Python provides a getopt module that helps you parse command-line options and arguments. $ python test . py arg1 arg2 arg3 The Python sys module provides access to any command-line arguments via the sys.argv . This serves two purposes − sys.argv is the list of command-line arguments. len(sys.argv) is the number of command-line arguments. Here sys.argv[0] is the program ie. script name. Example Consider the following script test.py − #!/usr/bin/python import sys print 'Number of arguments:' , len ( sys . argv ), 'arguments.' print 'Argument List:' , str ( sys . argv ) Now run above script as follows − $ python test . py arg1 arg2 arg3 This produce following result − Number of arguments: 4 arguments. Argument List: ['test.py', 'arg1', 'arg2', 'arg3'] NOTE − As mentioned above, first argument is always script name and it is also being counted in number of arguments. Parsing Command-Line Arguments Python provided a ge...
Posts
Showing posts from September, 2020
Python
- Get link
- X
- Other Apps
Why to Learn Python? Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed to be highly readable. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages. Python is a MUST for students and working professionals to become a great Software Engineer specially when they are working in Web Development Domain. I will list down some of the key advantages of learning Python:
- Get link
- X
- Other Apps
What is Tableau? Tableau is the fastest growing data visualization software that is used for data science and business intelligence aims to help people to see and understand data. In order to transform the way people use data to solve problems, tableau software ensures to converts raw data into a very easily understandable format. Tableau Software is an American computer software company headquartered in Seattle, WA, USA. It generates interactive data visualization products which focused on BI. The company was established at Stanford University’s Department of Computer Science between 1997 and 2002. Tableau Product Family / tableau offering The different products which tableau has built are 1. The Tableau Desktop: It is a self service business analytics and data visualization that anyone can use. It translates pictures of data into optimized queries. With tableau desktop, you can directly connect to data from your data warehouse for live up ...