Re: print range in python3.3

2014-01-04 Thread Chris Angelico
On Sun, Jan 5, 2014 at 6:38 PM, luofeiyu wrote: range(1,10) > range(1, 10) print(range(1,10)) > range(1, 10) > > how can i get 1,2,3,4,5,6,7,8,9 in python3.3 ? Are you looking for a list? That's what Python 2 returned. In Python 3, you can get that like this: >>> list(range(1,10)) [1,

print range in python3.3

2014-01-04 Thread luofeiyu
>>> range(1,10) range(1, 10) >>> print(range(1,10)) range(1, 10) how can i get 1,2,3,4,5,6,7,8,9 in python3.3 ? -- https://mail.python.org/mailman/listinfo/python-list

Re: Blog "about python 3"

2014-01-04 Thread Chris Angelico
On Sun, Jan 5, 2014 at 2:20 PM, Roy Smith wrote: > I've got a new sorting algorithm which is guaranteed to cut 10 seconds > off the sorting time (i.e. $0.10 per package). The problem is, it makes > a mistake 1% of the time. That's a valid line of argument in big business, these days, because we'

Re: Blog "about python 3"

2014-01-04 Thread Steven D'Aprano
Roy Smith wrote: > I wrote: >> > I realize I'm taking this statement out of context, but yes, sometimes >> > fast is more important than correct. > > In article <52c8c301$0$29998$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: >> Fast is never more important than correct. > > Sur

Re: Blog "about python 3"

2014-01-04 Thread Roy Smith
In article , Rustom Mody wrote: > On Sun, Jan 5, 2014 at 8:50 AM, Roy Smith wrote: > > I wrote: > >> > I realize I'm taking this statement out of context, but yes, sometimes > >> > fast is more important than correct. > > > > In article <52c8c301$0$29998$c3e8da3$54964...@news.astraweb.com>, > >

Re: Blog "about python 3"

2014-01-04 Thread Rustom Mody
On Sun, Jan 5, 2014 at 8:50 AM, Roy Smith wrote: > I wrote: >> > I realize I'm taking this statement out of context, but yes, sometimes >> > fast is more important than correct. > > In article <52c8c301$0$29998$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: >> Fast is never more i

Using multiple ORMs? - And SQLalchemy vs Pony vs Peewee vs stdnet vs …

2014-01-04 Thread Alec Taylor
Investigating possible using multiple ORMs in my project. Toy project, want to make it as generic as humanly possible; whilst still exposing abstract pythonic interfaces. E.g.: support most number of backends, including SQL ones like: Postgres, SQLite, MySQL, … and NoSQL ones such as Redis (using

Re: Suggest an open-source log analyser?

2014-01-04 Thread Alec Taylor
Because I'm thinking that something with a much less expressive query interface would serve me better in the long run... e.g.: Redis or maybe Hadoop On Sat, Jan 4, 2014 at 5:35 PM, Walter Hurry wrote: > On Thu, 02 Jan 2014 16:40:19 +1100, Alec Taylor wrote: > >> I use the Python logger class; wit

Re: Blog "about python 3"

2014-01-04 Thread Roy Smith
I wrote: > > I realize I'm taking this statement out of context, but yes, sometimes > > fast is more important than correct. In article <52c8c301$0$29998$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Fast is never more important than correct. Sure it is. Let's imagine you're b

Re: Blog "about python 3"

2014-01-04 Thread Chris Angelico
On Sun, Jan 5, 2014 at 1:41 PM, Steven D'Aprano wrote: > wxjmfa...@gmail.com wrote: > >> The very interesting aspect in the way you are holding >> unicodes (strings). By comparing Python 2 with Python 3.3, >> you are comparing utf-8 with the the internal "representation" >> of Python 3.3 (the flex

Re: Blog "about python 3"

2014-01-04 Thread Steven D'Aprano
wxjmfa...@gmail.com wrote: > The very interesting aspect in the way you are holding > unicodes (strings). By comparing Python 2 with Python 3.3, > you are comparing utf-8 with the the internal "representation" > of Python 3.3 (the flexible string represenation). This is incorrect. Python 2 has ne

Re: Blog "about python 3"

2014-01-04 Thread MRAB
On 2014-01-05 02:32, Chris Angelico wrote: On Sun, Jan 5, 2014 at 1:27 PM, Steven D'Aprano wrote: But regardless of how fast your path-finder algorithm might become, you're unlikely to be satisfied with a solution that travels around in a circle from A to B a million times then shoots off strai

Re: Blog "about python 3"

2014-01-04 Thread Chris Angelico
On Sun, Jan 5, 2014 at 1:27 PM, Steven D'Aprano wrote: > But regardless of how fast your path-finder algorithm might become, you're > unlikely to be satisfied with a solution that travels around in a circle > from A to B a million times then shoots off straight to Z without passing > through any o

Re: Blog "about python 3"

2014-01-04 Thread Steven D'Aprano
Roy Smith wrote: > In article , > Mark Lawrence wrote: > >> Surely everybody prefers fast but incorrect code in >> preference to something that is correct but slow? > > I realize I'm taking this statement out of context, but yes, sometimes > fast is more important than correct. I know somebod

Update image in same window with, say, PIL

2014-01-04 Thread John O'Hagan
I'm using something like the following to display an image and refresh it in the same window each time the image file is updated: import cv def display(filename): """Display scores as they are created""" cv.NamedWindow(filename) while 1: ... #wait for signal that filename has

Re: django question

2014-01-04 Thread Tim Chase
On 2014-01-04 15:30, Igor Korot wrote: > Does anybody here use django? Yes. However there's also a Django-users mailing list[1] for Django-specific questions. Folks there are friendly & helpful. > Is it possible to display a data grid table with django? The short answer is yes. > Basically I

Re: django question

2014-01-04 Thread Joel Goldstick
On Sat, Jan 4, 2014 at 6:30 PM, Igor Korot wrote: > Hi, ALL, > Does anybody here use django? > I have a very basic question about it. > > Is it possible to display a data grid table with django? > Yes, using the django template language. If you learn django (perhaps 2 days of exploring), you wo

django question

2014-01-04 Thread Igor Korot
Hi, ALL, Does anybody here use django? I have a very basic question about it. Is it possible to display a data grid table with django? Basically I am looking for displaying a data from the db table on the web interface thru django or some other web interface. My main application is in Python, that

Re: Blog "about python 3"

2014-01-04 Thread Chris Angelico
On Sun, Jan 5, 2014 at 9:46 AM, Terry Reedy wrote: > On 1/4/2014 2:10 PM, wxjmfa...@gmail.com wrote: >> >> Le samedi 4 janvier 2014 15:17:40 UTC+1, Chris Angelico a écrit : > > >>> any, and Python has only one, idiot like jmf who completely > > > Chris, I appreciate the many contributions you make

Re: [newbie] Recursive algorithm - review

2014-01-04 Thread Chris Angelico
On Sun, Jan 5, 2014 at 6:07 AM, Wiktor wrote: > On Sat, 4 Jan 2014 01:16:14 +0100, Wiktor wrote: > Idea is still the same. I start with 2d array > And then I fill it up one number by one (exception: first row). At every > step > checking if current column is unique (0's not counted) and if al

Re: Flip a graph

2014-01-04 Thread David Hutto
I would definitely utilize y axis as an altitudinal derivative of time,x. I'd go with more of a dart type of graphic, so you might be able to show a peak in altitude from take off, and the rotate the graphic in relation to the deceleration . But, you could also depict the velocity, fuel rate, etc

[ANN] gg_scrapper -- scrapping of the Google Groups

2014-01-04 Thread Matej Cepl
Did you try to archive email list hosted on the Google Groups? Were you endlessly frustrated by the black hole which is Google Groups, conscpicious by its absence on the Data Liberation Front website? Yes, I was too_ So, I have created a script webscrapping a google group and created gg_scra

Re: Blog "about python 3"

2014-01-04 Thread Terry Reedy
On 1/4/2014 2:10 PM, wxjmfa...@gmail.com wrote: Le samedi 4 janvier 2014 15:17:40 UTC+1, Chris Angelico a écrit : any, and Python has only one, idiot like jmf who completely Chris, I appreciate the many contributions you make to this list, but that does not exempt you from out standard of c

Re: Strange behaviour with a for loop.

2014-01-04 Thread Larry Hudson
On 01/03/2014 10:32 PM, Sean Murphy wrote: Hi everyone. [snip] The 2nd part of my original question still stands. I will expand upon this a bit more to give more context. I want to print from the beginning of the paragraph to the end. Each paragraph ends with "\n\n\n". If I use "\n\n\n" in l

Re: Flip a graph

2014-01-04 Thread Vincent Davis
When printing the rows of the array/canvas you might add \n to the end of each row and print the canvas all at once rather than a print statement for each row. Vincent Davis 720-301-3003 On Sat, Jan 4, 2014 at 3:10 PM, Vincent Davis wrote: > You might think about using an array to represent the

Re: Flip a graph

2014-01-04 Thread Vincent Davis
You might think about using an array to represent the canvas. Starting with it filled with "" and then for each point change it to "X". The print the rows of the array. You can make the array/canvas arbitrarily large and then plot multiple different paths onto the same array. Vincent Davis 720-3

Re: Flip a graph

2014-01-04 Thread Terry Reedy
PS to my previous response: please send plain text only, and not the html in addition. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Flip a graph

2014-01-04 Thread Terry Reedy
On 1/4/2014 11:15 AM, Jason Friedman wrote: I am teaching Python to a class of six-graders as part of an after-school enrichment. Great. I love seeing basic Python used for that sort of thing. These are average students. We wrote a non-GUI "rocket lander" program: you have a rocket some di

Re: Flip a graph

2014-01-04 Thread Wiktor
On Sat, 4 Jan 2014 09:15:39 -0700, Jason Friedman wrote: > My concern is whether the average 11-year-old will be able to follow such > logic. Is there a better approach? Basically mine approach is the same, but maybe is easier to explain it to kids. max_height = max(measurement_dict.values

Re: Strange behaviour with a for loop.

2014-01-04 Thread Larry Hudson
On 01/03/2014 08:03 PM, Sean Murphy wrote: Hello all. This is a newly question. But I wish to understand why the below code is providing different results. import os, sys if len(sys.argv) > 2: filenames = sys.argv[1:] else print ("no parameters provided\n") sys.edit() for filename

Flip a graph

2014-01-04 Thread Jason Friedman
I am teaching Python to a class of six-graders as part of an after-school enrichment. These are average students. We wrote a non-GUI "rocket lander" program: you have a rocket some distance above the ground, a limited amount of fuel and a limited burn rate, and the goal is to have the rocket tou

Re: [newbie] Recursive algorithm - review

2014-01-04 Thread Wiktor
On Sat, 4 Jan 2014 20:07:33 +0100, Wiktor wrote: > I guess that some kind of you have done this before. ;-) Damn it. This 'kind' shouldn't be there. Now it sounds silly, even offensive. ;-) Normally I would supersede it, but probably attached mailin

3.4 on Windows ImportError: cannot import name 'IntEnum'

2014-01-04 Thread Mark Lawrence
I first saw this when tring to run the command "py -3.4 -m ensurepip" which gave me this lot. Traceback (most recent call last): File "C:\Python34\lib\runpy.py", line 160, in _run_module_as_main "__main__", fname, loader, pkg_name) File "C:\Python34\lib\runpy.py", line 73, in _run_code

Re: Blog "about python 3"

2014-01-04 Thread wxjmfauth
Le samedi 4 janvier 2014 15:17:40 UTC+1, Chris Angelico a écrit : > On Sun, Jan 5, 2014 at 12:55 AM, Roy Smith wrote: > > > In article , > > > Mark Lawrence wrote: > > > > > >> Surely everybody prefers fast but incorrect code in > > >> preference to something that is correct but slow? > >

Re: [newbie] Recursive algorithm - review

2014-01-04 Thread Wiktor
On Sat, 4 Jan 2014 01:16:14 +0100, Wiktor wrote: > Hi, OK, another question. This time, I think, closer to the original subject (recursive algorithm). Thanks to Terry's and Chris' advises I refined script. Then I thought, that with some changes and with minimal effort I can force this script

Re: Blog "about python 3"

2014-01-04 Thread Ned Batchelder
On 1/4/14 9:17 AM, Chris Angelico wrote: On Sun, Jan 5, 2014 at 12:55 AM, Roy Smith wrote: In article , Mark Lawrence wrote: Surely everybody prefers fast but incorrect code in preference to something that is correct but slow? I realize I'm taking this statement out of context, but yes,

Re: How to make a tkinter GUI work on top of a CUI program?

2014-01-04 Thread Beinan Li
... and thanks to Chris too. Now I got the better idea how the subprocess module works. On Sat, Jan 4, 2014 at 11:29 AM, Beinan Li wrote: > Thank you so much Jerry. > I should have read though the man page more carefully. > The available online cscope tutorials never mentioned the line-oriented

Re: How to make a tkinter GUI work on top of a CUI program?

2014-01-04 Thread Beinan Li
Thank you so much Jerry. I should have read though the man page more carefully. The available online cscope tutorials never mentioned the line-oriented mode. On Sat, Jan 4, 2014 at 1:35 AM, Jerry Hill wrote: > On Fri, Jan 3, 2014 at 9:44 PM, Beinan Li wrote: > > But some console programs have

Re: Blog "about python 3"

2014-01-04 Thread Chris Angelico
On Sun, Jan 5, 2014 at 12:55 AM, Roy Smith wrote: > In article , > Mark Lawrence wrote: > >> Surely everybody prefers fast but incorrect code in >> preference to something that is correct but slow? > > I realize I'm taking this statement out of context, but yes, sometimes > fast is more importan

Re: Blog "about python 3"

2014-01-04 Thread Roy Smith
In article , Mark Lawrence wrote: > Surely everybody prefers fast but incorrect code in > preference to something that is correct but slow? I realize I'm taking this statement out of context, but yes, sometimes fast is more important than correct. Sometimes the other way around. -- https://

Re: Blog "about python 3"

2014-01-04 Thread wxjmfauth
Le vendredi 3 janvier 2014 12:14:41 UTC+1, Robin Becker a écrit : > On 02/01/2014 18:37, Terry Reedy wrote: > > > On 1/2/2014 12:36 PM, Robin Becker wrote: > > > > > >> I just spent a large amount of effort porting reportlab to a version > > >> which works with both python2.7 and python3.3. I h

Re: [newbie] Recursive algorithm - review

2014-01-04 Thread Wiktor
On Sat, 4 Jan 2014 22:18:09 +1100, Chris Angelico wrote: >> Thank you for all Your comments. > > My pleasure! Always happy to help out. I'm aware, that at my point of education there's no sense in optimizing code to squeeze from it every millisecond, but Project Euler gave me habit to compar

Re: [newbie] Recursive algorithm - review

2014-01-04 Thread Wiktor
On Sat, 4 Jan 2014 22:18:09 +1100, Chris Angelico wrote: >>> This is the same as you have at the top of 'if not towers'. Can you be >>> confident that row is None any time towers is None? If so, just move >>> this up above the other check and save the duplication. >> >> row is None at start, but

Re: [newbie] Recursive algorithm - review

2014-01-04 Thread Wiktor
On Fri, 03 Jan 2014 20:47:16 -0500, Terry Reedy wrote: > [0]*size] is fine for one row > > towers = [[0]*size] for i in range(size)] > > should do what you want for a 2-d array instead of the above. Right. Thank you also. -- Best regards, Wiktor Matuszewski 'py{}@wu{}em.pl'.format('wkm'

Re: On radio buttons in tkinter

2014-01-04 Thread Christian Gollwitzer
Am 04.01.14 11:17, schrieb eneskri...@gmail.com: So the issue is like this. I have to make a 2 x N grid like this: o Radio - 1 o Radio - 2 o Radio - 3 o Radio - 4 ... o Radio - N - 1 o Radio - N How to do so with a loop? Create the buttons and append them into a list, so you can later refer

Re: [newbie] Recursive algorithm - review

2014-01-04 Thread Chris Angelico
On Sat, Jan 4, 2014 at 10:09 PM, Wiktor wrote: > On Sat, 4 Jan 2014 13:02:37 +1100, Chris Angelico wrote: >> And in fact, you might want to turn this whole branch into something >> that harks to a more functional programming style: >> >> return all((check(towers, i) for i in range(len(towers))) >

Re: [newbie] Recursive algorithm - review

2014-01-04 Thread Wiktor
On Sat, 4 Jan 2014 13:02:37 +1100, Chris Angelico wrote: >> def check(towers, x=None): >> column = [] # value added on pos. x >> for i in range(len(towers)): >> column.append(towers[i][c]) >> column = [x for x in column if x != 0] >

Re: On radio buttons in tkinter

2014-01-04 Thread Chris Angelico
On Sat, Jan 4, 2014 at 9:17 PM, wrote: > So the issue is like this. I have to make a 2 x N grid like this: > o Radio - 1 o Radio - 2 > o Radio - 3 o Radio - 4 > ... > o Radio - N - 1 o Radio - N > > How to do so with a loop? How far have you managed to get so far? Do you have a Tkinter program t

On radio buttons in tkinter

2014-01-04 Thread eneskristo
So the issue is like this. I have to make a 2 x N grid like this: o Radio - 1 o Radio - 2 o Radio - 3 o Radio - 4 ... o Radio - N - 1 o Radio - N How to do so with a loop? -- https://mail.python.org/mailman/listinfo/python-list

Re: Strange behaviour with a for loop.

2014-01-04 Thread Chris Angelico
On Sat, Jan 4, 2014 at 8:52 PM, Sean Murphy wrote: > Thanks for the tip on the function. I was not aware of that function, Grin. > Creating the function as you mention makes a lot of sense. > > I am doing a lot of little bits and pieces focusing on things I need to > eventually build a script th

Re: Highest performance HTTP REST microframework?

2014-01-04 Thread Marc Aymerich
On Sat, Jan 4, 2014 at 5:26 AM, Alec Taylor wrote: > What is the highest performance REST microframework? > > Happy if it's mostly written in C or C++; as long as it provides a > simple routes interface in Python. > > Currently using bottle and utilising its application, @route and > app.merge(app

Re: Strange behaviour with a for loop.

2014-01-04 Thread Sean Murphy
Chris, Thanks for the tip on the function. I was not aware of that function, Grin. Creating the function as you mention makes a lot of sense. I am doing a lot of little bits and pieces focusing on things I need to eventually build a script that is going to compile data from a router and config

Re: On a scrollbar for tkinter

2014-01-04 Thread eneskristo
On Friday, January 3, 2014 12:00:05 PM UTC+1, Vlastimil Brom wrote: > 2014/1/3 : > > > @Rick > > > I found some solutions for python 2.x, but still, as I am with the future, > > I need a futuristic solution or 2, so if anyone else could help me, I'd be > > grateful! > > > -- > > > > Hi, >

Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp?

2014-01-04 Thread Chris Seberino
Thanks.. I think your 10% Python idea is the way to go. And you are right that most of Python is not needed in an intro course. -- https://mail.python.org/mailman/listinfo/python-list