0

The title says it all. Is there a way so I input

input("")

They input

dbs -U thebos123 -P pw.txt

Then store thebos123 into a variable but not the rest

Dinesh Pundkar
  • 4,160
  • 1
  • 23
  • 37
Toozyne
  • 31
  • 5

1 Answers1

1

If it's always the third word, you can get it this way.

line = raw_input("Some input please: ")  # or `input("Some...` in python 3
splitline = line.split(" ");
var = splitline[2]
print var

Test

python pyprog.py 
Some input please: dbs -U thebos123 -P pw.txt
thebos123
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424