pastebin - collaborative debugging tool
python.kpaste.net RSS


EasyOptionsArgs
Posted by Anonymous on Mon 12th Apr 2021 18:07
raw | new post
view followups (newest first): IfNotFoundDo by Anonymous

  1. #!/usr/bin/python3
  2. import sys
  3.  
  4. def easyOptionsArgs(lookingFor,theArgs):
  5.     n = len(theArgs)
  6.     theValue=""
  7.     for i in range(1, n):
  8.         if (sys.argv[i].startswith(lookingFor)):
  9.             theValue=sys.argv[i].split("=")
  10.             return theValue[1:][0]
  11.     return theValue
  12.  
  13.  
  14. def main():
  15.     InFileName = easyOptionsArgs("-f",sys.argv)
  16.     print("InFileName",InFileName)
  17.  
  18. if __name__ == "__main__":
  19.     main()

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at