Re: Python3.0 has more duplication in source code than Python2.5

2009-02-06 Thread Martin v. Löwis
> Does that say something about the code quality of Python3.0? Not necessarily. IIUC, copying a single file with 2000 lines completely could already account for that increase. It would be interesting to see what specific files have gained large numbers of additional files, compared to 2.5. Regar

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

2009-02-06 Thread Terry Reedy
Albert Hopkins wrote: Probably that [c.l.]python is becoming more popular and, like most things as they become popular, it loses its "purity"... much like the Internet in the early 1990s. Several years ago when I proposed the addition of list.pop(), a couple of people accused me of trying to r

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread Terry Reedy
er wrote: Somebody much more intelligent than I said today that someone told him that Python lists are just dictionaries with lists hashed by integers. Abstractly, which is to say, behaviorally, a Python list is a sequence class as defined under Built-in Types in the Library manual. Diction

Python3.0 has more duplication in source code than Python2.5

2009-02-06 Thread Terry
I used a CPD (copy/paste detector) in PMD to analyze the code duplication in Python source code. I found that Python3.0 contains more duplicated code than the previous versions. The CPD tool is far from perfect, but I still feel the analysis makes some sense. |Source Code | NLOC | Dup60

Re: simple web app, where to start

2009-02-06 Thread Matthew Sacks
have a loo at the django framework http://www.djangoproject.com/ On Fri, Feb 6, 2009 at 8:16 PM, Vincent Davis wrote: > I have a simple script that takes a few input values and returns a csv file > and a few stats. If I wanted to host this on the web how would I. I have no > idea where to begin.

Re: Flattening lists

2009-02-06 Thread rdmurray
Quoth Mensanator : > On Feb 6, 3:23=A0pm, Rhamphoryncus wrote: > > On Feb 5, 1:16=A0pm, Michele Simionato > > wrote: > > > > > On Feb 5, 7:24=A0pm, a...@pythoncraft.com (Aahz) wrote: > > > > In article > > > > , > > > > Michele Simionato =A0 wrote: > > > > >Looks fine to me. In some situations y

Re: Running all unit tests

2009-02-06 Thread Jean-Paul Calderone
On Fri, 06 Feb 2009 21:11:15 -0500, Jason Voegele wrote: I'm working on my first substantial Python project, and I'm following a fully test-first approach. I'd like to know how Pythonistas typically go about running all of their tests to ensure that my application stays "green". In Ruby, I wou

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread Stephen Hansen
On Fri, Feb 6, 2009 at 7:32 PM, er wrote: > Thanks Chris. Lua tables are one of my favorite linguistic traits, which > was actually part of the discussion that brought up this nugget. > Nevertheless, any details you care to provide about the details. I'm going > to dive into the source code in m

Re: Flattening lists

2009-02-06 Thread Michele Simionato
On Feb 6, 10:23 pm, Rhamphoryncus wrote: > 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, > > > >'__it

Re: WebError documentation?

2009-02-06 Thread Chris Rebert
On Thu, Feb 5, 2009 at 12:52 PM, Ron Garret wrote: > Is there any? Where is it? Extensive Googling has proven fruitless. It's not a standard Python exception. A third-party library you're using must be raising it. Check the exception traceback. Cheers, Chris -- Follow the path of the Iguana.

Re: Returning a variable number of things...

2009-02-06 Thread r0g
Chris Rebert wrote: > 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 >>

simple web app, where to start

2009-02-06 Thread Vincent Davis
I have a simple script that takes a few input values and returns a csv file and a few stats. If I wanted to host this on the web how would I. I have no idea where to begin. If someone could point me in the right direction like maybe a tutorial, tools I will need, functions. I would appreciate i

WebError documentation?

2009-02-06 Thread Ron Garret
Is there any? Where is it? Extensive Googling has proven fruitless. Thanks, rg -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 performance on windows, usb connection

2009-02-06 Thread Grant Edwards
On 2009-02-06, Martin v. L?wis wrote: > To investigate further, you might drop the write operating, > and measure only source.read(). If that is slower, then, for > some reason, the network speed is bad on Windows. Maybe you > have the network interfaces misconfigured? Maybe you are using > wirel

What is difference between ADO and RDO

2009-02-06 Thread Agile Consulting
Explain ADO and RDO -- http://mail.python.org/mailman/listinfo/python-list

GOZERBOT 0.9 RELEASED

2009-02-06 Thread Bart Thate
Finally gozerbot 0.9 has been released. This is a huge step forward to version 1.0 and contains a number of changes: * use json as the format to save data in instead of pickles * let config files also use json, this makes them more readable and human editable * remove popen usage from

Re: Where to host a (Python) project?

2009-02-06 Thread Aahz
In article <6dcb8ce5-c93e-458c-9047-e5db60f27...@v18g2000pro.googlegroups.com>, andrew cooke wrote: >On Feb 1, 8:45=A0pm, a...@pythoncraft.com (Aahz) wrote: >> >> [...]=A0I for one won't participate in any list hosted on >> Google because of the need for a Google login. > >hi, just fyi, i invest

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

2009-02-06 Thread Albert Hopkins
Probably that [c.l.]python is becoming more popular and, like most things as they become popular, it loses its "purity"... much like the Internet in the early 1990s. -- http://mail.python.org/mailman/listinfo/python-list

Re: Portable way to refer to the null device?

2009-02-06 Thread Ben Finney
Roy Smith writes: > I need to run a command using subprocess.Popen() and have stdin > connected to the null device. On unix, I would do: > > self.process = subprocess.Popen(argv, > env=new_env, > stdout=open

Re: Portable way to refer to the null device?

2009-02-06 Thread skip
Roy> I need to run a command using subprocess.Popen() and have stdin Roy> connected to the null device. os.path.devnull should do what you want: >>> os.path.devnull '/dev/null' >>> import ntpath >>> ntpath.devnull 'nul' -- Skip Montanaro - s...@pobox.com - http://w

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread Chris Rebert
> On Fri, Feb 6, 2009 at 10:25 PM, Chris Rebert wrote: >> On Fri, Feb 6, 2009 at 7:18 PM, er wrote: >> > Somebody much more intelligent than I said today that someone told him >> > that >> > Python lists are just dictionaries with lists hashed by integers. Since >> > he >> > said that someone el

Portable way to refer to the null device?

2009-02-06 Thread Roy Smith
I need to run a command using subprocess.Popen() and have stdin connected to the null device. On unix, I would do: self.process = subprocess.Popen(argv, env=new_env, stdout=open(outfile, 'w'),

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread er
Thanks Chris. Lua tables are one of my favorite linguistic traits, which was actually part of the discussion that brought up this nugget. Nevertheless, any details you care to provide about the details. I'm going to dive into the source code in more depth tomorrow, just so I can get a better unde

Re: Running all unit tests

2009-02-06 Thread Ben Finney
Jason Voegele writes: > What's the recommended approach for Python programs? I'm sure I > could write a shell script (or a Python script even) that scans my > "test" directory for test cases and runs them, but I'm wondering if > there's something already built in that could do this for me. The l

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread Chris Rebert
On Fri, Feb 6, 2009 at 7:18 PM, er wrote: > Somebody much more intelligent than I said today that someone told him that > Python lists are just dictionaries with lists hashed by integers. Since he > said that someone else told him this, I piped up and said that I thought > that wasn't true. I lo

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread er
Correction, the first sentence should read, "lists are just dictionaries keyed with integers." On Fri, Feb 6, 2009 at 10:18 PM, er wrote: > Somebody much more intelligent than I said today that someone told him that > Python lists are just dictionaries with lists hashed by integers. Since he >

Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread er
Somebody much more intelligent than I said today that someone told him that Python lists are just dictionaries with lists hashed by integers. Since he said that someone else told him this, I piped up and said that I thought that wasn't true. I looked at the source code for lists in python, and I

Re: Running all unit tests

2009-02-06 Thread D'Arcy J.M. Cain
On Fri, 06 Feb 2009 21:11:15 -0500 Jason Voegele wrote: > I'm working on my first substantial Python project, and I'm following a fully > test-first approach. I'd like to know how Pythonistas typically go about > running all of their tests to ensure that my application stays "green". I check i

Re: Running all unit tests

2009-02-06 Thread Darcy Mason
On Feb 6, 9:11 pm, Jason Voegele wrote: > I'm working on my first substantial Python project, and I'm following a fully > test-first approach.  I'd like to know how Pythonistas typically go about > running all of their tests to ensure that my application stays "green". > > In Ruby, I would have a

Re: Using while loop and if statement to tell if a binary has an odd or even number of 1's.

2009-02-06 Thread Mark Wooding
Duncan Booth writes: > Mark Dickinson wrote: [snip] >> while n: >> count += 1 >> n &= n-1 >> return count >> >> is_even = count_set_bits(the_int) % 2 == 0 >> >> ...but anyone submitting this as a homework >> solution had better be prepared to explain why >> it works. >>

sys.exc_info() different between python 2.5.4 and 2.6.1?

2009-02-06 Thread Vlastimil Brom
Hi all, I just noticed a changed behaviour of sys.exc_info() between python 2.5.4 and 2.6.1 and wanted to ask, wheter it was intended, and how to deal with the new state. Some code triggers an error while opening a text file (windows 1250 - with non-ascii characters) wrongly as utf-8, this gets ca

Re: urllib2 performance on windows, usb connection

2009-02-06 Thread MRAB
dq wrote: MRAB wrote: dq wrote: dq wrote: 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 cer

Running all unit tests

2009-02-06 Thread Jason Voegele
I'm working on my first substantial Python project, and I'm following a fully test-first approach. I'd like to know how Pythonistas typically go about running all of their tests to ensure that my application stays "green". In Ruby, I would have a Rake task so that I could say "rake test" and al

Re: urllib2 performance on windows, usb connection

2009-02-06 Thread dq
MRAB wrote: dq wrote: dq wrote: 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

Possible to access MS Access 2007 password-protected database from Python?

2009-02-06 Thread Kenneth McDonald
Googling has shown me various ways of connecting to a non-password- protected Access database, but I was wondering if someone could point to code illustrating how to use an Access db that's password- protected. I haven't been able to find anything on this. Thanks, Ken -- http://mail.python.or

Re: Why doesn't this RE match?

2009-02-06 Thread John Machin
On Feb 7, 11:23 am, "Just Another Victim of the Ambient Morality" wrote: >     I'm confused by this behaviour: > > import re > > regex = re.compile('foo') > match = regex.match('whatfooever') > >     In my experience with regular expressions, regex should have found a > match.  However, in this ca

Re: Trouble sorting a list of objects by attributes

2009-02-06 Thread Robocop
On Feb 6, 2:41 pm, Stephen Hansen wrote: > > 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?

Re: Why doesn't this RE match?

2009-02-06 Thread Robert Kern
On 2009-02-06 18:23, Just Another Victim of the Ambient Morality wrote: I'm confused by this behaviour: import re regex = re.compile('foo') match = regex.match('whatfooever') In my experience with regular expressions, regex should have found a match. However, in this case regex.ma

Re: Why doesn't this RE match?

2009-02-06 Thread Stephen Hansen
>In my experience with regular expressions, regex should have found a > match. However, in this case regex.match() returns None. Why is that? > What am I missing? You want regex.search(). match specifically looks for the pattern from the start of the screen, search anywhere. --S -- http://m

Re: Why doesn't this RE match?

2009-02-06 Thread MRAB
Just Another Victim of the Ambient Morality wrote: I'm confused by this behaviour: import re regex = re.compile('foo') match = regex.match('whatfooever') In my experience with regular expressions, regex should have found a match. However, in this case regex.match() returns None. W

Re: Why doesn't this RE match?

2009-02-06 Thread Vlastimil Brom
2009/2/7 Just Another Victim of the Ambient Morality : >    I'm confused by this behaviour: > > > import re > > regex = re.compile('foo') > match = regex.match('whatfooever') > > >    In my experience with regular expressions, regex should have found a > match.  However, in this case regex.match()

Why doesn't this RE match?

2009-02-06 Thread Just Another Victim of the Ambient Morality
I'm confused by this behaviour: import re regex = re.compile('foo') match = regex.match('whatfooever') In my experience with regular expressions, regex should have found a match. However, in this case regex.match() returns None. Why is that? What am I missing? Thank you... -

Re: urllib2 performance on windows, usb connection

2009-02-06 Thread MRAB
dq wrote: > dq wrote: >> 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 answ

Re: Flattening lists

2009-02-06 Thread Mensanator
On Feb 6, 3:23 pm, Rhamphoryncus wrote: > 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, > > > >'__ite

Re: urllib2 performance on windows, usb connection

2009-02-06 Thread dq
MRAB wrote: dq wrote: 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: urllib2 performance on windows, usb connection

2009-02-06 Thread dq
dq wrote: 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

Re: Ordered dict by default

2009-02-06 Thread MRAB
bearophileh...@lycos.com wrote: Cameron Simpson: increases the unrealised assumptions about mappings in general which a newbie may acquire, causing them pain/complaint later with other mappings< This is wrong in several different ways. I would much rather keep dictionaries as performant as

Re: urllib2 performance on windows, usb connection

2009-02-06 Thread MRAB
dq wrote: 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* to do with Pyt

Re: Ordered dict by default

2009-02-06 Thread bearophileHUGS
bearophile: > In Python 3 strings are all unicode, integral numbers are all > multiprecision, chars in Python 2.x+ are strings, lists are arrays > that can grow dynamically, and so on because the Purpose of Python > isn't to be as fast as possible, but to be first of all flexible, > safe, easy, not

Re: Ordered dict by default

2009-02-06 Thread bearophileHUGS
Cameron Simpson: >increases the unrealised assumptions about mappings in general which a newbie >may acquire, causing them pain/complaint later with other mappings< This is wrong in several different ways. > I would much rather keep dictionaries as performant as possible, as a > bare mapping,

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

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

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: 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 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: 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 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, 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: 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: 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 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: 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: 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: 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: 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: 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: 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: 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: 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: 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 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

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

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

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

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: 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: 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 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: 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: 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

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

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

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

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: 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: 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: 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

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: 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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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

  1   2   >