Skip to main content

Linux how to make own linux command using python

this is post on how to make own linux command just like other linux odinary commands
just like cd , cp , apt-get , pacman etc. 
but we are using python because its easy to make thing happen in linux shell scripts but people have to also know how to done using other programming languages also.



so we are going to step by step.

1. First create a programme like programme.py

and enter this text

print"python"


2. then save it .

then open your terminal and type;

and now we will make .pyc file for already compiled file of python

python then 

also type 

import py_compile
py_compile.compile( "programme.py " )
exit()

and now copy in the folder in which you are there is a programme.pyc

now copy this programme.pyc to

/bin folder of linux

and then type in terminal programme.pyc
and then it will work !
and video tutorial is also available for this. so that you can learn perfectly.
if you have any question feel free to comment and feel free to email me.

this is my youtube channel : - youtube.com/kishan_joshi_robokishan


check that out for further videos. on android , arduino , linux , and more comming soon on one place. 



Comments

Popular posts from this blog

Python Reads gmail

This is tutorial on how to read gmail emails with python programme : ----------------- #!/usr/bin/python __author__ = 'Robokishan' import email import imaplib import ctypes import getpass mail = imaplib.IMAP4_SSL('imap.gmail.com',993) unm = raw_input("insert Email : ") #pwd = raw_input("insert password : ") pwd = getpass.getpass("input : ") mail.login(unm,pwd) mail.select("INBOX") def loop():    mail.select("INBOX")    n=0    (retcode, messages) = mail.search(None, '(UNSEEN)')    if retcode == 'OK':             for num in messages[0].split() :          #print 'Processing '          n=n+1          print n          typ, data = mail.fetch(num,'(RFC822)')          for response_part in data:             if isinstance(response_part, tuple): ...

How to make stoppable thread in python

Python multi threading: stoppable thread:     many of you heard about threading in python is very bad. its not easy to stop it but there are several method to do that thing happen .     so lets get started.     create file name called <filename>.py then paste this code in your text editor. import threading import time ##writer = Robokishan ##stopable thread class ThreadingExample(object):     """ Threading example class     The run() method will be started and it will run in the background     until the application exits.     """     #NOTE: STOPING THREAD IS BAD METHOD     def __init__(self, interval=1):         """ Constructor         :type interval: int         :param interval: Check interval, in seconds       ...

All Android Manifest permissions

<uses-permission android:name="android.permission.ACCESS_CACHE_FILESYSTEM"/> <uses-permission android:name="android.permission.ACCESS_CHECKIN_PROPERTIES"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY"/> <uses-permission android:name="android.permission.ACCESS_DRM_CERTIFICATES"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FM_RADIO"/> <uses-permission android:name="android.permission.ACCESS_IMS_CALL_SERVICE"/> <uses-permission android:name="android.permission.ACCESS_INPUT_FLINGER"/> <uses-permission android:name="android.permission.ACCESS_KEYGUARD_SECURE_STORAGE"/> <uses-permission android:name="an...