Re: interpreter vs. compiled

2008-08-05 Thread castironpi
On Aug 5, 1:54 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Tue, Aug 5, 2008 at 12:12 PM, castironpi <[EMAIL PROTECTED]> wrote: > > On Aug 5, 9:21 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > >> On Aug 3, 1:26 am, castironpi <[EMAIL PROTECTED]> wrote: > > >> > Which is 12 bytes lo

Re: What Python looks like

2008-08-05 Thread William Pursell
On 5 Aug, 16:08, Brett Ritter <[EMAIL PROTECTED]> wrote: > On Aug 4, 3:43 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > > > A page of Python code looks *clean*,  with not a lot of > > punctuation/special symbols and (in particular) no useless lines > My first impression of Python was that it was vi

Re: What Python looks like

2008-08-05 Thread Paddy
On Aug 4, 8:06 pm, iu2 <[EMAIL PROTECTED]> wrote: > Hi, > > This is a little bit strange post, but I'm curious... > > I learned Python from its tutorial step by step, and practicing > writing small scripts. > I haven't seen a Python program before knowing Python. > > I'm curious, what did Python co

Re: Trying to fix Invalid CSV File

2008-08-05 Thread Ryan Rosario
On Aug 4, 1:56 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > Ryan Rosario wrote: > > On Aug 4, 8:30 am, Emile van Sebille <[EMAIL PROTECTED]> wrote: > >> John Machin wrote: > >>> On Aug 4, 6:15 pm, Ryan Rosario <[EMAIL PROTECTED]> wrote: > On Aug 4, 1:01 am, John Machin <[EMAIL PROTECTED]> wrot

Re: Questions about asyncore

2008-08-05 Thread Frank Millman
On Aug 5, 6:18 pm, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > Giampaolo already offered up some information, but I will offer these > two little tidbits: > In your first client, your handle_read doesn't handle the case where > you have received multiple packets at one time. That is, imagine tha

Re: string to type object (C)

2008-08-05 Thread castironpi
On Aug 5, 7:59 pm, Miles <[EMAIL PROTECTED]> wrote: > On Tue, Aug 5, 2008 at 2:30 AM, castironpi <[EMAIL PROTECTED]> wrote: > > I'm looking for a one-to-one function from strings to the built-in > > data types in C.  I will be keeping the string in a file.  I need the > > PyTypeObject* back from it

Re: URLs and ampersands

2008-08-05 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > I could just do a string replace, but is there a "right" way to escape > and unescape URLs? I've looked through the standard lib, but I can't find > anything helpful. xml.sax.utils.unescape() -- http://mail.python.org/mailman/listinfo/python-list

Tkinter Entry widgets 'font' property (API ?) changed in Python 2.5.2 ?

2008-08-05 Thread Atul
Hi, The snippet : entryFontDescr = Entry()["font"] print self.entryFontDescr On Windows XP it displays {MS Sans Serif} 8 On Suse Linux 10.2 it used to display TkTextFont 10 I upgraded to OpenSuse 11 and now it shows TkTextFont I used this snippet to obtain the default font size for an Entr

Professional Grant Proposal Writing Workshop (September 2008: British Columbia Institute of Technology - Vancouver Campus)

2008-08-05 Thread Anthony Jones
The Grant Institute's Grants 101: Professional Grant Proposal Writing Workshop will be held at the British Columbia Institute of Technology - Vancouver Campus, September 29 - October 1, 2008. Interested development professionals, researchers, faculty, and graduate students should register as soo

Re: Finding IP address of localhost via socket API (or other API)

2008-08-05 Thread Timothy Grant
On Tue, Aug 5, 2008 at 4:39 PM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Sorry for replying to the replier (Timothy) instead of the OP (David), > but the original post seems to have been eaten by my ISP. > > On Tue, 05 Aug 2008 15:48:26 -0700, Timothy Grant wrote: > >> On Tue, Aug 5, 2008 at 2:

Re: pyprocessing/multiprocessing for x64?

2008-08-05 Thread Benjamin Kaplan
On Tue, Aug 5, 2008 at 9:29 PM, Christian Heimes <[EMAIL PROTECTED]> wrote: > Benjamin Kaplan wrote: > >> I don't have a 64-bit machine, so I can only go off of what I read. This >> is >> from the AMD64 FAQ< >> http://www.amd.com/us-en/Processors/ProductInformation/0,,30_118_9331_13278,00.html#100

Re: Is there a faster way to do this?

2008-08-05 Thread Tomasz Rola
On Tue, 5 Aug 2008, [EMAIL PROTECTED] wrote: > I have a csv file containing product information that is 700+ MB in > size. I'm trying to go through and pull out unique product ID's only > as there are a lot of multiples. My problem is that I am appending the > ProductID to an array and then search

Re: Is there a faster way to do this?

2008-08-05 Thread Roy H. Han
Why not just use sets? a = set() a.add(1) a.add(2) On Tue, Aug 5, 2008 at 10:14 PM, RPM1 <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> >> I have a csv file containing product information that is 700+ MB in >> size. I'm trying to go through and pull out unique product ID's only >> as th

Re: Is there a faster way to do this?

2008-08-05 Thread RPM1
[EMAIL PROTECTED] wrote: I have a csv file containing product information that is 700+ MB in size. I'm trying to go through and pull out unique product ID's only as there are a lot of multiples. My problem is that I am appending the ProductID to an array and then searching through that array each

Re: Finding IP address of localhost via socket API (or other API)

2008-08-05 Thread David York
I'm going to look into the Internet Gateway Device protocol and see what it has to offer. If it is more work than it is work I'm going with Steven's suggestion (nice code BTW). And yes, you guys understood what I was asking - I wanted the internet IP address of my machine, not the local subnet fa

Re: Redirecting stderr and stdout to syslog

2008-08-05 Thread Lincoln Yeoh
At 03:29 AM 8/6/2008, Matthew Woodcraft wrote: In article <[EMAIL PROTECTED]>, > How do I redirect ALL stderr stuff to syslog, even stderr from > external programs that don't explicitly change their own stderr? Sending messages to syslog involves more than writing to a file descriptor, so there

Re: What Python looks like

2008-08-05 Thread Ben Finney
brad <[EMAIL PROTECTED]> writes: > Gary Herron wrote: > > > A page of Python code looks *clean*, with not a lot of > > punctuation/special symbols and (in particular) no useless lines > > containing {/} or begin/end or do/done (or whatever). > > what about all those 'self' thingys? :) Nice, cle

Re: pyprocessing/multiprocessing for x64?

2008-08-05 Thread Christian Heimes
Benjamin Kaplan wrote: I don't have a 64-bit machine, so I can only go off of what I read. This is from the AMD64 FAQ Welcome to the world of marketing. The FAQ just explains that AMD64 compatible proc

Re: pyprocessing/multiprocessing for x64?

2008-08-05 Thread Benjamin Kaplan
On Tue, Aug 5, 2008 at 8:05 PM, Christian Heimes <[EMAIL PROTECTED]> wrote: > Benjamin Kaplan wrote: > >> I'm not an expert on this, but I think that anything written for x86 (32 >> bit) machines can run on x64 machines. >> > > Become an export - say the opposite :) > > > I don't have a 64-bit mac

Re: string to type object (C)

2008-08-05 Thread Miles
On Tue, Aug 5, 2008 at 2:30 AM, castironpi <[EMAIL PROTECTED]> wrote: > I'm looking for a one-to-one function from strings to the built-in > data types in C. I will be keeping the string in a file. I need the > PyTypeObject* back from it. If nothing else I'll just do a bunch of > strcmp( "tuple"

Re: Finding IP address of localhost via socket API (or other API)

2008-08-05 Thread John Machin
On Aug 6, 9:51 am, Emile van Sebille <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > The only way I know of is to query an external server that will tell you. > > There's a few of them out there. Here's a few: > > >http://checkip.dyndns.org/ > >http://www.showmyip.com > >http://www.showmyip

pygame 1.8.1 released

2008-08-05 Thread illume
Hello, Stick a fork in it, it's baked... nice and toasty. A new version of pygame is out. http://www.pygame.org/ Pygame is a set of Python modules designed for writing games. Pygame adds functionality on top of the excellent SDL library. This allows you to create fully featured games and multimed

Re: pyprocessing/multiprocessing for x64?

2008-08-05 Thread Christian Heimes
Benjamin Kaplan wrote: I'm not an expert on this, but I think that anything written for x86 (32 bit) machines can run on x64 machines. Become an export - say the opposite :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding IP address of localhost via socket API (or other API)

2008-08-05 Thread Emile van Sebille
Steven D'Aprano wrote: The only way I know of is to query an external server that will tell you. There's a few of them out there. Here's a few: http://checkip.dyndns.org/ http://www.showmyip.com http://www.showmyip.com/simple/ http://whatismyip.org/ all four of these show my internal IP o

Re: Finding IP address of localhost via socket API (or other API)

2008-08-05 Thread Steven D'Aprano
Sorry for replying to the replier (Timothy) instead of the OP (David), but the original post seems to have been eaten by my ISP. On Tue, 05 Aug 2008 15:48:26 -0700, Timothy Grant wrote: > On Tue, Aug 5, 2008 at 2:50 PM, David York <[EMAIL PROTECTED]> wrote: >> Does anybody know how to find the r

Re: pyprocessing/multiprocessing for x64?

2008-08-05 Thread Benjamin Kaplan
On Tue, Aug 5, 2008 at 7:16 PM, pigmartian <[EMAIL PROTECTED]> wrote: > I recently learned (from I response on this newsgroup to an earlier query) > of the processing module for working with subprocesses in a similar manner > to threading. For what I needed to do, it worked great --- until I trie

Re: Trying to fix Invalid CSV File

2008-08-05 Thread John Machin
On Aug 5, 6:56 am, Larry Bates <[EMAIL PROTECTED]> wrote: > Ryan Rosario wrote: > > On Aug 4, 8:30 am, Emile van Sebille <[EMAIL PROTECTED]> wrote: > >> John Machin wrote: > >>> On Aug 4, 6:15 pm, Ryan Rosario <[EMAIL PROTECTED]> wrote: > On Aug 4, 1:01 am, John Machin <[EMAIL PROTECTED]> wrot

Re: URLs and ampersands

2008-08-05 Thread Steven D'Aprano
On Tue, 05 Aug 2008 12:07:39 +, Duncan Booth wrote: > Whenever you put a URL into an HTML file you need to escape it, so > naturally you will also need to unescape it when it is retrieved from > the file. However, whatever you use to parse the HMTL ought to be > unescaping text and attributes

pyprocessing/multiprocessing for x64?

2008-08-05 Thread pigmartian
I recently learned (from I response on this newsgroup to an earlier query) of the processing module for working with subprocesses in a similar manner to threading. For what I needed to do, it worked great --- until I tried to run my code on an x64 box, for which that module isn't available*.

Re: Finding IP address of localhost via socket API (or other API)

2008-08-05 Thread Christian Heimes
David York wrote: How do I find out my machine's IP address as visible to the outside world? Thanks a lot. Most modern routers home routers support the IGD part of UPnP (http://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol). You can use an UPnP client software to query the router for

Re: Finding IP address of localhost via socket API (or other API)

2008-08-05 Thread Diez B. Roggisch
Timothy Grant schrieb: On Tue, Aug 5, 2008 at 2:50 PM, David York <[EMAIL PROTECTED]> wrote: Does anybody know how to find the real IP address (e.g.: address visible to internet) of a machine via Python? In other words I have a machine with an IP address something like 192.168.1.5, an address g

Re: Finding IP address of localhost via socket API (or other API)

2008-08-05 Thread Timothy Grant
On Tue, Aug 5, 2008 at 2:50 PM, David York <[EMAIL PROTECTED]> wrote: > Does anybody know how to find the real IP address (e.g.: address visible to > internet) of a machine via Python? In other words I have a machine with an > IP address something like 192.168.1.5, an address given to me by a rout

Re: Dictionary to tree format (hopefully simple)

2008-08-05 Thread Diez B. Roggisch
Adam Powell schrieb: Hi! I have seemingly simple problem, which no doubt someone out there has already solved, but I'm stumped. Imagine I have a dictionary like below, in which the keys are parent nodes and the values are a list of children nodes. dict = { 0: [1, 2], 1: [3], 2: [6], 3: [4,7], 4:

Re: interpreter vs. compiled

2008-08-05 Thread Paul Boddie
On 5 Aug, 20:54, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > JIT has been around for decades now, it's well documented, well > understood, and quite common. Apart from Psyco, whose status is hopefully that of being revived somewhat [1], not quite common enough to permeate the most popular Python

Re: __new__

2008-08-05 Thread Ethan Furman
Rhamphoryncus wrote: On Aug 4, 11:46 am, Ethan Furman <[EMAIL PROTECTED]> wrote: Mel wrote: Ethan Furman wrote: Emile van Sebille wrote: Ethan Furman wrote: --> d25._int = (1, 5) Python considers names that start with a leading underscore as internal or private, and that abuse i

Dictionary to tree format (hopefully simple)

2008-08-05 Thread Adam Powell
Hi! I have seemingly simple problem, which no doubt someone out there has already solved, but I'm stumped. Imagine I have a dictionary like below, in which the keys are parent nodes and the values are a list of children nodes. dict = { 0: [1, 2], 1: [3], 2: [6], 3: [4,7], 4: [5,8], 8: [9] } Is th

Finding IP address of localhost via socket API (or other API)

2008-08-05 Thread David York
Does anybody know how to find the real IP address (e.g.: address visible to internet) of a machine via Python? In other words I have a machine with an IP address something like 192.168.1.5, an address given to me by a router. The router's address (and thus my machine's address) to the outside worl

Re: very large dictionary

2008-08-05 Thread Terry Reedy
Simon Strobl wrote: Well, as I was using Python, I did not expect to have to care about the language's internal affairs that much. I thought I could simply do always the same no matter how large my files get. In other words, I thought Python was really scalable. Python the language is indefi

Re: string to type object (C)

2008-08-05 Thread Terry Reedy
castironpi wrote: Hello, I'm looking for a one-to-one function from strings to the built-in data types in C. I will be keeping the string in a file. I need the PyTypeObject* back from it. Use a dict mapping py strings to the object pointers (cast to py ints). -- http://mail.python.org/mai

Re: robust optimisation

2008-08-05 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Dear all, I have a LP model here as follow: ... The constraints .15*x1 + .2*x2 +.15*x3 >= 100; .2*x1 + .05*x2 + .2*x3 >= 100; .25*x1 + .15*x2+ .05*x3 >= 150; have uncertainties in x1, x2, and x3 coefficients. I want to know how can I make a robust optimisation model

Re: Print statement isn't showing up?

2008-08-05 Thread Terry Reedy
Robert Dailey wrote: I have the following code: Python version? Plafform? def ReplaceExternalWithCopy( localDir, remoteDir ): print "Removing external local directory:", localDir rmdirs( localDir ) vfxrepo.copy( remoteDir, localDir ) I noticed that the print statement above do

Re: Inserting into a combo box

2008-08-05 Thread Casey McGinty
What toolkit are you using? -- http://mail.python.org/mailman/listinfo/python-list

Re: Psycho question

2008-08-05 Thread Erik Max Francis
David C. Ullrich wrote: Just heard about Psycho. I've often wondered why someone doesn't make something that does exactly what Psycho does - keen. Silly question: It's correct, is it not, that Psycho doesn't actually modify the Python installation, except by adding a module or two (so that code

Re: overriding file.readline: "an integer is required"

2008-08-05 Thread Terry Reedy
Gabriel Genellina wrote: def readline(self, size=None): if size == None: line = self.file.readline() else: line = self.file.readline(size) # etc., etc. Not obvious from the docs, but readline(-1) should be the same as readline(). (In 3.0b2, Non

Re: Print statement isn't showing up?

2008-08-05 Thread Robert Dailey
On Tue, Aug 5, 2008 at 2:28 PM, Timothy Grant <[EMAIL PROTECTED]>wrote: > On Tue, Aug 5, 2008 at 9:09 AM, Robert Dailey <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have the following code: > > > > > > def ReplaceExternalWithCopy( localDir, remoteDir ): > > print "Removing external local direc

Re: Redirecting stderr and stdout to syslog

2008-08-05 Thread Matthew Woodcraft
In article <[EMAIL PROTECTED]>, > How do I redirect ALL stderr stuff to syslog, even stderr from > external programs that don't explicitly change their own stderr? Sending messages to syslog involves more than writing to a file descriptor, so there's no way to make this happen without having som

Re: Print statement isn't showing up?

2008-08-05 Thread Timothy Grant
On Tue, Aug 5, 2008 at 9:09 AM, Robert Dailey <[EMAIL PROTECTED]> wrote: > Hi, > > I have the following code: > > > def ReplaceExternalWithCopy( localDir, remoteDir ): > print "Removing external local directory:", localDir > rmdirs( localDir ) > vfxrepo.copy( remoteDir, localDir ) > > I

Re: Link Checking Issues - Sub domains

2008-08-05 Thread Terry Reedy
rpupkin77 wrote: Hi, I have written this script to run as a cron that will loop through a text file with a list of urls. It works fine for most of the links, however there are a number of urls which are subdomains (they are government sites) such as http://basename.airforce.mil, these links ar

Re: interpreter vs. compiled

2008-08-05 Thread [EMAIL PROTECTED]
Regarding exploring processor instructions. Lets say you compile a C program targeting x86 architecture, with optimizations turned on for speed, and let the compiler automatic select MMX and SSE instructions for numeric code. I have now a program that executes very fast, and does what I want very

Re: Difference between type and class

2008-08-05 Thread Terry Reedy
Gabriel Genellina wrote: A decade ago, in 1.x, 'types' were built-in classes. They were instances of class 'type'. 'Classes' were user-defined classes. They were instances of (built-in) class 'classob'. User classes had the same status as instances of any other built-in class. They could o

Re: Brainwave: A Complete Web Platform With Database Out of the Box

2008-08-05 Thread Michael Mabin
Actually this is not my web site or my product. But this is the kind of tough love I'd like the creators to read. On Tue, Aug 5, 2008 at 10:36 AM, Avinash Vora <[EMAIL PROTECTED]> wrote: > On Aug 5, 2008, at 8:37 PM, Michael Mabin wrote: > > Brainwave is a complete Web Development Platform with a

Re: interpreter vs. compiled

2008-08-05 Thread Chris Mellon
On Tue, Aug 5, 2008 at 12:12 PM, castironpi <[EMAIL PROTECTED]> wrote: > On Aug 5, 9:21 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: >> On Aug 3, 1:26 am, castironpi <[EMAIL PROTECTED]> wrote: >> >> >> > Which is 12 bytes long and runs in a millisecond. What it does is set >> > a memory ad

Re: regex question

2008-08-05 Thread MRAB
On Aug 5, 11:39 am, Fred Mangusta <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to delete all the instances of a '.' into a number. > > In other words I'd like to replace all the instances of a '.' character > with something (say nothing at all) when the '.' is representing a > decimal separato

RE: Password prompt with mask

2008-08-05 Thread Neuberger, Sheldon N.
> Could I write my own if one does not exist? Take a look at the getpass.py module. It's very short. The windows version of the getpass function can be trivially modified to echo something. The unix version is just as short but a bit more complicated. def win_getpass(prompt='Password: ', stream=N

Re: proposal, change self. to .

2008-08-05 Thread Russ P.
On Aug 3, 5:44 am, Nick Dumas <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > It's also worth noting that you can use a different name for the object > that represents your class. If you did def __init__(foo):pass, then you > would be able to access the class's obje

Psycho question

2008-08-05 Thread David C. Ullrich
Just heard about Psycho. I've often wondered why someone doesn't make something that does exactly what Psycho does - keen. Silly question: It's correct, is it not, that Psycho doesn't actually modify the Python installation, except by adding a module or two (so that code not using Psycho is absolu

Re: Decimals not equalling themselves (e.g. 0.2 = 0.2000000001)

2008-08-05 Thread Dave
On 3 Aug, 15:02, CNiall <[EMAIL PROTECTED]> wrote: > However, with some, but not all, decimals, they do not seem to 'equal > themselves'. Back in my days studying electrical engineering I was pointed to this reference about floating point arithmetic - http://citeseer.ist.psu.edu/goldberg91what.ht

Re: proposal, change self. to .

2008-08-05 Thread Russ P.
On Aug 3, 4:10 am, "Heiko Wundram" <[EMAIL PROTECTED]> wrote: > Am 03.08.2008, 12:51 Uhr, schrieb Equand <[EMAIL PROTECTED]>: > > > how about changing the precious self. to . > > imagine > > > self.update() > > > .update() > > > simple right? > > What about: > > class x: > > def x(self,ob): >

Re: regex search loops instead of findall

2008-08-05 Thread Waldemar Osuch
On Aug 5, 12:06 pm, brad <[EMAIL PROTECTED]> wrote: > Hi guys... I'm trying to make my Python regex code behave like my C++ > regex code. In order to search large strings for *all* occurrences of > the thing I'm searching for, I loop like this in C++: > > void number_search(const std::string& porti

Re: Class definition attribute order

2008-08-05 Thread Terry Reedy
Michele Simionato wrote: BTW, since I do not really follow python-dev, do you know if some consensus was reached on the issue of adding an ordered dict implementation to the standard library? I thought there was to be one added to collections, where default_dict lives, but I do not remember

regex search loops instead of findall

2008-08-05 Thread brad
Hi guys... I'm trying to make my Python regex code behave like my C++ regex code. In order to search large strings for *all* occurrences of the thing I'm searching for, I loop like this in C++: void number_search(const std::string& portion, const boost::regex& Numbers) { boost::smatch m

Re: URLs and ampersands

2008-08-05 Thread Matthew Woodcraft
Gabriel Genellina wrote: > Steven D'Aprano wrote: >> I have searched for, but been unable to find, standard library >> functions that escapes or unescapes URLs. Are there any such >> functions? > Yes: cgi.escape/unescape, and xml.sax.saxutils.escape/unescape. I don't see a cgi.unescape in the st

Re: Python-URL! - weekly Python news and links (Jul 28)

2008-08-05 Thread Gabriel Genellina
En Tue, 05 Aug 2008 06:28:33 -0300, Bruno Desthuilliers <[EMAIL PROTECTED]> escribió: > Gabriel Genellina a écrit : >> QOTW: "Python's goals are to maximize opportunities for good >> programming, which is quite different." - Bruno Desthuilliers, contrasting >> Python with Java >> > > I'm afraid

How to troubleshoot hanging script?

2008-08-05 Thread kj
Hi! I have a Pythonoob question. I have a script that hangs indefinitely at random times; the only thing to do at this point is to kill it. I'm looking for suggestions on how to troubleshoot and debug the problem. I'm not even sure of where exactly the script is hanging, though I suspect it i

Re: Decimals not equalling themselves (e.g. 0.2 = 0.2000000001)

2008-08-05 Thread Gabriel Genellina
En Tue, 05 Aug 2008 11:50:43 -0300, schinckel <[EMAIL PROTECTED]> escribió: > I had a class today which dealt with Decimal <-> IEE754 conversion, > and > whilst 0.1 was an example that was converted, and a representation was > generated, no mention was made of the precision issue. > > I'm hoping t

Re: proposal, change self. to .

2008-08-05 Thread bearophileHUGS
Heiko Wundram: > > how about changing the precious self. to . > > imagine > > self.update() > > .update() > > simple right? I suggest you to start using Ruby instead. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: URLs and ampersands

2008-08-05 Thread Matthew Woodcraft
Steven D'Aprano wrote: > I'm using urllib.urlretrieve() to download HTML pages, and I've hit a > snag with URLs containing ampersands: > > http://www.example.com/parrot.php?x=1&y=2 > > Somewhere in the process, urls like the above are escaped to: > > http://www.example.com/parrot.php?x=1&y=2 > > w

Re: interpreter vs. compiled

2008-08-05 Thread castironpi
On Aug 5, 9:21 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Aug 3, 1:26 am, castironpi <[EMAIL PROTECTED]> wrote: > > > > Which is 12 bytes long and runs in a millisecond.  What it does is set > > a memory address to successive integers 0..9, then yields.  Due to the > > nature of progra

Password prompt with mask

2008-08-05 Thread Robert Dailey
Hi, I'm looking for something simple that I can use to obtain passwords from the user. Something like input(), but with an option to set the mask character. So if I set it to "*", then all the user will see is: ** as they type their password. I know about getpass.getpass(), but I want somethin

Re: URLs and ampersands

2008-08-05 Thread Gabriel Genellina
En Tue, 05 Aug 2008 06:59:20 -0300, Steven D'Aprano <[EMAIL PROTECTED]> escribió: > On Mon, 04 Aug 2008 23:16:46 -0300, Gabriel Genellina wrote: > >> En Mon, 04 Aug 2008 20:43:45 -0300, Steven D'Aprano >> <[EMAIL PROTECTED]> escribi�: >> >>> I'm using urllib.urlretrieve() to download HTML pages,

Re: Is there a faster way to do this?

2008-08-05 Thread Gary Herron
Avinash Vora wrote: On Aug 5, 2008, at 10:00 PM, [EMAIL PROTECTED] wrote: I have a csv file containing product information that is 700+ MB in size. I'm trying to go through and pull out unique product ID's only as there are a lot of multiples. My problem is that I am appending the ProductID to

Re: Is there a faster way to do this?

2008-08-05 Thread Avinash Vora
On Aug 5, 2008, at 10:00 PM, [EMAIL PROTECTED] wrote: I have a csv file containing product information that is 700+ MB in size. I'm trying to go through and pull out unique product ID's only as there are a lot of multiples. My problem is that I am appending the ProductID to an array and then sea

Re: Doubts about how implementing asynchronous timeouts through a heap

2008-08-05 Thread Josiah Carlson
On Jul 12, 12:16 pm, Josiah Carlson <[EMAIL PROTECTED]> wrote: > On Jul 9, 4:13 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > I'm trying to implement an asynchronous scheduler forasyncoreto call > > functions at a later time without blocking the main loop. > > The logic behin

Re: Is there a faster way to do this?

2008-08-05 Thread Gary Herron
[EMAIL PROTECTED] wrote: I have a csv file containing product information that is 700+ MB in size. I'm trying to go through and pull out unique product ID's only as there are a lot of multiples. My problem is that I am appending the ProductID to an array and then searching through that array each

Is there a faster way to do this?

2008-08-05 Thread [EMAIL PROTECTED]
I have a csv file containing product information that is 700+ MB in size. I'm trying to go through and pull out unique product ID's only as there are a lot of multiples. My problem is that I am appending the ProductID to an array and then searching through that array each time to see if I've seen t

Re: Questions about asyncore

2008-08-05 Thread Josiah Carlson
On Jul 29, 4:09 am, Frank Millman <[EMAIL PROTECTED]> wrote: > Hi all > > I have been using my own home-brewed client/server technique for a > while, using socket and select. It seems to work ok. The server can > handle multiple clients. It does this by creating a new thread for > each connection.

Print statement isn't showing up?

2008-08-05 Thread Robert Dailey
Hi, I have the following code: def ReplaceExternalWithCopy( localDir, remoteDir ): print "Removing external local directory:", localDir rmdirs( localDir ) vfxrepo.copy( remoteDir, localDir ) I noticed that the print statement above does not show up before vfxrepo.copy() is called. t

Re: proposal, change self. to .

2008-08-05 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Nick Dumas <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > It's also worth noting that you can use a different name for the object > that represents your class. If you did def __init__(foo):pass, then you > would be able to access

Re: PIL (etc etc etc) on OS X

2008-08-05 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Irmen de Jong <[EMAIL PROTECTED]> wrote: > > > David C. Ullrich wrote: > > > Decided to try to install PIL on my Mac (OS X.5). > > > > > > I know nothing about installing programs

Re: PIL (etc etc etc) on OS X

2008-08-05 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Irmen de Jong <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > Just as well that the message sent earlier today > > seems to have been lost... > > > > Ok. Read your instructions on libjpeg. Read some > > of the install.doc. ./configure, fine. make, fine. >

Re: Python FTP - NameError: name 'mydpa' is not defined

2008-08-05 Thread Ej
Hi Fredrik, Thanks so much for you quick help!!! I googled the os.rename you gave me and I found solution to solve my problem. You made my day! On Aug 5, 10:37 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Ej wrote: > > I have a similar problem. I need to download the same file every hour >

Re: Brainwave: A Complete Web Platform With Database Out of the Box

2008-08-05 Thread Avinash Vora
On Aug 5, 2008, at 8:37 PM, Michael Mabin wrote: Brainwave is a complete Web Development Platform with a DDL-free database. Its application server is built on CherryPy. It comes already bundled with Cheetah and Mako templating engines. And its database is its true gem. You aren't differ

Re: PIL (etc etc etc) on OS X

2008-08-05 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Kevin Walzer <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > Just as well that the message sent earlier today > > seems to have been lost... > > > > Ok. Read your instructions on libjpeg. Read some > > of the install.doc. ./configure, fine. make, fine. >

Link Checking Issues - Sub domains

2008-08-05 Thread rpupkin77
Hi, I have written this script to run as a cron that will loop through a text file with a list of urls. It works fine for most of the links, however there are a number of urls which are subdomains (they are government sites) such as http://basename.airforce.mil, these links are always throwing 400

Re: Any tips on Python web development on Mac OS

2008-08-05 Thread Tim Greening-Jackson
Bruno Desthuilliers wrote: Tim Greening-Jackson a écrit : (snip) You're not going to get anywhere without learning (x)html and css IMHO. Even using a "graphical" html editor like Dreamweaver requires having a good enough (IOW : being able to do it all by hand) knowledge of these languages. W

Re: What Python looks like

2008-08-05 Thread Brett Ritter
On Aug 4, 3:43 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > A page of Python code looks *clean*,  with not a lot of > punctuation/special symbols and (in particular) no useless lines I am actually going to buck the trend. My first impression of Python was that it was visually hard to parse. When

Brainwave: A Complete Web Platform With Database Out of the Box

2008-08-05 Thread Michael Mabin
What do you all think of this? Brainwave is a complete Web Development Platform with a DDL-free database. Its application server is built on CherryPy. It comes already bundled with Cheetah and Mako templating engines. And its database is its true gem. The database is built on a "neural" model.

Re: Strange return behavior for function

2008-08-05 Thread Robert Dailey
On Tue, Aug 5, 2008 at 10:05 AM, Robert Dailey <[EMAIL PROTECTED]> wrote: > Hi, > > I've created a function to normalize Subversion URLs, however when I return > a string, printing the result of the function becomes "None". When I print > the value of the string before I return from the function,

Strange return behavior for function

2008-08-05 Thread Robert Dailey
Hi, I've created a function to normalize Subversion URLs, however when I return a string, printing the result of the function becomes "None". When I print the value of the string before I return from the function, I see a valid string. What's going on? The function is below: def normurl( url_roo

Re: regex question

2008-08-05 Thread Fred Mangusta
Chris wrote: Doesn't work for his use case as he wants to keep periods marking the end of a sentence. Exactly. Thanks to all of you anyway, now I have a better understanding on how to go on :) F. -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimals not equalling themselves (e.g. 0.2 = 0.2000000001)

2008-08-05 Thread schinckel
On Aug 5, 3:26 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 03 Aug 2008 19:57:10 -0300, Grant Edwards <[EMAIL PROTECTED]>   > escribi : > > > On 2008-08-03, Larry Bates <[EMAIL PROTECTED]> wrote: > > >> What are they teaching in computer science classes these days? > > > When I was

Re: What Python looks like

2008-08-05 Thread Tyler Breisacher
To paraphrase this video (http://www.youtube.com/watch?v=zJOS0sV2a24) (which is the Randall Munroe, author of the famous xkcd (http://www.xkcd.com/), giving a talk at Google), "you just type the pseudo-code and it runs! And as someone said, if Python is executable pseudo-code, then Perl is exec

Re: Python FTP - NameError: name 'mydpa' is not defined

2008-08-05 Thread Fredrik Lundh
Ej wrote: I have a similar problem. I need to download the same file every hour so it will be nice to be able to rename the downloads with a variable name. For example in this case: from ftplib import FTP ftp=FTP('tgftp.nws.noaa.gov') ftp.login() ftp.cwd('SL.us008001/DF.of/DC.radar/DS.81dpr/SI.

Re: Getting mod_python to Work

2008-08-05 Thread jpuopolo
On Aug 5, 8:44 am, jpuopolo <[EMAIL PROTECTED]> wrote: > Hi, all... > > I am hoping that someone can help me with the magic incantation to get > mod_python working on my local machine. > > Set up: Apache 2.2.9, mod_python 3.3.1 on Windows Vista (yes, pity > me). > > I've gotten the basic mptest.py

Re: interpreter vs. compiled

2008-08-05 Thread [EMAIL PROTECTED]
On Aug 3, 1:26 am, castironpi <[EMAIL PROTECTED]> wrote: > On Aug 2, 2:02 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > > > castironpi <[EMAIL PROTECTED]> wrote: > > > >And furthermore, I think I'm getting > > >confused about what exactly constitutes an interpreter: it is whether > > >there is a pro

How to do CPU/Memory benchmarking in Python?

2008-08-05 Thread Omer Khalid
Hi, I have few long running python based scripts which does lots of number crunching; I would like to bench mark the CPU/Memory/IO for that script. I am wondering if there is a python benchmarking suite available? There is pybench but it more or less test the executing script it self from Python's

Re: Python FTP - NameError: name 'mydpa' is not defined

2008-08-05 Thread Ej
I have a similar problem. I need to download the same file every hour so it will be nice to be able to rename the downloads with a variable name. For example in this case: from ftplib import FTP ftp=FTP('tgftp.nws.noaa.gov') ftp.login() ftp.cwd('SL.us008001/DF.of/DC.radar/DS.81dpr/SI.kbuf') ftp.

Python-URL! - weekly Python news and links (Aug 5)

2008-08-05 Thread Gabriel Genellina
QOTW: "As a project manager, I have never had trouble finding people with crazy ideas. I have trouble finding people who can execute. IOW, 'innovation' is way oversold. And it sure as hell shouldn't be applied to products like MS Word or Open office." - Linus http://www.simple-talk.com/opin

Re: Are makepy-generated COM wrapper classes distributable?

2008-08-05 Thread gundlach
On Aug 4, 2:24 am, gundlach <[EMAIL PROTECTED]> wrote: > Can I somehow bundle the generated modules into my > setuptools package so that the wrappers are installed at the same > time?  (If so, how -- just copy them into the package directory?)  Or > are the wrappers targeted to my machine or instal

Redirecting stderr and stdout to syslog

2008-08-05 Thread Lincoln Yeoh
Hi, I've just started to learn python (I've been using perl for some years). How do I redirect ALL stderr stuff to syslog, even stderr from external programs that don't explicitly change their own stderr? Say I have a program called foo: #!/usr/bin/python import syslog import os, sys class l

  1   2   >