Ok. Now I will try to explain this for the final time since I think I have bothered you guys enough.I am sorry for that.
The situation is as under:
I have a server setup on my window XP machine. It is used for uploading, downloading and deleting files(all these functionalities working fine). Now what I want is to have python scripts that perform certain task. The place where all python scripts are located is:
The two scripts with the name hello.wsgi/copy of hello.py is the same file (only extension changed for test purpose.)
The complete script is as under:
def application(environ, response):
text ="Hello Everyone"
response('200 OK', [('Content-Type', 'text/plain;charset=utf-8'),('Content-Length', str(len(text)))])
return [text]
Clicking on this script(hello.wsgi or copy of hello.py) gives the output which prints Hello Everyone!!!
I tried using this script:
import subprocess
import os
import traceback
def application(environ, response):
try:
file.write("im here\n")
subprocess.Popen('c:\WINDOWS\notepad.exe')
except:
if traceback.print_exc(10) != None:
file.write(traceback.print_exc(10))
else:
file.write("nothing happened")
file.close()
text ="When that Aprill with his shoures soote"
response('200 OK', [('Content-Type', 'text/plain;charset=utf-8'),('Content-Length', str(len(text)))])
return [text]
The desired output is that, on clicking this script it shall print out text (not in notepad) and open up notepad.
But what it does is, it prints out the text and I dont know why it runs the notepad application in the background instead.
You cant see any notepad opening up but when you check it in task manager it shows that notepad is running.
So I would say the only problem now left is how to get the application (notepad) to run in front (as in openup notepad on click) rather than running in the back ground.
I hope it will clear out the situation as to what I am trying to do. I am sorry for not explaining it well before.