Re: [newbie] struggling wth tkinter

2013-12-07 Thread Jean Dubois
Op zaterdag 7 december 2013 19:23:30 UTC+1 schreef Cousin Stanley: > > > > > The only thing I see when running it is a little popup > > > with "Click mouse here to quit" which works as expected > > > but always shows the following error-message. > > > > This seems to be left over f

Re: [newbie] struggling wth tkinter

2013-12-07 Thread Chris Angelico
On Sun, Dec 8, 2013 at 6:40 PM, Jean Dubois wrote: > coolens@antec2:~$ python3 feet2meters.py > ImportError: No module named Tkinter In Python 3, the module's named tkinter instead of Tkinter. You should be able to do the exact same import but with the lower-case name, or if you need to support b

Re: [newbie] struggling wth tkinter

2013-12-07 Thread Jean Dubois
Op zaterdag 7 december 2013 19:12:50 UTC+1 schreef Dave Angel: > On Sat, 7 Dec 2013 08:52:08 -0800 (PST), Jean Dubois > > wrote: > > > I'm trying to go through a tutorial on tkinter which has the code > > below as an example. The only thing I see when running it is a little > > popup with "

Re: Is It Bug?

2013-12-07 Thread Tim Roberts
Mahan Marwat wrote: > >Why this is not working. > 'Hello, World'.replace('\\', '\\') > >To me, Python will interpret '' to '\\'. It's really important that you think about the difference between the way string literals are written in Python code, and the way the strings actually loo

Re: Is It Bug?

2013-12-07 Thread Joshua Gardner
If I'm having to deal with incessant backslashes in a string I'll often use the r'\' (raw string literal) syntax. Simplifies things quite a bit. -- https://mail.python.org/mailman/listinfo/python-list

Re: Is It Bug?

2013-12-07 Thread rusi
On Sunday, December 8, 2013 6:28:24 AM UTC+5:30, Mahan Marwat wrote: > Why this is not working. > >>> 'Hello, World'.replace('\\', '\\') > To me, Python will interpret '' to '\\'. And the replace method > will replace '\\' with '\'. So, the result will be 'Hello, > \World'. But it's give

Re: interactive help on the base object

2013-12-07 Thread Devin Jeanpierre
On Fri, Dec 6, 2013 at 9:03 AM, Mark Lawrence wrote: > Is it just me, or is this basically useless? > help(object) > Help on class object in module builtins: > > class object > | The most base type > > > Surely a few more words, or a pointer to this > http://docs.python.org/3/library/f

Re: interactive help on the base object

2013-12-07 Thread Mark Janssen
>>> Is it just me, or is this basically useless? >>> >>> class object >>> | The most *base* type >> [[Terry Reedy:]] > How about something like. > The default top *superclass* for all Python classes. How 'bout you foos just admit that you didn't realize you've been confused this whole time? (It

Re: One liners

2013-12-07 Thread Rotwang
On 07/12/2013 16:25, Steven D'Aprano wrote: On Sat, 07 Dec 2013 16:13:09 +, Rotwang wrote: On 07/12/2013 12:41, Jussi Piitulainen wrote: [...] if tracks is None: tracks = [] Sorry to go off on a tangent, but in my code I often have stuff like this at the start of functions:

Re: Does Python optimize low-power functions?

2013-12-07 Thread Michael Torrie
On 12/06/2013 12:32 PM, Nick Cash wrote: > Nope: > > Python 3.3.0 (default, Sep 25 2013, 19:28:08) > [GCC 4.7.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import dis dis.dis(lambda x: x*x) > 1 0 LOAD_FAST0 (x) >

Re: Is It Bug?

2013-12-07 Thread Roy Smith
In article , Chris Angelico wrote: > The first thing to get your head around is Python string literals. > You'll find them well described in the online tutorial, or poke around > in the interactive interpreter. A couple of ideas to explore along those lines: 1) Read up on raw strings, i.e. r

Re: Is It Bug?

2013-12-07 Thread MRAB
On 08/12/2013 00:59, Mahan Marwat wrote: Why this is not working. 'Hello, World'.replace('\\', '\\') To me, Python will interpret '' to '\\'. And the replace method will replace '\\' with '\'. So, the result will be 'Hello, \World'. But it's give me 'Hello, World'. The result I w

Re: Is It Bug?

2013-12-07 Thread Mark Lawrence
On 08/12/2013 00:59, Mahan Marwat wrote: Why this is not working. 'Hello, World'.replace('\\', '\\') Whoops a daisy!!! ---- ??? To me, Python will interpret '' to '\\'. And the replace method will replace '\\' with '\'. So, the result will be 'Hello, \World'. B

Re: Is It Bug?

2013-12-07 Thread Chris Angelico
On Sun, Dec 8, 2013 at 11:59 AM, Mahan Marwat wrote: > Why this is not working. > 'Hello, World'.replace('\\', '\\') > > To me, Python will interpret '' to '\\'. And the replace method will > replace '\\' with '\'. So, the result will be 'Hello, \World'. But it's give > me 'Hello, \

Re: Is It Bug?

2013-12-07 Thread Iuri
This way, it will replace '\' with '\', so nothing change. >>> 'Hello, World'.replace('', '\\') 'Hello, \\World' >>> print 'Hello, World'.replace('', '\\') Hello, \World On Sat, Dec 7, 2013 at 10:58 PM, Mahan Marwat wrote: > Why this is not working. > > >>> 'Hello, World'.r

Is It Bug?

2013-12-07 Thread Mahan Marwat
Why this is not working. >>> 'Hello, World'.replace('\\', '\\') To me, Python will interpret '' to '\\'. And the replace method will replace '\\' with '\'. So, the result will be 'Hello, \World'. But it's give me 'Hello, World'. The result I want form the code is 'Hello, \World'. -

Is It Bug?

2013-12-07 Thread Mahan Marwat
Why this is not working. >>> 'Hello, World'.replace('\\', '\\') To me, Python will interpret '' to '\\'. And the replace method will replace '\\' with '\'. So, the result will be 'Hello, \World'. But it's give me 'Hello, World'. The result I want form the code is 'Hello, \World'. -

Re: interactive help on the base object

2013-12-07 Thread Ned Batchelder
On 12/7/13 7:10 PM, Gregory Ewing wrote: Mark Lawrence wrote: Is it just me, or is this basically useless? class object | The most base type It's also a somewhat strange construction from an English language point of view. To make sense, it requires interpreting the word "base" as an adject

Re: One liners

2013-12-07 Thread bryan rasmussen
Someone was thinking in ruby there. On Sat, Dec 7, 2013 at 1:14 AM, Dan Stromberg wrote: > > On Fri, Dec 6, 2013 at 4:10 PM, Michael Torrie wrote: > >> On 12/06/2013 04:54 PM, Dan Stromberg wrote: >> > Does anyone else feel like Python is being dragged too far in the >> direction >> > of long

Re: interactive help on the base object

2013-12-07 Thread Gregory Ewing
Mark Lawrence wrote: Is it just me, or is this basically useless? class object | The most base type It's also a somewhat strange construction from an English language point of view. To make sense, it requires interpreting the word "base" as an adjective, and when used that way it has connota

Re: [newbie] struggling wth tkinter

2013-12-07 Thread Terry Reedy
On 12/7/2013 1:12 PM, Dave Angel wrote: On Sat, 7 Dec 2013 08:52:08 -0800 (PST), Jean Dubois wrote: I'm trying to go through a tutorial on tkinter which has the code below as an example. The only thing I see when running it is a little popup with "Click mouse here to quit" which works as expec

Re: One liners

2013-12-07 Thread Mark Lawrence
On 06/12/2013 23:54, Dan Stromberg wrote: Does anyone else feel like Python is being dragged too far in the direction of long, complex, multiline one-liners? Or avoiding temporary variables with descriptive names? Or using regex's for everything under the sun? What happened to using classes?

Re: One liners

2013-12-07 Thread Terry Reedy
On 12/7/2013 11:13 AM, Rotwang wrote: On 07/12/2013 12:41, Jussi Piitulainen wrote: [...] if tracks is None: tracks = [] Sorry to go off on a tangent, but in my code I often have stuff like this at the start of functions: tracks = something if tracks is None else tracks or, in

Re: [newbie] struggling wth tkinter

2013-12-07 Thread Cousin Stanley
> > The only thing I see when running it is a little popup > with "Click mouse here to quit" which works as expected > but always shows the following error-message. This seems to be left over from an earlier post where you were binding a mouse event to a tk label Did you create a

Re: [newbie] struggling wth tkinter

2013-12-07 Thread Dave Angel
On Sat, 7 Dec 2013 08:52:08 -0800 (PST), Jean Dubois wrote: I'm trying to go through a tutorial on tkinter which has the code below as an example. The only thing I see when running it is a little popup with "Click mouse here to quit" which works as expected but always shows the following error

Re: One liners

2013-12-07 Thread Jussi Piitulainen
Rotwang writes: > On 07/12/2013 12:41, Jussi Piitulainen wrote: > > [...] > > > >if tracks is None: > > tracks = [] > > Sorry to go off on a tangent, but in my code I often have stuff like > this at the start of functions: > > tracks = something if tracks is None else tracks > >

Re: One liners

2013-12-07 Thread rusi
On Saturday, December 7, 2013 10:26:04 PM UTC+5:30, Michael Torrie wrote: > On 12/06/2013 08:27 PM, Roy Smith wrote: > > Steven D'Aprano wrote: > >> The ternary if is slightly unusual and unfamiliar > > It's only unusual an unfamiliar if you're not used to using it :-) > > Coming from a C/C++ b

Re: Managing Google Groups headaches

2013-12-07 Thread Ned Batchelder
On 12/7/13 11:27 AM, rusi wrote: On Saturday, December 7, 2013 3:46:02 PM UTC+5:30, wxjm...@gmail.com wrote: Rusi: "unicode as a medium is universal in the same way that ASCII used to be" Probably, you do not realize deeply how this sentence is correct. Unicode and ascii are constructed in

Re: One liners

2013-12-07 Thread Michael Torrie
On 12/07/2013 09:56 AM, Michael Torrie wrote: >> extracols = sorted(set.union(*(set(t.data.keys()) for t in tracks))) if >> tracks else [] > > This is a generator expressions, and ternary ifs are common and often > needed in generator expressions. Oops. This is not a generator expression at all!

Re: One liners

2013-12-07 Thread Michael Torrie
On 12/06/2013 08:27 PM, Roy Smith wrote: > In article <52a287cb$0$30003$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> The ternary if is slightly unusual and unfamiliar > > It's only unusual an unfamiliar if you're not used to using it :-) > Coming from a C/C++ background,

[newbie] struggling wth tkinter

2013-12-07 Thread Jean Dubois
I'm trying to go through a tutorial on tkinter which has the code below as an example. The only thing I see when running it is a little popup with "Click mouse here to quit" which works as expected but always shows the following error-message. However the "main" window which should let you enter

Re: Managing Google Groups headaches

2013-12-07 Thread rusi
On Saturday, December 7, 2013 3:46:02 PM UTC+5:30, wxjm...@gmail.com wrote: > Rusi: > "unicode as a medium is universal in the same way that > ASCII used to be" > Probably, you do not realize deeply how this sentence > is correct. Unicode and ascii are constructed in the > same way. It has not ev

Re: One liners

2013-12-07 Thread Steven D'Aprano
On Sat, 07 Dec 2013 16:13:09 +, Rotwang wrote: > On 07/12/2013 12:41, Jussi Piitulainen wrote: >> [...] >> >>if tracks is None: >> tracks = [] > > Sorry to go off on a tangent, but in my code I often have stuff like > this at the start of functions: > > tracks = something if t

Re: One liners

2013-12-07 Thread Michael Torrie
On 12/07/2013 09:13 AM, Rotwang wrote: > On 07/12/2013 12:41, Jussi Piitulainen wrote: >> [...] >> >>if tracks is None: >> tracks = [] > > Sorry to go off on a tangent, but in my code I often have stuff like > this at the start of functions: > > tracks = something if tracks is Non

Re: Managing Google Groups headaches

2013-12-07 Thread Rotwang
On 07/12/2013 16:08, Roy Smith wrote: In article <31f1bb84-1432-446c-a7d4-79ce16f2a...@googlegroups.com>, wxjmfa...@gmail.com wrote: It is on this level the FSR fails. What is "FSR"? I apologize if this was explained earlier in the thread and I can't find the reference. It's the Flexible

Re: Managing Google Groups headaches

2013-12-07 Thread Tim Chase
On 2013-12-07 11:08, Roy Smith wrote: > In article <31f1bb84-1432-446c-a7d4-79ce16f2a...@googlegroups.com>, > wxjmfa...@gmail.com wrote: > > > It is on this level the FSR fails. > > What is "FSR"? I apologize if this was explained earlier in the > thread and I can't find the reference. Flexibl

Re: One liners

2013-12-07 Thread Rotwang
On 07/12/2013 12:41, Jussi Piitulainen wrote: [...] if tracks is None: tracks = [] Sorry to go off on a tangent, but in my code I often have stuff like this at the start of functions: tracks = something if tracks is None else tracks or, in the case where I don't intend for the

Re: Managing Google Groups headaches

2013-12-07 Thread Roy Smith
In article <31f1bb84-1432-446c-a7d4-79ce16f2a...@googlegroups.com>, wxjmfa...@gmail.com wrote: > It is on this level the FSR fails. What is "FSR"? I apologize if this was explained earlier in the thread and I can't find the reference. https://en.wikipedia.org/wiki/FSR#Science_and_technology w

Re: ASCII and Unicode

2013-12-07 Thread giacomo boffi
Steven D'Aprano writes: > Ironically, your post was not Unicode. [...] Your post was sent > using a legacy encoding, Windows-1252, also known as CP-1252 i access rusi's post using a NNTP server, and in his post i see Content-Type: text/plain; charset=UTF-8 is it possible that what you see is

Re: One liners

2013-12-07 Thread Jussi Piitulainen
Steven D'Aprano writes: > On Fri, 06 Dec 2013 22:27:00 -0500, Roy Smith wrote: > > > Just for fun, I took a look through the Songza code base. 66 kloc of > > non-whitespace Python. I found 192 ternary expressions. Here's a few > > of the more bizarre ones (none of which I consider remotely rea

Re: Managing Google Groups headaches

2013-12-07 Thread Chris Angelico
On Sat, Dec 7, 2013 at 10:25 PM, Steven D'Aprano wrote: > On Sat, 07 Dec 2013 02:16:02 -0800, wxjmfauth wrote: > >> Rusi: >> >> "unicode as a medium is universal in the same way that ASCII used to be" >> >> Probably, you do not realize deeply how this sentence is correct. >> Unicode and ascii are

Re: One liners

2013-12-07 Thread Steven D'Aprano
On Fri, 06 Dec 2013 22:27:00 -0500, Roy Smith wrote: > Just for fun, I took a look through the Songza code base. 66 kloc of > non-whitespace Python. I found 192 ternary expressions. Here's a few > of the more bizarre ones (none of which I consider remotely readable): > > --

Re: Managing Google Groups headaches

2013-12-07 Thread Steven D'Aprano
On Sat, 07 Dec 2013 02:16:02 -0800, wxjmfauth wrote: > Rusi: > > "unicode as a medium is universal in the same way that ASCII used to be" > > Probably, you do not realize deeply how this sentence is correct. > Unicode and ascii are constructed in the same way. It has not even to do > with "chara

Re: Managing Google Groups headaches

2013-12-07 Thread wxjmfauth
Rusi: "unicode as a medium is universal in the same way that ASCII used to be" Probably, you do not realize deeply how this sentence is correct. Unicode and ascii are constructed in the same way. It has not even to do with "characters", but with mathematics. It is on this level the FSR fails. It

New Project for rpm spec file creation

2013-12-07 Thread Unix SA
Hello Guys, I am starting new project on github for rpm spec file creation .. currently repository is empty and i am looking for ideas from the people who are experts in creating rpms for different applications please share your ideas to me .. . currently what i know is i can have some templ