How do I send arguments to a function by using windows command prompt?
mahela007
6
Posting Whiz in Training
Recommended Answers
Jump to PostYou can play with this ...
# test Python command line arguments import sys if (len(sys.argv) >= 2): # skip sys.argv[0] commandline_args = sys.argv[1:] print( commandline_args ) raw_input("Press Enter to go on ...") # wait """my output for args 1 2 3 --> ['1', '2', '3'] """
All 4 Replies
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
mahela007
6
Posting Whiz in Training
jlm699
320
Veteran Poster
mahela007
6
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.