Re: Command-line does work when scheduled



On Sep 29, 6:56 pm, "Gabriel Genellina" <gagsl-...@xxxxxxxxxxxx>
wrote:
En Sat, 29 Sep 2007 19:17:49 -0300, Jim <jscre...@xxxxxxxxxxxxxx> escribi?:





On Sep 29, 3:19 pm, "Gabriel Genellina" <gagsl-...@xxxxxxxxxxxx>
wrote:
En Sat, 29 Sep 2007 17:34:34 -0300, Jim <jscre...@xxxxxxxxxxxxxx>
escribi?:

I want to schedule a Python program that reads the command line for
input. However, when adding an argument to the command line Python
will not pick it up when using Windows scheduled tasks.

How do I get it to work?

Do you write the command line when defining the task? Using double
quotes
around arguments with spaces?
It works fine for me.

I ran the following on the Scheduled Tasks:
"J:\Jim Crerar\MyPython\Zero_OE_Counter\Zero_OE_Counter.py" n
"J:\Jim Crerar\MyPython\Zero_OE_Counter\Zero_OE_Counter.py n"
"J:\Jim Crerar\MyPython\Zero_OE_Counter\Zero_OE_Counter.py" "n"
None of them work.
However, no problem with running from *.bat file or directly from
shortcut on my Desktop.

Try prepending the Python executable:

C:\Python25\Python.exe "J:\Jim
Crerar\MyPython\Zero_OE_Counter\Zero_OE_Counter.py" n

If it works this way, maybe the .py file extension is not correctly
registered.

--
Gabriel Genellina- Hide quoted text -

- Show quoted text -

Yes, it works this way.
How do I register the .py extension correctly?

Thanks,
Jim

.



Relevant Pages

  • Re: Implementing an 8 bit fixed point register
    ... I'm about to write a simulator for a microcontroller in python ... for some other strange register) and I need to simulate the ... They'll allow you to define special handling for the semantics ... going to confuse people who are more used to reading processor ...
    (comp.lang.python)
  • Problem building Openoffice 3.1.1 at -current
    ... getting an strange error (associated with python). ... ERROR: ERROR: Could not register all components for file services.rdb ... removing directory ... ('No module named _socket', traceback follows ...
    (freebsd-current)
  • Re: Implementing an 8 bit fixed point register
    ... I'm about to write a simulator for a microcontroller in python ... and I need to simulate the fixed point behaviour of the register, ... A bytearray subclass could enforce that all 'bits' are ...
    (comp.lang.python)
  • I fought typelib- and typelib won.
    ... I am trying to extend Crystal Reports with Python. ... I attempted to build my exe with the -tbl switch that py2exe requires. ... seems to build with no errors, but when I register the .exe, I see no ... check the box that says 'create typelib'. ...
    (comp.lang.python)
  • Re: "The system cannot execute the specified program."
    ... downloaded the AS distribution of Python 2.6 from ActiveState. ... When the bat file tries to invoke Python, ... couldn't run the *.msi file. ...
    (comp.lang.python)