Re: Ubuntu package "python3" does not include tkinter

2013-04-21 Thread Rui Maciel
Steven D'Aprano wrote: > It's only easy to install a package on Ubuntu if you know that you have > to, and can somehow work out the name of the package. No one actually has to install tkinter. That's the whole point of providing it as a separate package: only those who want to use it have to in

Re: Ubuntu package "python3" does not include tkinter

2013-04-21 Thread Rui Maciel
lcrocker wrote: > I understand that for something like a server distribution, but Ubuntu > is a user-focused desktop distribution. It has a GUI, always. Irrelevant. > The > purpose of a distro like that is to give users a good experience. If I > install Python on Windows, I get to use Python

How to get urllib2 HTTPConnection object, use httplib methods?

2013-04-21 Thread Brian Raymond
I have a httplib based application and in an effort to find a quick way to start leveraging urllib2, including NTLM authentication (via python-ntlm) I am hoping there is a way to utilize an HTTPConnection object opened by urllib2. The goal is to change the initial opener to use urllib2, after t

Re: Ubuntu package "python3" does not include tkinter

2013-04-21 Thread Andrew Berg
On 2013.04.21 23:34, rusi wrote: > On Apr 22, 9:24 am, Andrew Berg wrote: >> On 2013.04.21 22:57, Steven D'Aprano wrote:> It's only easy to install a >> package on Ubuntu if you know that you have >> > to, and can somehow work out the name of the package. >> >> I haven't worked with Ubuntu or apt

ANN: rom 0.10 - Redis object mapper for Python

2013-04-21 Thread Josiah Carlson
Hey everyone, I know, it's been several years since I announced anything on these lists, but I suspect that some of you may have uses for my new package, so here you go. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or

Re: Ubuntu package "python3" does not include tkinter

2013-04-21 Thread rusi
On Apr 22, 9:24 am, Andrew Berg wrote: > On 2013.04.21 22:57, Steven D'Aprano wrote:> It's only easy to install a > package on Ubuntu if you know that you have > > to, and can somehow work out the name of the package. > > I haven't worked with Ubuntu or apt-based packaging in ages, but isn't this

Re: Ubuntu package "python3" does not include tkinter

2013-04-21 Thread Andrew Berg
On 2013.04.21 22:57, Steven D'Aprano wrote: > It's only easy to install a package on Ubuntu if you know that you have > to, and can somehow work out the name of the package. I haven't worked with Ubuntu or apt-based packaging in ages, but isn't this kind of information in a description message or

Re: Ubuntu package "python3" does not include tkinter

2013-04-21 Thread rusi
On Apr 22, 8:57 am, Steven D'Aprano wrote: > On Sat, 20 Apr 2013 18:10:58 +0200, Sibylle Koczian wrote: > > Am 19.04.2013 19:42, schrieb lcrocker: > >> I understand that for something like a server distribution, but Ubuntu > >> is a user-focused desktop distribution. It has a GUI, always. The > >>

Re: Ubuntu package "python3" does not include tkinter

2013-04-21 Thread Steven D'Aprano
On Sat, 20 Apr 2013 18:10:58 +0200, Sibylle Koczian wrote: > Am 19.04.2013 19:42, schrieb lcrocker: >> I understand that for something like a server distribution, but Ubuntu >> is a user-focused desktop distribution. It has a GUI, always. The >> purpose of a distro like that is to give users a goo

Re: itertools.groupby

2013-04-21 Thread Joshua Landau
On 21 April 2013 01:13, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > I wouldn't use groupby. It's a hammer, not every grouping job is a nail. > > Instead, use a simple accumulator: > > > def group(lines): > accum = [] > for line in lines: > line = line.strip() >

Re: suggestion for a small addition to the Python 3 list class

2013-04-21 Thread Terry Jan Reedy
On 4/21/2013 1:12 PM, Lele Gaifax wrote: "Robert Yacobellis" writes: I've noticed that the str join() method takes an iterable, Specifically, it takes an iterable of strings. Any iterable can be made such iwth map(str, iterable) or map(repr, iterble). >> so in the most general case I'm s

Re: Weird behaviour?

2013-04-21 Thread jussij
On Monday, April 22, 2013 11:05:11 AM UTC+10, Steven D'Aprano wrote: > I cannot confirm that behaviour. It works fine for me. As Chris pointed out there is a \r character at the end of the string and that is causing the if to fail. I can now see the \r :) So this is *Windows only* behaviour.

Re: Weird behaviour?

2013-04-21 Thread Steven D'Aprano
On Mon, 22 Apr 2013 10:56:11 +1000, Chris Angelico wrote: > You're running this under Windows. The convention on Windows is for > end-of-line to be signalled with \r\n, but the convention inside Python > is to use just \n. With the normal use of buffered and parsed input, > this is all handled for

Re: Weird behaviour?

2013-04-21 Thread Chris Angelico
On Mon, Apr 22, 2013 at 11:05 AM, Steven D'Aprano wrote: > I cannot confirm that behaviour. It works fine for me. I should mention: Under Linux, there's no \r, so -u or no -u, the program will work fine. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird behaviour?

2013-04-21 Thread jussij
On Monday, April 22, 2013 10:56:11 AM UTC+10, Chris Angelico wrote: > so your string actually contains '120\r', as will be revealed > by its repr(). Thanks Chris. That makes sense. Cheers Jussi -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird behaviour?

2013-04-21 Thread Steven D'Aprano
On Sun, 21 Apr 2013 17:37:18 -0700, jussij wrote: > Can someone please explain the following behaviour? > > I downloaded and compiled the Python 2.7.2 code base. > > I then created this simple c:\temp\test.py macro: > > import sys > > def main(): > print("Please Input 120:

Re: Weird behaviour?

2013-04-21 Thread Chris Angelico
On Mon, Apr 22, 2013 at 10:37 AM, wrote: > Can someone please explain the following behaviour? > > If I run the macro using the -u (flush buffers) option the if statement > always fails: > > C:\Temp>python.exe -u c:\temp\test.py > Please Input 120: > 120 > Value Inputed: 120 >

Weird behaviour?

2013-04-21 Thread jussij
Can someone please explain the following behaviour? I downloaded and compiled the Python 2.7.2 code base. I then created this simple c:\temp\test.py macro: import sys def main(): print("Please Input 120: ") input = raw_input() print("Value Inputed: " +

Re: ask for note keeper tomboy's style

2013-04-21 Thread Walter Hurry
On Sun, 21 Apr 2013 11:42:06 -0600, Michael Torrie wrote: > On 04/21/2013 12:20 AM, LordMax wrote: >> Hi to all. >> >> I am new to python and I was asked to implement a system of notes in >> tomboy's style for my company. >> >> As one of the requirements is the ability to synchronize notes betwe

Re: Preparing sqlite, dl and tkinter for Python installation (no admin rights)

2013-04-21 Thread James Jong
I see, just to be clear, do you mean that Python 2.7.4 (stable) is incompatible with Tk 8.6 (stable)? James On Fri, Apr 19, 2013 at 12:27 PM, Serhiy Storchaka wrote: > 18.04.13 19:24, James Jong написав(ла): > >> The file libtk8.6.so has 1.5M and is definitely >> there. >>

Re: Remove some images from a mail message

2013-04-21 Thread Dave Angel
On 04/21/2013 01:31 PM, Jason Friedman wrote: I will be receiving email that contains, say, 10 images, and I want to forward that message on after removing, say, 5 of those images. I will remove based on size, for example 1679 bytes. I am aware that other images besides the unwanted ones could

Re: suggestion for a small addition to the Python 3 list class

2013-04-21 Thread Steven D'Aprano
On Sun, 21 Apr 2013 09:09:20 -0500, Robert Yacobellis wrote: > Greetings, > > I'm an instructor of Computer Science at Loyola University, Chicago, and > I and Dr. Harrington (copied on this email) teach sections of COMP 150, > Introduction to Computing, using Python 3. One of the concepts we te

Re: Porting 2.x to 3.3: BaseHTTPServer

2013-04-21 Thread Serhiy Storchaka
21.04.13 16:46, Chris Angelico написав(ла): Also, it's expecting bytes everywhere, and I can't find a simple way to declare an encoding and let self.wfile.write() accept str. Do I have to explicitly encode everything that I write, or is there a cleaner way? io.TextIOWrapper -- http://mail.pyt

Re: ask for note keeper tomboy's style

2013-04-21 Thread Michael Torrie
On 04/21/2013 12:20 AM, LordMax wrote: > Hi to all. > > I am new to python and I was asked to implement a system of notes in > tomboy's style for my company. > > As one of the requirements is the ability to synchronize notes > between multiple PC (program level or through cloud-folder does not >

Remove some images from a mail message

2013-04-21 Thread Jason Friedman
I will be receiving email that contains, say, 10 images, and I want to forward that message on after removing, say, 5 of those images. I will remove based on size, for example 1679 bytes. I am aware that other images besides the unwanted ones could be 1679 bytes but this is unlikely and the impac

Re: suggestion for a small addition to the Python 3 list class

2013-04-21 Thread Lele Gaifax
"Robert Yacobellis" writes: > I've noticed that the str join() method takes an iterable, so in the > most general case I'm suggesting to add a join() method to every > Python-provided iterable (however, for split() vs. join() it would be > sufficient to just add a join() method to the list class)

Re: itertools.groupby

2013-04-21 Thread Jason Friedman
#!/usr/bin/python3 > from itertools import groupby > > def get_lines_from_file(file_name): > with open(file_name) as reader: > for line in reader.readlines(): > yield(line.strip()) > > counter = 0 > def key_func(x): > if x.startswith("Starting a new group"): > g

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-21 Thread rusi
On Apr 15, 8:48 am, Mark Janssen wrote: > That all being said, the thrust of this whole effort is to possibly > advance Computer Science and language design, because in-between the > purely concrete "object" architecture of the imperative programming > languages and the purely abstract object arch

Re: There must be a better way

2013-04-21 Thread Colin J. Williams
On 21/04/2013 9:43 AM, Peter Otten wrote: Colin J. Williams wrote: I was seeking some code that would be acceptable to both Python 2.7 and 3.3. In the end, I used: inData= csv.reader(inFile) def main(): if ver == '2': headerLine= inData.next() else: headerLine

Re: There must be a better way

2013-04-21 Thread Colin J. Williams
On 21/04/2013 9:39 AM, Jussi Piitulainen wrote: Colin J. Williams writes: ... It is not usual to have a name with preceding and following udserscores,imn user code. Presumably, there is a rationale for the change from csv.reader.next to csv.reader.__next__. ... I think the user code is suppos

suggestion for a small addition to the Python 3 list class

2013-04-21 Thread Robert Yacobellis
Greetings, I'm an instructor of Computer Science at Loyola University, Chicago, and I and Dr. Harrington (copied on this email) teach sections of COMP 150, Introduction to Computing, using Python 3. One of the concepts we teach students is the str methods split() and join(). I have a suggest

Re: django vs zope vs web2py

2013-04-21 Thread Alok Singh Mahor
On Sun, Apr 21, 2013 at 5:49 PM, Modulok wrote: > > Hi everyone, > > few months back I decided to adopt python for my all sort of work > including > > web programming... > > -- > > http://mail.python.org/mailman/listinfo/python-list > > > > Pick Django or web2py. You'll be happy with either. (I h

Re: Porting 2.x to 3.3: BaseHTTPServer

2013-04-21 Thread Chris Angelico
On Mon, Apr 22, 2013 at 12:01 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> In the current version of the code, I use BaseHTTPServer as the main >> structure of the request handler. 2to3 translated this into >> http.server, which seems to be the nearest direct translation. But

Re: Porting 2.x to 3.3: BaseHTTPServer

2013-04-21 Thread Roy Smith
In article , Chris Angelico wrote: > In the current version of the code, I use BaseHTTPServer as the main > structure of the request handler. 2to3 translated this into > http.server, which seems to be the nearest direct translation. But is > that the best way to go about making a simple HTTP ser

Porting 2.x to 3.3: BaseHTTPServer

2013-04-21 Thread Chris Angelico
I'm porting an old project to Python 3, with the intention of making one codebase that will still run on 2.6/2.7 as well as 3.2+ (or 3.3+, if 3.2 is in any way annoying). My first step was to run the code through 2to3, and the basics are already sorted out by that. Got one question though, and it's

Re: There must be a better way

2013-04-21 Thread Peter Otten
Colin J. Williams wrote: > I was seeking some code that would be acceptable to both Python 2.7 and > 3.3. > > In the end, I used: > > inData= csv.reader(inFile) > > def main(): > if ver == '2': > headerLine= inData.next() > else: > headerLine= inData.__next__() >

Re: There must be a better way

2013-04-21 Thread Jussi Piitulainen
Colin J. Williams writes: ... > It is not usual to have a name with preceding and following > udserscores,imn user code. > > Presumably, there is a rationale for the change from csv.reader.next > to csv.reader.__next__. ... I think the user code is supposed to be next(csv.reader). For example, cu

Re: There must be a better way

2013-04-21 Thread Colin J. Williams
On 20/04/2013 9:07 PM, Terry Jan Reedy wrote: On 4/20/2013 8:34 PM, Tim Chase wrote: In 2.x, the csv.reader() class (and csv.DictReader() class) offered a .next() method that is absent in 3.x In Py 3, .next was renamed to .__next__ for *all* iterators. The intention is that one iterate with fo

Re: clear the screen

2013-04-21 Thread Steven D'Aprano
On Sat, 20 Apr 2013 19:45:46 -0700, Yuanyuan Li wrote: > How to clear the screen? For example, in the two player game. One player > sets a number and the second player guesses the number. When the first > player enters the number, it should be cleared so that the second number > is not able to see

Re: django vs zope vs web2py

2013-04-21 Thread Modulok
> Hi everyone, > few months back I decided to adopt python for my all sort of work including > web programming... > -- > http://mail.python.org/mailman/listinfo/python-list > Pick Django or web2py. You'll be happy with either. (I have no experience with zope.) They're both full featured do-everyt

Re: django vs zope vs web2py

2013-04-21 Thread Surya Kasturi
On Sun, Apr 21, 2013 at 11:48 AM, Alok Singh Mahor wrote: > I am sorry by mistake I sent incomplete mail here is my mail. > > Hi everyone, > few months back I decided to adopt python for my all sort of work > including web programming. and I have wasted long time deciding which to > adopt out of d

Re: Is Unicode support so hard...

2013-04-21 Thread Mark Lawrence
On 21/04/2013 10:02, Terry Jan Reedy wrote: On 4/20/2013 9:37 PM, rusi wrote: I believe that the recent correction in unicode performance followed jmf's grumbles No, the correction followed upon his accurate report of a regression, last August, which was unfortunately mixed in with grumbles a

Re: django vs zope vs web2py

2013-04-21 Thread Roy Smith
In article <47fb29e2-3e78-4989-850b-24359d84b...@googlegroups.com>, Alok Singh Mahor wrote: > I am sorry by mistake I sent incomplete mail here is my mail. > > Hi everyone, > few months back I decided to adopt python for my all sort of work including > web programming. and I have wasted long t

Re: clear the screen

2013-04-21 Thread Dave Angel
On 04/20/2013 10:45 PM, Yuanyuan Li wrote: How to clear the screen? For example, in the two player game. One player sets a number and the second player guesses the number. When the first player enters the number, it should be cleared so that the second number is not able to see it. My question

Re: Is Unicode support so hard...

2013-04-21 Thread Terry Jan Reedy
On 4/20/2013 9:37 PM, rusi wrote: I believe that the recent correction in unicode performance followed jmf's grumbles No, the correction followed upon his accurate report of a regression, last August, which was unfortunately mixed in with grumbles and inaccurate claims. Others separated out

ANN: Albow 2.2.0

2013-04-21 Thread Gregory Ewing
ALBOW - A Little Bit of Widgetry for PyGame Version 2.2 is now available. http://www.cosc.canterbury.ac.nz/greg.ewing/python/Albow/ Highlights of this version: * Multichoice control * Powerful new facilities for hot-linking controls to application data There are also many other improvem

Re: itertools.groupby

2013-04-21 Thread Peter Otten
Jason Friedman wrote: > I have a file such as: > > $ cat my_data > Starting a new group > a > b > c > Starting a new group > 1 > 2 > 3 > 4 > Starting a new group > X > Y > Z > Starting a new group > > I am wanting a list of lists: > ['a', 'b', 'c'] > ['1', '2', '3', '4'] > ['X', 'Y', 'Z'] > [] >

Re: django vs zope vs web2py

2013-04-21 Thread rusi
On Apr 21, 11:18 am, Alok Singh Mahor wrote: > I am sorry by mistake I sent incomplete mail here is my mail. > > Hi everyone, > few months back I decided to adopt python for my all sort of work including > web programming. and I have wasted long time deciding which to adopt out of > django, zope