Re: Teething troubles with Python on a Mac

2008-08-03 Thread greg
Thomas Philips wrote: Question 1: How can I locate the Python installation? There a few files under Applications MacPython 2.5, but this is clearly not the entire installation. Have a look in /Library/Frameworks/Python.framework/Versions/2.5 But I do not seem to be able to see the

Re: why goes the time change after import statement ?

2008-08-03 Thread binaryjesus
On Aug 3, 1:46 am, Paul Hankin [EMAIL PROTECTED] wrote: On Aug 2, 10:35 pm, binaryjesus [EMAIL PROTECTED] wrote: hi i am working on a S3 project and facing a really weird problem! take a look at the following import statements and the time output import time time.strftime(%a, %d %b

Re: SMTP via GMAIL

2008-08-03 Thread binaryjesus
i have a lot of experience in gmail. i use it to store 100GB's of server backup on it. the form: field will be equal to the gmail acc u login with. you are not clear with ur cc: so i cant offer any help on it. but u can include multiple addresses in the To: and use Bcc: since python doesnt

Re: raw_input on several lines

2008-08-03 Thread Raja Baz
On Sat, 02 Aug 2008 21:58:09 +0200, TP wrote: Hi everybody, When using raw_input(), the input of the user ends when he types Return on his keyboard. How can I change this behavior, so that another action is needed to stop the input? For example, CTRL-G. It would allow the user to input

Re: Multiline text in XML file

2008-08-03 Thread Stefan Behnel
King wrote: Is there any other way to define multiline text in a XML file: Help![CDATA[ multiline multiline multiline multiline ... ]] /Help Yes, without the CDATA, for example. XML doesn't treat line ending characters any different from other characters. I have no idea what you are

Re: Attack a sacred Python Cow

2008-08-03 Thread Michele Simionato
On Jul 28, 8:46 pm, Russ P. [EMAIL PROTECTED] wrote: Letting self (or whatever the first argument was) be implied in .cat does absolutely *NOTHING* to change the internal workings of the Python interpreter. It's a very simple idea that you insist on making complicated. As I said, I could write

Re: Teething troubles with Python on a Mac

2008-08-03 Thread Avi
Apart from the initial installation of Python itself, I never use an installer to install a Python package if I can avoid it. I wouldn't trust it to install into the right Python version. On that: how would I go about updating the system Python, then? Or is that going to be stuck at whatever

Re: Attack a sacred Python Cow

2008-08-03 Thread Michele Simionato
On Aug 3, 9:29 am, Michele Simionato [EMAIL PROTECTED] wrote: On Jul 28, 8:46 pm, Russ P. [EMAIL PROTECTED] wrote: Letting self (or whatever the first argument was) be implied in .cat does absolutely *NOTHING* to change the internal workings of the Python interpreter. It's a very simple

Re: base-96

2008-08-03 Thread Kless
On 3 ago, 00:16, Tim Roberts [EMAIL PROTECTED] wrote: Kless [EMAIL PROTECTED] wrote: I think that would be very interesting thay Python would have a module for working on base 96 too. [1] Well, then, write one. However, I'm not sure I see the point.  Base 64 is convenient because 6 bits

Re: base-96

2008-08-03 Thread Kless
On 3 ago, 00:33, Terry Reedy [EMAIL PROTECTED] wrote: seehttp://en.wikipedia.org/wiki/Base-85 for something more practical In this thread [1] --a mirror group of python-dev mailing list-- where I sent the same post, has been named too that enconding way. [1]

Re: base-96

2008-08-03 Thread Kless
On 3 ago, 00:31, Tim Roberts [EMAIL PROTECTED] wrote: Whether it creates problems depends on how you intend to use it.  The biggest use for Base64, for instance, is in translating binary files to a form where they can be send via email using only printable characters.  If you use a

Project Question

2008-08-03 Thread ToshiBoy
I'm a newbie to Python... well a newbie to programming, really. I know the basics and try to learn by setting myself simple tasks and goals just to find out if I can work out a way to code the solutions. Works for me. However, now I've set my eyes on a more ambitious project: We sell office

Re: why goes the time change after import statement ?

2008-08-03 Thread Paul Hankin
On Aug 3, 8:12 am, binaryjesus [EMAIL PROTECTED] wrote: On Aug 3, 1:46 am, Paul Hankin [EMAIL PROTECTED] wrote: On Aug 2, 10:35 pm, binaryjesus [EMAIL PROTECTED] wrote: hi i am working on a S3 project and facing a really weird problem! take a look at the following import statements

Re: Genetic programming: pygene, pygp, AST, or (gasp) Lisp?

2008-08-03 Thread John Ladasky
Thanks to everyone who replied. I haven't chosen a definite direction for my project yet. But you have given me some good leads. Google Books offers previews of many pages of John Koza's book, published in the early 1990's. I'm reading through the preview pages, with the idea of purchasing a

Re: How to redirect operation methods to some sepcific method easily?

2008-08-03 Thread Steven D'Aprano
On Sun, 03 Aug 2008 02:44:34 -0700, Victor Lin wrote: Now, here comes the problem : I have to override all the operation methods, such as __add__ and __mul__. I know the most stupid way is just to write all of them like this. def __add__(self, other): self.leftOperation('add', other)

How to redirect operation methods to some sepcific method easily?

2008-08-03 Thread Victor Lin
Hi, I'd like to write some class that can help me build reusable formula easily, some simple code like this. # -*- coding: utf8 -*- class OperationResult: def __init__(self, left, right): self.dataSource = dataSource def __add__(self, other):

Re: Attack a sacred Python Cow

2008-08-03 Thread Paul McGuire
On Jul 31, 6:15 pm, Paul McGuire [EMAIL PROTECTED] wrote: On Jul 28, 12:15 pm, Kay Schluehr [EMAIL PROTECTED] wrote: On 28 Jul., 06:42, Russ P. [EMAIL PROTECTED] wrote: On Jul 27, 8:58 pm, castironpi [EMAIL PROTECTED] wrote: On Jul 27, 2:39 pm, Bruno Desthuilliers [EMAIL

Re: current week / weeks in year - best practice

2008-08-03 Thread egbert
On Sat, Aug 02, 2008 at 07:46:49PM -0700, Dennis Lee Bieber wrote: heh What is the meaning of heh ? e. -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 --

Re: Multiline text in XML file

2008-08-03 Thread Pete Kirkham
http://www.w3.org/TR/REC-xml/#sec-white-space is relevant, as is the following section on handling carriage returns. Don't mix C escapes \n and XML markup - there really is is no point, and it reduces the portability of the XML. XML lets you put carriage returns in without excapes into text, and

proposal, change self. to .

2008-08-03 Thread Equand
how about changing the precious self. to . imagine self.update() .update() simple right? -- http://mail.python.org/mailman/listinfo/python-list

HELP with PIL and grainy text

2008-08-03 Thread Huuuze
I could really use some help. Please take a look at the following image: http://img227.imageshack.us/img227/1346/grainynn3.png As you can see, the text in the image is fairly grainy. To get to that point, I converted an ArialBold TTF to a BDF using otf2bdf

Re: Profiling weirdness: Timer.timeit(), fibonacci and memoization

2008-08-03 Thread ssecorp
I think you are confusing 2 people in this thread but that doesn't really matter. What surprised me was that I didn't think fib would benefit from memoization because it didn't repeat the same calculations. fibmem without memoization is the classic naive implementation that grows exponentially and

Re: proposal, change self. to .

2008-08-03 Thread Heiko Wundram
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): ob.doSomethingWith(self) ? Not so simple anymore, isn't it? If you're not trolling,

Re: proposal, change self. to .

2008-08-03 Thread Nick Dumas
-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 objects with foo.objectname. Using self is simply the recommended

Re: scanf in python

2008-08-03 Thread [EMAIL PROTECTED]
On Jul 22, 2:00 pm, AMD [EMAIL PROTECTED] wrote: Hello Fredrik, I didn't think my comment would offend anyone [...] I doubt that it offended anyone else. Having been the recipient of a few F-bombs :-) myself, I'd just let it go by... Mike --

Re: Project Question

2008-08-03 Thread Simon Brunning
2008/8/3 ToshiBoy [EMAIL PROTECTED]: Currently, I'm using iMacro, an add-on to Firefox, which runs a macro and enters all the info. It's great, but I would like to try and write a program for this in Python. It needs to collect some user input at the beginning, and then open the default web

Re: scanf in python

2008-08-03 Thread castironpi
On Aug 3, 8:27 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Jul 22, 2:00 pm, AMD [EMAIL PROTECTED] wrote: Hello Fredrik, I didn't think my comment would offend anyone [...] I doubt that it offended anyone else.  Having been the recipient of a few F-bombs :-) myself, I'd just let it

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

2008-08-03 Thread CNiall
I am very new to Python (I started learning it just yesterday), but I have encountered a problem. I want to make a simple script that calculates the n-th root of a given number (e.g. 4th root of 625--obviously five, but it's just an example :P), and because there is no nth-root function in

Re: Profiling weirdness: Timer.timeit(), fibonacci and memoization

2008-08-03 Thread Rob Williscroft
Steven D'Aprano wrote in news:[EMAIL PROTECTED] in comp.lang.python: So the question is: whats going on with timeit.Timer ? As far as I can see, nothing. I think you have misunderstood the results you got. No, the answer is that is it repeats a million times. It might better be called

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

2008-08-03 Thread Diez B. Roggisch
CNiall schrieb: I am very new to Python (I started learning it just yesterday), but I have encountered a problem. I want to make a simple script that calculates the n-th root of a given number (e.g. 4th root of 625--obviously five, but it's just an example :P), and because there is no

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

2008-08-03 Thread Edwin . Madari
for nth square root: use math.sqrt n times for example import math num = 625 how_many_sqrt = 2 for i in range(how_many_sqrt): .. num = math.sqrt(num) .. num 5.0 all comparisons work fine for arbitrary floating point numbers... For readability print them with required precision. for

__new__

2008-08-03 Thread Ethan Furman
Greetings, List! I was browsing through the Decimal source today, and found this: # We're immutable, so use __new__ not __init__ def __new__. . . self = object.__new__(cls) . . . return self Out of curiousity I then tried this: -- import

Re: Error:can't assign to operator

2008-08-03 Thread Emile van Sebille
Dennis Lee Bieber wrote: just an fyi self.towers = [ list(reversed(range(self.numDisks))), or range(self.numDisks-1,-1,-1) Emile -- http://mail.python.org/mailman/listinfo/python-list

Re: Teething troubles with Python on a Mac

2008-08-03 Thread Timothy Grant
On Sun, Aug 3, 2008 at 12:37 AM, Avi [EMAIL PROTECTED] wrote: Apart from the initial installation of Python itself, I never use an installer to install a Python package if I can avoid it. I wouldn't trust it to install into the right Python version. On that: how would I go about updating the

Re: __new__

2008-08-03 Thread Emile van Sebille
Ethan Furman wrote: -- d25._int = (1, 5) Python considers names that start with a leading underscore as internal or private, and that abuse is the burden of the abuser... Is bytecodehacks still around? That was serious abuse :) Emile --

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

2008-08-03 Thread Tommy Nordgren
On 3 aug 2008, at 17.16, [EMAIL PROTECTED] wrote: for nth square root: use math.sqrt n times for example Ehum. The OP wants to compute the nth root ( not the nth square root) import math num = 625 how_many_sqrt = 2 for i in range(how_many_sqrt): .. num = math.sqrt(num) ..

module for generating captcha images

2008-08-03 Thread Irmen de Jong
Hi, I wanted to generate Captcha images(*) from Python and I couldn't find any module that suited my needs so I made one myself. It only needs PIL. (I used PIL 1.1.6) It can generate images with a provided background or it can make a random background for you. It needs a truetype font to

Re: Teething troubles with Python on a Mac

2008-08-03 Thread Avinash Vora
You will likely cause more problems updating the system python than managing the two separate installations. That's sadly worrying. OSX relies on the version of python they ship. I think that helps my point--there *are* bug fixes between major versions despite the new language changes,

Re: Teething troubles with Python on a Mac

2008-08-03 Thread Timothy Grant
On Sun, Aug 3, 2008 at 10:44 AM, Avinash Vora [EMAIL PROTECTED] wrote: You will likely cause more problems updating the system python than managing the two separate installations. That's sadly worrying. OSX relies on the version of python they ship. I think that helps my point--there *are*

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

2008-08-03 Thread Diez B. Roggisch
CNiall schrieb: I am very new to Python (I started learning it just yesterday), but I have encountered a problem. I want to make a simple script that calculates the n-th root of a given number (e.g. 4th root of 625--obviously five, but it's just an example :P), and because there is no

Using two pythons in an application

2008-08-03 Thread Allen
I'm in the process of developing an application that will use Python for a scripting support. In light of the upcoming changes to Python, I was wondering if it is possible to link to and use two different versions of Python so that in the future, scripts could be migrated to the new version,

Re: ANN: pyspread 0.0.8

2008-08-03 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: On Sat, 02 Aug 2008 13:39:25 -0400 Colin J. Williams [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: pyspread 0.0.8 has been released. Are you planning any documentation? Actually, yes. 0.0.10 will feature some docs. Any help writing and doing the layout is

Re: Using two pythons in an application

2008-08-03 Thread Jorgen Grahn
On Sun, 03 Aug 2008 14:01:49 -0400, Allen [EMAIL PROTECTED] wrote: I'm in the process of developing an application that will use Python for a scripting support. In light of the upcoming changes to Python, I was wondering if it is possible to link to and use two different versions of

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

2008-08-03 Thread Jorgen Grahn
On Sun, 03 Aug 2008 16:50:22 +0200, Diez B. Roggisch [EMAIL PROTECTED] wrote: CNiall schrieb: ... 0.2 0.20001 ... Welcome to the wonderful world of IEEE754. Just because other languages shield you from the gory details they still are there. Python chose to not do that,

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

2008-08-03 Thread Diez B. Roggisch
Jorgen Grahn schrieb: On Sun, 03 Aug 2008 16:50:22 +0200, Diez B. Roggisch [EMAIL PROTECTED] wrote: CNiall schrieb: ... 0.2 0.20001 ... Welcome to the wonderful world of IEEE754. Just because other languages shield you from the gory details they still are there. Python chose

Re: Strong/weak typing

2008-08-03 Thread Jorgen Grahn
On Fri, 01 Aug 2008 22:47:04 -0400, Mel [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I'm writing Python as if it were strongly typed, never recycling a name to hold a type other than the original type. Is this good software engineering practice, or am I missing something Pythonic?

My Python error...

2008-08-03 Thread SaMTHG
Basically I have Mac OS X 10.4.11 and I've got python 2.5. When I go to TextEdit and type in something like #!/usr/bin/env python print 2+2 and save it as simplescript.py. Then I go to terminal and cd my way to the dir that the script source is in and type: python simplescript.py And the output

Re: very large dictionary

2008-08-03 Thread Jorgen Grahn
On Fri, 1 Aug 2008 01:05:07 -0700 (PDT), Simon Strobl [EMAIL PROTECTED] wrote: What does load a dictionary mean? I had a file bigrams.py with a content like below: bigrams = { , djy : 75 , , djz : 57 , , djzoom : 165 , , dk : 28893 , , dk.au : 854 , , dk.b. : 3668 , ... } In

Re: My Python error...

2008-08-03 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: Basically I have Mac OS X 10.4.11 and I've got python 2.5. When I go to TextEdit and type in something like #!/usr/bin/env python print 2+2 and save it as simplescript.py. Then I go to terminal and cd my way to the dir that the script source is in and type: python

Re: very large dictionary

2008-08-03 Thread Jorgen Grahn
On 3 Aug 2008 20:36:33 GMT, Jorgen Grahn [EMAIL PROTECTED] wrote: On Fri, 1 Aug 2008 01:05:07 -0700 (PDT), Simon Strobl [EMAIL PROTECTED] wrote: ... If there is no other way to do it, I will have to learn how to use databases in Python. If you use Berkeley DB (import bsddb), you don't have

Re: Project Question

2008-08-03 Thread ToshiBoy
Great, I think that's exactly what I'm after. Thank you! Simon Brunning wrote: 2008/8/3 ToshiBoy [EMAIL PROTECTED]: Currently, I'm using iMacro, an add-on to Firefox, which runs a macro and enters all the info. It's great, but I would like to try and write a program for this in Python. It

Re: [unittest] Run setUp only once

2008-08-03 Thread Jorgen Grahn
On Tue, 29 Jul 2008 20:12:14 +0200, Nikolaus Rath [EMAIL PROTECTED] wrote: Jean-Paul Calderone [EMAIL PROTECTED] writes: On Tue, 29 Jul 2008 19:26:09 +0200, Nikolaus Rath [EMAIL PROTECTED] wrote: Jean-Paul Calderone [EMAIL PROTECTED] writes: On Tue, 29 Jul 2008 16:35:55 +0200, Nikolaus Rath

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

2008-08-03 Thread Dan Bishop
On Aug 3, 9:02 am, CNiall [EMAIL PROTECTED] wrote: I am very new to Python (I started learning it just yesterday), but I have encountered a problem. I want to make a simple script that calculates the n-th root of a given number (e.g. 4th root of 625--obviously five, but it's just an example

How do I find out from inside pdb which namespace contains an object?

2008-08-03 Thread Jonathan Mark
I am inside a Pdb-like Plone debugging tool and I get the following error at the prompt. I was wondering how to find out from inside the debugger which namespace the collective.dancing.channel object is located in. : collective.dancing.channel.tool_added(DelegateNichols.portal_newsletters, None)

Re: very large dictionary

2008-08-03 Thread member thudfoo
On 3 Aug 2008 20:40:02 GMT, Jorgen Grahn [EMAIL PROTECTED] wrote: On 3 Aug 2008 20:36:33 GMT, Jorgen Grahn [EMAIL PROTECTED] wrote: On Fri, 1 Aug 2008 01:05:07 -0700 (PDT), Simon Strobl [EMAIL PROTECTED] wrote: ... If there is no other way to do it, I will have to learn how to use

Re: ANN: pyspread 0.0.8

2008-08-03 Thread Martin Manns
On Sun, 03 Aug 2008 14:25:11 -0400 Colin J. Williams [EMAIL PROTECTED] wrote: I've copied your tutorial in my site-packages\pyspread directory I wrote the tutorial in this thread as a step by step guide that can be followed manually. You do not need to put it anywhere on your hard drive. Start

Re: ANN: pyspread 0.0.8

2008-08-03 Thread Colin J. Williams
Martin Manns wrote: On Sun, 03 Aug 2008 14:25:11 -0400 Colin J. Williams [EMAIL PROTECTED] wrote: I've copied your tutorial in my site-packages\pyspread directory I wrote the tutorial in this thread as a step by step guide that can be followed manually. You do not need to put it anywhere on

Keg - A python web framework

2008-08-03 Thread eghansah
Hi, I've been working on a python web framework which I think might be of interest to you. Details may be found at http://code.google.com/p/keg/wiki/Concept. All suggestions or comments will be greatly appreciated. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

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

2008-08-03 Thread Larry Bates
CNiall wrote: I am very new to Python (I started learning it just yesterday), but I have encountered a problem. I want to make a simple script that calculates the n-th root of a given number (e.g. 4th root of 625--obviously five, but it's just an example :P), and because there is no nth-root

from Tkinter import *,win = Tk() from Tkinter import *

2008-08-03 Thread Pierre Dagenais
from Tkinter import * win = Tk() If I type those two lines at the command prompt (in WindowsXP) I get a new window on my screen. Yet if I copy those lines in a file called test.py and then run python test.py at the command prompt I am returned to the command prompt and nothing shows up on

Re: Using two pythons in an application

2008-08-03 Thread Larry Bates
Allen wrote: I'm in the process of developing an application that will use Python for a scripting support. In light of the upcoming changes to Python, I was wondering if it is possible to link to and use two different versions of Python so that in the future, scripts could be migrated to the

Inserting into a combo box

2008-08-03 Thread Brandon
I'm attempting to insert items into a combo box, but when it goes to run it, throws up the error: TypeError: argument 1 of QComboBox.insertItem() has an invalid type and here is what I'm trying to do: self.editUsername.insertItem(uname) editUsername is the combo box, and uname is a string I'm

Re: from Tkinter import *,win = Tk() from Tkinter import *

2008-08-03 Thread Larry Bates
Pierre Dagenais wrote: from Tkinter import * win = Tk() If I type those two lines at the command prompt (in WindowsXP) I get a new window on my screen. Yet if I copy those lines in a file called test.py and then run python test.py at the command prompt I am returned to the command prompt

Re: very large dictionary

2008-08-03 Thread Avinash Vora
On Aug 4, 2008, at 4:12 AM, Jörgen Grahn wrote: (You might want to post this to comp.lang.python rather than to me -- I am just another c.l.p reader. If you already have done to, please disregard this.) Yeah, I hit reply by mistake and didn't realize it. My bad. (I assume here that

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

2008-08-03 Thread Fuzzyman
On Aug 3, 3:02 pm, CNiall [EMAIL PROTECTED] wrote: I am very new to Python (I started learning it just yesterday), but I have encountered a problem. I want to make a simple script that calculates the n-th root of a given number (e.g. 4th root of 625--obviously five, but it's just an example

Re: __new__

2008-08-03 Thread Ethan Furman
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 is the burden of the abuser... Is bytecodehacks still around? That was serious abuse :) Emile Good point. What I'm

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

2008-08-03 Thread Grant Edwards
On 2008-08-03, Larry Bates [EMAIL PROTECTED] wrote: However, it appears that when n in 1/n is a power of two, the decimal does not get 'thrown off'. How might I make Python recognise 0.2 as 0.2 and not 0.20001? This discrepancy is very minor, but it makes the whole n-th root

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

2008-08-03 Thread Steven D'Aprano
On Sun, 03 Aug 2008 17:30:29 -0500, Larry Bates wrote: As you can see, the last two decimals are very slightly inaccurate. However, it appears that when n in 1/n is a power of two, the decimal does not get 'thrown off'. How might I make Python recognise 0.2 as 0.2 and not 0.20001?

Re: Profiling weirdness: Timer.timeit(), fibonacci and memoization

2008-08-03 Thread Steven D'Aprano
On Sun, 03 Aug 2008 09:46:45 -0500, Rob Williscroft wrote: Steven D'Aprano wrote in news:[EMAIL PROTECTED] in comp.lang.python: So the question is: whats going on with timeit.Timer ? As far as I can see, nothing. I think you have misunderstood the results you got. No, the answer is

Re: __new__

2008-08-03 Thread Calvin Spealman
its a good point you make. if its not _technically_ immutable, why use __new__ when __init__ would work just as fine? well, if it should be treated as immutable, then we should do what we can to follow that, even in internal code that knows otherwise. Besides, maybe down the road, protections will

Re: How do I find out from inside pdb which namespace contains an object?

2008-08-03 Thread Jonathan Mark
Never mind. I had to run import collective.dancing first. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using two pythons in an application

2008-08-03 Thread Allen
Larry Bates wrote: Allen wrote: I'm in the process of developing an application that will use Python for a scripting support. In light of the upcoming changes to Python, I was wondering if it is possible to link to and use two different versions of Python so that in the future, scripts

Re: Teething troubles with Python on a Mac

2008-08-03 Thread greg
Avi wrote: On that: how would I go about updating the system Python, then? The usual advice is not to try to do that at all. Generally it's best to treat anything in /System as off-limits. (I used to do so, but it caused so many issues with installing new packages that I gave up on it)

PyWorks Call for Papers extended

2008-08-03 Thread Brian Jones
For those who don't follow PlanetPython, Python Magazine, OnLAMP, or some of the other Python news/blog outlets, PyWorks is a Python conference being held November 12-14, 2008, in Atlanta, by MTA (publisher of Python Magazine). The call for papers has been what I would call a success, but I've

Trying to fix Invalid CSV File

2008-08-03 Thread Ryan Rosario
I have a very large CSV file that contains double quoted fields (since they contain commas). Unfortunately, some of these fields also contain other double quotes and I made the painful mistake of forgetting to escape or double the quotes inside the field: 123,Here is some, text and some quoted

Re: Teething troubles with Python on a Mac

2008-08-03 Thread Cameron Simpson
On 03Aug2008 23:14, Avinash Vora [EMAIL PROTECTED] wrote: You will likely cause more problems updating the system python than managing the two separate installations. That's sadly worrying. It shouldn't be. It is often useful to have multiple versions of stuff installed. Replacing the system

Re: Teething troubles with Python on a Mac

2008-08-03 Thread Sean DiZazzo
Question 1: How can I locate the Python installation? There a few files under Applications MacPython 2.5, but this is clearly not the entire installation. find / -name site-packages Will lead you to where SciPy and Numpy should be installed for each Python installation. You can work

Peer-to-Peer Chat Program

2008-08-03 Thread Trevor Slocum
Python seemed like the right choice for writing a peer-to-peer application, as the support for sockets is adequate and the cross-platform ability is nominal. That's why I searched around for P2P frameworks in Python, and didn't have much luck. The framework that I did find was designed

Re: Trying to fix Invalid CSV File

2008-08-03 Thread Emile van Sebille
Ryan Rosario wrote: I have a very large CSV file that contains double quoted fields (since they contain commas). Unfortunately, some of these fields also contain other double quotes and I made the painful mistake of forgetting to escape or double the quotes inside the field: 123,Here is some,

[issue3488] Provide compress/uncompress functions on the gzip module

2008-08-03 Thread Anand B Pillai
Anand B Pillai [EMAIL PROTECTED] added the comment: Thanks. The file I uploaded was not an actual patch but just how the functions would appear in the gzip module, to illustrate the code. I can make an actual patch to gzip.py with docstrings, unit-tests and taking care of your other comments.

[issue3228] mailbox.mbox creates files with execute bit set

2008-08-03 Thread Niels Gustäbel
Niels Gustäbel [EMAIL PROTECTED] added the comment: Of course you are right... Added file: http://bugs.python.org/file11042/mailbox-fix-w-tests-v2.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3228

[issue3228] mailbox.mbox creates files with execute bit set

2008-08-03 Thread Jakub Wilk
Jakub Wilk [EMAIL PROTECTED] added the comment: For consistency with other methods, test_folder_file_permissions() should set umask to 0. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3228 ___

[issue3228] mailbox.mbox creates files with execute bit set

2008-08-03 Thread Niels Gustäbel
Niels Gustäbel [EMAIL PROTECTED] added the comment: I've added tests for all mailbox formats and the maildirfolder marker, so I think all aspects of the fix are covered. The permissions of temporary files and lock files are not checked, but they are basically all using the _create_carefully()

[issue3495] site module doc typo

2008-08-03 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: Thanks, fixed in r65430. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3495 ___

[issue3496] distutils fails with mingw binutils 2.18.50.20080109

2008-08-03 Thread Paul Moore
New submission from Paul Moore [EMAIL PROTECTED]: The latest version of Mingw binutils, 2.18.50.20080109, uses a 4-part version number which distutils does not like (StrictVersion only allows for 3 parts). The attached patch fixes this, simply by using LooseVersion (the version number has

[issue3496] distutils fails with mingw binutils 2.18.50.20080109

2008-08-03 Thread Antoine Pitrou
Changes by Antoine Pitrou [EMAIL PROTECTED]: -- priority: - critical versions: +Python 2.6, Python 3.0 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3496 ___

[issue3475] _elementtree.c import can fail silently

2008-08-03 Thread Fredrik Lundh
Fredrik Lundh [EMAIL PROTECTED] added the comment: This is fixed in the ET 1.3-compatible codebase. Since it's too late to add ET 1.3 to 2.6, I guess it's time to make a new 1.2 bugfix release for 2.6. ___ Python tracker [EMAIL PROTECTED]

[issue3488] Provide compress/uncompress functions on the gzip module

2008-08-03 Thread Anand B Pillai
Anand B Pillai [EMAIL PROTECTED] added the comment: I have uploaded the actual patch file which can be applied against the gzip.py module. I did not modify the _test() function since it is written for testing file compression. I can modify test_gzip.py if this patch is accepted. --

[issue3497] a bug in the interpreter?

2008-08-03 Thread vadim suvorov
New submission from vadim suvorov [EMAIL PROTECTED]: The result of the attached script execution is extremely unstable. The change in the print statement in line 146 from 'print 1' to 'print 1' (string literal to numerical) changes the result of execution to the correct (presumably) one. The

[issue3497] a bug in the interpreter?

2008-08-03 Thread vadim suvorov
Changes by vadim suvorov [EMAIL PROTECTED]: Added file: http://bugs.python.org/file11046/nonogramsolver09.py ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3497 ___

[issue3492] Zlib compress/decompress functions returning bytearray

2008-08-03 Thread Anand B Pillai
Anand B Pillai [EMAIL PROTECTED] added the comment: Hi, I have a patch ready for this to be applied to zlibmodule.c. The patch is attached. I have tested it and it is working fine. -- keywords: +patch Added file: http://bugs.python.org/file11047/zlibmodule.patch

[issue3497] a bug in the interpreter?

2008-08-03 Thread vadim suvorov
vadim suvorov [EMAIL PROTECTED] added the comment: tested Python 2.4.4 on WinXP SP3. It required minor modifications of the code (removing conditional expressions), but the effect stayed. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3497

[issue3497] a bug in the interpreter?

2008-08-03 Thread vadim suvorov
Changes by vadim suvorov [EMAIL PROTECTED]: -- versions: +Python 2.4 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3497 ___ ___ Python-bugs-list

[issue3497] a bug in the interpreter?

2008-08-03 Thread Martin v. Löwis
Changes by Martin v. Löwis [EMAIL PROTECTED]: -- nosy: +loewis ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3497 ___ ___ Python-bugs-list mailing list

[issue3497] a bug in the interpreter?

2008-08-03 Thread Tim Peters
Tim Peters [EMAIL PROTECTED] added the comment: I doubt this is a bug in Python. It's more likely an error (one or more ;-)) in the logic of the script, triggered by the inherently unpredictable order of set iteration. Some evidence: I added a `.counter` member to the Sequence class, and

[issue3497] a bug in the interpreter?

2008-08-03 Thread vadim suvorov
vadim suvorov [EMAIL PROTECTED] added the comment: Thank you very much, Tim. I am still very much confused, how change in print statement changes order in which items are removed from a set. I presumed it to be undefined but deterministic (similar to dict()): while I cannot tell which order it

[issue3497] a bug in the interpreter?

2008-08-03 Thread Guilherme Polo
Guilherme Polo [EMAIL PROTECTED] added the comment: Just run it a couple of times and you will hit the problem in both failing and running examples you added. -- nosy: +gpolo ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3497

[issue3497] a bug in the interpreter?

2008-08-03 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: I am still very much confused, how change in print statement changes order in which items are removed from a set. I presumed it to be undefined but deterministic (similar to dict()): while I cannot tell which order it is going to be, I can

[issue3497] a bug in the interpreter?

2008-08-03 Thread vadim suvorov
vadim suvorov [EMAIL PROTECTED] added the comment: Tim, Martin, thank you very much. I think now it is not an issue, and the record can be closed. Thank you very much again, and please accept my apology. 2 Guilherme Polo: I ran it many times. The results in WinXP (with constant script) are

[issue3497] a bug in the interpreter?

2008-08-03 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: I think we have enough evidence now to close this bug as invalid. :) -- nosy: +georg.brandl resolution: - invalid status: open - closed ___ Python tracker [EMAIL PROTECTED]

  1   2   >