take all the spaces out….. most older applications of terminal/command prompt do not know how to resolve the space char, so instead you need to deliberately acknowledge vacant spaces
I'm a terrible teacher, but as an example: 'my uNkle Bobo' - should be my/uNkle/Bobo' never ever have spaces in your filename with maya - - - EVER --- it's almost the equivalent of dividing by zero good Luck@ On 16/05/2013, at 7:29 AM, Jesse Capper <[email protected]> wrote: > Why is my unkle bobo broken? Windows works with mixed slashes and that > filepath should resolve fine. os.path.isdir(os.path.join( scenepath , 'my > uNkle Bobo' )) should be True (assuming the directory exists). > > You're getting mixed slashes because \ is the windows separator (os.path.join > uses os.sep). > > On Wednesday, May 15, 2013 9:06:03 AM UTC-7, Ævar Guðmundsson wrote: >> Thanks for the excellent replies! >> >> Further argument goes without saying I'd think, it's not only more >> efficient and code friendly to make use of the python standard path library >> as well as readability within the code is greatly enhanced when using >> os.path for path splicing and 'string'.join() for other joining things and >> while there are no personal griefs going on regarding the shutil module the >> process of copying a single file into a directory should be rather >> straightforward and effortless. >> However, I've updated my code accordingly and was about to try out shutil >> vs ctypes.windll.kernel32 when I noticed my destination path wasn't getting >> picked up... >> >> Explanation coming in this simplified example: >> [code] >> import os >> import maya.cmds >> >> workspace = maya.cmds.workspace( q=1,rd=1 ) >> directory = maya.cmds.workspace( 'scenes' , q=1 , fre=1 ) >> scenepath = os.path.join( workspace , 'my folder') >> >> print scenepath >> print os.path.join( scenepath , 'my uNkle Bobo' ) >> print '/'.join( [ scenepath , 'tends to join things' ] ) >> >> [output] >> C:/Users/aevar_000/Dropbox/Samansafn/Verkefni/Cube/my folder >> C:/Users/aevar_000/Dropbox/Samansafn/Verkefni/Cube/my folder\my uNkle Bobo >> C:/Users/aevar_000/Dropbox/Samansafn/Verkefni/Cube/my folder/tends to join >> things >> >> [resolution] >> My uNkle Bobo is broken, path constructed him using two different slash >> schemes. The / symbols are what Maya is returning and \ is coming from path. >> >> Any ideas? The platform module comes to mind but I've never used it that >> much so any info will be great, or perhaps I should just create a custom >> filerule and query that one with fre='custom' ? > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > -- 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 [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
