Re: Simple eval

2007-11-19 Thread Gabriel Genellina
En Sun, 18 Nov 2007 22:24:39 -0300, greg <[EMAIL PROTECTED]> escribi�: > Importing the names from tokenize that you use repeatedly > should save some time, too. >from tokenize import STRING, NUMBER > > If you were willing to indulge in some default-argument abuse, you > could also do > >def

Finding lowest value in dictionary of objects, how?

2007-11-19 Thread davenet
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: class Block: def __init__(sel

Re: Python too complex ?!?!?!

2007-11-19 Thread Kay Schluehr
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/Python > programmer, but he claims that the install, config, and > library models for C# hav

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

2007-11-19 Thread Marc 'BlackJack' Rintsch
On Mon, 19 Nov 2007 00:18:33 -0800, davenet wrote: > The objects are defined as follows: > > class Block: >def __init__(self,addr): > self.addr = addr > self.age = 0 > > My dictionary is defined as: >blocks = {} > > I have added 1000 (will hold more after I get this working)

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

2007-11-19 Thread Ben Finney
davenet <[EMAIL PROTECTED]> writes: > I'm new to Python and working on a school assignment. Thank you for being honest about this. You should carefully read the policies on plagiarism for your school. In general, the student is expected to use the resources of their course material, the lecturer

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

2007-11-19 Thread Steven D'Aprano
On Mon, 19 Nov 2007 00:18:33 -0800, davenet wrote: > Hi, > > I'm new to Python and working on a school assignment. Thank you for your honesty. > 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 >

Re: Simple eval

2007-11-19 Thread Steven D'Aprano
On Sun, 18 Nov 2007 21:46:49 -0800, MonkeeSage wrote: > As I see it, just as a matter of common sense, there will be no way to > match the performance of the backend eval() with any interpreted code. > At best, performance-wise, a preprocessor for the built-in eval() would > be in order, filtering

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

2007-11-19 Thread Steven D'Aprano
On Mon, 19 Nov 2007 20:00:27 +1100, Ben Finney wrote: > You should carefully read the policies on plagiarism for your school. In > general, the student is expected to use the resources of their course > material, the lecturer and tutor, and their own creativity to come up > with the answers — *not

computer language python in 2007

2007-11-19 Thread balu
computer language python in 2007 http://www.bidvertiser.com/ http://bigchurch.com/go/g906803-pmem http://indianfriendfinder.com/go/g906803-pmem -- http://mail.python.org/mailman/listinfo/python-list

computer language from american lang.

2007-11-19 Thread balu
computer language from american lang. http://www.bidvertiser.com/ http://bigchurch.com/go/g906803-pmem http://indianfriendfinder.com/go/g906803-pmem -- http://mail.python.org/mailman/listinfo/python-list

Re: Python too complex ?!?!?!

2007-11-19 Thread alain
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/Python > > programmer,

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

2007-11-19 Thread Abandoned
On Nov 18, 10:27 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Nov 18, 6:46 am, Abandoned <[EMAIL PROTECTED]> wrote: > > > Hi.. > > I want to show the pictures with mod python directly. > > > def showimage(req): > > some process... > > open /var/www/a.jpg and print > > > for example

Re: logging.SocketHandler connections

2007-11-19 Thread oj
On Nov 16, 2:31 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > On Nov 15, 3:23 pm, oj <[EMAIL PROTECTED]> wrote: > > > > > However, initially, I had tried it with a server that closed the > > connection after receiving each record, and the SocketHandler doesn't > > seem to behave as advertised. > > >

Re: regular expression

2007-11-19 Thread gardsted
The retarded cousin - that's me! I keep getting confused by the caret - sometimes it works - sometimes it's better with backslash-n Yes - retarded cousin, I guess. The file format is a config-track for a multitrack recording software, which i need to automate a bit. I can start it from the comm

return image in mod python

2007-11-19 Thread Abandoned
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) req.sendfile(im) give me some error. How can i return this image witdhout save ? -- http://mail.python.org/mailman/listinfo/py

Re: return image in mod python

2007-11-19 Thread Diez B. Roggisch
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) > req.sendfile(im) > > > > give me some error. Really? I don't see any error. So there can't be

Re: What is python?????

2007-11-19 Thread James Stroud
rzed wrote: > Cope <[EMAIL PROTECTED]> wrote in news:7ab5b781-3c6c- > [EMAIL PROTECTED]: > >> please tell me what is python.This group is so crowded. >> > > I see nobody has chosen to answer your question seriously. I'll > give you an answer, but it is probably not to the question you are > ask

Re: What is python?????

2007-11-19 Thread Diez B. Roggisch
> You're having a conversation with a spambot. Spam - certainly. But bot - no. Unless there have been some really remarkable improvements in KI lately. It's amazing that recently so many spam is written by some guys actually _reading_ this group. I presume they somehow want to create credibility

Re: newbie Q: sequence membership

2007-11-19 Thread John Machin
> > On Nov 17, 4:35 am, John Machin <[EMAIL PROTECTED]> wrote: >> Worse: Consider z = ['A1', 'Z9']. It's highly likely that when x == >> 'A1', "x is_in z" is True -- because an unguaranteed implementation- >> dependent caper caches or "interns" some values, so that x and z[0] >> are the same objec

securing a python execution environment...

2007-11-19 Thread Chris Withers
Hi All, I'm trying to build a secure execution environment for bits of python for two reasons: - to allow users of the system to write scripts in python without circumventing the application's security model - to allow the system to have an environment where security is handled without having

Re: What is python?????

2007-11-19 Thread Chris Withers
Diez B. Roggisch wrote: > It's amazing that recently so many spam is written by some guys actually > _reading_ this group. I presume they somehow want to create credibility in > their postings by provoking real threads that then at some point contain > the actual information. I wonder why this gro

struct,long on 64-bit machine

2007-11-19 Thread Neal Becker
What's wrong with this? type(struct.unpack('l','\00'*8)[0]) Why I am getting 'int' when I asked for 'long'? This is on python-2.5.1-15.fc8.x86_64 -- http://mail.python.org/mailman/listinfo/python-list

Re: securing a python execution environment...

2007-11-19 Thread Laszlo Nagy
Chris Withers wrote: > Hi All, > > I'm trying to build a secure execution environment for bits of python > for two reasons: > > - to allow users of the system to write scripts in python without > circumventing the application's security model > > - to allow the system to have an environment where

Re: struct,long on 64-bit machine

2007-11-19 Thread Robin Becker
Neal Becker wrote: > What's wrong with this? > type(struct.unpack('l','\00'*8)[0]) > > > Why I am getting 'int' when I asked for 'long'? > > This is on python-2.5.1-15.fc8.x86_64 > On my AMD 64 I think int is 64 bits $ python -c "import sys; print sys.maxint" 9223372036854775807 -- Robin Be

Re: struct,long on 64-bit machine

2007-11-19 Thread Hrvoje Niksic
Neal Becker <[EMAIL PROTECTED]> writes: > What's wrong with this? > type(struct.unpack('l','\00'*8)[0]) > > > Why I am getting 'int' when I asked for 'long'? C longs are converted to Python integers; see the table on http://docs.python.org/lib/module-struct.html. If you really need the Python l

Re: overriding methods - two questions

2007-11-19 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : > On Fri, 16 Nov 2007 18:28:59 +0100, Bruno Desthuilliers wrote: > >>> Question 1: >>> >>> Given that the user of the API can choose to override foo() or not, how >>> can I control the signature that they use? >> While technically possible (using inspect.getargspec), tryi

Re: overriding methods - two questions

2007-11-19 Thread Bruno Desthuilliers
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 can choose to override foo() or not, how can I control the sig

Re: securing a python execution environment...

2007-11-19 Thread Alberto Berti
maybe using import hooks? http://www.python.org/dev/peps/pep-0302/ -- http://mail.python.org/mailman/listinfo/python-list

ANN: eGenix mxODBC and mxODBC Zope DA on AIX 5.3 (and later)

2007-11-19 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Database Interface eGenix.com mxODBC Zope Database Adapter for AIX 5.3 and later This announcement is also available on our web-site for on

Re: What is python?????

2007-11-19 Thread rzed
James Stroud <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > You're having a conversation with a spambot. Actually, my intent was to address the question that was asked. Much of the genuine conversation in the group really does intermix the various senses of "Python", sometimes in wa

Re: implement random selection in Python

2007-11-19 Thread Neil Cerutti
On 2007-11-17, Bruza <[EMAIL PROTECTED]> wrote: > OOPS. I pressed the Send too fast. > > The problem w/ Boris's solution is that after repeated calling > of randomPick(3,items), 'Jane' is not the most "frequent > appearing" member in all the out list of 3 member lists... How does this solution fai

guess file type in python

2007-11-19 Thread Japan Shah
-- http://mail.python.org/mailman/listinfo/python-list

Re: securing a python execution environment...

2007-11-19 Thread Laszlo Nagy
Alberto Berti wrote: > maybe using import hooks? > > http://www.python.org/dev/peps/pep-0302/ > > I don't think so. Anyone can hook the import statement. And this is just one reason. Some objects are built in. For example, file(). How can you restrict file creation? I believe that there is no

Re: securing a python execution environment...

2007-11-19 Thread Chris Withers
Laszlo Nagy wrote: > Once upon a time, there has been a module called "bastillon" (am I > right?) and "rexec" (restricted execution environment) but they were not > really secure. It was a long time ago. Python is very flexible, and > interpreted and it is hard to prevent the users from importin

Re: What is python?????

2007-11-19 Thread Wildemar Wildenburger
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, Diez was right. /W -- http://mail.python.org/mailman/listinfo/python-list

Re: return image in mod python

2007-11-19 Thread Abandoned
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) > > req.sendfile(im) >

Re: securing a python execution environment...

2007-11-19 Thread Chris Withers
Alberto Berti wrote: > maybe using import hooks? > > http://www.python.org/dev/peps/pep-0302/ Well, as Lazlo reminded me, there are also plenty of builtins that are problematic... although hopefully providing a limited set of contents for the global and local namespaces could solve that? But,

Re: securing a python execution environment...

2007-11-19 Thread Giles Brown
On 19 Nov, 11:16, Chris Withers <[EMAIL PROTECTED]> wrote: > Hi All, > > I'm trying to build a secure execution environment for bits of python > for two reasons: > > - to allow users of the system to write scripts in python without > circumventing the application's security model > > - to allow the

Re: securing a python execution environment...

2007-11-19 Thread Paul Boddie
On 19 Nov, 12:16, Chris Withers <[EMAIL PROTECTED]> wrote: > > I'm trying to build a secure execution environment for bits of python > for two reasons: [...] > Have other people bumped into this problem? > What solutions do people recommend? It might be worth looking at these pages for some sugg

Re: overriding methods - two questions

2007-11-19 Thread J. Clifford Dyer
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 of the API can choose to ov

Re: Interfaces.

2007-11-19 Thread Scott SA
On 11/17/07, Duncan Booth ([EMAIL PROTECTED]) wrote: >Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > >> Benjamin wrote: >>> Python is has duck typing. "If it quacks like a duke, it's duck." >> >> How do dukes quack, exactly? :) > >They quack with a North-eastern Scottish accent of course. > >Th

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

2007-11-19 Thread davenet
On Nov 19, 1:00 am, Ben Finney <[EMAIL PROTECTED]> wrote: > davenet <[EMAIL PROTECTED]> writes: > > I'm new to Python and working on a school assignment. > > Thank you for being honest about this. > > You should carefully read the policies on plagiarism for your > school. In general, the student is

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

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: 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: 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: 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: 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

[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: 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

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:

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: 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

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: 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

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: 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 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: 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 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: 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 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 Hrvoje Niksic
blaine <[EMAIL PROTECTED]> writes: > Python Code: > G = > long(2333938645766150615511255943169694097469294538730577330470365230748185729160097289200390738424346682521059501689463393405180773510126708477896062227281603) > P = > long(7897383601534681724700886135766287333879367007236994792380

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: 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: 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: 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

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 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

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

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: 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

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 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: 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.-

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: 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

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: 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: 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: 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: 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

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: 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

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: 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=

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

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: 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

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: 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 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

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: 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

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 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

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

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

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

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

  1   2   >