Database module & multithreading
Hi guys!!! Just one quick question... Which database module should I use when I want to use multi threading as my application requires lots of data from internet I also want this database module to be fast, simple n efficient, in any case multi threading capabilities are # 1 requirement. Thanx Guys Anil -- http://mail.python.org/mailman/listinfo/python-list
Re: Database module & multithreading
On Mar 10, 7:29 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: > jupiter wrote: > > Hi guys!!! > > > Just one quick question... Which database module should I use when I > > want to use multi threading as my application requires lots of data > > from internet I also want this database module to be fast, simple > > n efficient, in any case multi threading capabilities are # 1 > > requirement. > > > Thanx Guys > > > Anil > > See the threadsafety flag of Python DB-API V2 compliant database modules. > 0 = no thread safe > 1 = threads may share module > 2 = + may share connections > 3 = + may share cursors > > A+ > > Laurent. Thanx for this pointer buddy! I have done my homework. Some Database modules are not actively maintained some modules does not work with Python 2.5. At this moment I am using Sqlite3 which is pretty fast but it dosent allow me to use multi threading so which database module is better in terms of multithreading @ -- http://mail.python.org/mailman/listinfo/python-list
Re: Database module & multithreading
On Mar 10, 8:16 pm, Michael Bentley <[EMAIL PROTECTED]> wrote:
> > Thanx for this pointer buddy! I have done my homework. Some Database
> > modules are not actively maintained some modules does not work with
> > Python 2.5. At this moment I am using Sqlite3 which is pretty fast but
> > it dosent allow me to use multi threading so which database module is
> > better in terms of multithreading
>
> Actually, I think sqlite3 just requires that each thread have its own
> connection and cursor.
I tried this approach with
for each new thread
self.c1=sqlite3.connect('urls')
self.c=self.c1.cursor()
check condition
insert if true else ignore
but no success
--
http://mail.python.org/mailman/listinfo/python-list
Re: Database module & multithreading
On Mar 10, 8:16 pm, Michael Bentley <[EMAIL PROTECTED]> wrote:
> > Thanx for this pointer buddy! I have done my homework. Some Database
> > modules are not actively maintained some modules does not work with
> > Python 2.5. At this moment I am using Sqlite3 which is pretty fast but
> > it dosent allow me to use multi threading so which database module is
> > better in terms of multithreading
>
> Actually, I think sqlite3 just requires that each thread have its own
> connection and cursor.
Exception in thread Thread-2:
Traceback (most recent call last):
File "D:\Python25\lib\threading.py", line 460, in __bootstrap
self.run()
File "url_part1.py", line 161, in run
dbacc(self.o, self.dbase).dataenter()
File "url_part1.py", line 64, in dataenter
self.c.execute('insert into '+self.odbase+' values
(?,?,?,?,?,?,?,?,?,?,?,?,
?)',self.odata)
InterfaceError: Error binding parameter 3 - probably unsupported type.
this is the error I am getting
--
http://mail.python.org/mailman/listinfo/python-list
Re: Database module & multithreading
On Mar 10, 8:42 pm, [EMAIL PROTECTED] (Alex Martelli) wrote:
> jupiter <[EMAIL PROTECTED]> wrote:
>
>...
>
> > Python 2.5. At this moment I am using Sqlite3 which is pretty fast but
> > it dosent allow me to use multi threading so which database module is
> > better in terms of multithreading
>
> Perhaps psycopg2 (with PostgreSQL as the engine), according to
> <http://cheeseshop.python.org/pypi/psycopg2/2.0.2> it is specifically
> "designed for heavily multi-threaded applications that create and
> destroy lots of cursors and make a conspicuous number of concurrent
> INSERTs or UPDATEs".
>
> Alex
conn = psycopg2.connect("dbname=test user=test")
Traceback (most recent call last):
File "", line 1, in
conn = psycopg2.connect("dbname=test user=test")
OperationalError: could not connect to server: Connection refused
(0x274D/10061)
Is the server running on host "???" and accepting
TCP/IP connections on port 5432?
this is the error I am getting with psycopg2 I want to access a local
file
--
http://mail.python.org/mailman/listinfo/python-list
Conversion of string to integer
Hi guys, I have a problem. I have a list which contains strings and numeric. What I want is to compare them in loop, ignore string and create another list of numeric values. I tried int() and decimal() but without success. eq of problem is #hs=string.split(hs) hs =["popopopopop","254.25","pojdjdkjdhhjdccc","25452.25"] j=0 for o in range(len(hs)): print hs[o],o p=Decimal(hs[o]) if p > 200: j+=j print "-"*5,j print "*"*25 I could be the best way to solve this ..? @nil -- http://mail.python.org/mailman/listinfo/python-list
function & class
hi friends, I have a program like some variable definations a function ( arg1, agr2): do something with arg1 & arg2 return a list if condition do this function(arg1,arg2) else if condition do this function else do this My problem is I want to use threading and I might need to pass values between function and classes. I am not sure how this can be done. I have read about classes and I know they are like function however does not return anything where as function does. If I define class and then function in this class how do I access this function ? I am not sure and confused about classes and functions as how to go about them is there any simple way to understand difference between them and when to use what and how to pass data/reference pointer between them ? @nil Pythonist -- http://mail.python.org/mailman/listinfo/python-list
Re: function & class
c.execute("select symbol,tvolume,date,time from "+self.dbase+"
where symbol=
?",t)
ProgrammingError: SQLite objects created in a thread can only be used
in that sa
me thread.The object was created in thread id 976 and this is thread
id 944
I am getting this error when I am using sql command within
class.function accessing from another class
how can I create seperate instance for sqlite objects ???
@nil
--
http://mail.python.org/mailman/listinfo/python-list
Help regarding pattern matching
Hi People, I need some ideas on how to find pattern in random data series like stock chart. What I want is to be able to find Head & Shoulder pattern in chart. Thanx Anil -- http://mail.python.org/mailman/listinfo/python-list
No module named encodings
Having an issue with this error. I have uninstalled and reinstalled several times but I cannot solve the problem. I googled my issue but non of the solutions have worked. Sent from Mail for Windows 10 -- https://mail.python.org/mailman/listinfo/python-list
