Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
python [2016/07/30 14:07]
nikolaj
python [2017/06/12 17:04] (current)
nikolaj
Line 22: Line 22:
  
 >input() >input()
 +
 +== Terminal args ==
 +<​code/​Python>​
 +from sys import argv as arguments
 +
 +
 +def get():
 +    return [(i, v) for i, v in enumerate(arguments)]
 +    # Add if i > 0 if you want to neglect the .py
 +
 +
 +def main():
 +    print("​\nHere is what main returns in pretty-print:"​)
 +    for index, arg in get():
 +        print(index,​ arg)
 +
 +
 +if __name__ == '​__main__':​
 +    main()
 +</​code>​
  
 === Discussion === === Discussion ===
Link to graph
Log In
Improvements of the human condition