printing text with " "

Become a member of the CGSociety

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

Thread Tools Display Modes
  03 March 2009
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.


beDistinct RecomFarmhouse IMDB LinkedIN
  03 March 2009
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
  03 March 2009
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
  03 March 2009

thanks guys
beDistinct RecomFarmhouse IMDB LinkedIN
  03 March 2009
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
Society of Digital Artists

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

All times are GMT. The time now is 09:46 PM.

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