Re: guessthenumber print games left

2013-04-11 Thread eschneider92
How do I make it say that I have one game left? I'm having trouble fitting it into my main code. Thanks a lot for the help btw. -- http://mail.python.org/mailman/listinfo/python-list

Re: guessthenumber print games left

2013-04-11 Thread Chris Angelico
On Thu, Apr 11, 2013 at 3:56 PM, eschneide...@comcast.net wrote: How do I make it say that I have one game left? I'm having trouble fitting it into my main code. Thanks a lot for the help btw. The main confusion seems to be over whether to add one or two. If you add one, it'll tell you you

Re: guessthenumber print games left

2013-04-11 Thread eschneider92
The 2 makes the game play twice instead of 3 times, right? I've tried it with the 1, but but I'm still having trouble. Again, to be exact, I want to somehow make it count down from 2 (the number of games)and print. If that's what this does, is it possible to insert it into my original main

Re: guessthenumber print games left

2013-04-11 Thread Chris Angelico
On Thu, Apr 11, 2013 at 4:15 PM, eschneide...@comcast.net wrote: The 2 makes the game play twice instead of 3 times, right? I've tried it with the 1, but but I'm still having trouble. Again, to be exact, I want to somehow make it count down from 2 (the number of games)and print. If that's

Re: Python pdb bug, followed by bug in bugs.python.org

2013-04-11 Thread Ned Deily
In article asm8lhf602...@mid.individual.net, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Ned Deily wrote: There is a meta tracker for problems with the Python issuer tracker itself: http://psf.upfronthosting.co.za/roundup/meta/ but you do have to register for that tracker (a

Re: Unicode issue with Python v3.3

2013-04-11 Thread nagia . retsina
Since now we k ow the problem maybe we can tell metrites.py to open index.html using utf-8 encoding rather as binary, dont you think? -- http://mail.python.org/mailman/listinfo/python-list

Re: name lookup failure using metaclasses with unittests

2013-04-11 Thread Ulrich Eckhardt
Am 10.04.2013 11:52, schrieb Peter Otten: Ulrich Eckhardt wrote: [...] It looks like this particular invocation relies on class attribute and function __name__ being identical. Please file a bug report. Thanks for confirming this and reducing the test case even more. Now, concerning

Re: name lookup failure using metaclasses with unittests

2013-04-11 Thread Ulrich Eckhardt
Am 10.04.2013 11:52, schrieb Peter Otten: It looks like this particular invocation relies on class attribute and function __name__ being identical. Please file a bug report. http://bugs.python.org/issue17696 Uli -- http://mail.python.org/mailman/listinfo/python-list

Re: guessthenumber print games left

2013-04-11 Thread eschneider92
If you get the time, please post an example, because I don't understand. -- http://mail.python.org/mailman/listinfo/python-list

Re: guessthenumber print games left

2013-04-11 Thread Chris Angelico
On Thu, Apr 11, 2013 at 5:15 PM, eschneide...@comcast.net wrote: If you get the time, please post an example, because I don't understand. (It helps to include some quoted text to provide context to your post.) Imagine you had a program that just showed the number of games left, nothing else.

Re: use a loop to create lists

2013-04-11 Thread Thomas Goebel
* On 10/04/2013 10:40, martaamu...@gmail.com wrote: Hi! I would like to create a list containing lists. I need each list to have a differente name and i would like to use a loop to name the list. [...] global_list=[] for i in range (20): (list_+i)=[] #These would be the name of the

Re: Strange files??

2013-04-11 Thread Dave Angel
On 04/10/2013 05:16 PM, Joe Hill wrote: Recently I installed Python 3.3 successfully. Yesterday - I have a bunch of PY files such as thesaurus.py, some *.p7s files, some signature files and an index.fpickle. A total of 23 files. Where do they come from and how do they end up as incoming

Re: performance of script to write very long lines of random chars

2013-04-11 Thread Steven D'Aprano
On Wed, 10 Apr 2013 18:21:51 -0700, gry wrote: Dear pythonistas, I am writing a tiny utility to produce a file consisting of a specified number of lines of a given length of random ascii characters. I am hoping to find a more time and memory efficient way, that is still fairly simple

Re: Unicode issue with Python v3.3

2013-04-11 Thread Steven D'Aprano
On Thu, 11 Apr 2013 00:13:46 -0700, nagia.retsina wrote: Since now we k ow the problem maybe we can tell metrites.py to open index.html using utf-8 encoding rather as binary, dont you think? What makes you think it is UTF-8? Last time you tried decoding content as UTF-8, you got an error that

Re: name lookup failure using metaclasses with unittests

2013-04-11 Thread Steven D'Aprano
On Thu, 11 Apr 2013 08:43:58 +0200, Ulrich Eckhardt wrote: The first thing I was wondering was why Python doesn't complain about a class property that is marked as special (leading and trailing double underscores) but that it knows nothing about. Because that breaks backward compatibility.

Re: name lookup failure using metaclasses with unittests

2013-04-11 Thread Arnaud Delobelle
On 11 April 2013 07:43, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: The second question that came up was if there is a way to keep a metaclass defined inside the class or if the only way is to provide it externally. Yes, using metaclasses! I wouldn't recommend it though. Here's a

Re: Unicode issue with Python v3.3

2013-04-11 Thread Steven D'Aprano
On Thu, 11 Apr 2013 07:50:19 +, Steven D'Aprano wrote: On Thu, 11 Apr 2013 00:13:46 -0700, nagia.retsina wrote: Since now we k ow the problem maybe we can tell metrites.py to open index.html using utf-8 encoding rather as binary, dont you think? What makes you think it is UTF-8?

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-11 Thread someone
On 2013-04-11 03:39, Cousin Stanley wrote: for row in list_tuples : print ' ' , row.date , row.time , row.col1 , row.col3 , row.col4 file_source.close() Oh, that's great - thank you - I didn't know this named-tuple container before... I'm still wondering whether or not it's the

Return a value from a function result

2013-04-11 Thread Ombongi Moraa Fe
Hello Team, My perl script a.pl calls python script b.py and passes arguments to it; expecting a return value; b.py uses suds to facilitate soap-based communication with another server which then returns some value (deliveryStatus) basically, my b.py script has these 3 major parts; #part 1 of

Re: USBLock : lock/unlock your computer with a USB key

2013-04-11 Thread Dylan Evans
This looks cool, would actual be pretty useful. I see you did it as a usb project but probably bluetooth would be better so you could just pair it to your phone and know that your PC will lock when you walk away. On Tue, Apr 9, 2013 at 1:21 AM, Sven sven...@gmail.com wrote: I've been working

Re: performance of script to write very long lines of random chars

2013-04-11 Thread Oscar Benjamin
On 11 April 2013 02:21, gry georgeryo...@gmail.com wrote: Dear pythonistas, I am writing a tiny utility to produce a file consisting of a specified number of lines of a given length of random ascii characters. I am hoping to find a more time and memory efficient way, that is still fairly

Can I iterate over a dictionary outside a function ?

2013-04-11 Thread inshu chauhan
I have a prog in which a functions returns a dict but when I try to iterate over the dict using iterkeys, It shows an error. I think its because only address of the dictionary is returned so cannot be iterated upon. Please suggest some way by which it can be made possible to iterate over the

Re: performance of script to write very long lines of random chars

2013-04-11 Thread Oscar Benjamin
On 11 April 2013 08:47, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: One thing to be aware of: urandom may run out of entropy, and then it will slow down a lot. If you don't care about cryptographic randomness, you could use this instead: Reading this I'm realising that I don't

Re: Can I iterate over a dictionary outside a function ?

2013-04-11 Thread Oscar Benjamin
On 11 April 2013 10:48, inshu chauhan insidesh...@gmail.com wrote: I have a prog in which a functions returns a dict but when I try to iterate over the dict using iterkeys, It shows an error. I think its because only address of the dictionary is returned so cannot be iterated upon. Please

Re: Unicode issue with Python v3.3

2013-04-11 Thread nagia . retsina
Τη Πέμπτη, 11 Απριλίου 2013 11:20:47 π.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: On Thu, 11 Apr 2013 07:50:19 +, Steven D'Aprano wrote: On Thu, 11 Apr 2013 00:13:46 -0700, nagia.retsina wrote: Since now we k ow the problem maybe we can tell metrites.py to open

Re: Unicode issue with Python v3.3

2013-04-11 Thread Lele Gaifax
nagia.rets...@gmail.com writes: metrites.py tries to open that script so we must tell it to open as utf-8 text and not as a binary file. One way is the following: from codecs import open with open('index.html', encoding='utf-8') as f: content = f.read() ciao, lele. --

Re: Unicode issue with Python v3.3

2013-04-11 Thread Cameron Simpson
On 10Apr2013 21:50, nagia.rets...@gmail.com nagia.rets...@gmail.com wrote: | Firtly thank uou for taking a look into the code. | the doctype is coming form the attempt of script metrites.py to open and read the 'index.html' file. | But i don't know how to try to open it as a byte file instead of

Re: Unicode issue with Python v3.3

2013-04-11 Thread nagia . retsina
Of course here is how it look like: if page.endswith('.html'): f = open( /home/nikos/www/ + page, encoding=utf-8 ) htmldata = f.read() htmldata = htmldata % (quote, music) counter = ''' center

Re: performance of script to write very long lines of random chars

2013-04-11 Thread Steven D'Aprano
On Thu, 11 Apr 2013 10:47:43 +0100, Oscar Benjamin wrote: On 11 April 2013 08:47, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: One thing to be aware of: urandom may run out of entropy, and then it will slow down a lot. If you don't care about cryptographic randomness, you

Re: USBLock : lock/unlock your computer with a USB key

2013-04-11 Thread Sven
Thanks for taking an interest. Yes, I had the idea to add bluetooth too, removes the whole plugging and unplugging spiel. I might start work on that, and if anyone else wants to dive in and help, feel free. I will probably need to refactor the Listener a little, or create a USB and BT listener

Re: performance of script to write very long lines of random chars

2013-04-11 Thread Robert Kern
On 2013-04-11 16:20, Steven D'Aprano wrote: On Thu, 11 Apr 2013 10:47:43 +0100, Oscar Benjamin wrote: On 11 April 2013 08:47, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: One thing to be aware of: urandom may run out of entropy, and then it will slow down a lot. If you don't

Re: Can I iterate over a dictionary outside a function ?

2013-04-11 Thread Mark Lawrence
On 11/04/2013 10:48, inshu chauhan wrote: I have a prog in which a functions returns a dict but when I try to iterate over the dict using iterkeys, It shows an error. I think its because only address of the dictionary is returned so cannot be iterated upon. Please suggest some way by which it

Re: performance of script to write very long lines of random chars

2013-04-11 Thread Oscar Benjamin
On 11 April 2013 11:50, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Thu, 11 Apr 2013 10:47:43 +0100, Oscar Benjamin wrote: On 11 April 2013 08:47, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: One thing to be aware of: urandom may run out of entropy, and then

Fwd: use a loop to create lists

2013-04-11 Thread Franz Kelnreiter
-- Forwarded message -- From: Franz Kelnreiter kelnrei...@gmail.com Date: Thu, Apr 11, 2013 at 2:09 PM Subject: Re: use a loop to create lists To: thomas.goe...@ohm-hochschule.de On Thu, Apr 11, 2013 at 1:46 PM, Thomas Goebel thomas.goe...@ohm-hochschule.de wrote: * On

Problems with sockets and threads

2013-04-11 Thread Dexter Deejay
When i try to run this code and to connect to server (server is written in java that part of code is ok) everything stalls. Thread that i created here occupies processor all the time and GUI freezes. It's supposed to be waiting for message from server. (asynchronous one) Is there something that

Re: Can I iterate over a dictionary outside a function ?

2013-04-11 Thread Neil Cerutti
On 2013-04-11, Mark Lawrence breamore...@yahoo.co.uk wrote: On 11/04/2013 10:48, inshu chauhan wrote: I have a prog in which a functions returns a dict but when I try to iterate over the dict using iterkeys, It shows an error. I think its because only address of the dictionary is returned so

Re: Problems with sockets and threads

2013-04-11 Thread Wayne Werner
On Thu, 11 Apr 2013, Dexter Deejay wrote: When i try to run this code and to connect to server (server is written in java that part of code is ok) everything stalls. Thread that i created here occupies processor all the time and GUI freezes. It's supposed to be waiting for message from

Re: guessthenumber print games left

2013-04-11 Thread Neil Cerutti
On 2013-04-11, eschneide...@comcast.net eschneide...@comcast.net wrote: If you get the time, please post an example, because I don't understand. Maybe it would help to think about contraints. Write them next to your variable names, and then check, at every point in your program, if the

Re: Problems with sockets and threads

2013-04-11 Thread Dexter Deejay
Yeah, that seems to be problem. Waiting for message is in theory infinite. But why doesn't this separate thread leave processor while it is sleeping? -- http://mail.python.org/mailman/listinfo/python-list

Re: use a loop to create lists

2013-04-11 Thread Thomas Goebel
* On 11/04/2013 14:11, Franz Kelnreiter wrote: On Thu, Apr 11, 2013 at 1:46 PM, Thomas Goebel wrote: the difference between your and my code is that global_list = {'_'.join(['list', str(i)]):[] for i in range(20)} creates a dict 'global_list' which has 20 keys named from 'list_0' to

Re: Problems with sockets and threads

2013-04-11 Thread Wayne Werner
On Thu, 11 Apr 2013, Dexter Deejay wrote: Yeah, that seems to be problem. Waiting for message is in theory infinite. But why doesn't this separate thread leave processor while it is sleeping? As far as I've been able to tell? Magic ;) But I haven't really dug into it. If you're really doing

Re: Problems with sockets and threads

2013-04-11 Thread Dexter Deejay
Thanks for help. Do you have any reference to pint me out for that subprocess creation? -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with sockets and threads

2013-04-11 Thread Dexter Deejay
Thanks for help. Do you have any reference to direct me for that subprocess creation? -- http://mail.python.org/mailman/listinfo/python-list

Re: use a loop to create lists

2013-04-11 Thread Chris Angelico
On Thu, Apr 11, 2013 at 10:57 PM, Thomas Goebel thomas.goe...@ohm-hochschule.de wrote: [a for a in range(3)] will return a list [0, 1, 2] Simplification possible: That's the same as: list(range(3)) f = {'list_' + str(n):[m for m in range(3)] for n in range(3)} Meaning that this can be

Re: performance of script to write very long lines of random chars

2013-04-11 Thread Robert Kern
On 2013-04-11 17:35, Oscar Benjamin wrote: On 11 April 2013 11:50, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Thu, 11 Apr 2013 10:47:43 +0100, Oscar Benjamin wrote: On 11 April 2013 08:47, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: One thing to be aware

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-11 Thread someone
On 2013-04-11 10:49, someone wrote: On 2013-04-11 03:39, Cousin Stanley wrote: Is there any clever way of avoiding this for loop, for either this container or another clever container type? Ah, I see - I can also just add a numpy array, i.e: -- import

Re: Fwd: use a loop to create lists

2013-04-11 Thread Thomas Goebel
* On 11/04/2013 14:11, Franz Kelnreiter wrote: On Thu, Apr 11, 2013 at 1:46 PM, Thomas Goebel wrote: global_list = {'_'.join(['list', str(i)]):[] for i in range(20)} Thanks for your explanation, I think I know what you want to do and I would very much like to understand your code in detail

Re: performance of script to write very long lines of random chars

2013-04-11 Thread Chris Angelico
On Thu, Apr 11, 2013 at 10:05 PM, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On 11 April 2013 11:50, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Some (most?) modern operating systems provide a cryptographically strong source of non-deterministic randomness. The

Re: Return a value from a function result

2013-04-11 Thread Chris Angelico
On Thu, Apr 11, 2013 at 7:06 PM, Ombongi Moraa Fe moraa.lovetak...@gmail.com wrote: My perl script a.pl calls python script b.py and passes arguments to it; expecting a return value; Can you clarify this part, please? What kind of return value is your Perl script expecting? Presumably you

Re: use a loop to create lists

2013-04-11 Thread Franz Kelnreiter
On Thu, Apr 11, 2013 at 2:57 PM, Thomas Goebel thomas.goe...@ohm-hochschule.de wrote: ... Which is the same as: f = {'list_' + str(n):[m for m in range(3)] for n in range(3)} Thomas, thank you for your patience and your long explanation! Now I understand better this shorthand expression of

Re: Problems with sockets and threads

2013-04-11 Thread Dexter Deejay
FOUND ERROR! :D In creatin method of thread i wrote treadFunc() and should have said threadFunc (as pointer). Now i have problem with Text component. How to append string at end of it? -- http://mail.python.org/mailman/listinfo/python-list

Re: use a loop to create lists

2013-04-11 Thread Thomas Goebel
* On 11/04/2013 16:11, Franz Kelnreiter wrote: On Thu, Apr 11, 2013 at 2:57 PM, Thomas Goebel thomas.goe...@ohm-hochschule.de wrote: ... Which is the same as: f = {'list_' + str(n):[m for m in range(3)] for n in range(3)} [...] But didnt you miss square brackets: f = {'list_' +

Re: Fwd: use a loop to create lists

2013-04-11 Thread Franz Kelnreiter
On Thu, Apr 11, 2013 at 3:43 PM, Thomas Goebel thomas.goe...@ohm-hochschule.de wrote: ... I get a syntax error, as I exepected (Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19)). Sorry Franz, as you are using python 2.6 you have to use d1 = dict(('list_' + str(i), []) for i in

Re: Problems with sockets and threads

2013-04-11 Thread Peter Otten
Dexter Deejay wrote: When i try to run this code and to connect to server (server is written in java that part of code is ok) everything stalls. Thread that i created here occupies processor all the time and GUI freezes. It's supposed to be waiting for message from server. (asynchronous one)

Re: Python pdb bug, followed by bug in bugs.python.org

2013-04-11 Thread donaldcallen
Suggestions? Post the 10-line program here, so others can verify whether it is a bug. #! /usr/bin/env python3 import pdb def foo(message): print(message) pdb.set_trace() foo('first call') foo('second call') Stick this in an file with execute permission and run it. At

Re: Python pdb bug, followed by bug in bugs.python.org

2013-04-11 Thread donaldcallen
On Tuesday, April 9, 2013 6:17:28 PM UTC-4, Ned Deily wrote: In article a34e8251-85df-4486-b5a1-72eb2bb9f...@googlegroups.com, donallen wrote: I am I've developed an application in Python 3.3.1 (on an up-to-date 64-bit Arch Linux system) and am attempting to use pdb to debug it.

Re: USBLock : lock/unlock your computer with a USB key

2013-04-11 Thread Ethan Furman
On 04/11/2013 04:13 AM, Sven wrote: Yes, I had the idea to add bluetooth too, removes the whole plugging and unplugging spiel. I might start work on that, and if anyone else wants to dive in and help, feel free. I will probably need to refactor the Listener a little, or create a USB and BT

My string module doesn't have maketrans or translate functions

2013-04-11 Thread Lamb
Hi all, I'm really new to python and trying to figure out the basic rule and settings of it. I'm using python 3.3 and I was trying this code in python: import string s = string. With. Punctuation? out = s.translate(string.maketrans(,), string.punctuation) And I got the following error:

Re: Problems with sockets and threads

2013-04-11 Thread Dexter Deejay
Thanks! :D -- http://mail.python.org/mailman/listinfo/python-list

Re: My string module doesn't have maketrans or translate functions

2013-04-11 Thread Chris Angelico
On Fri, Apr 12, 2013 at 1:30 AM, Lamb lamban...@gmail.com wrote: import string s = string. With. Punctuation? out = s.translate(string.maketrans(,), string.punctuation) Try this instead: import string s = string. With. Punctuation? out = s.translate(str.maketrans(, , string.punctuation)) Due

Re: My string module doesn't have maketrans or translate functions

2013-04-11 Thread Lamb
Thanks! It worked! But why didn't I see functions : translate(), maketrans(), rstrip(), etc. listed when I called print(dir(string))? On Thursday, April 11, 2013 11:45:05 AM UTC-4, Chris Angelico wrote: import string s = string. With. Punctuation? out =

Re: My string module doesn't have maketrans or translate functions

2013-04-11 Thread Chris Angelico
On Fri, Apr 12, 2013 at 2:05 AM, Lamb lamban...@gmail.com wrote: Thanks! It worked! But why didn't I see functions : translate(), maketrans(), rstrip(), etc. listed when I called print(dir(string))? Because they're not in the string module any more - they're methods on str (and bytes). Try

Frances President Hollande Eradicate tax havens

2013-04-11 Thread 23alagmy
Frances President Hollande Eradicate tax havens http://natigtas7ab.blogspot.com/2013/04/frances-president-hollande-eradicate.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode issue with Python v3.3

2013-04-11 Thread Nikos
Τη Πέμπτη, 11 Απριλίου 2013 1:45:22 μ.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε: On 10Apr2013 21:50, nagia.rets...@gmail.com nagia.rets...@gmail.com wrote: | Firtly thank uou for taking a look into the code. | the doctype is coming form the attempt of script metrites.py to open and read

Re: My string module doesn't have maketrans or translate functions

2013-04-11 Thread Mark Lawrence
On 11/04/2013 16:30, Lamb wrote: Hi all, I'm really new to python and trying to figure out the basic rule and settings of it. I'm using python 3.3 and I was trying this code in python: import string s = string. With. Punctuation? out = s.translate(string.maketrans(,), string.punctuation)

Re: Python pdb bug, followed by bug in bugs.python.org

2013-04-11 Thread Ian Kelly
On Thu, Apr 11, 2013 at 8:56 AM, donaldcal...@gmail.com wrote: #! /usr/bin/env python3 import pdb def foo(message): print(message) pdb.set_trace() foo('first call') foo('second call') Stick this in an file with execute permission and run it. At the first breakpoint, the

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-11 Thread Cousin Stanley
someone wrote: I want to put this table into an appropriate container such that afterwards I want to: 1) Put the data into a mySql-table You might consider using sqlite3 as a database manager since it is batteries included with python The stand-alone sqlite

shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Rob Schneider
Using Python 2.7.2 on OSX, I have created a file in temp space, then use the function shutil.copyfile(fn,loc+fname) from fn to loc+fname. At the destination location, the file is truncated. About 10% of the file is lost. Original file is unchanged. I added calls to statinfo immediately after

splinter web browser simulator causing constant BSODs

2013-04-11 Thread matt . topolinski
Hello, I'm trying to torubleshoot this issue for a user I support. He is running the splinter web browser simulator trough Google Chrome, and it appears to be causing his workstation to constantly BSOD. His machine has the following hardware: Dual Xeon E5-2637 Processors NVIDIA Quadro 600 -

Re: Python pdb bug, followed by bug in bugs.python.org

2013-04-11 Thread Robert Kern
On 2013-04-11 23:11, Ian Kelly wrote: On Thu, Apr 11, 2013 at 8:56 AM, donaldcal...@gmail.com wrote: #! /usr/bin/env python3 import pdb def foo(message): print(message) pdb.set_trace() foo('first call') foo('second call') Stick this in an file with execute permission and run

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-11 Thread Cousin Stanley
Cousin Stanley wrote: The stand-alone sqlite interpreter can first be used to create an empty database named some.sql3 and create a table named xdata in that data base sqlite3 some.sql3 '.read xdata_create.sql' This step can also be done in python without using the

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Neil Cerutti
On 2013-04-11, Rob Schneider rmsc...@gmail.com wrote: Using Python 2.7.2 on OSX, I have created a file in temp space, then use the function shutil.copyfile(fn,loc+fname) from fn to loc+fname. At the destination location, the file is truncated. About 10% of the file is lost. Original file is

Re: Python pdb bug, followed by bug in bugs.python.org

2013-04-11 Thread Ian Kelly
On Thu, Apr 11, 2013 at 12:42 PM, Robert Kern robert.k...@gmail.com wrote: Use `where` to see the problem: Ah. Then I can verify that the problem occurs in Windows as well: C:\Users\ikelly\Desktopc:\python33\python python_bug.py first call --Return--

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Rob Schneider
Thanks. Yes, there is a close function call before the copy is launched. No other writes. Does Python wait for file close command to complete before proceeding? -- http://mail.python.org/mailman/listinfo/python-list

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-11 Thread someone
On 04/11/2013 07:58 PM, Cousin Stanley wrote: someone wrote: You can be creative with the data selections and pass them off to be plotted as needed If mysql is used instead of sqlite3 you should only have to monkey with the data type declarations in xdata_create.sql and

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Neil Cerutti
On 2013-04-11, Rob Schneider rmsc...@gmail.com wrote: Thanks. Yes, there is a close function call before the copy is launched. No other writes. Does Python wait for file close command to complete before proceeding? The close method is defined and flushing and closing a file, so it should not

Re: Can I iterate over a dictionary outside a function ?

2013-04-11 Thread Alexander Blinne
Am 11.04.2013 11:48, schrieb inshu chauhan: I have a prog in which a functions returns a dict but when I try to iterate over the dict using iterkeys, It shows an error. 1) Show us your code in form of a minimal working example, working means that it should show us what you expect it to do but

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Steven D'Aprano
On Thu, 11 Apr 2013 19:55:53 +, Neil Cerutti wrote: On 2013-04-11, Rob Schneider rmsc...@gmail.com wrote: Thanks. Yes, there is a close function call before the copy is launched. No other writes. Does Python wait for file close command to complete before proceeding? The close method

Re: My string module doesn't have maketrans or translate functions

2013-04-11 Thread Steven D'Aprano
On Thu, 11 Apr 2013 17:56:51 +0100, Mark Lawrence wrote: The string module is effectively dead. It's not dead, it's pining for the fjords. But seriously, the string module holds a collection of useful string constants and the Template class. -- Steven --

OOPv2 -- Was: [Python-ideas] Reviving PEP 3140 - str(container) should call str(item), not repr(item)

2013-04-11 Thread Mark Janssen
On Sat, Apr 6, 2013 at 7:35 PM, Ned Batchelder n...@nedbatchelder.com wrote: Mark, so I can understand your mindset better, what do you mean by let's update the OOP paradigm? Do you mean, 1) let's change Python in the next release, or 2) let's see if we can imagine a different way of doing

Re: OOPv2 -- Was: [Python-ideas] Reviving PEP 3140 - str(container) should call str(item), not repr(item)

2013-04-11 Thread Mark Lawrence
On 12/04/2013 01:29, Mark Janssen wrote: You are right. It might not be realistic given the Python developer environment at present. In fact, I'm moving the thread out of python-ideas into python-list since Guido doesn't want to discuss it. Please don't. -- If you're using GoogleCrap™

Re: OOPv2 -- Was: [Python-ideas] Reviving PEP 3140 - str(container) should call str(item), not repr(item)

2013-04-11 Thread Mark Janssen
On Thu, Apr 11, 2013 at 5:34 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 12/04/2013 01:29, Mark Janssen wrote: You are right. It might not be realistic given the Python developer environment at present. In fact, I'm moving the thread out of python-ideas into python-list since

Re: OOPv2 -- Was: [Python-ideas] Reviving PEP 3140 - str(container) should call str(item), not repr(item)

2013-04-11 Thread Mark Lawrence
On 12/04/2013 01:54, Mark Janssen wrote: Sorry, not the whole repr() vs str() thread, just the inquiry about rethinking OOP Mark IMHO an adequate summary of your views in the last paragraph here http://mail.python.org/pipermail/python-ideas/2013-March/020034.html -- If you're using

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Cameron Simpson
On 12Apr2013 00:06, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: | On Thu, 11 Apr 2013 19:55:53 +, Neil Cerutti wrote: | On 2013-04-11, Rob Schneider rmsc...@gmail.com wrote: | Thanks. Yes, there is a close function call before the copy is | launched. No other writes. Does

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Ned Deily
In article 20130412011550.ga80...@cskk.homeip.net, Cameron Simpson c...@zip.com.au wrote: Or that the filesystem may be full? Of course, that's usually obvious more widely when it happens... Question: is the size of the incomplete file a round number? (Like a multiple of a decent sized

Re: Message passing syntax for objects | OOPv2

2013-04-11 Thread Mark Janssen
Okay peeps, I'm re-opening this thread, because despite being hijacked by naysayers, the merit of the underlying idea I think still has not been communicated or perceived adequately. As a personal request from the BDFL, which I begrudge him for, I've removed the thread from python-ideas. If you

Re: OOPv2 -- Was: [Python-ideas] Reviving PEP 3140 - str(container) should call str(item), not repr(item)

2013-04-11 Thread Mark Janssen
But there is no single OOP paradigm. Java vs Python vs Ruby vs Javascript, they're all subtly different. Subtly is the keyword there. Predominately, they are the same -- they try to make a pure OOP object model in an imagined abstract space. Wikipedia suggests that there are four main

Re: Message passing syntax for objects | OOPv2

2013-04-11 Thread Ethan Furman
On 04/11/2013 06:57 PM, Mark Janssen wrote: [blah blah not python blah blah] Mark, this list if for Python, about Python, helping with Python. If you want to discuss whatever this idea is, you should do it somewhere else, as it is *not* Python. -- ~Ethan~ --

Re: People in the python community [was Re: Unicode issue with Python v3.3]

2013-04-11 Thread Michael Torrie
On 04/10/2013 10:50 AM, Νίκος Γκρ33κ wrote: I'am not sure i follow you. How did my topic changed?! Is this possible? This is a mailing list/nntp newsgroup. The subject line can be changed arbitrarily by anyone replying to another message. Normally this is done to indicate a natural

Re: Functional vs. Object oriented API

2013-04-11 Thread Steven D'Aprano
On Thu, 11 Apr 2013 00:16:19 +0100, Max Bucknell wrote: For example, I have a vector class, that works like so: a = Vector([2, 7, 4]) b = Vector.j # unit vector in 3D y direction I also have a function to generate the dot product of these two vectors. In Java, such a function

Re: Unicode issue with Python v3.3

2013-04-11 Thread nagia . retsina
Well, can somebody else propose somehting plz? i have paste the whole script and even the necessary snippet that perhaps causing this encoding confusion in 3.3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode issue with Python v3.3

2013-04-11 Thread alex23
On Apr 12, 2:36 pm, nagia.rets...@gmail.com wrote: Well, can somebody else propose somehting plz? Pay for a professional. -- http://mail.python.org/mailman/listinfo/python-list

Re: Message passing syntax for objects | OOPv2

2013-04-11 Thread alex23
On Apr 12, 11:57 am, Mark Janssen dreamingforw...@gmail.com wrote: hijacked by naysayers Says the man who wrote: - I blame the feminists for being too loyal to atheism and G-d for being too loyal to the Jews. Torture happened. - The world is insane because people loved snakes more than G-d,

[issue17585] IDLE - regression with exit() and quit()

2013-04-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes, fixing site.py is fine. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17585 ___ ___ Python-bugs-list

[issue17696] lookup fails for renamed functions

2013-04-11 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt: When you rename a test function, you can't explicitly specify it on the commandline any more. During normal test runs, it is automatically discovered though. The error is that the old name was not found, even though the new name was specified. The attached

[issue1208304] urllib2's urlopen() method causes a memory leak

2013-04-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: The entire description of this issue is bogus. Reference cycles are not a bug, since Python has a cyclic garbage collector. Closing as invalid. -- nosy: +pitrou resolution: - invalid status: open - closed ___

[issue16273] f.tell() returning negative number on Windows build

2013-04-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Giacomo, which behaviour are you talking about? FWIW, there is no such tell() issue in Python 3 and it doesn't use ftell(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16273

[issue1208304] urllib2's urlopen() method causes a memory leak

2013-04-11 Thread Ralf Schmitt
Ralf Schmitt added the comment: I'd consider reference cycles a bug especially if they prevent filedescriptors from being closed. please read the comments. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1208304

[issue17620] Python interactive console doesn't use sys.stdin for input

2013-04-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: • interactive console doesn't use sys.stdin for input, why? Modules/main.c calls PyRun_AnyFileFlags(stdin, stdin, ...). At this point, sys.stdin *is* the same as C stdin by construction, so I'm not sure how you came to encounter the issue. However, it's

[issue17430] missed peephole optimization

2013-04-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: The migration to an AST optimizer is a bit of a pie-in-the-sky project. Functionally, it doesn't have many benefits since the scope of legal static optimizations in Python is very narrow (due to the dynamic nature of the language). Therefore, the main benefit

  1   2   >