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 Pytho

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, 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. Write me out what you wou

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 n

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 mail??

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 tha

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 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 proof of concept: class MyTyp

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 optimal

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

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 wrote: > I've been working on a little proje

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 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 clear, and

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 dicti

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 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 really know what os.urandom is. H

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

2013-04-11 Thread Oscar Benjamin
On 11 April 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

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. -- nick

Re: Unicode issue with Python v3.3

2013-04-11 Thread Cameron Simpson
On 10Apr2013 21:50, 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 an tetxt file. I think

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 = '''

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 > 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: > > R

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 cla

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 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, y

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 ca

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 wrote: > On Thu, 11 Apr 2013 10:47:43 +0100, Oscar Benjamin wrote: > >> On 11 April 2013 08:47, Steven D'Aprano >> 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 cryptogr

Fwd: use a loop to create lists

2013-04-11 Thread Franz Kelnreiter
-- Forwarded message -- From: Franz Kelnreiter 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 11/04/2013 13:25, Franz K

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 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 cannot be itera

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 server

Re: guessthenumber print games left

2013-04-11 Thread Neil Cerutti
On 2013-04-11, 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 contraint is still true. Here'

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

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 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 simplified too: f = {'list_'

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 wrote: On Thu, 11 Apr 2013 10:47:43 +0100, Oscar Benjamin wrote: On 11 April 2013 08:47, Steven D'Aprano wrote: One thing to be aware of: urandom may run out of entropy, and then it will slow down a lot. If

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 matplotlib.p

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 d

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 wrote: > On 11 April 2013 11:50, Steven D'Aprano > wrote: >> Some (most?) modern operating systems provide a cryptographically strong >> source of non-deterministic randomness. The non-deterministic part comes >> from external "stuff", which is cal

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 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 actually mean something

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 expressio

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 =

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

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 on

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.

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 , > > 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. I am getting > > > incorrect stack traces

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 list

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: T

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 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 to t

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 = s.translate(string.m

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 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 checking out dir(str)

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 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'

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, 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 backtrace wi

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

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 - co

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, 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 brea

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 th

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Neil Cerutti
On 2013-04-11, Rob Schneider 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 uncha

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 wrote: > Use `where` to see the problem: Ah. Then I can verify that the problem occurs in Windows as well: C:\Users\ikelly\Desktop>c:\python33\python python_bug.py first call --Return-- > c:\users\ikelly\desktop\python_bug.py(7)foo()->None -> pdb.se

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 th

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Neil Cerutti
On 2013-04-11, Rob Schneider 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 return until th

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

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 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

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 -- http://mail.python.org/mailman/li

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 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 > things, even tho

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™ ple

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 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 Guido doesn't wan

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 Go

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Cameron Simpson
On 12Apr2013 00:06, Steven D'Aprano wrote: | On Thu, 11 Apr 2013 19:55:53 +, Neil Cerutti wrote: | > On 2013-04-11, Rob Schneider 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 | >> comple

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Ned Deily
In article <20130412011550.ga80...@cskk.homeip.net>, Cameron Simpson 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 power of 2>)

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 w

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 ma

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~ -- http://mail.python.org/mailman/list

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 progressi

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

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 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, and believed in homose

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Rob Schneider
> The close method is defined and flushing and closing a file, so > > it should not return until that's done. > > > > What command are you using to create the temp file? > > re command to write the file: f=open(fn,'w') ... then create HTML text in a string f.write(html) f.close -- http:/

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Rob Schneider
> I would consider the chance that the disk may be faulty, or the file > > system is corrupt. Does the problem go away if you write to a different > > file system or a different disk? > It's a relatively new MacBook Pro with a solid state disk. I've not noticed any other disk problems. I di

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Rob Schneider
> > > 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 power of 2>) > > > > Also on what OS X file system type does t

Re: shutil.copyfile is incomplete (truncated)

2013-04-11 Thread Rob Schneider
> The file system is Mac OS Extended Journaled (default as out of the box). I ran a repair disk .. .while it found and fixed what it called "minor" problems, it did something. However, the repair did not fix the problem. I just ran the program again and the source is 47,970 bytes and target af