-3

My script helps me grab all urls from Bing when you type something. But the thing that it only works when I type one word to search about like this :

python test.py text

it doesn't work when I type :

python test.py text text
halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

1

Python arguments passed through the command line are separated by spaces. So your first command,

python test.py text

has one argument passed to it. Your second command,

python test.py text text

has two arguments due to the space in between them.

If you want to string multiple words together into one argument you have to place them inside quotes so it knows they are to be counted as one argument.

python test.py "Type whatever you want in here"
Dávid Laczkó
  • 1,091
  • 2
  • 6
  • 25
D1TTO
  • 115
  • 8