Create and Run Python Script in Linux Command Line
- cd scratch
- mkdir new_folder
- cd new_folder
- touch test.py
- vi test.py
- Press "i" - this will open the file in edit mode
- Enter below lines :
#! /usr/bin/python
print('Hello, world!') - Press "esc"
- type ":wq!" without quotes
- chmod a+x test.py
- ./test.py
No comments:
Post a Comment