Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The difference between sys.argv & argv?

I don't understand the difference between sys.argv and just argv, Nothing online gives me the concept that I understand. if both are the same! When do we use sys.argv and when to use argv ?

if not what is the sys.argv. I've idea what is the argv.

like image 756
amrx Avatar asked Mar 27 '26 18:03

amrx


1 Answers

They're the same thing, it just depends on how you write the import statement.

import sys

If you write this, then you must reference sys.argv.

from sys import argv
from sys import *

If you write either of those, then you can write simply argv without the sys. qualifier.

like image 183
John Kugelman Avatar answered Apr 02 '26 16:04

John Kugelman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!