Trying to Run a Script,Syntax Errors :-/

Hi,
i’m trying to run a model converter script and am just getting syntax errors, can someone point out what i’m doing wrong please? It’s probably something obvious, i’ve not used this in about 10 years.
the script is old and the docs say touse Python 2.7 onwards, can cause errors in 3 so i’ve grabbed 2.7.8, installed it. i’ve put my model and script in the main folder and am trying, as per the instructions
" Usage: python Obj2DatTexNorm.py <filename>"
another thing says to use “python2” so i went through all possible variants lol;

>>> os.getcwd()
'C:\\Python27'
>>> Python2 Obj2DatTexNorm.py testship.obj
  File "<stdin>", line 1
    Python2 Obj2DatTexNorm.py testship.obj
                         ^
SyntaxError: invalid syntax
>>> Python Obj2DatTexNorm.py testship.obj
  File "<stdin>", line 1
    Python Obj2DatTexNorm.py testship.obj
                        ^
SyntaxError: invalid syntax
>>> Obj2DatTexNorm.py testship.obj
  File "<stdin>", line 1
    Obj2DatTexNorm.py testship.obj
                             ^
SyntaxError: invalid syntax
>>> Obj2DatTexNorm.py ('testship.obj')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Obj2DatTexNorm' is not defined
>>> python Obj2DatTexNorm.py testship.obj
  File "<stdin>", line 1
    python Obj2DatTexNorm.py testship.obj
                        ^
SyntaxError: invalid syntax
>>> python Obj2DatTexNorm.py --help
  File "<stdin>", line 1
    python Obj2DatTexNorm.py --help
                        ^
SyntaxError: invalid syntax

TIA

You’re using the python console like a command line, you can’t call python from within a python shell.

side note: I don’t really see how this is related to Blender, seems like some basic python issues, probably have better luck with general python stuff over on stack exchange or some other similar tech support site.

1 Like