Re: Getting returncode of a command executed with Popen through xterm

2010-10-19 Thread AmFreak
Am 19.10.2010, 10:10 Uhr, schrieb Diez B. Roggisch : amfr...@web.de writes: Hi, i have a program that have to execute linux commands. I do it like this: retcode = Popen(["xterm", "-e", command],stdin=PIPE, stdout=PIPE, stderr=PIPE) I have to use xterm because some commands need further inpu

Getting returncode of a command executed with Popen through xterm

2010-10-18 Thread AmFreak
ut xterm. As i understand it, if i use xterm the retcode refers to the xterm window (process). But is there a way i can get the returncode and errormessage of the command i sent to xterm ? Thanks for any answers AmFreak -- http://mail.python.org/mailman/listinfo/python-list

Converting an ugly path to a shell path

2010-09-13 Thread AmFreak
ke this /home/user/!" ยง$/. The shell don't understand the special chars so i have to escape them with "\" . Is there a function that does this ? If there isn't i would use a RegEx but I can't even seem to find a list containing all special chars :/ Greetings

Re: Saving (unusual) linux filenames

2010-08-31 Thread AmFreak
Thanks for all the nice answers! The normal thing to do is to escape the delimiter when it appears in data. There are lots of plenty of escaping standards to choose from, and some of them (e.g. the one used for URLs) are already present in various bits of Python's standard library. The CSV mo

Saving (unusual) linux filenames

2010-08-31 Thread AmFreak
Hi, i have a script that reads and writes linux paths in a file. I save the path (as unicode) with 2 other variables. I save them seperated by "," and the "packets" by newlines. So my file looks like this: path1, var1A, var1B path2, var2A, var2B path3, var3A, var3B this works for "norm