I am working on MODO scripts in python.I created my script as follow:
#python
import lx
import sys
layers = lx.evalN("query layerservice layers ? all")
oFile = open('myfile.txt','w')
for layer in layers:
lx.out('Hello World!')
layerName = lx.eval1("query layerservice layer.name ? %s"%layer)
lx.out("Layer Name : %s" %layerName)
and so on.....
when i run this script in MODO,rest everything works fine for me.I wanted to create one text file at same time and perform write operation on it.but the code
oFile = open('myfile.txt','w')
do not create text file.So i cannot proceed further.
How do i create my file and perform write operation on it.???
Thanx in advance.
It sounds like you are creating the file in an unexpected location.
You can either pass a full path to the
opencall, or useos.chdir(...)to change the directory in which files will be opened.