0

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

1 Answers1

1

it seems the warning because unproper path writing as you expected therefore you have to take care if these notes

  • path separator differs on operation system. Windows uses backslash \, Linux&Mac use slash /
  • in windows Desktop folder lies on C:\\Users\[username]\Desktop, on linux /home/[username]/Desktop
  • you can use os.path package to handle paths os.path.join

Tip drag the script file into your terminal to get the absolute path located on your file system