Re: unexpected from/import statement behaviour

2008-08-27 Thread nisp
On Aug 27, 3:35 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > nisp wrote: > > Thanks first of all ! I read the interesting Diez's link but something > > still remains to me unclear, on the other hand it's clear the my > > problem is concentrated there and on symbols. > > Read it again. If you have t

Re: Wild Card String Comparison

2008-08-27 Thread Timothy Grant
On Wed, Aug 27, 2008 at 10:00 PM, W. eWatson <[EMAIL PROTECTED]> wrote: > Timothy Grant wrote: >> >> On Wed, Aug 27, 2008 at 8:49 PM, W. eWatson <[EMAIL PROTECTED]> >> wrote: >>> >>> Is it possible to do a search for a wild card string in another string. >>> For >>> example, I'd like to find "v*.da

Re: List of modules available for import inside Python?

2008-08-27 Thread Michele Simionato
On Aug 28, 6:21 am, ssecorp <[EMAIL PROTECTED]> wrote: > Is there a way to view all the modules I have available for import > from within Python? > Like writing in the interpreter: Try: >>> help() help> modules Please wait a moment while I gather a list of all available modules... -- http://mail

Python sockets UDP broadcast multicast question??

2008-08-27 Thread inorlando
Hi all, I have a question about python and sockets , UDP datagram in particular. I'm new to socket programming so please bare with me. I am trying to write a simple application that broadcast files to another computer on the same network/subnet but I do not want the receiver computer to have to r

Re: List of modules available for import inside Python?

2008-08-27 Thread Fredrik Lundh
ssecorp wrote: Is there a way to view all the modules I have available for import from within Python? Like writing in the interpreter: import.modules there's a helper script in the 2.5 source code kit that locates all existing standard modules: http://svn.python.org/projects/python/tags/r25

Re: calling NetShareEnum win32api with ctypes

2008-08-27 Thread castironpi
On Aug 28, 12:01 am, taghi <[EMAIL PROTECTED]> wrote: > I want to call NetShareEnum, a function from netapi32.dll > NetShareEnum has this definition: > > NET_API_STATUS NetShareEnum( >   __in     LPWSTR servername, >   __in     DWORD level, >   __out    LPBYTE *bufptr, >   __in     DWORD prefmaxlen

Re: no string.downer() ?

2008-08-27 Thread Fredrik Lundh
Asun Friere wrote: Never ascribe to humour that which can be adequately explained by increadible stupidity! On the other hand given up/down vs. high/low, upper/downer might appear logical to someone who doesn't know that "downcase" is called 'lowercase.' prior exposure to Ruby might explain t

Re: Python on Mac

2008-08-27 Thread Rajanikanth Jammalamadaka
e-mail, gratis per te: http://www.email.it/f > > Sponsor: > Libera la tua voglia di giocare. Scarica Videogames sul cellulare! > Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7753&d=20080827 > > > -- > http://mail.python.org/mailman/listinfo/python-list >

Process "Killed"

2008-08-27 Thread dieter
Hi, Overview === I'm doing some simple file manipulation work and the process gets "Killed" everytime I run it. No traceback, no segfault... just the word "Killed" in the bash shell and the process ends. The first few batch runs would only succeed with one or two files being processed (out of

Re: [Q] How to ignore the first line of the text read from a file

2008-08-27 Thread Marc 'BlackJack' Rintsch
On Wed, 27 Aug 2008 21:11:26 -0700, [EMAIL PROTECTED] wrote: > I want to read text line-by-line from a text file, but want to ignore > only the first line. I know how to do it in Java (Java has been my > primary language for the last couple of years) and following is what I > have in Python, but I

Re: Wild Card String Comparison

2008-08-27 Thread W. eWatson
Sean DiZazzo wrote: On Aug 27, 8:49 pm, "W. eWatson" <[EMAIL PROTECTED]> wrote: Is it possible to do a search for a wild card string in another string. For example, I'd like to find "v*.dat" in a string called bingo. v must be matched against only the first character in bingo, and not simply fou

Re: Wild Card String Comparison

2008-08-27 Thread W. eWatson
Timothy Grant wrote: On Wed, Aug 27, 2008 at 8:49 PM, W. eWatson <[EMAIL PROTECTED]> wrote: Is it possible to do a search for a wild card string in another string. For example, I'd like to find "v*.dat" in a string called bingo. v must be matched against only the first character in bingo, and no

calling NetShareEnum win32api with ctypes

2008-08-27 Thread taghi
I want to call NetShareEnum, a function from netapi32.dll NetShareEnum has this definition: NET_API_STATUS NetShareEnum( __in LPWSTR servername, __in DWORD level, __outLPBYTE *bufptr, __in DWORD prefmaxlen, __outLPDWORD entriesread, __outLPDWORD totalentries,

calling NetShareEnum win32api with ctypes

2008-08-27 Thread taghi
I want to call NetShareEnum, a function from netapi32.dll NetShareEnum has this definition: NET_API_STATUS NetShareEnum( __in LPWSTR servername, __in DWORD level, __outLPBYTE *bufptr, __in DWORD prefmaxlen, __outLPDWORD entriesread, __outLPDWORD totalentries,

Re: List of modules available for import inside Python?

2008-08-27 Thread James Mills
On Thu, Aug 28, 2008 at 2:21 PM, ssecorp <[EMAIL PROTECTED]> wrote: > Also, is there anything like Cpan for Python? Try the Python Cheese Shop / PyPi http://pypi.python.org/pypi cheers James -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: List of modules available for import inside Python?

2008-08-27 Thread Chris Rebert
On Wed, Aug 27, 2008 at 9:21 PM, ssecorp <[EMAIL PROTECTED]> wrote: > Is there a way to view all the modules I have available for import > from within Python? > Like writing in the interpreter: > import.modules > > > Also, is there anything like Cpan for Python? The closest thing would be PyPI (th

paging mark hahn

2008-08-27 Thread Alex
hey mark, wondering if you've still got a net presence out there. ive been playing around with the old C prothon code base and wanted to chat with you about things. shoot me an email if you are still out there. --Alex -- http://mail.python.org/mailman/listinfo/python-list

Python on Mac

2008-08-27 Thread luca . ciciriello
iocare. Scarica Videogames sul cellulare! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7753&d=20080827 -- http://mail.python.org/mailman/listinfo/python-list

python on Mac

2008-08-27 Thread luca . ciciriello
uoi sogni! Fido fino a 3.000 eruo, rate a partire da 20 euro e canone gratis il 1° anno. Scoprila! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7876&d=20080827 -- http://mail.python.org/mailman/listinfo/python-list

Re: Date type in win32com?

2008-08-27 Thread Gabriel Genellina
En Tue, 26 Aug 2008 08:53:40 -0300, Haeyoung Kim <[EMAIL PROTECTED]> escribi�: I'm migrating a VBScript into python. How should I convert Date type parameter in VBScript's COM interface with win32com? Look for PyTime in the pywin32 documentation. -- Gabriel Genellina -- http://mail.pytho

Re: GUI programming with python

2008-08-27 Thread mobiledreamers
http://delicious.com/url/4adfb8d4a16eb4e2a9884298e0af1784 people are starting to save :) -- http://mail.python.org/mailman/listinfo/python-list

Re: [Q] How to ignore the first line of the text read from a file

2008-08-27 Thread Benjamin Kaplan
On Thu, Aug 28, 2008 at 12:11 AM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > Hello, > > I am new to Python and have one simple question to which I cannot find > a satisfactory solution. > I want to read text line-by-line from a text file, but want to ignore > only the first line. I know how t

List of modules available for import inside Python?

2008-08-27 Thread ssecorp
Is there a way to view all the modules I have available for import from within Python? Like writing in the interpreter: import.modules Also, is there anything like Cpan for Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python multimap

2008-08-27 Thread Carl Banks
On Aug 27, 1:52 pm, brad <[EMAIL PROTECTED]> wrote: > Mike Kent wrote: > > Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) > > [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > k = {} > k['1'] = [] > k['1'].app

[Q] How to ignore the first line of the text read from a file

2008-08-27 Thread [EMAIL PROTECTED]
Hello, I am new to Python and have one simple question to which I cannot find a satisfactory solution. I want to read text line-by-line from a text file, but want to ignore only the first line. I know how to do it in Java (Java has been my primary language for the last couple of years) and followi

Re: Wild Card String Comparison

2008-08-27 Thread Timothy Grant
On Wed, Aug 27, 2008 at 8:49 PM, W. eWatson <[EMAIL PROTECTED]> wrote: > Is it possible to do a search for a wild card string in another string. For > example, I'd like to find "v*.dat" in a string called bingo. v must be > matched against only the first character in bingo, and not simply found > s

Re: Wild Card String Comparison

2008-08-27 Thread Sean DiZazzo
On Aug 27, 8:49 pm, "W. eWatson" <[EMAIL PROTECTED]> wrote: > Is it possible to do a search for a wild card string in another string. For > example, I'd like to find "v*.dat" in a string called bingo. v must be > matched against only the first character in bingo, and not simply found > somewhere in

Wild Card String Comparison

2008-08-27 Thread W. eWatson
Is it possible to do a search for a wild card string in another string. For example, I'd like to find "v*.dat" in a string called bingo. v must be matched against only the first character in bingo, and not simply found somewhere in bingo, as might be the case for "*v*.dat". -- Wayne

Gucci 110 G-Link Watches: Quality Gucci Discount Watches

2008-08-27 Thread blog335
Gucci 110 G-Link Watches: Quality Gucci Discount Watches Quality Gucci 110 G-Link Watches http://gucci-watches.pxhelp.com/gucci-110-g-link.html Thank you for choosing http://www.pxhelp.com/ Discount Gucci Watches http://gucci-watches.pxhelp.com/ We guarantee our Gucci 110 G-Link Watches and Gu

Re: Python AST preserving whitespace and comments

2008-08-27 Thread Terry Reedy
Michal Kwiatkowski wrote: Hi, I'm working on Pythoscope[1], a unit test generator for Python and stumbled into the following problem. I need a way to analyze and modify Python AST tree, but without loosing source code formatting and comments. Standard library ast module discards those, so I st

Re: no string.downer() ?

2008-08-27 Thread Asun Friere
On Aug 28, 11:34 am, John Machin <[EMAIL PROTECTED]> wrote: > On Aug 28, 11:25 am, Asun Friere <[EMAIL PROTECTED]> wrote: > > > On Aug 28, 10:28 am, John Machin <[EMAIL PROTECTED]> wrote: > > > > Out of the possible diagnoses (trolling, incredible stupidity, feeble > > > joke attempt) of the cause

Re: no string.downer() ?

2008-08-27 Thread Terry Reedy
Grant Edwards wrote: Not only does one need to be familiar with English, but one also has to be familiar with somewhat obscure terms dervied from ancient typsetting practices. In other contexts, downer is definitely the obvious converse of upper. Nonsense. Down is the opposite of up, but low

Re: use of Queue

2008-08-27 Thread Raymond Hettinger
On Aug 27, 4:55 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > Or make the consumers daemon threads so that when the producers are finished > > an all non-daemon threads exit, the consumers do as well. > > How are the consumers supposed to know when the producers a

Re: Global var access in imported modules?

2008-08-27 Thread RgeeK
Dennis Lee Bieber wrote: On Wed, 27 Aug 2008 16:21:03 -0400, RgeeK <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: I have a main module doStuff.py and another module utility.py. At the start of doStuff.py I call import utility.py I hope not... import utility

Re: Global var access in imported modules?

2008-08-27 Thread RgeeK
Fredrik Lundh wrote: >>import utility.py > that tries to import a module named "py" from the package "utility". oops - that was just a typo in my post - I meant of course "import utility" > > Python doesn't have "program-wide global" variables; if you need that, > create a support module and

Re: Global var access in imported modules?

2008-08-27 Thread Rgg
Fredrik Lundh wrote: import utility.py that tries to import a module named "py" from the package "utility". oops - that was just a typo in my post - I meant of course "import utility" Python doesn't have "program-wide global" variables; if you need that, create a support module and impor

Re: no string.downer() ?

2008-08-27 Thread Grant Edwards
On 2008-08-28, Timothy Grant <[EMAIL PROTECTED]> wrote: > I was going to go with not particularly strong in English. To > someone not familiar with English, downer() could very well be > the obvious converse of upper(). Not only does one need to be familiar with English, but one also has to be fa

Re: Multiple values for one key

2008-08-27 Thread norseman
Terry Reedy wrote: Ron Brennan wrote: Hello, How would I create a dictionary that contains multiple values for one key. Make the value a collection object (set or list if you plan to add and delete). I'd also like the key to be able to have duplicate entries. Dict keys must be ha

Re: no string.downer() ?

2008-08-27 Thread John Machin
On Aug 28, 11:25 am, Asun Friere <[EMAIL PROTECTED]> wrote: > On Aug 28, 10:28 am, John Machin <[EMAIL PROTECTED]> wrote: > > > Out of the possible diagnoses (trolling, incredible stupidity, feeble > > joke attempt) of the cause of the ensuing upper/downer question, I'm > > going with the third. >

Re: no string.downer() ?

2008-08-27 Thread Asun Friere
On Aug 28, 10:28 am, John Machin <[EMAIL PROTECTED]> wrote: > Out of the possible diagnoses (trolling, incredible stupidity, feeble > joke attempt) of the cause of the ensuing upper/downer question, I'm > going with the third. Never ascribe to humour that which can be adequately explained by incr

Fwd: no string.downer() ?

2008-08-27 Thread Vistro
-- Forwarded message -- From: Vistro <[EMAIL PROTECTED]> Date: Wed, Aug 27, 2008 at 7:43 PM Subject: Re: no string.downer() ? (Hopefully this one makes its way to the list...) I usually use this If take the string that needs to be converted to lowercase, (should have a variable,

Re: no string.downer() ?

2008-08-27 Thread Timothy Grant
On Wed, Aug 27, 2008 at 5:28 PM, John Machin <[EMAIL PROTECTED]> wrote: > On Aug 28, 9:53 am, Terry Reedy <[EMAIL PROTECTED]> wrote: >> ssecorp wrote: >> > if i want to make a string downcase, is upper().swapcase() the onyl >> > choice? there is no downer() ? >> >> If you are not being a troll, the

Re: Tkinter popup menu

2008-08-27 Thread Carl
"Chuckk Hubbard" <[EMAIL PROTECTED]> writes: > Right-click popup menu. None of the options that come from the > cascades can be selected with the mouse. If you select a submenu with > the mouse and then use the arrow keys and enter key to select an > option, it works, but the menu remains on the

Re: finding out the number of rows in a CSV file [Resolved]

2008-08-27 Thread John Machin
On Aug 28, 7:51 am, norseman <[EMAIL PROTECTED]> wrote: > Peter Otten wrote: > > John S wrote: > > >> [OP] Jon Clements wrote: > >>> On Aug 27, 12:54 pm, SimonPalmer <[EMAIL PROTECTED]> wrote: > after reading the file throughthe csv.reader for the length I cannot > iterate over the rows.

Re: Multiple values for one key

2008-08-27 Thread Maric Michaud
Le Thursday 28 August 2008 01:56:54 Terry Reedy, vous avez écrit : > >  I'd also like the key to be able to have duplicate entries. > > Dict keys must be hashable and unique. Let's admit they don't have to be unique (it's easy to implement all sort of data structures in pure python), but what wou

Re: no string.downer() ?

2008-08-27 Thread John Machin
On Aug 28, 9:53 am, Terry Reedy <[EMAIL PROTECTED]> wrote: > ssecorp wrote: > > if i want to make a string downcase, is upper().swapcase() the onyl > > choice? there is no downer() ? > > If you are not being a troll, there are two easy ways to answer such a > question. > [snip] Reading the manual

Python AST preserving whitespace and comments

2008-08-27 Thread Michal Kwiatkowski
Hi, I'm working on Pythoscope[1], a unit test generator for Python and stumbled into the following problem. I need a way to analyze and modify Python AST tree, but without loosing source code formatting and comments. Standard library ast module discards those, so I started looking for other soluti

Pythoncom and pywintypes

2008-08-27 Thread Vistro
Hey, there. I've been coding in python for about three weeks now. I have made basic games, tools to check forum PMs for me, and other general utilities with python, but I'm now encountering problems. http://ubuntuforums.org/archive/index.php/t-511211.html I want to do that, and I have installed b

Re: Multiple values for one key

2008-08-27 Thread Terry Reedy
Ron Brennan wrote: Hello, How would I create a dictionary that contains multiple values for one key. Make the value a collection object (set or list if you plan to add and delete). I'd also like the key to be able to have duplicate entries. Dict keys must be hashable and unique.

How come Python software, tools and libraries is so good? A hug to Gvr and the Python community!

2008-08-27 Thread cnb
I have been testing different tools for cvs, math etc and I am constantly amazed how many great tools and libraries there are for Python. SAGE, Mercurial as 2 outstanding tools and there a re excellent libraries fro anything you want, natural language processing, any kind of parsing, math, simulati

Tkinter popup menu

2008-08-27 Thread Chuckk Hubbard
Right-click popup menu. None of the options that come from the cascades can be selected with the mouse. If you select a submenu with the mouse and then use the arrow keys and enter key to select an option, it works, but the menu remains on the canvas. If you click the option with the mouse, the

Re: no string.downer() ?

2008-08-27 Thread Terry Reedy
ssecorp wrote: if i want to make a string downcase, is upper().swapcase() the onyl choice? there is no downer() ? If you are not being a troll, there are two easy ways to answer such a question. >>> dir('') ['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__fo

Re: Identifying the start of good data in a list

2008-08-27 Thread castironpi
On Aug 27, 6:14 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Aug 27, 5:48 pm, castironpi <[EMAIL PROTECTED]> wrote: > > > > > On Aug 27, 4:34 pm, [EMAIL PROTECTED] wrote: > > > > George Sakkis: > > > > > This seems the most efficient so far for arbitrary iterables. > > > > This one probably sc

Re: unexpected from/import statement behaviour

2008-08-27 Thread alex23
On Aug 27, 5:42 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > alex23 schrieb: > > > > > nisp <[EMAIL PROTECTED]> wrote: > >> I've always been convinced of the equivalence of the two ways of using > >> the import statement but it's clear I'm wrong :-( > > > Python 2.5.2 (r252:60911, Jul 31 200

Re: Setting my Locale

2008-08-27 Thread Derek Martin
On Wed, Aug 27, 2008 at 01:25:49AM -0300, Gabriel Genellina wrote: > En Tue, 26 Aug 2008 07:52:21 -0300, Robert Rawlins > >How can I get a list of available locales? > > I'd like to know how to retrieve that too... On a Linux system (and likely most modern Unix systems): locale -a -- Derek D

Re: Identifying the start of good data in a list

2008-08-27 Thread George Sakkis
On Aug 27, 5:48 pm, castironpi <[EMAIL PROTECTED]> wrote: > On Aug 27, 4:34 pm, [EMAIL PROTECTED] wrote: > > > > > George Sakkis: > > > > This seems the most efficient so far for arbitrary iterables. > > > This one probably scores well with Psyco ;-) > > > def start_good3(seq, good_ones=4): > >

Re: Identifying the start of good data in a list

2008-08-27 Thread George Sakkis
On Aug 27, 5:34 pm, [EMAIL PROTECTED] wrote: > George Sakkis: > > > This seems the most efficient so far for arbitrary iterables. > > This one probably scores well with Psyco ;-) I think if you update this so that it returns the "good" iterable instead of the starting index, it is equivalent to Ge

doctesting practices

2008-08-27 Thread Alia Khouri
I was wondering the other day how other pythonistas incorporate doctests into their coding practices. I have acquired the habit of keeping an editor open in one window and an ipython instance open in another and then using something similar to the format of the module below. In this case, I incorpo

Re: finding out the number of rows in a CSV file [Resolved]

2008-08-27 Thread norseman
Peter Otten wrote: John S wrote: [OP] Jon Clements wrote: On Aug 27, 12:54 pm, SimonPalmer <[EMAIL PROTECTED]> wrote: after reading the file throughthe csv.reader for the length I cannot iterate over the rows. How do I reset the row iterator? A CSV file is just a text file. Don't use csv.re

Re: Identifying the start of good data in a list

2008-08-27 Thread castironpi
On Aug 27, 4:34 pm, [EMAIL PROTECTED] wrote: > George Sakkis: > > > This seems the most efficient so far for arbitrary iterables. > > This one probably scores well with Psyco ;-) > > def start_good3(seq, good_ones=4): >     n_good = 0 >     pos = 0 >     for el in seq: >         if el: >          

Re: Identifying the start of good data in a list

2008-08-27 Thread bearophileHUGS
George Sakkis: > This seems the most efficient so far for arbitrary iterables. This one probably scores well with Psyco ;-) def start_good3(seq, good_ones=4): """ >>> start_good = start_good3 >>> start_good([0, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) 4 >>> start_good([]) -1

Re: How can this script fail?

2008-08-27 Thread M.-A. Lemburg
On 2008-08-27 13:15, [EMAIL PROTECTED] wrote: > On Aug 27, 1:08 pm, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: > >> I don't think this is related to IDLE or your setup. The odbc >> module is very old and unmaintained, so it's possible that Windows >> doesn't find some system DLLs needed for it to

Re: Global var access in imported modules?

2008-08-27 Thread Fredrik Lundh
RgeeK wrote: I have a main module doStuff.py and another module utility.py. At the start of doStuff.py I call import utility.py that tries to import a module named "py" from the package "utility". Then I also proceed to initiallize some global variables sName = "" Within my utility.

Re: Identifying the start of good data in a list

2008-08-27 Thread George Sakkis
On Aug 27, 3:00 pm, Gerard flanagan <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I have a list that starts with zeros, has sporadic data, and then has > > good data. I define the point at which the data turns good to be the > > first index with a non-zero entry that is followed by at

Re: Multiple values for one key

2008-08-27 Thread Fredrik Lundh
Ron Brennan wrote: How would I create a dictionary that contains multiple values for one key. I'd also like the key to be able to have duplicate entries. look for the thread titled "python multimap". -- http://mail.python.org/mailman/listinfo/python-list

Re: Books about Python.

2008-08-27 Thread Joseph W. Losco
I did also. On Aug 27, 2008, at 4:19 PM, James Matthews wrote: I really liked Core python programming 2nd edition -- http://mail.python.org/mailman/listinfo/python-list

Re: Identifying the start of good data in a list

2008-08-27 Thread George Sakkis
On Aug 26, 10:39 pm, [EMAIL PROTECTED] wrote: > On Aug 26, 7:23 pm, Emile van Sebille <[EMAIL PROTECTED]> wrote: > > > > > [EMAIL PROTECTED] wrote: > > > I have a list that starts with zeros, has sporadic data, and then has > > > good data. I define the point at which the data turns good to be the

Multiple values for one key

2008-08-27 Thread Ron Brennan
Hello, How would I create a dictionary that contains multiple values for one key. I'd also like the key to be able to have duplicate entries. Thanks, Ron -- FYI, my email address is changing. My rogers account will be deactivated shortly. From now on please use: [EMAIL PROTECTED] -- http://ma

Global var access in imported modules?

2008-08-27 Thread RgeeK
I have a main module doStuff.py and another module utility.py. At the start of doStuff.py I call import utility.py Then I also proceed to initiallize some global variables sName = "" Then I create a class, some methods etc. In one of the methods I assign a value to my variable sName. Th

[SOLVED] How can this script fail?

2008-08-27 Thread Robert Latest
Dennis Lee Bieber wrote: >> On 2008-08-27 12:37, [EMAIL PROTECTED] wrote: >> > Got file in dir >> > Found in path: >> > >> > >> >> This looks strange... the same module in two dirs that only >> differ by case ? >> > Even stranger when you take into account that under Windows, path > name

Re: Books about Python.

2008-08-27 Thread James Matthews
I really liked Core python programming 2nd edition On Wed, Aug 27, 2008 at 9:49 AM, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] a écrit : >> >> I'm up to write a 20-30 research paper for my computer science course, >> and I was considering choosing to do mine on Python. I w

Re: use of Queue

2008-08-27 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Or make the consumers daemon threads so that when the producers are finished > an all non-daemon threads exit, the consumers do as well. How are the consumers supposed to know when the producers are finished? Yes, there are different approaches like sentinels, but the

Re: Python multimap

2008-08-27 Thread castironpi
On Aug 27, 1:38 pm, brad <[EMAIL PROTECTED]> wrote: > castironpi wrote: > > I don't understand what a multimap does that a map of lists doesn't do. > > It counts both keys individually as separate keys. The Python workaround > does not... see examples... notice the key(s) that are '4' > > Python ou

Re: email parsing

2008-08-27 Thread Alan Franzoni
ra9ftm was kind enough to say: > It is my first script on python. Don't know is it correctly uses > modules, but it is working fine with specially with russian code pages > and mime formated messages. Also quoted-printable and base64 > encoded Some hints: 1) don't write "x", use "

Re: Tkinter event loop question

2008-08-27 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >gordon wrote: > >> is it possible to send a message to the gui instance while the Tk >> event loop is running?I mean after i create a gui object like . .

Re: How to update value in dictionary?

2008-08-27 Thread Fredrik Lundh
mblume wrote: 2) setdefault is your friend d = {} d['a'] = d.setdefault('a', 1) + 1 d['a'] = d.get('a', 1) + 1 seems to me a little better, as d['a'] doesn't get set twice, right? setdefault is pronounced "get, and set if necessary". it only updates the dictionary if the key isn't alread

Re: Identifying the start of good data in a list

2008-08-27 Thread Gerard flanagan
[EMAIL PROTECTED] wrote: I have a list that starts with zeros, has sporadic data, and then has good data. I define the point at which the data turns good to be the first index with a non-zero entry that is followed by at least 4 consecutive non-zero data items (i.e. a week's worth of non-zero da

Re: exception handling in complex Python programs

2008-08-27 Thread Bruno Desthuilliers
Lie a écrit : On Aug 21, 12:59 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: On Wed, 20 Aug 2008 09:23:22 -0700, [EMAIL PROTECTED] wrote: On Aug 19, 4:12 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: On Tue, 19 Aug 2008 11:07:39 -0700, [EMAIL PROTECTED]

Re: Books about Python.

2008-08-27 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : I'm up to write a 20-30 research paper for my computer science course, and I was considering choosing to do mine on Python. I was curious if anybody knows of any good books about python they could recommend that have more of a technical view rather than a Teach-yourse

Re: How to update value in dictionary?

2008-08-27 Thread mblume
Am Wed, 27 Aug 2008 15:45:13 +0200 schrieb Diez B. Roggisch: > >> dict.update({"a":1}) SETS the dict item "a" 's value to 1. >> >> i want to increase it by 1. isnt that possible in an easy way? >> I should use a tuple for this? > > > 1) Don't use dict as name for a dictionary, it shadows the t

Re: Python multimap

2008-08-27 Thread Fredrik Lundh
Miles wrote: That's what a multimap is. iirc, a C++ multimap provides a flat view of the data, so you need to provide custom enumeration and iteration methods as well. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python multimap

2008-08-27 Thread brad
castironpi wrote: I don't understand what a multimap does that a map of lists doesn't do. It counts both keys individually as separate keys. The Python workaround does not... see examples... notice the key(s) that are '4' Python output (using the k = [] idea): Key: 4 Value: [[13, 'Visa'],

Re: how do I stop SocketServer()?

2008-08-27 Thread Uberman
On Wed, 27 Aug 2008 18:44:46 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >Alexandru Mosoi wrote: > >> supposing that I have a server (an instance of SocketServer()) that >> waits for a connection (ie is blocked in accept()) and in another >> thread i want to stop the server, how do I do

Re: Python multimap

2008-08-27 Thread castironpi
On Aug 27, 12:52 pm, brad <[EMAIL PROTECTED]> wrote: > Mike Kent wrote: > > Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) > > [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > k = {} > k['1'] = [] > k['1'].ap

Re: Custom PyQt4 TableWidget

2008-08-27 Thread ff
On Aug 27, 6:44 pm, Phil Thompson <[EMAIL PROTECTED]> wrote: > On Wed, 27 Aug 2008 09:51:29 -0700 (PDT), ff <[EMAIL PROTECTED]> > wrote: > > > > >> setSelectionMode()? > > >> Phil > > > Ive tried that, it does half the job, it stops you selecting more than > > one item in the table at any one time

Re: How can this script fail?

2008-08-27 Thread kdwyer
On 27 Aug, 12:15, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Aug 27, 1:08 pm, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: > > > I don't think this is related to IDLE or your setup. The odbc > > module is very old and unmaintained, so it's possible that Windows > > doesn't find some system D

Re: Split function for host:port in standard lib

2008-08-27 Thread Hartmut Goebel
Michael Ströder schrieb: Examples IPv6 addresses: '::1:389' -> ('::1',389) '::1' -> ('::1',None) These are wrong, see http://tools.ietf.org/html/rfc2732 ("Format for Literal IPv6 Addresses in URL's§). Correct formats are: [::1]:389 [::1] -- http://mail.python.org/mailman/listinfo/python-lis

Re: Python multimap

2008-08-27 Thread Miles
brad wrote: > There is only one '1' key in your example. I need multiple keys that are all > '1'. I thought Python would have something built-in to handle this sort of > thing. > > I need a true multimap ... without making K's value a list of stuff > to append to. That's what a multimap is. If yo

Re: Need help with extension modules built in debug mode

2008-08-27 Thread Uberman
On Wed, 27 Aug 2008 00:31:37 -0300, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >In debug mode, python looks for hello_d.pyd - NOT hello.pyd. >Note that neither hello.dll nor hello_d.dll are recognized anymore since >version 2.5 Excellent! Thank you, Gabriel. Just what I was missing. -- ht

Re: Python multimap

2008-08-27 Thread brad
Mike Kent wrote: Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. k = {} k['1'] = [] k['1'].append('Tom') k['1'].append('Bob') k['1'].append('Joe') k['1'] ['Tom', 'Bob', 'Joe']

Re: finding out the number of rows in a CSV file [Resolved]

2008-08-27 Thread Fredrik Lundh
John S wrote: after reading the file throughthe csv.reader for the length I cannot iterate over the rows. How do I reset the row iterator? A CSV file is just a text file. Don't use csv.reader for counting rows -- it's overkill. You can just read the file normally, counting lines (lines == row

Re: Tkinter event loop question

2008-08-27 Thread Fredrik Lundh
gordon wrote: is it possible to send a message to the gui instance while the Tk event loop is running?I mean after i create a gui object like root=Tk() mygui=SomeUI(root) and call root.mainloop() can i send message to mygui without quitting the ui or closing the window?i tried some code like

Re: problem with packages and path

2008-08-27 Thread Daniel
On Aug 27, 11:00 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 27 Aug, 18:44, Daniel <[EMAIL PROTECTED]> wrote: > > > > > I'm writing some unit tests for my python software which uses > > packages.  Here is the basic structure: > > > mypackage > > [...] > > >   unittests > >     __init__.py > >  

Re: problem with packages and path

2008-08-27 Thread Daniel
On Aug 27, 11:00 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 27 Aug, 18:44, Daniel <[EMAIL PROTECTED]> wrote: > > > > > I'm writing some unit tests for my python software which uses > > packages.  Here is the basic structure: > > > mypackage > > [...] > > >   unittests > >     __init__.py > >  

Re: Custom PyQt4 TableWidget

2008-08-27 Thread Phil Thompson
On Wed, 27 Aug 2008 09:51:29 -0700 (PDT), ff <[EMAIL PROTECTED]> wrote: >> >> setSelectionMode()? >> >> Phil > > Ive tried that, it does half the job, it stops you selecting more than > one item in the table at any one time but it doesnt stop the top-left > 'thing', How about setCornerButtonEnabl

Re: finding out the number of rows in a CSV file [Resolved]

2008-08-27 Thread Peter Otten
John S wrote: > [OP] Jon Clements wrote: >> On Aug 27, 12:54 pm, SimonPalmer <[EMAIL PROTECTED]> wrote: >>> after reading the file throughthe csv.reader for the length I cannot >>> iterate over the rows. How do I reset the row iterator? > > A CSV file is just a text file. Don't use csv.reader fo

Re: finding out the number of rows in a CSV file [Resolved]

2008-08-27 Thread John S
[OP] Jon Clements wrote: > On Aug 27, 12:54 pm, SimonPalmer <[EMAIL PROTECTED]> wrote: >> after reading the file throughthe csv.reader for the length I cannot >> iterate over the rows. How do I reset the row iterator? A CSV file is just a text file. Don't use csv.reader for counting rows -- it's

Re: import error between 2 modules

2008-08-27 Thread Fredrik Lundh
jimgardener wrote: is this kind of mutual import not allowed in python? it is, but you need to understand how things work before you can use it without getting yourself into trouble. this page might help: http://effbot.org/zone/import-confusion.htm see the "Circular Import" section fo

Re: no string.downer() ?

2008-08-27 Thread Fredrik Lundh
ssecorp wrote: if i want to make a string downcase, is upper().swapcase() the onyl choice? what you're asking for is usually called "lower case": http://en.wikipedia.org/wiki/Lower_case and the corresponding string method method is called "lower": >>> "HELLO".lower() 'hello' >

Tkinter event loop question

2008-08-27 Thread gordon
is it possible to send a message to the gui instance while the Tk event loop is running?I mean after i create a gui object like root=Tk() mygui=SomeUI(root) and call root.mainloop() can i send message to mygui without quitting the ui or closing the window?i tried some code like mygui.someMethod(

  1   2   3   >