using PIL for PCA analysis

2008-02-20 Thread [EMAIL PROTECTED]
hi guys i am trying out PCA analysis using python.I have a set of jpeg(rgbcolor) images whose pixel data i need to extract and make a matrix .( rows =num of images and cols=num of pixels) For this i need to represent an image as an array. i was able to do this using java's BufferedImage as below

Re: how to write text into file in ansi encoding ?

2008-02-20 Thread James Yu
I just figure out the how-to: # first we open and read in chars as in utf-8 encoding ansiLine = line.decode('utf-8', 'ignore') # then writing it into another file in any encoding you like, it's big5 in my case. src_handle.write(ansiLine.encode('big5', 'ignore')) -- This is a UTF-8 formatted mail

Boa Constructor Mac crash when adding menubar

2008-02-20 Thread Jacob Davis
hi. Every time I go through the Boa Constructor tutorial and I get to the "Add a Menu Bar" section, Boa Constructor crashes after I select a wx.menubar and then left click either in the Data or design frames. I saw a post on the internet from the usenet about this very question, but was fro

usenet problem

2008-02-20 Thread Jacob Davis
Hi. I am a newbie to usenet. I am using mac and have downloaded a free usenet client, "MT-NewsWatcher". I put in comp.lang.python but it says that it cannot get the address of the news server host. My config says it is trying on port 119. Thanks for any help. Jake -- http://mail.python.

Re: Is there a way to "link" a python program from several files?

2008-02-20 Thread Edward A. Falk
In article <[EMAIL PROTECTED]>, BlueBird <[EMAIL PROTECTED]> wrote: > >I wrote a small wiki page to sum-up my findings about such typical >problem: > >http://www.freehackers.org/Packaging_a_python_program > Excellent references, but maybe a bit of overkill. Everybody in my target audience has py

Re: syntax error in python

2008-02-20 Thread Tim Roberts
Lalit <[EMAIL PROTECTED]> wrote: >Hi >I am executing following commands. test = os.path.isfile('c:\\src\\kasjdfl.txt') print test >True >working fine but for below statement it is giving syntax >error. > if (os.path.isfile('c:\\src\\kasjdfl.txt')) >SyntaxError: invalid s

Re: Is there a sort-of "clear" function in Pythonwin now?

2008-02-20 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >Looks like there are some years old questions talking about how to >clear the Pythonwin environment. But still no answer. Do we have to >close Pythonwin again and again to update our modules? If "reload" won't solve your problem, then yes. The same kind of issue occurs

Is there any python lib for NAT transversal?

2008-02-20 Thread hawk gao
Is there any python lib for NAT transversal? -- http://mail.python.org/mailman/listinfo/python-list

Re: ENMAC Mobile Phones, iPods EQ100 www.enmac.com.hk

2008-02-20 Thread Saqib Mehmood
On Jan 24, 1:43 pm, Farooq <[EMAIL PROTECTED]> wrote: > www.enmac.com.hk > GSM Mobile Phones, Digital iPods, Digital Clocks, Digital Pens, > Digital Quran. Enjoy these products with Islamic Features (Complete > Holy Quran with Text and Audio, Tafaseer books, Ahadees Books, Daily > Supplications, Un

Re: Article of interest: Python pros/cons for the enterprise

2008-02-20 Thread TerryP
Thanks for the link, was a nice read. "Have specialized needs better served by other languages that you already know. For example, if you want to do a lot of text processing and you have a basement full of Perl programmers, there's no compelling reason to switch." Now that really hits the sweet

configuration and limitation of memcache..

2008-02-20 Thread bharath venkatesh
hi, In my project i need to store lot n lots of images in my cache and retrieve it very frequently.. currently i am using memcache to store and retreive images from cache... i will be using 4 GB ram as cache and each image won't exceed 1 mb for sure ...and i came across that memcache will be as

Tkinter OSX and "lift"

2008-02-20 Thread Miki
Hello, Tk.lift doesn't seem to work on OSX (Python 2.5.1). The below starts OK, but the window is the behind all other windows. from Tkinter import * root = Tk() Button(root, text="OK", command=root.quit).pack() root.lift() root.mainloop() Any ideas how to tell the window to start as the topmos

how to write text into file in ansi encoding ?

2008-02-20 Thread James Yu
I am using *fileHandle = open(srcFile, 'w')* + *fileHandle.write('whatever') * to put text into a file, and Python uses utf-8 encoding by default. How do I configure or do anything to make Python writing files in ansi encoding ? -- This is a UTF-8 formatted mail --

Re: class object using widget

2008-02-20 Thread jim-on-linux
On Wednesday 20 February 2008 13:16, you wrote: > from Tkinter import * > # get widget classes from tkMessageBox > import askokcancel # get canned > std dialog > > class Quitter(Frame): > # subclass our GUI def __init__(self, > parent=Non

Re: smtplib & gnupg

2008-02-20 Thread Miki
Hello Bernd, > at the moment my program sends mail with smtplib. Is there a chance to > sign and/or encode/cipher this mails with GnuPG? > If yes, does anyone have some sample code? Not exactly Python, but maybe http://codesorcery.net/old/mutt/mutt-gnupg-howto might help. HTH, -- Miki <[EMAIL PRO

Re: unitests don't run under pdb

2008-02-20 Thread Miki
Hello Amit, > python testname.py : the unitests runs as usual and I get the > following results: > -- > Ran 2 tests in 0.024s > > OK > > > However, if I do "pyth

Why doesnt ctrl-c during recvfrom raise keyboardexcpetion

2008-02-20 Thread Jeff
Hi, Fairly new to python, messing with some socket and pcap sniffing and have come across the following issue while trying to do a pcap_loop (via pcapy http://oss.coresecurity.com/projects/pcapy.html). I believe i recall seeing similar stuff using other pcap libs with python in the past (such as p

Re: scanf in python?

2008-02-20 Thread Terry Reedy
Using a search engine (ie, Google 'scanf python') will often give you a quick answer and possibly better than anyone will give you here. -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding Priority Scheduling feature to the subprocess

2008-02-20 Thread Terry Reedy
| Because UNIX uses priorities between +20 and -20 and Windows, via | Process and Thread priorities, allows settings between 0 and 31, a | uniform setting for each system should be derived. This would be | accomplished by giving process priority in terms of a floating-point | value between 0.0 an

Re: standardization allows?

2008-02-20 Thread castironpi
On Feb 19, 9:41 pm, Paddy <[EMAIL PROTECTED]> wrote: > On Feb 13, 10:41 pm, [EMAIL PROTECTED] wrote: > > > Standardization helps avoid the readability and reliability problems > > which arise when many different individuals create their own slightly > > varying implementations, each with their own

Re: Double underscores -- ugly?

2008-02-20 Thread castironpi
On Feb 19, 8:20 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Feb 19, 10:26 am, Wildemar Wildenburger > > <[EMAIL PROTECTED]> wrote: > >> Jason wrote: > >>> Hmm.  I must be the only person who doesn't think the double > >>> underscores are ugly. > >> Nope. I like the

Re: What's "the standard" for code docs?

2008-02-20 Thread castironpi
On Feb 20, 4:42 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Tue, 19 Feb 2008 16:37:23 -0800, Preston  Landers wrote: > > On Feb 19, 4:31 pm, [EMAIL PROTECTED] wrote: > > > But after reading some of your other recent posts on other topics, I'm > > not confident that it was intended

Re: Bored now [was Re: The big shots]

2008-02-20 Thread castironpi
On Feb 20, 7:57 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Trying to decipher the fractured, incoherent ramblings of castironpi has > lost it's amusement value. I no longer care whether the poster is a bot, > or a loser nowhere near as smart as he thinks he is with few soci

Bored now [was Re: The big shots]

2008-02-20 Thread Steven D'Aprano
Trying to decipher the fractured, incoherent ramblings of castironpi has lost it's amusement value. I no longer care whether the poster is a bot, or a loser nowhere near as smart as he thinks he is with few social skills, or even a troll just playing games. I just want it to stop. Can people PL

For discussion, semantic construct

2008-02-20 Thread castironpi
Here is a construction for passing parameters. I include the Python idea, a C/C++ equivalent, and write a little about it. (Blech.) It is a little obscure, and my use cases are not as good as yours. So say yours. The presentation is structured: problem, solution. Problem: Sometimes you need

Re: is this data structure build-in or I'll have to write my own class?

2008-02-20 Thread Carl Banks
On Feb 20, 8:12 am, "Jorge Vargas" <[EMAIL PROTECTED]> wrote: > I need a data structure that will let me do: > > - attribute access (or index) > - maintain the order (for iter and print) > - be mutable. > > in case there isn't one. I was thinking having a base class like > Bunchhttp://aspn.actives

Re: Article of interest: Python pros/cons for the enterprise

2008-02-20 Thread Carl Banks
On Feb 20, 8:58 am, Tim Chase <[EMAIL PROTECTED]> wrote: > > You Used Python to Write WHAT? > >http://www.cio.com/article/185350 > > """ > Furthermore, the power and expressivity that Python offers means > that it may require more skilled developers. > [...down to the summary...] > Python may not b

Re: The big shots

2008-02-20 Thread Ben Finney
[EMAIL PROTECTED] writes: > On Feb 20, 6:02 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: > > For what it's worth, I've found none of your threads in the last > > few weeks to make much sense at all, because of unclear and > > incoherent writing. On that basis, I dismiss them before trying to > > re

Re: Querying a complex website

2008-02-20 Thread 7stud
7stud wrote: > schweet1 wrote: > > On Feb 19, 4:04�pm, 7stud <[EMAIL PROTECTED]> wrote: > > > schweet1 wrote: > > > > Greetings, > > > > > > > I am attempting to use python to submit a query to the following URL: > > > > > > >https://ramps.uspto.gov/eram/patentMaintFees.do > > > > > > > The page lo

Re: Querying a complex website

2008-02-20 Thread 7stud
schweet1 wrote: > On Feb 19, 4:04�pm, 7stud <[EMAIL PROTECTED]> wrote: > > schweet1 wrote: > > > Greetings, > > > > > I am attempting to use python to submit a query to the following URL: > > > > >https://ramps.uspto.gov/eram/patentMaintFees.do > > > > > The page looks simple enough - it requires

Re: The big shots

2008-02-20 Thread castironpi
On Feb 20, 6:02 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > My writing isn't unclear > > Please re-assess that statement in light of the dozens of responses > from many people in the last few weeks, telling you that your writing > *is* unclear. > > For what it's worth,

Re: The big shots

2008-02-20 Thread Paul Rubin
Ben Finney <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] writes: > > My writing isn't unclear > Please re-assess that statement Really, it may not have been clear at first, but after a while, things became clear. -- http://mail.python.org/mailman/listinfo/python-list

Re: Querying a complex website

2008-02-20 Thread Mark Lim
On 2/19/08 11:55 AM, "schweet1" <[EMAIL PROTECTED]> wrote: > Greetings, > > I am attempting to use python to submit a query to the following URL: > > https://ramps.uspto.gov/eram/patentMaintFees.do > > The page looks simple enough - it requires submitting a number into 2 > form boxes and then s

Re: packing things back to regular expression

2008-02-20 Thread Steven D'Aprano
On Wed, 20 Feb 2008 11:36:20 -0800, Amit Gupta wrote: > Before I read the message: I screwed up. > > Let me write again > >>> x = re.compile("CL(?P[a-z]+)") > # group name "name1" is attached to the match of lowercase string of > alphabet > # Now I have a dictionary saying {"name1", "iamgood"}

Re: The big shots

2008-02-20 Thread Ben Finney
[EMAIL PROTECTED] writes: > My writing isn't unclear Please re-assess that statement in light of the dozens of responses from many people in the last few weeks, telling you that your writing *is* unclear. For what it's worth, I've found none of your threads in the last few weeks to make much sen

Re: firefox cache & Python

2008-02-20 Thread mmayes
On Feb 20, 3:40 am, subeen <[EMAIL PROTECTED]> wrote: > Searching for FF automation but still no luck. > > Any other idea on how to locate the cache directory and then read the > directory ? > > regards, > Subeenhttp://love-python.blogspot.com/ > > On Feb 20, 3:20 am, "Gabriel Genellina" <[EMAIL PR

Re: The big shots

2008-02-20 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Feb 20, 1:14 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: >> On 19 Feb., 04:14, [EMAIL PROTECTED] wrote: >> >>> The printing press, rail, automobiles, and Python, were not in >>> prevalent use before their invention. >> True but automobiles fuelled with newspapers and d

Re: The big shots

2008-02-20 Thread castironpi
On Feb 20, 1:14 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 19 Feb., 04:14, [EMAIL PROTECTED] wrote: > > > The printing press, rail, automobiles, and Python, were not in > > prevalent use before their invention. > > True but automobiles fuelled with newspapers and driven by Pythons > still are

Re: threaded http server

2008-02-20 Thread Steve Holden
bharath venkatesh wrote: > hi, > will this twisted,turbo gear etc help me to create a http server that > can serve multiple clients concurrently Yes. Google for the projects and do some reading, they are all serving large web sites with sometimes havy demand. > and also the http server whic

ANN: allmydata.org "Tahoe" v0.8 -- a secure, decentralized filesystem

2008-02-20 Thread zooko
ANNOUNCING: Allmydata.org "Tahoe" version 0.8 We are pleased to announce the release of version 0.8 of allmydata.org "Tahoe". Allmydata.org "Tahoe" is a secure, decentralized, fault-tolerant filesystem. All of the source code is available under a Free Software, Open Source licence (or two). Thi

Re: The big shots

2008-02-20 Thread Chris Mellon
On Tue, Feb 19, 2008 at 5:31 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > > > May I insist? By the criteria you've mentioned so far, nothing rules > > out 'ext'. If it's still a bad idea, there's a reason. What is it? > > You imply that just because something is somehow working and eve

Re: syntax error in python

2008-02-20 Thread Lalit
On Feb 20, 2:03 pm, Lalit <[EMAIL PROTECTED]> wrote: > Hi > I am executing following commands.>>> test = > os.path.isfile('c:\\src\\kasjdfl.txt') > >>> print test > > True > working fine but for below statement it is giving syntax > error. > > >>> if (os.path.isfile('c:\\src\\kasjdfl.t

syntax error in python

2008-02-20 Thread Lalit
Hi I am executing following commands. >>> test = os.path.isfile('c:\\src\\kasjdfl.txt') >>> print test True working fine but for below statement it is giving syntax error. >>> if (os.path.isfile('c:\\src\\kasjdfl.txt')) SyntaxError: invalid syntax any idea what is incorrect in my synt

Re: The big shots

2008-02-20 Thread castironpi
On Feb 19, 7:52 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 19 Feb 2008 23:19:29 -0200, <[EMAIL PROTECTED]> escribió: > > > But 'ext' is actually good. > > Even if it were, that alone doesn't mean it should be included in the   > stdlib. > > Start writting a recipe in the Python Co

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-20 Thread Fred Pacquier
Stani <[EMAIL PROTECTED]> said : > Even without python-pyexiv2 Phatch features read-only EXIF support > thanks to PIL. So you can name your files or write data stamps (date, > aperature, velocity, ...) based on EXIF information. Oh, that's good. I hadn't looked at PIL for a long while and wasn't

Re: Querying a complex website

2008-02-20 Thread schweet1
On Feb 19, 4:04 pm, 7stud <[EMAIL PROTECTED]> wrote: > schweet1 wrote: > > Greetings, > > > I am attempting to use python to submit a query to the following URL: > > >https://ramps.uspto.gov/eram/patentMaintFees.do > > > The page looks simple enough - it requires submitting a number into 2 > > form

Re: class object using widget

2008-02-20 Thread Jeff Schwab
asit wrote: > from Tkinter import * # get widget classes > from tkMessageBox import askokcancel # get canned std dialog > > class Quitter(Frame): # subclass our GUI > def __init__(self, parent=None): # constructor method >

Re: is this data structure build-in or I'll have to write my own class?

2008-02-20 Thread mkPyVS
On Feb 20, 12:07 pm, thebjorn <[EMAIL PROTECTED]> wrote: > On Feb 20, 3:32 pm, "Jorge Vargas" <[EMAIL PROTECTED]> wrote: > > > > > On Feb 20, 2008 8:15 AM, Larry Bates <[EMAIL PROTECTED]> wrote: > > > > Jorge Vargas wrote: > > > > I need a data structure that will let me do: > > > > > - attribute a

Re: how to finish a while loop...

2008-02-20 Thread Jeff Schwab
icarus wrote: > Opened up a regular console and executed it > from there. > And voilait works! Well, after this I'm going back to the old > trusty shell. +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

unitests don't run under pdb

2008-02-20 Thread Amit Gupta
Hi I have a unitest file: If I do python testname.py : the unitests runs as usual and I get the following results: -- Ran 2 tests in 0.024s OK However, if I d

scanf in python?

2008-02-20 Thread Bob and Deb
Hello python-list, This is my first post and yes I am a python newbie :-) I've been trying to figure out how to convert an old database dump into a form that can be imported into Postgresql. The file (dealing with one table) looks something like this: create table table1 (id int, name char(20),

Re: packing things back to regular expression

2008-02-20 Thread Amit Gupta
Before I read the message: I screwed up. Let me write again >> x = re.compile("CL(?P[a-z]+)") # group name "name1" is attached to the match of lowercase string of alphabet # Now I have a dictionary saying {"name1", "iamgood"} # I would like a function, that takes x and my dictionary and return "C

Re: packing things back to regular expression

2008-02-20 Thread Tim Chase
> mytable = {"a" : "myname"} >>> re.SomeNewFunc(compilexp, mytable) > "myname" how does SomeNewFunc know to pull "a" as opposed to any other key? >>> mytable = {"a" : "1"} >>> re.SomeNewFunc(compileexp, mytable) > ERROR You could do something like one of the following 3 functions: import re

Re: Why must implementing Python be hard unlike Scheme?

2008-02-20 Thread Eduardo O. Padoan
On Feb 19, 2008 3:15 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Does this have to be true? Beneath the more complex syntax are there > a few core design principles/objects/relationships to help in grokking > the whole thing? Got any related links? Take a look at a simpler implementation,

Re: The big shots

2008-02-20 Thread Kay Schluehr
On 19 Feb., 04:14, [EMAIL PROTECTED] wrote: > The printing press, rail, automobiles, and Python, were not in > prevalent use before their invention. True but automobiles fuelled with newspapers and driven by Pythons still aren't. Right? Not entirely sure what you are after but it sounds much lik

correlation between seemingly independent instances of same class

2008-02-20 Thread nikipore
Hello, the results of the following code boggle me. i would have expected that y.data is not affected by setting z.data. Regards Jan --code- class Test: def __init__(self, x={}): self.data = x #end def #end class Test y = Test() z = Test() p

Re: packing things back to regular expression

2008-02-20 Thread Gary Herron
Amit Gupta wrote: > Hi > > I wonder if python has a function to pack things back into regexp, > that has group names. > > e.g: > exp = ([a-z]+) > compiledexp = re.compile(exp) > > Now, I have a dictionary "mytable = {"a" : "myname"} > > Is there a way in re module, or elsewhere, where I can have it

packing things back to regular expression

2008-02-20 Thread Amit Gupta
Hi I wonder if python has a function to pack things back into regexp, that has group names. e.g: exp = ([a-z]+) compiledexp = re.compile(exp) Now, I have a dictionary "mytable = {"a" : "myname"} Is there a way in re module, or elsewhere, where I can have it match the contents from dictionary to

class object using widget

2008-02-20 Thread asit
from Tkinter import * # get widget classes from tkMessageBox import askokcancel # get canned std dialog class Quitter(Frame): # subclass our GUI def __init__(self, parent=None): # constructor method Frame.__init__(se

Re: is this data structure build-in or I'll have to write my own class?

2008-02-20 Thread thebjorn
On Feb 20, 3:32 pm, "Jorge Vargas" <[EMAIL PROTECTED]> wrote: > On Feb 20, 2008 8:15 AM, Larry Bates <[EMAIL PROTECTED]> wrote: > > > Jorge Vargas wrote: > > > I need a data structure that will let me do: > > > > - attribute access (or index) > > > - maintain the order (for iter and print) > > > -

Re: The big shots

2008-02-20 Thread Wildemar Wildenburger
Dotan Cohen wrote: >> French and Spanish have impersonal pronouns: "on" and "se", >> respectively. In English, they often come out as, "we", "they", and >> "you" a lot, on occasion a "one", and sometimes, even, I. > > In Hebrew, we have 8 different words for "you". That does not affect > my En

Re: how to finish a while loop...

2008-02-20 Thread Martin Blume
"richie" schrieb > > > That code works. Maybe you fixed it while > > > you were mailing it =) > > > > This is weird mate. > > I'm using eclipse 3.2 with the pydev plugin. > > There it loops forever - from the eclipse console. > > Two hours of trying, changing the code...finally gave up. > > > >

Re: Handling locked db tables...

2008-02-20 Thread Larry Bates
breal wrote: > On Feb 20, 8:05 am, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: >> On 2008-02-20 16:24, breal wrote: >> >>> I have a db table that holds a list of ports. There is a column >>> in_use that is used as a flag for whether the port is currently in >>> use. When choosing a port the table

Re: threaded http server

2008-02-20 Thread bharath venkatesh
oh .. thanks for explaining since this is my first ever project i don't know much ... can u give me a basic idea of how it(image_proxy_server) can be done efficiently .. like serving many clients concurrently On Feb 20, 2008 9:01 AM, Christian Heimes <[EMAIL PROTECTED]> wrote: > bharath ve

Re: threaded http server

2008-02-20 Thread Christian Heimes
bharath venkatesh wrote: > hi, > will this twisted,turbo gear etc help me to create a http server that can > serve multiple clients concurrently > and also the http server which i want to create in my project will not be > doing any IO (it is not like frontend and backend ).. but it will act a

Re: threaded http server

2008-02-20 Thread bharath venkatesh
hi, will this twisted,turbo gear etc help me to create a http server that can serve multiple clients concurrently and also the http server which i want to create in my project will not be doing any IO (it is not like frontend and backend ).. but it will act as a image_proxy_server i.e when a c

PEP: Adding Priority Scheduling feature to the subprocess

2008-02-20 Thread [EMAIL PROTECTED]
I am working on a PEP and would appreciate comment. The proposal is available at http://python.timehorse.com/PEP_-_Application_Priority.reST and is repeated below: - :PEP: :Title: Adding Priority Scheduling feature to the subprocess module :Version: $Rev: 93 $ :Last Modified: $Date: 2

Re: Python Memory Manager

2008-02-20 Thread Ross Ridge
<[EMAIL PROTECTED]> wrote: >20 MBs = 5 M 32-bit words = 1.25 millis to move half of them on a >2GHz machine. Don't know how much a milli costs where you live. A 2GHz machine doesn't have 20Mb of 2GHz memory. You made the mistake of measuring the speed of processor's cache, rather than the RAM.

Re: psycopg2: connect copy_from and copy_to

2008-02-20 Thread Thomas Guettler
[EMAIL PROTECTED] schrieb: > On Feb 19, 8:06 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: >> Any suggestions? > > If you don't mind trying out some beta quality software, you can try > my pg_proboscis driver. It has a DBAPI2 interface, but for you to use > COPY, you'll need to use the GreenTrunk

Re: Handling locked db tables...

2008-02-20 Thread breal
On Feb 20, 8:05 am, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: > On 2008-02-20 16:24, breal wrote: > > > I have a db table that holds a list of ports. There is a column > > in_use that is used as a flag for whether the port is currently in > > use. When choosing a port the table is read and the f

Re: The big shots

2008-02-20 Thread Preston Landers
On Feb 19, 7:19 pm, [EMAIL PROTECTED] wrote: > If not, how about these: > > - It doesn't match the rest of the language > - It's too cutting edge > - It is too hard to handle > - It would get out of hand really quickly > - I can't control you anymore after I let it in > - The functionality already

Re: What's "the standard" for code docs?

2008-02-20 Thread Preston Landers
On Feb 20, 2:32 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > I use epydoc for pyparsing, and I really like the results. Just make > sure that importing your modules doesn't really do anything > substantial (like connect to db's, or run unit tests that run for > hours); epydoc imports your code a

Re: Handling locked db tables...

2008-02-20 Thread M.-A. Lemburg
On 2008-02-20 16:24, breal wrote: > I have a db table that holds a list of ports. There is a column > in_use that is used as a flag for whether the port is currently in > use. When choosing a port the table is read and the first available > port with in_use = 0 is used, updated to in_use = 1, use

Handling locked db tables...

2008-02-20 Thread breal
I have a db table that holds a list of ports. There is a column in_use that is used as a flag for whether the port is currently in use. When choosing a port the table is read and the first available port with in_use = 0 is used, updated to in_use = 1, used, then updated to in_use = 0. I am using

Re: smtplib & gnupg

2008-02-20 Thread Shane Geiger
To the best of my knowledge, GNUPG acts upon the body of the message. If you think about it you should realize that the header of the message cannot be encrypted, as it will be handled by mail servers that have no knowledge of GNUPG or your encryption keys. I am further emboldened to make this as

Re: Why must implementing Python be hard unlike Scheme?

2008-02-20 Thread Jason
On Feb 19, 11:22 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Feb 19, 9:49 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > > Building a > > Python VM in a high level language is certainly not harder than > > creating a Scheme interpreter. > > Does VM = interpreter? > Are you saying imple

Re: The big shots

2008-02-20 Thread Grant Edwards
On 2008-02-20, Marco Mariani <[EMAIL PROTECTED]> wrote: > Sergio Correia wrote: > >> I don't get this thread. At all. I want my 15 minutes back. > > I think it's a sort of Turing test, You're probably right, and I think I failed the test. -- Grant Edwards grante Yow

Re: is this data structure build-in or I'll have to write my own class?

2008-02-20 Thread Jorge Vargas
On Feb 20, 2008 8:15 AM, Larry Bates <[EMAIL PROTECTED]> wrote: > Jorge Vargas wrote: > > I need a data structure that will let me do: > > > > - attribute access (or index) > > - maintain the order (for iter and print) > > - be mutable. > > > > in case there isn't one. I was thinking having a base

Re: is this data structure build-in or I'll have to write my own class?

2008-02-20 Thread Duncan Booth
"Jorge Vargas" <[EMAIL PROTECTED]> wrote: > I was thinking having a base class like Bunch > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52308 and on > top of that keeping a list of the keys and pop/push to the list when > adding/deleting items. I don't like this idea because I'll have

smtplib & gnupg

2008-02-20 Thread Brot
Hello, at the moment my program sends mail with smtplib. Is there a chance to sign and/or encode/cipher this mails with GnuPG? If yes, does anyone have some sample code? Regards Bernd -- http://mail.python.org/mailman/listinfo/python-list

Re: Automating GUI interaction with Python

2008-02-20 Thread jay graves
On Feb 20, 5:37 am, "Ryan Ginstrom" <[EMAIL PROTECTED]> wrote: > > On Behalf Of jorma kala > > Is there a python library or bindings to a library in some > > other language for automating GUI interaction (the kind of > > functionality provided by Autoit for instance). > > What I need to do is very

Re: is this data structure build-in or I'll have to write my own class?

2008-02-20 Thread jay graves
On Feb 20, 7:32 am, "Jorge Vargas" <[EMAIL PROTECTED]> wrote: > > What is your objective? From the description of this recipe I cann't get > > your use case. > > I got an xml object which feed me in data. in a simple format > > foo > bar > baz > bal > If it is XML why not use ElementTree or some

Re: is this data structure build-in or I'll have to write my own class?

2008-02-20 Thread Larry Bates
Jorge Vargas wrote: > I need a data structure that will let me do: > > - attribute access (or index) > - maintain the order (for iter and print) > - be mutable. > > in case there isn't one. I was thinking having a base class like Bunch > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/523

Re: Python seems to be ignoring my except clause...

2008-02-20 Thread Larry Bates
Adam W. wrote: > I am trying to handle a Unicode error but its acting like the except > clause is not even there. Here is the offending code: > > def characters(self, string): > if self.initem: > try: > self.data.append(string.encode()) >

Re: is this data structure build-in or I'll have to write my own class?

2008-02-20 Thread bearophileHUGS
subeen: > I think you should go for 'dictionary' that is a built-in data > structure of Python. The OP asks this too: > maintain the order (for iter and print) So I think an "ordered dict" is fitter, the op can search for an odict implementation, in the cookbook too (I too have written one, but i

Re: is this data structure build-in or I'll have to write my own class?

2008-02-20 Thread Jorge Vargas
dict doesn't maintains order. >>> a=[(3,2),(2,2)] >>> dict(a).items() [(2, 2), (3, 2)] >>> a=[(3,2),(2,2)] >>> assert dict(a).items()==a Traceback (most recent call last): File "", line 1, in AssertionError >>> dict(a).items() [(2, 2), (3, 2)] On Feb 20, 2008 7:50 AM, subeen <[EMAIL PROTECTED

Re: Article of interest: Python pros/cons for the enterprise

2008-02-20 Thread Tim Chase
> You Used Python to Write WHAT? > http://www.cio.com/article/185350 """ Furthermore, the power and expressivity that Python offers means that it may require more skilled developers. [...down to the summary...] Python may not be an appropriate choice if you: [...] * Rely on teams of less-experie

Re: is this data structure build-in or I'll have to write my own class?

2008-02-20 Thread subeen
I think you should go for 'dictionary' that is a built-in data structure of Python. regards, Subeen http://love-python.blogspot.com/ On Feb 20, 7:32 pm, "Jorge Vargas" <[EMAIL PROTECTED]> wrote: > 2008/2/20 Jarek Zgoda <[EMAIL PROTECTED]>:> Jorge Vargas napisa³(a): > > > > - attribute access (o

Re: threaded http server

2008-02-20 Thread Christian Heimes
bharath venkatesh wrote: > hi >i want to create fast n efficient http server which serve multiple > client concurrently .. so i thought of threading the http server using Threads ain't efficient for IO bound problems like a HTTP server. Most OSs have far better ways to deal with IO bound app

Re: is this data structure build-in or I'll have to write my own class?

2008-02-20 Thread Jorge Vargas
2008/2/20 Jarek Zgoda <[EMAIL PROTECTED]>: > Jorge Vargas napisał(a): > > > - attribute access (or index) > > - maintain the order (for iter and print) > > - be mutable. > > These are all attributes of standard Python lists. probably I confused you with the "or index" part. I want to be able to do

Re: is this data structure build-in or I'll have to write my own class?

2008-02-20 Thread Jarek Zgoda
Jorge Vargas napisał(a): > - attribute access (or index) > - maintain the order (for iter and print) > - be mutable. These are all attributes of standard Python lists. > in case there isn't one. I was thinking having a base class like Bunch > http://aspn.activestate.com/ASPN/Cookbook/Python/Reci

is this data structure build-in or I'll have to write my own class?

2008-02-20 Thread Jorge Vargas
I need a data structure that will let me do: - attribute access (or index) - maintain the order (for iter and print) - be mutable. in case there isn't one. I was thinking having a base class like Bunch http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52308 and on top of that keeping a list

Re: threaded http server

2008-02-20 Thread Steve Holden
bharath venkatesh wrote: > hi >i want to create fast n efficient http server which serve multiple > client concurrently .. so i thought of threading the http server using > > class HTTPServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer): > pass: > > as this creates an t

Re: Python Memory Manager

2008-02-20 Thread Paul Rubin
[EMAIL PROTECTED] writes: > > Use XMM instead. > > Thank you, Paul. I'm pretty sure you meant MMX, Multi-Media eXtensions. MMX is the obsolete 64 bit predecessor to XMM. XMM encompasses 128 bit wide MMX-like integer instructions and several generations of SSE floating point ops. Main thing abou

Re: The big shots

2008-02-20 Thread Dotan Cohen
On 20/02/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm going to start marking my subjective comments with a star, so it's > clear what is emperically verifiable, and what is not. An ascii star? You do realize that email is a text medium, no? > It's a bad sign. If you aren't keeping

Re: The big shots

2008-02-20 Thread Dotan Cohen
On 20/02/2008, Marco Mariani <[EMAIL PROTECTED]> wrote: > Sergio Correia wrote: > > > I don't get this thread. At all. I want my 15 minutes back. > > > I think it's a sort of Turing test, to fine-tune some spammer's text > generating algorithm. You mean this: http://science.slashdot.org/article.

Re: Python Memory Manager

2008-02-20 Thread MartinRinehart
Paul Rubin wrote: > repz movsw is a pretty lame way to copy data on current x86's. > Use XMM instead. Thank you, Paul. I'm pretty sure you meant MMX, Multi-Media eXtensions. Paul's just told me to upgrade my 32-bit thinking to use newer 64-bit registers, even on a 32-bit cpu. Please divide my p

Re: What's "the standard" for code docs?

2008-02-20 Thread Paul Boddie
On 20 Feb, 09:32, Paul McGuire <[EMAIL PROTECTED]> wrote: > > I use epydoc for pyparsing, and I really like the results. Just make > sure that importing your modules doesn't really do anything > substantial (like connect to db's, or run unit tests that run for > hours); epydoc imports your code an

Re: Double underscores -- ugly?

2008-02-20 Thread Steven D'Aprano
On Tue, 19 Feb 2008 21:50:33 -0800, Ivan Illarionov wrote: > I would like to see something like %init or &init to be converted to > __init__ behind the scenes. Unfortunately -- or perhaps fortunately -- % clashes with the already established uses of % as the modulus operator for numbers and the

Re: Python Memory Manager

2008-02-20 Thread MartinRinehart
Steve Holden wrote: > You have a strange idea of "nearly free" ... > > Extending an integer array from 100 to 150 items is a pretty puny > operation when you compare it with the amount of data that might need to > be moved during a compactifying garbage collection of a 20MB Python > program image

  1   2   >