Python Forum
How to pass args to myprog.exe
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to pass args to myprog.exe
#1
I've Googled this but it's been a long day and maybe some kind soul will share some simple example code so I can get out of this chair for today :-)

I need simple examples of launching an external .exe file and passing it an argument or arguments?

I think you use subprocess and pOpen but I've yet to find a simple example for say the following...

If run from the command line...

# example 1 - launch a program and pass it some text as an argument
> myprog.exe arg1

# example 2 - launch a program and pass it a file
> vlc test.wav

# example 3 - launch a program and pass it some arguments and get the results
> set /a 2+3
> 5

How to do this from Python?

thanks for any help
Reply


Messages In This Thread
How to pass args to myprog.exe - by Fran_3 - Sep-04-2017, 12:54 AM
RE: How to pass args to myprog.exe - by metulburr - Sep-04-2017, 02:12 AM
RE: How to pass args to myprog.exe - by Fran_3 - Sep-04-2017, 11:11 PM
RE: How to pass args to myprog.exe - by metulburr - Sep-05-2017, 12:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to pass encrypted pass to pyodbc script tester_V 0 949 Jul-27-2023, 12:40 AM
Last Post: tester_V
Question How to compare two parameters in a function that has *args? Milan 4 1,419 Mar-26-2023, 07:43 PM
Last Post: Milan
  *args implementation and clarification about tuple status amjass12 10 4,210 Jul-07-2021, 10:29 AM
Last Post: amjass12
  [SOLVED] Good way to handle input args? Winfried 2 2,150 May-18-2021, 07:33 PM
Last Post: Winfried
  Two Questions, *args and //= beginner721 8 3,655 Feb-01-2021, 09:11 AM
Last Post: buran
  Pass by object reference when does it behave like pass by value or reference? mczarnek 2 2,635 Sep-07-2020, 08:02 AM
Last Post: perfringo
  does yield support variable args? Skaperen 0 1,726 Mar-03-2020, 02:44 AM
Last Post: Skaperen
  is there a way: repeat key word args Skaperen 2 2,307 Feb-03-2020, 06:03 PM
Last Post: Skaperen
  Pass by reference vs Pass by value leodavinci1990 1 2,275 Nov-20-2019, 02:05 AM
Last Post: jefsummers
  Using function *args to multiply multiple arguments allusernametaken 8 6,287 Nov-20-2019, 12:01 AM
Last Post: allusernametaken

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020