0

How would I pass in an input file to a Python script from the command line, like this:

python mycode.py inputFile inputParameter

ArtOfWarfare
  • 20,617
  • 19
  • 137
  • 193
user2916464
  • 491
  • 2
  • 8
  • 16
  • Initially I couldn't understand what this was asking so I raised a flag, but after rereading it several times, I think I was able to find out what the person was asking. I heavily edited what was here to reflect what I think their real question was. I suspect this should be closed as a duplicate, perhaps of this question: http://stackoverflow.com/questions/1009860/command-line-arguments-in-python – ArtOfWarfare Oct 30 '14 at 23:22

1 Answers1

0

If you are trying to read it in python:

f = open('workfile', 'r')
ArtOfWarfare
  • 20,617
  • 19
  • 137
  • 193
Nathan M
  • 171
  • 1
  • 6
  • @Dave - This certainly isn't a new question. It may be a request for clarification from the author like Simone suggested. The question isn't even remotely clear though. – ArtOfWarfare Oct 30 '14 at 23:18
  • My mistake i flagged incorrectly when i was going through the flag system. Thanks for alerting me :) @ArtOfWarfare – Sir Oct 30 '14 at 23:22