Re: OT: excellent book on information theory

2006-01-18 Thread Roger Upole
"Alex Martelli" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > ... >> I mean, when you read "He sat on the chair" do you need >> to look up the dictionary to discover that chairs can >> have arm rests or not, they can be made of wood or

Re: web crawling.

2006-01-18 Thread Alex Martelli
S Borg <[EMAIL PROTECTED]> wrote: > Hello, > > I have been writing very simple Python programs that parse HTML and > such, mainly just to get > a better feel for the language. Here is my question: If I parsed an > HTML page into all of the image > files listed on that page, how could I request

Re: OT: excellent book on information theory

2006-01-18 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: ... > I mean, when you read "He sat on the chair" do you need > to look up the dictionary to discover that chairs can > have arm rests or not, they can be made of wood or > steel or uphostered springs, be on legs or coasters, > fixed or movable? If

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-18 Thread Fredrik Lundh
Dave Hansen wrote: > >Fuzzyman wrote: > >> I'm not familiar with the C basic datatypes - I assume it has an array > >> or list like object. > >> > >> Would it contain a sequence of poitners to the members ? In which case > >> they would only be equal if the pointers are the same. > >> > >> In this

Re: Arithmetic sequences in Python

2006-01-18 Thread Alex Martelli
Paul Rubin wrote: ... > What should the output of "print list(1,2,3)" be? Is there a really > good reason to make it different from the input syntax? If we assume that str and repr must keep coinciding for lists (and why not), no reason -- just like, say, today: >>>

tools to manipulate PDF document?

2006-01-18 Thread wcc
Hello group, I wonder what tools/modules are avaible to manipulate PDF ducument, i.e., merge, split, rotate page, crop, etc.. I checked the PyPI page and seems the only one may fit the need is pyPdf. But it is in its early stage and currently only supports two functions: merge & split. I suppose

why is my hash being weird??

2006-01-18 Thread pycraze
Hi , I am using Fedora Core -3 and my Python version is 2.4 . kernel version - 2.6.9-1.667smp There is some freakish thing that happens with python hashes when i run a python script my python file is basically : myhash = {} def summa(): global myhash

Need Help with Python/C API

2006-01-18 Thread pycraze
Hi guys, I Need to know how do i create a dictionary... eg: n = pali_hash n={} n={1:{ } } -> i need to know how to make a key of a dictionary, to a dictionary using Python/C API's Pls do help -- http://mail.python.org/mailman/listinfo/python-list

Re: how do "real" python programmers work?

2006-01-18 Thread Fernando Perez
bblais wrote: > Hello, > > Let me start by saying that I am coming from a background using Matlab > (or Octave), and C++. I am going to outline the basic nuts-and-bolts > of how I work in these languages, and ask for some help to find out how > the same thing is done in Python. I am not sure wh

Re: OT: excellent book on information theory

2006-01-18 Thread [EMAIL PROTECTED]
Terry Hancock wrote: > I find that bizarre. There is no mythological > basis for a "Sourceror's Stone", but the "Philosopher's > Stone", was of course the mythical Alchemists' goal of a > catalyst for converting lead into gold (it had other > properties, IIRC). As an American, I was somewhat myst

Re: socket.ssl with key files?

2006-01-18 Thread Martin v. Löwis
Chris Curvey wrote: > I see that socket.ssl takes "keyfile" and "certfile" parameters. So do > I just take the text file that I've been given and break it into two > files, then specify those file names when I open the connection? This might help, or it might not. If you have a passphrase on the

Re: Is the Python binding for ncurses unicode capable?

2006-01-18 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > I can't tell from the documentation, but I'd like to try and print > unicode characters through Python's binding to ncurses. From reading > the documentation on the curses module, it doesn't appear that this is > possible: > > http://python.org/doc/2.4.2/lib/module-curse

web crawling.

2006-01-18 Thread S Borg
Hello, I have been writing very simple Python programs that parse HTML and such, mainly just to get a better feel for the language. Here is my question: If I parsed an HTML page into all of the image files listed on that page, how could I request all of those images and download them into some

Re: OT: excellent book on information theory

2006-01-18 Thread Steven D'Aprano
Roger Upole wrote: I wouldn't have figured out that a "car park" was a parking lot. I might have thought it was a park where you go to look at scenery from inside your car. Sort of a cross between a normal park and a drive-in movie >>> >>> >>>Just as another isolated data point,

Re: Arithmetic sequences in Python

2006-01-18 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > > Well, [...] notation for regular lists (as opposed to list > > comprehensions) is also unnecessary since we could use "list((a,b,c))". > > Indeed, there's no reason list couldn't accept multiple arguments as an > alternative to one sequence argument, j

Re: [OT] Nit: please don't user "it's" unless you can substitute "it is" without changing your inteded meaning.

2006-01-18 Thread Steven D'Aprano
Steven D'Aprano wrote: >> But wait, if you follow the rules on the poster, you'd use an >> apostrophe for the possive of "it", right? > > > But not if you actually followed the link I intended to send but forgot to: > > http://www.angryflower.com/its.gif Dammit, wrong link. Serves me right fo

Re: How to set a wx.textctrl can editable or readonly?

2006-01-18 Thread Frank Millman
Tim Chase wrote: > > def onGotFocus(self,evt): > > if readonly: > > self.Navigate() > > > > This causes the control to react as if the user press 'tab'. By default > > it always tabs forwards, but it takes an optional 'IsForward' argument > > - set it to False to tab backwa

Re: [OT] Nit: please don't user "it's" unless you can substitute "it is" without changing your inteded meaning.

2006-01-18 Thread Steven D'Aprano
Grant Edwards wrote: > On 2006-01-19, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > >>>Typos happen to all of us, but in case you hadn't realized what "it's" >>>is a contraction for ("it is"), now you do, and you can save yourself further >>>embarrassment (assuming you care ;-). >>>If your frie

Re: OT: excellent book on information theory

2006-01-18 Thread Roger Upole
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Roger Upole wrote: > >>>I wouldn't have figured out that a "car park" was a parking lot. I >>>might have thought it was a park where you go to look at scenery from >>>inside your car. Sort of a cross between a normal

Re: Arithmetic sequences in Python

2006-01-18 Thread Steven D'Aprano
Steven Bethard wrote: > I'm not sure I find it truly hateful, but definitely unnecessary. > TOOWTDI and all... TOOWTDI Considered Harmful. There is confusion between "There's Only One Way To Do It" and "There's One Obvious Way To Do It". The first is pejorative, harmful if it were true but st

Re: Arithmetic sequences in Python

2006-01-18 Thread André
Alex Martelli wrote: > Paul Rubin wrote: >... > > Well, [...] notation for regular lists (as opposed to list > > comprehensions) is also unnecessary since we could use "list((a,b,c))". > [snip] ... or should that be list(snip)? > But > list has no such problem, a

Re: OT: excellent book on information theory

2006-01-18 Thread Steven D'Aprano
Roger Upole wrote: >>I wouldn't have figured out that a "car park" was a parking lot. I >>might have thought it was a park where you go to look at scenery from >>inside your car. Sort of a cross between a normal park and a drive-in >>movie > > > Just as another isolated data point, the first t

Re: [OT] Nit: please don't user "it's" unless you can substitute "it is" without changing your inteded meaning.

2006-01-18 Thread Grant Edwards
On 2006-01-19, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> Typos happen to all of us, but in case you hadn't realized what "it's" >> is a contraction for ("it is"), now you do, and you can save yourself further >> embarrassment (assuming you care ;-). >> If your friends won't tell you, who will

Re: a more precise re for email addys

2006-01-18 Thread Steven D'Aprano
[EMAIL PROTECTED] wrote: > rbt> re.compile('([EMAIL PROTECTED])') > rbt> re.compile(r'[EMAIL PROTECTED],4}') > rbt> re.compile('(\S+)@(\S+)') > > rbt> All of these will find email addys, but they also find other > rbt> things. > > I think the only way to decide if your regular

Re: Another method of lazy, cached evaluation.

2006-01-18 Thread simonwittber
Hmm, good ideas. I've made some refinements and posted to the cookbook. The refinements allow for multilple function arguments and keywords. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/466315 -Sw. -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Nit: please don't user "it's" unless you can substitute "it is" without changing your inteded meaning.

2006-01-18 Thread Steven D'Aprano
Bengt Richter wrote: > Typos happen to all of us, but in case you hadn't realized what "it's" > is a contraction for ("it is"), now you do, and you can save yourself further > embarrassment (assuming you care ;-). > If your friends won't tell you, who will ;-) For all three of the people on the

Re: Returning a tuple-struct

2006-01-18 Thread James Stroud
[EMAIL PROTECTED] wrote: > I've noticed that there's a few functions that return what appears to > be a tuple, but that also has attributes for each item in the tuple. > For example, time.localtime() returns a time.time_struct, which looks > like a tuple but also like a struct. That is, I can do:

Returning a tuple-struct

2006-01-18 Thread groups . 20 . thebriguy
I've noticed that there's a few functions that return what appears to be a tuple, but that also has attributes for each item in the tuple. For example, time.localtime() returns a time.time_struct, which looks like a tuple but also like a struct. That is, I can do: >>> time.localtime() (2006, 1, 1

Re: verify a user

2006-01-18 Thread Dan Sommers
On Wed, 18 Jan 2006 18:25:19 -0700, David Bear <[EMAIL PROTECTED]> wrote: > If I have a unix user name, is there a way to verify that the user > really exists and query default group memberships? import pwd unix_user_name = raw_input( 'enter a user name:' ) try: print pwd.getpwnam( unix_user_

Re: OT: excellent book on information theory

2006-01-18 Thread Alex Martelli
Terry Hancock <[EMAIL PROTECTED]> wrote: ... > > Nothing at all. But I still prefer tales of people who > > have hacked their DVD players to be multi-region :-) > > It isn't illegal in Canada anyway. And yes, it would be > possible for me to pay a very high price to get a > region-free player

Re: Arithmetic sequences in Python

2006-01-18 Thread Alex Martelli
Paul Rubin wrote: ... > Well, [...] notation for regular lists (as opposed to list > comprehensions) is also unnecessary since we could use "list((a,b,c))". Indeed, there's no reason list couldn't accept multiple arguments as an alternative to one sequence argument, j

A learning exercise...yet another Sudoku solver with GUI

2006-01-18 Thread engsolnorm
A co-worker and I want to increase our knowledge of Python. I have a tiny bit of exposure to python. He has none, but has wide experience with C, C++, NET, C#, etc. We agreed we'd do a Sudoku solver. I'd do the GUI, he would do the solver code. My question is this: I assume that once I invoke

New Python.org website?

2006-01-18 Thread Obaid R.
Steve Holden: > The history of this choice is lost in the mists of time. Many other > proposals were made and discussed at around the same time, to the extent > that it became clear no one choice could win universal approval. > >You are the first person to my knowledge to point out that it is shap

Re: New Python.org website ?

2006-01-18 Thread Shalabh Chaturvedi
JW wrote: > Tim the Taller (I presume he's taller; he's Dutch) and the other critics > fail to realize is that no one reads "content". I disagree completely. I wouldn't touch a new language or technology without first reading content. Neither would my boss, or any other manager for that matter.

Re: Another method of lazy, cached evaluation.

2006-01-18 Thread Kamilche
If you wanted to avoid the __getattr__ __setattr__ speed hit, something like this would work. However, you have to not mind calling a function to get the data, instead of only getting the attribute: class Cache(object): _cache = {} def __init__(self, filename): self.filename = file

Re: New Python.org website ?

2006-01-18 Thread Shalabh Chaturvedi
Tim Parkin wrote: > Tim N. van der Leeuw wrote: >> Perhaps I should have withheld my criticisms until I could offer an >> alternative. (Still thinking about what could be there instead of those >> 3 pictures. But I'd like there to be some actual real Python content, >> or links to events from the P

Re: magical expanding hash

2006-01-18 Thread braver
Giovanni Bajo wrote, > dict.setdefault, as I already explained to you. I wonder about numerics too. Say we have a = None somewhere. I want to increment it, so I'd say a += 8. Now if this is a parsing app, the increment may happen everywhere -- so I'd write a function to do it if I worry about

Re: OT: excellent book on information theory

2006-01-18 Thread Terry Hancock
On Mon, 16 Jan 2006 12:15:25 -0500 "Tim Peters" <[EMAIL PROTECTED]> wrote: > You should enjoy: > >http://www.hp-lexicon.org/about/books/differences.html > > and especially the links near the bottom to > try-to-be-exhaustive listings of all differences between > the Bloomsbury (UK) and Scholas

Re: New Python.org website ?

2006-01-18 Thread Shalabh Chaturvedi
Tim Parkin wrote: > Well apart from the front page and a couple of pages providing content > specific to different types of usersm the whole site is the same as it > was before. Do you have a problem with marketing python or with the > content of the python site? Could you expand on why you think

verify a user

2006-01-18 Thread David Bear
If I have a unix user name, is there a way to verify that the user really exists and query default group memberships? -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

Re: understanding stat module names

2006-01-18 Thread David Bear
Claudio Grondi wrote: > David Bear wrote: >> I'm trying to use os.chmod and am refered to the stat module. >> >> Is there are explanation of: >> * S_ISUID >> * S_ISGID >> * S_ENFMT >> * S_ISVTX >> * S_IREAD >> * S_IWRITE >> * S_IEXEC >> * S_IRWXU >> * S_IRUSR >

socket.ssl with key files?

2006-01-18 Thread Chris Curvey
I need to use socket.ssl() to open a connection using key files. I have been provided with a text file called cert_key_pem.txt containing my keys that looks like this: -BEGIN RSA PRIVATE KEY- MIICXgIBAAKBgQDKwLuk/UpICOnZvH3mf9rFQvCkDPA8XQZLpa80Z0liMVYu4GQT -END RSA PRIVATE KEY- -

getopt.gnu_getopt: incorrect documentation

2006-01-18 Thread Giovanni Bajo
Hello, The official documentation for "getopt.gnu_getopt" does not mention the version number in which it was introduced (so I assumed it was introduced back when getopt was added). This is wrong, though: I was informed that Python 2.2 does not have this function, and a quick google search turned

Re: OT: excellent book on information theory

2006-01-18 Thread Roger Upole
"Paul Rubin" wrote in message news:[EMAIL PROTECTED] > Terry Hancock <[EMAIL PROTECTED]> writes: >> > > Very interesting. And rather sad that editors think the >> > > average Amermican reader too dim-witted to figure out >> > > (in context, even) that a "car park" is a

Re: OT: excellent book on information theory

2006-01-18 Thread Terry Hancock
On Wed, 18 Jan 2006 07:55:50 + Steve Holden <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > Terry Hancock <[EMAIL PROTECTED]> wrote: > >... > > > >>due to the Evil Conspiracy of region-coding, I couldn't > >>watch the British DVD even if I were to import it (Well, > >>yeah I could,

Re: understanding stat module names

2006-01-18 Thread Marius Gedminas
David Bear wrote: > I'm trying to use os.chmod and am refered to the stat module. > > Is there are explanation of: > * S_ISUID ... > * S_IXOTH These come from the POSIX standard. See http://www.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html HTH, Marius Gedminas -- http://mail.py

Re: Registering COM python based components when not admin

2006-01-18 Thread Roger Upole
To register the com server for only the current user, your base key should be HKEY_CURRENT_USER\SOFTWARE\Classes instead of just HKCU. However, I don't know if this will solve your problem or not. The ICatRegister interface is supplied by the system, so nobody but MS has the source code to the Re

Re: Being unjust

2006-01-18 Thread Runsun Pan
I would prefer to see a core gui library that has a dom like structure and the core lib doesn't really define the interface but only serves as "an interface to other interfaces".   For example, a button class in this library will work like this :      b = Button('Submit')    b.setStyles( {'backgro

Pythonise this algorithm ?

2006-01-18 Thread news
Don't you hate the *.ps/*.pdf texts which are arranged in columns as if it was a newspaper ? Especially when you want to email a section after using 'pdftotxt'. I'm guessing that an algorithm to extract colums could work like this : [assume 2 column, but 3, 4.. should be similar, remember that

Re: Duplicate entries in a matrix

2006-01-18 Thread Gerard Flanagan
Chris Lasher wrote: > Hello Pythonistas! > I'm looking for a way to duplicate entries in a symmetrical matrix > that's composed of genetic distances. For example, suppose I have a > matrix like the following: > > ABC > A 0.00 0.50 1.00 > B 0.50 0.00 0.50

Re: Trying to generate a list of the subclasses of C

2006-01-18 Thread Charles Krug
On 2006-01-16, Alex Martelli <[EMAIL PROTECTED]> wrote: > Charles Krug <[EMAIL PROTECTED]> wrote: >... >> I'm trying to create a list of all of C's subclasses: > > There's a class method for that very purpose: > class C(object): pass > ... class D(C): pass > ... class E(C): pas

Re: understanding stat module names

2006-01-18 Thread Claudio Grondi
David Bear wrote: > I'm trying to use os.chmod and am refered to the stat module. > > Is there are explanation of: > * S_ISUID > * S_ISGID > * S_ENFMT > * S_ISVTX > * S_IREAD > * S_IWRITE > * S_IEXEC > * S_IRWXU > * S_IRUSR > * S_IWUSR > * S_IXUSR >

Re: New Python.org website ?

2006-01-18 Thread Roel Schroeven
Roel Schroeven schreef: > JW schreef: >> I >> immediately >> noticed something when visiting Joel using Firefox. **Scrollbars**. The >> page wouldn't even fit on the screen! I started to read it, but my face >> went numb before I needed to use the scrollbar. > > [...] >> >> OK for blogging --

Re: Another method of lazy, cached evaluation.

2006-01-18 Thread Kamilche
[EMAIL PROTECTED] wrote: > Now, when the pic_1 and pic_2 attributes are accessed, they will return > an Image instance, which is something different to which they were > initially assigned. Is this kind of behavior bad form? That's pretty good, I like it. > Likewise, what > do people think abou

understanding stat module names

2006-01-18 Thread David Bear
I'm trying to use os.chmod and am refered to the stat module. Is there are explanation of: * S_ISUID * S_ISGID * S_ENFMT * S_ISVTX * S_IREAD * S_IWRITE * S_IEXEC * S_IRWXU * S_IRUSR * S_IWUSR * S_IXUSR * S_IRWXG * S_IRGRP * S_IWGRP * S_IX

Re: A simpler more pythonic approach to adding in

2006-01-18 Thread George Sakkis
A cleaner, though not shorter, rewriting could be: from itertools import chain def ancestors(path): while True: yield path parent = os.path.dirname(path) if parent == path: break path = parent for dir in chain([os.environ['HOME']],

Re: New Python.org website ?

2006-01-18 Thread Roel Schroeven
JW schreef: > On Wed, 18 Jan 2006 20:51:03 +, Roel Schroeven wrote: > >> I, Jim Wilson, schreef: >>> I'm assured that in print ads the only "content" anyone reads is in >>> picture captions, and you damn well better make sure your message is >>> conveyed there. Any other "content" only wastes

PyCon Vs. Europython

2006-01-18 Thread Simon Burton
My employer has given me the choice to go to either Pycon or Europython this year, and I need some help deciding which would be more useful (for me, my company, and python itself). I am mainly interested in scientific/engineering applications of python; and am keen to work on/learn about some of t

Re: MySQLdb - Query/fetch don't return result when it *theorically* should

2006-01-18 Thread Bernard Lebel
I'm absolutely flabbergasted. Your suggestion worked, the loop now picks up the changed values, and without the need to reconnect. It's the first time I have to commit after a query, up until I wrote this program, I used commit() was for UPDATE/INSERT types of commands only, and always got proper

Re: Uncompressing TIFF files directly in Python

2006-01-18 Thread sophie_newbie
Ya that was the original plan but it didn't support the G4 compression of the tif files! I think the idea of using tiffcp is the best as it runs on both unix and windows which is what i need! -- http://mail.python.org/mailman/listinfo/python-list

Re: Uncompressing TIFF files directly in Python

2006-01-18 Thread sophie_newbie
Ya I did, sorry! -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb - Query/fetch don't return result when it *theorically* should

2006-01-18 Thread Stephen Prinster
Have you tried doing a "connection.commit()" after each query attempt? I believe mysqldb also has a connection.autocommit feature. -- http://mail.python.org/mailman/listinfo/python-list

Duplicate entries in a matrix

2006-01-18 Thread Chris Lasher
Hello Pythonistas! I'm looking for a way to duplicate entries in a symmetrical matrix that's composed of genetic distances. For example, suppose I have a matrix like the following: ABC A 0.00 0.50 1.00 B 0.50 0.00 0.50 C 1.00 0.50 0.00 Say I

RE: New Python.org website ?

2006-01-18 Thread Walter S. Leipold
Martin Maney writes: > From a quick look, the beta appears to commit the same error as every > design (as opposed to usability) driven web site in the > world: it makes the running text smaller than the user's default. > It's as if they care more about how it looks than whether I can read > it..

Re: MSSQL LIKE and IN statements in ADO problem

2006-01-18 Thread Peter A.Schott
Well, the raw TSQL would be: select * from tb_name where firstname like '%raj%' I think that would more translate to: name = "raj" cmd.CommandText = "SELECT * FROM tb_name WHERE firstname like '%%%s%%'" % name Perhaps issuing a print statement of the CommandText would help for future runs to de

Re: MySQLdb - Query/fetch don't return result when it *theorically* should

2006-01-18 Thread Bernard Lebel
Hi Alan, On 1/18/06, Alan Franzoni <[EMAIL PROTECTED]> wrote: > Il Wed, 18 Jan 2006 14:39:09 -0500, Bernard Lebel ha scritto: > 1) It would be great if you didn't post four messages in less than an hour > ^_^ Yeah I know :-) But like I said, I've been stuck for 3 days on that, so, I need to get t

project ideas

2006-01-18 Thread Stephen Aichele
I'm looking for ideas for an intermediate-level python project that would allow me to touch on the following: (a) use of oo design patterns in python (b) threading (c) socket programming (d) wxPython gui interface (e) possibly integrate with MySQL To date I've acquired some experience with (b) thro

A simpler more pythonic approach to adding in

2006-01-18 Thread rh0dium
Hi all, I need a cleaner ( and shorter ) way to to look in my home directory or any directory for a directory called modules. This is what I currently have - but it is really ugly. Some a few of you experts point me to a cleaner more pythonic approach? mod = 0 if os.path.exists( o

wanna stop by my homemade glory hole?

2006-01-18 Thread RUPEDUDE
HI SUGAR, WONDERED IF YOU HAVE ANY VIDEOS FOR SALE. NOTHING HOTTER THAN A FOX SUCKING AN UNKNOWN. LET ME KNOW, AND THANKS.   M -- http://mail.python.org/mailman/listinfo/python-list

Problem getting MoinMoin going

2006-01-18 Thread funny_leech
Please tell me if there's a better group to post this in-- I've been trying to get a MoinMoin installation up-and-running for the last two days. I've installed the latest MoinMoin version, mod_python (v. 2.3.4) is running, using Apache on a White Box Enterprise Linux VPS installation. So the bas

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-18 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Claudio Grondi <[EMAIL PROTECTED]> wrote: ... > It is probably true, that it doesn't much matter when writing Python > code when one do not understand how Python works internally. The rare > practical cases of getting into trouble because of lack of such > unders

Re: OT: excellent book on information theory

2006-01-18 Thread Grant Edwards
On 2006-01-18, Steve Holden <[EMAIL PROTECTED]> wrote: >> Getting overly sensitive, I guess: Once your country goes >> and violates international conventions and UN sanctions, >> invades foreign countries who haven't attacked it, and >> starts taking political prisoners, spies on >> its own citiz

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-18 Thread Steven D'Aprano
On Wed, 18 Jan 2006 15:29:24 +0100, Claudio Grondi wrote: > The problem here is, that I mean, that in Python it makes no sense to > talk about a value of an object, because it leads to weird things when > trying to give a definition what a value of an object is. Python object: 1 The value of th

Shell-like Decorators

2006-01-18 Thread Joel Bender
I was inspired by shell-like processing mentioned here: and created a decorator version below. I've been using it for parsing a pile of C include files and building digraphs of the results. For example, given jdir('*.h') retu

Re: New Python.org website ?

2006-01-18 Thread André
I have read enough "crass" criticisms that I felt I should add my voice to this discussion... I can't wait to see the new website go on "live". No offense to anyone, but I think that the current website is extremely "amateurish" and could serve as a deterrent to the promotion of Python [ok, this

Re: check to see if value can be an integer instead of string

2006-01-18 Thread Steven D'Aprano
On Wed, 18 Jan 2006 04:23:17 -0800, nephish wrote: > it isn't really that i will want to change it to an integer anyway. the > script uses a table to reference a value to a key, if the key is a > group of letters, that code tells the script to do something. if the > value is a number, it means an

Re: Addressing the modem via pyserial

2006-01-18 Thread Roel Schroeven
Doru-Catalin Togea schreef: > My question is actually: will an at-command like 'atdt1234' translate to > ser.write('atdt1234')? You'll have to include the end-of-line; I guess 'atdt1234\n' should work, otherwise you can try 'atdt1234\r\n' or 'atdt1234\r'. Also, don't forget that you have to set

Re: a more precise re for email addys

2006-01-18 Thread rbt
[EMAIL PROTECTED] wrote: > Does it really need to be a regular expression? Why not just write a > short function that breaks apart the input and validates each part? > > def IsEmail(addr): > 'Returns True if addr appears to be a valid email address' > > # we don't allow stuff like [EMAIL PROT

Re: Uncompressing TIFF files directly in Python

2006-01-18 Thread Gary Duzan
sophie_newbie wrote: > Hey guys, > > OK this is a long shot but does anyone know of a way to uncompress tiff > files directly in python. I know it can be done with an os call but > that'll only work on unix and only if the right software is installed! > > I need to convert tiff images downloaded

Is the Python binding for ncurses unicode capable?

2006-01-18 Thread bmcnally
I can't tell from the documentation, but I'd like to try and print unicode characters through Python's binding to ncurses. From reading the documentation on the curses module, it doesn't appear that this is possible: http://python.org/doc/2.4.2/lib/module-curses.html Am I missing something, or is

Re: a more precise re for email addys

2006-01-18 Thread dave . brueck
Does it really need to be a regular expression? Why not just write a short function that breaks apart the input and validates each part? def IsEmail(addr): 'Returns True if addr appears to be a valid email address' # we don't allow stuff like [EMAIL PROTECTED]@biff.com if addr.count('@') !=

Re: OT: excellent book on information theory

2006-01-18 Thread Steve Holden
Terry Hancock wrote: > On Wed, 18 Jan 2006 07:58:10 + > Steve Holden <[EMAIL PROTECTED]> wrote: > >>Terry Hancock wrote: >> >>>On Tue, 17 Jan 2006 13:28:15 + >>>Steve Holden <[EMAIL PROTECTED]> wrote: >>> They know that the average American could work it out. They also know that t

Re: OT: excellent book on information theory

2006-01-18 Thread Terry Hancock
On Wed, 18 Jan 2006 07:58:10 + Steve Holden <[EMAIL PROTECTED]> wrote: > Terry Hancock wrote: > > On Tue, 17 Jan 2006 13:28:15 + > > Steve Holden <[EMAIL PROTECTED]> wrote: > >>They know that the average American could work it out. > >>They also know that the average American doesn't like

Re: New Python.org website ?

2006-01-18 Thread JW
On Wed, 18 Jan 2006 20:51:03 +, Roel Schroeven wrote: > I, Jim Wilson, schreef: >> >> I'm assured that in print ads the only "content" anyone reads is in >> picture captions, and you damn well better make sure your message is >> conveyed there. Any other "content" only wastes space. I see no

Re: MySQLdb - Query/fetch don't return result when it *theorically* should

2006-01-18 Thread Alan Franzoni
Il Wed, 18 Jan 2006 14:39:09 -0500, Bernard Lebel ha scritto: [cut] 1) It would be great if you didn't post four messages in less than an hour ^_^ 2) Your code is very long! You can't expect many people to run and read it all! You should post a very small demo program with the very same problem a

Re: New Python.org website ?

2006-01-18 Thread Roel Schroeven
Tim Parkin schreef: > Shalabh Chaturvedi wrote: >> Hm. Am I the only one not particularly impressed? Sure the front page is >> 'slick' but a few clicks reveal a fairly shallow facade of marketing >> material, with no real content. In general gives the impression of >> 'phony' company trying to m

Re: a more precise re for email addys

2006-01-18 Thread rbt
Jim wrote: > There is a precise one in a Perl module, I believe. > http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html > Can you swipe that? > > Jim > I can swipe it... but it causes my head to explode. I get unbalanced paratheses errors when trying to make it work as a python re... it mak

Re: Sudoku solver: reduction + brute force

2006-01-18 Thread Carl Cerecke
ago wrote: >> But to inflate my ego beyond the known universe, here is my solver >>(that solves the avove mentioned grid reasonably fast). I suppose the >>only difference is that is uses 3, rather than 2, rules to simplify >>before starting tree-like search. > > > Thanks for the nice problem and

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-18 Thread Dave Hansen
On 18 Jan 2006 08:41:00 -0800 in comp.lang.python, [EMAIL PROTECTED] wrote: > >Fuzzyman wrote: >> I'm not familiar with the C basic datatypes - I assume it has an array >> or list like object. >> >> Would it contain a sequence of poitners to the members ? In which case >> they would only be equal

Re: Clicking at a certain x,y position in python? (Mac OSX)

2006-01-18 Thread Nainto
I found soemthing! The following link will lead you to a page that will give you the code to to create a commandline tool that will manipulate the mouse. Then you can just set mouseButtonDown to true and be on your way! http://tinyurl.com/br7ty -- http://mail.python.org/mailman/listinfo/python-l

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-18 Thread Dave Hansen
On Wed, 18 Jan 2006 17:03:23 +0100 in comp.lang.python, Claudio Grondi <[EMAIL PROTECTED]> wrote: [...] > > >>> a = 1L > >>> b = 1L > >>> a is b >False > >Python fails to reuse the long integer object. It would be interesting >to know why, because it seems to be strange, that in case of integers

Re: New Python.org website ?

2006-01-18 Thread Roel Schroeven
JW schreef: > On Wed, 18 Jan 2006 00:33:06 -0800, Tim N. van der Leeuw wrote: > >> What I especially dislike about the new website are the flashy pictures >> on the front-page with no content and no purpose -- purely boasting but >> nothing to back up your claims. >> >> (I wouldn't mind some sleek

Re: how do "real" python programmers work?

2006-01-18 Thread Stormcoder
I might be a little late to the party but my comments may still be valuable. I write Python code in emacs. Emacs has an great python-mode. The code I write can range from a GUI apps to server side code and emacs works just as well in all cases. Some of the features that make emacs a good Python ed

Re: New Python.org website ?

2006-01-18 Thread Roel Schroeven
Tim Parkin schreef: > Roel Schroeven wrote: >> Tim N. van der Leeuw schreef: >> >>> Shalabh, >>> >>> You've managed very well to express the same things I feel about the >>> new Python website. >> >> FWIW, I don't like the new site at all. It tries to look slick (but >> fails to do so in my opinio

Re: OT: excellent book on information theory

2006-01-18 Thread Christopher Subich
Tim Peters wrote:> > Probably not, if Paul's American. For example, here in the states we > have Python Parks, where you go to look at scenery from inside your > python. As an American residing in Canada, I'll say that Python Parks are only fun if they spring for hydro -- otherwise it's kind of

Re: a more precise re for email addys

2006-01-18 Thread André Malo
* rbt wrote: > Is it possible to write an re that _only_ matches email addresses? No. The only way to check if the matched thing is a mail address is to send a mail and ask the supposed receiver whether he got it. The grammar in RFC 2822 nearly matches anything with an @ in it. So, how accurate

Re: Being unjust

2006-01-18 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Even your technique narrows the list of candidates down to one, that > doesn't solve the problem. There is a certain "stamp of approval" > implicit with inclusion in the standard library. It's thus a fairly > important decision to get at least approximately right. Yes

Re: list(...) and list comprehensions (WAS: Arithmetic sequences in Python)

2006-01-18 Thread Diez B. Roggisch
Steve Holden schrieb: > Diez B. Roggisch wrote: >>> due to the nested parentheses. Note that replacing list >>> comprehensions with list(...) doesn't introduce any nested >>> parentheses; it basically just replaces brackets with parentheses. >> >> >> But you don't need the nested parentheses - u

Re: a more precise re for email addys

2006-01-18 Thread skip
Jim> http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html Maybe Cafe Express could be convinced to put that on a t-shirt... Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Being unjust

2006-01-18 Thread skip
Paul> There are maybe a half dozen plausible candidates. The first Paul> thing to do is ask the authors whether they'd WANT their framework Paul> to be shipped with Python. If exactly one says yes, that makes Paul> the choice simple. Either way, that question should narrow it

  1   2   3   4   >