i created a python .py file in VsCode and i want to make dynamo run this .py file without need to re-write it again inside Dynamo ?
thanks in advance
i created a python .py file in VsCode and i want to make dynamo run this .py file without need to re-write it again inside Dynamo ?
thanks in advance
Have a look at these nodes:
File.FromPath is another node you’ll need for this…
i tried both and same problem
Looks like its the issue in the code. Haven’t looked the complete though. Python Script from String should work directly with string. Try adding this:
import os
@Martin_Spence1 is right. Add File.FromPath and File.ReadText.
Then there is the issue of your code not actually being written properly which @Kulkul refers to. Your code has compilation errors. These need to be addressed.
If import os
doesn’t do the trick you might be missing a reference to C:\ProgramFiles\Iron Python 2.7\Libs
To summarize, just keep an eye on all references. They might be working file in external IDE like Visual Studio, but Dynamo might not have the same references loaded in by default, so you have to be explicit.
This is related and might be of help: