Re: indirect assignment question

2011-05-17 Thread Ben Finney
Andy Baxter highfel...@gmail.com writes: with something like this: widgetDic = { mainWindow: self.window, menuitem_output_on: self.outputToggleMenu, button_toggle_output: self.outputToggleButton, textview_log: self.logView,

Re: obviscating python code for distribution

2011-05-17 Thread Dotan Cohen
On Mon, May 16, 2011 at 07:40, Chris Angelico ros...@gmail.com wrote: And I'm sure Steven will agree with me that this is not in any way a bad thing. I've written hundreds of such programs myself (possibly thousands), and they have all served their purposes. On a slightly larger scale, there

Re: obviscating python code for distribution

2011-05-17 Thread Chris Angelico
On Tue, May 17, 2011 at 4:16 PM, Dotan Cohen dotanco...@gmail.com wrote: Actually, Chris, those applications are probably no less valuable to be open source than Linux or Firefox. The reason is that when one goes to learn a new language it is valuable to look at existing real world code.

ipython prompt does not appear in windows

2011-05-17 Thread rusi
If I use ipython under emacs on linux it works (at least basic REPL) ie I can type an expression and I get a result followed by a prompt On windows ipython works at the shell. Plain python works in emacs as well. But inside emacs I dont see a prompt in ipython although I see it in python. I have

Re: indirect assignment question

2011-05-17 Thread Thomas Rachel
Am 17.05.2011 07:13 schrieb Andy Baxter: self.window = self.wTree.get_widget(mainWindow) self.outputToggleMenu = self.wTree.get_widget(menuitem_output_on) self.outputToggleButton = self.wTree.get_widget(button_toggle_output) self.logView = self.wTree.get_widget(textview_log)

Re: Deleting a file?

2011-05-17 Thread Algis Kabaila
On Tuesday 17 May 2011 07:23:33 garyr wrote: A file can be deleted by opening it with mode os.O_TEMPORARY and then closing it. How can a file be moved to the Recycle Bin, a la Windows? Just highlight it, pess the Del key and select move to Trash. (With minor variation between different

How to select Python web frameworks and which one is the best framework ?

2011-05-17 Thread VGNU Linux
Hi all, I am confused on which web framework to select for developing a small data driven web application. Application will have features generally found in now-a-days web application like security, database connectivity, authentication etc. I found few web frameworks over the net like django,

FW: help please

2011-05-17 Thread hamed azarkeshb
From: hamed3...@hotmail.com To: webmas...@python.org Subject: help please Date: Tue, 17 May 2011 13:20:22 +0430 hi dearinwant to useautomation with catiaby python,but i dont know,how do we can creat catsafearrayvariant in python?please help me.i need urhelp by one example.thank u

Re: Convert AWK regex to Python

2011-05-17 Thread J
Hello, I have managed to get my script finished in the end by taking bits from everyone who answered. Thank you so much. the finished query string looks like this (still not the best but it gets the job done. Once I learn to code more with Python I will probably go back to it and re-write

Datetime.timedelta

2011-05-17 Thread Tsolmon Narantsogt
Hi list I'm using datetime.timedelta and i have a problem delta = 1 day, 2:30:00 hours = delta.days * 8 how to add 8 + 2:30:00 Regards Tsolmon. -- http://mail.python.org/mailman/listinfo/python-list

cPickle - invalid signature

2011-05-17 Thread Neal Becker
What does it mean when cPickle.load says: RuntimeError: invalid signature Is binary format not portable? -- http://mail.python.org/mailman/listinfo/python-list

Re: Datetime.timedelta

2011-05-17 Thread Gabriel Genellina
En Tue, 17 May 2011 07:44:08 -0300, Tsolmon Narantsogt mnt...@gmail.com escribió: I'm using datetime.timedelta and i have a problem delta = 1 day, 2:30:00 hours = delta.days * 8 how to add 8 + 2:30:00 Just operate with it as it were a number. The timedelta class implements all sane

Re: FW: help please

2011-05-17 Thread Gabriel Genellina
En Tue, 17 May 2011 06:43:51 -0300, hamed azarkeshb hamed3...@hotmail.com escribió: hi dearinwant to useautomation with catiaby python,but i dont know,how do we can creat catsafearrayvariant in python?please help me.i need urhelp by one example.thank u forany thing There are

Re: cPickle - invalid signature

2011-05-17 Thread Gabriel Genellina
En Tue, 17 May 2011 08:41:41 -0300, Neal Becker ndbeck...@gmail.com escribió: What does it mean when cPickle.load says: RuntimeError: invalid signature Is binary format not portable? Are you sure that's the actual error message? I cannot find such message anywhere in the sources. The

where to find shared python script?

2011-05-17 Thread Yue Chao
Dear all, I am new to python and thank you for your help! the first question is, is there any resource online where we can find shared python script (like reading a csv file for ready plot making, I know to use csv module while I find it's not good enough) . The second one is, is there a search

Re: where to find shared python script?

2011-05-17 Thread Tim Golden
On 17/05/2011 13:53, Yue Chao wrote: I am new to python and thank you for your help! the first question is, is there any resource online where we can find shared python script (like reading a csv file for ready plot making, I know to use csv module while I find it's not good enough) . I don't

Re: Convert AWK regex to Python

2011-05-17 Thread AlienBaby
On May 17, 11:07 am, J jnr.gonza...@googlemail.com wrote: Hello, I have managed to get my script finished in the end by taking bits from everyone who answered.  Thank you so much.  the finished query string looks like this (still not the best but it gets the job done.  Once I learn to code

Re: obviscating python code for distribution

2011-05-17 Thread D'Arcy J.M. Cain
On Tue, 17 May 2011 16:39:48 +1000 Chris Angelico ros...@gmail.com wrote: You have a point there. Although I can't guarantee that all my code is particularly *good*, certainly not what I'd want to hold up for a novice to learn from - partly because it dates back anywhere up to two decades, and

Re: Convert AWK regex to Python

2011-05-17 Thread harrismh777
J wrote: Hello, Hello, J, This is totally off-topic, but I was wondering why you are posting with double messages (triple) all over the place? Your reply-to is set to comp.lang.pyt...@googlegroups.com, and you cc to python-list@python.org... and you're stuff is showing up in

Re: Python 3 vs Python 2.7 dilemma

2011-05-17 Thread Jorge Romero
I would recommend you going on the Python 2.x path. Python 2.x is far from being deprecated. According to Wesley Chun (active member of Python community and author of Core Python Programming) on a Google I/O talk, everybody will be using Python 3 by 2018, so there's still plenty of time. Besides,

Newbie: Python 3.2, search for module dBase + Excel

2011-05-17 Thread Andreas Mosmann
Hi, I am new to python and so I decided to use python 3.2 But, if I found out correctly, the are no working modules concerning Excel and dBase for this python version. Did I only misunderstand anything or is this right? I tried to download and use pydbf and pyexcelerator but both gave me an

Re: Deleting a file?

2011-05-17 Thread garyr
Jerry, There was an error during the install but only required a minor change to an __init__.py file to correct. Works great. Just what I was looking for. Many thanks! Gary Jerry Hill malaclyp...@gmail.com wrote in message news:mailman.1654.1305601607.9059.python-l...@python.org... On Mon,

portable multiprocessing code

2011-05-17 Thread Eric Frederich
I have written some code using Python 2.7 but I'd like these scripts to be able to run on Red Hat 5's 2.4.3 version of Python which doesn't have multiprocessing. I can try to import multiprocessing and set a flag as to whether it is available. Then I can create a Queue.Queue instead of a

Re: portable multiprocessing code

2011-05-17 Thread Benjamin Kaplan
On Tue, May 17, 2011 at 8:14 AM, Eric Frederich eric.freder...@gmail.com wrote: I have written some code using Python 2.7 but I'd like these scripts to be able to run on Red Hat 5's 2.4.3 version of Python which doesn't have multiprocessing. I can try to import multiprocessing and set a flag

Faster Recursive Fibonacci Numbers

2011-05-17 Thread RJB
I noticed some discussion of recursion. the trick is to find a formula where the arguments are divided, not decremented. I've had a divide-and-conquer recursion for the Fibonacci numbers for a couple of years in C++ but just for fun rewrote it in Python. It was easy. Enjoy. And tell me how

Re: Python 3 vs Python 2.7 dilemma

2011-05-17 Thread Eric Snow
On Mon, May 16, 2011 at 10:48 PM, Navkirat Singh n4vpyt...@gmail.comwrote: Hi Guys, I have been trying to fight this issue for sometime now. I know that a large part of the python 3rd party software base has not been ported to python 3 yet. I am trying to build a web-based enterprise

Re: pyjamas 0.8alpha1 release

2011-05-17 Thread lkcl
On May 4, 7:37 pm, Terry Reedy tjre...@udel.edu wrote: On 5/4/2011 10:06 AM, Luke Kenneth Casson Leighton wrote: after a long delay thepyjamasproject -http://pyjs.org- has begun the 0.8 series of releases, beginning with alpha1: https://sourceforge.net/projects/pyjamas/files/pyjamas/0.8/

Re: FW: help please

2011-05-17 Thread Littlefield, Tyler
Not to be pedantic or anything, and I may not be able to help regardless, but it looks like your space key is fixed, and I don't really care to pick through and try to play hangman with your message. On 5/17/2011 3:43 AM, hamed azarkeshb wrote: From: hamed3...@hotmail.com To:

Re: Faster Recursive Fibonacci Numbers

2011-05-17 Thread Ian Kelly
On Tue, May 17, 2011 at 9:50 AM, RJB rbott...@csusb.edu wrote: I noticed some discussion of recursion. the trick is to find a formula where the arguments are divided, not decremented. I've had a divide-and-conquer recursion for the Fibonacci numbers for a couple of years in C++ but just

Re: Faster Recursive Fibonacci Numbers

2011-05-17 Thread rusi
On May 17, 8:50 pm, RJB rbott...@csusb.edu wrote: I noticed some discussion of recursion. the trick is to find a formula where the arguments are divided, not decremented. I've had a divide-and-conquer recursion for the Fibonacci numbers for a couple of years in C++ but just for fun rewrote

Re: Python enabled gdb on Windows and relocation

2011-05-17 Thread Ruben Van Boxem
2011/5/15 Ruben Van Boxem vanboxem.ru...@gmail.com: 2011/5/15 Ruben Van Boxem vanboxem.ru...@gmail.com: 2011/5/15 Ruben Van Boxem vanboxem.ru...@gmail.com: 2011/5/14 Doug Evans d...@google.com: On Sat, May 14, 2011 at 2:09 AM, Ruben Van Boxem vanboxem.ru...@gmail.com wrote: 2011/5/14 Doug

Re: Faster Recursive Fibonacci Numbers

2011-05-17 Thread rusi
On May 17, 8:50 pm, RJB rbott...@csusb.edu wrote: I noticed some discussion of recursion. the trick is to find a formula where the arguments are divided, not decremented. I've had a divide-and-conquer recursion for the Fibonacci numbers for a couple of years in C++ but just for fun rewrote

Re: [ann] pyjamas 0.8alpha1 release

2011-05-17 Thread harrismh777
Terry Reedy wrote: Like it or not, Python 3 is the future of Python. It is the Python that many Python newcomers learn first, and perhaps ever will. Yes, no doubt, and I'm genuine about that... ... but there is something else to consider, as I'm sure you are aware. At some point Python is

Re: Faster Recursive Fibonacci Numbers

2011-05-17 Thread geremy condra
On Tue, May 17, 2011 at 9:36 AM, rusi rustompm...@gmail.com wrote: On May 17, 8:50 pm, RJB rbott...@csusb.edu wrote: I noticed some discussion of recursion. the trick is to find a formula where the arguments are divided, not decremented. I've had a divide-and-conquer recursion for the

in search of graceful co-routines

2011-05-17 Thread Chris Withers
Hi All, I'm looking for a graceful pattern for the situation where I have a provider of a sequence, the consumer of a sequence and code to moderate the two, and where I'd like to consumer to be able to signal to the provider that it hasn't succeeded in processing one element in the queue.

groupby - summing multiple columns in a list of lists

2011-05-17 Thread Jackson
I'm currently using a function pasted in below. This allows me to sum a column (index) in a list of lists. So if mylist = [[1, 2, 3], [1, 3, 4], [2, 3, 4], [2, 4, 5]] group_results(mylist,[0],1) Returns: [(1, 5), (2, 7)] What I would like to do is allow a tuple/list of index values, rather than

Re: Faster Recursive Fibonacci Numbers

2011-05-17 Thread Jussi Piitulainen
geremy condra writes: or O(1): φ = (1 + sqrt(5)) / 2 def fib(n): numerator = (φ**n) - (1 - φ)**n denominator = sqrt(5) return round(numerator/denominator) Testing indicates that it's faster somewhere around 7 or so. And increasingly inaccurate from 71 on. --

Re: in search of graceful co-routines

2011-05-17 Thread Ian Kelly
On Tue, May 17, 2011 at 11:04 AM, Chris Withers ch...@simplistix.co.uk wrote: Now, since the sequence is long, and comes from a file, I wanted the provider to be an iterator, so it occurred to me I could try and use the new 2-way generator communication to solve the communicate back with the

Re: in search of graceful co-routines

2011-05-17 Thread Carl Banks
On Tuesday, May 17, 2011 10:04:25 AM UTC-7, Chris Withers wrote: Now, since the sequence is long, and comes from a file, I wanted the provider to be an iterator, so it occurred to me I could try and use the new 2-way generator communication to solve the communicate back with the provider,

if statement on lenght of a list

2011-05-17 Thread Joe Leonardo
Hey all, Totally baffled by this...maybe I need a nap. Writing a small function to reject input that is not a list of 19 fields. def breakLine(value): if value.__class__() != [] and value.__len__() != 19: print 'You must pass a list that contains 19 fields.' else: print

best way to extract sentence from txt file

2011-05-17 Thread Robert Pazur
Hi all, my question is maybe quite simple: What is the best (and shortest) way to extract sentence from .txt file? Thanks in advance, Robert Pazur -- http://mail.python.org/mailman/listinfo/python-list

Re: groupby - summing multiple columns in a list of lists

2011-05-17 Thread Peter Otten
Jackson wrote: I'm currently using a function pasted in below. This allows me to sum a column (index) in a list of lists. So if mylist = [[1, 2, 3], [1, 3, 4], [2, 3, 4], [2, 4, 5]] group_results(mylist,[0],1) Returns: [(1, 5), (2, 7)] What I would like to do is allow a tuple/list of

Re: cPickle - invalid signature

2011-05-17 Thread Neal Becker
Gabriel Genellina wrote: En Tue, 17 May 2011 08:41:41 -0300, Neal Becker ndbeck...@gmail.com escribió: What does it mean when cPickle.load says: RuntimeError: invalid signature Is binary format not portable? Are you sure that's the actual error message? I cannot find such message

Re: if statement on lenght of a list

2011-05-17 Thread Jerry Hill
On Tue, May 17, 2011 at 2:02 PM, Joe Leonardo joe.leona...@datalogix.comwrote: Hey all, Totally baffled by this…maybe I need a nap. Writing a small function to reject input that is not a list of 19 fields. def breakLine(value): if value.__class__() != [] and value.__len__() != 19:

Re: if statement on lenght of a list

2011-05-17 Thread Chris Rebert
On Tue, May 17, 2011 at 11:02 AM, Joe Leonardo joe.leona...@datalogix.com wrote: Hey all, Totally baffled by this…maybe I need a nap. Writing a small function to reject input that is not a list of 19 fields. def breakLine(value):     if value.__class__() != [] and value.__len__() != 19:  

Re: if statement on lenght of a list

2011-05-17 Thread MRAB
On 17/05/2011 19:02, Joe Leonardo wrote: Hey all, Totally baffled by this…maybe I need a nap. Writing a small function to reject input that is not a list of 19 fields. def breakLine(value): if value.__class__() != [] and value.__len__() != 19: print 'You must pass a list that

Re: if statement on lenght of a list

2011-05-17 Thread Ian Kelly
On Tue, May 17, 2011 at 12:02 PM, Joe Leonardo joe.leona...@datalogix.comwrote: Hey all, Totally baffled by this…maybe I need a nap. Writing a small function to reject input that is not a list of 19 fields. def breakLine(value): if value.__class__() != [] and value.__len__() !=

Python 3.x and bytes

2011-05-17 Thread Ethan Furman
In Python 3 one can say -- huh = bytes(5) Since the bytes type is actually a list of integers, I would have expected this to have huh being a bytestring with one element -- the integer 5. Actually, what you get is: -- huh b'\x00\x00\x00\x00\x00' or five null bytes. Note that this is an

[RELEASED] Python 3.2.1 rc 1

2011-05-17 Thread Georg Brandl
On behalf of the Python development team, I am pleased to announce the first release candidate of Python 3.2.1. Python 3.2.1 will the first bugfix release for Python 3.2, fixing over 120 bugs and regressions in Python 3.2. For an extensive list of changes and features in the 3.2 line, see

Re: best way to extract sentence from txt file

2011-05-17 Thread Michiel Overtoom
On May 17, 2011, at 20:22, Robert Pazur wrote: my question is maybe quite simple: What is the best (and shortest) way to extract sentence from .txt file? Well, open(filename.txt).readlines() gives you a list of all the lines in a txt file, which might not be sentences, depending on the text

Re: if statement on lenght of a list

2011-05-17 Thread Ethan Furman
Joe Leonardo wrote: Totally baffled by this…maybe I need a nap. Writing a small function to reject input that is not a list of 19 fields. def breakLine(value): if value.__class__() != [] and value.__len__() != 19: print 'You must pass a list that contains 19 fields.' else:

Re: Faster Recursive Fibonacci Numbers

2011-05-17 Thread geremy condra
On Tue, May 17, 2011 at 10:19 AM, Jussi Piitulainen jpiit...@ling.helsinki.fi wrote: geremy condra writes: or O(1): φ = (1 + sqrt(5)) / 2 def fib(n):     numerator = (φ**n) - (1 - φ)**n     denominator = sqrt(5)     return round(numerator/denominator) Testing indicates that it's faster

Re: best way to extract sentence from txt file

2011-05-17 Thread Miki Tebeka
http://nltk.googlecode.com/svn/trunk/doc/api/nltk.tokenize-module.html ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.x and bytes

2011-05-17 Thread Ian Kelly
On Tue, May 17, 2011 at 12:47 PM, Ethan Furman et...@stoneleaf.us wrote: In Python 3 one can say -- huh = bytes(5) Since the bytes type is actually a list of integers, I would have expected this to have huh being a bytestring with one element -- the integer 5.  Actually, what you get is:

Re: Python 3.x and bytes

2011-05-17 Thread Felipe Bastos Nunes
They accept .replace(b00, b12) for example. Documentation about it.http://docs.python.org/py3k/library/stdtypes.html#bytes-methods 2011/5/17 Ethan Furman et...@stoneleaf.us In Python 3 one can say -- huh = bytes(5) Since the bytes type is actually a list of integers, I would have expected

Re: Python 3.x and bytes

2011-05-17 Thread Ian Kelly
On Tue, May 17, 2011 at 1:20 PM, Ian Kelly ian.g.ke...@gmail.com wrote: I suppose it's for interoperability with the mutable bytearray type, which takes the same parameters in the constructor. http://www.python.org/dev/peps/pep-3137/#constructors --

Cartoonify Myself

2011-05-17 Thread Chris M. Bartos
Hi, Is there a Python module that can cartoonify a picture of myself? There's got to be an algorithm out there somewhere, right? If there is a way to cartoon a single picture, could you cartoonify a video, too? Thanks for your help. Chris -- Christopher M. Bartos bartos...@osu.edu

Re: problem with GKT module?

2011-05-17 Thread Alister Ware
On Mon, 16 May 2011 14:56:38 -0500, harrismh777 wrote: alister ware wrote: def callback(self,widget,data=None): print widget #gives reference to radio button ok print widget.name #widget name on windoze, None on linux Well,

Re: Python 3.x and bytes

2011-05-17 Thread MRAB
On 17/05/2011 19:47, Ethan Furman wrote: In Python 3 one can say -- huh = bytes(5) Since the bytes type is actually a list of integers, I would have expected this to have huh being a bytestring with one element -- the integer 5. Actually, what you get is: -- huh b'\x00\x00\x00\x00\x00' or

Re: FW: help please

2011-05-17 Thread Albert Hopkins
On Tue, 2011-05-17 at 10:18 -0600, Littlefield, Tyler wrote: Not to be pedantic or anything, and I may not be able to help regardless, but it looks like your space key is fixed, and I don't really care to pick through and try to play hangman with your message. I actually, at first glance,

Re: Python 3.x and bytes

2011-05-17 Thread Corey Richardson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/17/2011 02:47 PM, Ethan Furman wrote: In Python 3 one can say -- huh = bytes(5) Since the bytes type is actually a list of integers, I would have expected this to have huh being a bytestring with one element -- the integer 5.

Re: ipython prompt does not appear in windows

2011-05-17 Thread Dan Stromberg
Try running ipython in a cmd.exe. If that works, it almost certainly means that the I/O is going directly to video RAM instead of through a disciplined API. On Tue, May 17, 2011 at 12:00 AM, rusi rustompm...@gmail.com wrote: If I use ipython under emacs on linux it works (at least basic REPL)

Re: Python 3.x and bytes

2011-05-17 Thread Ethan Furman
Felipe Bastos Nunes wrote: 2011/5/17 Ethan Furman wrote: In Python 3 one can say -- huh = bytes(5) Since the bytes type is actually a list of integers, I would have expected this to have huh being a bytestring with one element -- the integer 5. Actually, what you get is: -- huh

Re: portable multiprocessing code

2011-05-17 Thread Michael Kent
You could also install Python 2.7 on that RedHat machine. It can be done without interfering with the 2.5 that RedHat depends on. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.x and bytes

2011-05-17 Thread Felipe Bastos Nunes
This piece of code works fine for me: somevar = bytes() somevar '' somevar.replace(b'', b'10') '10' somevar '' somevar = somevar.replace(b'', b'10') somevar '10' somevar2 = bytes(b'10'*2) somevar2 '1010' somevar2 = somevar2.replace(b'01', b'57'*3) somevar2 '15757570'

Re: Cartoonify Myself

2011-05-17 Thread andy baxter
On 17/05/11 20:26, Chris M. Bartos wrote: Hi, Is there a Python module that can cartoonify a picture of myself? There's got to be an algorithm out there somewhere, right? If there is a way to cartoon a single picture, could you cartoonify a video, too? Thanks for your help. Chris You

Re: Trying to understand html.parser.HTMLParser

2011-05-17 Thread Karim
On 05/17/2011 03:05 AM, Andrew Berg wrote: On 2011.05.16 02:26 AM, Karim wrote: Use regular expression for bad HTLM or beautifulSoup (google it), below a exemple to extract all html links: linksList = re.findall('a href=(.*?).*?/a',htmlSource) for link in linksList: print link I was

Re: Python enabled gdb on Windows and relocation

2011-05-17 Thread Doug Evans
On Sun, May 15, 2011 at 6:26 AM, Ruben Van Boxem vanboxem.ru...@gmail.com wrote: Wow, I think I have a partial solution. Delving into the Python docs, for example here: http://docs.python.org/using/windows.html#finding-modules, you can see that PYTHONPATH is used first, then the Windows

Re: Python 3.x and bytes

2011-05-17 Thread Ethan Furman
Corey Richardson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/17/2011 02:47 PM, Ethan Furman wrote: In Python 3 one can say -- huh = bytes(5) Since the bytes type is actually a list of integers, I would have expected this to have huh being a bytestring with one element -- the

Re: Python 3.x and bytes

2011-05-17 Thread Felipe Bastos Nunes
Mine bytes constructor when useing Corey's advice give's me a string instead of a b''... 2011/5/17 Corey Richardson kb1...@aim.com -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/17/2011 02:47 PM, Ethan Furman wrote: In Python 3 one can say -- huh = bytes(5) Since the bytes

Re: Python 3.x and bytes

2011-05-17 Thread Ian Kelly
On Tue, May 17, 2011 at 1:50 PM, Corey Richardson kb1...@aim.com wrote: - From help(bytes):  |  bytes(iterable_of_ints) - bytes  |  bytes(string, encoding[, errors]) - bytes  |  bytes(bytes_or_buffer) - immutable copy of bytes_or_buffer  |  bytes(memory_view) - bytes Looks like you're using

Re: Python enabled gdb on Windows and relocation

2011-05-17 Thread Doug Evans
On Sun, May 15, 2011 at 9:11 AM, Ruben Van Boxem vanboxem.ru...@gmail.com wrote: I am sorry for the repeated messages that no one cares about, but I may have discovered GDB in its current form already allows what I want: I tried to figure out what exact paths the snake in gdb was using to

Re: Python 3.x and bytes

2011-05-17 Thread Ian Kelly
On Tue, May 17, 2011 at 2:20 PM, Ethan Furman et...@stoneleaf.us wrote: The big question, though, is would you do it this way: some_var = bytes(23).replace(b'\x00', b'a') or this way? some_var = bytes(b'a' * 23) Actually, I would just do it this way: some_var = b'a' * 23 That's already a

python logging

2011-05-17 Thread Fei
where is default logging file on Mac? I saw lots of app just import logging, and begins to logging.info(...) etc. I'm not sure where to look at the logging configuration to figure out the log location. I just get in touch of python about 1month ago, and I appreciate your help. --

Re: Faster Recursive Fibonacci Numbers

2011-05-17 Thread Wolfram Hinderer
On 17 Mai, 20:56, geremy condra debat...@gmail.com wrote: On Tue, May 17, 2011 at 10:19 AM, Jussi Piitulainen jpiit...@ling.helsinki.fi wrote: geremy condra writes: or O(1): ö = (1 + sqrt(5)) / 2 def fib(n):     numerator = (ö**n) - (1 - ö)**n     denominator = sqrt(5)    

Re: portable multiprocessing code

2011-05-17 Thread Ian Kelly
On Tue, May 17, 2011 at 9:14 AM, Eric Frederich eric.freder...@gmail.com wrote: I have written some code using Python 2.7 but I'd like these scripts to be able to run on Red Hat 5's 2.4.3 version of Python which doesn't have multiprocessing. I can try to import multiprocessing and set a flag

test_argparse.py FAILED (failures=6)

2011-05-17 Thread nirinA raseliarison
== FAIL: test_failures_many_groups_listargs (__main__.TestFileTypeW) -- Traceback (most recent call last): File Lib/test/test_argparse.py, line 216, in

test_ftplib.py failed with segmentation fault,gcc4.6.0,glibc-2.13

2011-05-17 Thread nirinA raseliarison
hi all, i can't get connected to bugs.python.org so here my make test results. make test aborted when running test_ftplib. and running # ./python Lib/test/test_ftplib.py Segmentation fault with this kernel message: [ 2166.927138] python[12142]: segfault

smtplib is broken when using TLS

2011-05-17 Thread nirinA raseliarison
i think this has the same origin as the ftplib test failure. Python 3.2.1rc1 (default, May 17 2011, 22:01:34) [GCC 4.6.0] on linux2 Type copyright, credits or license() for more information. RESTART send: 'ehlo

Re: Python 3.x and bytes

2011-05-17 Thread Corey Richardson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/17/2011 04:55 PM, Ethan Furman wrote: Apparently, it's not well documented. If you check PEP 358 you'll find it. ~Ethan~ Agreed, it looks like it should be mentioned in bytes.__doc__ about the single-integer argument. - -- Corey

Re: Having a problem getting python working...

2011-05-17 Thread Ned Deily
In article 6e09a0f4-b9a6-4c9f-874b-cb6e21ef7...@gmail.com, Chris Paton chrispaton2...@gmail.com wrote: Not sure if this is the right place to put this (forgive me for my ignorance, I'm looking everywhere!). I'm having a problem getting IDLE working. I'm working off Mac OSX 10.6.7 with Python

Re: Faster Recursive Fibonacci Numbers

2011-05-17 Thread geremy condra
On Tue, May 17, 2011 at 2:04 PM, Wolfram Hinderer wolfram.hinde...@googlemail.com wrote: On 17 Mai, 20:56, geremy condra debat...@gmail.com wrote: On Tue, May 17, 2011 at 10:19 AM, Jussi Piitulainen jpiit...@ling.helsinki.fi wrote: geremy condra writes: or O(1): ö = (1 + sqrt(5)) / 2

Re: python logging

2011-05-17 Thread Rafael Durán Castañeda
On 17/05/11 22:55, Fei wrote: where is default logging file on Mac? I saw lots of app just import logging, and begins to logging.info(...) etc. I'm not sure where to look at the logging configuration to figure out the log location. I just get in touch of python about 1month ago, and I

Re: Python 3.x and bytes

2011-05-17 Thread Ethan Furman
Ian Kelly wrote: On Tue, May 17, 2011 at 2:20 PM, Ethan Furman et...@stoneleaf.us wrote: The big question, though, is would you do it this way: some_var = bytes(23).replace(b'\x00', b'a') or this way? some_var = bytes(b'a' * 23) Actually, I would just do it this way: some_var = b'a' * 23

English Idiom in Unix: Directory Recursively

2011-05-17 Thread Xah Lee
might be of interest. 〈English Idiom in Unix: Directory Recursively〉 http://xahlee.org/comp/idiom_directory_recursively.html -- English Idiom in Unix: Directory Recursively Xah Lee, 2011-05-17 Today, let's discuss something in the category of lingustics.

Re: ipython prompt does not appear in windows

2011-05-17 Thread Ori L.
See here for a workaround: https://bugs.launchpad.net/ipython/+bug/290228 First result on Google for the query ipython emacs windows, BTW. On May 17, 3:00 am, rusi rustompm...@gmail.com wrote: If I use ipython under emacs on linux it works (at least basic REPL) ie I can type an expression and

Re: python logging

2011-05-17 Thread Ian Kelly
On Tue, May 17, 2011 at 2:55 PM, Fei mail2...@gmail.com wrote: where is default logging file on Mac? I saw lots of app just import logging, and begins to logging.info(...) etc.  I'm not sure where to look at the logging configuration to figure out the log location. There is no default log

Re: English Idiom in Unix: Directory Recursively

2011-05-17 Thread Ian Kelly
On Tue, May 17, 2011 at 4:26 PM, Xah Lee xah...@gmail.com wrote: Though, if you think about it, it's not exactly a correct description. “Recursive”, or “recursion”, refers to a particular type of algorithm, or a implementation using that algorithm. Only when used as programming jargon. In

Re: best way to extract sentence from txt file

2011-05-17 Thread Chris Angelico
On Wed, May 18, 2011 at 4:40 AM, Michiel Overtoom mot...@xs4all.nl wrote: Until then we have to guess, and my E.S.P. is notoriously bad. Roll d20 and add your ESP skill and your Wisdom modifier. The DC for this test is 20 if you're familiar with DD, or 25 if you are not. Chris Angelico Dungeon

Re: English Idiom in Unix: Directory Recursively

2011-05-17 Thread Chris Angelico
On Wed, May 18, 2011 at 8:26 AM, Xah Lee xah...@gmail.com wrote:      Apply changes to this folder only.        Apply changes to this folder, subfolders and files. Note the second choice. In unix, it would say “Apply changes to this folder recursively.” I think this is more about the Windows

Re: FW: help please

2011-05-17 Thread Gabriel Genellina
En Tue, 17 May 2011 16:48:29 -0300, Albert Hopkins mar...@letterboxes.org escribió: On Tue, 2011-05-17 at 10:18 -0600, Littlefield, Tyler wrote: Not to be pedantic or anything, and I may not be able to help regardless, but it looks like your space key is fixed, and I don't really care to pick

Re: cPickle - invalid signature

2011-05-17 Thread Gabriel Genellina
En Tue, 17 May 2011 15:26:53 -0300, Neal Becker ndbeck...@gmail.com escribió: Gabriel Genellina wrote: En Tue, 17 May 2011 08:41:41 -0300, Neal Becker ndbeck...@gmail.com escribió: What does it mean when cPickle.load says: RuntimeError: invalid signature Is binary format not portable?

Re: FW: help please

2011-05-17 Thread Littlefield, Tyler
I can't remember exactly in which release 'perfect English skills' were added to Python runtime requirements, could you please refresh my memory? the one that requires people use the space key and check over their messages before they hit the enter key. Not so bad a request, I don't think. I am

Ed hardy, (tshirt$13, swim strunk$25, jean$30, handbag$34, cap$13, sunglass$12, shoes$25), Nike shoes:$32, Handbag:$35, NFL:$20, jean:$30, air force one shoes, lv, gucci, DG, bbc, coachUGG boot:$50

2011-05-17 Thread john kode
Get Nike Shoes at Super Cheap Prices Discount Ed hardy tshirt (www.dmuch.com) Discount Ed hardy swimming suit (www.dmuch.com) Discount Ed hardy jean (www.dmuch.com) Discount Ed hardy shoes (www.dmuch.com) Discount Ed hardy handbag (www.dmuch.com) Discount Ed hardy other porduct

Re: cPickle - invalid signature

2011-05-17 Thread Gabriel Genellina
En Tue, 17 May 2011 15:26:53 -0300, Neal Becker ndbeck...@gmail.com escribió: Gabriel Genellina wrote: En Tue, 17 May 2011 08:41:41 -0300, Neal Becker ndbeck...@gmail.com escribió: What does it mean when cPickle.load says: RuntimeError: invalid signature Is binary format not portable?

basic bytecode to machine code compiler (part 2)

2011-05-17 Thread Rouslan Korneychuk
I mentioned before that I had a proof of concept to convert Python bytecode to native machine code. It's available at https://github.com/Rouslan/nativecompile Now that I have a substantial number of the bytecode instructions implemented, I thought I would share some benchmark results. The

Re: python logging

2011-05-17 Thread Fei
On May 17, 6:55 pm, Ian Kelly ian.g.ke...@gmail.com wrote: On Tue, May 17, 2011 at 2:55 PM, Fei mail2...@gmail.com wrote: where is default logging file on Mac? I saw lots of app just import logging, and begins to logging.info(...) etc.  I'm not sure where to look at the logging

Re: English Idiom in Unix: Directory Recursively

2011-05-17 Thread Steven W. Orr
On 5/17/2011 6:26 PM, Xah Lee wrote: might be of interest. 〈English Idiom in Unix: Directory Recursively〉 http://xahlee.org/comp/idiom_directory_recursively.html The answer is from compute science 101. From any standard data structures course, you learn the algorithm for how to walk a tree.

Re: pyjamas 0.8alpha1 release

2011-05-17 Thread Terry Reedy
On 5/17/2011 12:07 PM, lkcl wrote: On May 4, 7:37 pm, Terry Reedytjre...@udel.edu wrote: On 5/4/2011 10:06 AM, Luke Kenneth Casson Leighton wrote: pyjamasis a suite of projects, including a python-to-javascript compiler As you well know, there is no such thing as 'python' when it comes to

Finding the local directory of a file in the python path

2011-05-17 Thread are Dogue
Hi there, I have a problem that I can't seem to solve after quite a bit of searching, probably because I can't find the right terms to search for. Basically, here's the situation. Let's say I have a file at ~/foo/bin/ foo.py that imports a script that at ~/bar/bin/bar.py. The imported file needs

  1   2   >