need help for QProcess under windows
I have a python script let's call it myscript.py.
When I start "myscript.py" from Qt4.3 Command Prompt it works alright and I can also do "C:/Python24/python.exe myscript.py". Now when I use QProcess only the latter works, is there a way to do a simple process.start("myscript.py")? maybe there is an exec() function on windows I'm unaware of?
thanx in advance
Pat
Re: need help for QProcess under windows
You can try
Code:
pyscript.
start("C:/Python24/python",
QStringList() <<
"complete/path/to/myscript.py");
Re: need help for QProcess under windows
Quote:
Originally Posted by munna
You can try
Code:
pyscript.
start("C:/Python24/python",
QStringList() <<
"complete/path/to/myscript.py");
sure that works great, but what I wanted to do was more something like this:
Code:
pyscript.start("complete/path/to/myscript.py");
cause when I do "complete/path/to/myscript.py" with cmd it works so that means C:/Python24/python is in the PATH right? and if it's in the path why can't I just do a pyscript.start("complete/path/to/myscript.py"); ?
Re: need help for QProcess under windows
QProcess is not equivalent of cmd.
Which means that if you want to directly just give the .py file then you have first open cmd and then type the path to your .py file.
I think u need to use rundll32.exe for this.
I think it will be something like :
Code:
str1 = str1.left(3);//c:\ or d:\...
str1 += "WINDOWS/system32/rundll32.exe";
p.addArgument(str1);
p.addArgument("I am not sure about this argument");
Re: need help for QProcess under windows
If Your python path result on..
cmd # echo %PATH%
(Python install process or installer make this!)
python & ruby & php like moore...
Code:
system("start /max /wait http://www.blogistan.co.uk/qt/");
system("python c:/fulldir/file.py"); /* not python.exe */
system("php c:/fulldir/file.wphp");
/* Only java compliled is better on qprocess exe url, browser but not interpret language*/
Why? i don know... maybe Qprocess grab procedure.... faster if compiled sources...