Last active
November 5, 2015 10:08
-
-
Save K240-zz/8be4027dbce2a4c8f9d9 to your computer and use it in GitHub Desktop.
startup for python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print "Setting for python" | |
| pythonpath = #( | |
| -- add your python path. | |
| @"d:\dev\3dsmax\python\lib" | |
| ) | |
| for p in pythonpath do | |
| ( | |
| format "add python path:%\n" p | |
| cmd = "import sys;sys.path.append(r'"+p+"')" | |
| python.execute cmd | |
| ) | |
| fn execute_python filename = | |
| ( | |
| try | |
| ( | |
| fd = openFile filename mode:"r" | |
| seek fd #eof | |
| maxlen=filepos fd | |
| seek fd 0 | |
| code = readChars fd maxlen errorAtEOF:false | |
| close fd | |
| return python.execute code | |
| ) | |
| catch | |
| ( | |
| return false | |
| ) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment