Python Forum
Get anything before arguments
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get anything before arguments
#1
I understand how to retrieve arguments from any user input from powershell. However, I want to get what exactly was typed before arguments. For example, for the command entered by user: py myscript.py, I should print/retrieve py.

Similarly for user input python myscript.py, I should print/get python ?
Reply


Messages In This Thread
Get anything before arguments - by Robotguy - May-17-2021, 11:16 PM
RE: Get anything before arguments - by BashBedlam - May-18-2021, 02:01 AM
RE: Get anything before arguments - by Robotguy - May-18-2021, 11:17 PM
RE: Get anything before arguments - by BashBedlam - May-19-2021, 01:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Functions (Arguments Passing,Changing a mutable ,Assignment to Arguments Names) Adelton 2 4,025 Mar-02-2017, 10:23 PM
Last Post: zivoni

Forum Jump:

User Panel Messages

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