Re: [Tutor] Difficulty Understanding Example Code for Blender Script

2010-07-21 Thread Marc Tompkins
On Wed, Jul 21, 2010 at 9:48 PM, Andrew Martin wrote:

> This code was part of a Blender script to build a 3d bar graph, so I don't
> know if understanding Blender is a prereq for understanding this code. The
> function is for the axis labels.
>
> def label(text,position,orientation='z'):
> txt=Text3d.New('label')
> txt.setText(text)
> ob=Scene.GetCurrent().objects.new(txt)
> ob.setLocation(*position)
> if orientation=='x':
> ob.setEuler(-pi/2.0,0,0)
> elif orientation=='z':
> ob.setEuler(0,0,pi/2.0)
> print 'label %s at %s along %s' %(text,position,orientation)
>
>  I understand it for the most part except for the orientation part. I
> assume orientation is for the 3d text object, but how is it determined
> whether it is x or z?


I don't use Blender myself, so this will be a more generic, high-level
answer...

> def label(text,position,orientation='z'):
>
This definition specifies that label() takes two mandatory parameters - text
and position - and one optional parameter, orientation.  What makes
"orientation" optional is the fact that a default value is supplied:
"orientation='z'".  In other words, "orientation" is equal to "z" unless you
specify otherwise in your call to label().

Take a look at this section of the Python docs:
http://docs.python.org/tutorial/controlflow.html#more-on-defining-functions

Hope that helps...
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Difficulty Understanding Example Code for Blender Script

2010-07-21 Thread Andrew Martin
This code was part of a Blender script to build a 3d bar graph, so I don't
know if understanding Blender is a prereq for understanding this code. The
function is for the axis labels.

def label(text,position,orientation='z'):
txt=Text3d.New('label')
txt.setText(text)
ob=Scene.GetCurrent().objects.new(txt)
ob.setLocation(*position)
if orientation=='x':
ob.setEuler(-pi/2.0,0,0)
elif orientation=='z':
ob.setEuler(0,0,pi/2.0)
print 'label %s at %s along %s' %(text,position,orientation)

 I understand it for the most part except for the orientation part. I assume
orientation is for the 3d text object, but how is it determined whether it
is x or z? Please keep replies simple; I am a newcomer to programming (and
if this makes no sense at all, I would appreciate polite inquiries for more
info).

Using Blender 2.49b and Python 2.6

Thanks a bunch,
amartin7211
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] attachments?

2010-07-21 Thread Lang Hurst

Naw, didn't come through.

On 07/21/2010 08:08 PM, Alex Hall wrote:

--
There are no stupid questions, just stupid people.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] SQLite database locked problem

2010-07-21 Thread Che M



Date: Tue, 20 Jul 2010 07:28:45 +0200
From: cwi...@compuscan.co.za
To: pine...@hotmail.com
CC: tutor@python.org
Subject: Re: [Tutor] SQLite database locked problem






  
  


On 20/07/2010 06:48, Che M wrote:

  I'm
using an SQLite3 database (with Python 2.5) and every so often the
application crashes or hangs because somewhere there is this error, or
something like it:

  

OperationalError:  database is locked.

  

This is probably because I am viewing and sometimes changing the
database through SQLite Database Browser while working on my app, and
occasionally the app tries to access the db when the Database Browser
is writing to it or something like that.

  

I'd like to a) know how to reproduce the error (haven't seen it in a
while, but want to be sure  know when it may happen for users and b)
prevent it from being a problem in the running app.  

  

Any suggestions welcome.  Thank you,

Che

  

  Hotmail is redefining busy with tools for the New Busy. Get more
from your inbox. See how.
  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
  



? SQLite is technically thread safe, but a write operation locks the
entire 

> database [1]:
> - Any resultset being step()'d through uses a shared read-only lock. 

> - Any insert/update being executed requires an exclusive write lock.





Thanks, that's fine to know, but what do I do in Python to address my concern?  



Che

  
_
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] attachments?

2010-07-21 Thread Alex Hall
-- 
Have a great day,
Alex (msg sent from GMail website)
mehg...@gmail.com; http://www.facebook.com/mehgcap
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Observer design pattern: request for feedback

2010-07-21 Thread chombee
Hi,

I decided I wanted to use the Observer design pattern in my application.
I did a little googling, but all the examples that I found of Observer
in Python seemed over-complicated, so I wrote my own simple version. It
doesn't have as many features as other Observer implementations might,
but it's a start. Any critical comments or suggestions would be greatly
appreciated. The code is here:

https://gist.github.com/90d8b7ec425ac92f5539

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] has it gone quiet or is it just me?

2010-07-21 Thread Robert Berman
Same.

Robert

> -Original Message-
> From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor-
> bounces+bermanrl=cfl.rr@python.org] On Behalf Of Luke
> Paireepinart
> Sent: Wednesday, July 21, 2010 2:05 PM
> To: Alan Gauld
> Cc: tutor@python.org
> Subject: Re: [Tutor] has it gone quiet or is it just me?
> 
> Not sure Alan.
> I haven't gotten any messages either, but this one came through just
> fine.
> -Luke
> 
> On Wed, Jul 21, 2010 at 12:55 PM, Alan Gauld
>  wrote:
> > I haven't had any tutor messages in 2 days.
> > Do I have a problem or are things just very quiet suddenly?
> > The archive isn't showing anything either which makes me
> suspicious.
> >
> > ___
> > Tutor maillist  -  tu...@python.org
> > To unsubscribe or change subscription options:
> > http://mail.python.org/mailman/listinfo/tutor
> >
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] has it gone quiet or is it just me?

2010-07-21 Thread Corey Richardson
The "SQLite Database locked problem" was yesterday at 12:48 AM, I'm 
guessing you didn't count that? ;)


Alan Gauld wrote:

I haven't had any tutor messages in 2 days.
Do I have a problem or are things just very quiet suddenly?
The archive isn't showing anything either which makes me suspicious.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] has it gone quiet or is it just me?

2010-07-21 Thread Lowell Tackett
You folks are just so good at what you do here that you've answered everybody's 
questions.  Everyone's happy right now.
>From the virtual desk of Lowell Tackett  



--- On Wed, 7/21/10, Alan Gauld  wrote:

> From: Alan Gauld 
> Subject: [Tutor] has it gone quiet or is it just me?
> To: tutor@python.org
> Date: Wednesday, July 21, 2010, 1:55 PM
> I haven't had any tutor messages in 2
> days.
> Do I have a problem or are things just very quiet
> suddenly?
> The archive isn't showing anything either which makes me
> suspicious.
> 
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
> 


  

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] has it gone quiet or is it just me?

2010-07-21 Thread Hugo Arts
Damnit guys, I was hoping everyone would stay real quiet so we could
freak Alan out a bit ;-)

On Wed, Jul 21, 2010 at 8:14 PM, Alan Gauld  wrote:
> OK, from the fact I got two replies and Luke hasn't had anything either
> I'll assume all is ok and things are just quiet :-)
>
>
> "Alan Gauld"  wrote in message
> news:i27cac$uc...@dough.gmane.org...
>>
>> I haven't had any tutor messages in 2 days.
>> Do I have a problem or are things just very quiet suddenly?
>> The archive isn't showing anything either which makes me suspicious.
>>
>> ___
>> Tutor maillist  -  tu...@python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/mailman/listinfo/tutor
>>
>
>
> ___
> Tutor maillist  -  tu...@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] has it gone quiet or is it just me?

2010-07-21 Thread Shashwat Anand
On Wed, Jul 21, 2010 at 11:44 PM, Alan Gauld wrote:

> OK, from the fact I got two replies and Luke hasn't had anything either
> I'll assume all is ok and things are just quiet :-)
>

Yes. c-l-p is having decent traffic though.


>
>
> "Alan Gauld"  wrote in message
> news:i27cac$uc...@dough.gmane.org...
>
>  I haven't had any tutor messages in 2 days.
>> Do I have a problem or are things just very quiet suddenly?
>> The archive isn't showing anything either which makes me suspicious.
>>
>> ___
>> Tutor maillist  -  Tutor@python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/mailman/listinfo/tutor
>>
>>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>



-- 
~l0nwlf
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] has it gone quiet or is it just me?

2010-07-21 Thread William Witteman
On Wed, Jul 21, 2010 at 06:55:25PM +0100, Alan Gauld wrote:
>I haven't had any tutor messages in 2 days.
>Do I have a problem or are things just very quiet suddenly?
>The archive isn't showing anything either which makes me suspicious.

It's not just you.  I've been hearing crickets as well.
-- 

yours,

William

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] has it gone quiet or is it just me?

2010-07-21 Thread Alan Gauld
OK, from the fact I got two replies and Luke hasn't had anything 
either

I'll assume all is ok and things are just quiet :-)


"Alan Gauld"  wrote in message 
news:i27cac$uc...@dough.gmane.org...

I haven't had any tutor messages in 2 days.
Do I have a problem or are things just very quiet suddenly?
The archive isn't showing anything either which makes me suspicious.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor




___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] has it gone quiet or is it just me?

2010-07-21 Thread David Abbott
On Wed, Jul 21, 2010 at 1:55 PM, Alan Gauld  wrote:
> I haven't had any tutor messages in 2 days.
> Do I have a problem or are things just very quiet suddenly?
> The archive isn't showing anything either which makes me suspicious.
>
Hi Alan,
Sorry have not been paying attention, but did get this as you I hope can see :)
David

-- 
David Abbott (dabbott)
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] has it gone quiet or is it just me?

2010-07-21 Thread Luke Paireepinart
Not sure Alan.
I haven't gotten any messages either, but this one came through just fine.
-Luke

On Wed, Jul 21, 2010 at 12:55 PM, Alan Gauld  wrote:
> I haven't had any tutor messages in 2 days.
> Do I have a problem or are things just very quiet suddenly?
> The archive isn't showing anything either which makes me suspicious.
>
> ___
> Tutor maillist  -  tu...@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] has it gone quiet or is it just me?

2010-07-21 Thread Alan Gauld

I haven't had any tutor messages in 2 days.
Do I have a problem or are things just very quiet suddenly?
The archive isn't showing anything either which makes me suspicious.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor