Home Linux how to write a python file without an IDE
Reply: 2

Linux how to write a python file without an IDE

Tree Garen
1#
Tree Garen Published in 2018-01-13 03:43:13Z
  1. Make a copy of a computer python file you wrote for some other course without an IDE just a simple text editor

  2. Modify this program slightly, without using an IDE.

  3. Run the modified program, without using an IDE

How do I create a python file with linux?

Oleg Somov
2#
Oleg Somov Reply to 2018-01-13 03:58:45Z

To create a python file using Linux use command touch to create a file(will create a file in current directory, to know the current directory use cd command)

touch myfile.py

Open the file using one of the available text editors, for example vi:

vi myfile.py

Type your code and use command :wq to save and close the file.

a=2
b=3
print a+b

Run your code using python command:

python myfile.py
5  #output

To check or install Python on Linux, please refer to AWS detailed instructions: LINK

To get more instructions on using vi editor: LINK

Seenivasan
3#
Seenivasan Reply to 2018-01-13 04:04:28Z

It is as usual with writing c programs and others. No difference at all. If you are familiar with linux command line you can use command line text editors. Otherwise use gedit , sublime text,vs code,atom..etc (all are text editors with GUI) just as you use a notepad in windows.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.522347 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO