Question

I have a small python script to make an installation. I need some information like username, password, path, classname, dbname, ip, port etc... First of all this is an admin task and end-users won't be dealing with this script. So for an administrator should I ask every needed information with console prompts or just mention them in readme file then he can go and change variable assignments in script file (which are on top with needed explanation).

Asking for every possible information is for me kinda chatty. And other approach might be a bit hidden... Yes, at this point I need ideas...

Was it helpful?

Solution

I think either through command line arguments, like

$ foo john password -p 1977 -h 255.255.255.0

Or, if there's simply too much information, filing it in the script is a much better idea, as you only have to do it once, and the script is less complex as a result (no stdin code).

Depending on how you distribute the script, you code have a config file with it, like '.foo_config', and get the config from there, that's much more explicit, but not as simple to distribute.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top