stupid error.... File Not Found

stupid error.... File Not Found

Anonymous
Not applicable
5,187 Views
3 Replies
Message 1 of 4

stupid error.... File Not Found

Anonymous
Not applicable

I know this is a really silly problem to have, but MaxScript Listener keeps throwing back "--Runtime error: File not found"

 

I'm trying to execute python.ExecuteFile "C:\data\test.py"

 

I'm 100% positive this file exists at this location with this spelling (used copy/paste).  This file is pretty simple too... has "import MaxPlus" on the first line and "print 'Hello'" on the next line.

 

I've run python.Init(), python.Execute "print 'Hello'", and python.ExecuteFile "demoBentCylinder.py" all returning success.

 

I'm reletively new to Python scripting but and I'm not sure what's going on.  I feel kinda stupid asking since it's a pretty straight forward process, but for some reason the last two times I started up I had this trouble.  What am I missing here?

 

 

For reference I have looked at this page:

http://docs.autodesk.com/3DSMAX/16/ENU/3ds-Max-Python-API-Documentation/index.html

 

In the section "Executing Python from MaxScript" it says:

"If you provide a full path using the ExecuteFile command; for example, as follows; 3ds Max looks for the Python file in the path provided."

0 Likes
Accepted solutions (2)
5,188 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Accepted solution

...ok stupid solution...

 

python doesn't recognize paths with backslash, need to change them to frontslash...

 

"C:\data\test.py" won't work

"C:/data/test.py" does work

 

...so if you're copying the path from the explorer address bar, be sure to flip the slashes the other way

0 Likes
Message 3 of 4

Swordslayer
Advisor
Advisor
Accepted solution

Actually, backslash is the escape character, you use it to insert special characters such as tab (\t), newline (\n), quotes (\") etc. If you want to use it as a backslash guaranteed to be backslash, you have to escape it (\\) or use verbatim string literal, @ i.e. @"C:\data\test.py"

0 Likes
Message 4 of 4

Anonymous
Not applicable

I'm working in vault and "file not found" error is something I don’t understand as the file is exactly where it supposed to be, downloaded from Vault and Inventor continues to come up with this error message. This software is very inferior as compared to others in the market. Most error messages do not make sense. Typical Autodesk.

 

 

0 Likes