| Reply | « Previous Thread | Next Thread » |
|
Hi,
I'm writing a small method to replace some text in a file. The only argument I need is the new text, as it is always the same file and text to be replaced. I'm having a problem using the os.system() call, when I try to use the argument of the method If I use a string like below, everything runs ok: stringId = "GRRRRRRRRR" cmd="sed '1,$s/MANAGER_ID=[0-9]*/MANAGER_ID=" + stringId + "/g' path/file.old > path/file.new" os.system(cmd) Now, if i try to give a string as a parameter like below, the command is not executed. I do a print to see if the command is correct, and it is. I can even execute it with success if I copy / paste to my shell import os def updateExportConfigId(id): stringId = "%s" % id cmd= "sed '1,$s/MANAGER_ID=[0-9]*/MANAGER_ID=" + stringId + "/g' path/file.old > path/file.new" print "command is " + cmd os.system(cmd) Does anyone knows what is wrong? |
|
Hello and welcome to Forum Nokia.
However, this forum is specially for the Python for S60 (PyS60). For non-PyS60 Python questions, you will probably get better answers at other programming Q&A sites, for example StackOverflow. Lauri |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| STLPort namespace issue | yickhong | Open C/C++ | 0 | 2009-04-09 09:54 |
| SyncML link problem | samuel_ | General Symbian C++ | 4 | 2009-03-27 09:02 |
| Problem with eglSwapBuffers and heap corruption | greatape | Symbian Media (Graphics & Sounds) | 2 | 2007-05-24 04:35 |
| netcards - Problem with opening adapter | kernj | Symbian Tools & SDKs | 5 | 2007-01-10 09:56 |
| Problem: S60 SDK for CW in PC with .NET | anttij | Carbide.c++ IDE and plug-ins | 1 | 2005-02-28 12:36 |