Re: Efficient (HUGE) prime modulus

2007-11-19 Thread Paul Rubin
blaine <[EMAIL PROTECTED]> writes: > As an alternative I > can use Java - but I'd rather have a pure python implementation. A number of people have suggested using 3-argument pow, but if this is supposed to be a learning exercise, I think it's worth figuring out for yourself how 3-argument pow is

Trouble getting loop to break

2007-11-19 Thread Dick Moores
I'm writing a demo of the infinite series x**0/0! + x**1/1! + x**2/2! + x**3/3! + ... = e**x (x is non-negative) It works OK for many x, but for many the loop doesn't break. Is there a way to get it to break where I want it to, i.e., when the sum equals the limit as closely as the precision

Debugging Python across C++

2007-11-19 Thread phani kumar
Hello, I have used python to develop a GUI for an application, the source was written in C++ and i have extended it to python using swig interface. I want to debug this setup. How do I debug python with C++ extensions? I want to step from the python code into the C++ component.

Re: Variable-width lookbehind

2007-11-19 Thread OKB (not okblacke)
Tim Roberts wrote: > "OKB (not okblacke)" <[EMAIL PROTECTED]> wrote: >> >> For years now Python has not supported variable-length >> lookbehinds. >>I'm just curious whether there are any plans to change this in >>Python 3.0, or before, or after. It seems that Perl 6 will allow >

Re: pydoc - how to generate documentation for an entire package?

2007-11-19 Thread [EMAIL PROTECTED]
On Nov 19, 12:50 pm, Jens <[EMAIL PROTECTED]> wrote: > On 8 Nov., 02:46, Jens <[EMAIL PROTECTED]> wrote: > > > I have a project/package for which I want to generate documentation > > usingpydoc. > > > My problem is that when I type "pydoc.py -w MyPackage" it only > > generates documentation for the

Re: pydoc - how to generate documentation for an entire package?

2007-11-19 Thread Marc 'BlackJack' Rintsch
On Mon, 19 Nov 2007 10:50:28 -0800, Jens wrote: > Generating documentation form code is a nice thing, but this pydoc.py > is driving me insane - isn't there are better way? Epydoc!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficient (HUGE) prime modulus

2007-11-19 Thread Tim Roberts
blaine <[EMAIL PROTECTED]> wrote: > > For my Network Security class we are designing a project that will, >among other things, implement a Diffie Hellman secret key exchange. >The rest of the class is doing Java, while myself and a classmate are >using Python (as proof of concept). I am having pr

Re: Tkinter Problem?

2007-11-19 Thread Marc 'BlackJack' Rintsch
On Mon, 19 Nov 2007 18:13:03 -0800, Davy wrote: > ##-- > from Tkinter import * > > class MyApp: > def __init__(self,parent): > self.myContainer1 = Frame(parent) > self.myContainer1.pack() > self.canv = Canvas(relief=SUNKEN) > self.canv.confi

Re: How to add a Decorator to a Class Method

2007-11-19 Thread Marc 'BlackJack' Rintsch
On Mon, 19 Nov 2007 20:59:51 -0800, [EMAIL PROTECTED] wrote: > How do I add a decorator to a class method? Here's what I want to do, > but I guess my syntax isn't right. Any advice? > > class A: > def pre(self,fn): > def new_func(*args,**kwargs): > print 'hi' >

Re: How to add a Decorator to a Class Method

2007-11-19 Thread Arnaud Delobelle
On Nov 20, 4:59 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > How do I add a decorator to a class method? Here's what I want to do, > but I guess my syntax isn't right. Any advice? > > class A: > def pre(self,fn): > def new_func(*args,**kwargs): > print 'hi' >

Re: Variable-width lookbehind

2007-11-19 Thread Tim Roberts
"OKB (not okblacke)" <[EMAIL PROTECTED]> wrote: > > For years now Python has not supported variable-length lookbehinds. >I'm just curious whether there are any plans to change this in Python >3.0, or before, or after. It seems that Perl 6 will allow variable- >width lookbehinds (see http:

Re: getElementsByTagName in ElementTree

2007-11-19 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > what's the equivalent of minidom's getElementsByTagName in ElementTree? element.findall("//{namespace}tagname") Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Joining open source python projects

2007-11-19 Thread Maurice LING
Giampaolo Rodola' wrote: > Hi there, > I don't know if such a thing has been already discussed, in which case > I'm sorry. > I was wondering if there's a place for python open source projects > that need help. > It thought it would be very nice having a place where developers could > submit "help r

Re: How to add a Decorator to a Class Method

2007-11-19 Thread Jeff McNeil
Think about the context in which your function definition is executed and how the 'self' parameter is implemented. Your definitions (and decorator calls) are executed in the context of 'class A.' That said, the following would work: >>> class A: def pre(fn): def new_func(*args,**kwa

How to add a Decorator to a Class Method

2007-11-19 Thread [EMAIL PROTECTED]
How do I add a decorator to a class method? Here's what I want to do, but I guess my syntax isn't right. Any advice? class A: def pre(self,fn): def new_func(*args,**kwargs): print 'hi' fn(*args,**kwargs) return new_func @self.pre def func(self,

Re: Python too complex ?!?!?!

2007-11-19 Thread Tim Roberts
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > >On Sun, 18 Nov 2007 14:29:06 -0800, John Nagle <[EMAIL PROTECTED]> >declaimed the following in comp.lang.python: > >> shared hosting server and see how far you get. Or try to install >> the same set of modules on both Linux and Windows. >> > Tr

Re: Is it possible to use sockets to login to a website that uses php?

2007-11-19 Thread Jeremy Dillworth
On Nov 19, 3:37 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 19 Nov 2007 15:01:16 -0300, Lamonte Harris <[EMAIL PROTECTED]> > escribió: > > > I need to some how make a script that logs into a website from my desktop > > and I can do the rest and grab the information on my on hopeful

Re: Tkinter Problem?

2007-11-19 Thread kyosohma
On Nov 19, 8:13 pm, Davy <[EMAIL PROTECTED]> wrote: > Hi all, > > I have written a simple Tkinter program, that is draw a rectangle in a > canvas, when I press Up key, the rectangle move up. But the program > seems work not properly? My environment is Python2.5+PythonWin. > > ##

Re: compiling python 2.5, missing zlib

2007-11-19 Thread Martin v. Löwis
> Those headers are already installed, according to "up2date". Is there > a way to specify the header files used? It will automatically use them if they are good. What's the value of ZLIB_VERSION in /usr/include/zlib.h? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: implement random selection in Python

2007-11-19 Thread Scott David Daniels
J. Clifford Dyer wrote: > My understanding of what you are looking for is that on each individual > selection, > the probability of picking a given name is that name's prob value, divided by > the > sum of all prob values. That is, in the following case: > items = [('Mary', 96),('Shimon', 1)

Re: What is python?????

2007-11-19 Thread Cope
On Nov 19, 6:40 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > Cope wrote: > > within 10 months over 1 mn joined the network. everything available on > > its viewbar. But it can be download only onXP and Vista for security. > > > Cope > >www.spam.spam/spam/SPAM > >www.spam-spam.spam > > See

Re: Variable-width lookbehind

2007-11-19 Thread OKB (not okblacke)
Gary Herron wrote: > OKB (not okblacke) wrote: >> Paul Rubin wrote: >> >> >>> "OKB (not okblacke)" <[EMAIL PROTECTED]> writes: >>> For years now Python has not supported variable-length lookbehinds. >>> I'm not sure what that is and the perl links

Re: sockets: why doesn't my connect() block?

2007-11-19 Thread Justin Kwok
On Nov 19, 4:45 pm, [EMAIL PROTECTED] wrote: > a better question is why you are not using higher level libraries, > such as twisted I don't know about Mr. 7stud, but when I was doing a networking class, the prof recommended that we use C++ to learn socket programming. Students asked the obvious qu

Re: Efficient (HUGE) prime modulus

2007-11-19 Thread Justin Kwok
For the interested, the algorithm that is most likely being used is http://en.wikipedia.org/wiki/Exponentiation_by_squaring If you scroll down, there is a ruby implementation. Combine this with a little bit of http://en.wikipedia.org/wiki/Modular_arithmetic and I wrote a small python function that

Tkinter Problem?

2007-11-19 Thread Davy
Hi all, I have written a simple Tkinter program, that is draw a rectangle in a canvas, when I press Up key, the rectangle move up. But the program seems work not properly? My environment is Python2.5+PythonWin. ##-- from Tkinter import * class MyApp: def __init__(self,par

Joining open source python projects

2007-11-19 Thread Giampaolo Rodola'
Hi there, I don't know if such a thing has been already discussed, in which case I'm sorry. I was wondering if there's a place for python open source projects that need help. It thought it would be very nice having a place where developers could submit "help requests" for their projects and let the

Re: Recursive insertion of a line

2007-11-19 Thread Gabriel Genellina
En Mon, 19 Nov 2007 21:15:16 -0300, Henry <[EMAIL PROTECTED]> escribió: > On 19/11/2007, Francesco Pietra <[EMAIL PROTECTED]> wrote: >> >> How to insert "TER" records recursively, i.e. some thousand fold, in a >> file >> like in the following example? "H2 WAT" is the only constant >> characteri

Re: Recursive insertion of a line

2007-11-19 Thread Henry
On 19/11/2007, Francesco Pietra <[EMAIL PROTECTED]> wrote: > > New to the list and just beginning with Python (Linux B console). Urgent > problem before I can correctly program: > > How to insert "TER" records recursively, i.e. some thousand fold, in a > file > like in the following example? "H2 W

Re: regular expression

2007-11-19 Thread gardsted
Paul McGuire wrote: > Sorry about your coffee cup! Would you be interested in a pyparsing > rendition? > > -- Paul > > > from pyparsing import * > > def defineGrammar(): > ParserElement.setDefaultWhitespaceChars(" \t") > > ident = Word(alphanums+"_") > LT,GT = map(Suppress,"<>") >

Put beauties on your pages,source code free to use:

2007-11-19 Thread my god
Put beauties on your pages,source code free to use: http://groups.google.com/group/all-good-things/web/free-beauty-source -- http://mail.python.org/mailman/listinfo/python-list

Recursive insertion of a line

2007-11-19 Thread Francesco Pietra
New to the list and just beginning with Python (Linux B console). Urgent problem before I can correctly program: How to insert "TER" records recursively, i.e. some thousand fold, in a file like in the following example? "H2 WAT" is the only constant characteristic of the line after which to inser

Re: Some clauses cases BeautifulSoup to choke?

2007-11-19 Thread Chris Mellon
On Nov 19, 2007 3:29 PM, Marc Christiansen <[EMAIL PROTECTED]> wrote: > Frank Stutzman <[EMAIL PROTECTED]> wrote: > > I've got a simple script that looks like (watch the wrap): > > --- > > import BeautifulSoup,urllib > > > > ifile = urllib.urlopen("ht

Re: Some clauses cases BeautifulSoup to choke?

2007-11-19 Thread Marc Christiansen
Frank Stutzman <[EMAIL PROTECTED]> wrote: > I've got a simple script that looks like (watch the wrap): > --- > import BeautifulSoup,urllib > > ifile = urllib.urlopen("http://www.naco.faa.gov/digital_tpp_search.asp?fldId > ent=klax&fld_ident_type=ICAO

Re: Is python.org blocking traffic from the ibm.com domain?

2007-11-19 Thread Terry Reedy
| Can someone responsible for maintaining the website please check what | is happening and help me (and the rest of the IBM community) get back | into the python website ? forwarded to [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie Q: sequence membership

2007-11-19 Thread Steven D'Aprano
On Mon, 19 Nov 2007 16:06:36 -0500, Sells, Fred wrote: >> >>> a, b = [], [] >> >>> a.append(b) >> >>> b.append(a) > did you perhaps mean a.append('b'); b.append('a'); otherwise this seems > pretty advanced for a newbie If you had bothered to read the rest of the post, you'd see that he meant exa

RE: Getting name of control under mouse in Windows?

2007-11-19 Thread Shane Clark
> To: python-list@python.org > From: [EMAIL PROTECTED] > Subject: Re: Getting name of control under mouse in Windows? > Date: Mon, 19 Nov 2007 03:33:24 -0300 > > En Sun, 18 Nov 2007 21:10:18 -0300, Shane Clark > escribió: > >>> From: [EMAIL PROTECTED]

Re: Python for embedded devices?

2007-11-19 Thread Paul Boddie
On 19 Nov, 18:17, Malte Forkel <[EMAIL PROTECTED]> wrote: > I would like to use Python on a router, an Edimax BR-6104K, running OpenWrt > (http://www.openwrt.org). While I probably won't need most of the fancier > stuff in Python, serial I/O and threads should be supported. > > The router is bas

Re: compiling python 2.5, missing zlib

2007-11-19 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
On Nov 19, 2:19 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Neither seems to work. What am I missing here? > > You forgot to install the zlib header files, which come in > an RPM provided by Redhat (probably called zlib-dev or some > such). > > Regards, > Martin Those headers are already

Re: Learning Python : >>> import math doesn't work ?

2007-11-19 Thread Terry Reedy
"Asun Friere" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Nov 19, 3:46 pm, windspy <[EMAIL PROTECTED]> wrote: | > use it like: x = math.sqrt (100) and math.sin(x) | | alternatively import like this: | | from math import sqrt, sin | | ... and use it like you have. Or, import

Re: Some clauses cases BeautifulSoup to choke?

2007-11-19 Thread Duncan Booth
Frank Stutzman <[EMAIL PROTECTED]> wrote: > I did some poking and proding and it seems that there is something in > the > clause that is causing the problem. Heck if I can see what it >is. > Maybe Beautifulsoup believes the incorrect encoding in the meta tags? -- http://mail.python.org/mailm

Re: Python too complex ?!?!?!

2007-11-19 Thread Diez B. Roggisch
Dennis Lee Bieber schrieb: > On Mon, 19 Nov 2007 18:47:37 +0100, "Diez B. Roggisch" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> BTW, you can download eggs and install them from files - so while >> teaching easy_install how to deal with proxies (are these still used by

Re: sockets: why doesn't my connect() block?

2007-11-19 Thread sndive
On Nov 17, 11:32 pm, 7stud <[EMAIL PROTECTED]> wrote: > According to "Python in a Nutshell(2nd)", p. 523: > > connect: s.connect((host, port)) > ... > Blocks until the server accepts or rejects the connection attempt. > > However, my client program ends immediately after the call to > connect()--

Re: Is python.org blocking traffic from the ibm.com domain?

2007-11-19 Thread Martin v. Löwis
> IBM internal network security confirms that they are not blocking > access to these sites, so we are guessing that the websites themselves > are choosing not to respond, perhaps thinking that the volume of > traffic from the ibm.com domain is spam or DOS attack. > > Can someone responsible for m

Re: compiling python 2.5, missing zlib

2007-11-19 Thread Martin v. Löwis
> Neither seems to work. What am I missing here? You forgot to install the zlib header files, which come in an RPM provided by Redhat (probably called zlib-dev or some such). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

getElementsByTagName in ElementTree

2007-11-19 Thread sndive
what's the equivalent of minidom's getElementsByTagName in ElementTree? -- http://mail.python.org/mailman/listinfo/python-list

weave and compiler install help

2007-11-19 Thread Michael ODonnell
I am trying to compile some inline c++ code inside python using weave. I always get a similar problem where the compiled file cannot be found (see below). I am not sure if the problem is with the compiler or something else. I am a new user of scipy and a novice with python so I would appreciate any

RE: Anyone knows how to use xemacs with ipython or python on WinXP? [phishing][html-removed]

2007-11-19 Thread wang frank
I did not byte-compile the python-mode.el. Does this change anything? I still cannot get the ipython commad prompt. Thanks Frank> Subject: RE: Anyone knows how to use xemacs with ipython or python on WinXP? [phishing][html-removed]> Date: Mon, 19 Nov 2007 15:57:59 -0500> From: [EMAIL PROTEC

RE: newbie Q: sequence membership

2007-11-19 Thread Sells, Fred
> >>> a, b = [], [] > >>> a.append(b) > >>> b.append(a) did you perhaps mean a.append('b'); b.append('a'); otherwise this seems pretty advanced for a newbie > >>> b in a > True > >>> a in a > Traceback (most recent call last): > File "", line 1, in > RuntimeError: maximum recursion depth exce

RE: Anyone knows how to use xemacs with ipython or python on WinXP? [phishing][html-removed]

2007-11-19 Thread Sells, Fred
you did remember to "byte-compile" the python-mode.el file? > I am struggling to make the ipython or python works in > xemacs. I have been seraching on the internet for a solution > for one day. I have put python-mode.el and ipython.el in the > load-path and in the xemacs I type: M-x load libra

compiling python 2.5, missing zlib

2007-11-19 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I'm trying to compile Python 2.5 on a RHEL system, using "./ configure;make;make install". The build seems to go alright, but the zlib module is missing. I've tried the following: 1) Download and build the zlib libraries myself 2) Specify '--without-system-zlib' to ./configure Neither seems to w

Re: python application dll

2007-11-19 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hi, > > Is there a way to create a .dll from a python program which includes > the python runtime? > > I'm building a Windows application (C# VisualStudio2005) and I'd like > to utilize some of the functionality available in a Python module. For > my users who install m

Re: Python for embedded devices?

2007-11-19 Thread Grant Edwards
On 2007-11-19, Malte Forkel <[EMAIL PROTECTED]> wrote: > I would like to use Python on a router, an Edimax BR-6104K, > running OpenWrt (http://www.openwrt.org). While I probably > won't need most of the fancier stuff in Python, serial I/O and > threads should be supported. > > The router is based

Re: Python for embedded devices?

2007-11-19 Thread Chris Mellon
On Nov 19, 2007 11:17 AM, Malte Forkel <[EMAIL PROTECTED]> wrote: > I would like to use Python on a router, an Edimax BR-6104K, running OpenWrt > (http://www.openwrt.org). While I probably won't need most of the fancier > stuff in Python, serial I/O and threads should be supported. > > The route

Re: Is it possible to use sockets to login to a website that uses php?

2007-11-19 Thread Gabriel Genellina
En Mon, 19 Nov 2007 15:01:16 -0300, Lamonte Harris <[EMAIL PROTECTED]> escribió: > I need to some how make a script that logs into a website from my desktop > and I can do the rest and grab the information on my on hopefully. How > would I login to a website using sockets with python? See the

Python-URL! - weekly Python news and links (Nov 19)

2007-11-19 Thread Gabriel Genellina
QOTW: "I think the need for these 'eventloop unifications' stems from Visual Basic. VB programmers never learned to use more than one thread, and they are still struggling to unlearn the bad habits they aquired." - sturlamolden http://groups.google.com/group/comp.lang.python/msg/41d29242b2a825

Re: newbie Q: sequence membership

2007-11-19 Thread Gabriel Genellina
En Mon, 19 Nov 2007 03:32:12 -0300, saccade <[EMAIL PROTECTED]> escribió: > So if I am permitted to think of integers as immutable objects with > predefined labels (i.e. the integers used in the text of the program > code) that cannot de or re referenced then what a similar treatment of > characte

Re: Some clauses cases BeautifulSoup to choke?

2007-11-19 Thread Chris Mellon
On Nov 19, 2007 1:36 PM, Frank Stutzman <[EMAIL PROTECTED]> wrote: > I've got a simple script that looks like (watch the wrap): > --- > import BeautifulSoup,urllib > > ifile = urllib.urlopen("http://www.naco.faa.gov/digital_tpp_search.asp?fldId > ent=

Some clauses cases BeautifulSoup to choke?

2007-11-19 Thread Frank Stutzman
I've got a simple script that looks like (watch the wrap): --- import BeautifulSoup,urllib ifile = urllib.urlopen("http://www.naco.faa.gov/digital_tpp_search.asp?fldId ent=klax&fld_ident_type=ICAO&ver=0711&bnSubmit=Complete+Search").read() soup=Beau

Re: Populating a dictionary, fast [SOLVED]

2007-11-19 Thread Francesc Altet
A Wednesday 14 November 2007, Francesc Altet escrigué: > I think I've got messed on some benchmarks that I've done on that > subject some time ago, but either my memory is bad or I've made some > mistake on those experiments. My apologies. Just for the record. I was unable to stop thinking about

Python for embedded devices?

2007-11-19 Thread Malte Forkel
I would like to use Python on a router, an Edimax BR-6104K, running OpenWrt (http://www.openwrt.org). While I probably won't need most of the fancier stuff in Python, serial I/O and threads should be supported. The router is based on the ADM5120P, has 2MB of flash and 16MB of RAM, so the versi

Re: embed ipython in wxPython app

2007-11-19 Thread chewie54
On Nov 19, 1:44 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Nov 19, 2007 12:21 PM, chewie54 <[EMAIL PROTECTED]> wrote: > > > > > On Nov 19, 1:07 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > > > On Nov 19, 2007 11:51 AM, chewie54 <[EMAIL PROTECTED]> wrote: > > > > > On Nov 18, 8:39 pm, c

Re: display messages in python shell

2007-11-19 Thread Bruno Desthuilliers
Jens a écrit : > On 19 Nov., 19:48, [EMAIL PROTECTED] wrote: > >>Is it possible to display messages in the python shell? I want to >>display error messages based on parameters in my scripts to the >>users. Is there another way to display messages other than log >>files? Thanks. >> >>Kou > > >

Re: Efficient: put Content of HTML file into mysql database

2007-11-19 Thread Fabian López
Thanks Jesse, we have a webserver with different domains and I need to crawl different urls so I decided first to download the file using : f = urllib.urlretrieve(url,'doc.html') And after that, I will read the content with all the HTML tags and save it on our database in order to work with this te

Re: Python too complex ?!?!?!

2007-11-19 Thread Aaron Watters
On Nov 19, 3:44 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 17 Nov., 14:46, Brian <[EMAIL PROTECTED]> wrote: > What have I missed? Microsoft has a free download version of Visual Studio which you can install in one go that has basically everything you might want to cover in the first 2 or 3 p

Re: display messages in python shell

2007-11-19 Thread Jens
On 19 Nov., 19:48, [EMAIL PROTECTED] wrote: > Is it possible to display messages in the python shell? I want to > display error messages based on parameters in my scripts to the > users. Is there another way to display messages other than log > files? Thanks. > > Kou What about using print? For

Re: pydoc - how to generate documentation for an entire package?

2007-11-19 Thread Jens
On 8 Nov., 02:46, Jens <[EMAIL PROTECTED]> wrote: > I have a project/package for which I want to generate documentation > usingpydoc. > > My problem is that when I type "pydoc.py -w MyPackage" it only > generates documentation for the package - no modules, classes or > methods or sub-packages. Just

display messages in python shell

2007-11-19 Thread koutoo
Is it possible to display messages in the python shell? I want to display error messages based on parameters in my scripts to the users. Is there another way to display messages other than log files? Thanks. Kou -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficient: put Content of HTML file into mysql database

2007-11-19 Thread Jesse Jaggars
Fabian López wrote: > Hi colegues, > do you know the most efficient way to put the content of an html file > into a mySQL database?Could it be this one?: > 1.- I have the html document in my hard disk. > 2.- Then I Open the file (maybe with fopen??) > 3.- Read the content (fread or similar) > 4.-

Re: embed ipython in wxPython app

2007-11-19 Thread Chris Mellon
On Nov 19, 2007 12:21 PM, chewie54 <[EMAIL PROTECTED]> wrote: > On Nov 19, 1:07 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > > On Nov 19, 2007 11:51 AM, chewie54 <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > On Nov 18, 8:39 pm, chewie54 <[EMAIL PROTECTED]> wrote: > > > > Hi All, > > > >

Re: Sorting Countries by Region

2007-11-19 Thread martyw
nothing, Alan wrote: > On Nov 16, 8:28 pm, martyw <[EMAIL PROTECTED]> wrote: >> i would create a class to capture country information, e.g. > > > What is the advantage of this: > >> def __cmp__(self, other): >> if self.name < other.name: >> return -1 >> elif s

Re: embed ipython in wxPython app

2007-11-19 Thread chewie54
On Nov 19, 1:07 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Nov 19, 2007 11:51 AM, chewie54 <[EMAIL PROTECTED]> wrote: > > > > > > > On Nov 18, 8:39 pm, chewie54 <[EMAIL PROTECTED]> wrote: > > > Hi All, > > > > I'm evaluting IPython to see if I can it use like Tcl and Tk. If I > > > star

Efficient: put Content of HTML file into mysql database

2007-11-19 Thread Fabian López
Hi colegues, do you know the most efficient way to put the content of an html file into a mySQL database?Could it be this one?: 1.- I have the html document in my hard disk. 2.- Then I Open the file (maybe with fopen??) 3.- Read the content (fread or similar) 4.- Write all the content it in a SQL s

Re: insert comments into elementtree

2007-11-19 Thread Tim Arnold
"Stefan Behnel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Tim Arnold wrote: >> Hi, I'm using the TidyHTMLTreeBuilder to generate some elementtrees from >> html. One by-product is that I'm losing comments embedded in the html. > > That's how the parser in ET works. Use lxml inst

Re: embed ipython in wxPython app

2007-11-19 Thread Chris Mellon
On Nov 19, 2007 11:51 AM, chewie54 <[EMAIL PROTECTED]> wrote: > > On Nov 18, 8:39 pm, chewie54 <[EMAIL PROTECTED]> wrote: > > Hi All, > > > > I'm evaluting IPython to see if I can it use like Tcl and Tk. If I > > start wish8.4, I get a command line > > interpreter in xterm, then I can source

Is it possible to use sockets to login to a website that uses php?

2007-11-19 Thread Lamonte Harris
I need to some how make a script that logs into a website from my desktop and I can do the rest and grab the information on my on hopefully. How would I login to a website using sockets with python? -- http://mail.python.org/mailman/listinfo/python-list

Re: embed ipython in wxPython app

2007-11-19 Thread chewie54
On Nov 18, 8:39 pm, chewie54 <[EMAIL PROTECTED]> wrote: > Hi All, > > I'm evaluting IPython to see if I can it use like Tcl and Tk. If I > start wish8.4, I get a command line > interpreter in xterm, then I can source tcl progams that draw tk > graphics on a canvas in another window. > > Is th

Re: Python too complex ?!?!?!

2007-11-19 Thread Diez B. Roggisch
alain schrieb: > On Nov 19, 9:44 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: >> On 17 Nov., 14:46, Brian <[EMAIL PROTECTED]> wrote: >> >>> Had a unsettling conversation with a CS instructor that >>> teaches at local high schools and the community >>> college. This person is a long-term Linux/C/Pyth

Re: regular expression

2007-11-19 Thread Paul McGuire
Sorry about your coffee cup! Would you be interested in a pyparsing rendition? -- Paul from pyparsing import * def defineGrammar(): ParserElement.setDefaultWhitespaceChars(" \t") ident = Word(alphanums+"_") LT,GT = map(Suppress,"<>") NL = LineEnd().suppress() real = Word(

Re: logging.SocketHandler connections

2007-11-19 Thread Vinay Sajip
On Nov 19, 10:27 am, oj <[EMAIL PROTECTED]> wrote: > On Nov 16, 2:31 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > > Here is the server code. Pretty much directly copied from the example, > aside from not having the the handler loop forever, and queing the > records instead of dealing with the direc

Re: Efficient (HUGE) prime modulus

2007-11-19 Thread Hrvoje Niksic
blaine <[EMAIL PROTECTED]> writes: > Python Code: > G = > long(2333938645766150615511255943169694097469294538730577330470365230748185729160097289200390738424346682521059501689463393405180773510126708477896062227281603) > P = > long(7897383601534681724700886135766287333879367007236994792380

Re: Efficient (HUGE) prime modulus

2007-11-19 Thread Paul McGuire
On Nov 19, 10:32 am, blaine <[EMAIL PROTECTED]> wrote: > Hey guys, > For my Network Security class we are designing a project that will, > among other things, implement a Diffie Hellman secret key exchange. > The rest of the class is doing Java, while myself and a classmate are > using Python (as

Re: Efficient (HUGE) prime modulus

2007-11-19 Thread Steven Bethard
blaine wrote: > Hey guys, > For my Network Security class we are designing a project that will, > among other things, implement a Diffie Hellman secret key exchange. > The rest of the class is doing Java, while myself and a classmate are > using Python (as proof of concept). I am having problems

Re: Efficient (HUGE) prime modulus

2007-11-19 Thread Peter Otten
blaine wrote: > A = (G ** a) % P # G^a mod P > > ## END # > The above code takes a very long time. If I make little a only 16 bits > instead of 512, it takes about 12 seconds on my machine to compute. Is > this incorrect usage of **? I used math.pow and built-in pow. The > math.pow

Re: Finding lowest value in dictionary of objects, how?

2007-11-19 Thread Steven Bethard
Boris Borcic wrote: > davenet wrote: >> Hi, >> >> I'm new to Python and working on a school assignment. >> >> I have setup a dictionary where the keys point to an object. Each >> object has two member variables. I need to find the smallest value >> contained in this group of objects. >> >> The obje

Re: Efficient (HUGE) prime modulus

2007-11-19 Thread Chris Mellon
On Nov 19, 2007 10:32 AM, blaine <[EMAIL PROTECTED]> wrote: > Hey guys, > For my Network Security class we are designing a project that will, > among other things, implement a Diffie Hellman secret key exchange. > The rest of the class is doing Java, while myself and a classmate are > using Pytho

Re: Python too complex ?!?!?!

2007-11-19 Thread kyosohma
On Nov 19, 9:57 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Nov 19, 2007 8:52 AM, <[EMAIL PROTECTED]> wrote: > > > > > > > On Nov 17, 7:46 am, Brian <[EMAIL PROTECTED]> wrote: > > > Had a unsettling conversation with a CS instructor that > > > teaches at local high schools and the community

Re: Efficient (HUGE) prime modulus

2007-11-19 Thread Paul Rubin
blaine <[EMAIL PROTECTED]> writes: > A = (G ** a) % P # G^a mod P Think of how large the intermediate result G**a will be. That should explain why it's taking so long. So figure out what Java's modPow function must be doing, and write something similar. Or, see the docs for python's built-i

Re: securing a python execution environment...

2007-11-19 Thread Chris Withers
Paul Boddie wrote: > http://wiki.python.org/moin/SandboxedPython > http://wiki.python.org/moin/How_can_I_run_an_untrusted_Python_script_safely_%28i%2ee%2e_Sandbox%29 Yeah, from this I'm pretty much set on: http://pypi.python.org/pypi/RestrictedPython/ I know it's pretty bulletproof (I've been us

Efficient (HUGE) prime modulus

2007-11-19 Thread blaine
Hey guys, For my Network Security class we are designing a project that will, among other things, implement a Diffie Hellman secret key exchange. The rest of the class is doing Java, while myself and a classmate are using Python (as proof of concept). I am having problems though with crunching h

Re: how can i return a image in mod python ?

2007-11-19 Thread Arnaud Delobelle
On Nov 19, 10:27 am, Abandoned <[EMAIL PROTECTED]> wrote: [...] > Thank you but i have a another problem. > > def showimage(req): > from PIL import Image > im=Image.open("c:\image-2.jpg") > im.thumbnail((800,600), Image.ANTIALIAS) > req.sendfile(im) > > give me some

Is python.org blocking traffic from the ibm.com domain?

2007-11-19 Thread scott . h . snyder
Hello all, I work at IBM and was discussing with a fellow developer how to access packages from the cheeseshop that might be useful for a project he is working on. He found that he could not connect to the cheeseshop (chesseshop.python.org) from inside IBM but could connect from home. I confirmed

Re: Finding lowest value in dictionary of objects, how?

2007-11-19 Thread Boris Borcic
davenet wrote: > Hi, > > I'm new to Python and working on a school assignment. > > I have setup a dictionary where the keys point to an object. Each > object has two member variables. I need to find the smallest value > contained in this group of objects. > > The objects are defined as follows:

Re: Python too complex ?!?!?!

2007-11-19 Thread Chris Mellon
On Nov 19, 2007 8:52 AM, <[EMAIL PROTECTED]> wrote: > > On Nov 17, 7:46 am, Brian <[EMAIL PROTECTED]> wrote: > > Had a unsettling conversation with a CS instructor that > > teaches at local high schools and the community > > college. This person is a long-term Linux/C/Python > > programmer, but he

[EMAIL PROTECTED]: Re: overriding methods - two questions]

2007-11-19 Thread J. Clifford Dyer
On Mon, Nov 19, 2007 at 04:33:39PM +0100, Bruno Desthuilliers wrote regarding Re: overriding methods - two questions: > > J. Clifford Dyer a ?crit : > > On Mon, Nov 19, 2007 at 01:41:46PM +0100, Bruno Desthuilliers wrote > > regarding Re: overriding methods - two questions: > >> Steven D'Aprano

Re: overriding methods - two questions

2007-11-19 Thread Bruno Desthuilliers
J. Clifford Dyer a écrit : > On Mon, Nov 19, 2007 at 01:41:46PM +0100, Bruno Desthuilliers wrote regarding > Re: overriding methods - two questions: >> Steven D'Aprano a ?crit : >>> On Fri, 16 Nov 2007 18:28:59 +0100, Bruno Desthuilliers wrote: >>> > Question 1: > > Given that the user

Re: return image in mod python

2007-11-19 Thread Diez B. Roggisch
Abandoned wrote: > On Nov 19, 12:36 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Abandoned wrote: >> > Hi i have a problem. >> >> > def showimage(req): >> > from PIL import Image >> > im=Image.open("c:\image-2.jpg") >> > im.thumbnail((800,600), Image.ANTIALIAS) >> >

Re: guess file type in python

2007-11-19 Thread Matt Nordhoff
Japan Shah wrote: > > > > > > mimetypes module? -- -- http://mail.python.org/mailman/listinfo/python-list

Re: overriding methods - two questions

2007-11-19 Thread George Sakkis
On Nov 19, 7:44 am, Bruno Desthuilliers wrote: > George Sakkis a écrit : > > > > > On Nov 16, 5:03 pm, Steven D'Aprano <[EMAIL PROTECTED] > > cybersource.com.au> wrote: > > >> On Fri, 16 Nov 2007 18:28:59 +0100, Bruno Desthuilliers wrote: > Question 1: > Given that the user of the API ca

Re: Book: Python Power!: The Comprehensive Guide

2007-11-19 Thread kyosohma
On Nov 18, 12:17 am, John Salerno <[EMAIL PROTECTED]> wrote: > Anyone know anything about this book? I've read a few intro Python books > already, but I'm always interested in reading more to reinforce the > language. No reviews on Amazon yet so I'm not sure if it's good or not. > > Thanks. It's a

Re: Python too complex ?!?!?!

2007-11-19 Thread kyosohma
On Nov 17, 7:46 am, Brian <[EMAIL PROTECTED]> wrote: > Had a unsettling conversation with a CS instructor that > teaches at local high schools and the community > college. This person is a long-term Linux/C/Python > programmer, but he claims that the install, config, and > library models for C# hav

  1   2   >