Where does MySQLdb put inserted data?

2013-10-04 Thread F.R.
Hi, As of late clipboard pasting into a terminal sometimes fails (a known bug, apparently), I use MySQLdb to access MySQL tables. In general this works just fine. But now I fail filling a new table. The table exists. "mysql>EXPLAIN new_table;" explains and "root@blackbox-one:/# sudo/find /

Re: Multiple scripts versus single multi-threaded script

2013-10-04 Thread Jeremy Sanders
Roy Smith wrote: > Threads are lighter-weight. That means it's faster to start a new > thread (compared to starting a new process), and a thread consumes fewer > system resources than a process. If you have lots of short-lived tasks > to run, this can be significant. If each task will run for a

Re: wil anyone ressurect medusa and pypersist?

2013-10-04 Thread jkn
On Thursday, 3 October 2013 21:48:35 UTC+1, c-gsc...@neogov.net wrote: > On Thursday, May 16, 2013 11:15:45 AM UTC-7, vispha...@gmail.com wrote: > > > www.prevayler.org in python = pypersist > > > > > > > > > > > > medusa = python epoll web server and ftp server eventy and async > > > >

Re: Where does MySQLdb put inserted data?

2013-10-04 Thread Steven D'Aprano
On Fri, 04 Oct 2013 09:38:41 +0200, F.R. wrote: > Hi, > As of late clipboard pasting into a terminal sometimes fails (a > known bug, apparently), I use MySQLdb to access MySQL tables. [...] You appear to have posted to the wrong list. This is a Python list, not MySQL. Nothing in your quest

Re: Tail recursion to while iteration in 2 easy steps

2013-10-04 Thread 88888 Dihedral
On Thursday, October 3, 2013 5:33:27 AM UTC+8, Terry Reedy wrote: > On 10/2/2013 8:31 AM, random...@fastmail.us wrote: > > > On Tue, Oct 1, 2013, at 17:30, Terry Reedy wrote: > > >> Part of the reason that Python does not do tail call optimization is > > >> that turning tail recursion into while

howto check programs and C libraries

2013-10-04 Thread David Palao
Hello, I'm in charge of preparing a computer room for the practices of "introduction to programming". One of the tasks is checking that from all the computers in the room one can execute some programs and link (and compile) against some libraries. My first idea was using Autotools (or cmake), but a

Re: ipy %run noob confusion

2013-10-04 Thread Oscar Benjamin
On 3 October 2013 18:42, wrote: > I have some rather complex code that works perfectly well if I paste it in by > hand to ipython, but if I use %run it can't find some of the libraries, but > others it can. The confusion seems to have to do with mathplotlib. I get it > in stream by: > >%py

Re: howto check programs and C libraries

2013-10-04 Thread Oscar Benjamin
On 4 October 2013 10:30, David Palao wrote: > Hello, > I'm in charge of preparing a computer room for the practices of > "introduction to programming". > One of the tasks is checking that from all the computers in the room > one can execute some programs and link (and compile) against some > libra

Re: hg.python.org: Server unresponsive and timeout

2013-10-04 Thread Oscar Benjamin
On 2 October 2013 23:25, Terry Reedy wrote: > On 10/2/2013 5:36 AM, Tae Wong wrote: >> >> This post is irrelevant from using Python; so it's an Internet server >> problem. >> >> When you try to connect to hg.python.org, the connection takes forever. > > > I believe hg.python.org is on a different

Re: Where does MySQLdb put inserted data?

2013-10-04 Thread F.R.
On 10/04/2013 09:38 AM, F.R. wrote: Hi, As of late clipboard pasting into a terminal sometimes fails (a known bug, apparently), I use MySQLdb to access MySQL tables. In general this works just fine. But now I fail filling a new table. The table exists. "mysql>EXPLAIN new_table;" explains a

Re: Tail recursion to while iteration in 2 easy steps

2013-10-04 Thread Alain Ketterlin
Mark Janssen writes: > def fact(n): return 1 if n <= 1 else n * fact(n-1) >> class Strange: >> ... >> def __le__(dummy): >> global fact >> fact = someotherfun # this is "binding" >> return false >> You cannot prevent this in python. > No, but you can't prevent a lot of bad

Re: Where does MySQLdb put inserted data?

2013-10-04 Thread Chris Angelico
On Fri, Oct 4, 2013 at 8:05 PM, F.R. wrote: > Off list? MySQL is. MySQLdb is not. Before I know which of the two is > the culprit, I don't know whether I'm off list or not and take the risk, > prepared to beg pardon if I am. > Just to clarify: Off-topic means discussing stuff that isn't abou

Re: Tail recursion to while iteration in 2 easy steps

2013-10-04 Thread Duncan Booth
Neil Cerutti wrote: > On 2013-10-03, Duncan Booth wrote: >> It isn't hard to imagine adding a TAIL_CALL opcode to the >> interpreter that checks whether the function to be called is >> the same as the current function and if it is just updates the >> arguments and jumps to the start of the code b

Re: Tail recursion to while iteration in 2 easy steps

2013-10-04 Thread Ian Kelly
On Fri, Oct 4, 2013 at 4:16 AM, Duncan Booth wrote: > Neil Cerutti wrote: >> On 2013-10-03, Duncan Booth wrote: >>> It isn't hard to imagine adding a TAIL_CALL opcode to the >>> interpreter that checks whether the function to be called is >>> the same as the current function and if it is just up

Re: Where does MySQLdb put inserted data?

2013-10-04 Thread F.R.
On 10/04/2013 12:11 PM, Chris Angelico wrote: On Fri, Oct 4, 2013 at 8:05 PM, F.R. wrote: Off list? MySQL is. MySQLdb is not. Before I know which of the two is the culprit, I don't know whether I'm off list or not and take the risk, prepared to beg pardon if I am. Just to clarify: Off-t

Re: Tail recursion to while iteration in 2 easy steps

2013-10-04 Thread Ian Kelly
On Fri, Oct 4, 2013 at 4:41 AM, Ian Kelly wrote: > There is no doubt that it's a tail call. Whether it is recursion is > irrelevant to optimizing it. The reason we talk about "tail call > recursion" specifically is because the recursive case is the one that > makes the optimization worthwhile, n

Image manipulation

2013-10-04 Thread markotaht
Is there a way using the python 3.3.2 whidout any additional downloaded moduls, to get a pixels RGB value? -- https://mail.python.org/mailman/listinfo/python-list

Re: Tail recursion to while iteration in 2 easy steps

2013-10-04 Thread rusi
On Thursday, October 3, 2013 10:57:48 PM UTC+5:30, Ravi Sahni wrote: > On Wed, Oct 2, 2013 at 10:46 AM, rusi wrote: > > 4. There is a whole spectrum of such optimizaitons -- > > 4a eg a single-call structural recursion example, does not need to push > > return address on the stack. It only needs t

Re: Tail recursion to while iteration in 2 easy steps

2013-10-04 Thread Steven D'Aprano
On Fri, 04 Oct 2013 11:49:26 +0200, Alain Ketterlin wrote: > I think allowing rebinding of function names is extremely strange, It's not, it's quite common. Functions in Python are first-class values, and we can do things like this: from somelibrary import somethingwithalonglongname as shortnam

Re: Tail recursion to while iteration in 2 easy steps

2013-10-04 Thread Jussi Piitulainen
Duncan Booth writes: > Neil Cerutti wrote: > > On 2013-10-03, Duncan Booth wrote: > >> It isn't hard to imagine adding a TAIL_CALL opcode to the > >> interpreter that checks whether the function to be called is > >> the same as the current function and if it is just updates the > >> arguments and

Re: howto check programs and C libraries

2013-10-04 Thread Dave Angel
On 4/10/2013 05:30, David Palao wrote: > Hello, > I'm in charge of preparing a computer room for the practices of > "introduction to programming". > One of the tasks is checking that from all the computers in the room > one can execute some programs and link (and compile) against some > libraries.

Re: Tail recursion to while iteration in 2 easy steps

2013-10-04 Thread Duncan Booth
Ian Kelly wrote: > On Fri, Oct 4, 2013 at 4:41 AM, Ian Kelly wrote: >> There is no doubt that it's a tail call. Whether it is recursion is >> irrelevant to optimizing it. The reason we talk about "tail call >> recursion" specifically is because the recursive case is the one that >> makes the o

Re: howto check programs and C libraries

2013-10-04 Thread Ravi Sahni
On Fri, Oct 4, 2013 at 3:00 PM, David Palao wrote: > Hello, > I'm in charge of preparing a computer room for the practices of > "introduction to programming". > One of the tasks is checking that from all the computers in the room > one can execute some programs and link (and compile) against some

Re: JUST GOT HACKED

2013-10-04 Thread Wayne Werner
On Tuesday, October 1, 2013 5:06:38 PM UTC-5, Ben Finney wrote: > This is an unmoderated forum, so we have occasional spates of persistent > > nuisances, and those who respond with the maturity level and impulse > > control of an average six-year-old. Hey! That's so degrading! I don't know many

Re: JUST GOT HACKED

2013-10-04 Thread Antoon Pardon
Op 03-10-13 13:30, Steven D'Aprano schreef: > On Thu, 03 Oct 2013 09:01:29 +0200, Antoon Pardon wrote: > >> You don't >> follow the principle of treating others in the way you hope to be >> treated if you were in their shoes. > [...] >> Suppose you develop a new >> interest in which you are now

Re: JUST GOT HACKED

2013-10-04 Thread Wayne Werner
On Wednesday, October 2, 2013 5:43:32 AM UTC-5, Ferrous Cranus wrote: > > I only re-ask the same thing if: > > > 1. Di not understood what was provided or proposed to me as being a solution > > 2. Still feel that that the solution provided to me doesn't meet my > needs and should have been re

API for custom Unicode error handlers

2013-10-04 Thread Steven D'Aprano
I have some custom Unicode error handlers, and I'm looking for advice on the right API for dealing with them. I have a module containing custom Unicode error handlers. For example: # Python 3 import unicodedata def namereplace_errors(exc): c = exc.object[exc.start] try: name = un

Re: ipy %run noob confusion

2013-10-04 Thread Jeff Shrager
Thank you. This is extremely helpful. The key that I was missing is that it's running them outside of the ipy context. I also discovered that if you call the script .ipy instead of .py, it actually does more or less what I was expecting -- that is, it allows magic commands, and I got the thing work

Re: Image manipulation

2013-10-04 Thread Gary Herron
On 10/04/2013 03:52 AM, markot...@gmail.com wrote: Is there a way using the python 3.3.2 whidout any additional downloaded moduls, to get a pixels RGB value? No (I guess). If you want a better answer, then you'll have to give us a *much* better question. Get a pixel from *what*? (screen?

Re: Multiple scripts versus single multi-threaded script

2013-10-04 Thread Grant Edwards
On 2013-10-03, Roy Smith wrote: > Threads are lighter-weight. That means it's faster to start a new > thread (compared to starting a new process), and a thread consumes > fewer system resources than a process. That's true, but the extent to which it's true varies considerably from one OS to an

Re: compare two list of dictionaries

2013-10-04 Thread MRAB
On 04/10/2013 03:29, Mohan L wrote: [snip] output1=[ {'count': 3 , 'ip': 'xxx.xx.xxx.1'}, {'count': 4, 'ip': 'xxx.xx.xxx.2'}, {'count': 8, 'ip': 'xxx.xx.xxx.3'}, {'count': 10, 'ip': 'xxx.xx.xxx.4'}, {'count': 212, 'ip': 'hostname1'}, {'count': 27, 'ip': 'hostname2'}, {'count': 513, 'ip': 'hostna

Re: Why didn't my threads exit correctly ?

2013-10-04 Thread 李洛
Thanks for your reply, MRAB. I've seen that the child thread has been stoped, it just died in the queue.If I want the queue be empty, I must use queue.get() to dequeue and clean it, but I didn't do that. I've implement the thread using List now, thanks again. On Fri, Oct 4, 2013 at 2:25 AM, MRAB

Re: API for custom Unicode error handlers

2013-10-04 Thread Chris Angelico
On Fri, Oct 4, 2013 at 11:56 PM, Steven D'Aprano wrote: > Should the module holding the error handlers automatically register them? > In other words, if I do: > > import error_handlers > > just importing it will have the side-effect of registering the error > handlers. Normally, I dislike imports

Re: API for custom Unicode error handlers

2013-10-04 Thread Ethan Furman
On 10/04/2013 06:56 AM, Steven D'Aprano wrote: Should the module holding the error handlers automatically register them? I think it should. Registration only needs to happen once, the module is useless without being registered, no threads nor processes are being started, and the only reason

Re: API for custom Unicode error handlers

2013-10-04 Thread Serhiy Storchaka
04.10.13 20:22, Chris Angelico написав(ла): I'd be quite happy with importing having a side-effect here. If you import a module that implements a numeric type, it should immediately register itself with the Numeric ABC, right? This is IMO equivalent to that. There is a difference. You can't use

Help wanted: Writing a PMI Project Management system

2013-10-04 Thread john . r . moser
I'm looking for anyone who has an interest in project management; workable Python design and programming skills; and wants to code for an open source Project Management system. Having used Redmine, Launchpad, Trak, OpenProj, and so on, I've found there's no good PM tools. Microsoft Project and

Re: compare two list of dictionaries

2013-10-04 Thread Tobiah
On 10/03/2013 09:11 AM, Mohan L wrote: Dear All, I have two list of dictionaries like below: In the below dictionaries the value of ip can be either hostname or ip address. output1=[ {'count': 3 , 'ip': 'xxx.xx.xxx.1'}, {'count': 4, 'ip': 'xxx.xx.xxx.2'}, {'count': 8, 'ip': 'xxx.xx.xxx.3'}, {'

Re: API for custom Unicode error handlers

2013-10-04 Thread Serhiy Storchaka
04.10.13 16:56, Steven D'Aprano написав(ла): I have some custom Unicode error handlers, and I'm looking for advice on the right API for dealing with them. I have a module containing custom Unicode error handlers. For example: # Python 3 import unicodedata def namereplace_errors(exc): c = e

Re: Tail recursion to while iteration in 2 easy steps

2013-10-04 Thread Terry Reedy
On 10/4/2013 6:46 AM, Ian Kelly wrote: On the other hand, if you start optimizing every tail call and not just the recursive functions, then I can see where that could start to get problematic for debugging -- as arbitrary functions get removed from the stack traces just because they happened to

Re: JUST GOT HACKED

2013-10-04 Thread Piet van Oostrum
Ravi Sahni writes: > I find this real confused!! Why they are answering then?!?! > As far as I can make out everyone who is answering (helping!) doing it > frustratation and disgust. But still they keep answering and > answering!! I answered him because I wanted to help him. I also find it inte

Re: Tail recursion to while iteration in 2 easy steps

2013-10-04 Thread Terry Reedy
On 10/4/2013 5:49 AM, Alain Ketterlin wrote: I think allowing rebinding of function names is extremely strange, Steven already countered the 'is extremely strange' part by showing that such rebinding is common, generally useful, and only occasionally dodgy and a candidate for being blocked.

Re: API for custom Unicode error handlers

2013-10-04 Thread Terry Reedy
On 10/4/2013 3:35 PM, Serhiy Storchaka wrote: 04.10.13 16:56, Steven D'Aprano написав(ла): I have some custom Unicode error handlers, and I'm looking for advice on the right API for dealing with them. I'm planning to built this error handler in 3.4 (see http://comments.gmane.org/gmane.comp.py

Re: Hyper-spacial ray-tracer

2013-10-04 Thread Rouslan Korneychuk
On 10/04/2013 04:23 PM, Tony the Tiger wrote: On Wed, 02 Oct 2013 17:05:32 -0400, Rouslan Korneychuk wrote: game Sorry, but that sounds awful. I hate games. This... isn't a game or even related to gaming. Is it because of the use of Pygame that you thought it was. I use Pygame because it'

Re: Hyper-spacial ray-tracer

2013-10-04 Thread Chris Angelico
On Sat, Oct 5, 2013 at 10:17 AM, Rouslan Korneychuk wrote: > The point of this was to explore the concept of hyperspace, which is a > mathematical curiosity and also has relevance in theoretical physics. I don't have any actual use-case for what you've done, but it sure sounds cool! Having worked

Re: Hyper-spacial ray-tracer

2013-10-04 Thread Rouslan Korneychuk
On 10/04/2013 09:41 PM, Chris Angelico wrote: On Sat, Oct 5, 2013 at 10:17 AM, Rouslan Korneychuk wrote: The point of this was to explore the concept of hyperspace, which is a mathematical curiosity and also has relevance in theoretical physics. I don't have any actual use-case for what you'v

Re: Hyper-spacial ray-tracer

2013-10-04 Thread 88888 Dihedral
On Saturday, October 5, 2013 8:17:52 AM UTC+8, Rouslan Korneychuk wrote: > On 10/04/2013 04:23 PM, Tony the Tiger wrote: > > > On Wed, 02 Oct 2013 17:05:32 -0400, Rouslan Korneychuk wrote: > > > > > >> game > > > > > > Sorry, but that sounds awful. I hate games. > > > > > > > This... isn't