run python script from cmd with inputs -


i have written these lines of code input user:

uname=os.environ.get( "username" ) pwd = getpass.getpass() path=input("provide textfile input: " ) 

i want execute pythonapplication1.py cmd. please guide me.i using python 3.6.

i think want run program windows command line, need add python system path variable or change directory python's directory.

type python in cmd , press enter, if python comes up, path ok! can run program this:

python your_program_path/application1.py 

else if python wasn't in path, can add it: computer -> system properties -> advanced system settings -> environment variables or can change working directory python's directory:

cd c:\python_path 

and then:

python your_program_path/application1.py 

Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -