Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@Gooey(progress_regex=r"^progress: (-?\d+)%$",
disable_progress_bar_animation=True)
def main():
parser = GooeyParser(prog="example_progress_bar_1")
_ = parser.parse_args(sys.argv[1:])
print("Step 1")
for i in range(1, 101):
print("progress: {}%".format(i))
sys.stdout.flush()
sleep(0.05)
print("Step 2")
print("progress: -1%") # pulse
sys.stdout.flush()
@Gooey(program_name="quickpack")
def pyinstaller_main():
parser = GooeyParser(
description="pack your python file")
parser.add_argument('-p', '--path', required=True,
help="Enter the file path you want to pack", widget="DirChooser")
parser.add_argument(
'-r',
'--remove',
action="store_true",
help="remove all exe under the path")
parser.add_argument(
"-e",
"--exe",
action="store_true",
help="pack py file to exe by pyinstaller")
args = parser.parse_args()
@Gooey(
program_name='BatchMaker'
)
def main():
parser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('--wave',
default='data',
help='Directory of wave files (*.wav).')
parser.add_argument('--text',
default='data',
help='Script file or directory of script files (*.txt).')
parser.add_argument('--zipdir',
default='zippeddata',
help='Directory to save zipped data.')
parser.add_argument('--limit',
@Gooey(dump_build_config=True)
def arbitrary_function():
desc = "Example application to show Gooey's various widgets"
file_help_msg = "Name of the file you want to process"
my_cool_parser = GooeyParser(description=desc)
my_cool_parser.add_argument("FileChooser", help=file_help_msg, widget="FileChooser") # positional
# my_cool_parser.add_argument("DirectoryChooser", help=file_help_msg, widget="DirChooser") # positional
# my_cool_parser.add_argument("FileSaver", help=file_help_msg, widget="FileSaver") # positional
my_cool_parser.add_argument("MultiFileSaver", help=file_help_msg, widget="MultiFileChooser") # positional
# my_cool_parser.add_argument("directory", help="Directory to store output") # positional
my_cool_parser.add_argument('-d', '--duration', default=2, type=int, help='Duration (in seconds) of the program output')
my_cool_parser.add_argument('-s', '--cron-schedule', type=int, help='datetime when the cron should begin', widget='DateChooser')
my_cool_parser.add_argument("-c", "--showtime", action="store_true", help="display the countdown timer")
my_cool_parser.add_argument("-p", "--pause", action="store_true", help="Pause execution")
my_cool_parser.add_argument('-v', '--verbose', action='count')
my_cool_parser.add_argument("-o", "--overwrite", action="store_true", help="Overwrite output file (if present)")
@Gooey(tabbed_groups=True)
def main():
parser = GooeyParser(usage="%(prog)s [options]",
description="Creates visualizations of FASTA formatted DNA nucleotide data.",
add_help=True,
prog='fluentdna')
if len(sys.argv) == 2 and not sys.argv[1].startswith('-'): # there's only one input and it does have a flag
print("--Starting in Quick Mode--")
print("This will convert the one FASTA file directly to an image and place it in the same "
"folder as the image for easy access. "
# "The scaffolds will be sorted by length for best layout."
"Recommend you open large files with 'Windows Photo Viewer'.")
sys.argv[1] = '--fasta=' + sys.argv[1]
sys.argv.append("--quick")
if "--quick" in sys.argv:
sys.argv.append("--no_webpage") # don't generate a full webpage (deepzoom is time consuming)
@Gooey(program_name="equation solver")
def main():
parser = argparse.ArgumentParser(description="solve the maths equation")
group = parser.add_mutually_exclusive_group()
group.add_argument("-q", "--quadratic", help="enter the quadratic equation")
group.add_argument("-d", "--dimensional", help="enter the one-dimensional equation")
abc = parser.add_subparsers(help="subparsers")
abc_parser = abc.add_parser("abc", help = "use abc template")
group2 = abc_parser.add_mutually_exclusive_group()
group2.add_argument("-aq", "--quadratic", help="enter the quadratic equation", nargs = 3)
group2.add_argument("-ad", "--dimensional", help="enter the one-dimensional equation", nargs = 2)
args = parser.parse_args()
# print(args.equation)
print(args)
if args.quadratic:
if isinstance(args.quadratic, list):
solve_abc_quadratic_equation(args.quadratic)
@Gooey(progress_regex=r'.*EM iteration (\d+)/(\d+)',
progress_expr='x[0] / x[1] * 100.',
monospace_display=True,
image_dir=image_dir)
def main():
parser = GooeyParser()
subparsers = parser.add_subparsers()
init_subparsers(subparsers)
args = parser.parse_args()
args.func(args)
@Gooey(
auto_start=False,
advanced=True,
encoding="utf-8",
language="english",
show_config=True,
default_size=(1200, 1000),
dump_build_config=False,
load_build_config=None,
monospace_display=False,
disable_stop_button=False,
show_stop_warning=True,
force_stop_is_error=True,
show_success_modal=True,
run_validators=True,
poll_external_updates=False,
return_to_config=False,
@Gooey(
program_name='Privacy Fighter',
requires_shell=False)
def main():
parser = argparse.ArgumentParser(
description="Privacy-Fighter: A Browser Setup For Increased Privacy And Security"
)
# parser.add_argument("-v", "--version", action="version", version="Privacy-Fighter " + __version__)
parser.add_argument("-p", "--profile", dest="profile_name", default="TEST",
help="Firefox Profile Name: Leave value to 'default' if unsure or using only single profile", type=str)
args = parser.parse_args()
run(args.profile_name)
@Gooey(monospace_display=True,
advanced=True,
default_size=(900, 600),
program_description='Download tvshows/movies from NRK/Super')
def main():
NRK = NRK(gui=True)
parser = GooeyParser()
parser.add_argument('-u', '--url', action='store', default=False,
required=False, widget='TextField', help='"url1 url2 url3"')
parser.add_argument('-e', '--encoding', default='latin-1',
required=False, help='Set encoding')
parser.add_argument('-save', '--save_path', default=False,