Forum: Poser Python Scripting


Subject: How to convert a text file to a .py?

Boni opened this issue on Mar 11, 2007 · 5 posts


Boni posted Sun, 11 March 2007 at 1:05 PM

Greetings,
I'm new to using Python Script.  I was doing a tutorial in changing lighting in Poser to take light reflections in IBL lighting and it called for a python script posted at the web site ... I copied it to a .txt file ... but now when I try to access it in Python it gives me a "null character" error.  How do I convert this to Python?  Thank you.

Boni

Boni



"Be Hero to Yourself" -- Peter Tork


EnglishBob posted Sun, 11 March 2007 at 2:01 PM

Normally when you download a script from a forum, all you have to do is change the .TXT extension for .PY. It sounds as if the file has become corrupted somehow. Where did the file come from? If one of us can download it, we can probably see where the problem is. You could try this - open the .TXT file in Notepad or similar, then save it again. That should get rid of any dodgy characters, and you can rename the extension to .PY.


nruddock posted Sun, 11 March 2007 at 2:41 PM

For Windows, you either have to change the "Folder Options" so that you can see extensions, or use the rename command from a command prompt.


Boni posted Sun, 11 March 2007 at 5:10 PM

Thank you for your response.  Here is the page:
http://www.users.on.net/~pkinnane/IBL%20Tutorial/ImportLightsFromHDRShop.py

Any help would be greatly appreciated.
Thank you
Boni

Boni



"Be Hero to Yourself" -- Peter Tork


EnglishBob posted Sun, 11 March 2007 at 5:21 PM

Here's what I did: I followed the link, and the script came up in my browser as text. I did File > Save As and selected "all files" as the type - don't accept the default, which is usually text or HTML. The script ran for me, as far as asking for a file input anyway. I didn't have anything to give it, but I guess that proves my download was working.