pyosd question

2007-03-19 Thread Eugene Antimirov
Small script used to work, by last week I noticed that it simply hangs 
up. Can someone run this code on his own python and tell me about 
results? Help me please.

import time
import pyosd
import re

default_font="-adobe-helvetica-medium-r-*-*-24-*"

interval = 2
temp_led_number = pyosd.osd(default_font, colour='#038b06',
  
timeout=1,pos=pyosd.POS_BOT,offset=40,shadow=1,align=pyosd.ALIGN_CENTER)
   
def display():
# Here it will stay forever
temp_led_number.display('123', pyosd.TYPE_STRING)
# Never reach this line :(
print "Yeah!"
   
while 1:
display()
    time.sleep(interval)


-- 
Sincerely,
Eugene Antimirov
PortaOne, Inc., SIP Engineer
[EMAIL PROTECTED]

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: newbie question

2007-01-22 Thread Eugene Antimirov
kavitha thankaian wrote:
> Hi,
>  
> i wrote a simple script (which follows) to insert a table in the 
> database.i could execute this query and get the result in python 
> shell.but when i open "my sql enterprise manager" i couldnt find the 
> table"animals".it would be so kind of you if someone could help me,,,
>  
>  
> import dbi
> import odbc
> conn=odbc.odbc("DSN=mydatabase;UID=xxx;PWD=yyy")
> cursor=conn.cursor()
> cursor.execute("Create table animals(parent char(50),child char(50))")
> cursor.execute("insert into animals values('lion','cub')")
> cursor.execute("insert into animals values('goat','lamb')")
> cursor.execute("select * from animals")
> print cursor.fetchall()
>  
>  
> Rgds
> Kavitha
>
> 
You've probably missed cursor.commit() ;)

-- 
Sincerely,
Eugene Antimirov
PortaOne, Inc., SIP Support Engineer
[EMAIL PROTECTED]

* For further Billing and Technical information:
=> Please visit our website http://www.portaone.com
=> Please visit our forum http://forum.portaone.com

* Meet us at Internet Telephony Conference & Expo
* Ft. Lauderdale, FL - January 24-26, 2007 - Booth 1322
* http://www.tmcnet.com/voip/conference/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: newbie question

2007-01-22 Thread Eugene Antimirov
Eugene Antimirov wrote:
> You've probably missed cursor.commit() ;)
Sorry, my bad:

conn.commit() is correct one AFAIR.


-- 
Sincerely,
Eugene Antimirov
PortaOne, Inc., SIP Support Engineer
[EMAIL PROTECTED]

* For further Billing and Technical information:
=> Please visit our website http://www.portaone.com
=> Please visit our forum http://forum.portaone.com

* Meet us at Internet Telephony Conference & Expo
* Ft. Lauderdale, FL - January 24-26, 2007 - Booth 1322
* http://www.tmcnet.com/voip/conference/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Working with shared folders

2007-01-23 Thread Eugene Antimirov
Marcpp wrote:
> Any idea to work with windows shared folders?
> Which library is needed to execute console comands?
>   
Don't you want to look at fusesmb first and then work with windows files 
and dirs as well as with any others.

-- 
Sincerely,
Eugene Antimirov
PortaOne, Inc., SIP Support Engineer
[EMAIL PROTECTED]

* For further Billing and Technical information:
=> Please visit our website http://www.portaone.com
=> Please visit our forum http://forum.portaone.com

* Meet us at Internet Telephony Conference & Expo
* Ft. Lauderdale, FL - January 24-26, 2007 - Booth 1322
* http://www.tmcnet.com/voip/conference/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: another newbie question: why should you use "*args" ?

2007-01-31 Thread Eugene Antimirov
stef wrote:

> # method 2
> def chunk_plot(self, list):
> for i in range ( len(list) ):
>   do something


And one note more. Just to be more pythonic you shouldn't use form 
range(len(blabla)). Instead use:

for i in list:
blabla...


-- 
Sincerely,
Eugene Antimirov
PortaOne, Inc., SIP Support Engineer
[EMAIL PROTECTED]

-- 
http://mail.python.org/mailman/listinfo/python-list