By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,706 Members | 1,264 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,706 IT Pros & Developers. It's quick & easy.

How to write and save program from Terminal

P: 3
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
Share this Question
Share on Google+
3 Replies

bvdet
Expert Mod 2.5K+
P: 2,851
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

P: 3
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

P: 6
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.