views:

23

answers:

1

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...

+1  A: 

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.

cloudhead
in my case paramater number is more than 5-6 and path and classnames with namespaces will be too long to be argument. And one more thing about arguments is users need to consider empty spaces in paths and put quotes ( "c:\Prog Files" ) in windows and I dont like it ...
erdogany