![]() You can add multiple file type choices for the dropdown selection by adding new description and file type pairs separated with the pipe character. The first part is the description of the format that is shown on the file selector dialog, and the second part is the file type that should be matched. I’m only using the wildcard setting which accepts a wildcard string that matches the wxPython FileDialog wildcard format which uses the pipe character | as a separator. The value should be a dictionary mapping of the desired widget specific settings. Some widgets accept additional parameters that can be passed in by using the gooey_options argument. Gooey_options= dict(wildcard= "MPEG-4 (.mp4)|*.mp4")Ĭonvert(args.input_file, args.output_file) ![]() Gooey_options= dict(wildcard= "Video files (*.mp4, *.mkv)|*.mp4 *.mkv") Program_description= "Convert between different video formats",Ĭonverter = parser.add_argument_group( "Video Converter") I’m using Windows but you probably already know how this works in your own environment.įirst, let’s create the requirements.txt "Video Converter", Setting up the environmentĪs always, the first step is to set up the Python virtual environment. It’ll also make it easier to expand the project later on if new features are required. ![]() So, looking at the ffmpeg command here’s what we need:Įven though the ffmpeg call is super simple I’ll be also using the ffmpeg-python package to handle the execution instead of directly using Python’s built in subprocess because this reduces the amount of code that I need to write. The starting point needs to be an application that uses the argparse module to parse command line arguments. Something to GUI’izeįirst we’ll need to build the script that we want to create the GUI for. You can also find the code from my GitHub repository. ![]() I thought that this might actually be the perfect opportunity to try out Gooey, create a useful utility for myself, and write an article about it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |