Hi group! I run my own python scripts wihin web2py framework and importing web2py models by shell comand:
python2.5 web2py.py -S appname -M -R myscript.py -d --DATE 2008-11-30 param1 param2 The above works. You see that I need to pass options to my script. When my options coincide with web2py's, there is a conflict and web2py tries to parse my options. E.g.: python2.5 web2py.py -S appname -M -R myscript.py -dt --DATE 2008-11-30 param1 param2 Here I added 't' option to my script. This causes an error: Usage: python web2py.py web2py.py: error: option -D: invalid integer value: '2008-11-30' Note that it complaints against 'D' option. How can I pass options to my script - is there workaround possible? I parse options in my script as: from optparse import OptionParser <...usuall stuff for OptionParser...> (options, args) = parser.parse_args(sys.argv[6:]) Here sys.argv[6:] extracts web2py args (python2.5 web2py.py -S appname -M -R) for me. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---