well, i'm trying to execute a python file in a new terminal. I've tried several thing, no result. I read this Execute terminal command from python in new terminal window? So i tried
subprocess.call(['gnome-terminal', '-x', 'python /root/Desktop/Script/website/bb.py'])
it opens me a new terminal but it says me "no such file or directory". i've tried differents paths without results.
What i'm doing wrong ?
Thanks i
it seems the warning because unproper path writing as you expected therefore you have to take care if these notes
\\
, Linux&Mac use slash /
C:\\\\Users\\[username]\\Desktop
, on linux /home/[username]/Desktop
os.path.join
Tip drag the script file into your terminal to get the absolute path located on your file system
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.