473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 2633
bvdet
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

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

Similar topics

6
by: haynesc | last post by:
Hi, I'm having a problem where when trying to open a file in write mode, I get an IOError stating no such file or directory. I'm calling an external program which takes an input file and...
2
by: Kevin | last post by:
i have a python file called pyq which outputs stock quotes, currently i also have a html file that takes stock ticker inputs, i would like to bridge the two by building another program that takes...
10
by: lorenzogordon | last post by:
Hi there, I'd greatly appreciate any insights into the following problem: I've got PHP running fine on IIS (OS: Server 2003, SP1; IIS: 6.0; PHP: 4.3.11). In PHP, the user uploads a file,...
10
by: mistral | last post by:
I have installed ActivePython http://www.activestate.com/Products/ActivePython/ How I can run Python file, test.py?
4
by: Michael Malinowski | last post by:
Is there a way to read the directory that the currently running python file is located in? Cheers Mike.
2
by: yinglcs | last post by:
How to modify the source of a python file inside a python egg file? I can see the file by unzipping it, but how can I package it back as a python egg file after my modification. Thank you.
1
by: jtertin | last post by:
I am currently using the following code to make sure a file is writable (i.e. is not in use) by using the CanWrite method of the FileStream object. Using the code below, the TextWriter is still...
3
by: yinglcs | last post by:
Hi, i have 2 python files in *different directory* , how can I import python functions from 1 python file to another? i get this error: import task ImportError: No module named task/ Thank...
2
by: sophie_newbie | last post by:
Hi, I'm wondering if there is a way to get a python script to write text to an input box in a window of another program that is running? For example a text box in a web browser window? Thanks!
1
by: Seid Mohammed | last post by:
Greetins all 1. I can easily run python file from a comand prompt just typing "python filname.py". How can I do this from the python IDLE shell 2. How to create EXE in python. thanks all for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.