running a python program + naming a file as input in command prompt Watch

EmergencyBagels
Badges: 18
Rep:
?
#1
Report Thread starter 2 years ago
#1
hello
i need to be able to run a program from command prompt (so i have all my functions in that program) BUT pass the argument to it from a different file like this:

python programName.py file.txt

so that the function in programName.py runs using file.txt as an argument

how do you do this?
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts

All the exam results help you need

1,478

people online now

225,530

students helped last year
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

University open days

  • Sheffield Hallam University
    Clearing open day Undergraduate
    Tue, 20 Aug '19
  • Bournemouth University
    Clearing Open Day Undergraduate
    Wed, 21 Aug '19
  • University of Dundee
    Undergraduate Open Day Undergraduate
    Mon, 26 Aug '19

Are you going to self-release into Clearing?

Yes I've pressed the button (76)
17.31%
No I'm happy with my uni offer (281)
64.01%
Not yet but I am planning to (21)
4.78%
Not yet but I might (61)
13.9%

Watched Threads

View All