Learn Python Training from the Best Tutors
Search in
sys: system; arg: argument; v: variable
sys.argv is a list which contains the command line argument.
How it is used:
Lets assume you want to run a python program file saved with name kiran.py
which adds two number input to it from the command line, in that case you can open the command prompt/anaconda prompt,
> python kiran.py 1 2
you will get 3 as the result
>> 3
The code in kiran.py
import sys
print(sys.argv[1]+sys.argv[2])
Note --- here sys.argv will be ['kiran.py',1,2] i.e. first element is always filename/path
read less
Related Questions
Hi i am vishnu. I did my Post Diploma in Tool design after DME and am now working in an MNC as contract base which will be completed on April 2020. Now i am in search of a job and i want to know any other courses like PYTHON or SAP which is best as i am not having any job opportunities in my domain. Please suggest a course and tell me whether I can do it or not as I only hold a Diploma degree
Thankyou
Who can learn the Python?
I have passed Btech Electronics and Communication in 2015 and as you all know in ECE there is little knowledge of programming. And i want to learn Python from scratch. How much time it'll take to get a job after learning Python.
Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com
Ask a QuestionRecommended Articles
Top 5 reasons why you should learn Python
Python is one of the most popular programming languages in the world. It is general-purpose, object oriented, high-level programming language used in a number of programming fields. Python is a great programming language to learn as it will introduce you to the world of programming. If you are from the technical background...
Learn Microsoft Excel
Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...
Make a Career in Mobile Application Programming
Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...
8 Hottest IT Careers of 2014!
Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...
Looking for Python Training classes?
Learn from the Best Tutors on UrbanPro
Are you a Tutor or Training Institute?
Join UrbanPro Today to find students near youThe best tutors for Python Training Classes are on UrbanPro
The best Tutors for Python Training Classes are on UrbanPro