printing text with " "

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 03 March 2009   #1
printing text with " "

In my script I want to print the render.exe path into a .bat file.

At the moment the script line looks like this:

print ("Render -r mi -binary 0 -cam " + $camera + " " + $selectedScenes[$i] + "\r");

This works fine and prints the correct text into my file however I need to print the full path of the Render executable. In order for it to render it needs to look like this at the start:

"C:\Program Files\Autodesk\Maya2008\bin\Render.exe"

However when I try and insert this into the script. eg

print (""C:\Program Files\Autodesk\Maya2008\bin\Render.exe" -r mi -binary 0 -cam " + $camera + " " + $selectedScenes[$i] + "\r");

I get a syntax error. It doesn't seem to like the two "" at the start.

How can i fix this.

Thanks

Rich
__________________
beDistinct RecomFarmhouse IMDB LinkedIN
 
Old 03 March 2009   #2
If you want to use double quotes inside a string you have to escape it, like you did with the \r.

print( "\"quote\"" ) will output "quote".
__________________
Freelance | Consulting | Development | Autodesk Authorized Developer
Boole | Stitch | Konstrukt | SmartDuplicate | Wire | Contours | MultiTool
 
Old 03 March 2009   #3
when using quotes inside of quotes you need to escape them with a \ like this " \"some text\" "

[edit] - bah beat me to it, what ticket said :P
__________________
- elenerville
 
Old 03 March 2009   #4
brilliant!

thanks guys
__________________
beDistinct RecomFarmhouse IMDB LinkedIN
 
Old 03 March 2009   #5
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:25 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.