Re: value of pi and 22/7

2011-03-18 Thread peter
On Mar 17, 5:22 pm, Kee Nethery k...@kagi.com wrote: My favorite approximation is: 355/113  (visualize 113355 split into two 113 355 and then do the division). The first 6 decimal places are the same. 3.141592920353982 = 355/113 vs 3.1415926535897931 Kee Nethery Or (more for fun than any

Re: Abend with cls.__repr__ = cls.__str__ on Windows.

2011-03-18 Thread Duncan Booth
Terry Reedy tjre...@udel.edu wrote: On 3/17/2011 10:00 PM, Terry Reedy wrote: On 3/17/2011 8:24 PM, J Peyret wrote: This gives a particularly nasty abend in Windows - Python.exe has stopped working, rather than a regular exception stack error. I've fixed it, after I figured out the cause,

Re: Fitting polynomial curve

2011-03-18 Thread eryksun ()
On 3/17/2011 1:42 AM, Astan Chee wrote: I have 2 points in 3D space and a bunch of points in-between them. I'm trying to fit a polynomial curve on it. Currently I'm looking through numpy but I don't think the function exists to fit a function like this: y = ax**4 + bx**3 + cx**2 + dx + e You

Re: Abend with cls.__repr__ = cls.__str__ on Windows.

2011-03-18 Thread eryksun ()
On Thursday, March 17, 2011 8:24:36 PM UTC-4, J Peyret wrote: I suspect that object.__str__ is really object.__repr__ by default, as they both print out the same string, so that this doesn't make any sense. They're not the same object, and they don't have all of the same methods. In [1]:

Re: Multiprocessing.Process Daemonic Behavior

2011-03-18 Thread Anssi Saari
John L. Stephens lists.jksteph...@gmail.com writes: As the parent process terminates 'normally' (either through normal termination or SIGINT termination), mulitprocessing steps in and performs child process cleanup via the x.terminate() method. If the parent terminates any other way,

Re: value of pi and 22/7

2011-03-18 Thread Neil Cerutti
On 2011-03-18, peter peter.mos...@talk21.com wrote: The Old Testament (1 Kings 7,23) says ... And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits: and a line of thirty cubits did compass it round about. . So pi=3. End

Re: value of pi and 22/7

2011-03-18 Thread Stefan Behnel
Neil Cerutti, 18.03.2011 13:17: On 2011-03-18, peterpeter.mos...@talk21.com wrote: The Old Testament (1 Kings 7,23) says ... And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits: and a line of thirty cubits did compass it

Re: value of pi and 22/7

2011-03-18 Thread Neil Cerutti
On 2011-03-18, Stefan Behnel stefan...@behnel.de wrote: Neil Cerutti, 18.03.2011 13:17: On 2011-03-18, peterpeter.mos...@talk21.com wrote: The Old Testament (1 Kings 7,23) says ... And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was

Re: value of pi and 22/7

2011-03-18 Thread Aage Andersen
peter Kee Nethery My favorite approximation is: 355/113 (visualize 113355 split into two 113 355 and then do the division). The first 6 decimal places are the same. 3.141592920353982 = 355/113 vs 3.1415926535897931 Kee Nethery Or (more for fun than any practical application) try

Re: value of pi and 22/7

2011-03-18 Thread Sherm Pendley
Stefan Behnel stefan...@behnel.de writes: Neil Cerutti, 18.03.2011 13:17: On 2011-03-18, peterpeter.mos...@talk21.com wrote: The Old Testament (1 Kings 7,23) says ... And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits:

Re: value of pi and 22/7

2011-03-18 Thread Westley Martínez
On Fri, 2011-03-18 at 02:10 -0700, peter wrote: On Mar 17, 5:22 pm, Kee Nethery k...@kagi.com wrote: My favorite approximation is: 355/113 (visualize 113355 split into two 113 355 and then do the division). The first 6 decimal places are the same. 3.141592920353982 = 355/113 vs

Re: value of pi and 22/7

2011-03-18 Thread Stefan Behnel
Sherm Pendley, 18.03.2011 14:46: Stefan Behnel writes: Neil Cerutti, 18.03.2011 13:17: On 2011-03-18, peterpeter.mos...@talk21.com wrote: The Old Testament (1 Kings 7,23) says ... And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height

Re: value of pi and 22/7

2011-03-18 Thread Grant Edwards
On 2011-03-18, peter peter.mos...@talk21.com wrote: The Old Testament (1 Kings 7,23) says ... And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits: and a line of thirty cubits did compass it round about. . So pi=3. End

Re: value of pi and 22/7

2011-03-18 Thread Kee Nethery
On Mar 18, 2011, at 5:17 AM, Neil Cerutti wrote: On 2011-03-18, peter peter.mos...@talk21.com wrote: The Old Testament (1 Kings 7,23) says ... And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits: and a line of thirty

Bounds checking

2011-03-18 Thread Martin De Kauwe
Hi, if one has a set of values which should never step outside certain bounds (for example if the values were negative then they wouldn't be physically meaningful) is there a nice way to bounds check? I potentially have 10 or so values I would like to check at the end of each iteration. However

Re: value of pi and 22/7

2011-03-18 Thread John Gordon
In 8uh0rcfe1...@mid.individual.net Neil Cerutti ne...@norwich.edu writes: RIIght. What's a cubit? How long can you tread water? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears

Re: Bounds checking

2011-03-18 Thread Katie T
What sort of checks are you making ? - in general greater than/less than tend to be fairly optimal, although you might be able to do a faster is negative test Katie On Fri, Mar 18, 2011 at 2:24 PM, Martin De Kauwe mdeka...@gmail.com wrote: Hi, if one has a set of values which should never

Re: Bounds checking

2011-03-18 Thread Jean-Michel Pichavant
Martin De Kauwe wrote: Hi, if one has a set of values which should never step outside certain bounds (for example if the values were negative then they wouldn't be physically meaningful) is there a nice way to bounds check? I potentially have 10 or so values I would like to check at the end of

Re: Bounds checking

2011-03-18 Thread Mel
Jean-Michel Pichavant wrote: Martin De Kauwe wrote: Don't check for bounds, fix any bug in the code that would set your values out of bounds and use asserts while debugging. [ ... ] def __setattr__(self, attribute, value): if not self.funcTable.get(attribute, lambda x:

Re: value of pi and 22/7

2011-03-18 Thread Adam Tauno Williams
On Fri, 2011-03-18 at 14:16 +, Grant Edwards wrote: On 2011-03-18, peter peter.mos...@talk21.com wrote: The Old Testament (1 Kings 7,23) says ... And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits: and a line of

Re: email library

2011-03-18 Thread Ethan Furman
peterob wrote: Im completely confinvalided from email library. When you parse email from file it creates object Message. f = open(emailFile, 'r') msg = email.message_from_file(f) f.close() How can I access RAW header of email represented by object msg? I dont wanna access each header field by

Remove all directories using wildcard

2011-03-18 Thread JSkinn3
I'm new to python and I am trying to figure out how to remove all sub directories from a parent directory using a wildcard. For example, remove all sub directory folders that contain the word PEMA from the parent directory C:\Data. I've trying to use os.walk with glob, but I'm not sure if this

Re: Remove all directories using wildcard

2011-03-18 Thread Tim Golden
On 18/03/2011 16:41, JSkinn3 wrote: I'm new to python and I am trying to figure out how to remove all sub directories from a parent directory using a wildcard. For example, remove all sub directory folders that contain the word PEMA from the parent directory C:\Data. I've trying to use os.walk

RE: Remove all directories using wildcard

2011-03-18 Thread Andreas Tawn
I'm new to python and I am trying to figure out how to remove all sub directories from a parent directory using a wildcard. For example, remove all sub directory folders that contain the word PEMA from the parent directory C:\Data. I've trying to use os.walk with glob, but I'm not sure if

multiprocessing Pool workers cannot create subprocesses

2011-03-18 Thread Jason Grout
In a recent application, a student of mine tried to create child processes inside of a multiprocessing Pool worker (for security and convenience reasons, we wanted to run some code inside of a child process). Here is some test code for python 2.7: = import

Re: Bounds checking

2011-03-18 Thread Miki Tebeka
def bounds_check(state): check state values are 0 for attr in dir(state): if not attr.startswith('__') and getattr(state, attr) 0.0: print Error state values 0: %s % (attr) sys.exit() Not that related to the question. But it's usually better to

ctypes pointer to structure memory swap

2011-03-18 Thread Wanderer
I'm observing some strange behavior with ctypes. I created this test code to try to figure out what I'm doing wrong creating pointers to structures. from ctypes import * class QCamSettingId(Structure): QCam_settings_id _fields_ = [(f1, c_ulong), (f2, c_ushort),

Re: Bounds checking

2011-03-18 Thread Katie T
On Fri, Mar 18, 2011 at 3:01 PM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Don't check for bounds, fix any bug in the code that would set your values out of bounds and use asserts while debugging. Otherwise if you really need dynamic checks, it will cost you cpu, for sure.

Re: Two random lists from one list

2011-03-18 Thread noydb
Thanks All for your responses, all a help! -- http://mail.python.org/mailman/listinfo/python-list

Could I joined in this Happy family

2011-03-18 Thread duxiu xiang
Dear friends: I am in China.For some rearon,I cannot visit your Google Group.May I joint this mail list for help in learning Python? -- 笑看嫣红染半山,逐风万里白云间。 -- http://mail.python.org/mailman/listinfo/python-list

Re: Could I joined in this Happy family

2011-03-18 Thread Nick Stinemates
Welcome aboard ! On Mar 18, 2011 11:34 AM, duxiu xiang xiangduxi...@gmail.com wrote: Dear friends: I am in China.For some rearon,I cannot visit your Google Group.May I joint this mail list for help in learning Python? -- 笑看嫣红染半山,逐风万里白云间。 --

class error

2011-03-18 Thread monkeys paw
I have the following file: FileInfo.py: import UserDict class FileInfo(UserDict): store file metadata def __init__(self, filename=None): UserDict.__init__(self) self[name] = filename When i import it like so: import FileInfo i get this

Re: multiprocessing Pool workers cannot create subprocesses

2011-03-18 Thread Ned Deily
In article 4d838d28.5090...@creativetrax.com, Jason Grout jason-pyt...@creativetrax.com wrote: The problem appears to be that multiprocessing sets its workers to have the daemon flag set to True, which prevents workers from creating child processes. If I uncomment the line indicated in the

Re: class error

2011-03-18 Thread MRAB
On 18/03/2011 20:13, monkeys paw wrote: I have the following file: FileInfo.py: import UserDict class FileInfo(UserDict): store file metadata def __init__(self, filename=None): UserDict.__init__(self) self[name] = filename When i import it like so: import FileInfo

Re: class error

2011-03-18 Thread Ethan Furman
monkeys paw wrote: I have the following file: FileInfo.py: import UserDict class FileInfo(UserDict): store file metadata def __init__(self, filename=None): UserDict.__init__(self) self[name] = filename When i import it like so: import FileInfo i get this error:

Re: class error

2011-03-18 Thread Alexander Kapps
On 18.03.2011 21:13, monkeys paw wrote: I have the following file: FileInfo.py: import UserDict After this import statement, the name UserDict refers to the module. class FileInfo(UserDict): Here you are trying to subclass the module. What you need instead is: class

Re: Abend with cls.__repr__ = cls.__str__ on Windows.

2011-03-18 Thread Carl Banks
On Mar 18, 2:18 am, Duncan Booth duncan.bo...@invalid.invalid wrote: Terry Reedy tjre...@udel.edu wrote: On 3/17/2011 10:00 PM, Terry Reedy wrote: On 3/17/2011 8:24 PM, J Peyret wrote: This gives a particularly nasty abend in Windows - Python.exe has stopped working, rather than a regular

Re: class error

2011-03-18 Thread monkeys paw
On 3/18/2011 4:43 PM, Alexander Kapps wrote: On 18.03.2011 21:13, monkeys paw wrote: I have the following file: FileInfo.py: import UserDict After this import statement, the name UserDict refers to the module. class FileInfo(UserDict): Here you are trying to subclass the module. What

Reading/Writing files

2011-03-18 Thread Jon Herman
Hello all, I am pretty new to Python and am trying to write data to a file. However, I seem to be misunderstanding how to do so. For starters, I'm not even sure where Python is looking for these files or storing them. The directories I have added to my PYTHONPATH variable (where I import modules

Re: ctypes pointer to structure memory swap

2011-03-18 Thread Nobody
On Fri, 18 Mar 2011 10:34:35 -0700, Wanderer wrote: I'm observing some strange behavior with ctypes. I created this test code to try to figure out what I'm doing wrong creating pointers to structures. What makes you think that you're doing anything wrong. Note that the hex number shown when

Use cookies from a script in a browser

2011-03-18 Thread gervaz
Hi all, I use a scraper to retrieve data from a web page. In order to do that I need to enable cookies. The data that I'm looking for is contained in a bunch of web pages. Is there a way to show this web pages in a browser using the cookies used in the script (otherwise it doesn't work). Thanks,

Re: Reading/Writing files

2011-03-18 Thread Matt Chaput
On 18/03/2011 5:33 PM, Jon Herman wrote: I am pretty new to Python and am trying to write data to a file. However, I seem to be misunderstanding how to do so. For starters, I'm not even sure where Python is looking for these files or storing them. The directories I have added to my PYTHONPATH

Re: Reading/Writing files

2011-03-18 Thread Jack Trades
On Fri, Mar 18, 2011 at 4:33 PM, Jon Herman jfc.her...@gmail.com wrote: Hello all, I am pretty new to Python and am trying to write data to a file. However, I seem to be misunderstanding how to do so. For starters, I'm not even sure where Python is looking for these files or storing them.

Re: Reading/Writing files

2011-03-18 Thread Ethan Furman
Jon Herman wrote: Hello all, I am pretty new to Python and am trying to write data to a file. However, I seem to be misunderstanding how to do so. For starters, I'm not even sure where Python is looking for these files or storing them. The directories I have added to my PYTHONPATH variable

Re: Use cookies from a script in a browser

2011-03-18 Thread Miki Tebeka
You can use mechanize, which holds a cookie jar and can user the browser cookies as well. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading/Writing files

2011-03-18 Thread Jon Herman
Jack, thanks. Alright, so what I did is create a file called hello.txt with a single line of text in there. I then did the following: f=fulldirectory\hello.txt (where fulldirectory is of course the actual full directory on my computer) open(f, w) And I get the following error: IOError: [Errno

Re: Reading/Writing files

2011-03-18 Thread Jack Trades
On Fri, Mar 18, 2011 at 4:56 PM, Jon Herman jfc.her...@gmail.com wrote: Jack, thanks. Alright, so what I did is create a file called hello.txt with a single line of text in there. I then did the following: f=fulldirectory\hello.txt (where fulldirectory is of course the actual full

Re: Reading/Writing files

2011-03-18 Thread Dan Stromberg
For open() or os.open(), it should look in your Current Working Directory (CWD). Your python's CWD defaults to what the CWD was when python was started, and it is changed with os.chdir(). Absolute paths will of course be relative to / on most OS's (or C:/ if you're on C:, D:/ if you're on D:,

Re: Reading/Writing files

2011-03-18 Thread Jack Trades
On Fri, Mar 18, 2011 at 4:59 PM, Jack Trades jacktradespub...@gmail.comwrote: On Fri, Mar 18, 2011 at 4:56 PM, Jon Herman jfc.her...@gmail.com wrote: Jack, thanks. Alright, so what I did is create a file called hello.txt with a single line of text in there. I then did the following:

Re: Reading/Writing files

2011-03-18 Thread Dan Stromberg
Are you on windows? You probably should use / as your directory separator in Python, not \. In Python, and most other programming languages, \ starts an escape sequence, so to introduce a literal \, you either need to prefix your string with r (r\foo\bar) or double your backslashes (\\foo\\bar).

Re: ctypes pointer to structure memory swap

2011-03-18 Thread Wanderer
On Mar 18, 5:48 pm, Nobody nob...@nowhere.com wrote: On Fri, 18 Mar 2011 10:34:35 -0700, Wanderer wrote: I'm observing some strange behavior with ctypes. I created this test code to try to figure out what I'm doing wrong creating pointers to structures. What makes you think that you're

Re: Reading/Writing files

2011-03-18 Thread Alexander Kapps
On 18.03.2011 22:33, Jon Herman wrote: Hello all, I am pretty new to Python and am trying to write data to a file. However, I seem to be misunderstanding how to do so. For starters, I'm not even sure where Python is looking for these files or storing them. The directories I have added to my

Re: Reading/Writing files

2011-03-18 Thread Jon Herman
Folks, thanks for the many responses! Specifying the full file name (and not using parentheses when inappropriate, thanks Jack :)) I am now happily reading/writing files. My next question: what is the best way for me to write an array I generated to a file? And what is the best way for me to

Re: Reading/Writing files

2011-03-18 Thread Jack Trades
On Fri, Mar 18, 2011 at 5:21 PM, Jon Herman jfc.her...@gmail.com wrote: Folks, thanks for the many responses! Specifying the full file name (and not using parentheses when inappropriate, thanks Jack :)) I am now happily reading/writing files. My next question: what is the best way for me

Re: Use cookies from a script in a browser

2011-03-18 Thread gervaz
On 18 Mar, 22:52, Miki Tebeka miki.teb...@gmail.com wrote: You can use mechanize, which holds a cookie jar and can user the browser cookies as well. I use: opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor()) urllib.request.install_opener(opener) I start scraping from

Re: Reading/Writing files

2011-03-18 Thread Westley Martínez
On Fri, 2011-03-18 at 15:56 -0600, Jon Herman wrote: Jack, thanks. Alright, so what I did is create a file called hello.txt with a single line of text in there. I then did the following: f=fulldirectory\hello.txt (where fulldirectory is of course the actual full directory on my

Re: Bounds checking

2011-03-18 Thread Martin De Kauwe
Don't check for bounds, fix any bug in the code that would set your values out of bounds and use asserts while debugging. whilst that is a nice idea in practice this just is not a practical solution. Otherwise if you really need dynamic checks, it will cost you cpu, for sure. Yes I agree

Re: Bounds checking

2011-03-18 Thread Martin De Kauwe
Offhand, my only quibble is that sys.exit is not helpful for debugging.   Much better to raise an error:         if not self.funcTable.get(attribute, lambda x: True)(value):             raise ValueError ('error out of bound') or define a subclass of ValueError just for this purpose.  On

Re: ctypes pointer to structure memory swap

2011-03-18 Thread Nobody
On Fri, 18 Mar 2011 15:16:40 -0700, Wanderer wrote: Thanks for the reply, but I'm still not sure I understand. Why should Object1 be at address1 and Object2 be at address2 and the next moment Object2 is at address1 and Object1 is at address2? I'll try casting them to see what the value is

Re: Reading/Writing files

2011-03-18 Thread Ethan Furman
Dan Stromberg wrote: Are you on windows? You probably should use / as your directory separator in Python, not \. In Python, and most other programming languages, \ starts an escape sequence, so to introduce a literal \, you either need to prefix your string with r (r\foo\bar) or double

Re: Reading/Writing files

2011-03-18 Thread Westley Martínez
On Fri, 2011-03-18 at 15:18 -0700, Dan Stromberg wrote: Are you on windows? badadvice / You shouldn't use / or \ on Windows. You should use os.path.join(). On Windows, when you start mixing / with \\ and spaces things can get hairy and obscure. It's always best to just use os.path.join().

Re: Bounds checking

2011-03-18 Thread Dan Stromberg
Actually, I'd probably create a class with 3 arguments - an initial value, a lower bound, and an upper bound, give it a _check method, and call _check from the various operator methods. The class would otherwise impersonate an int. In code that isn't performance-critical, it's better to check

Re: Reading/Writing files

2011-03-18 Thread Jon Herman
Wow, Jack, that is one awesome and simple module...thank you so much! I am happily storing and accessing all the arrays I could ever want :) Thanks to all for the quick assistance! On Fri, Mar 18, 2011 at 4:24 PM, Jack Trades jacktradespub...@gmail.comwrote: On Fri, Mar 18, 2011 at 5:21

Re: multiprocessing Pool workers cannot create subprocesses

2011-03-18 Thread Jason Grout
On 3/18/11 3:29 PM, Ned Deily wrote: In article4d838d28.5090...@creativetrax.com, Jason Groutjason-pyt...@creativetrax.com wrote: The problem appears to be that multiprocessing sets its workers to have the daemon flag set to True, which prevents workers from creating child processes. If I

SocketServer.BaseRequestHandler has the data, and now?

2011-03-18 Thread ao11
Hello, I wrote a test application to play around with UDP, the receiving part looks like: class proxyServer(SocketServer.ThreadingMixIn, SocketServer.UDPServer): pass class proxyHandler(SocketServer.BaseRequestHandler): def handle(self): data = self.request[0] source

Re: Abend with cls.__repr__ = cls.__str__ on Windows.

2011-03-18 Thread J Peyret
On Mar 18, 2:15 pm, Carl Banks pavlovevide...@gmail.com wrote: Multiple people reproduce a Python hang/crash yet it looks like no one bothered to submit a bug report I observed the same behavior (2.6 and 3.2 on Linux, hangs) and went ahead and submitted a bug report. Carl Banks

Re: Abend with cls.__repr__ = cls.__str__ on Windows.

2011-03-18 Thread Terry Reedy
On 3/18/2011 5:15 PM, Carl Banks wrote: Multiple people reproduce a Python hang/crash yet it looks like no one bothered to submit a bug report I did not because I did not initially see a problem... I observed the same behavior (2.6 and 3.2 on Linux, hangs) and went ahead and submitted a

Re: Reading/Writing files

2011-03-18 Thread Dan Stromberg
On Fri, Mar 18, 2011 at 4:00 PM, Ethan Furman et...@stoneleaf.us wrote: Dan Stromberg wrote: Are you on windows? You probably should use / as your directory separator in Python, not \. In Python, and most other programming languages, \ starts an escape sequence, so to introduce a literal

Re: Abend with cls.__repr__ = cls.__str__ on Windows.

2011-03-18 Thread Carl Banks
On Mar 18, 5:31 pm, J Peyret jpey...@gmail.com wrote: If I ever specifically work on an OSS project's codeline, I'll post bug reports, but frankly that FF example is a complete turn-off to contributing by reporting bugs. You probably shouldn't take it so personally if they don't agree with

Re: class error

2011-03-18 Thread Terry Reedy
On 3/18/2011 5:27 PM, monkeys paw wrote: TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) OK, i overlooked that and the error was not very enlightening. A detailed explanation: every module is an instance of a class we will call Module.

Re: Bounds checking

2011-03-18 Thread Terry Reedy
On 3/18/2011 10:24 AM, Martin De Kauwe wrote: def bounds_check(state): check state values are 0 for attr in dir(state): if not attr.startswith('__') and getattr(state, attr) 0.0: print Error state values 0: %s % (attr) dir() has to do a bit a computation.

How to install python xlwt in ubuntu 9

2011-03-18 Thread ratna PB
Hey friends i tried a lot to unstall excel xlwt in ubuntu 9 but failed please help me before i get full fraustrated... -- http://mail.python.org/mailman/listinfo/python-list

Syntax Error

2011-03-18 Thread Manatee
I hope this is the place to post this question. I am a really new pythonista. I am studying Tkinter and when I run this basic code, I get a syntax error on line 20, print hi there, everyone. Its a simple print line, but I can't see the problem. I am using Python 2.71, gVim for an editor, and a

Re: Syntax Error

2011-03-18 Thread xDog Walker
On Friday 2011 March 18 21:39, Manatee wrote: I hope this is the place to post this question. I am a really new pythonista. I am studying Tkinter and when I run this basic code, I get a syntax error on line 20, print hi there, everyone. Its a simple print line, but I can't see the problem. I

Re: Syntax Error

2011-03-18 Thread Thomas L. Shinnick
At 11:39 PM 3/18/2011, Manatee wrote: I hope this is the place to post this question. I am a really new pythonista. I am studying Tkinter and when I run this basic code, I get a syntax error on line 20, print hi there, everyone. Its a simple print line, but I can't see the problem. I am using

Re: Syntax Error

2011-03-18 Thread Vlastimil Brom
2011/3/19 Manatee markrri...@aol.com: I hope this is the place to post this question. I am a really new pythonista. I am studying Tkinter and when I run this basic code, I get  a syntax error on line 20,  print hi there, everyone. Its a simple print line, but I can't see the problem. I am

Re: Abend with cls.__repr__ = cls.__str__ on Windows.

2011-03-18 Thread J Peyret
On Mar 18, 6:55 pm, Carl Banks pavlovevide...@gmail.com wrote: On Mar 18, 5:31 pm, J Peyret jpey...@gmail.com wrote: If I ever specifically work on an OSS project's codeline, I'll post bug reports, but frankly that FF example is a complete turn-off to contributing by reporting bugs. You

[issue11592] Compilation warnings in os module

2011-03-18 Thread Ross Lagerwall
Changes by Ross Lagerwall rosslagerw...@gmail.com: -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11592 ___

[issue11320] Can't call Py_SetPath() on pointer returned by Py_GetPath()

2011-03-18 Thread Palm Kevin
Palm Kevin kevin.p...@labsolution.lu added the comment: Antoine, Your guess that my issue initially wasn't related to virtualenv is correct (I've never heard about that project before posting this issue...) As for passing the output of Py_GetPath directly to Py_SetPath: You are right, there

[issue11320] Can't call Py_SetPath() on pointer returned by Py_GetPath()

2011-03-18 Thread Palm Kevin
Palm Kevin kevin.p...@labsolution.lu added the comment: Furthermore I would propose to rename this issue: The problem is not that Py_SetPath cannot be called on pointer returned by Py_GetPath. I think that the problem is more general: Calling Py_SetPath NEVER works. -- I get the same

[issue11320] Can't call Py_SetPath() on pointer returned by Py_GetPath()

2011-03-18 Thread Palm Kevin
Palm Kevin kevin.p...@labsolution.lu added the comment: As for this error: Fatal Python error: Py_Initialize: Unable to get the locale encoding LookupError: no codec search functions registered: can't find encoding It seems to me that this error appears if the path passed to Py_SetPath does

[issue11593] Add encoding parameter to logging.basicConfig

2011-03-18 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: I've been thinking about adding a handler= keyword argument to basicConfig(), and it seems to me that it would not only cover your use case, but also other cases which require different handlers. So I'm marking as wontfix for now, but

[issue11572] bring Lib/copy.py to 100% coverage

2011-03-18 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: A little research has found that building without complex is not possible anymore, so you’re good: http://bugs.python.org/issue7147 Regarding “unicode”, see line 112. -- ___ Python tracker

[issue10914] Python sub-interpreter test

2011-03-18 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Well, config._link() seems to do what is needed here. My point is that it’s easier to write a few lines of code directly using a compiler object (copying and simplifying code from try_run or _link) than go through the distutils command

[issue11591] python -S should be robust against e.g. from site import addsitedir

2011-03-18 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Fair argument. Brett is the author of recent changes in site, let him decide. Brett: Would you agree to 1)? -- nosy: +brett.cannon ___ Python tracker rep...@bugs.python.org

[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input

2011-03-18 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Instead of always calling clearerr(), we can only call it on EOF: diff -r 88fe1ac48460 Parser/myreadline.c --- a/Parser/myreadline.c Mon Mar 07 08:31:52 2011 +0100 +++ b/Parser/myreadline.c Fri Mar 18 10:57:23 2011 +0100

[issue11320] Can't call Py_SetPath() on pointer returned by Py_GetPath()

2011-03-18 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: As for this error: Fatal Python error: Py_Initialize: Unable to get the locale encoding LookupError: no codec search functions registered: can't find encoding It seems to me that this error appears if the path passed to Py_SetPath does

[issue11575] addresses.txt file leaks into search engines

2011-03-18 Thread Senthil Kumaran
Senthil Kumaran orsent...@gmail.com added the comment: Why should we have this file served on the web itself? Cannot it be on server outside of www ( or any directory which is getting served). I would vote for this. -- nosy: +orsenthil ___ Python

[issue11575] addresses.txt file leaks into search engines

2011-03-18 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The question is not why, it is how. This file is part of the scripts used to migrate from svn to hg. These files themselves were maintained in an hg repository (it could have been an svn repository), for obvious practical reasons. And that

[issue11549] Rewrite peephole to work on AST

2011-03-18 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11549 ___ ___

[issue11574] Unicode Fallback Encoding on Python 3.3

2011-03-18 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: After reading the related mail thread on python-dev, I realized that you are talking about TextIOWrapper choice (file content, not file name). My previous message is about file names. --

[issue11572] bring Lib/copy.py to 100% coverage

2011-03-18 Thread Brandon Craig Rhodes
Brandon Craig Rhodes bran...@rhodesmill.org added the comment: Éric, after checking line 112 of the two patches and then of the new file, I figured out that you meant line 112 of the old file — and, yes, that test can go away too since in python3 complex always exists and unicode never

[issue11574] Unicode Fallback Encoding on Python 3.3

2011-03-18 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: TextIOWrapper is mostly based on locale.getpreferredencoding(), so msg131290 is still valid: if no env var is set, nl_langinfo() gives 'ASCII' (or something like that). But it is not easy to detect that env vars are not set. I

[issue11581] buildbot error when pushing to 2.5 branch?

2011-03-18 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I talked to Martin. He wants the 2.5 mercurial branch to get *exactly* that set of changes that needs to be applied to the svn repository in order for him to build the security release, no more no less. Note that 2.5 goes out of

[issue11581] buildbot error when pushing to 2.5 branch?

2011-03-18 Thread Senthil Kumaran
Senthil Kumaran orsent...@gmail.com added the comment: David, from you message I understand that Martin is planning to release 2.5 via svn. If that is the case, whatever was pushed for security fix to hg can remain as such and so that those can be exported to svn. The bugs related to buildbot

[issue11581] buildbot error when pushing to 2.5 branch?

2011-03-18 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Yes, although there may be another answer on the compile bug. -- resolution: - wont fix stage: - committed/rejected status: open - closed type: - behavior ___ Python tracker

[issue11513] chained exception/incorrect exception from tarfile.open on a non-existent file

2011-03-18 Thread Evan Dandrea
Evan Dandrea e...@ubuntu.com added the comment: David, Thanks for the pointers. I've updated the patch hopefully adequately addressing your concerns. -- components: +Interpreter Core -Library (Lib) type: behavior - Added file:

[issue11513] chained exception/incorrect exception from tarfile.open on a non-existent file

2011-03-18 Thread Evan Dandrea
Changes by Evan Dandrea e...@ubuntu.com: Removed file: http://bugs.python.org/file21223/tarfile-fix-multiple-exception-on-enoent.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11513 ___

[issue11579] python 2.5 does not build from hg - looks for subversion keywords

2011-03-18 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I talked to Martin about this at the sprints. He wants the set of patches in the 2.5 hg repo to be exactly those that he should apply to svn to build the next release, no more no less. If someone wants to propose a patch that fixes

[issue11594] 2to3 tool does not preserve line-endings

2011-03-18 Thread Alexander Belchenko
New submission from Alexander Belchenko bia...@ukr.net: I'm using LF-only line-endings for development of my IntelHex library. I'm working on Windows most of the time. After 2to3 tool has been ran on my library it has not only changed the Python syntax, but it also saved all files with CRLF

  1   2   >