Python 3 Programming Tutorial – Sys Module

///Python 3 Programming Tutorial – Sys Module

Python 3 Programming Tutorial – Sys Module

FavoriteLoadingAdd to favorites

This video covers some of the basics to the sys module in Python 3. The sys module allows you to use stdin() and stdout(), as well as stderr()… but, most interestingly, we can utilize sys.argv(). To many this is a confusing concept, but it is pretty simple and very useful once you learn it. The idea of sys.argv is to allow you to pass arguments through to Python from the command line.

This ability acts as a bridge to the ability to communicate between Python and other languages.

Sample code for this basics series:

Python 3 Programming tutorial Playlist:

Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6


By |2019-06-24T20:11:25+00:00June 24th, 2019|Python Video Tutorials|22 Comments


  1. Hasham Baig June 24, 2019 at 8:11 pm - Reply

    Understood everything except for the last code. It just went over my head.

  2. Patrice Saunders June 24, 2019 at 8:11 pm - Reply

    If anyone is going through from now, in windows 10 the command prompt option will not show when right-clicking the folder. So search "Add 'Open Command Window Here' to Windows 10 Context Menu" and there will be a website called ITProToday that has detailed steps in making it appear, it's a bit complicated but not too long.

  3. Sachin Jha June 24, 2019 at 8:11 pm - Reply

    Why do u still use Windows??

  4. Dallas Kappel June 24, 2019 at 8:11 pm - Reply

    Please make new videos sir I like your tutorials

  5. A Jim Fan June 24, 2019 at 8:11 pm - Reply

    I put in 5 but it was invalid syntax

    My code is:
    import sys

    sys.stderr.write('This is stderr textn')
    sys.stdout.write('This is stdout textn')

    #prints all arguments

    if len(sys.argv) > 1:

  6. S م June 24, 2019 at 8:11 pm - Reply

    what about sys.stdout? how ca you use it?

  7. Omar Abdelkader June 24, 2019 at 8:11 pm - Reply

    Harrison, you're such a SYS-sy


    Edit: what has the world become for this to get a like? but thanks anyway!

  8. Minespidur June 24, 2019 at 8:11 pm - Reply

    I'm only given the option to open "Powershell" and not command prompt. How can I enable command prompt? Btw thanks so much for these tutorials!

  9. John G June 24, 2019 at 8:11 pm - Reply


  10. John Smith June 24, 2019 at 8:11 pm - Reply

    it would seem; the more one knows about computing, the less one is able to use a microphone.

  11. FeralOnrush June 24, 2019 at 8:11 pm - Reply

    at first I didn't understand and skipped but came back after watching the next videos and now I don't really understand why I skipped this in the first place xD

  12. Vivek Pant June 24, 2019 at 8:11 pm - Reply

    all other were useful but not this one. What happened!! I am a beginner

  13. I Wish I had Social Skills June 24, 2019 at 8:11 pm - Reply

    what about from sys import exit????

  14. mallikarjuna srikantam June 24, 2019 at 8:11 pm - Reply

    why we should use the sys module in python?

  15. D3n N3sm June 24, 2019 at 8:11 pm - Reply

    wordpress sucks.

  16. Konrad June 24, 2019 at 8:11 pm - Reply

    I was confusing until I run the code myself: python SomeArgument in cmd. It gets you a list you have access to and play around with coming from cmd, and accessible elsewhere.

  17. kabonk olidenzo June 24, 2019 at 8:11 pm - Reply

    i have problem in my codes when i try to get an output it's came with this { } None
    this is my fonction which is in tkinter:

    def recognaze():
    proc = Popen("", stdout=PIPE,stdlshell=True)
    proc = proc.communicate()
    output.insert(END, proc)

  18. smriti das June 24, 2019 at 8:11 pm - Reply

    i don't know if you still read the comments and respond, but could you elaborate and add videos related to the stuff you said about communication between PHP and python?

  19. Shailaja Yadav June 24, 2019 at 8:11 pm - Reply

    do u have videos on data structure and algorithm??

  20. Joseph Smith June 24, 2019 at 8:11 pm - Reply

    am i right in thinking that sys.argv and sockets modules may be used in conjunction to make a simple shell of sorts?

  21. MD. JUBAER HOSSAIN June 24, 2019 at 8:11 pm - Reply

    Could you please show how you communicate with php with python using sys.argv ? A basic example would suffice 🙂

  22. sidra Aleem June 24, 2019 at 8:11 pm - Reply

    @sendtex what is the difference between print function and stderr and stdout??

Leave A Comment