Skip to content

Tag: arguments

Disable/Remove argument in argparse

Is it possible to remove or disable an argument in argparse, such that it does not show in the help? How? It is easy to add new arguments: And I know you can override arguments with a new definition by specifying the “resolve” conflict handler: But this still includes arg1 in the help message and …

Getting HTTP GET arguments in Python

I’m trying to run an Icecast stream using a simple Python script to pick a random song from the list of songs on the server. I’m looking to add a voting/request interface, and my host allows use of python to serve webpages through CGI. However, I’m getting hung up on just how to get the GET …

How to pass elements of a list as arguments to a function?

I’m building a simple interpreter in python and I’m having trouble handling differing numbers of arguments to my functions. My current method is to get a list of the commands/arguments as follows. Then to execute com, I check to see if it is in my dictionary of command-> code mappings and if it…