run in Windows cmd (It's OK):
C:\>dir c:\Work /b
test.bat

C:\>type c:\Work\test.bat
@echo off
C:
dir >> C:\Work\dir.txt

C:\>c:\Work\test.bat

C:\>dir c:\Work /b
dir.txt
test.bat

After run the test.bat, a new file dir.txt is created.

--------------------------------------------------------------------------------
run in Python 2.51 use os.system (It's OK):
 C:\>dir c:\Work /b
test.bat

C:\>python
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system('c:\\Work\\test.bat')
0
>>> quit()

C:\>dir c:\Work /b
dir.txt
test.bat

--------------------------------------------------------------------------------
run in Python 2.51 use subprocess.call (It's OK):
 C:\>dir c:\Work /b
test.bat

C:\>python
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.call('C:\\Work\\test.bat')
0
>>> quit()

C:\>dir c:\Work /b
dir.txt
test.bat

--------------------------------------------------------------------------------
run in webpy (Python 2.51)  (It looks like Failed):
C:\Inetpub\wwwroot>dir C:\Work\ /b
test.bat

C:\Inetpub\wwwroot>python WebFacade.py 88
http://0.0.0.0:88/

and then open a IE browser and visit http://127.0.0.1:88/, I got a
prompt:
127.0.0.1:2777 - - [23/Nov/2008 11:14:07] "HTTP/1.1 GET /test" - 200
OK

but no file is created:
C:\Inetpub\wwwroot>dir C:\Work\ /b
test.bat

WebFacade.py source code segment :
... ...
render = web.template.render('templates/');
urls = (
'/test','test'
);
web.template.cache=False;

class test:
    def GET(self):
        os.system(r"C:\Work\test.bat")
        print render.index();
... ...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to