Horje
pass argument to a py file Code Example
pass argument to a py file
import sys

def hello(a,b):
    print "hello and that's your sum:", a + b

if __name__ == "__main__":
    a = int(sys.argv[1])
    b = int(sys.argv[2])
    hello(a, b)
# If you type : py main.py 1 5
# It should give you "hello and that's your sum:6"




Python

Related
get variance of list python Code Example get variance of list python Code Example
python module for converting miles to km Code Example python module for converting miles to km Code Example
pytesseract.pytesseract.TesseractError: (2, 'Usage: pytesseract [-l lang] input_file') Code Example pytesseract.pytesseract.TesseractError: (2, 'Usage: pytesseract [-l lang] input_file') Code Example
mongodb python get all documents Code Example mongodb python get all documents Code Example
pandas select column by index Code Example pandas select column by index Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8