Re: popen help Programming Software Development by Gribouillis … a shell. In linux for example, a statement like [icode]Popen("ls", shell=True)[/icode] starts 2 processes actually… a 'ls' process. With shell=True, the first argument to Popen must be a string (similar to the command line you… in other cases without it. If you are using the Popen.communicate method to get the output and error of your… popen help Programming Software Development by novice20 hi all... whats the difference between os.popen and subprocess.popen?? what does shell=True in subprocess.call really mean? if os.popen is used for snmpwalk, will there be any problem such as exceeding pipe capacity? what is the capacity of the file objcet connected to pipe using os.popen?/ how much data can it hold? popen Programming Software Development by TheBeast32 … input from a user, sends it to a program with popen(), gets the output, and repeats this until the program ends… <iostream> using namespace std; int main() { FILE *fp = popen("cmd.exe", "r+" ); char buff[50… Re: popen Programming Software Development by VernonDozier … input from a user, sends it to a program with popen(), gets the output, and repeats this until the program ends… <iostream> using namespace std; int main() { FILE *fp = popen("cmd.exe", "r+" ); char buff[50… Re: popen Programming Software Development by Salem Better check your popen() manual, because most implementations are uni-directional. Either read-only, or write-only. Popen problems Programming Software Development by johnyboy82 …a small script I have written [CODE]from subprocess import Popen import os global p def executeProcess(): cmd = "…;ls -l /home" global p p = Popen(cmd) #os.system (cmd)[/CODE] This works only once in…/CNUSubprocess.py", line 10, in executeProcess p = Popen(cmd) File "/usr/lib/python2.5/subprocess.py&… popen and "ls" Programming Software Development by Line …. Since system() returns an int I tried popen() --> [CODE] char buffer[1000]; FILE* myPipe = popen(buf, "r"); if(myPipe… Popen and lists Programming Software Development by nutrion …(1) scanMsg = ''' Enumerating domain for controllers.....Please wait..... ''' servers = subprocess.Popen(["net","use"], stdout=subprocess.PIPE, universal_newlines… Re: Popen and lists Programming Software Development by nutrion … I think. The code (shortened for brevity): [CODE]servers = subprocess.Popen(["net","use"], stdout=subprocess.PIPE, universal_newlines… Re: Popen and lists Programming Software Development by ckoy …). [/QUOTE] add a split() method as follows: [CODE]servers = subprocess.Popen(["net","use"], stdout=subprocess.PIPE, universal_newlines… popen is multithreading? Programming Software Development by mahesh113 I want to learn multithreading in C++. somewhere on internet I got a piece of code using popen() function of stdio.h. I just wanted to know that if this function helps in creating the new threads or it doesn't come under multithreading. Please guide me in multithreading. Re: popen is multithreading? Programming Software Development by L7Sqr [icode]popen[/icode] creates another process and manages the pipe setup for you. It calls [icode]fork[/icode] (in linux) and I'm not sure how the child process is executed in Windows. This is different than using something such as [icode]pthreads[/icode] to run multiple threads in the same process space. Popen with wShowWindow in startupinfo not affecting display Programming Software Development by oscargrower11 …() info.dwFlags |= subprocess.STARTF_USESHOWWINDOW info.wShowWindow = win32con.SW_SHOWMINIMIZED x = subprocess.Popen("calc.exe", startupinfo = info) It pops up the… Re: opening telnet client with popen Programming Software Development by Salem … communication only (either reading or writing). Some enhanced versions of popen() allow bi-directional flow (which is what you would want… Re: popen Programming Software Development by TheBeast32 That's weird, because if you type help, you will get the help message. Re: popen Programming Software Development by TheBeast32 I modified it a little: [Code=C++] strcat(command, "\n"); fputs(command, fp); [/Code] It's better, but I still can't get the ouput correctly. Re: popen Programming Software Development by TheBeast32 I think you're right. I changed the command to help. That displayed the entire thing. Thanks for the help! Combine 2 programs (curl and popen) Programming Software Development by red711 …from internet) and another c-program using popen. currently the popen is using the command ls -l … curl_easy_cleanup(handle); }[/CODE] and the other is popen program, which currently is listing the contents in …curl_easy_cleanup(handle); FILE *fp; char line[130]; fp = popen("handle", "r"); while ( fgets( … Weird segfault involving popen Programming Software Development by liliafan …'t figure out why it is happening: This is the popen class: cpp [code] #include <iostream> #…files_to_open, "/usr/bin/ksh %s", filename); if( (kshfd = popen(files_to_open, "r")) == NULL ) { return 1; // Damn… I get a segfault, if I remove the popen code no more segfaults so it is within this… Using the popen function with program variables - C Programming Software Development by programmer4life …file named a1.db). I hear we can use the popen function to implement shell code within a C program so… '[B]input[/B]' a1.dv\n" if ( !(read_fp = (FILE*)popen(command,"r")) ) { (record not found) [read_fp is null…, so I tried this code [I]before[/I] doing the popen code above: command: [CODE]command = "grep 'input' a1.… Re: Combine 2 programs (curl and popen) Programming Software Development by L7Sqr …]-lcurl[/icode] as a parameter to the compiler). Also, [icode]popen[/icode] takes a program name to execute as if you… opening telnet client with popen Programming Software Development by madmax007 … application. My idea was to open a telnet session with popen and to use the input/output pipes to communicate but…sure that it is not possible to use telnet with popen. I did not find something clear on the web yet… { printf("Open a network client\n"); FILE* pipe = popen("telnet\n", "r"); sleep(1); printf… [Python] How to kill a specific process launched by subprocess.Popen Programming Software Development by ljjfb Hello, all professionals, I used subprocess.Popen to launch a process, right now I am …a error message.) [CODE] import subprocess import time pid = subprocess.Popen(args = ["gonome-terminal", ""--command = …error says: 'unbound method kill() must be called with Popen instance as first argument (got int instance instead)' Thank … Re: [Python] How to kill a specific process launched by subprocess.Popen Programming Software Development by ljjfb … only)""" import subprocess as SP proc = SP.Popen('ps -o pid,ppid ax | grep "%d"' %… of a pid (linux only)""" proc = SP.Popen('ps -o pid,ppid ax | grep "%d"' %…p, pp in pidppid if int(pp) == pid) term = SP.Popen(["gnome-terminal"]) term.wait() print term.pid term… Re: Weird segfault involving popen Programming Software Development by liliafan … convert `char**' to `const char*' for argument `1' to `FILE* popen(const char*, const char*)' However, char* files_to_open = new char[ kMaxFileSize… Re: [Python] How to kill a specific process launched by subprocess.Popen Programming Software Development by Gribouillis …, such as: [CODE] import subprocess, os, signal, time proc1 = subprocess.Popen("gnome-terminal", shell=True) print proc1.pid time… launched. Something like [code=python] >>> term = sp.Popen(["gnome-terminal"]) >>> term.wait() 0… Re: [Python] How to kill a specific process launched by subprocess.Popen Programming Software Development by Gribouillis … of a pid (linux only)""" proc = SP.Popen('ps -o pid,ppid ax | grep "%d"' % pid… p, pp in pidppid if int(pp) == pid) term = SP.Popen(["gnome-terminal"]) term.wait() print term.pid term… Re: [Python] How to kill a specific process launched by subprocess.Popen Programming Software Development by ljjfb … is the eventual code: [CODE] import subprocess, time proc1 = subprocess.Popen(args=['gnome-terminal','--command=XXX']) print 'proc1\'s pid = ',proc1….pid time.sleep(5) proc1.terminate() [/CODE] Anyway, I tried Popen.terminate() before, but it works just then. I do not… Re: subprocess.Popen() question Programming Software Development by afireinside … close python to continue. [code]numberExtractor = subprocess.Popen(["C:\\Perl\\bin\\perl5.10.0.exe",&…O operation on closed file. [code]numberExtractor = subprocess.Popen(["C:\\Perl\\bin\\perl5.10.0.exe","… item in my folder. [code]numberExtractor = subprocess.Popen(["C:\\Perl\\bin\\perl5.10.0.exe","… Re: Explain popen() please Programming Software Development by vegaseat … will illustrate the purpose and meaning of [B]Popen[/B] ... [code]# save this code as …code]... now run this code ... [code]# calendar_may_2011_popen.py # Popen (Pipe open) will open the 'pipe' containing the # standard…C:/Python27/python.exe calendar_may_2011.py" p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) # allow the…