Showing posts with label at command prompt. Show all posts
Showing posts with label at command prompt. Show all posts
Create your own commands and run in linux terminal using python
Using python you can create your own commands and run it using linux terminal. The steps are : -
1. Create a simple pragram like hello world . with the location of the python interpretor .
(For eg) : #!/usr/bin/python
# Filename : myfirstprogram.py
print "This is my FirstProgram !"
here # - is used as comment
And the line follwed with the symbols #! - is known as shebang line , This is used to tell the linux system that this program should run with that interpretor at the destination.
Now give the excecute permission using:
$ chmod a+x myfirstprogram.py
then run using
$./myfristprogram.py
o/p : This is my FirstProgram !
Then rename this program as myfirstprogram and it will still run when you excecute using terminal.
Now give the command $ echo $ path
/home/usr/bin:
you will get the location of the environment variable.
Now paste the program file in that location. And run the myfirstprogram in terminal it will run. You can now run this program from any location
Subscribe to:
Posts (Atom)
Labels
A simple apps in django
(1)
at command prompt
(1)
Change volume to maximum in linux
(1)
Creating a simple cms in django
(1)
database
(1)
Django
(2)
Django simple program
(1)
Fedora
(2)
FIND SYSTEM PATH
(1)
how to create a logo
(1)
How to Find A Program installed directory in Linux
(1)
Increase sound in fedora 14
(1)
Inkscape Vs Gimp
(1)
install libre office in fedora 15
(1)
Linux
(3)
Linux Essentials
(1)
MySQl Python installation
(1)
object oriented design
(1)
program installed location
(1)
Python
(2)
python in windows
(1)
python os module
(1)
Raster Images vs Vector Images
(1)
RGB vs CMYK
(1)
Simple Python Programs
(5)
simple website development with python
(1)
Sqlite installed location
(1)
to delete a file permanently in linux
(1)
website development
(1)
windows
(18)
|
|
