Writeing new files

Ignacio Vazquez-Abrams ignacio at openservices.net
Fri Aug 31 00:01:54 EDT 2001


On Thu, 30 Aug 2001, Emile van Sebille wrote:

> Again, you're problem is with Create.  Try this code:
>
> class Create:
>     def __init__(self,val):
>         self.val = val
>     def __repr__(self):
>         return repr(self.val)
>
> name= Create('Name')
>
> print '%s' % name
>
> class Create:
>     def __init__(self,val):
>         self.val = val
>     def __str__(self):
>        return str(self.val)
>
> name= Create('Name')
>
> print '%s' % name
>
> If Create is coming out of Blender, look in dir(name) to see if the name is
> already an attribute.  I don't have Blender so I can't check it for you.  If
> there's a Blender mailing list, try it as well.
>
> HTH,
>
> --
>
> Emile van Sebille
> emile at fenx.com

Create() is coming out of Blender.Draw.

I've downloaded Blender and am trying to look at the problem, but it doesn't
seem to work on my system very well.

Eber, grab the following file:

  http://www.blender.nl/resource/python/blends/console.zip

Open the file, erase the contents of the top window, and put this in its
place:

---
import Blender
from Blender.Draw import *

print 'test'
name=Create('Name')
print 'Name'
print Name
---

Then play it and report back.

-- 
Ignacio Vazquez-Abrams  <ignacio at openservices.net>









More information about the Python-list mailing list