Re: Newbie question: Tab key giving different output

2005-11-28 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >While in the interactive mode, i need to use the tab key to indent my >code. However, i get a message "List all 174 possibilities? (Y/N)" >instead of an indent. So i use spaces. > >How do i tell python to give me indents? You know, the number of spaces you use is not im

Re: books: Dive into Python vs Beginning Python

2005-11-28 Thread Anders Eriksson
On Fri, 25 Nov 2005 11:25:43 +0100, Franz Mueller wrote: > Hi, > > which of the following books would you recommend: > "Dive into Python" or "Beginning Python: From Novice to Professional"? > Since "Dive into Python" is on the net, you can see for yourself if it's any good (which I think it is!)

Re: Death to tuples!

2005-11-28 Thread Antoon Pardon
On 2005-11-28, Duncan Booth <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: > >>> >>> def func(x): >>> ... if x in [1,3,5,7,8]: >>> ... print 'x is really odd' >>> ... >>> >>> dis.dis(func) >>> ... >>>3 20 LOAD_FAST0 (x) >>> 23 LOAD_CONST

Re: cheese shop registration error

2005-11-28 Thread Martin v. Löwis
Todd Greenwood-Geer wrote: > Q: Do I have to be a member of some sort of secret society in order to > be listed in the 'local recipient table'? Ah, you don't know about the PSU :-? Seriously, please report a bug at sf.net/projects/pypi. Unfortunately, the (single) cheeseshop maintainer is overwor

Re: Death to tuples!

2005-11-28 Thread bonono
Rikard Bosnjakovic wrote: > Steven Bethard wrote: > > > [1]http://www.python.org/dev/summary/2005-09-01_2005-09-15.html#string-formatting-in-python-3-0 > > Reading this link, I find this: > > "Currently, using % for string formatting has a number of inconvenient > consequences: > > * preceden

Re: Death to tuples!

2005-11-28 Thread Rikard Bosnjakovic
Steven Bethard wrote: > [1]http://www.python.org/dev/summary/2005-09-01_2005-09-15.html#string-formatting-in-python-3-0 > Reading this link, I find this: "Currently, using % for string formatting has a number of inconvenient consequences: * precedence issues: "a%sa" % "b"*4 produces 'ab

SQLObject transaction rollback not working

2005-11-28 Thread jacob . miles
Hello. I'm trying to wrap a function call in a transaction, but when I intentionally throw an exception in the middle of the function it doesn't actually roll back the transaction. The debug output says 1/ROLLBACK, without any 1/COMMITs in there, but when I view the data in the command-line mysql

Re: General question about Python design goals

2005-11-28 Thread Mike Meyer
[EMAIL PROTECTED] (Bengt Richter) writes: >>Then feel free to submit patches for the docs. > This is easy to say, and maybe the docs maintainers are accomodating, > but I'd be the average reader wouldn't have a concept of how a "patch" > should be prepared. >From what's been said here before, the

Re: Instantiating classes which are derived from built-in types.

2005-11-28 Thread Alex Martelli
Paul Rubin wrote: > [EMAIL PROTECTED] (Alex Martelli) writes: > > A is oldstyle -- a wart existing for backwards compatibility. > > I think it's time for "from __future__ import newclasses" since > I hate having to type "class A(object):" instead of "class A:" > all ove

New Position at Naples Daily News using Django/Python

2005-11-28 Thread eric . moritz
One of the most respected and award-winning newspaper Web teams in the world has moved to Florida and is looking for an experienced server-side Web developer. NDN Productions -- the online and new media publishing division of the Naples Daily News -- is looking for a full-time Python programmer to

Re: General question about Python design goals

2005-11-28 Thread Bengt Richter
On 27 Nov 2005 21:01:49 -0800, [EMAIL PROTECTED] (Aahz) wrote: >In article <[EMAIL PROTECTED]>, >Christoph Zwerschke <[EMAIL PROTECTED]> wrote: >>Aahz wrote: >>> Christoph deleted his own attribution: For instance, I just wanted to use the index() method on a tuple which does not wo

Re: Instantiating classes which are derived from built-in types.

2005-11-28 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > A is oldstyle -- a wart existing for backwards compatibility. I think it's time for "from __future__ import newclasses" since I hate having to type "class A(object):" instead of "class A:" all over the place. -- http://mail.python.org/mailman/listinfo/p

Re: Death to tuples!

2005-11-28 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: ... > Actually, no, I hadn't. I don't use tuples that way. It's rare when I have > a tuple whose elements are not all floats, strings or ints, and I never put > mutable containers in them. You never have a dict whose values are lists? Or never call .items (or .iter

Re: Death to tuples!

2005-11-28 Thread Alex Martelli
Mike Meyer <[EMAIL PROTECTED]> wrote: ... > concept of tuple unpacking. When names are bound, you can use a > "tuple" for an lvalue, and the sequence on the rhs will be "unpacked" > into the various names in the lvalue: > > for key, value = mydict.iteritems(): ... > a, (b, c) =

Re: return in loop for ?

2005-11-28 Thread Alex Martelli
Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > I don't know what the state of the art is, but I suspect it > > will be a long, long time before it is as easy as running "import > > mymodule; verify(mymodule)". > > Some pretty significant pieces of s

Re: Death to tuples!

2005-11-28 Thread Steven Bethard
Mike Meyer wrote: > Steven Bethard <[EMAIL PROTECTED]> writes: > >>Dan Bishop wrote: >> >>>Mike Meyer wrote: >>> >>> Is there any place in the language that still requires tuples instead of sequences, except for use as dictionary keys? >>> >>>The % operator for strings. And in argument li

Re: Instantiating classes which are derived from built-in types.

2005-11-28 Thread Alex Martelli
Achim Dahlhoff <[EMAIL PROTECTED]> wrote: > Hi. > > I'm trying to find out the diffrence between normal classes and classes > derived from built-in types. > (Which is causing me trouble trying to instantiate a class using C API > calls) > > >>> class A: > ... pass > ... > >>> class B(dict): > .

Re: Writing big XML files where beginning depends on end.

2005-11-28 Thread uche . ogbuji
""" Then we need something that allows parts of the XML file to be written to file and purged from RAM to avoid the memory problem. Suggestions for solutions are appreciated. """ Multiple XML files is not an option, but what about general entities or XInclude? That way you don't need to change

Re: importing a method

2005-11-28 Thread Alex Martelli
Flavio <[EMAIL PROTECTED]> wrote: > > If you have a function f and want to make an instancemethod out of it, > > you can simply call f.__get__(theinstance, theclass) and that will build > > and return the new instancemethod you require. > > I think that > > f.show = MethodType(show,f) > > is le

Re: importing a method

2005-11-28 Thread Alex Martelli
Martin Miller <[EMAIL PROTECTED]> wrote: > I'd like to point out to the OP that using a function's __get__ method > this way only works with new-style classes and their instances...not > with the example in the shown in original post. Uh, why not? >>> class old: pass ... >>> def f(self): print

Re: How to write an API for a Python application?

2005-11-28 Thread Alex Martelli
Cameron Laird <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Alex Martelli <[EMAIL PROTECTED]> wrote: > . > >Note also that you can freely download all of the code in my book as > >http://examples.oreilly.com/pythonian/pythonian-examples.zip (it's just > >36 K

Re: Newbie question: Tab key giving different output

2005-11-28 Thread Kaizer
Thank you for your response, Mr. Lundh Have a great day, Kaizer. -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple versions

2005-11-28 Thread Me
Thank you for your reply! Is there a simple way to change the .py/.pyw associations? Like a registry setting I can "toggle"? Or are there lots of other things involved, system directory libraries etcetera? "Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [Me] > I need to i

Re: Looking for small, impressive 3D-related Python script

2005-11-28 Thread Robert Kern
Kenneth McDonald wrote: > I'm not trying to persuade my company to offer Python as a scripting > language for their product, but I am trying to give them examples of > things that Python can do easily that cannot be done easily with > their current proprietary scripting language. After that i

Re: New docs for set elements/dictionary keys

2005-11-28 Thread Mike Meyer
Christoph Zwerschke <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Christoph Zwerschke wrote: >>>I think that is not so bad. How about this simplification: >>> >>>Any hashable object(1) can be used as a dictionary key/set >>>element. Lists, sets and dicts are not hashable, and can not be >>>us

Re: General question about Python design goals

2005-11-28 Thread Mike Meyer
Christoph Zwerschke <[EMAIL PROTECTED]> writes: > A programming language is not a "work of art". If you are an artist, > you may break symmetry and introduce all kinds of unexpected > effects. Actually, as an artist, you purposfully want to provoke > astonishment. But if I am using a programming la

cheese shop registration error

2005-11-28 Thread Todd Greenwood-Geer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Python-list - I'd like to publish to PyPI. I'm assuming that this is open to anyone. So here's my repro case for trying to register for an account: REPRO: - - open cheeseshop reg form http://cheeseshop.python.org/pypi?%3Aaction=register_form - - fi

Re: return in loop for ?

2005-11-28 Thread Mike Meyer
Paul Rubin writes: > I don't know about the BCPL type verifier but every statically typed > language verifies certain assertions about the types of expressions > and this is useful. BCPL is untyped. You can perform any operation on any variable. You can use the floating

Re: UUID?

2005-11-28 Thread Stephen Prinster
Huang Zhen wrote: > Hello, > How can I get a UUID with python? > Thanks! I've never used this, but I just saw it on Planet Python this morning: http://www.livejournal.com/users/zestyping/157957.html HTH, Steve P. -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for small, impressive 3D-related Python script

2005-11-28 Thread Kenneth McDonald
Thanks. Unfortunately, I then still need to write some sort of impressive OBJ-generating script, and it would really be nice if one existed already...I know there will be simple examples out there that will still look very good, but I don't know enough to quickly write one myself.KenOn 28-Nov-05, a

Re: General question about Python design goals

2005-11-28 Thread Aahz
In article <[EMAIL PROTECTED]>, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: >Aahz wrote: >>Christoph wrote: >>>Aahz wrote: Christoph wrote: > >For instance, I just wanted to use the index() method on a tuple which >does not work. ... Because Guido believes that tuples

UUID?

2005-11-28 Thread Huang Zhen
Hello, How can I get a UUID with python? Thanks! -- Best Regards, Huang Zhen Linux Technology Center IBM China Development Lab, Beijing Telno: (8610)82782244-2845 -- http://mail.python.org/mailman/listinfo/python-list

Re: General question about Python design goals

2005-11-28 Thread Christoph Zwerschke
Christoph Zwerschke wrote: > there should be comma after "ist", Sorry, *before* "ist". I should probably stop posting for today... -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for small, impressive 3D-related Python script

2005-11-28 Thread Jack Diederich
On Mon, Nov 28, 2005 at 04:44:56PM -0600, Kenneth McDonald wrote: > I'm not trying to persuade my company to offer Python as a scripting > language for their product, but I am trying to give them examples of > things that Python can do easily that cannot be done easily with > their current pr

Re: General question about Python design goals

2005-11-28 Thread Paul Rubin
Peter Hansen <[EMAIL PROTECTED]> writes: > Christoph Zwerschke wrote: > > Ok, these are nice aphorisms with some truth. But I had to think of > > the German excuse "Wer Ordnung hält ist nur zu Faul zum Suchen - ein > > Genie überblickt das Chaos." ("Those who try to keep things tidy are > > just to

Re: General question about Python design goals

2005-11-28 Thread Christoph Zwerschke
Peter Hansen schrieb: > Christoph Zwerschke wrote: > >> Ok, these are nice aphorisms with some truth. But I had to think of >> the German excuse "Wer Ordnung hält ist nur zu Faul zum Suchen - ein >> Genie überblickt das Chaos." ("Those who try to keep things tidy are >> just too lazy to search f

Re: Call OCX from python?

2005-11-28 Thread JustSomeGuy
"Claudio Grondi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "JustSomeGuy" <[EMAIL PROTECTED]> schrieb im Newsbeitrag > news:[EMAIL PROTECTED] > > Hi I have a commercial OCX that I want to use in > > my python application. How do I call OCXs from > > python? > > TIA > > import w

Re: Death to tuples!

2005-11-28 Thread Peter Hansen
Antoon Pardon wrote: > Op 2005-11-28, Peter Hansen schreef <[EMAIL PROTECTED]>: >>Mike Meyer wrote: >>>Is there any place in the language that still requires tuples instead >>>of sequences, except for use as dictionary keys? >> >>Would it be possible to optimize your "frozenlist" so that the object

Re: General question about Python design goals

2005-11-28 Thread Peter Hansen
Christoph Zwerschke wrote: > Ok, these are nice aphorisms with some truth. But I had to think of the > German excuse "Wer Ordnung hält ist nur zu Faul zum Suchen - ein Genie > überblickt das Chaos." ("Those who try to keep things tidy are just too > lazy to search for searching - a genius survey

Re: return in loop for ?

2005-11-28 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > I don't know what the state of the art is, but I suspect it > will be a long, long time before it is as easy as running "import > mymodule; verify(mymodule)". Some pretty significant pieces of software have been formally verified to meet their formal s

Re: New Ordered Dictionery to Criticise

2005-11-28 Thread Christoph Zwerschke
Fuzzyman wrote: > Sorry for this hurried message - I've done a new implementation of out > ordered dict. This comes out of the discussion on this newsgroup (see > blog entry for link to archive of discussion). Thanks. I'll try to check it out and put my oar in over the next weekend. One thing I a

TypeError: unsubscriptable object

2005-11-28 Thread enas khalil
when i run this script to make a training of some text and so can use condfreqdistributions to guess text in test , my code isas follows: from nltk.probability import ConditionalFreqDistfrom nltk.tokenizer import WhitespaceTokenizerfrom nltk.tagger import *token1 = []train_tokens = []cfdist=Condit

Re: [pyparsing] How to get arbitrary text surrounded by keywords?

2005-11-28 Thread Inyeol Lee
On Mon, Nov 28, 2005 at 09:00:58PM +, Paul McGuire wrote: > "Inyeol Lee" <[EMAIL PROTECTED]> wrote in message > [...] > > How should I write the part of 'module_contents'? It's an arbitrary text > > which doesn't contain 'endmodule' keyword. I don't want to use full > > scale Verilog parser for

Re: return in loop for ?

2005-11-28 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > >> Which means you can't create a verifier which will verify all > >> programs. Is there a reason to believe that you can't have a verifier > >> with three possible outcomes: Correct, Incorrect, and I don't know, > >> and it is always correct in doing so? No

Re: New docs for set elements/dictionary keys

2005-11-28 Thread Christoph Zwerschke
Mike Meyer wrote: > Christoph Zwerschke wrote: >>I think that is not so bad. How about this simplification: >> >>Any hashable object(1) can be used as a dictionary key/set >>element. Lists, sets and dicts are not hashable, and can not be >>used. Tuples can be used if all the things they contain are

Instantiating classes which are derived from built-in types.

2005-11-28 Thread Achim Dahlhoff
Hi. I'm trying to find out the diffrence between normal classes and classes derived from built-in types. (Which is causing me trouble trying to instantiate a class using C API calls) >>> class A: ... pass ... >>> class B(dict): ... pass ... >>> type(A) >>> type(B) >>> When I have a handle

Re: General question about Python design goals

2005-11-28 Thread Christoph Zwerschke
Fredrik Lundh schrieb: > Christoph Zwerschke wrote: > >>What about design goals such as: >> >>- orthogonality >>- coherence, consistency >>- principle of least astonishment ("Python fits my brain") >>- simplicity ("kiss" principle) >>- aesthetics, symmetry >> >>Actually, which priority have the ab

Re: FTP over TLS

2005-11-28 Thread Carl Waldbieser
Dima Barsky wrote: > Carl Waldbieser <[EMAIL PROTECTED]> wrote: > >> Does anyone know of any good examples for writing client side code >> to upload files over a secure FTP connection? I am referring to >> FTPS, *not* SFTP, which I found out the hard way are two different >> things. > > Look a

Re: Which License Should I Use?

2005-11-28 Thread Steven D'Aprano
On Mon, 28 Nov 2005 12:40:07 -0600, Rocco Moretti wrote: > Gaak! No! The Python license you point to contains horrible amounts of > cruft due to the ownership ping-pong game. (And just using the hyperlink > like you did leaves it vauge as to who is doing the liscensing - Steven > D'Aprano? the

Re: PYTHONDOCS on OSX

2005-11-28 Thread Dan Lowe
On Nov 28, 2005, at 5:27 PM, Robert Hicks wrote: > I have that...and it isn't working with the OSX version of IDLE in the > MacPython folder. If I start Python from the Terminal it works. > > Any idea why it doesn't work that way? Unless a program is launched in a Terminal window, your .profile

Looking for small, impressive 3D-related Python script

2005-11-28 Thread Kenneth McDonald
I'm not trying to persuade my company to offer Python as a scripting language for their product, but I am trying to give them examples of things that Python can do easily that cannot be done easily with their current proprietary scripting language. After that it would be their decision. As

Re: Precision for equality of two floats?

2005-11-28 Thread Steven D'Aprano
On Mon, 28 Nov 2005 12:35:16 -0500, Mike Meyer wrote: >> e.g. "if f1==f2:" will always mean "if abs(f1-f2)<1e-6:" > > This is a *bad* idea. What happens if f1=1e-12 and f2=1e-112? Do you > really want to values that 100 orders of magnitude different to > compare as equal? Sure, if f1 and f2 rep

Re: General question about Python design goals

2005-11-28 Thread Christoph Zwerschke
Aahz wrote: >Christoph wrote: >>Aahz wrote: >>>Christoph wrote: For instance, I just wanted to use the index() method on a tuple which does not work. ... >>> >>>Because Guido believes that tuples should be primarily used as >>>lightweight replacements for C structs. Therefore they have mi

RE: New Ordered Dictionery to Criticise

2005-11-28 Thread Delaney, Timothy (Tim)
"Martin v. Löwis" wrote: > A couple of minor points: > - I would drop 2.2 compatibility Unfortunately, there are a *lot* of systems out there where only 2.2 is support (Red Hat 3.0 anyone?). I know we'd like to be able to not support earlier versions (yes, I saw today's messages on the djgpp p

Re: exception KeyboardInterrupt and os.system command

2005-11-28 Thread darren kirby
Thanks for the tips everyone, although it turns out this is not a python problem at all. After several tests with mpg123 both direct on the cli, and wrapped in an os.system() call, I see it is _always_ returning 0 exit status whether I interrupt it or not. I went to the mpg123 website to see if

Re: PYTHONDOCS on OSX

2005-11-28 Thread Robert Hicks
Dave Opstad wrote: > In article <[EMAIL PROTECTED]>, > "Robert Hicks" <[EMAIL PROTECTED]> wrote: > > > How do I set this variable in my .bash_profile? I have the html docs in > > /usr/local/PythonDocs. > > I have a line in my .profile like this: > > export PYTHONDOCS='/Users/opstad/Documents/Deve

Re: Long integer arrays in Python; how? /Carl

2005-11-28 Thread Robert Kern
Carl wrote: > I have the following problem > > import Numeric > dim = 1 > bits = 32 > v = Numeric.zeros((dim, bits), 'l') > for j in range(bits): > v[0][j] = 1L << bits - j - 1 > > The problem is the last assignment, which is not valid, since the integer is > on the r

Re: return in loop for ?

2005-11-28 Thread Steven D'Aprano
On Mon, 28 Nov 2005 12:05:03 -0500, Mike Meyer wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> On Mon, 28 Nov 2005 10:02:19 +0100, Sybren Stuvel wrote: >>> Duncan Booth enlightened us with: I would have thought that no matter how elaborate the checking it is guaranteed there exis

Re: importing a method

2005-11-28 Thread Steven D'Aprano
On Mon, 28 Nov 2005 08:16:12 -0800, Martin Miller wrote: > First of all,why do you think the new module is deprecated? (I can't > find anything in the docs to indicate this.) Did you try help(new) from an interactive prompt? py> new.__doc__.splitlines()[0] 'Create new objects of various types.

Re: General question about Python design goals

2005-11-28 Thread Christoph Zwerschke
Fredrik Lundh schrieb: > Christoph Zwerschke wrote: >>But the problem is that the tutorials and manuals give the impression >>that the difference between lists and tuples is only mutablity versus >>immutability. > > both the tutorial and the FAQ discusses the difference in terms of use > cases and

Re: Book: Cross-Platform GUI Programming with wxWidgets?

2005-11-28 Thread Bugs
[EMAIL PROTECTED] wrote: > I was wondering if people using wxPython found this book useful? Is it > worth the money? Thanks > It might be better for Python folks to just wait for this book, due Jan 1, 2006: http://www.manning.com/books/rappin http://www.amazon.com/gp/product/1932394621/002-8046

Re: return in loop for ?

2005-11-28 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > Which means you can't create a verifier which will verify all > programs. Is there a reason to believe that you can't have a verifier > with three possible outcomes: Correct, Incorrect, and I don't know, > and it is always correct in doing so? Note that "I d

Re: return in loop for ?

2005-11-28 Thread Mike Meyer
Paul Rubin writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> Which means you can't create a verifier which will verify all >> programs. Is there a reason to believe that you can't have a verifier >> with three possible outcomes: Correct, Incorrect, and I don't know, >>

Re: Which License Should I Use?

2005-11-28 Thread Ben Finney
Rocco Moretti <[EMAIL PROTECTED]> wrote: > One point that frequently gets ignored in licensing debates: > > The value of a license is directly proportional to the amount of > time, effort, and money you are willing to spend enforcing it. That's a very important factor, yes. > It doesn't matter h

Re: Death to tuples!

2005-11-28 Thread skip
>>> For those of us not following this thread closely, can you identify >>> cases where tuples are mutable, not hashable or can't be used as >>> dictionary keys? I've never encountered any such cases. >> >> t = ([1,2], [3,4]) ... t = ([1,2], [3,4]) t[0

Re: Death to tuples!

2005-11-28 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Mike> Tuples have the problem that they are immutable, except when > Mike> they're not (or for proper values of immutable, your > Mike> choice). They're hashable, except when they're not. Or > Mike> equivalently, they can be used as dictionary keys - or s

Re: Death to tuples!

2005-11-28 Thread Paul Rubin
"Paddy" <[EMAIL PROTECTED]> writes: > I would consider > t = ([1,2], [3,4]) > to be assigning a tuple with two list elements to t. > The inner lists will be mutable but I did not know you could change the > outer tuple and still have the same tuple object. Whether t is mutable is a question of d

Re: Python as Guido Intended

2005-11-28 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: > Op 2005-11-25, Mike Meyer schreef <[EMAIL PROTECTED]>: >> Antoon Pardon <[EMAIL PROTECTED]> writes: >>> Well this is, is one thing I have a problem with. >>> The python people seem to be more concerned with fighting things >>> that could be used counter t

Re: Death to tuples!

2005-11-28 Thread Paddy
I would consider t = ([1,2], [3,4]) to be assigning a tuple with two list elements to t. The inner lists will be mutable but I did not know you could change the outer tuple and still have the same tuple object. - Pad. -- http://mail.python.org/mailman/listinfo/python-list

Re: Death to tuples!

2005-11-28 Thread Aahz
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: >[EMAIL PROTECTED] writes: >> >> For those of us not following this thread closely, can you identify >> cases where tuples are mutable, not hashable or can't be used as >> dictionary keys? I've never encountered any such

Re: FTP over TLS

2005-11-28 Thread Paul Rubin
"adam" <[EMAIL PROTECTED]> writes: > I'm not 100% sure whether this answers your problem, but I would ignore > getting a special TLS module and just concentrate on the ftp side of > the protocol. If your connection to your ftp server must be in TLS, you > could modify you socket module similar to h

Re: PYTHONDOCS on OSX

2005-11-28 Thread Dave Opstad
In article <[EMAIL PROTECTED]>, "Robert Hicks" <[EMAIL PROTECTED]> wrote: > How do I set this variable in my .bash_profile? I have the html docs in > /usr/local/PythonDocs. I have a line in my .profile like this: export PYTHONDOCS='/Users/opstad/Documents/Developer Docs/Python-Docs-2.4.1' So

Re: Death to tuples!

2005-11-28 Thread Paul Rubin
[EMAIL PROTECTED] writes: > For those of us not following this thread closely, can you identify cases > where tuples are mutable, not hashable or can't be used as dictionary keys? > I've never encountered any such cases. t = ([1,2], [3,4]) -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython Licence vs GPL

2005-11-28 Thread Paul Rubin
Paul Rubin writes: > With the GPL, you get a slight restriction from the GPL author (you're > not allowed to redistribute the binary unless you offer source). Forgot to add: and under the GPL, you must not threaten to have the goverment clobber people for redistributing

Re: wxPython Licence vs GPL

2005-11-28 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > If you want me to agree that the GPL puts more conditions on distribution > than the MIT/BSD licence, then I'll happily agree. If you want me to > describe that as a "restrictive licence", then I refuse. With the GPL, you get a slight restriction from

Re: Death to tuples!

2005-11-28 Thread skip
Mike> Tuples have the problem that they are immutable, except when Mike> they're not (or for proper values of immutable, your Mike> choice). They're hashable, except when they're not. Or Mike> equivalently, they can be used as dictionary keys - or set Mike> elements - except wh

Long integer arrays in Python; how? /Carl

2005-11-28 Thread Carl
I have the following problem import Numeric dim = 1 bits = 32 v = Numeric.zeros((dim, bits), 'l') for j in range(bits): v[0][j] = 1L << bits - j - 1 The problem is the last assignment, which is not valid, since the integer is on the right hand side is to large to be a

Re: [pyparsing] How to get arbitrary text surrounded by keywords?

2005-11-28 Thread Paul McGuire
"Inyeol Lee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm trying to extract module contents from Verilog, which has the form > of; > > module foo (port1, port2, ... ); > > // module contents to extract here. > ... > > endmodule > > To extract the module

Re: importing a method

2005-11-28 Thread Flavio
> If you have a function f and want to make an instancemethod out of it, > you can simply call f.__get__(theinstance, theclass) and that will build > and return the new instancemethod you require. I think that f.show = MethodType(show,f) is less cryptic than f.__get__(instance, class) Flávio

Re: importing a method

2005-11-28 Thread Flavio
> First of all,why do you think the new module is deprecated? (I can't > find anything in the docs to indicate this.) Its in the docs of python 2.4. I dont know about older versions: Help on module new: NAME new - Create new objects of various types. Deprecated. FILE /usr/lib/python2.

Re: Death to tuples!

2005-11-28 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> It seems that the distinction between tuples and lists has slowly been >> fading away. What we call "tuple unpacking" works fine with lists on >> either side of the assignment, and iterators on the values side. IIRC, >> "apply" used to

Re: pcm format to wav...

2005-11-28 Thread GIan Mario Tagliaretti
On Mon, 28 Nov 2005 18:15:25 +0100, [EMAIL PROTECTED] wrote: > I have WinXP. Bad for you :) > I want to convert my PySonic recorded (raw) pcm format files to wav > files. How can I do it ? You can use -> http://www.pymedia.org/ cheers -- Tagliaretti Gian Mario PyGTK GUI programming http://www

Re: Death to tuples!

2005-11-28 Thread Mike Meyer
Steven Bethard <[EMAIL PROTECTED]> writes: > Dan Bishop wrote: >> Mike Meyer wrote: >> >>>Is there any place in the language that still requires tuples instead >>>of sequences, except for use as dictionary keys? >> The % operator for strings. And in argument lists. >> def __setitem__(self, (row, c

Re: How to stop a linux process

2005-11-28 Thread Glen
Simon Brunning wrote: > The subprocess module might be worth a look. That looks about right for what I need (once I understand it!). Thanks very much. -- http://mail.python.org/mailman/listinfo/python-list

Re: New Ordered Dictionery to Criticise

2005-11-28 Thread Martin v. Löwis
Fuzzyman wrote: > Criticism solicited (honestly) :-) A couple of minor points: - I would drop 2.2 compatibility - self=self isn't needed in the functions, because of nested scopes - popitem(self) can be rewritten as def popitem(self): try: key = self._sequence.pop()

Re: FTP over TLS

2005-11-28 Thread adam
I'm not 100% sure whether this answers your problem, but I would ignore getting a special TLS module and just concentrate on the ftp side of the protocol. If your connection to your ftp server must be in TLS, you could modify you socket module similar to how I have using this diff (against 2.3.4) a

Re: How to stop a linux process

2005-11-28 Thread Simon Brunning
On 11/28/05, Glen <[EMAIL PROTECTED]> wrote: > When I used the following line to play a midi file in linux, > > return_value = os.system('timidity test.mid') > > I have encountered two problems. > 1. The python script halts until timidity has finished. > 2. If I had control of the script, I can't t

Re: Which License Should I Use?

2005-11-28 Thread Rocco Moretti
mojosam wrote: > I've been watching the flame war about licenses with some interest. > There are many motivations for those who participate in this sector, so > disagreements over licenses reflect those agendas. One point that frequently gets ignored in licensing debates: The value of a license i

How to stop a linux process

2005-11-28 Thread Glen
When I used the following line to play a midi file in linux, return_value = os.system('timidity test.mid') I have encountered two problems. 1. The python script halts until timidity has finished. 2. If I had control of the script, I can't think how I would stop timidity. Any advice on the 'area'

Re: How to write an API for a Python application?

2005-11-28 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: . . . >Note also that you can freely download all of the code in my book as >http://examples.oreilly.com/pythonian/pythonian-examples.zip (it's just >36 K

Re: Which License Should I Use?

2005-11-28 Thread Steve Holden
Steven D'Aprano wrote: > On Fri, 25 Nov 2005 11:30:46 -0800, mojosam wrote: > > >>I guess I don't care too much about how other people use it. > > > Then probably the best licence to use is just to follow the lead of > Python. For that sort of small program of limited value, I put something > l

After migrating from debian to ubuntu, tkinter "hello world" doesn't work

2005-11-28 Thread mortuno
Hi My tkinter apps worked fine in debian linux (woody and sarge) I moved to ubuntu 5.10 I follow the 'hello world' test as seen in http://wiki.python.org/moin/TkInter import _tkinter # with underscore, and lowercase 't' import Tkinter # no underscore, uppercase 'T' Tkinter._test() # note unders

[pyparsing] How to get arbitrary text surrounded by keywords?

2005-11-28 Thread Inyeol Lee
I'm trying to extract module contents from Verilog, which has the form of; module foo (port1, port2, ... ); // module contents to extract here. ... endmodule To extract the module contents, I'm planning to do something like; from pyparsing import * ident = Word(alphas+

Re: Which License Should I Use?

2005-11-28 Thread Rocco Moretti
Steven D'Aprano wrote: > On Fri, 25 Nov 2005 11:30:46 -0800, mojosam wrote: > >>I guess I don't care too much about how other people use it. > > Then probably the best licence to use is just to follow the lead of > Python. For that sort of small program of limited value, I put something > like th

Re: Death to tuples!

2005-11-28 Thread Aahz
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: > >Is there any place in the language that still requires tuples instead >of sequences, except for use as dictionary keys? > >If not, then it's not clear that tuples as a distinct data type >still serves a purpose in the languag

Re: exception KeyboardInterrupt and os.system command

2005-11-28 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "malv" <[EMAIL PROTECTED]> wrote: > That's also kind of what I expected. > However, I quickly tried: > import os > while 1: > y = os.system("sleep 1") > z = (y >> 8) & 0xFF > print z > > I never get anything in return but 0, hitting c-C or not. > I h

Re: Writing pins to the RS232

2005-11-28 Thread Philippe C. Martin
Hi, Some of it should be doable on windows: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcecoreos5/html/wce50lrfescapecommfunction.asp Yet this might require a new wrapper module for I am not sure what the current interface lets you do. Not sure about Linux. Regards; Phili

Re: General question about Python design goals

2005-11-28 Thread Aahz
In article <[EMAIL PROTECTED]>, Sebastien Douche <[EMAIL PROTECTED]> wrote: > >I use this thread to asking on python conception : why python have so >many builtins ? >I cannot understand why we use a builtins for open a file. Is it a old >decision ? If anyone have a pointer of this or can explain

Re: best cumulative sum

2005-11-28 Thread David Isaac
"Peter Otten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > sufficiently similar I think I understand your points now. But I wanted to match these cases: >>> import operator >>> reduce(operator.add,[],42) 42 >>> reduce(operator.add,[1],42) 43 The idea is that the i-th yield of i

build_opener()

2005-11-28 Thread Steve Young
Hello, I had a question about urllib2's build_opener() statement. I am trying to just get the html from any webpage as a string but I need everything on the page to be the same as what it'd be if I would browse to that page (and at the very least, all the href's). This is my code: url = ''

  1   2   >