+ 15

What is the sys module ?

What is it used for? and can it be used on the SLCP(sololearn code playground)

21st Jul 2018, 5:05 PM
LONGTIEšŸ‘”
LONGTIEšŸ‘” - avatar
6 Answers
+ 6
From Google. sysĀ ā€” System-specific parameters and functions. ThisĀ moduleĀ provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter. It is always available. ... A tuple of strings giving the names of allĀ modulesĀ that are compiled into this Python interpreter.
22nd Jul 2018, 2:56 AM
Maninder $ingh
Maninder $ingh - avatar
+ 15
Well the sys module allows user to use stdin() and stdout(), as well as stderr(), but we can also utilize sys.argv(). 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.
23rd Jul 2018, 8:21 AM
Shaif Jwd
Shaif Jwd - avatar
+ 5
Try this code: import sys If it works without errors (and it does) you can use it. More information can be found here: https://docs.python.org/3/library/sys.html
21st Jul 2018, 6:03 PM
Paul
Paul - avatar
21st Jul 2018, 8:15 PM
Nicolass22
Nicolass22 - avatar
+ 2
import sys and import os
22nd Jul 2018, 7:22 PM
šŸ…æļøĀ®ļøā­•ļø_eāœ–ļøe
šŸ…æļøĀ®ļøā­•ļø_eāœ–ļøe - avatar
+ 2
whenever you want to find more about a certain module just import it, and then call dir() and help(). python -c "import sys; dir(sys);help(sys)"
24th Jul 2018, 11:13 PM
dejanualex
dejanualex - avatar