Python Forum
Not all data returned from sys.argv
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not all data returned from sys.argv
#2
example (file tmp.py)

import sys

if __name__ == '__main__':
    print(len(sys.argv))
    print(sys.argv[0])
    print(sys.argv[1])
    print(sys.argv[2])
start with:

python3 tmp.py first second

Output:
3 tmp.py first second
Reply


Messages In This Thread
Not all data returned from sys.argv - by ecdhyne - Sep-05-2019, 05:21 PM
RE: Not all data returned from sys.argv - by Axel_Erfurt - Sep-05-2019, 08:09 PM
RE: Not all data returned from sys.argv - by buran - Sep-05-2019, 08:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to access values returned from inquirer cspower 6 913 Dec-26-2023, 09:34 PM
Last Post: cspower
  How do I call sys.argv list inside a function, from the CLI? billykid999 3 841 May-02-2023, 08:40 AM
Last Post: Gribouillis
  sys.argv method nngokturk 3 1,149 Jan-23-2023, 10:41 PM
Last Post: deanhystad
  SQLAlchemy Object Missing when Null is returned Personne 1 1,797 Feb-19-2022, 02:50 AM
Last Post: Larz60+
  Getting "name 'get_weather' is not defined error and no json_data returned? trthskr4 6 3,729 Sep-14-2021, 09:55 AM
Last Post: trthskr4
  Libraries installed with pipenv, but ModuleNotFoundError returned jpncsu 2 3,080 Sep-06-2021, 07:24 PM
Last Post: jpncsu
  import argv Scott 3 5,967 Apr-01-2021, 11:03 AM
Last Post: radix018
  Exception: Returned Type Mismatch Error devansing 1 5,224 Mar-06-2020, 07:26 PM
Last Post: ndc85430
  How to use a returned value? t4keheart 12 5,026 Jan-16-2020, 06:54 AM
Last Post: perfringo
  Strange Characters in JSON returned string fioranosnake 4 5,294 Dec-02-2019, 07:25 PM
Last Post: fioranosnake

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020