Re: dictionary of dictionaries

2007-12-10 Thread kettle
On Dec 10, 6:58 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > kettle wrote: > > On Dec 9, 5:49 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > >> On Sun, 09 Dec 2007 00:35:18 -0800, kettle wrote: > >> > Hi, > >> > I'm wondering what the best practice is for creating an extensible > >> > d

Re: dictionary of dictionaries

2007-12-10 Thread kettle
On Dec 10, 6:58 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > kettle wrote: > > On Dec 9, 5:49 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > >> On Sun, 09 Dec 2007 00:35:18 -0800, kettle wrote: > >> > Hi, > >> > I'm wondering what the best practice is for creating an extensible > >> > d

Re: Serializing Python compiled code.

2007-12-10 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >In a C++ application having a Python interpreter embedded, is it >possible to compile a small Python snippet into object code and >serialize the compiled object code to, for example, a database? I am >exploring the possibility of writing a data driven application, where

Re: Is a "real" C-Python possible?

2007-12-10 Thread Kay Schluehr
> We obviously need more effort to make Python more efficient for CPU > bound tasks. Particularly JIT compilation like Java, compilation like > Lisp or data specialization like Psyco. Given that the Python core team has been mostly silent about JIT compilation and Armin Rigos work in particular wh

Re: Help needed with python unicode cgi-bin script

2007-12-10 Thread Jack
Just want to make sure, how exactly are you doing that? > Thanks for the reply, Jack. I tried setting mode to binary but it had no > affect. -- http://mail.python.org/mailman/listinfo/python-list

Web page from hell breaks BeautifulSoup, almost

2007-12-10 Thread John Nagle
This web page: http://azultralights.com/ulclass.html parses OK with BeautifulSoup, but "prettify" will hit the recursion limit if you try to display it. I raised the recursion limit to a large number, and it was converted to 5MB of text successfully, in about a minute. The page has real problem

Re: Best way to protect my new commercial software.

2007-12-10 Thread Ravi Kumar
> > 1. Put all the compiled Python bytecode in a heavily encrypted binary > file. Consider using a hardware hash in the key. > > 2. Program a small binary executable (.exe file) in C or C++ that: > > 2a. Reads the binary file. > > 2b. Decrypts it to conventional Python byte code. > > 2c. Embe

Re: newbie

2007-12-10 Thread Rick Dooling
On Dec 10, 8:03 pm, "Whizzer" <[EMAIL PROTECTED]> wrote: > Is OReilly's Learning Python a good place to start learning to program? > I've been told Python is a good first language. > > Thanks for the advice. If you already have Python installed,just go to the bottom of this article and check the v

Re: Job Offer: Python Ninja or Pirate!

2007-12-10 Thread Stargaming
On Mon, 10 Dec 2007 19:27:43 -0800, George Sakkis wrote: > On Dec 10, 2:11 pm, Stargaming <[EMAIL PROTECTED]> wrote: >> On Mon, 10 Dec 2007 16:10:16 +0200, Nikos Vergas wrote: >> >> [snip] >> >> >> Problem: In the dynamic language of your choice, write a short >> >> program that will: >> >> 1. de

Re: Any way to program custom syntax to python prompt? >> I want to edit matrices.

2007-12-10 Thread Stargaming
On Mon, 10 Dec 2007 16:54:08 -0800, mosi wrote: > Python matrices are usually defined with numpy scipy array or similar. > e.g. matrix1 = [[1, 2], [3, 4], [5, 6]] > I would like to have easier way of defining matrices, for example: matrix = [1, 2; 3, 4; 5, 6] > matrix = > [ 1, 2; >

Re: Job Offer: Python Ninja or Pirate!

2007-12-10 Thread George Sakkis
On Dec 10, 2:11 pm, Stargaming <[EMAIL PROTECTED]> wrote: > On Mon, 10 Dec 2007 16:10:16 +0200, Nikos Vergas wrote: > > [snip] > > >> Problem: In the dynamic language of your choice, write a short program > >> that will: > >> 1. define a list of the following user ids 42346, 77290, 729 (you can >

Re: newbie

2007-12-10 Thread farsheed
On Dec 11, 5:03 am, "Whizzer" <[EMAIL PROTECTED]> wrote: > Is OReilly's Learning Python a good place to start learning to program? > I've been told Python is a good first language. > > Thanks for the advice. I learn it from python own tutorials comes with it's installation. It is so important that

need the unsigned value from dl.call()

2007-12-10 Thread eliss
I'm using dl.call() to call a C function in an external library. It's working great so far except for one function, which returns an unsigned int in the C version. However, in python it returns a signed value to me. How can I get the unsigned value from this? I haven't brushed up on my two's comple

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Jeremy C B Nicoll
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Jeremy C B Nicoll a écrit : > > Figuring out how IDLE works is a bit beyond me at this stage. > > Did you try out, or is it just an a priori ? Sort of, no and yes... A few weeks ago I started trying to use Python & IDLE and found a bug (which I

Re: newbie

2007-12-10 Thread Joe Riopel
On Dec 10, 2007 9:03 PM, Whizzer <[EMAIL PROTECTED]> wrote: > Is OReilly's Learning Python a good place to start learning to program? > I've been told Python is a good first language. I think this is a great place to start, there is a free version right there online. http://diveintopython.org/ --

newbie

2007-12-10 Thread Whizzer
Is OReilly's Learning Python a good place to start learning to program? I've been told Python is a good first language. Thanks for the advice. -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI development with 3D view

2007-12-10 Thread gsal
If all you need to do is display a bunch of arrows, as you mention, the easiest thing to do might be to use Visual Python. It is extremely easy to use. gsal -- http://mail.python.org/mailman/listinfo/python-list

xpath and current python xml libraries

2007-12-10 Thread sndive
PyXML seems to be long gone. Is lxml the way to go if i want to have xpath supported? -- http://mail.python.org/mailman/listinfo/python-list

Re: Any way to program custom syntax to python prompt? >> I want to edit matrices.

2007-12-10 Thread sturlamolden
On 11 Des, 01:54, mosi <[EMAIL PROTECTED]> wrote: > Python matrices are usually defined with numpy scipy array or similar. > e.g.>>> matrix1 = [[1, 2], [3, 4], [5, 6]] That is a list of Python lists, not a NumPy array or matrix. > For example:>>> matrix + 2 > > [ 3, 4; > 5, 6; > 7, 8;] > >

Re: Best way to protect my new commercial software.

2007-12-10 Thread Tim Chase
greg wrote: > Tim Chase wrote: >> -Write Lovecraftian code ("import goto" comes to mind) designed >> to make reverse-engineers go insane trying to figure out what you >> were thinking > > The problem with that is it makes it hard for *you* to > figure out what you were thinking... Psst...other th

Any way to program custom syntax to python prompt? >> I want to edit matrices.

2007-12-10 Thread mosi
Python matrices are usually defined with numpy scipy array or similar. e.g. >>> matrix1 = [[1, 2], [3, 4], [5, 6]] I would like to have easier way of defining matrices, for example: >>> matrix = [1, 2; 3, 4; 5, 6] >>> matrix = [ 1, 2; 3, 4; 5, 6;] Any ideas how could this be done? The ";" sig

Re: Best way to protect my new commercial software.

2007-12-10 Thread sturlamolden
On 10 Des, 08:15, farsheed <[EMAIL PROTECTED]> wrote: > I wrote a software and I want to protect it so can not be cracked > easily. I wrote it in python and compile it using py2exe. what is the > best way in your opinion? I wrote this in another thread, 1. Put all the compiled Python bytecode in

Re: reading cookies from PHP

2007-12-10 Thread Joshua Kugler
Jack Holt wrote: > Hello there. > I'm a PHP fan but a Python newbie. I wrote anapplication in Python > that needs to read a cookie setup from a PHP page. Is itpossible to do it? > > If not, what if I create a TXT file - as well as a cookie - thatcontains > the cookie's data? Will python be able to

Re: Best way to protect my new commercial software.

2007-12-10 Thread greg
Tim Chase wrote: > -Write Lovecraftian code ("import goto" comes to mind) designed > to make reverse-engineers go insane trying to figure out what you > were thinking The problem with that is it makes it hard for *you* to figure out what you were thinking... -- Greg -- http://mail.python.org/ma

Re: Best way to protect my new commercial software.

2007-12-10 Thread greg
Carl Banks wrote: > From the OP's post, it seemed likely to me that the OP was asked by a > misguided management to make sure it was "reverse-engineer-proof". In that case, just package it with py2exe and tell him it's done. The misguided management won't know any better. -- Greg -- http://mail.

Re: Best way to protect my new commercial software.

2007-12-10 Thread greg
farsheed wrote: > It is some kind of in house tool and I want to copy protect it. this > is very complicated tool and not useful for > many people. So there will be very few people with any incentive to steal it, and even less if it's not distributed to the public. -- Greg -- http://mail.python.

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Matimus
> python -c "import py_compile; py_compile.compile(r'FILENAME')" > > ... where FILENAME is the filename of the python script you want to check. > > What this does in practice is (trying to) compile the source, and any > errors or warnings will be reported. better written: python -mpy_compile FIL

Re: GUI development with 3D view

2007-12-10 Thread sturlamolden
On 10 Des, 13:33, Achim Domma <[EMAIL PROTECTED]> wrote: > I'm looking for quite some time now for a gui library for python, > which allows me to display 3D graphics. Main OS is windows, Mac OS X > and Linux would be nice to have. I want to use python 2.5. My first > try was wx + pyOpenGL but ther

reading cookies from PHP

2007-12-10 Thread Jack Holt
Hello there. I’m a PHP fan but a Python newbie. I wrote anapplication in Python that needs to read a cookie setup from a PHP page. Is itpossible to do it? If not, what if I create a TXT file - as well as a cookie - thatcontains the cookie’s data? Will python be able to open the file and

Re: Help needed with python unicode cgi-bin script

2007-12-10 Thread John Machin
On Dec 11, 9:55 am, "weheh" <[EMAIL PROTECTED]> wrote: > Hi Martin, thanks for your response. My updates are interleaved with your > response below: > > > What is the encoding of that file? Without a correct answer to that > > question, you will not be able to achieve what you want. > > I don't kno

Re: Is a "real" C-Python possible?

2007-12-10 Thread sturlamolden
On 9 Des, 23:34, Christian Heimes <[EMAIL PROTECTED]> wrote: > >http://antoniocangiano.com/2007/11/28/holy-shmoly-ruby-19-smokes-pyth... > > The Ruby developers are allowed to be proud. They were able to optimize > some aspects of the implementation to get one algorithm about 14 times > faster. Th

Re: Is a "real" C-Python possible?

2007-12-10 Thread sturlamolden
On 10 Des, 23:49, [EMAIL PROTECTED] (Aahz) wrote: > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare (often misattributed to Knuth, who was himself quoting > Hoare) Oh, I was Hoare? Thanks. Anyway, it doesn't change the argument that optimizing in wrong places is

Re: Is a "real" C-Python possible?

2007-12-10 Thread sturlamolden
On 10 Des, 23:54, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Or a lack of time and money. Lisp is one of the older programming > languages around, and at a time had BigBucks(tm) invested on it to try > and make it practically usable. Yes. But strangely enough, the two Lisp implementations t

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Bruno Desthuilliers
Jeremy C B Nicoll a écrit : > Simon Forman <[EMAIL PROTECTED]> wrote: > > >>On Dec 8, 6:45 pm, Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: > > >>>Ah, I've been using IDLE so far (but would probably prefer to write >>>Python in my normal text editor). In IDLE Alt-X syntax checks the saved >>>c

RE: Equivalent of perl's Pod::Usage?

2007-12-10 Thread Ryan Ginstrom
> On Behalf Of Nick Craig-Wood > As for Pod::Usage - write the instructions for your script as > a docstring at the top of your file, then use this little function... > > def usage(error): > """ > Print the usage, an error message, then exit with an error > """ > print >>sys.stder

Re: Are Python deques linked lists?

2007-12-10 Thread Raymond Hettinger
> > 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? > > The deque is implemented as a list of arrays. See 5.12.1 Recipes > for t

Re: Help needed with python unicode cgi-bin script

2007-12-10 Thread weheh
Hi Martin, thanks for your response. My updates are interleaved with your response below: > What is the encoding of that file? Without a correct answer to that > question, you will not be able to achieve what you want. I don't know for sure the encoding of the file. I'm assuming it has no intrin

Re: Is a "real" C-Python possible?

2007-12-10 Thread Bruno Desthuilliers
sturlamolden a écrit : > On 9 Des, 23:34, Christian Heimes <[EMAIL PROTECTED]> wrote: > > >>Nevertheless it is just one algorithm that beats Python in an area that >>is well known to be slow. Python's numbers are several factors slower >>than C code because the overhead of the dynamic language th

Re: Help needed with python unicode cgi-bin script

2007-12-10 Thread weheh
Thanks for the reply, Jack. I tried setting mode to binary but it had no affect. "Jack" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You probably need to set stdout mode to binary. They are not by default on > Windows. > > > "weheh" <[EMAIL PROTECTED]> wrote in message > news:

Re: J in the Q

2007-12-10 Thread Bruno Desthuilliers
Wayne Brehaut a écrit : > On Mon, 10 Dec 2007 21:41:56 +0100, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > > >>Wayne Brehaut a écrit : >>(snip spam) >> >>>Obvious, since God is One, and so He divides 1, and 0, and -1, and all >>>integers both positive and negative (Peace Be Upon Them). >>>

Re: Is a "real" C-Python possible?

2007-12-10 Thread Aahz
In article <[EMAIL PROTECTED]>, sturlamolden <[EMAIL PROTECTED]> wrote: > >Donald Knuth, one of the fathers of modern computer science, is famous >for stating that "premature optimization is the root of all evil in >computer science." >From my .sig database: "Premature optimization is the root

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Jeremy C B Nicoll
Simon Forman <[EMAIL PROTECTED]> wrote: > On Dec 8, 6:45 pm, Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: > > Ah, I've been using IDLE so far (but would probably prefer to write > > Python in my normal text editor). In IDLE Alt-X syntax checks the saved > > copy of the file being edited (at leas

Re: Is a "real" C-Python possible?

2007-12-10 Thread Bruno Desthuilliers
Jack a écrit : > Aahz a écrit >> >>Could you provide some evidence that Python is slower than Java or PHP? > > > I think most Java-Python benchmarks you can find online will indicate > that Java is a 3-10 times faster. A few here: > http://mail.python.org/pipermail/python-list/2002-January/12578

Re: Is a "real" C-Python possible?

2007-12-10 Thread sturlamolden
On 9 Des, 23:34, Christian Heimes <[EMAIL PROTECTED]> wrote: > Nevertheless it is just one algorithm that beats Python in an area that > is well known to be slow. Python's numbers are several factors slower > than C code because the overhead of the dynamic language throws lots of > data out of the

ANN: pyparsing 1.4.10 released!

2007-12-10 Thread Paul McGuire
I'm happy to announce that I have just uploaded the latest release (v1.4.10) of pyparsing. I had to quick turnaround this release because a bug I thought I had fixed in 1.4.9 still persisted. I now have unit tests to catch the problematic variations in the operatorPrecedence method. This release

Re: Is a "real" C-Python possible?

2007-12-10 Thread sturlamolden
On 9 Des, 22:14, "Jack" <[EMAIL PROTECTED]> wrote: > I understand that the standard Python distribution is considered > the C-Python. Howerver, the current C-Python is really a combination > of C and Python implementation. There are about 2000 Python files > included in the Windows version of Pyth

Source formatting fixer?

2007-12-10 Thread Bret
Does anyone know of a package that can be used to "fix" bad formatting in Python code? I don't mean actual errors, just instances where someone did things that violate the style guide and render the code harder to read. If nothing exists, I'll start working on some sed scripts or something to add

Re: Is a "real" C-Python possible?

2007-12-10 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) > I'd like to provide some evidence that Python is *faster* than Java. Then benchmark the time taken for the interpreter (oops, sorry: "VM") to start !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Is a "real" C-Python possible?

2007-12-10 Thread Bruno Desthuilliers
Jack a écrit : >>>I'm not sure >>>how much of the C-Python is implemented in C but I think the more >>>modules implemented in C, the better performance and lower memory >>>footprint it will get. >> >>Prove it. ;-) > > > I guess this is subjective :) If yes, benchmarks are not an argument. Else,

Re: J in the Q

2007-12-10 Thread Wayne Brehaut
On Mon, 10 Dec 2007 21:41:56 +0100, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >Wayne Brehaut a écrit : >(snip spam) >> Obvious, since God is One, and so He divides 1, and 0, and -1, and all >> integers both positive and negative (Peace Be Upon Them). >> >> wwwayne > > >wwwayne, > >My isp di

Re: Ruby's Template Engine for Python

2007-12-10 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > On Dec 8, 3:24 pm, Samuel <[EMAIL PROTECTED]> wrote: > >>On Sat, 08 Dec 2007 13:06:15 -0800, Steve Howell wrote: >> >>>This is what I came up with: >> >>>http://pylonshq.com/pastetags/form_remote_tag >> >>I see that Pylons uses a standard templating systems with all t

Re: JESUS in the QURAN

2007-12-10 Thread Bruno Desthuilliers
Wayne Brehaut a écrit : (snip spam) > Obvious, since God is One, and so He divides 1, and 0, and -1, and all > integers both positive and negative (Peace Be Upon Them). > > wwwayne wwwayne, My isp did a good job at filtering out that spam. In fact, if it wasn't for your answer, I wouldn't eve

Re: logging.py: mutiple system users writing to same file getting permission errors.

2007-12-10 Thread evenrik
On Dec 7, 12:46 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > On Dec 6, 6:35 pm, evenrik <[EMAIL PROTECTED]> wrote: > > > An a redhat box I have root, apache and other normal users run code > > that uses theloggingmodule to write to the same log file. Since > > umasks are set to 2 or 022 this gets

Re: JESUS in the QURAN

2007-12-10 Thread Wayne Brehaut
On Mon, 10 Dec 2007 11:20:49 -0800 (PST), aassime abdellatif <[EMAIL PROTECTED]> wrote: > 'And they devised, and God >devised, and God devised, and God is the best of divisors. Obvious, since God is One, and so He divides 1, and 0, and -1, and all integers both positive and negative (Peace Be Up

Re: Job Offer: Python Ninja or Pirate!

2007-12-10 Thread kromakey
On 10 Dec, 19:11, Stargaming <[EMAIL PROTECTED]> wrote: > On Mon, 10 Dec 2007 16:10:16 +0200, Nikos Vergas wrote: > > [snip] > > >> Problem: In the dynamic language of your choice, write a short program > >> that will: > >> 1. define a list of the following user ids 42346, 77290, 729 (you can > >>

Re: Best way to protect my new commercial software.

2007-12-10 Thread Grant Edwards
On 2007-12-10, Chris Mellon <[EMAIL PROTECTED]> wrote: > On Dec 10, 2007 5:56 AM, Carl Banks <[EMAIL PROTECTED]> wrote: >> On Dec 10, 6:26 am, Tim Chase <[EMAIL PROTECTED]> wrote: >> > > So you say there is not any trusted way? >> > >> > You cannot distribute any program with the expectation that i

Re: I'm missing something here with range vs. xrange

2007-12-10 Thread John Machin
On Dec 11, 3:55 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: [snip] > No. What range does is create and return a list of integers. The > iteration is a separate step, and is traditional list iteration. In > longhand, for x in range(y): looks something like this: > > range = [] > #this loop happens

module level subclassing

2007-12-10 Thread km
Hi all, Is there a way to access the classes defined in the __init__.py into the modules files in the directory? for example say i have a module (dir) M with contents __init__.py and a.pyand b.py a.py and b.py would like to subclass/instantiate a class defined in __init__.py how's that possibl

Re: searching a value of a dict (each value is a list)

2007-12-10 Thread bearophileHUGS
Seongsu Lee: >I have a dictionary with million keys. Each value in the dictionary has a list >with up to thousand integers.< Let's say each integer can be represented with 32 bits (if there are less numbers then a 3-byte representation may suffice, but this makes things more complex), that is 2^2

Re: Python Exponent Question

2007-12-10 Thread Robert Kern
databyss wrote: > I have a simple program and the output isn't what I expect. Could > somebody please explain why? > > Here's the code: > > #simple program > print "v = 2" > v = 2 > print "v**v = 2**2 =", v**v > print "v**v**v = 2**2**2 =", v**v**v > print "v**v**v**v = 2**2**2**2 =", v**v**v**v

JESUS in the QURAN

2007-12-10 Thread aassime abdellatif
JESUS in the QURAN The Islamic view of Jesus lies between two extremes. The Jews , who rejected Jesus as a Prophet of God, called him an impostor. The Christians, on the other hand, considered him to be the son of God and worship him as such. Islam considers Jesus to be one of the great prophets

Re: abusing exceptions for continuations

2007-12-10 Thread Paul McGuire
On Dec 10, 2:39 am, gangesmaster <[EMAIL PROTECTED]> wrote: > i've had this strange idea of using the exception's traceback (which > holds the stack frame) to enable functional continuations, meaning, > raise some special exception which will be caught by a reactor/ > scheduler/framework, which cou

Re: Dumb newbie back in shell

2007-12-10 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Not trying to write C, I meant "trying to use Python like it was C" - but I guess it doesn't matter that much !-) > I'm trying to write Decaf, a language I've > designed (see www.MartinRinehart.com for more) but which doesn't > exist. Got to code the first bit in s

Re: Job Offer: Python Ninja or Pirate!

2007-12-10 Thread Stargaming
On Mon, 10 Dec 2007 16:10:16 +0200, Nikos Vergas wrote: [snip] >> Problem: In the dynamic language of your choice, write a short program >> that will: >> 1. define a list of the following user ids 42346, 77290, 729 (you can >> hardcode these, but it should >> still work with more or less ids) >>

Re: Converting Excel time-format (hours since 1.1.1901)

2007-12-10 Thread [EMAIL PROTECTED]
On Dec 10, 3:49 am, Dirk Hagemann <[EMAIL PROTECTED]> wrote: > On 9 Dez., 18:38, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > > > On Dec 9, 8:52�am, Dirk Hagemann <[EMAIL PROTECTED]> wrote: > > > > On 7 Dez., 22:36, John Machin <[EMAIL PROTECTED]> wrote: > > > > > On Dec 8, 12:20 am, Di

Re: abusing exceptions for continuations

2007-12-10 Thread Bruno Desthuilliers
gangesmaster a écrit : > i've had this strange idea of using the exception's traceback (which > holds the stack frame) to enable functional continuations, meaning, > raise some special exception which will be caught by a reactor/ > scheduler/framework, which could later revive it by restoring the >

Re: Job Offer: Python Ninja or Pirate!

2007-12-10 Thread Sergio Correia
> import sys, xml, urllib > > dummy = [sys.stdout.write(city + ': ' + str(num) + '\n') for city, num in > set([[(a, o.count(a)) for a in p] for o, p in [2*tuple([[city for city in > ((xml.dom.minidom.parseString(urllib.urlopen(' > http://api.etsy.com/feeds/xml_user_details.php?id=' > + str(id)).rea

Re: Distinguishing attributes and methods

2007-12-10 Thread Bruno Desthuilliers
Steve Howell a écrit : > --- Jan Claeys <[EMAIL PROTECTED]> wrote: > >>To conclude this discussion: >> >> * in Python, methods are attributes >> * in Ruby, attributes are methods >> > > > So clearly one of the languages has it all wrong. ;) > Nope, quite on the contrary, both got it right !-)

Re: Distinguishing attributes and methods

2007-12-10 Thread Bruno Desthuilliers
Jan Claeys a écrit : > Op Sun, 09 Dec 2007 12:44:46 -0800, schreef MonkeeSage: > > >>The point is that just because the attributes are "looked up the same >>way" or whatever, doesn't make them the same *kind* of attribute. To say >>that all attributes are the same in python muddies the water. The

Re: GUI development with 3D view

2007-12-10 Thread M�ta-MCI (MVP)
Re! On Vista, OpenGL depend of (releases of) video-cards. Some cards don't support OpenGL => problem! Some cards have native openGL support => good (dream?) Some cards need update (drivers) @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: SimpleXMLRPCServer interruptable?

2007-12-10 Thread Bret
On Dec 6, 7:43 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 06 Dec 2007 13:11:09 -0300, Bret <[EMAIL PROTECTED]> escribió: > > > > > For completeness, what I ended up doing is this: > > > server = SimpleXMLRPCServer((host, port)) > > server.socket.settimeout(0.1) > > > Serve

Re: Are Python deques linked lists?

2007-12-10 Thread Neil Cerutti
On 2007-12-10, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-12-10, Peter Otten <[EMAIL PROTECTED]> wrote: >> Neil Cerutti wrote: def test(): ll = LinkedList([random.randint(1,1000) for i in range(10)]) for el in ll: if el.value%2==0: ll

Re: Are Python deques linked lists?

2007-12-10 Thread Neil Cerutti
On 2007-12-10, Peter Otten <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >>> def test(): >>> ll = LinkedList([random.randint(1,1000) for i in range(10)]) >>> >>> for el in ll: >>> if el.value%2==0: >>> ll.delete(el) >>> >>> print [el.value for el in ll] >>> >>> >>

Re: Python Exponent Question

2007-12-10 Thread Christian Heimes
databyss wrote: > I would expect 2**2**2**2 to be 256 I stumbled upon it, too. 2**2**2**2 == 2**(2**(2**2)) == 2**16 == 65536 Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Exponent Question

2007-12-10 Thread Zero Piraeus
: > v = 2 > v**v = 2**2 = 4 > v**v**v = 2**2**2 = 16 > v**v**v**v = 2**2**2**2 = 65536 > > I would expect 2**2**2**2 to be 256 "... in an unparenthesized sequence of power and unary operators, the operators are evaluated from right to left ..." - http://docs.python.org/ref/power.html So, 2**2**

Re: Are Python deques linked lists?

2007-12-10 Thread Duncan Booth
Peter Otten <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: > >> On 2007-12-10, Duncan Booth <[EMAIL PROTECTED]> wrote: > >>> def test(): >>> ll = LinkedList([random.randint(1,1000) for i in range(10)]) >>> >>> for el in ll: >>> if el.value%2==0: >>> ll.delete(el) >>

Re: Python Exponent Question

2007-12-10 Thread Tim Chase
databyss wrote: > I have a simple program and the output isn't what I expect. Could > somebody please explain why? > > Here's the code: > > #simple program > print "v = 2" > v = 2 > print "v**v = 2**2 =", v**v > print "v**v**v = 2**2**2 =", v**v**v > print "v**v**v**v = 2**2**2**2 =", v**v**v**v

Re: Dumb newbie back in shell

2007-12-10 Thread MartinRinehart
Peter, question is, why did the first one work? In my real code I've got module-level vars and an error msg trying to use them in a function. In my test example I've got them accessed from within a function w/o error message. I am confused. Martin Peter Otten wrote: > MartinRinehart wrote: > >

Re: Python Exponent Question

2007-12-10 Thread Carsten Haese
On Mon, 2007-12-10 at 10:15 -0800, databyss wrote: > I have a simple program and the output isn't what I expect. Could > somebody please explain why? > [...] > v**v**v**v = 2**2**2**2 = 65536 > > I would expect 2**2**2**2 to be 256 Exponentiation is right-associative. 2**2**2**2 = 2**(2**(2**2))

Re: Best way to protect my new commercial software.

2007-12-10 Thread Chris Mellon
On Dec 10, 2007 5:56 AM, Carl Banks <[EMAIL PROTECTED]> wrote: > On Dec 10, 6:26 am, Tim Chase <[EMAIL PROTECTED]> wrote: > > > So you say there is not any trusted way? > > > > You cannot distribute any program with the expectation that it > > cannot be reverse engineered. > [snip] > > > >From the

Python Exponent Question

2007-12-10 Thread databyss
I have a simple program and the output isn't what I expect. Could somebody please explain why? Here's the code: #simple program print "v = 2" v = 2 print "v**v = 2**2 =", v**v print "v**v**v = 2**2**2 =", v**v**v print "v**v**v**v = 2**2**2**2 =", v**v**v**v #end program Here's the output: >>>

Re: Dumb newbie back in shell

2007-12-10 Thread MartinRinehart
Not trying to write C, I'm trying to write Decaf, a language I've designed (see www.MartinRinehart.com for more) but which doesn't exist. Got to code the first bit in something. Later I can write Decaf in Decaf. Chose Python as it looked like a faster write (learning curve included) than C or C++.

Re: Is a "real" C-Python possible?

2007-12-10 Thread hdante
On Dec 9, 10:07 pm, "Jack" <[EMAIL PROTECTED]> wrote: > >> I think most Java-Python benchmarks you can find online will indicate > >> that Java is a 3-10 times faster. A few here: > >>http://mail.python.org/pipermail/python-list/2002-January/125789.html > >>http://blog.snaplogic.org/?p=55 > > > The

Re: Equivalent of perl's Pod::Usage?

2007-12-10 Thread Nick Craig-Wood
Adam Funk <[EMAIL PROTECTED]> wrote: > Sorry about that! POD is a mark-up language that Perl's Pod::Usage > module can translate into man pages (and other documentation formats). > > So what I'm really after is an easy way to generate something that > looks like a man page. You might want to

Re: Job Offer: Python Ninja or Pirate!

2007-12-10 Thread Simon Forman
On Dec 10, 6:10 am, "Nikos Vergas" <[EMAIL PROTECTED]> wrote: > > Challenge: > > A valid response will be either a solution to the problem below, or a > > link to some code of which you > > are particularly proud. > > > Problem: In the dynamic language of your choice, write a short program > > that

Re: Dumb newbie back in shell

2007-12-10 Thread Peter Otten
MartinRinehart wrote: > However, here's the little tester I wrote: > > # t.py - testing > > global g > g = 'global var, here' > > def f(): > print g > > f() > > It prints 'global var, here,' not an error message. Wassup? Try it again with a modified f(): def f(): print g g = 42

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Bruno, > > Please explain why the NOP import is a GoodThing. Use small words > please. I'm not as young as I used to be. Each module that need access to another module must explicitely import it. This means that, in a typical program, your main script will import a

Re: Dumb newbie back in shell

2007-12-10 Thread MartinRinehart
Thanks, Marc. However, here's the little tester I wrote: # t.py - testing global g g = 'global var, here' def f(): print g f() It prints 'global var, here,' not an error message. Wassup? Marc 'BlackJack' Rintsch wrote: > On Mon, 10 Dec 2007 08:31:01 -0800, MartinRinehart wrote: > > > But

Re: Are Python deques linked lists?

2007-12-10 Thread Peter Otten
Neil Cerutti wrote: > On 2007-12-10, Duncan Booth <[EMAIL PROTECTED]> wrote: >> def test(): >> ll = LinkedList([random.randint(1,1000) for i in range(10)]) >> >> for el in ll: >> if el.value%2==0: >> ll.delete(el) >> >> print [el.value for el in ll] >> >> >> if __n

Re: Dumb newbie back in shell

2007-12-10 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > OK, it's a scripting language. For which definition of "scripting language" ?-) def g(): > ...os.remove('tokeneizer.pyc') > ...reload( tokeneizer ) > ...tokeneizer.tokenize('sample_decaf.d') > ... > > But that gets me to: > > ... line 110, in get_t

Re: Dumb newbie back in shell

2007-12-10 Thread Marc 'BlackJack' Rintsch
On Mon, 10 Dec 2007 08:31:01 -0800, MartinRinehart wrote: > But that gets me to: > > ... line 110, in get_toks > UnboundLocalError: local variable 'line_ptr' referenced before > assignment > > Here's a bit of the code, with line #s > > ... > 68 global line_ptr > 69 global char_ptr > ... > 75 li

Re: GUI development with 3D view

2007-12-10 Thread Mike C. Fletcher
Diez B. Roggisch wrote: ... > I was under the impression that PyOpenGL is ctypes-based in the new > versions? > It is, but I haven't had the time to do a new release and check it on a Windows box. There are minor fixes in CVS that *should* IIRC make us run better on those Windows machines that

Re: I'm missing something here with range vs. xrange

2007-12-10 Thread Chris Mellon
On Dec 7, 2007 8:58 PM, Joe Goldthwaite <[EMAIL PROTECTED]> wrote: > >You can't imagine why someone might prefer an iterative solution over > >a greedy one? Depending on the conditions, the cost of creating the > >list can be a greater or a lesser part of the total time spent. Actual > >iteration i

Re: detecting disc serial number without win32

2007-12-10 Thread Peter Otten
PiErre wrote: > I have to run a python script on a Linux machine. This script was > developed on a windows workstation and it > uses the win32 library to detect the cd (or dvd) serial number (in the > - format). > How can I change the script to do the same task on linux? > I found an old

SOAPpy server shutting down?

2007-12-10 Thread sberry
I have a soap server I am running on an OS X Server using SOAPpy. To start the server I am running server = SOAPpy.SOAPServer(('IPADDRESS", PORT), namespace=NAMESPACE) server.serve_forever() I am starting the server manually in the background by running from the command line as follows: ./mySOAPS

Dumb newbie back in shell

2007-12-10 Thread MartinRinehart
OK, it's a scripting language. >>> def g(): ...os.remove('tokeneizer.pyc') ...reload( tokeneizer ) ...tokeneizer.tokenize('sample_decaf.d') ... >>> But that gets me to: ... line 110, in get_toks UnboundLocalError: local variable 'line_ptr' referenced before assignment Here's a bit o

Re: Is a "real" C-Python possible?

2007-12-10 Thread Raymond Hettinger
On Dec 9, 1:14 pm, "Jack" <[EMAIL PROTECTED]> wrote: > I wonder if it's possible to have a Python that's completely (or at > least for the most part) implemented in C, just like PHP - I think > this is where PHP gets its performance advantage. Or maybe I'm wrong > because the core modules that matt

Re: Are Python deques linked lists?

2007-12-10 Thread Ant
On Dec 9, 10:54 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Dec 10, 9:43 am, "Just Another Victim of the Ambient Morality" > > <[EMAIL PROTECTED]> wrote: > > I'm looking for a linked list implementation. Something iterable with > > constant time insertion anywhere in the list. > > It's on

Re: a Python person's experience with Ruby

2007-12-10 Thread Chris Mellon
On Dec 9, 2007 5:11 AM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Dec 9, 12:15 am, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > > Richard Jones a écrit : > > > > > > > > > Bruno Desthuilliers wrote: > > > > >>class A(object): > > >> @apply > > >> def a(): > > >> def fget(self):

Re: Error when executing the library reference echo server example

2007-12-10 Thread Jean-Paul Calderone
On Mon, 10 Dec 2007 06:38:57 -0800 (PST), [EMAIL PROTECTED] wrote: > [snip] > >I tried it in Linux and it worked fine so I've been trying different >things as the code seems to be correct. >Finally, I've found that if both server and client are run from IDLE, >the thing crashes with the mentioned e

  1   2   >