3
I’m making a terminal and I have a question, how do I remove the user name behind the message?
exemplo: "C:/USERS/GUSTAVO/DESKTOP"
How do I leave:
example: "DESKTOP"
I’m using the OS library to get the directory.
Code:
import so
import sys
import platform
diretorio = os.path.dirname(os.path.abspath(__file__))
print(diretorio)
It didn’t work, buddy...
– Ghost Designer
do you want to leave the last folder in the variable directory? I guess I didn’t get it right
– Davi Wesley
Yes, as you can see in the example, there are other folders ( users,.
– Ghost Designer
"C:/USERS/GUSTAVO/DESKTOP" this would look like "C:/USERS/DESKTOP"?
– Davi Wesley
That’s right, I await answer <3
– Ghost Designer
Solved, that code you updated, but you did not warn me solved poblema. Thanks! + 1
– Ghost Designer