Not just opening some file automatically, that's easy. I want to know how to make a "enter program" function and it opens the program
My current code is this:
Code:
g='Prime Number Finder'
i=import program1
program1 = prime_numbers.py.environ.get('Prime_numbers')
if program1 and prime_numbers.path.isfile(filename):
execfile(prime_numbers.py)
print 'Programs available:'
print '1.', g
a=int(raw_input("Enter the program number: "))
while True:
ok = raw_input(prompt)
if ok in ('1'):
return i
while True:
pass
But I get a syntax error saying
Code:
i=import program1
^
SyntaxError: invalid syntax
How do I fix it?
--Additional Info--
*the file I'm trying to open is named prime_numbers.py
**prime_numbers.py is in a folder that run.py(the code above) is not in