

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do we use Python in script mode?
It is possible to execute Python script from command line. Python program can be written by any text editor (preferably a Python aware text editor) and saved with .py extension. To write basic Hello World program using IDLE, the Python IDE shipped with standard Python distribution, open the editor choosing File->New.
Example
Type following lines and save as test.py
#!/usr/bin/python Print (“Hello World”)
Execute the script using following command line
C:\users>python test.py
You can also run the script from Run Menu of IDLE file editor
- Related Questions & Answers
- How do we use Python in interactive mode?
- How do we display a script in HTML?
- How do we use double quotation in Python?
- Why do we use random.seed() in Python?
- Why do we use pandas in python?
- How do we use easy_install to install Python modules?
- How do we use Python Regular Expression named groups?
- How do we use re.finditer() method in Python regular expression?
- How do we use runOnUiThread in Android?
- How do we use jQuery selector eq:()?
- How do we use # in jQuery Attribute Selector?
- How do we use throw statement in JavaScript?
- How do we use file.readlines() to read multiple lines using Python?
- How do we use equivalence (“equality”) operator in Python classes?
- Why do we use re.compile() method in Python regular expression?
Advertisements