I think i found the problem.

The problem is that cwd for subprocess is not set into Web2Py. I
specified cwd during the instation of subprocess and all went well.

I cannot find the problem because I have to lunch a .bat inside wich
the path was not absolute so specifing cwd was required.

Angelo

2009/7/3 mdipierro <mdipie...@cs.depaul.edu>:
>
> All I can say I call subprocess in admin/controllers/gae.py and it
> works but it is tricky because you are starting a process from within
> a thread.
>
> Massimo
>
> On Jul 3, 9:04 am, Angelo Compagnucci <angelo.compagnu...@gmail.com>
> wrote:
>> I have the same problem,
>>
>> A call to subprcess into controller subprocess.call(string) return
>> errorcode 1, the same command (cut/paste) returns 0 in a python
>> console.
>>
>> I cannot find anything wrong ...
>>
>> Thanks!
>>
>> 2009/5/12 mdipierro <mdipie...@cs.depaul.edu>:
>>
>>
>>
>> > In trunk, look at the file
>>
>> > applications/admin/controllers/gae.py
>>
>> > It provides an example of suprocess + ajax to interact with
>> > subprocess.
>>
>> > On May 11, 8:13 pm, Francisco Gama <francisco....@gmail.com> wrote:
>> >> - does that call return anything at all?
>> >> For example, if you try:
>> >> print 'A'
>> >> os.system(...)
>> >> print 'B'
>>
>> >> do you ever get see 'A' and 'B' ?
>>
>> >> - have you tried using subprocess instead of os.system?
>> >> For example:
>> >> import subprocess
>> >> subprocess.call("E:/Python/web2py_src/web2py/applications/
>> >> TheReckoning/
>> >> prod_scripts/dropship_copy_to_opc.bat")
>>
>> >> you may also check other libs like:
>> >> os.spawn*
>> >> os.popen*
>> >> popen2.*
>> >> commands.*
>> >> (not so recommended)
>>
>> >> - Finally, you give little information about your problem. You
>> >> probably would live better with an IDE/debugger, probing your stack
>> >> data with breakpoints and showing you the code at execution time.
>>
>> >> Best Regards
>>
>> >> On 11 Maio, 21:54, NetHead <tbnethe...@yahoo.com> wrote:
>>
>> >> > Hey Gang:
>>
>> >> > When a user visits a page, I am attempting to run the following lines:
>>
>> >> > import os
>> >> > os.system("E:/Python/web2py_src/web2py/applications/TheReckoning/
>> >> > prod_scripts/dropship_copy_to_opc.bat")
>>
>> >> > This exact command works fine from a Python interactive session,
>> >> > BUT.... when put into a Web2py function, the page never loads -- the
>> >> > blue bar just creeps forward sloooowwwwly.
>>
>> >> > We tried this in both Firefox and IE with the same result.
>>
>> >> > Any thoughts?   Please note that we ARE importing 'os' first.
>>
>> >> > Thanks!!
>>
>> >> > Todd
> >
>

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

Reply via email to