Forum: Blender


Subject: python scripts

blueblott opened this issue on Apr 26, 2009 · 5 posts


blueblott posted Sun, 26 April 2009 at 4:55 AM

***Hey.
just getting to grips with PYTHON scripts in Blender.

When trying to open some scripts that i have imported myself i get the read console error message which when checked at Python .org in a lot of cases the error is caused by a latin
code entered in the script. Entering a magic line into the script is a bit beyond me at the moment  ...............soo where do i find a good site to download scripts that would work in 2.48a.
Plenty out there i know, can you suggest any good ones
Can you have older versions of Python installed with the recent versions without conflicts?

Thanks for reading

Regards
blueblott



oldskoolPunk posted Mon, 27 April 2009 at 12:42 PM

Yes you can have more than one python installed.

Usually script errors are from certain data not being present and the writer not including all fail-safes.

For example, many export scripts will report an error if the object you are trying to export doesn't have uv coordinates.

So just check whatever it is you are doing, and maybe post some more specific information on an individual error you are getting?

Here are some.


blueblott posted Tue, 28 April 2009 at 2:44 AM

**Thanks oldschoolpunk ,
So if a script was made useing an older version of Python would you have to have that older version installed? or does the present Python open older scripts ok ?

Have attached  console error message that if you have a moment perhaps you would be able to give me a few clues .

I thought the sun script would be handy to have it did involve two scripts.

It seems some scripts just dont even get into  the scripts menu after clicking the "update"
button ?
**
File" ", line one, in< module>
File "C:Program filesBlender FoundationBlender.blenderscriptsinsect-walk
-0.4.py" line 150
SyntaxError: Non -ASCII character ' xbo' in file C:Program Files Blender Foundation.blender
scriptsinsect-walk-0.4py on line 150,but no encoding declared; see http://www.python,org/
peps//pep-0263.html for details.

File "", line 1, in
File "C;Program filesBlender FoundationBlender.blenderscripts_D.py",
line 82
SyntaxError; Non-ASCii character  'xao'  in file C;Program filesBlender FoundationBlender
scriptssun_D.py on line 83, but no encoding declared:see  ......0263 as above.

Thanks for your help


nruddock posted Tue, 28 April 2009 at 1:44 PM

The problem here is some non-ASCII characters.
A possible fix for this (based on reading the PEP mentioned in the error) is to add one of the following as the first line of the file :-

# coding: utf-8
# coding: latin-1
# coding: iso-8859-15

blueblott posted Wed, 29 April 2009 at 5:43 AM

**Thanks nruddock,

Will give that a go .

Regards
blueblott.
**