470,872 Members | 1,777 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,872 developers. It's quick & easy.

How to write and save program from Terminal

I am using ubuntu how I write my program from terminal to file and then how I open python file in terminal to run.
Where should be file saved
Oct 5 '12 #1
3 2508
2,851 Expert Mod 2GB
I can't help you with ubuntu, but in windows I use an interactive Python editor to create and run scripts. File management is something that is basic to your operating system and a matter of organization. I usually keep my "test" scripts in one subdirectory, finished scripts in another, and "packages" in unique subdirectories for each package. IDLE comes with Python. Have you tried it?
Oct 5 '12 #2
I am interested to Work with GEM5 so for that i am learning Python and the environment suits me is ubuntu
Oct 5 '12 #3
step 1:
1. open the terminal and type the below command.
nano myfile.py

2. Once you done this you have file opened in the name of myfile.py, then do all your programming stuff in the file.

3. Then press (ctrl+o) in the keyboard then your file will be saved.

4. Then press (ctrl+exit) , u will see the terminal again.

5. Now run the below command where the file reside
example: your file is in the Desktop
1. type below command

i.) cd /Desktop

ii.) python myfile.py

6. thats all you can see the output your program.
Dec 14 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Kevin | last post: by
10 posts views Thread by lorenzogordon | last post: by
10 posts views Thread by mistral | last post: by
1 post views Thread by Seid Mohammed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.