0

I am running in Linux and I need to open another python script with a python script and in windows it was as easy as

import os
os.startfile(dir)

but now im in Linux it gives me

Traceback (most recent call last):
  File "/home/dev/PycharmProjects/pythonProject/vpn.py", line 1, in <module>
    os.startfile('main.py')
AttributeError: module 'os' has no attribute 'startfile'

what do I use to run files in Linux?

I'm using zorin os 16.1 (Ubuntu)

1 Answers1

0

Personally, I prefer to use os.system('python main.py'), since it is the same as just running the command python main.py from your command line

S6ad0w
  • 63
  • 5