Should ctypes handle mis-matching structure return ABI between mingw and MSVC?

2011-07-05 Thread Just Fill Bugs
According the Bug 36834 of gcc, there is a mis-matching between mingw and MSVC when a struct was returned by value from a C function. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36834 Should ctypes handle this situation automatically somehow? A ctypes discussion on 2009: http://thread

Adjacency lists with sqlalchemy...

2009-09-03 Thread Just Another Victim of the Ambient Morality
I'm desperately trying to declare an adjacency list table with declarative_base() but I can't figure it out. Strangely, all the documentation avoids declarative_base() like the plague and does everything the hard way. What the hell is this thing for if we're not supposed to use it? If

Re: Confessions of a Python fanboy

2009-08-05 Thread Just Another Victim of the Ambient Morality
contests. > > Criticism of a language is a pissing contest? > > Yeah, okay, I was a tad dismissive. I un-apologetically jump to strong > impressions about languages based on minimal use -- but I'm also willing > to change my mind. Ruby certainly looks to me like it has some ni

How to load file .py

2009-03-20 Thread Im Just GembeL
Hello all My name is agiz.im student from indonesia.im stay in borneo island. Hmm. im instal python version 3 and Im try file schemafuzz.py this file created by darkc0de. And my question.how to load file schemafuzz.py in vista? after try to load file with commanD Python schemafuzz.py but my vista

Why doesn't this RE match?

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

Bad hack fix around a bizarre problem...

2009-01-11 Thread Just Another Victim of the Ambient Morality
ks like the MySQLdb version doesn't match the _mysql version. If these were two different libraries, I might understand how this error happened. However, they're part of the same library. _mysql is just a Python binding to the MySQL C API and MySQLdb is just a Python wrapper arou

Any news on when some libraries will be ported to Python 3.0?

2009-01-07 Thread Just Another Victim of the Ambient Morality
I'm excited to use Python 3.0 (foolishly, it's the only Python interpreter I have on my system) but there are no libraries for it beyond the kitchen sink. Personally, a good start would be Beautiful Soup and Mechanize. I could also use DB. Has there been any word on Beautiful Soup?

python debugger tips?

2008-10-10 Thread just . another . random . user
Hi All, I'm switching to python from perl, and like the language a ton, but I find pdb and pydb to be vastly inferior debuggers to the perl version. In particular, I've grown very used to stepping into arbitrary functions interactively. For instance, in perl you can do this: casqa1:~> perl -de

Are Python deques linked lists?

2007-12-09 Thread Just Another Victim of the Ambient Morality
I'm looking for a linked list implementation. Something iterable with constant time insertion anywhere in the list. I was wondering if deque() is the class to use or if there's something else. Is there? Thank you... -- http://mail.python.org/mailman/listinfo/python-list

How do I not make a list?

2007-11-29 Thread Just Another Victim of the Ambient Morality
xpects and iterable. I'm pretty sure this something else doesn't need a list, either, and just wants to iterate over elements. Now, I could just make a list, using a list comprehension, performing my operation on each element, and then pass that list on, knowing that it is iterable. Howe

Re: A bug in Python's regular expression engine?

2007-11-27 Thread Just Another Victim of the Ambient Morality
"Paul Hankin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Nov 27, 3:48 pm, "Just Another Victim of the Ambient Morality" > <[EMAIL PROTECTED]> wrote: >> This won't compile for me: >> >> regex = re.compile(&#x

A bug in Python's regular expression engine?

2007-11-27 Thread Just Another Victim of the Ambient Morality
This won't compile for me: regex = re.compile('(.*\\).*') I get the error: sre_constants.error: unbalanced parenthesis I'm running Python 2.5 on WinXP. I've tried this expression with another RE engine in another language and it works just fine which

How do I convert escaped HTML into a string?

2007-11-23 Thread Just Another Victim of the Ambient Morality
I've done a google search on this but, amazingly, I'm the first guy to ever need this! Everyone else seems to need the reverse of this. Actually, I did find some people who complained about this and rolled their own solution but I refuse to believe that Python doesn't have a built-in solu

Re: SPAM

2007-11-15 Thread just bob
"Lew" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > just bob wrote: >> "John Bean" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> On Wed, 14 Nov 2007 11:04:35 -0800, "just bob" >>&

Re: SPAM

2007-11-14 Thread just bob
"John Bean" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, 14 Nov 2007 11:04:35 -0800, "just bob" > <[EMAIL PROTECTED]> wrote: > >> > > Your SPAM appears to be non-existent. Vapourware. Not real. > > Shame, I

SPAM

2007-11-14 Thread just bob
-- http://mail.python.org/mailman/listinfo/python-list

Re: Is pyparsing really a recursive descent parser?

2007-11-07 Thread Just Another Victim of the Ambient Morality
"Chris Mellon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Nov 7, 2007 5:15 PM, Just Another Victim of the Ambient Morality > <[EMAIL PROTECTED]> wrote: >> >> "Chris Mellon" <[EMAIL PROTECTED]> wrote in message >

Re: Is pyparsing really a recursive descent parser?

2007-11-07 Thread Just Another Victim of the Ambient Morality
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, 07 Nov 2007 21:15:50 +, Just Another Victim of the Ambient > Morality wrote: > >> Why can't I find a pyparsing-esque library with this implementation? >>

Re: Is pyparsing really a recursive descent parser?

2007-11-07 Thread Just Another Victim of the Ambient Morality
"Chris Mellon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Nov 7, 2007 3:15 PM, Just Another Victim of the Ambient Morality > <[EMAIL PROTECTED]> wrote: > >> > In short, it hasn't really evovled into a user-friendly package &g

Re: Is pyparsing really a recursive descent parser?

2007-11-07 Thread Just Another Victim of the Ambient Morality
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2007-11-07, Just Another Victim of the Ambient Morality > <[EMAIL PROTECTED]> wrote: >> "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PRO

Re: Is pyparsing really a recursive descent parser?

2007-11-07 Thread Just Another Victim of the Ambient Morality
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2007-11-05, Just Another Victim of the Ambient Morality > <[EMAIL PROTECTED]> wrote: >> "Kay Schluehr" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PRO

How do I change elements in a list?

2007-11-06 Thread Just Another Victim of the Ambient Morality
How do you change certain elements in a list? I'm looking to do the Python equivalent of this Ruby code: -> first = [1, 2] => [1, 2] -> second = first => [1, 2] -> first.map! {|i| i + 1} => [2, 3] -> first => [2, 3] -> second => [2, 3] I need to change a list, in place, so o

Re: Is pyparsing really a recursive descent parser?

2007-11-04 Thread Just Another Victim of the Ambient Morality
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2007-11-05, Just Another Victim of the Ambient Morality > <[EMAIL PROTECTED]> wrote: >> >> "Kay Schluehr" <[EMAIL PROTECTED]> wrote in message >> news:

Re: Is pyparsing really a recursive descent parser?

2007-11-04 Thread Just Another Victim of the Ambient Morality
"Kay Schluehr" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Nov 4, 10:44 pm, "Just Another Victim of the Ambient Morality" > <[EMAIL PROTECTED]> > >> I believe there is a cure and it's called recursive descent parsing. >

Re: Is pyparsing really a recursive descent parser?

2007-11-04 Thread Just Another Victim of the Ambient Morality
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2007-11-04, Just Another Victim of the Ambient Morality > <[EMAIL PROTECTED]> wrote: >> "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PR

Re: Is pyparsing really a recursive descent parser?

2007-11-04 Thread Just Another Victim of the Ambient Morality
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2007-11-04, Just Another Victim of the Ambient Morality > <[EMAIL PROTECTED]> wrote: >>> Consider writing a recursive decent parser by hand to parse >>> the l

Re: Is pyparsing really a recursive descent parser?

2007-11-04 Thread Just Another Victim of the Ambient Morality
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2007-11-04, Just Another Victim of the Ambient Morality > <[EMAIL PROTECTED]> wrote: >> >> "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message >> n

Re: Is pyparsing really a recursive descent parser?

2007-11-03 Thread Just Another Victim of the Ambient Morality
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2007-11-03, Paul McGuire <[EMAIL PROTECTED]> wrote: >> On Nov 3, 12:33 am, "Just Another Victim of the Ambient Morality" >><[EMAIL PROTECTED]> wrote: >>>

Re: Is pyparsing really a recursive descent parser?

2007-11-03 Thread Just Another Victim of the Ambient Morality
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Nov 3, 12:33 am, "Just Another Victim of the Ambient Morality" > <[EMAIL PROTECTED]> wrote: >> It has recursion in it but that's not sufficient to call it a >

Re: Is pyparsing really a recursive descent parser?

2007-11-02 Thread Just Another Victim of the Ambient Morality
y for "Recursive Descent Parser" describes this > parser model as a "predictive parser", and later goes on to say that > some (uncited) authors equate "predictive parser" with "recursive > descent parsers". The article makes a special distinction fo

Re: Is there a usenet library for Python?

2007-11-01 Thread Just Another Victim of the Ambient Morality
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2007-10-30, Just Another Victim of the Ambient Morality > <[EMAIL PROTECTED]> wrote: > >> Is there a Python library to communicate with a usenet server? > > Which protoc

Is pyparsing really a recursive descent parser?

2007-11-01 Thread Just Another Victim of the Ambient Morality
Is pyparsing really a recursive descent parser? I ask this because there are grammars it can't parse that my recursive descent parser would parse, should I have written one. For instance: from pyparsing import * grammar = OneOrMore(Word(alphas)) + Literal('end') grammar.parseString('Firs

Is there a usenet library for Python?

2007-10-30 Thread Just Another Victim of the Ambient Morality
Is there a Python library to communicate with a usenet server? I did a bit of googling and found some sites that suggest that you can roll your own fairly easily but, mostly, I got a lot of false positives with talk of Python libraries on usenet and I am really hoping this work has already

Re: Need help parsing with pyparsing...

2007-10-22 Thread Just Another Victim of the Ambient Morality
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Oct 22, 4:18 am, "Just Another Victim of the Ambient Morality" > <[EMAIL PROTECTED]> wrote: >> I'm trying to parse with pyparsing but the grammar I'm usin

Need help parsing with pyparsing...

2007-10-22 Thread Just Another Victim of the Ambient Morality
I'm trying to parse with pyparsing but the grammar I'm using is somewhat unorthodox. I need to be able to parse something like the following: UPPER CASE WORDS And Title Like Words ...into two sentences: UPPER CASE WORDS And Title Like Words I'm finding this surprisingly hard to do

Re: Unexpected behaviour with HTMLParser...

2007-10-09 Thread Just Another Victim of the Ambient Morality
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Just Another Victim of the Ambient Morality schrieb: >> HTMLParser is behaving in, what I find to be, strange ways and I >> would like to better understand what it is doing and w

Unexpected behaviour with HTMLParser...

2007-10-09 Thread Just Another Victim of the Ambient Morality
HTMLParser is behaving in, what I find to be, strange ways and I would like to better understand what it is doing and why. First, it doesn't appear to translate HTML escape characters. I don't know the actual terminology but things like & don't get translated into & as one would like.

Getting VideoCapture to work with Python 2.5

2006-12-29 Thread Just Another Victim of the Ambient Morality
I can't seem to get VideoCapture (http://videocapture.sourceforge.net/) to work with my version of Python (2.5). Why is that? I've followed the instructions which made it look easy but, as it happens all too often, it simply doesn't work. The error I get is that the .py interface file can

I'm looking for a pythonic red-black tree...

2006-12-14 Thread Just Another Victim of the Ambient Morality
I need a red-black tree in Python and I was wondering if there was one built in or if there's a good implementation out there. Something that, lets face it, does whatever the C++ std::map<> allows you to do... Thank you... -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a decent HTML parser for Python...

2006-12-05 Thread Just Another Victim of the Ambient Morality
"Just Another Victim of the Ambient Morality" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >Okay, I think I found what I'm looking for in HTMLParser in the > HTMLParser module. Except it appears to be buggy or, at least, not very robust.

Re: Looking for a decent HTML parser for Python...

2006-12-05 Thread Just Another Victim of the Ambient Morality
"Just Another Victim of the Ambient Morality" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I'm trying to parse HTML in a very generic way. >So far, I'm using SGMLParser in the sgmllib module. The problem is > that it forces you to pars

Looking for a decent HTML parser for Python...

2006-12-05 Thread Just Another Victim of the Ambient Morality
I'm trying to parse HTML in a very generic way. So far, I'm using SGMLParser in the sgmllib module. The problem is that it forces you to parse very specific tags through object methods like start_a(), start_p() and the like, forcing you to know exactly which tags you want to handle. I

Re: Bug in re module?

2006-10-06 Thread Just
In article <[EMAIL PROTECTED]>, "Ant" <[EMAIL PROTECTED]> wrote: > Ant wrote: > > Look at the following minimal example: > ... (snip example that shows non-capturing group capturing) > > Note I get the same results from python versions 2.4 and 2.5.

Re: Doctests for nested functions

2006-09-23 Thread Just
I think we had that discussion before, but that's not what nested functions are for (in Python). Use modules for that. Also solves your doctest problem nicely. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Stack trace in C

2006-07-25 Thread Just
t_exception and print_tb. >From C, PyErr_Print() is often handy (if only for debugging). Just -- http://mail.python.org/mailman/listinfo/python-list

Re: The Split String Function - How to preserve whitespace?

2006-07-08 Thread Just
As I am reading Python source in this text and checking > identation this is a bit annoying :-) > > How can I stop this happening? Doesn't look like an option from the > documents. Do I have to use a regexp (scary unchartered stuff for > me...)? >>> "a\nb\nc\n&qu

Re: CENSORSHIP - Django Project (Schema Evolution Support)

2006-06-07 Thread Just
In article <[EMAIL PROTECTED]>, Erik Max Francis <[EMAIL PROTECTED]> wrote: > Thorsten Kampe wrote: > > > I think I have a deja-vu... Did someone say "Xah"?! > > With a hint of Brandon. And a slice of Timothy Rue. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: list comprehensions put non-names into namespaces!

2006-05-26 Thread Just
In article <[EMAIL PROTECTED]>, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Mel Wilson" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Point of information, would this be the interpreter putting > > the result of its last calculation in _ ? > > Yes, [ ... ] No, actually. It'

Re: md5 from python different then md5 from command line

2006-05-07 Thread Just
a newline: >>> import md5 >>> test = md5.new("marius\n") >>> print test.hexdigest() 0f0f60ac801a9eec2163083a22307deb Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuple assignment and generators?

2006-05-04 Thread Just
q = r = s = t = u = v = 0 Just -- http://mail.python.org/mailman/listinfo/python-list

Coming from delphi - looking for an IDE - willing to spend money

2006-04-24 Thread Just call me James
Hi, Coming away from the luxury of the delphi IDE has been something of a shock. As a consequence I've become aware that maybe I need to spend some money on a python IDE. As a beginner I reckon integrated debugging would be helpful. Does anyone have any advice or suggestions? So far I've glance

Re: just one more question about the python challenge

2006-04-12 Thread Just
do from > >> there. I don't know what it means to distribute a file bytewise, but if > >> I knew exactly which modules/functions to use, I'd be more than happy > >> reading up on them myself. I just hate not knowing where to go to begin > >> with (even thoug

Re: just one more question about the python challenge

2006-04-12 Thread Just
ch modules/functions to use, I'd be more than happy > reading up on them myself. I just hate not knowing where to go to begin > with (even though I know I probably won't know enough about images to > use the right module properly either, but I can try). Have a look at the url of the image, then try the next. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Quickie: converting r"\x2019" to int

2006-04-06 Thread Just
In article <[EMAIL PROTECTED]>, Kent Johnson <[EMAIL PROTECTED]> wrote: > Robin Haswell wrote: > > Hey guys. This should just be a quickie: I can't figure out how to convert > > r"\x2019" to an int - could someone give me a hand please? > > Is thi

Re: import random module

2006-03-23 Thread Just
olve the problem at hand, at least > there's nothing in the PEP that says it will. "import random" is an > absolute import even in random.py is in the current directory, because > current directory is in sys.path. Unless there's a change sys.path > planned, the sh

Re: Generating exceptions from C

2006-03-18 Thread Just
In article <[EMAIL PROTECTED]>, Jacob Kroon <[EMAIL PROTECTED]> wrote: > I'll just reply to myself what I've found out so far: > > > 1. PyErr_NewException() creates the exception _class_, not the > > instance right ? > > > Looks like it does

Re: Cheese Shop -> BSOL?

2006-03-11 Thread Just
ot;Bright Side of Life"? > > > I think I'd prefer "The Larch"... > > Or just "SPAM" ( Python Modules ?) Standard Python Archive (of) Modules? Just -- http://mail.python.org/mailman/listinfo/python-list

Re: First script, please comment and advise

2006-03-10 Thread Just
y into a helper function, giving that function a name and sticking it into a module can _hardly_ be called "pollution". That's what modules are *for*. [ ... ] > >To me, nested functions (in Python) are *only* helpful when using closures. > >If you're not

Re: First script, please comment and advise

2006-03-09 Thread Just
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Just: > > > Btw. I find the use of a nested function here completely bogus: you > > don't need the surrounding scope. > > I don't agree, nested functions are useful to better structure your &

Re: First script, please comment and advise

2006-03-09 Thread Just
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > My version is similar to Just one: > > from random import shuffle > > def scramble_text(text): > """Return the words in input text string scrambled > except for the first and la

Re: First script, please comment and advise

2006-03-09 Thread Just
. """ new_text = "" word = "" for ch in text: if ch.isalpha(): word += ch else: new_text += scramble(word) word = "" new_text += ch new_text += scramble(word) return new_text def scramble(word): """ scramble word """ from random import shuffle if len(word) < 4: return word letters = list(word[1:-1]) shuffle(letters) return word[0] + "".join(letters) + word[-1] Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Evangelism

2006-03-09 Thread Just
nt? Yeah, the URL: http://www.squidoo.com/pythonology :) Just -- http://mail.python.org/mailman/listinfo/python-list

Re: generators shared among threads

2006-03-08 Thread Just
Synchronized(itertools.count()) > > > > That isn't a general solution but can be convenient (if I didn't mess > > it up). Maybe there's a more general recipe somewhere. > > This code is not allowed in Python 2.4. From PEP 255: [ snip ] The code also doesn&#

Re: getting the reference count of an object ...

2006-03-03 Thread Just
ating a dict subclass that counts > the number of assignments and deletions but that seems cumbersome (an > bug-prone). > > Is there a way to get the reference count of these datadict items? I > imagine that this would be a more stable implementation of such a feature. > >

Re: Cross compile generation of .pyc from .py files...

2006-03-01 Thread Just
em for the i686 > system where they were being cross-compiled... .pyc files are only compatible with the same major Python version, so it sounds like you're using different versions on both platforms. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread Question

2006-03-01 Thread Just
examples that used classes, and > >> other examples that just called one thread start command - when should > >> you use one over another? > > > >For simple use it doesn't matter. Use a class when you want to add more > >state or behaviour - for example you

Re: py-cocoa?

2005-12-31 Thread Just
In article <[EMAIL PROTECTED]>, Lin-Chieh Shangkuan <[EMAIL PROTECTED]> wrote: > It's known that combining GTK+ or Qt with Python could enable the > GUI design with pygtk/pyqt. > > In Mac OSX, it's suggested that use Cocoa be the GUI framework. > Is the

Re: python coding contest

2005-12-31 Thread Just
In article <[EMAIL PROTECTED]>, Just <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > > > Mark Dickinson wrote: > > > Here's a variant of André's brilliant idea that's

Re: Memoization and encapsulation

2005-12-31 Thread Just
ef func(x): result = _cache.get(x) if result is None: result = x + 1 # or a time consuming calculation... _cache[x] = result return result Just -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-31 Thread Just
printable variant without the \r: > > j=''.join;seven_seg=lambda x:j(j(' _ |_|_ _| > |'[ord('^rm=3|4:s»'[int(c)])%d*2:][:3]for c in x)+"\n"for d in(3,8,7)) > > Note that there is only one non-ascii character in the code. Which isn't. So I'm not sure what the point is you're trying to make. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Using printf in a C Extension

2005-12-09 Thread Just
ot reach python stdout. > Is there something screwy with my environment or is there some trick to > this that I don't know. Any help would be greatly appreciated! Have a look at PySys_WriteStdout(). Just -- http://mail.python.org/mailman/listinfo/python-list

Re: email module, redirecting to stdout

2005-10-04 Thread Just
directing stderr to stdout from the shell is not an > > option for me, because I need to use stderr for other messages. > > smtplib obtains a copy of stderr by > > from sys import stderr > > Therefore you have to do > > smtplib.stderr = sys.stdout > > to get the desired effect. Ouch. I'd consider this a bug. "from sys import stderr" should at least be considered bad style. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: metaclass that inherits a class of that metaclass?

2005-06-01 Thread Just
s__ type also has type as its metaclass: >>> type.__class__ In other words, type is an instance of itself. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating dict from keys and values

2005-05-29 Thread Just
gt; > > d = {} > > for i in range(len(data)): > > d[header[i]] = data[i] > > But this feels kind of inelegant. So: is there a better way? d = dict(zip(header, data)) Just -- http://mail.python.org/mailman/listinfo/python-list

Re: namespaces in eval(): spot error in 3 line program

2005-05-25 Thread Just
In article <[EMAIL PROTECTED]>, "pasa" <[EMAIL PROTECTED]> wrote: > I'm an old time python user, but just got bitten by namespaces in eval. > If this is an old discussion somewhere, feel free to point me there. > > Based on the documentation, I woul

Re: py2exe + svn - the final drama

2005-05-07 Thread Just
In article <[EMAIL PROTECTED]>, David Bolen <[EMAIL PROTECTED]> wrote: > Just <[EMAIL PROTECTED]> writes: > > > the zipimport module has an attr called _zip_directory_cache, which is a > > dict you can .clear(). Still, reloading modules is hairy at best, i

Re: py2exe + svn - the final drama

2005-05-06 Thread Just
ul help snipped] the zipimport module has an attr called _zip_directory_cache, which is a dict you can .clear(). Still, reloading modules is hairy at best, its probably easiest to relaunch your app when the .zip file has changed. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe and library.zip

2005-05-04 Thread Just
In article <[EMAIL PROTECTED]>, Peter Hansen <[EMAIL PROTECTED]> wrote: > [ ... ] (Note to self: check if zip files that can > be in sys.path can be compressed, Yes. > and if py2exe compresses them.) Don't know, but I assume yes. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: pop3proxy

2005-05-02 Thread Just
In article <[EMAIL PROTECTED]>, BrokenClock <[EMAIL PROTECTED]> wrote: > Here is a python newbie! I've choose it to make a pop3 proxy - I want to > filter content between a pop3 client and a pop3 server, and I have no > control on the server... > First, I wanted

Re: deprecation of has_key?

2005-04-22 Thread Just
in-toss to a no-brainer. The main argument was that nothing but "key in d" made sense (for __contains__), and that therefore "for key in d" was the only option, for symmetry with the other "in". Just -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode character '\N{ }'

2005-04-11 Thread Just
verse of this process? For example, > when > I have a unicode character '£', uc.method() should return the character name > 'POUND SIGN' in str format. import unicodedata name = unicodedata.name(c) Just -- http://mail.python.org/mailman/listinfo/python-list

Re: zipimport IOError reading Modules.zip in Mac standalone app

2005-03-07 Thread Just
at be > a problem? Could it be that more than one process is trying to read > Modules.zip at the same time? If so, what do we do - I don't want to have > to include a separate version of the code for each subprocess. > > Any other suggestion? I need this fixed ASAP. I&#x

Re: python -i (interactive environment)

2005-03-07 Thread Just
> Unfortunately it does so in an entirely new namespace, thereby losing > the advantage of -i - namely, that you can investigate the program's > namespace after it's terminated. code.interact() has a namespace argument ('local'), so it really easy to have it use the namespace you want. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Gordon McMillan installer and Python 2.4

2005-03-03 Thread Just
In article <[EMAIL PROTECTED]>, "Serge Orlov" <[EMAIL PROTECTED]> wrote: > Svein Brekke wrote: > > > Seriously, if you're only interested in Windows, just use py2exe, > > > or if you want Linux+Windows, try cx_Freeze. > > > > Accor

Re: Initializing subclasses of tuple

2005-03-01 Thread Just
ialize instances of a class derived from tuple, if it's not > in the __init__ method? Hi Dave, You're going to have to override __new__. See eg. http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread /4a53d2c69209ba76/9b21a8326d0ef002 http://mail.python.org/pipermail/tutor/2004-January/027779.html Good luck, Just -- http://mail.python.org/mailman/listinfo/python-list

Re: naming convention for scalars, lists, dictionaries ...

2005-02-28 Thread Just
hat is being unpacked and what is the source. > > "for (one, two, three) in somelist:" > versus > "for one, two, three in sometlist:" > > Even with a colorizing editor (emacs) I find the first version > easier to read. YMMV. But you're using it for _

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-27 Thread Just
In article <[EMAIL PROTECTED]>, "Carl Banks" <[EMAIL PROTECTED]> wrote: > Just wrote: > > While googling for a non-linear equation solver, I found > > Math::Polynomial::Solve in CPAN. It seems a great little module, > except > > it's not

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Just
In article <[EMAIL PROTECTED]>, "Raymond L. Buvel" <[EMAIL PROTECTED]> wrote: > Just wrote: > > > > > SciPy indeed appear to contain a solver, but I'm currently stuck in > > trying to _get_ it for my platform (OSX). I'm definitely not g

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Just
ranslation process to python. > > > >Ah ok, I'll try to locate that (following the instruction in Solve.pm > >didn't work for me :( ). > > > > Ouch. I just did a quick search and found that that site has undergone > a few changes, and the code tha

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Just
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (John M. Gamble) wrote: > In article <[EMAIL PROTECTED]>, > Just <[EMAIL PROTECTED]> wrote: > >While googling for a non-linear equation solver, I found > >Math::Polynomial::Solve in CPAN. It seems a great l

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Just
In article <[EMAIL PROTECTED]>, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Just wrote: > > While googling for a non-linear equation solver, I found > > Math::Polynomial::Solve in CPAN. It seems a great little module, except > > it's not Python... I&

any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Just
ckage that implements that? Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Style guide for subclassing built-in types?

2005-02-24 Thread Just
ersing if iterable were huge. (and the "iterable" wouldn't be > garbage-collected because I want to keep a reference to it) If your list contains numbers (or lists of numbers), consider using NumPy (Numeric) or Numarray, in which seq[::-1] will actually return a "view"

Re: variable declaration

2005-02-08 Thread Just
t; - check the name exists in the local namespace, and throw an exception if it > doesn't. If it the name does exist, perform a normal store operation. But the compiler would _know_ in which scope the variable was defined, no? Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Hey, get this!

2005-02-03 Thread Just
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > > If it's a path importer, it could be a cookie, specific to the importer. > > I think in Steve's case initializing __path__ to ["*db*"] should work. > > > > Ju

Re: Hey, get this!

2005-02-03 Thread Just
If it's a path importer, it could be a cookie, specific to the importer. I think in Steve's case initializing __path__ to ["*db*"] should work. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating .pyc/.pyo from a make file

2005-02-03 Thread Just
*.py they have > been compiled from. True. > Copying them to other path locations will give you > the wrong __file___ information in tracebacks. This is not 100% accurate: yes, the traceback shows the original source file path, yet module.__file__ does point to the actual .pyc file it was loaded from. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy Q: dealing with object type

2005-02-03 Thread Just
lasses. Heck, isinstance() even works in Python 1.5.2... > Still, if you can use new-style classes, you should. > > Also, you should probably Google for "duck typing". Generally, in > Python it is frowned upon to check the type of an object. There are > times when it's necessary, but if you're just starting off, my guess is > that you haven't discovered one of these times yet... Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Reinstall python 2.3 on OSX 10.3.5?

2005-02-03 Thread Just
s you a Python installation under /sw. > > But that doesn't solve his problem, which is to restore the > Apple-supplied Python that he deleted. Also: fink is evil. I wouldn't touch it with a ten-foot pole. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: Hash of class from instance

2005-02-02 Thread Just
In article <[EMAIL PROTECTED]>, "Joakim Storck" <[EMAIL PROTECTED]> wrote: > So I guess it might be a little bit less unwise to use id() instead > then... Why don't you use the class objects themselves as dict keys? Just -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >