Re: Idea for removing the GIL...

2011-02-28 Thread Stefan Behnel
Aahz, 01.03.2011 03:02: Carl Banks wrote: The real reason they never replaced the GIL is that fine-grained locking is expensive with reference counting. The only way the cost of finer-grained locking would be acceptable, then, is if they got rid of the reference counting altogether, and that w

Re: Problems of Symbol Congestion in Computer Languages

2011-02-28 Thread Xah Lee
On Feb 28, 7:30 pm, rusi wrote: > On Feb 28, 11:39 pm, Dotan Cohen wrote: > > > You miss the canonical bad character reuse case: = vs ==. > > > Had there been more meta keys, it might be nice to have a symbol for > > each key on the keyboard. I personally have experimented with putting > > the sy

Re: Problems of Symbol Congestion in Computer Languages

2011-02-28 Thread rusi
On Feb 28, 11:39 pm, Dotan Cohen wrote: > You miss the canonical bad character reuse case: = vs ==. > > Had there been more meta keys, it might be nice to have a symbol for > each key on the keyboard. I personally have experimented with putting > the symbols as regular keys and the numbers as the

Re: Executing js/ajax in a sandboxed environment

2011-02-28 Thread Miki Tebeka
> I was wondering if there is a way to execute js associated in > page in sandbox environment before I start parsing it. You can use http://code.google.com/p/python-spidermonkey/ or http://code.google.com/p/pyv8/ to evaluate JavaScript. You can use any browser (including embedded htmlunit) using

Re: Idea for removing the GIL...

2011-02-28 Thread Aahz
In article , Carl Banks wrote: > >The real reason they never replaced the GIL is that fine-grained >locking is expensive with reference counting. The only way the cost >of finer-grained locking would be acceptable, then, is if they got rid >of the reference counting altogether, and that was cons

Re: Plumber, an alternative to mixin-based subclassing

2011-02-28 Thread Aahz
[posted & e-mailed] In article , Florian Friesdorf wrote: > >An alternative to mixin-based subclassing: > >http://pypi.python.org/pypi/plumber You'll probably get more interest if you provide a summary. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "Programm

Re: OT: Code Examples

2011-02-28 Thread Fred Marshall
On 2/28/2011 8:14 AM, n00m wrote: On Feb 28, 6:03 pm, Fred Marshall wrote: The best place for you to start: http://numpy.scipy.org/ Numpy manual: http://www.tramy.us/numpybook.pdf OK Thanks! Fred -- http://mail.python.org/mailman/listinfo/python-list

Re: move to end, in Python 3.2 Really?

2011-02-28 Thread Gregory Ewing
Raymond Hettinger wrote: The existing list.pop() API is similar (though it takes an index value instead of a boolean): mylist.pop() # default case: pop from last mylist.pop(0) # other case:pop from first pop() is somewhat different, because there

Re: how to properly pass literal strings python code to be executed using python -c

2011-02-28 Thread Steven D'Aprano
On Mon, 28 Feb 2011 10:59:01 -0800, jmoons wrote: > I need some help figuring out how to execute this python code from > python -c > I am have trouble formatting python so that it will execute for another > app in cmd I understand there maybe other ways to do what I am doing but > I am limited by

Re: subclass urllib2

2011-02-28 Thread Alex Willmer
On Feb 28, 6:53 pm, monkeys paw wrote: > I'm trying to subclass urllib2 in order to mask the > version attribute. Here's what i'm using: > > import urllib2 > > class myURL(urllib2): >      def __init__(self): >          urllib2.__init__(self) >          self.version = 'firefox' > > I get this> > T

Re: 3.1 -> 3.2: base64 lost deprecation warning

2011-02-28 Thread Ethan Furman
Terry Reedy wrote: On 2/28/2011 3:51 PM, Ethan Furman wrote: The deprecation warning has gone away in 3.2, No, still there: def encodestring(s): """Legacy alias of encodebytes().""" import warnings warnings.warn("encodestring() is a deprecated alias, use encodebytes()",

Re: 3.1 -> 3.2: base64 lost deprecation warning

2011-02-28 Thread Terry Reedy
On 2/28/2011 3:51 PM, Ethan Furman wrote: Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. --> import base64 --> base64.encodestring(b'this is a test') __main__:1: DeprecationWarning: encod

Re: 3.1 -> 3.2: base64 lost deprecation warning

2011-02-28 Thread Robert
On 2011-02-28 15:51:32 -0500, Ethan Furman said: Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. --> import base64 --> base64.encodestring(b'this is a test') __main__:1: DeprecationWarnin

Re: Problems with read_eager and Telnet

2011-02-28 Thread Terry Reedy
On 2/28/2011 3:46 PM, Robi wrote: unless using it just to get/set configuration, in which case, speed should hardly seem an issue. Right, I'm using it that way, I get/set properties changing them in real time (I whish!). ... My conclusion being, fgfs cannot answer back quicker than this: 20H

Re: SoC project: Python-Haskell bridge - request for feedback

2011-02-28 Thread Pauli Rikula
There is your bridge: http://kks.cabal.fi/HaskellAndPython It's not polished and one might shoot his/her legs off while using that -so be careful. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with read_eager and Telnet

2011-02-28 Thread Robi
> Given that FlightGear is a graphical flight > simulatorhttp://www.flightgear.org/https://secure.wikimedia.org/wikipedia/en/wiki/FlightGear > using a text terminal connection seems a bit odd, > unless using it just to get/set configuration, > in which case, speed should hardly seem an issue. Rig

Re: urlopen returns forbidden

2011-02-28 Thread Chris Rebert
On Mon, Feb 28, 2011 at 9:44 AM, Terry Reedy wrote: > On 2/28/2011 10:21 AM, Grant Edwards wrote: >> As somebody else has already said, if the site provides an API that >> they want you to use you should do so rather than hammering their web >> server with a screen-scraper. > > If there any generi

3.1 -> 3.2: base64 lost deprecation warning

2011-02-28 Thread Ethan Furman
Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. --> import base64 --> base64.encodestring(b'this is a test') __main__:1: DeprecationWarning: encodestring() is a deprecated alias, use enco

Re: Problem with python 3.2 and circular imports

2011-02-28 Thread Rafael Durán Castañeda
I'm stil totally stuck with relative imports, i' ve tried the example tree from PEP 328 without any result: package/ __init__.py subpackage1/ __init__.py moduleX.py moduleY.py subpackage2/ __init__.py moduleZ.py moduleA.py Assuming that the

Re: subclass urllib2

2011-02-28 Thread Santoso Wijaya
1. Why are you subclassing a module? 2. If you want to "mask" a module's version attribute, just do this: >>> import urllib2 >>> urllib2.__version__ = 'foo' >>> print urllib2.__version__ foo ~/santa On Mon, Feb 28, 2011 at 10:53 AM, monkeys paw wrote: > I'm trying to subclass u

how to properly pass literal strings python code to be executed using python -c

2011-02-28 Thread jmoons
I need some help figuring out how to execute this python code from python -c I am have trouble formatting python so that it will execute for another app in cmd I understand there maybe other ways to do what I am doing but I am limited by the final execution using cmd python -c so please keep this i

subclass urllib2

2011-02-28 Thread monkeys paw
I'm trying to subclass urllib2 in order to mask the version attribute. Here's what i'm using: import urllib2 class myURL(urllib2): def __init__(self): urllib2.__init__(self) self.version = 'firefox' I get this> Traceback (most recent call last): File "", line 1, in TypeEr

Re: Problems of Symbol Congestion in Computer Languages

2011-02-28 Thread Dotan Cohen
You miss the canonical bad character reuse case: = vs ==. Had there been more meta keys, it might be nice to have a symbol for each key on the keyboard. I personally have experimented with putting the symbols as regular keys and the numbers as the Shifted versions. It's great for programming. --

Re: Problems with read_eager and Telnet

2011-02-28 Thread Terry Reedy
On 2/28/2011 10:54 AM, Robi wrote: Hi everybody, I'm totally new to Python but well motivated :-) I'm fooling around with Python in order to interface with FlightGear using a telnet connection. Given that FlightGear is a graphical flight simulator http://www.flightgear.org/ https://secure.wi

Re: Lumberjack Song

2011-02-28 Thread MRAB
On 28/02/2011 10:26, Tom Zych wrote: We all like computers here. No doubt many of us like computer games. And most of us will be at least somewhat familiar with Monty Python. Therefore, I present (drum roll)... http://www.youtube.com/watch?v=Zh-zL-rhUuU (For the Runescape fans out there, this s

Re: Problems of Symbol Congestion in Computer Languages

2011-02-28 Thread rusi
On Feb 17, 3:07 am, Xah Lee wrote: > might be interesting. > > 〈Problems of Symbol Congestion in Computer Languages (ASCII Jam; > Unicode; Fortress)〉http://xahlee.org/comp/comp_lang_unicode.html Haskell is slowly moving this way see for example http://www.haskell.org/ghc/docs/latest/html/users_gu

Re: Problems with read_eager and Telnet

2011-02-28 Thread Robi
On 28 Feb, 18:35, Jack Diederich wrote: > On Mon, Feb 28, 2011 at 12:13 PM, Roberto Inzerillo > > wrote: > > Yes. read_eager() will never actually read from the socket, if it has > > >> any data it has already read & processed it will return those.  If you > >> call it enough times it will just s

Re: nntplib encoding problem

2011-02-28 Thread Laurent Duchesne
Hi, Thanks it's working! But is it "normal" for a string coming out of a module (nntplib) to crash when passed to print or write? I'm just asking to know if I should open a bug report or not :) I'm also wondering which strings should be re-encoded using the surrogateescape parameter and whic

Re: urlopen returns forbidden

2011-02-28 Thread Terry Reedy
On 2/28/2011 10:21 AM, Grant Edwards wrote: As somebody else has already said, if the site provides an API that they want you to use you should do so rather than hammering their web server with a screen-scraper. If there any generic method for finding out 'if the site provides an API" and spe

Re: Problems with read_eager and Telnet

2011-02-28 Thread Jack Diederich
On Mon, Feb 28, 2011 at 12:13 PM, Roberto Inzerillo wrote: > Yes. read_eager() will never actually read from the socket, if it has >> >> any data it has already read & processed it will return those.  If you >> call it enough times it will just start returning empty strings >> because it never ask

Re: Problems with read_eager and Telnet

2011-02-28 Thread Robi
Can you point me to a pratical usage example of read_eager()? Maybe that will help me in making all this clear. I'm still very fuzzy about the socket and the processing stuff. I'm still convinced I cannot use read_until() in my project and I'm determined in looking into the read_eager(), maybe tha

Re: Problems with read_eager and Telnet

2011-02-28 Thread Jack Diederich
On Mon, Feb 28, 2011 at 11:50 AM, Robi wrote: >> Telnet sends two kinds of data over the same channel (a simple TCP >> stream).  It sends the bytes you actually see in your terminal and it >> sends control commands that do things like turn echo on/off and >> negotiate what terminal type to use.  E

Re: Problems with read_eager and Telnet

2011-02-28 Thread Robi
> Telnet sends two kinds of data over the same channel (a simple TCP > stream).  It sends the bytes you actually see in your terminal and it > sends control commands that do things like turn echo on/off and > negotiate what terminal type to use.  Each time telnetlib reads from > the socket it puts

Re: question about numpy.polyval

2011-02-28 Thread Robert Kern
On 2/28/11 9:34 AM, sirvival wrote: Hi, I have some simulated data of stellar absorption lines. You will want to ask numpy questions on the numpy mailing list: http://www.scipy.org/Mailing_Lists It would be best if you could make a minimal, self-contained, runnable script that demonstrates

Re: OT: Code Examples

2011-02-28 Thread n00m
On Feb 28, 6:03 pm, Fred Marshall wrote: > I'm interested in developing Python-based programs, including an > engineering app. ... re-writing from Fortran and C versions.  One of the > objectives would to be make reasonable use of the available structure > (objects, etc.).  So, I'd like to read a

Re: Problems with read_eager and Telnet

2011-02-28 Thread Jack Diederich
On Mon, Feb 28, 2011 at 10:54 AM, Robi wrote: > Hi everybody, >  I'm totally new to Python but well motivated :-) > > I'm fooling around with Python in order to interface with FlightGear > using a telnet connection. > > I can do what I had in mind (send some commands and read output from > Flightg

OT: Code Examples

2011-02-28 Thread Fred Marshall
I'm interested in developing Python-based programs, including an engineering app. ... re-writing from Fortran and C versions. One of the objectives would to be make reasonable use of the available structure (objects, etc.). So, I'd like to read a couple of good, simple scientific-oriented pro

Problems with read_eager and Telnet

2011-02-28 Thread Robi
Hi everybody, I'm totally new to Python but well motivated :-) I'm fooling around with Python in order to interface with FlightGear using a telnet connection. I can do what I had in mind (send some commands and read output from Flightgear using the telnetlib) with a read_until() object to catch

question about numpy.polyval

2011-02-28 Thread sirvival
Hi, I have some simulated data of stellar absorption lines. What I am trying to is the following: I divide my data into chunks (each of the same size). Then I let the code find the max y value in one of those chunks. I got this working. Then I put those value in a two column array (first column

Re: urlopen returns forbidden

2011-02-28 Thread Grant Edwards
On 2011-02-28, Chris Rebert wrote: > On Sun, Feb 27, 2011 at 9:38 PM, monkeys paw wrote: >> I have a working urlopen routine which opens >> a url, parses it for tags and prints out >> the links in the page. On some sites, wikipedia for >> instance, i get a >> >> HTTP error 403, forbidden. >> >>

a chance from you.

2011-02-28 Thread marian
You'll like the way I was convinced a girl for winning the new Volvo S60: http://www.unlimitednaughty.ro/camera/video/concurent/Marian-Briceag Give me a chance by sharing this video to everyone on the group. Please, please SHARE it :) . p.s.: for English turn on the captions (the cc, under arrow fr

Re: SocketServer problem: client hangs trying to reconnect after server restart

2011-02-28 Thread Massi
On 28 Feb, 13:34, cmcp wrote: > In method StopServer() of class MyServer try calling  self.server_close() > after the self.shutdown() call.  I believe this will actually close the > server's socket and allow its reuse. It works! Thank you!! -- http://mail.python.org/mailman/listinfo/python-lis

Re: SocketServer problem: client hangs trying to reconnect after server restart

2011-02-28 Thread cmcp
In method StopServer() of class MyServer try calling self.server_close() after the self.shutdown() call. I believe this will actually close the server's socket and allow its reuse. -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding python : can't find encoding error

2011-02-28 Thread Mathieu CLERICI
Precisions : I'm trying to embed python 3.2 release. -- http://mail.python.org/mailman/listinfo/python-list

Embedding python : can't find encoding error

2011-02-28 Thread Mathieu CLERICI
Hi, I'm trying to embed python in a c++ program. I have compiled python32.lib with msvc 2010 targetting 32bits, i link it with my program wich is also 32bit. I get an error when calling Py_Initialize() : "no codec search functions registered: can't find encoding" Py_FileSystemDefaultEncoding val

Re: Various behaviors of doctest

2011-02-28 Thread Peter Otten
Gnarlodious wrote: > Yeah, I just spent about 2 hours trying everything I could think of... > without success. Including your suggestions. Guess I'll have to skip > it. But thanks for the ideas. > > -- Gnarlie Are you using Python 2.x? Then you cannot redefine print. Instead you have to redirec

SocketServer problem: client hangs trying to reconnect after server restart

2011-02-28 Thread Massi
Hi everyone! in my script (Python 2.6 on windows 7) I have to set up a SocketServer server and use it to handle external connections. During the execution It can happen that this server should be closed and restarted (for example with different port or host). The following piece of code simulates

Re: urlopen returns forbidden

2011-02-28 Thread Steven D'Aprano
On Sun, 27 Feb 2011 22:19:18 -0800, Chris Rebert wrote: > On Sun, Feb 27, 2011 at 9:38 PM, monkeys paw > wrote: >> I have a working urlopen routine which opens a url, parses it for >> tags and prints out the links in the page. On some sites, wikipedia for >> instance, i get a >> >> HTTP error 40

Lumberjack Song

2011-02-28 Thread Tom Zych
We all like computers here. No doubt many of us like computer games. And most of us will be at least somewhat familiar with Monty Python. Therefore, I present (drum roll)... http://www.youtube.com/watch?v=Zh-zL-rhUuU (For the Runescape fans out there, this should be quite hilarious. Possibly not

Re: [ANN]VTD-XML 2.10

2011-02-28 Thread Stefan Behnel
pyt...@bdurham.com, 27.02.2011 13:52: How does VTD-XML compare to XML tools in the stdlib or to 3rd party alternatives like lxml? For one, I'm not aware of any Python wrappers for vtd-xml, despite having seen lots of announcements by Jimmy on this list already (not the python-announce list, *