Fastest database solution

2009-02-06 Thread Curt Hash
I'm writing a small application for detecting source code plagiarism that currently relies on a database to store lines of code. The application has two primary functions: adding a new file to the database and comparing a file to those that are already stored in the database. I started out using

Re: urllib2 performance on windows, usb connection

2009-02-06 Thread Duncan Booth
dq wrote: > This runs great on Ubuntu. I get DL speeds of about 1.5 Mb/s on the > SATA HD or on a usb-connected iPod, but if I run the same program on > Windows (with a 2 GHz core 2 duo, 7200 rpm sata drive---better hardware > specs than the Ubuntu box), it maxes out at about 500 kb/s. Worse

Re: Fastest database solution

2009-02-06 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Curt Hash wrote: > I started out using sqlite3, but was not satisfied with the performance > results. I then tried using psycopg2 with a local postgresql server, and > the performance got even worse. SQLite is in the same process. Communication with

Re: Is c.l.py becoming less friendly?

2009-02-06 Thread Mark Dickinson
On Feb 6, 6:23 am, "Hendrik van Rooyen" wrote: > I think this thread has buggered up a perfectly ^^^ Such language. I'm appalled. Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Fastest database solution

2009-02-06 Thread Tino Wildenhain
Hi Curt, Curt Hash wrote: I'm writing a small application for detecting source code plagiarism that currently relies on a database to store lines of code. The application has two primary functions: adding a new file to the database and comparing a file to those that are already stored in the

Question on Strings

2009-02-06 Thread Kalyankumar Ramaseshan
Hi, Excuse me if this is a repeat question! I just wanted to know how are strings represented in python? I need to know in terms of: a) Strings are stored as UTF-16 (LE/BE) or UTF-32 characters? b) They are converted to utf-8 format when it is needed for e.g. when storing the string to disk o

Re: Fastest database solution

2009-02-06 Thread Jeroen Ruigrok van der Werven
-On [20090206 09:11], Curt Hash (curt.h...@gmail.com) wrote: >I'm writing a small application for detecting source code plagiarism that >currently relies on a database to store lines of code. > >The application has two primary functions: adding a new file to the database >and

Re: i have an query regarding pyodbc

2009-02-06 Thread Rahul
On Feb 6, 3:53 pm, Rahul wrote: > On Feb 6, 11:27 am, Rahul wrote: > > > > > hello all, > > > I have installed pyodbc on my red hat enterprise 4 linux machine but > > when i go to use that using statement, > > > import pyodbc > > > through python console it gives me error as > > > ImportError : d

Changing return of type(obj)

2009-02-06 Thread Ken Elkabany
Hello, I am attempting to fully-simulate an 'int' object with a custom object type. It is part of a library I am creating for python futures and promises. Is there anyway such that type(my_object) can return ? Or for that matter, any other primitive? I do not care how dirty the solution might poss

Re: Changing return of type(obj)

2009-02-06 Thread Chris Rebert
On Fri, Feb 6, 2009 at 3:03 AM, Ken Elkabany wrote: > Hello, > > I am attempting to fully-simulate an 'int' object with a custom object type. > It is part of a library I am creating for python futures and promises. Is > there anyway such that type(my_object) can return ? Or for that > matter, any

Re: kinterbasdb + firebird 1.5 with python 2.6 ?

2009-02-06 Thread Uwe Grauer
Laszlo Nagy wrote: > Uwe Grauer írta: >> Laszlo Nagy wrote: >> Get it from here: >> http://www.firebirdsql.org/index.php?op=devel&sub=python >> > Thanks. Unfortunately, this does not support Firebird 1.5 anymore. I can > only find Python 2.5 + Firebird 1.5. But not for Python 2.6. I'm going > to

Re: sorting for recursive folder rename

2009-02-06 Thread Peter Otten
ianaré wrote: > On Dec 16 2008, 7:36 pm, "Rhodri James" > wrote: >> On Tue, 16 Dec 2008 18:20:52 -, ianaré wrote: >> > Hello all, >> >> > I trying to recursivelyrenamefolders and files, and am looking for >> > some ideas on the best way of doing this. The problem is that the >> > given list

Re: Changing return of type(obj)

2009-02-06 Thread Christian Heimes
Ken Elkabany schrieb: > I would simply subclass 'int', but this object needs to be general enough to > pretend to be an 'int', 'NoneType', 'str', etc... A long shot: Can I change > the base class on an instance by instance basis depending on the need? Well, > now I can imagine having a class factor

Re: Question on Strings

2009-02-06 Thread John Machin
On Feb 6, 9:24 pm, Chris Rebert wrote: > On Fri, Feb 6, 2009 at 1:49 AM, Kalyankumar Ramaseshan > > wrote: > > > Hi, > > > Excuse me if this is a repeat question! > > > I just wanted to know how are strings represented in python? > > > I need to know in terms of: > > > a) Strings are stored as UT

Re: Fastest database solution

2009-02-06 Thread M.-A. Lemburg
On 2009-02-06 09:10, Curt Hash wrote: > I'm writing a small application for detecting source code plagiarism that > currently relies on a database to store lines of code. > > The application has two primary functions: adding a new file to the database > and comparing a file to those that are alrea

Re: Python 3.0 slow file IO

2009-02-06 Thread thomasvang...@gmail.com
Thanks a lot for all the responses. I'll move back to Python 2.5 for compatibility with SciPY and some other third party packages. I'll leave the compilation process for some other day, for now I'm a happy user, mayve In the future I would like to contribute to the developmental process.. -- http:/

Re: What is difference between ADO and RDO

2009-02-06 Thread OdarR
On 6 fév, 10:56, Agile Consulting wrote: > Explain ADO and RDO RU a bot ? Olivier -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-02-06 Thread agile
On Jan 31, 1:54 am, Christian Heimes wrote: > Michael Torrie schrieb: > > >> It all depends on implementation, I think even we can make "C" object > >> oriented with proper implementation. > > > Indeed, any code based on gobject libraries can be object-oriented in > > design and function. > > The

Re: Skipping bytes while reading a binary file?

2009-02-06 Thread Krzysztof Retel
On Feb 5, 11:51 pm, Lionel wrote: > On Feb 5, 3:35 pm, Lionel wrote: > > > > > On Feb 5, 2:56 pm, Lionel wrote: > > > > On Feb 5, 2:48 pm, MRAB wrote: > > > > > Lionel wrote: > > > > >  > Hello, > > > >  > I have data stored in binary files. Some of these files are > > > >  > huge...upwards of

Re: Scanning a file character by character

2009-02-06 Thread Jorgen Grahn
On Wed, 4 Feb 2009 22:48:13 -0800 (PST), Spacebar265 wrote: > Hi. Does anyone know how to scan a file character by character and > have each character so I can put it into a variable. I am attempting > to make a chatbot and need this to read the saved input to look for > spelling mistakes and fur

Re: Skipping bytes while reading a binary file?

2009-02-06 Thread Slaunger
You might also want to have a look at a numpy memmap viewed as a recarray. from numpy import dtype, memmap, recarray # Define your record in the file, 4bytes for the real value, # and 4 bytes for the imaginary (assuming Little Endian repr) descriptor = dtype([("r", "http://mail.python.org/mailman

Re: programming by evolution?

2009-02-06 Thread Pascal Costanza
Xah Lee wrote: Pascal Constanza is a Common Lisp fanatic. It's Costanza, not Constanza. Thank you, Pascal -- ELS'09: http://www.european-lisp-symposium.org/ My website: http://p-cos.net Common Lisp Document Repository: http://cdr.eurolisp.org Closer to MOP & ContextL: http://common-lisp.net/

WIn32api

2009-02-06 Thread K-Dawg
Hi, I have a python script that I want to run in the system tray and system tray only (windows system). I am looking at the win32gui_taskbar.py demo file but am having trouble making sense of what parts do. I understand what the whole does but I want to actually learn what it is doing so I can a

Distributing simple tasks

2009-02-06 Thread Noam Aigerman
Hi, Suppose I have an array of functions which I execute in threads (each thread get a slice of the array, iterates over it and executes each function in it's slice one after the other). Now I want to distribute these tasks between two machines, i.e give each machine half of the slices and let it

ANN: SuPy - Script Sketchup with Python

2009-02-06 Thread greg
SuPy 1.0 SuPy is a plugin for the Sketchup 3D modelling application that lets you script it in Python. http://www.cosc.canterbury.ac.nz/SuPy/ This is a first version and is highly experimental. Let me know if it works for you and whether you have any problems. -- Greg Ewing greg.ew.

Re: updating nntplib

2009-02-06 Thread Gerhard Häring
Travis wrote: > Hello all, > > There are some notable deficiencies in nntlib. Here are two: [...] Be sure to add a bug report/patch to the Python bug tracker. http://bugs.python.org/ Anything else will most likely be overlooked or forgotten. -- Gerhard -- http://mail.python.org/mailman/listi

Re: Question on Strings

2009-02-06 Thread Hendrik van Rooyen
"John Machin" wrote: >By the way, has anyone come up with a name for the shifting effect >observed above on str, and also with repr, range, and the iter* >family? If not, I suggest that the language's association with the >best of English humour be widened so that it be dubbed the "Mad >Hatter's

Re: ANN: SuPy - Script Sketchup with Python

2009-02-06 Thread paul
greg schrieb: SuPy 1.0 SuPy is a plugin for the Sketchup 3D modelling application that lets you script it in Python. Great, will give it a try. http://www.cosc.canterbury.ac.nz/SuPy/ I think you meant to write http://www.cosc.canterbury.ac.nz/~greg/SuPy/ This is a first versio

Re: self-aware list of objects able to sense constituent member alterations?

2009-02-06 Thread greyw...@gmail.com
On Jan 28, 4:37 am, John O'Hagan wrote: > On Tue, 27 Jan 2009, Reckoner wrote: > > I'm not sure this is possible, but I would like to have > > a list of  objects > > > A=[a,b,c,d,...,z] > > > where,  in the midst of a lot of processing I might do something like, > > > A[0].do_something_which_chang

Re: database wrapper ?

2009-02-06 Thread Christian
On Feb 1, 5:56 pm, Stef Mientki wrote: > Is SQLalchemy the best / most popular database wrapper ? > Are there any alternatives ? As others have confirmed, SQLAlchemy is far and away the most popular Python ORM. Another one to have a look at though is Dejavu (http://www.aminus.net/ dejavu). The

Re: database wrapper ?

2009-02-06 Thread Christian
On Feb 6, 10:17 am, Christian wrote: > One of its distinctives is that ... Not sure how I forgot this, but Dejavu also lets you write your datastore queries in a LINQ-like syntax. Robert Brewer, the author, is giving a talk [1] about it at this year's PyCon in the US. Christian http://www.dowsk

Re: Using cPickle

2009-02-06 Thread Steve Holden
mmcclaf wrote: > Hi there, > > I have to make a small database using cPickle. I'm having troubles > trying to read in the information if it's more than one line. I'm > pretty sure it's in the line "for line in stuff:" Can anyone help me > out? Basically the end result is wanting it to look somethi

Object explorer for python ?

2009-02-06 Thread Linuxguy123
Is there a (stand alone ?) object explorer for python objects such as the PyQt4 collection ? How else could I find out what is in PyQt4.QtCore, .QtGui and .QtWebKit ? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Power Point Slides

2009-02-06 Thread Benjamin Kaplan
On Fri, Feb 6, 2009 at 7:09 AM, Steve Holden wrote: > Tehseen Siddiqui wrote: > > > > > > DISCLAIMER: The information in this email is confidential and may be > > legally privileged. [... etc.] > > What information? We ca

RE: Distributing simple tasks

2009-02-06 Thread Noam Aigerman
Hi, The delta between the finishing times of each machine is insignificant compared to the actual runtime, thus I don't feel it's necessary at the moment. Anyway, I want to keep it simple until I understand how to distribute tasks J Thanks! From: Thomas Raef [mailto:tr...@ebasedsecurity.com]

Re: ANN: SuPy - Script Sketchup with Python

2009-02-06 Thread Steve Spicklemire
Hi Greg, Hm... "SuPy not found on this sever." ;-( Is there a better URL.. or did I just check too soon? thanks, -steve On Feb 5, 2009, at 11:56 PM, greg wrote: SuPy 1.0 SuPy is a plugin for the Sketchup 3D modelling application that lets you script it in Python. http://www.cosc

Re: Tkinter w.pack()?

2009-02-06 Thread W. eWatson
... The use of "letmegooglethatforyou" (not my video tool, by the way) is to point out that with the right search string you could have answered the question for yourself. Since you didn't appear to know that Google allowed you to search a single site (something I perhaps take for granted) I a

Re: Changing return of type(obj)

2009-02-06 Thread Ken Elkabany
I would simply subclass 'int', but this object needs to be general enough to pretend to be an 'int', 'NoneType', 'str', etc... A long shot: Can I change the base class on an instance by instance basis depending on the need? Well, now I can imagine having a class factory that will spawn for me the c

RE: Distributing simple tasks

2009-02-06 Thread Thomas Raef
Hi, Suppose I have an array of functions which I execute in threads (each thread get a slice of the array, iterates over it and executes each function in it's slice one after the other). Now I want to distribute these tasks between two machines, i.e give each machine half of the slices and let

Re: i have an query regarding pyodbc

2009-02-06 Thread Rahul
On Feb 6, 11:27 am, Rahul wrote: > hello all, > > I have installed pyodbc on my red hat enterprise 4 linux machine but > when i go to use that using statement, > > import pyodbc > > through python console it gives me error as > > ImportError : dynamic module does not define init function > (initpy

thread-local data

2009-02-06 Thread Emanuele D'Arrigo
Hi everybody, Assuming a snippet such as: threadLocalData = threading.local() threadLocalData.myDictionary = self.myDictionary is it correct to say that threadLocalData.myDictionary is NOT a thread- local -copy- of self.myDictionary but it's actually pointing to the same object? If that's the c

Using cPickle

2009-02-06 Thread mmcclaf
Hi there, I have to make a small database using cPickle. I'm having troubles trying to read in the information if it's more than one line. I'm pretty sure it's in the line "for line in stuff:" Can anyone help me out? Basically the end result is wanting it to look something like what is down below

Re: Python Power Point Slides

2009-02-06 Thread Steve Holden
Tehseen Siddiqui wrote: > > > DISCLAIMER: The information in this email is confidential and may be > legally privileged. [... etc.] What information? -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC

Re: ANN: SuPy - Script Sketchup with Python

2009-02-06 Thread Gary Herron
greg wrote: > SuPy 1.0 > > > SuPy is a plugin for the Sketchup 3D modelling application > that lets you script it in Python. > > http://www.cosc.canterbury.ac.nz/SuPy/ That URL fails with a 404 - not found. (At least for me at this moment in time.) > > This is a first version and is

Re: WIn32api

2009-02-06 Thread K-Dawg
I have come up with what I need and will try tweaking some things that hopefully will help me learn what some of this stuff does. In the meantime, I am having an issue: class *KeepAlive*(threading.Thread): def *__init__*(*self*): *self*.count = 0 *self*.ie=win32com.client.

Re: Question on Strings

2009-02-06 Thread MRAB
John Machin wrote: > On Feb 6, 9:24 pm, Chris Rebert wrote: >> On Fri, Feb 6, 2009 at 1:49 AM, Kalyankumar Ramaseshan >> >> wrote: >> >>> Hi, >>> Excuse me if this is a repeat question! >>> I just wanted to know how are strings represented in python? >>> I need to know in terms of: >>> a) String

Re: Question on Strings

2009-02-06 Thread Chris Rebert
On Fri, Feb 6, 2009 at 1:49 AM, Kalyankumar Ramaseshan wrote: > > Hi, > > Excuse me if this is a repeat question! > > I just wanted to know how are strings represented in python? > > I need to know in terms of: > > a) Strings are stored as UTF-16 (LE/BE) or UTF-32 characters? IIRC, Depends on wha

Re: Question on Strings

2009-02-06 Thread Tino Wildenhain
Hi, Kalyankumar Ramaseshan wrote: Hi, Excuse me if this is a repeat question! I just wanted to know how are strings represented in python? It depents on if you mean python2.x or python3.x - the model changed. Python 2.x knows str and unicode - the former a sequence of single byte character

Re: Object explorer for python ?

2009-02-06 Thread Mike Driscoll
On Feb 6, 9:49 am, Linuxguy123 wrote: > Is there a (stand alone ?) object explorer for python objects such as > the PyQt4 collection ? > > How else could I find out what is in PyQt4.QtCore, .QtGui > and .QtWebKit ? > > Thanks I like WingWare for this sort of thing, but you might like eric. Links

Re: Tkinter w.pack()?

2009-02-06 Thread MRAB
W. eWatson wrote: ... The use of "letmegooglethatforyou" (not my video tool, by the way) is to point out that with the right search string you could have answered the question for yourself. Since you didn't appear to know that Google allowed you to search a single site (something I perhaps ta

Re: thread-local data

2009-02-06 Thread MRAB
Emanuele D'Arrigo wrote: > Hi everybody, > > Assuming a snippet such as: > > threadLocalData = threading.local() > threadLocalData.myDictionary = self.myDictionary > > is it correct to say that threadLocalData.myDictionary is NOT a thread- > local -copy- of self.myDictionary but it's actually poin

Re: Tkinter w.pack()?

2009-02-06 Thread Steve Holden
W. eWatson wrote: > ... >>> >> The use of "letmegooglethatforyou" (not my video tool, by the way) is to >> point out that with the right search string you could have answered the >> question for yourself. >> >> Since you didn't appear to know that Google allowed you to search a >> single site (some

Re: Is c.l.py becoming less friendly?

2009-02-06 Thread Richard Levasseur
On Feb 5, 8:02 am, Dan Upton wrote: > On Thu, Feb 5, 2009 at 11:00 AM, mk wrote: > > > (duck) > > > 542 comp.lang.python rtfm > > > 467 comp.lang.python shut+up > > > 263 comp.lang.perl rtfm > > > 45 comp.lang.perl shut+up > > But over how many messages for each group?  Wouldn't the percentage of

Re: thread-local data

2009-02-06 Thread Diez B. Roggisch
Emanuele D'Arrigo schrieb: Hi everybody, Assuming a snippet such as: threadLocalData = threading.local() threadLocalData.myDictionary = self.myDictionary is it correct to say that threadLocalData.myDictionary is NOT a thread- local -copy- of self.myDictionary but it's actually pointing to the

Re: thread-local data

2009-02-06 Thread Diez B. Roggisch
Diez B. Roggisch schrieb: Emanuele D'Arrigo schrieb: Hi everybody, Assuming a snippet such as: threadLocalData = threading.local() threadLocalData.myDictionary = self.myDictionary is it correct to say that threadLocalData.myDictionary is NOT a thread- local -copy- of self.myDictionary but it'

Re: Question on Strings

2009-02-06 Thread Terry Reedy
John Machin wrote: The UTF-n siblings are *external* representations. 2.x: a_unicode_object.decode('UTF-16') -> an_str_object 3.x: an_str_object.decode('UTF-16') -> a_bytes_object That should be .encode() to bytes, which is the coded form. .decode is bytes => str/unicode -- http://mail.python

Re: Changing return of type(obj)

2009-02-06 Thread Terry Reedy
Ken Elkabany wrote: Hello, I am attempting to fully-simulate an 'int' object with a custom object type. It is part of a library I am creating for python futures and promises. Is there anyway such that type(my_object) can return 'int'>? Or for that matter, any other primitive? I do not care how

Re: i have an query regarding pyodbc

2009-02-06 Thread Diez B. Roggisch
Rahul schrieb: On Feb 6, 3:53 pm, Rahul wrote: On Feb 6, 11:27 am, Rahul wrote: hello all, I have installed pyodbc on my red hat enterprise 4 linux machine but when i go to use that using statement, import pyodbc through python console it gives me error as ImportError : dynamic module does

Re: What is difference between ADO and RDO

2009-02-06 Thread Scott David Daniels
OdarR wrote: On 6 fév, 10:56, Agile Consulting wrote: Explain ADO and RDO RU a bot ? I expect someone is experimenting with their spam generator. -- http://mail.python.org/mailman/listinfo/python-list

Re: Have you ever thought to know your intelligence level?

2009-02-06 Thread Diez B. Roggisch
His IQ must suck considering all the spelling errorsor is that not also a measure of one's IQ? I'm pretty sure there is a legasthenic nobel prize winner out there... so *if* it were a measure of IQ, it would make the whole affair even more braindead. I'd rather say he is of limited inte

Re: Distributing simple tasks

2009-02-06 Thread Terry Reedy
Noam Aigerman wrote: Hi, Suppose I have an array of functions which I execute in threads (each thread get a slice of the array, iterates over it and executes each function in it’s slice one after the other). Now I want to distribute these tasks between two machines, i.e give each machine half

Returning a variable number of things...

2009-02-06 Thread r0g
Hi There, I have a function that uses *args to accept a variable number of parameters and I would like it to return a variable number of objects. I could return a list but I would like to take advantage of tuple unpacking with the return values e.g. def unpack_struct( a_string, *args ): output

Re: updating nntplib

2009-02-06 Thread Terry Reedy
Gerhard Häring wrote: Travis wrote: Hello all, There are some notable deficiencies in nntlib. Here are two: [...] Be sure to add a bug report/patch to the Python bug tracker. http://bugs.python.org/ Anything else will most likely be overlooked or forgotten. It is my impression that nntpl

Re: Returning a variable number of things...

2009-02-06 Thread Chris Rebert
On Fri, Feb 6, 2009 at 10:50 AM, r0g wrote: > Hi There, > > I have a function that uses *args to accept a variable number of > parameters and I would like it to return a variable number of objects. > > I could return a list but I would like to take advantage of tuple > unpacking with the return va

Re: Returning a variable number of things...

2009-02-06 Thread Stephen Hansen
On Fri, Feb 6, 2009 at 10:50 AM, r0g wrote: > Hi There, > > I have a function that uses *args to accept a variable number of > parameters and I would like it to return a variable number of objects. > > I could return a list but I would like to take advantage of tuple > unpacking with the return

Re: Using cPickle

2009-02-06 Thread mmcclaf
On Feb 6, 10:25 am, Steve Holden wrote: > mmcclaf wrote: > > Hi there, > > > I have to make a small database using cPickle. I'm having troubles > > trying to read in the information if it's more than one line. I'm > > pretty sure it's in the line "for line in stuff:" Can anyone help me > > out? Ba

Re: What is difference between ADO and RDO

2009-02-06 Thread OdarR
On 6 fév, 19:36, Scott David Daniels wrote: > OdarR wrote: > > On 6 fév, 10:56, Agile Consulting wrote: > >> Explain ADO and RDO > > > RU a bot ? > > I expect someone is experimenting with their spam generator. An agile one :) Olivier -- http://mail.python.org/mailman/listinfo/python-list

Parallel port interfacing in python on Vista x64

2009-02-06 Thread SiWi
I have done some googling on this topic, but I haven't found anything thats really working on Vista x64. The most promising result I found was the Inpout32.dll: http://logix4u.net/Legacy_Ports/Parallel_Port/A_tutorial_on_Parallel_port_Interfacing.html But when using some code like that, I can't mea

Installation directory for extensions on Unix

2009-02-06 Thread Osmo Salomaa
I have written an extension (a.k.a. plugin or add-on, not C-extension) system for my application and I'm going to ship two extensions with it. Each extension is in a directory of its own and that directory contains Python files and various data files, e.g. Glade XML files and PNG icons. Where shou

Re: ANN: SuPy - Script Sketchup with Python

2009-02-06 Thread member thudfoo
On Fri, Feb 6, 2009 at 8:27 AM, Gary Herron wrote: > greg wrote: >> SuPy 1.0 >> >> >> SuPy is a plugin for the Sketchup 3D modelling application >> that lets you script it in Python. >> >> http://www.cosc.canterbury.ac.nz/SuPy/ > > > That URL fails with a 404 - not found. (At least for

Re: thread-local data

2009-02-06 Thread Emanuele D'Arrigo
Thank you both MRAB and Diez. I think I'll stick to making copies inside a thread-protected section unless I need to speed up things, at which point I might go for the key exception path. Thank you again! Manu -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel port interfacing in python on Vista x64

2009-02-06 Thread Diez B. Roggisch
SiWi schrieb: I have done some googling on this topic, but I haven't found anything thats really working on Vista x64. The most promising result I found was the Inpout32.dll: http://logix4u.net/Legacy_Ports/Parallel_Port/A_tutorial_on_Parallel_port_Interfacing.html But when using some code like t

Re: Fastest database solution

2009-02-06 Thread Curt Hash
On Fri, Feb 6, 2009 at 2:12 AM, Roger Binns wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Curt Hash wrote: > > I started out using sqlite3, but was not satisfied with the performance > > results. I then tried using psycopg2 with a local postgresql server, and > > the performance g

Re: Parallel port interfacing in python on Vista x64

2009-02-06 Thread SiWi
On Feb 6, 8:55 pm, "Diez B. Roggisch" wrote: > SiWi schrieb: > > > I have done some googling on this topic, but I haven't found anything > > thats really working on Vista x64. > > The most promising result I found was the Inpout32.dll: > >http://logix4u.net/Legacy_Ports/Parallel_Port/A_tutorial_on

Re: Using cPickle

2009-02-06 Thread MRAB
mmcclaf wrote: On Feb 6, 10:25 am, Steve Holden wrote: mmcclaf wrote: Hi there, I have to make a small database using cPickle. I'm having troubles trying to read in the information if it's more than one line. I'm pretty sure it's in the line "for line in stuff:" Can anyone help me out? Basical

Re: Fastest database solution

2009-02-06 Thread Curt Hash
On Fri, Feb 6, 2009 at 5:19 AM, M.-A. Lemburg wrote: > On 2009-02-06 09:10, Curt Hash wrote: >> I'm writing a small application for detecting source code plagiarism that >> currently relies on a database to store lines of code. >> >> The application has two primary functions: adding a new file to

Trouble sorting a list of objects by attributes

2009-02-06 Thread Robocop
Hello again, I've found myself stumped when trying to organize this list of objects. The objects in question are timesheets which i'd like to sort by four attributes: class TimeSheet: department = string engagement = string date = datetime.date stare_hour = datetime.time My ultimate goal

Trouble sorting a list of objects by attributes

2009-02-06 Thread rdmurray
Quoth Robocop : > Hello again, > I've found myself stumped when trying to organize this list of > objects. The objects in question are timesheets which i'd like to > sort by four attributes: > > class TimeSheet: > department = string > engagement = string > date = datetime.date > stare_ho

Re: Trouble sorting a list of objects by attributes

2009-02-06 Thread Miki
> I've found myself stumped when trying to organize this list of > objects.  The objects in question are timesheets which i'd like to > sort by four attributes: > > class TimeSheet: >   department = string >   engagement = string >   date = datetime.date >   stare_hour = datetime.time > > My ultim

Re: subprocess returncode windows

2009-02-06 Thread Andrew
On Feb 5, 9:17 pm, "Gabriel Genellina" wrote: > En Thu, 05 Feb 2009 17:34:29 -0200, Andrew   > escribió: > > > > > On Dec 16 2008, 5:11 pm, "Gabriel Genellina" > > wrote: > >> En Tue, 16 Dec 2008 17:21:35 -0200, Andrew   > >> escribió: > > >> > On Dec 16, 12:50 pm, Christian Heimes wrote: > >>

Re: Trouble sorting a list of objects by attributes

2009-02-06 Thread bearophileHUGS
Robocop: >then within each department block of the list, have it organized by projects.< I don't know what does it means. > timesheets.sort(key=operator.attrgetter('string')) Try something like: timesheets.sort(key=attrgetter("department", "engagement", "date", "stare_hour")) > My brain might

Re: Ordered dict by default

2009-02-06 Thread Cameron Simpson
On 05Feb2009 01:47, bearophileh...@lycos.com wrote: | [...] But even if the average performance becomes a | little worse I think making the default Python dict as ordered is a | positive change for Python too, because built-ins are meant to be as | flexible as possible, even if they aren't the fas

Re: urllib2 performance on windows, usb connection

2009-02-06 Thread dq
Martin v. Löwis wrote: So does anyone know what the deal is with this? Why is the same code so much slower on Windows? Hope someone can tell me before a holy war erupts :-) Only the holy war can give an answer here. It certainly has *nothing* to do with Python; Python calls the operating syst

Re: Question on Strings

2009-02-06 Thread John Machin
On Feb 7, 5:23 am, Terry Reedy wrote: > John Machin wrote: > > The UTF-n siblings are *external* representations. > > 2.x: a_unicode_object.decode('UTF-16') -> an_str_object > > 3.x: an_str_object.decode('UTF-16') -> a_bytes_object > > That should be .encode() to bytes, which is the coded form. >

Re: Flattening lists

2009-02-06 Thread Rhamphoryncus
On Feb 5, 1:16 pm, Michele Simionato wrote: > On Feb 5, 7:24 pm, a...@pythoncraft.com (Aahz) wrote: > > > In article > > , > > Michele Simionato   wrote: > > > >Looks fine to me. In some situations you may also use hasattr(el, > > >'__iter__') instead of isinstance(el, list) (it depends if you wa

Re: Using cPickle

2009-02-06 Thread mmcclaf
On Feb 6, 3:09 pm, MRAB wrote: > mmcclaf wrote: > > On Feb 6, 10:25 am, Steve Holden wrote: > >> mmcclaf wrote: > >>> Hi there, > >>> I have to make a small database using cPickle. I'm having troubles > >>> trying to read in the information if it's more than one line. I'm > >>> pretty sure it's i

Re: Ordered dict by default

2009-02-06 Thread MRAB
Cameron Simpson wrote: On 05Feb2009 01:47, bearophileh...@lycos.com wrote: | [...] But even if the average performance becomes a | little worse I think making the default Python dict as ordered is a | positive change for Python too, because built-ins are meant to be as | flexible as possible, ev

Re: urllib2 performance on windows, usb connection

2009-02-06 Thread MRAB
dq wrote: > Martin v. Löwis wrote: >>> So does anyone know what the deal is with this? Why is the same code so >>> much slower on Windows? Hope someone can tell me before a holy war >>> erupts :-) >> >> Only the holy war can give an answer here. It certainly has *nothing* to >> do with Python;

Re: Using multiprocessing from a Windows service

2009-02-06 Thread Mark Hammond
On 6/02/2009 4:21 PM, Volodymyr Orlenko wrote: In the patch I submitted, I simply check if the name of the supposed module ends with ".exe". It works fine for my case, but maybe this is too general. Is there a chance that a Python module would end in ".exe"? IIRC, py2exe may create executables

Re: WIn32api

2009-02-06 Thread Mark Hammond
On 7/02/2009 3:28 AM, K-Dawg wrote: You might like to seek out the python-win32 mailing list for stuff like this where more people tend to pay attention to windows problems. This works if I call run() specifically. But when I try to initiate the thread with .start() I get the following error

Re: Using cPickle

2009-02-06 Thread MRAB
mmcclaf wrote: On Feb 6, 3:09 pm, MRAB wrote: mmcclaf wrote: On Feb 6, 10:25 am, Steve Holden wrote: mmcclaf wrote: Hi there, I have to make a small database using cPickle. I'm having troubles trying to read in the information if it's more than one line. I'm pretty sure it's in the line "fo

Re: Trouble sorting a list of objects by attributes

2009-02-06 Thread Robocop
On Feb 6, 1:03 pm, bearophileh...@lycos.com wrote: > Robocop: > > >then within each department block of the list, have it organized by > >projects.< > > I don't know what does it means. > > > timesheets.sort(key=operator.attrgetter('string')) > > Try something like: > timesheets.sort(key=attrgette

Re: Trouble sorting a list of objects by attributes

2009-02-06 Thread Robocop
On Feb 6, 1:03 pm, bearophileh...@lycos.com wrote: > Robocop: > > >then within each department block of the list, have it organized by > >projects.< > > I don't know what does it means. > > > timesheets.sort(key=operator.attrgetter('string')) > > Try something like: > timesheets.sort(key=attrgette

Re: Trouble sorting a list of objects by attributes

2009-02-06 Thread Robocop
On Feb 6, 2:17 pm, Robocop wrote: > On Feb 6, 1:03 pm, bearophileh...@lycos.com wrote: > > > > > Robocop: > > > >then within each department block of the list, have it organized by > > >projects.< > > > I don't know what does it means. > > > > timesheets.sort(key=operator.attrgetter('string')) >

Re: Trouble sorting a list of objects by attributes

2009-02-06 Thread Robocop
On Feb 6, 2:20 pm, Robocop wrote: > On Feb 6, 2:17 pm, Robocop wrote: > > > > > On Feb 6, 1:03 pm, bearophileh...@lycos.com wrote: > > > > Robocop: > > > > >then within each department block of the list, have it organized by > > > >projects.< > > > > I don't know what does it means. > > > > > ti

Re: Trouble sorting a list of objects by attributes

2009-02-06 Thread Terry Reedy
Robocop wrote: UH OH GUYS! line 110, in sorter timesheets.sort(key=attrgetter("department", "engagement", "date","start")) TypeError: attrgetter expected 1 arguments, got 4 Um... what version of Python are you running? Alway specify. (Too many people do not). In 3.0 from operator imp

Re: urllib2 performance on windows, usb connection

2009-02-06 Thread dq
MRAB wrote: dq wrote: > Martin v. Löwis wrote: >>> So does anyone know what the deal is with this? Why is the same code so >>> much slower on Windows? Hope someone can tell me before a holy war >>> erupts :-) >> >> Only the holy war can give an answer here. It certainly has *nothing* t

Re: Trouble sorting a list of objects by attributes

2009-02-06 Thread Robocop
On Feb 6, 2:34 pm, Robocop wrote: > On Feb 6, 2:20 pm, Robocop wrote: > > > > > On Feb 6, 2:17 pm, Robocop wrote: > > > > On Feb 6, 1:03 pm, bearophileh...@lycos.com wrote: > > > > > Robocop: > > > > > >then within each department block of the list, have it organized by > > > > >projects.< > >

Re: Trouble sorting a list of objects by attributes

2009-02-06 Thread Stephen Hansen
> I think there may have been a misunderstanding. I was already using > attrgetter, my problem is that it doesn't appear to be sorting by the > argument i give it. How does sort work with strings? How about with > datetime.time or datetime.date? You were using the attrgetter, but it looks like

Module unloading resulting from SystemExit exception

2009-02-06 Thread Patrick Hartling
I am trying to understand how the SystemExit exception influences module unloading. The situation that I am facing is that a Python application behaves just fine upon exiting when executed using the standard Python interpreter, but when run as a frozen executable, modules are unloaded unexpectedly

  1   2   >