Pyowa Meeting 04-02-2009

2009-04-01 Thread Mike Driscoll
Event: Pyowa Meeting Location: Durham Center Room 248, ISU, Ames, IA Time: 7-9 p.m. on 04/02/2009 Topics: PyCon thoughts, plans for expanding, script review Website directions: www.pyowa.org If you're a Python programmer or want to be one, come to Pyowa! It's a good networking opportunity and

[ANNOUNCE] python-gtkmvc 1.99.0

2009-04-01 Thread Roberto Cavada
Version 1.99.0 of pygtkmvc has been released. Project homepage: http://apps.sourceforge.net/trac/pygtkmvc/wiki Download: http://sourceforge.net/projects/pygtkmvc/ == About pygtkmvc == pygtkmvc is a fully Python-based implementation of the Model-View-Controller

Re: Python Goes Mercurial

2009-04-01 Thread Lawrence D'Oliveiro
In message 35d429fa-5d13-4703- a443-6a95c740c...@o6g2000yql.googlegroups.com, John Yeung wrote: Here's one that clearly expresses strong antipathy: http://mail.python.org/pipermail/python-dev/2009-March/087971.html There are lots of GUI- and Web-based front ends to Git. And look at on-line

Re: Beazley on Generators

2009-04-01 Thread Lawrence D'Oliveiro
In message d2733ede-4d66-40a2-9a63-60d5363db...@q16g2000yqg.googlegroups.com, Michele Simionato wrote: Excellent reading for everybody wanting to understand cooperative concurrency! Hey, some of us were doing cooperative concurrency programming old MacOS for years. It was generally

Re: python for loop

2009-04-01 Thread Hrvoje Niksic
Chris Rebert c...@rebertia.com writes: Among other things, it has the nice property that: len(some_list[n:m]) == m-n And also that it is intuitive how to represent an empty slice (foo[n:n]). When traversing over sublists, it's also a useful property that foo[a:b] + foo[b:c] == foo. --

Re: Thoughts on language-level configuration support?

2009-04-01 Thread Aaron Brady
On Mar 30, 8:40 am, jfager jfa...@gmail.com wrote: I've written a short post on including support for configuration down at the language level, including a small preliminary half-functional example of what this might look like in Python, available athttp://jasonfager.com/?p=440. The basic

Re: Python Goes Mercurial

2009-04-01 Thread Paul Rubin
Terry Reedy tjre...@udel.edu writes: So what were these strong antipathies towards Git, exactly? The relevant PEP is http://www.python.org/dev/peps/pep-0374/ Interesting. I'm on a project that switched from Mercurial to Git recently. I don't have much of a sense of the relevant differences

Re: urllib2, proxies, and pac files on OS X

2009-04-01 Thread Cameron Simpson
On 30Mar2009 11:00, Mani Ghasemlou m...@tungle.com wrote: | urllib2 correctly detects proxies as configured in my preferences pane | on OS X 10.5: [...] | However, when configuring a proxy via PAC file, this does not seem to | be the case: [...] | Is there any way to obtain (and parse using

Re: Stripping non-numbers from a file parse without nested lists?

2009-04-01 Thread daku9999
On Mar 31, 6:47 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: What you're doing (pace error checking) seems fine for the data structures that you're using.  I'm not entirely clear what your usage pattern for dip and dir is once you've got them, so I can't say whether there's a more

Beautiful soup : why does string not give me the string?

2009-04-01 Thread Gabriel Rossetti
Hello everyone, I am using beautiful soup to parse some HTML and I came across something strange. Here is an illustration: soup = BeautifulSoup(u'div class=texthello ça boumebr //div') soup div class=texthello ça boumebr //div soup.find(div, text) div class=texthello ça boumebr //div

Re: urllib2 problem, data param not working? : DISREGARD

2009-04-01 Thread Gabriel Rossetti
Gabriel Rossetti wrote: Hello everyone, I am having a problem with urllib2, when I do this : post = urllib.urlencode(post) request = urllib2.Request(url, post) response = urllib2.urlopen(request) or this : post = urllib.urlencode(post) response = urllib2.urlopen(url, post) or

Re: Python Goes Mercurial

2009-04-01 Thread Chris Rebert
On Wed, Apr 1, 2009 at 12:01 AM, Carl Banks pavlovevide...@gmail.com wrote: On Mar 31, 6:25 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: http://arstechnica.com/open-source/news/2009/03/python-adopts-the-mer... So what were these strong antipathies towards Git, exactly?

Re: Thoughts on language-level configuration support?

2009-04-01 Thread Kay Schluehr
Discoverable, as in built-in tools that let you have the following conversation: Program, tell me all the things I can configure about you - Okay, here they all are. No digging through the source required. But this doesn't have any particular meaning. If I run a dir(obj) command all

Re: Python Goes Mercurial

2009-04-01 Thread Carl Banks
On Mar 31, 6:25 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: http://arstechnica.com/open-source/news/2009/03/python-adopts-the-mer... So what were these strong antipathies towards Git, exactly? Apparently Mercurial had it's own hate club, and the reaction on python-dev was

Re: python for loop

2009-04-01 Thread Carl Banks
On Mar 31, 7:23 pm, Lada Kugis lada.ku...@gmail.com wrote: On 01 Apr 2009 01:26:41 GMT, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: Why Python (and other languages) count from zero instead of one, and why half-open intervals are better than closed intervals:

Re: Does Python have certificate?

2009-04-01 Thread Lawrence D'Oliveiro
http://dilbert.com/dyn/str_strip/0//000/00/0/6000/800/6858/6858.strip.gif -- http://mail.python.org/mailman/listinfo/python-list

A design problem I met again and again.

2009-04-01 Thread 一首诗
Hi all, I am a programmer who works with some different kinds of programming languages, like python, C++(in COM), action script, C#, etc. Today, I realized that, what ever language I use, I always meet a same problem and I think I never solve it very well. The problem is : how to break my app

Re: python for loop

2009-04-01 Thread Diez B. Roggisch
Lada Kugis schrieb: On 01 Apr 2009 01:26:41 GMT, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: Why Python (and other languages) count from zero instead of one, and why half-open intervals are better than closed intervals:

Re: python for loop

2009-04-01 Thread Steven D'Aprano
On Wed, 01 Apr 2009 04:39:26 +0100, Rhodri James wrote: Dragging this back to the original topic, you clearly find starting list indices from zero unintuitive. To me, with a mathematical background, it's not just intuitive, it's correct. All sorts of useful properties fall out from that,

Re: Beazley on Generators

2009-04-01 Thread Michele Simionato
On Apr 1, 7:57 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message d2733ede-4d66-40a2-9a63-60d5363db...@q16g2000yqg.googlegroups.com, Michele Simionato wrote: Excellent reading for everybody wanting to understand cooperative concurrency! Hey, some of us were

Re: Beautiful soup : why does string not give me the string?

2009-04-01 Thread Jeremiah Dodds
On Wed, Apr 1, 2009 at 8:25 AM, Gabriel Rossetti gabriel.rosse...@arimaz.com wrote: Hello everyone, I am using beautiful soup to parse some HTML and I came across something strange. Here is an illustration: soup = BeautifulSoup(u'div class=texthello ça boumebr //div') soup div

Re: udp package header

2009-04-01 Thread Jeremiah Dodds
On Tue, Mar 31, 2009 at 6:19 PM, Artur M. Piwko milusi.pysiac...@buziaczek.pl wrote: In the darkest hour on Tue, 24 Mar 2009 00:50:10 + (UTC), R. David Murray rdmur...@bitdance.com screamed: I got a problem. İ want to send udp package and get this package (server and clinet ). it's

Re: A design problem I met again and again.

2009-04-01 Thread Lawrence D'Oliveiro
In message 48506803-a6b9-432b-acef- b75f76e90...@v23g2000pro.googlegroups.com, 一首诗 wrote: Until one day I find service has nearly 100 methods and 6000 lines of code. I don't need to read any programming book to know that it's too big. The question is not how many lines or how many methods,

List of paths

2009-04-01 Thread Nico Grubert
Dear Python developers I have the following (sorted) list. ['/notebook', '/notebook/mac', '/notebook/mac/macbook', '/notebook/mac/macbookpro', '/notebook/pc', '/notebook/pc/lenovo', '/notebook/pc/hp', '/notebook/pc/sony', '/desktop', '/desktop/pc/dell', '/desktop/mac/imac',

Re: I find explicit self much easier to understand if i replace it in my mind with the word instance

2009-04-01 Thread Lawrence D'Oliveiro
In message pan.2009.04.01.00.57...@remove.this.cybersource.com.au, Steven D'Aprano wrote: On Tue, 31 Mar 2009 07:05:13 -0700, frolib wrote: I find explicit self much easier to understand if i replace it in my mind with the word instance. I know that using the word self though is a strong

Re: List of paths

2009-04-01 Thread andrew cooke
def filter(values): ... last = None ... for value in values: ... if last is None or not value.startswith(last): ... yield value ... last = value ... for x in filter(['/notebook', ]): ... print(x) ... /notebook /desktop /server/hp/proliant andrew Nico Grubert wrote:

Re: A design problem I met again and again.

2009-04-01 Thread andrew cooke
Ò»Ê×Ê« wrote: 3. completely move codes in service to business classes. Initialize these classes and pass them to protocol classes. These protocol classes calls these instances of business classes instead of call service. These means whenever I add a new business class. I have to add a

Re: python for loop

2009-04-01 Thread andrew cooke
something i don't think has been mentioned much - if you're using range() in your python code then you're almost always doing it wrong. i just grepped lepl and i use range 20 times in 9600 lines of code. out of those, all but 3 are in quick and dirty tests or experimental code, not in the main

Re: python for loop

2009-04-01 Thread andrew cooke
andrew cooke wrote: [...] so in a small/moderate size library of 600 lines (including blanks and 6000 comments, but excluding tests and exploratory code) the only time i have used range with array indices i was either unhappy with the code, or

Re: python for loop

2009-04-01 Thread Dave Angel
Natural language is full of ambiguity, which is why my parents used to argue about the meaning of next Wednesday, or of the next exit. Until you have a starting reference, and until you decide whether it's a closed or open interval, you can't be sure everyone will get the same semantics.

BeautifulSoup : why does string not give me the string?

2009-04-01 Thread Gabriel Rossetti
Hello everyone, I am using BeautifulSoup to parse some HTML and I came across something strange. Here is an illustration: soup = BeautifulSoup(u'div class=texthello ça boumebr //div') soup div class=texthello ça boumebr //div soup.find(div, text) div class=texthello ça boumebr //div

Re: BeautifulSoup : why does string not give me the string?

2009-04-01 Thread Gabriel Rossetti
Gabriel Rossetti wrote: Hello everyone, I am using BeautifulSoup to parse some HTML and I came across something strange. Here is an illustration: soup = BeautifulSoup(u'div class=texthello ça boumebr //div') soup div class=texthello ça boumebr //div soup.find(div, text) div class=texthello

Re: Thoughts on language-level configuration support?

2009-04-01 Thread jfager
On Apr 1, 3:29 am, Kay Schluehr kay.schlu...@gmx.net wrote: Discoverable, as in built-in tools that let you have the following conversation:  Program, tell me all the things I can configure about you - Okay, here they all are.  No digging through the source required. But this doesn't

Re: python for loop

2009-04-01 Thread bearophileHUGS
Lada Kugis: (you have 1 apple, you start counting from 1 ... To little children I now show how to count starting from zero: apple number zero, apple number one, etc, and they find it natural enough :-) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Beautiful soup : why does string not give me the string?

2009-04-01 Thread Gabriel Rossetti
Jeremiah Dodds wrote: On Wed, Apr 1, 2009 at 8:25 AM, Gabriel Rossetti gabriel.rosse...@arimaz.com mailto:gabriel.rosse...@arimaz.com wrote: Hello everyone, I am using beautiful soup to parse some HTML and I came across something strange. Here is an illustration: soup

Re: python for loop

2009-04-01 Thread Steven D'Aprano
On Wed, 01 Apr 2009 04:39:39 -0700, bearophileHUGS wrote: Lada Kugis: (you have 1 apple, you start counting from 1 ... To little children I now show how to count starting from zero: apple number zero, apple number one, etc, and they find it natural enough :-) Ah, but that's not the same

Re: Python Goes Mercurial

2009-04-01 Thread Paul Boddie
On 1 Apr, 08:18, Paul Rubin http://phr...@nospam.invalid wrote: Terry Reedy tjre...@udel.edu writes: So what were these strong antipathies towards Git, exactly? The relevant PEP ishttp://www.python.org/dev/peps/pep-0374/ Interesting.  I'm on a project that switched from Mercurial to Git

Re: List of paths

2009-04-01 Thread dorzey
You could use the followingm, where the_list is your list. (I'm new to python so there might be a better way): toremove = [] for x in the_list: for y in the_list: if y.startswith(x) and y != x: toremove.append(y) difference = filter(lambda x:x not

Re: python for loop

2009-04-01 Thread Tim Rowe
2009/4/1 Carl Banks pavlovevide...@gmail.com: I am also an engineer, and I can tell your idea of intuitive is not universal, even among engineers.  I certainly do not lean toward one- based indexing. Another engineer here who finds 0-based indexing more intuitive than 1-based indexing. --

Re: Python Goes Mercurial

2009-04-01 Thread Tim Daneliuk
Carl Banks wrote: On Mar 31, 6:25 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: http://arstechnica.com/open-source/news/2009/03/python-adopts-the-mer... So what were these strong antipathies towards Git, exactly? Apparently Mercurial had it's own hate club, and the

how to handle/generate pcap file

2009-04-01 Thread Evan
Hello - I'm trying to decode the pcap file which is packet capture by tcpdump or wireshark. Is there a python module that I can use it for this problem? Can python-libpcap or pycap or dpkt do that? On the other hand, I also generate some packets by dpkt module, can I also dump these packets

Need a Python Training Class recommendation

2009-04-01 Thread greg
Hi guys, My company has offered to let me attend a week or so of python training in the New England area. I have looked around but can't seem to find a sit down course. Do you have any suggestions? I live in Manchester NH but would be willing to drive into Boston area. Any experiences, ideas or

Re: python for loop

2009-04-01 Thread Lou Pecora
In article 1ej5t4930m29h0f6ttpdcd83t08q2q3...@4ax.com, Lada Kugis lada.ku...@gmail.com wrote: On 01 Apr 2009 01:26:41 GMT, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: Why Python (and other languages) count from zero instead of one, and why half-open intervals are better

Re: The spam to content ratio of this group

2009-04-01 Thread Steven D'Aprano
On Wed, 01 Apr 2009 06:43:48 -0700, Eric wrote: is getting very high. Why aren't captcha's used to prevent all of this noise? /me opens mouth to make sarcastic comment /me shuts mouth again That's like saying There's a lot of oil slicks washing up onto the beach. Why don't we put more

Regex trouble

2009-04-01 Thread akshat agarwal
Hi, I am trying to use the following snippet of code to print a regex match. s = '01234567890123456789x012' pat = r'(.*?x|[^a]+)*y' mo = re.search(pat, s) if mo is not None: print mo.group(0) By adding one character before the 'x' in the input string, the time taken to print the match

Re: complaints about no replies last week

2009-04-01 Thread pruebauno
On Mar 31, 4:07 pm, Arnaud Delobelle arno...@googlemail.com wrote: prueba...@latinmail.com writes: [...] Well since I attracted a couple people's attention I will describe the problem in more detail. Describing the problem properly is probably as hard as solving it, so excuse me if I

Default Tkinter Structure of a 640x480 PIL BMP File?

2009-04-01 Thread W. eWatson
See Subject. Does it have a header, DIB, palette, and data section? What is the default depth? -- W. eWatson (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7 N, 121° 2' 32 W, 2700 feet Web

Re: python for loop

2009-04-01 Thread Lou Pecora
In article 72i5t4tgfo2h4gd6ggcs02flkca85kg...@4ax.com, Lada Kugis lada.ku...@gmail.com wrote: and the (m-n) point Chris was trying to explain doesn't seem that relevant to me. That's because you haven't done enough programming really using the Python structures and objects. You can

Re: python for loop

2009-04-01 Thread Lada Kugis
On Wed, 1 Apr 2009 00:40:17 -0700 (PDT), Carl Banks pavlovevide...@gmail.com wrote: Lada, I am also an engineer, and I can tell your idea of intuitive is not universal, even among engineers. I certainly do not lean toward one- based indexing. From a programming standpoint--and remember Python

Re: List of paths

2009-04-01 Thread Nico Grubert
May be not so much pythonic, but works for i in range(len(q)): for x in q[i:]: if x.startswith(q[i]) and x!=q[i]: q.remove(x) ...but works fine. Thanks, Eugene. Also thanks to Andrew. Your example works fine, too. Thanks to remind me of the 'yield' statement! ;-)

Re: python for loop

2009-04-01 Thread Lada Kugis
On 01 Apr 2009 08:06:28 GMT, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: There are advantages and disadvantages to both systems, but on balance, I think that zero-based is a better system for programming, and one-based for natural language. Nicely put. Yes, along with some

comtypes CreateObject problem

2009-04-01 Thread Maria R
We get the following, less favourable respons :o( Any advice is greatly appreciated!! Setting is python 2.5.2, windows xp professional SP3, SolidEdge V20 SP10 We have success with comtypes interfacing other software like SmarTeam (PDM/PLM software) and of course Excel and alike. Thnx IDLE

Re: i have to change default tab length in pydev

2009-04-01 Thread Coonay
On Mar 31, 8:39 am, Rhodri James rho...@wildebst.demon.co.uk wrote: i understand that you get request token,and you need to get Access tokens after that, my question is about Access tokens:which mechanism  do u use to tore access tokens for future use I'm sorry, I have no idea what

Re: Beazley on Generators

2009-04-01 Thread Kay Schluehr
On 1 Apr., 07:03, Terry Reedy tjre...@udel.edu wrote: At PyCon2008, David Beazley presented an excellent talk on generators. Generator Tricks for Systems Programmershttp://www.dabeaz.com/generators/index.html At PyCon2009, he followed up with another talk on more advanced generator usage,

Re: A design problem I met again and again.

2009-04-01 Thread 一首诗
I also think that's my best choice. Before I wrote my mail, I already knew that this is not a good question. It lacks details, and it is too big. But I think the first step to resolve a problem is to describe it. In that way, I might find the answer myself On Apr 1, 6:40 pm, andrew cooke

Re: A design problem I met again and again.

2009-04-01 Thread 一首诗
On Apr 1, 4:55 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 48506803-a6b9-432b-acef- b75f76e90...@v23g2000pro.googlegroups.com, 一首诗 wrote: Until one day I find service has nearly 100 methods and 6000 lines of code.   I don't need to read any programming book

xml to xhtml

2009-04-01 Thread jud779
Hi, I have a data in xml file and i want to show this on html page and i am planning to put his on http server. I am exploring my options to show content of xml file. Consider me new with html and all i am looking to generate simple html page from xml data. Also, this xml file that i created was

Re: python for loop

2009-04-01 Thread MRAB
Lada Kugis wrote: [snip] Yes, that's it. I won't argue over it, since I can't change it, but 1 is still more natural to me (it is the real world way). The above pros seem to me to be very little compared to the cons of the ... and the (m-n) point Chris was trying to explain doesn't seem that

Re: python for loop

2009-04-01 Thread MRAB
Steven D'Aprano wrote: On Wed, 01 Apr 2009 04:58:48 +0200, Lada Kugis wrote: Why do we try to create languages that are intuitive to humans, then ? Because of the foolish hope that sufficiently easy syntax will make excellent programmers out of average people. Programming is not intuitive

Re: Stripping non-numbers from a file parse without nested lists?

2009-04-01 Thread Lorenzo
Maybe you can try a regex, something like -- import re pattern = re.compile('^(\d+)/(\d+).*') def read_data(filename): fh = open(filename, r, encoding=ascii) for line in fh: if pattern.match(line): dip_,dir_ = pattern.match(line).groups()

The spam to content ratio of this group

2009-04-01 Thread Eric
is getting very high. Why aren't captcha's used to prevent all of this noise? -- http://mail.python.org/mailman/listinfo/python-list

Re: The spam to content ratio of this group

2009-04-01 Thread Grant Edwards
On 2009-04-01, Eric ericc...@gmail.com wrote: is getting very high. Why aren't captcha's used to prevent all of this noise? 1) Captcha's don't work. 2) The NNTP protocol doesn't support Captcha's 3) Simply ignoring all posts made from Google Groups works quite well. -- Grant Edwards

Re: Regex trouble

2009-04-01 Thread andrew cooke
.*? is a not greedy match, which is significantly more difficult to handle than a normal .*. so the performance will depend on quite complex details of how the regular expression engine is implemented. it wouldn't surprise me if perl was better here, because it comes from a background with a

Re: Regex trouble

2009-04-01 Thread andrew cooke
more exactly, my guess is perl has a special case for this that avoids doing a search over all possible matchers via the pushdown stack. andrew cooke wrote: .*? is a not greedy match, which is significantly more difficult to handle than a normal .*. so the performance will depend on quite

Re: List of paths

2009-04-01 Thread andrew cooke
Nico Grubert wrote: May be not so much pythonic, but works for i in range(len(q)): for x in q[i:]: if x.startswith(q[i]) and x!=q[i]: q.remove(x) ...but works fine. Thanks, Eugene. Also thanks to Andrew. Your example works fine, too. Thanks to remind me of the

Re: Stripping non-numbers from a file parse without nested lists?

2009-04-01 Thread jay logan
On Apr 1, 2:35 am, daku9...@gmail.com wrote: On Mar 31, 6:47 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: What you're doing (pace error checking) seems fine for the data structures that you're using.  I'm not entirely clear what your usage pattern for dip and dir is once you've got

Which is more Pythonic? (was: Detecting Binary content in files)

2009-04-01 Thread John Posner
Dennis Lee Bieber presented a code snippet with two consecutive statements that made me think, I'd code this differently. So just for fun ... is Dennis's original statement or my _alt statement more idiomatically Pythonic? Are there even more Pythonic alternative codings? mrkrs = [b for b in

Re: python for loop

2009-04-01 Thread andrew cooke
MRAB wrote: Steven D'Aprano wrote: On Wed, 01 Apr 2009 04:58:48 +0200, Lada Kugis wrote: Why do we try to create languages that are intuitive to humans, then ? Because of the foolish hope that sufficiently easy syntax will make excellent programmers out of average people. Programming is

Re: Stripping non-numbers from a file parse without nested lists?

2009-04-01 Thread jay logan
On Apr 1, 11:05 am, jay logan dear.jay.lo...@gmail.com wrote: On Apr 1, 2:35 am, daku9...@gmail.com wrote: On Mar 31, 6:47 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: What you're doing (pace error checking) seems fine for the data structures that you're using.  I'm not

Re: Beazley on Generators

2009-04-01 Thread andrew cooke
Kay Schluehr wrote: There is just one thing I find disappointing. Since the talk is almost a compendium of advanced uses of generators I'm missing a reference to Peter Thatchers implementation of monads: http://www.valuedlessons.com/2008/01/monads-in-python-with-nice-syntax.html Peters

Re: xml to xhtml

2009-04-01 Thread Joe Riopel
On Wed, Apr 1, 2009 at 10:43 AM, jud...@gmail.com wrote: If anyone can give me some guidance what should be the best way to generate html/xhtml page using python would be great. I am open to other options like xsl or anything else that can make things simple. Since you're open to other

Re: The spam to content ratio of this group

2009-04-01 Thread skip
Eric is getting very high. Why aren't captcha's used to prevent all of Eric this noise? Steven /me opens mouth to make sarcastic comment Steven /me shuts mouth again Steven That's like saying There's a lot of oil slicks washing up onto Steven the beach. Why don't we put

Re: The spam to content ratio of this group

2009-04-01 Thread Tim Golden
s...@pobox.com wrote: Eric is getting very high. Why aren't captcha's used to prevent all of Eric this noise? Steven /me opens mouth to make sarcastic comment Steven /me shuts mouth again Steven That's like saying There's a lot of oil slicks washing up onto Steven the

Re: List of paths

2009-04-01 Thread Eugene Perederey
Sure, generators rock! :-) 2009/4/1 andrew cooke and...@acooke.org: Nico Grubert wrote: May be not so much pythonic, but works for i in range(len(q)):     for x in q[i:]:        if x.startswith(q[i]) and x!=q[i]:            q.remove(x) ...but works fine. Thanks, Eugene. Also thanks to

Re: A design problem I met again and again.

2009-04-01 Thread Jeremiah Dodds
On Wed, Apr 1, 2009 at 3:40 PM, 一首诗 newpt...@gmail.com wrote: What are the average size of source files in your project? If it's far lower than 15,000, don't feel it's a little unbalance? -- http://mail.python.org/mailman/listinfo/python-list While I think 15,000 is, in the vast

Matrix operations on character matrix element?

2009-04-01 Thread olusina eric
I hope somebody will be able to help me here. I am trying to solve some physical problems that will require the generation of some function in terms of some parameters. These functions are derived from matrix operation on “characters”. Are there ways numpy/scipy perform matrix operations on

Re: Which is more Pythonic? (was: Detecting Binary content in files)

2009-04-01 Thread bieffe62
On Apr 1, 5:10 pm, John Posner jjpos...@snet.net wrote: Dennis Lee Bieber presented a code snippet with two consecutive statements that made me think, I'd code this differently. So just for fun ... is Dennis's original statement or my _alt statement more idiomatically Pythonic? Are there even

Re: Beazley on Generators

2009-04-01 Thread Peter Pearson
On Wed, 01 Apr 2009 01:03:50 -0400, Terry Reedy tjre...@udel.edu wrote: At PyCon2008, David Beazley presented an excellent talk on generators. Generator Tricks for Systems Programmers http://www.dabeaz.com/generators/index.html At PyCon2009, he followed up with another talk on more advanced

Creating a Python Module - Available Implementations

2009-04-01 Thread ntwrkd
I have been browsing through creating a Python module for common custom functions that I frequently use, but I am wondering, is this the best method, and is it necessary? Really all I need is to import functions from another plaintext Python source file, how might I do this? What would merit the

Re: python for loop

2009-04-01 Thread Carl Banks
On Apr 1, 7:08 am, Lada Kugis lada.ku...@gmail.com wrote: On Wed, 1 Apr 2009 00:40:17 -0700 (PDT), Carl Banks pavlovevide...@gmail.com wrote: Lada, I am also an engineer, and I can tell your idea of intuitive is not universal, even among engineers.  I certainly do not lean toward one-

Re: python for loop

2009-04-01 Thread MRAB
andrew cooke wrote: MRAB wrote: Steven D'Aprano wrote: On Wed, 01 Apr 2009 04:58:48 +0200, Lada Kugis wrote: Why do we try to create languages that are intuitive to humans, then ? Because of the foolish hope that sufficiently easy syntax will make excellent programmers out of average

double/float precision question

2009-04-01 Thread TP
Hi everybody, Try the following python statements: %.40f % 0.222 '0.098864108374982606619596' float( 0.222) 0.1 It seems the first result is the same than the following C program: #include

Re: The spam to content ratio of this group

2009-04-01 Thread r
On Apr 1, 9:57 am, Grant Edwards inva...@invalid wrote: On 2009-04-01, Eric ericc...@gmail.com wrote: 3) Simply ignoring all posts made from Google Groups works    quite well. sarcasm Yea, there's no spam in Usenet land /sarcasm APRIL FOOLS --

league problem in python

2009-04-01 Thread Ross
I'm new to programming and have chosen Python as my first language. I've gone through Allen Downey's Think Python book and I think I'm ready to dive into a project. The first problem I've chosen to tackle is a problem I have seen at my tennis club. Each spring/fall, the pro puts out a sheet of

RE: Which is more Pythonic? (was: Detecting Binary content in files)

2009-04-01 Thread John Posner
   mrkrs_alt2 = filter(lambda b: b 127 or b in list(\r\n\t), block) Never tested my 'pythonicity', but I would do: def test(b) : b 127 or b in r\r\n\t Oops! Clearly, b in \r\n\t is preferable to ... b in list(\r\n\t) You do *not* want to use a raw string here:

Re: Thoughts on language-level configuration support?

2009-04-01 Thread Aaron Brady
On Apr 1, 6:29 am, jfager jfa...@gmail.com wrote: On Apr 1, 3:29 am, Kay Schluehr kay.schlu...@gmx.net wrote: Discoverable, as in built-in tools that let you have the following conversation:  Program, tell me all the things I can configure about you - Okay, here they all are.  No

Re: python for loop

2009-04-01 Thread Mensanator
On Apr 1, 9:08 am, Lada Kugis lada.ku...@gmail.com wrote: On Wed, 1 Apr 2009 00:40:17 -0700 (PDT), Carl Banks pavlovevide...@gmail.com wrote: Lada, I am also an engineer, and I can tell your idea of intuitive is not universal, even among engineers.  I certainly do not lean toward one-

Re: double/float precision question

2009-04-01 Thread Mensanator
On Apr 1, 12:13 pm, TP tribulati...@paralleles.invalid wrote: Hi everybody, Try the following python statements: %.40f % 0.222 '0.098864108374982606619596' float( 0.222) 0.1 It seems the first

Re: league problem in python

2009-04-01 Thread bearophileHUGS
Ross: How should I go about starting this problem...I'm feel like this is a really simple problem, but I'm having writer's/coder's block. Can you guys help? There are refined ways to design a program, but this sounds like a simple and small one, so you probably don't need much formal things to

Re: python for loop

2009-04-01 Thread Lou Pecora
In article 91t6t4hfjicgvdrcgkhdjfro3ko3ktu...@4ax.com, Lada Kugis lada.ku...@gmail.com wrote: On Wed, 1 Apr 2009 00:40:17 -0700 (PDT), Carl Banks pavlovevide...@gmail.com wrote: Lada, I am also an engineer, and I can tell your idea of intuitive is not universal, even among engineers.

Re: Creating a Python Module - Available Implementations

2009-04-01 Thread Dave Angel
A python source file *is* a module. And you import it the same way you import any of the system modules. Just use the basename, without the .py extension. import mylib The only catch is where you locate this module. When you first write it, just put it in the same directory as your

Re: A design problem I met again and again.

2009-04-01 Thread Nick Craig-Wood
一首诗 newpt...@gmail.com wrote: But I think the first step to resolve a problem is to describe it. In that way, I might find the answer myself :-) That is a great saying! To answer your original question, split your code up into sections that can be tested independently. If you can test code

Re: List of paths

2009-04-01 Thread Paul McGuire
On Apr 1, 3:57 am, Nico Grubert nicogrub...@gmail.com wrote: Dear Python developers I have the following (sorted) list. ['/notebook',   '/notebook/mac',   '/notebook/mac/macbook',   '/notebook/mac/macbookpro',   '/notebook/pc',   '/notebook/pc/lenovo',   '/notebook/pc/hp',  

Re: double/float precision question

2009-04-01 Thread Dave Angel
It's not at all clear what you really want. You say you want to use the %e format, but then imply you're then going to turn it back into a float. Since I don't know what the end goal is, I'll just comment generally. All Python floating point is equivalent to the 'double' type of the C

[Ann] New super python vm

2009-04-01 Thread El Loco
Hi all, This is to announce that right after a few weeks after our first coding sprint, our project, Unswallowed-snot, has already achieved substantial results. In our tests, runtime performance shows a 150x slowdown. This is due mainly to our lead developer (myself) still not knowing enough

Re: New super python vm

2009-04-01 Thread r
On Apr 1, 1:55 pm, El Loco locoy...@gmail.com wrote: Hi all, This is to announce that right after a few weeks after our first coding sprint, our project, Unswallowed-snot, has already achieved substantial results. In our tests, runtime performance shows a 150x slowdown. This is due mainly

Re: league problem in python

2009-04-01 Thread r
On Apr 1, 12:35 pm, Ross ross.j...@gmail.com wrote: [snip] How should I go about starting this problem...I'm feel like this is a really simple problem, but I'm having writer's/coder's block. Can you guys help? Ross, I highly disagree with bear on this. What you have here is a 90 percent math

Re: A design problem I met again and again.

2009-04-01 Thread Martin P. Hellwig
一首诗 wrote: cut But I think the first step to resolve a problem is to describe it. In that way, I might find the answer myself cut That is an excellent approach, knowing you have a problem and describing it is actually the hardest part of a design, the rest is more like a puzzle. What I

imp.load_source() - explanation needed

2009-04-01 Thread mynthon
Hi! I need help. I don't understand what doc says. I load module from path testmod/mytest.py using imp.load_source(). My code is import imp testmod = imp.load_source('koko', 'testmod/mytest.py) print testmod but i don't understand whatt is first (name) argument for. Docs says that The name

Converting a PIL image object to a buffer

2009-04-01 Thread Simon Hibbs
I'm trying to dump a snapshot of my application window to the clipboard. I can use ImageGrab in PIL to get the screen data into a PIL image object, which i have converted to a bitmap using ImageWin, but when I try to pass this to the clipboard using -

  1   2   3   4   >