473,385 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

os.system prob



Hello,

I am trying to send some commands via os.system but am getting tripped
up by it stripping out the quote marks. I have:

program = "dcop klipper klipper setClipboardContents "
fileOut = '"test = FileOut(0,
"/bobbleheads/shots/bh112_01/roto_neck/ramin/renders/test", "Auto");"'

The fileOut string must be enclosed with "'s and also contains several "'s.

So I put them togeter

command = program + fileOut
os.system(command)

My clipboard then contains

test = FileOut(0,
/bobbleheads/shots/bh112_01/roto_neck/ramin/renders/test, Auto);

all of the " have been stripped out.

I need it to contain

"test = FileOut(0,
"/bobbleheads/shots/bh112_01/roto_neck/ramin/renders/test", "Auto");"

any ideas??

ps - this may only work under KDE. If there are python specific commands
to put things in the clip board
I can't find them??
Thanks in advance.

Jul 18 '05 #1
1 1300
In article <ma**************************************@python.o rg>,
Aaron Barclay <aa****@jhcs.co.uk> wrote:
I am trying to send some commands via os.system but am getting tripped
up by it stripping out the quote marks. I have:


Quoting can be tricky, when you have multiple layers of
interpretation - python, shell, etc. You can probably
figure it out with some experimentation, but if possible
it's better to avoid the problem. Use os.spawnv - like,

os.spawnv(os.P_WAIT, '/usr/local/bin/whatever',
['whatever', 'parameter one'])

This invokes the command directly, so there's no shell
command line parsing.

Donn Cave, do**@u.washington.edu
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: Thomas | last post by:
Hi I have an XSL stylesheet: <xsl:for-each select="TRACKS/TRACK"> <tr class="TDL"> <td width="90%"><xsl:number value="position()" format="1" /> - <xsl:value-of select="TRACKTITLE"/></td>...
8
by: Colin Mc Mahon | last post by:
Hi all, I am currently using a system you are probably familiar with if you have done any templating with vbscript, define a template file with special tokens in it(like ##Content## etc), load...
5
by: David Sobey | last post by:
Hi Sorry bout this basic prob. Got a file called file.obj. tryna read the first line from it as a string and print it to the screen. getting errors: #include "stdafx.h" #include <stdio.h>...
2
by: Dishan Fernando | last post by:
Hi my prob is like this.. ----------------------------- create table ax( i int , j int ) create table ay( i int ,
5
by: msnews.microsoft.com | last post by:
I am new to C# (coming from java) and I am confused about how to properly work with datagrids. The application I am working on is a message based system where properties aren't changed in direct...
0
Savage
by: Savage | last post by:
I'm making for fun a simple program which format a input file.Input file sustain of person name,lastname and date of birth.Output file si supposed to be forammted as following: NAME ...
2
by: mnacw | last post by:
Can anybody help me to resolve this prob. i have installed Visual Studio 2005 Professional edition. I am working in VB.Net. When I tried to connect to database it is connected but when i make some...
3
by: metalheadstorm | last post by:
hi there, im currently writing a program in vb6 that will eventually be able to retrieve data from an online xml sheet it will have a user base where each user has its own xml sheet and that only...
3
by: Rafath | last post by:
Hello iam new to this forum but i hope this will help me in solving the case The error iam getting is "Registry editing has been disabled please contact your system administrator" mines is a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.