Python Forum
Adding a parameter/argument to a script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding a parameter/argument to a script
#11
(Jan-29-2018, 12:32 AM)jehoshua Wrote: ..short and simple
I don't think you need the type=argparse.FileType('br') parameter because you are only interested in the file's name. If you remove it, you can write directly AUDIO_FILE = args.filename
Reply
#12
(Jan-29-2018, 06:53 AM)Gribouillis Wrote: I don't think you need the type=argparse.FileType('br') parameter because you are only interested in the file's name. If you remove it, you can write directly AUDIO_FILE = args.filename

Thanks, that worked fine. :)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [ERROR] ParamValidationError: Parameter validation failed: Invalid type for parameter gdbengo 3 11,085 Dec-26-2022, 08:48 AM
Last Post: ibreeden
  Adding a Wake word to my Script Extra 9 3,119 Jan-16-2022, 10:46 AM
Last Post: SheeppOSU
  Adding a list to Python Emailing Script Cknutson575 4 2,319 Feb-18-2021, 09:13 AM
Last Post: buran
  SyntaxError: positional argument follows keyword argument syd_jat 3 5,844 Mar-03-2020, 08:34 AM
Last Post: buran
  Adding markers to Folium map only adding last element. tantony 0 2,129 Oct-16-2019, 03:28 PM
Last Post: tantony
  Help needed adding a certain Argument StrongHandsDeepPockets 3 3,700 Apr-29-2018, 05:57 PM
Last Post: j.crater
  help with a script to determine length of an argument roadrage 9 8,516 Nov-02-2016, 06:02 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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