Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
proc = QProcess()
proc.addArgument("xterm")
proc.addArgument("-e")
proc.addArgument("myProg")
if proc.start():
print "I am started"
#********************
# Well upto this stage myProgram has been started in xterm and my program asks for user inputs. Now at this stage I want to add some parameters to my program say path of file. How to do this? I am trying to pass arguments to my program i.e. myProg like following. But this is not working...
proc.addArgument("[B]path for working directory[/B]") # Required User input no. 1 then user must press enter , so thart program will prompt for another user input
proc.addArgument("[B]My filename[/B]") #required user input no. 2. here also user provided file name and press enter..
I tried the above two command with writeToStdin with same quoted string arguments like for 1.0 "\home\field" and for 2.0 "test"
Well it does not workkkkk
I was just trying to take file path from user as in filedialog and provide these fragments to myProg as command line inputs and then show the terminal window..
Is this possible else. I will prompt user to select the file which is created by myProg application mentioned above...
You might be thinking.......Oh God quite a being explanation .... :) ZZZZ
Sandeep
|
Quoted
Originally posted by d0153030
I am trying to pass arguments to my program i.e. myProg like following. But this is not working...
proc.addArgument("path for working directory") # Required User input no. 1 then user must press enter , so thart program will prompt for another user input
proc.addArgument("My filename") #required user input no. 2. here also user provided file name and press enter..
I tried the above two command with writeToStdin with same quoted string arguments like for 1.0 "\home\field" and for 2.0 "test"
Well it does not workkkkk
|
|
Source code |
1 2 3 4 5 6 7 |
proc.start()
proc.writeToStdin("/home/field\n")
# \n is needed, the app needs a carriage return
# for line based reading like scanf
if proc.canReadLineStdout():
out = proc.readLineStdout()
# etc.
|