[Maya-Python] Re: Simple program with complicated problem! InternalVar issue?

2015-08-10 Thread Kate Sendall
Are you kidding me? That's it! Thank you so much, haha. I was using an 
american set keyboard and a small screen. The two obviously don't mix well.

Perfect answer.

On Sunday, August 9, 2015 at 4:41:43 PM UTC+1, ABHIRAJ KK wrote:

 *Hi, kate *

 *check the icons i in ur code i think u have used some special 
 characters *

 *imagePath = mc.internalVar(userPrefDir=True) +'icons/stairIcon.jpg'*
 *mc.image(image=imagePath)*


-- 
You received this message because you are subscribed to the Google Groups 
Python Programming for Autodesk Maya group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/8d601779-da77-4d79-9c5c-704583697a91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: Simple program with complicated problem! InternalVar issue?

2015-08-10 Thread Robert White
Or, if you're like me and don't ever remember how the %s formatting works:

imagePath={pth}icons/staircon.jpg.format(pth=mc.internalVar(userPrefDir=True))

or better yet, because it's a file path:

import os
imagePath= os.path.join(mc.internalVar(userPrefDir=True), 'icons', 
'staircon.jpg')

That last one is often best, because it will handle os specific things like 
whether directories are split by '/' or by '\'.

On Monday, August 10, 2015 at 3:49:34 PM UTC-5, larry wrote:

 *I would use python string formatting instead of the  + operator.*

 *Try something like:*

 *imagePath=%sicons/staircon.jpg%**mc.internalVar(userPrefDir=True)*


 *instead of:imagePath = mc.internalVar(userPrefDir=True) 
 +'icons/stairIcon.jpg'*

 *More info:*


 *http://www.diveintopython.net/native_data_types/formatting_strings.html 
 http://www.diveintopython.net/native_data_types/formatting_strings.html*

 On Mon, Aug 10, 2015 at 9:13 AM, Kate Sendall kate.alic...@googlemail.com 
 javascript: wrote:

 Are you kidding me? That's it! Thank you so much, haha. I was using an 
 american set keyboard and a small screen. The two obviously don't mix well.

 Perfect answer.

 On Sunday, August 9, 2015 at 4:41:43 PM UTC+1, ABHIRAJ KK wrote:

 *Hi, kate *

 *check the icons i in ur code i think u have used some special 
 characters *

 *imagePath = mc.internalVar(userPrefDir=True) +'icons/stairIcon.jpg'*
 *mc.image(image=imagePath)*

 -- 
 You received this message because you are subscribed to the Google Groups 
 Python Programming for Autodesk Maya group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to python_inside_maya+unsubscr...@googlegroups.com javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/python_inside_maya/8d601779-da77-4d79-9c5c-704583697a91%40googlegroups.com
  
 https://groups.google.com/d/msgid/python_inside_maya/8d601779-da77-4d79-9c5c-704583697a91%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google Groups 
Python Programming for Autodesk Maya group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/0e34b1fe-7332-443c-bb05-662d20ea3892%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: Simple program with complicated problem! InternalVar issue?

2015-08-10 Thread noah mizrahi
*I would use python string formatting instead of the  + operator.*

*Try something like:*

*imagePath=%sicons/staircon.jpg%**mc.internalVar(userPrefDir=True)*


*instead of:imagePath = mc.internalVar(userPrefDir=True)
+'icons/stairIcon.jpg'*

*More info:*


*http://www.diveintopython.net/native_data_types/formatting_strings.html
http://www.diveintopython.net/native_data_types/formatting_strings.html*

On Mon, Aug 10, 2015 at 9:13 AM, Kate Sendall 
kate.alicia.send...@googlemail.com wrote:

 Are you kidding me? That's it! Thank you so much, haha. I was using an
 american set keyboard and a small screen. The two obviously don't mix well.

 Perfect answer.

 On Sunday, August 9, 2015 at 4:41:43 PM UTC+1, ABHIRAJ KK wrote:

 *Hi, kate *

 *check the icons i in ur code i think u have used some special
 characters *

 *imagePath = mc.internalVar(userPrefDir=True) +'icons/stairIcon.jpg'*
 *mc.image(image=imagePath)*

 --
 You received this message because you are subscribed to the Google Groups
 Python Programming for Autodesk Maya group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to python_inside_maya+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/python_inside_maya/8d601779-da77-4d79-9c5c-704583697a91%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/8d601779-da77-4d79-9c5c-704583697a91%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Python Programming for Autodesk Maya group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAJJjd4JfyQOBkr03Jzzc%3DLpNmWyPBJF6EJ5k-a7PcOqnG4auig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: Simple program with complicated problem! InternalVar issue?

2015-08-09 Thread ABHIRAJ KK
*Hi, kate *

*check the icons i in ur code i think u have used some special 
characters *

*imagePath = mc.internalVar(userPrefDir=True) +'icons/stairIcon.jpg'*
*mc.image(image=imagePath)*

-- 
You received this message because you are subscribed to the Google Groups 
Python Programming for Autodesk Maya group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/49027a9e-83b7-458e-986f-a50ef14c769a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.