Python Tutorial – 25. Command line argument processing using argparse

///Python Tutorial – 25. Command line argument processing using argparse

Python Tutorial – 25. Command line argument processing using argparse

FavoriteLoadingAdd to favorites

Video without background music:

This tutorial shows how to pass command line arguments to python script.
Code used in this tutorial:

Next Video:
Python Tutorial – 25. Command line argument processing using argparse:

Website:
Facebook:
Twitter:
Patreon:

source

By |2019-10-27T23:37:41+00:00October 27th, 2019|Python Video Tutorials|41 Comments

41 Comments

  1. codebasics October 27, 2019 at 11:37 pm - Reply

    Video without background music: https://youtu.be/OxpBMNalsDM

  2. Mario Chiadika October 27, 2019 at 11:37 pm - Reply

    Please does argsparse work on Jupyter notebook

  3. Sanu Kurien October 27, 2019 at 11:37 pm - Reply

    Love how you thought of everything. While watching this I was thinking, but how will I debug this using pycharm, and then at the very next moment, you mentioned it. You are a genius.

  4. yomajo October 27, 2019 at 11:37 pm - Reply

    Besides help, are there any more functionality benefits versus sys.argv[1] to accept the input? Seems to be WAY MORE straight forward to accept user input from cmd.

  5. Thiyagarajan Paramadayalan October 27, 2019 at 11:37 pm - Reply

    came here after reading quite a few web pages. this is the best explanation, kudos!

  6. Lol Then October 27, 2019 at 11:37 pm - Reply

    no switch-case for you today?

  7. Suresh Kumar October 27, 2019 at 11:37 pm - Reply

    What kind of Editor / Framework, you are using to work with python?

  8. Abhinayaa Raja October 27, 2019 at 11:37 pm - Reply

    how to set those script parameters using normal python IDLE

  9. Uet Y October 27, 2019 at 11:37 pm - Reply

    how can i do the command prompt thing inside of the code

  10. Sanjay Krish October 27, 2019 at 11:37 pm - Reply

    Love you man.. awesome

  11. loveusoc October 27, 2019 at 11:37 pm - Reply

    This is great!!! Thank you

  12. Ankush Kumar Gupta October 27, 2019 at 11:37 pm - Reply

    Sala background me lagta hai B-Grade movie ka Music Chala diya ho

  13. Raghavendra Adiga October 27, 2019 at 11:37 pm - Reply

    Python is easy language as you've told. But making it easy to learn, you did a fantastic job.

  14. H G October 27, 2019 at 11:37 pm - Reply

    your videos are great, but they tend to make people sleepy , try to put some "energy" in your delivery.

  15. Mohamed Hamam October 27, 2019 at 11:37 pm - Reply

    Your Classes are the best I have ever watched. amazing way of explaining your points. I have Never seen anyone matching you. Many Many thanks for the amazing contents.

  16. Naresh Reddy October 27, 2019 at 11:37 pm - Reply

    what is the diff bw system.argv[ ] and argparse

  17. Nitesh Singh October 27, 2019 at 11:37 pm - Reply

    Very nice explanation, that I couldn't even get on pythonprogramming.net

  18. Edwin S October 27, 2019 at 11:37 pm - Reply

    lose the annoying music next time please….

  19. stack_psycho October 27, 2019 at 11:37 pm - Reply

    OK. I know what is the use of __name__='__main__'
    But I don't clearly understand why did you implement that method in this script at the beginning!!

  20. Anubhav Agarwal October 27, 2019 at 11:37 pm - Reply

    what is the use of this? why not take input in the program normally? I am new to python so please excuse my ignorance to the topic. Thanks

  21. Tonya Sims October 27, 2019 at 11:37 pm - Reply

    You are an amazing teacher!

  22. Kaustubh Deshpande October 27, 2019 at 11:37 pm - Reply

    Very helpful! Thank you! ๐Ÿ™‚

  23. Birobrata Deb October 27, 2019 at 11:37 pm - Reply

    extremely useful

  24. Hiimaanshuuu Kandwal October 27, 2019 at 11:37 pm - Reply

    Good vid dude

  25. STEPHAN FEIBISH October 27, 2019 at 11:37 pm - Reply

    I've upvoted every of your videos I've had the pleasure of viewing. If you don't know already, you have to turn up the volume to hear the videos on YouTube. The problem arises when your video finishes and YouTube plays an ad, which comes in way too loud.

  26. Avi Alexandru October 27, 2019 at 11:37 pm - Reply

    Very helpful. I saw more videos until yours and you nailed it! thanks a lot.

  27. tanushree gautam October 27, 2019 at 11:37 pm - Reply

    Thanks for the Video man..
    It really helped me..

  28. Duha Hassan October 27, 2019 at 11:37 pm - Reply

    Thank you so much man you are amazing๐Ÿ‘๐Ÿ‘

  29. adigun Orlami October 27, 2019 at 11:37 pm - Reply

    And also on my pycharm community version i keep seeing this message :
    (you need to manually configure HiDPI on window). any help will be appreciated. Thanks

  30. adigun Orlami October 27, 2019 at 11:37 pm - Reply

    HELLO EVERYONE PLS I NEED HELP TO THIS ERROR ON MY COMMAND PROMPT 'python' is not recognized as an internal or external command,
    operable program or batch file. THANKS

  31. Philipp Grafendorfer October 27, 2019 at 11:37 pm - Reply

    thank you. this was very helpful

  32. booboo October 27, 2019 at 11:37 pm - Reply

    music is distracting. can't hear what you 're talking about

  33. Kostas Nikolouts October 27, 2019 at 11:37 pm - Reply

    @codebasics What are the benefits of using it and when should we use this?

  34. Vivek sahoo October 27, 2019 at 11:37 pm - Reply

    Thanks for this video. Could you explain what is the difference between -number1 and –number1 in optparse module and also what is the use of dest and callback in that module.

  35. Deep Sukhwani October 27, 2019 at 11:37 pm - Reply

    Distracting music, but a good refresher on argparse module. Some points:
    * use type argument to add_argument rather than typecasting to int at a later stage
    * In PyCharm you do not compulsorily need to specify arguments in the Run Configuration, instead you can open a Python Terminal and run it from there as you would run from Terminal (Opt+F12 on Mac)

  36. Ashok Gujjuri October 27, 2019 at 11:37 pm - Reply

    Thanks for excellent videos

  37. Nikolaos Moraitis October 27, 2019 at 11:37 pm - Reply

    Thanks dude.

  38. Prateek Khera October 27, 2019 at 11:37 pm - Reply

    Hi, What text editor are you using. Is it some IDE I have a hard time find an IDE that has auto-intellisense with python. Please let me know any IDE or editor that has auto intellisense. Thanks!!

  39. Mark Schwartz October 27, 2019 at 11:37 pm - Reply

    Excellent introduction to argparse!

  40. Oleh Bedrenko October 27, 2019 at 11:37 pm - Reply

    I thought about switch operator when we compare same variable multiple times in the code but I can't see it in documentation. If it's missing then is there another way to simplify if .. elif construction when you have to compare same variable multiple times? Thank you.

  41. David Peleg October 27, 2019 at 11:37 pm - Reply

    i must say at first i thought the background music will be extremely distracting but it turns out it really helps concentrating.
    great tutorial!

Leave A Comment

*