Re: can i set up a mysql db connection as a class ?

2006-04-27 Thread *binarystar*
On 04/28/2006 07:54 AM, *binarystar* wrote: > > Just wondering: is there any risk of two threads accessing the Execute > function at the same time and getting something like this on the same > cursor object: > > thread_1: self.cursor.Execute( sql_statement ) > threa

Re: append function problem?

2006-04-27 Thread *binarystar*
# Try This seed = [2, 3, 4, 5] next = [7] seed1 = seed + next [EMAIL PROTECTED] wrote: > hello, recently i tried to use list.append() function in seemingly > logical ways, however, i cannot get it to work, here is the test code: > seed = [2, 3, 4, 5] next = 7 seed1 = seed.append(

Re: can i set up a mysql db connection as a class ?

2006-04-27 Thread *binarystar*
Oops .. slight edit now when you pass the db_connection instance to other classes, a reference will be passed automagically -- http://mail.python.org/mailman/listinfo/python-list

Re: can i set up a mysql db connection as a class ?

2006-04-27 Thread *binarystar*
your on the right track ... create something like this ( hope the formatting doesn't go to hay wire ) class DB_Connector(object): """ Humble Database Connection Class """ def __init__(self, host="localhost", user="MyUser",passwd="MyPassword", **other_db_arguments):

Re: can i set up a mysql db connection as a class ?

2006-04-27 Thread *binarystar*
that's definitely the way to go .. -create a database_object -initialise at start up -then pass the database object to other classes as needed ... If you want to get really fancy have a look at some ORM's ... I think there is a Python one called SQLObject? [EMAIL PROTECTED] wrote: > hey there,

Introspection Class/Instance Name

2006-04-25 Thread *binarystar*
Hello there, what method would you use to return the name of the class and/or instance introspectively eg. class Bollocks: def __init__( self ): print self.__method_that_returns_class_name__() print self.__method_that_returns_inst

Control Printer Queue On Windows 2000/XP

2005-06-30 Thread binarystar
Hi folks, I am writing a script to print a few thousand pdf documents and I need to have some control over the number of jobs that are sent to the printer queue at time ... something along the lines of if number_jobs > MAX_JOBS: time.sleep(10) else: #Print More Files I have been investi