Rajasankar
Rajasankar

Reputation: 928

Running a Command in Tomcat CGI using Python

I've encountered and weired behaviour when running python in Tomcat-CGI. All things workfine expect calling a this command

subprocess.Popen('"C:\Program Files\AutoIt3\Aut2Exe\Aut2exe.exe" /in "C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\python\install.au3" /out "C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\python\install.exe"')

Running this code generates an exe as expected, however, it also puts the following in the HTML

<subprocess.Popen object at 0x0094BC10>

If I call the same inside an batch file, it prints the entire output in the HTML and doesn't create the exe too.

Any Ideas?

Upvotes: 0

Views: 673

Answers (1)

Matus
Matus

Reputation: 613

I do not hnow much about TomCat and your environment, but I would say that your

<subprocess.Popen object at 0x0094BC10>

is returnvalue of subprocess.Popen() call.

I would try to move the subprocess.Popen() somewhere, where its returnvalue is not captured into your html (if what you want is eliminate the returnvalue from your html). Just my first idea, hope it helps.

Upvotes: 1

Related Questions