Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-23 Thread Wolfgang Keller
  On an actual operating system, the attitude of the developers (do
  they actually care or just don't give a darn) is *the* critical
  issue for end-user productivity. If a developer makes a statement
  such as of just get a faster computer or just get more RAM,
  then (s)he probably doesn't give darn. C++ applications, just like
  Java applications, tend to leak horrible amounts of memory these
  days, just because the vendors/developers don't care.
 
 I'll note that Python core developers do care about memory leaks.

And that's a really good thing.

But unfortunately, these days, it's rather the exception.

Sincerely,

Wolfgang
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-23 Thread wxjmfauth
Le lundi 23 décembre 2013 18:59:41 UTC+1, Wolfgang Keller a écrit :
   On an actual operating system, the attitude of the developers (do
 
   they actually care or just don't give a darn) is *the* critical
 
   issue for end-user productivity. If a developer makes a statement
 
   such as of just get a faster computer or just get more RAM,
 
   then (s)he probably doesn't give darn. C++ applications, just like
 
   Java applications, tend to leak horrible amounts of memory these
 
   days, just because the vendors/developers don't care.
 
  
 
  I'll note that Python core developers do care about memory leaks.
 
 
 
 And that's a really good thing.
 
 
 
 But unfortunately, these days, it's rather the exception.
 
 

Memory? Let me laugh!

 sys.getsizeof('a')
26
 sys.getsizeof('€')
40
 40 - 26
14
 sys.getsizeof('\U0001')
44
 44 - 26
18


I'm deeply convinced, one will soon see that
technology in CID font.

jmf
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-23 Thread Chris Angelico
On Tue, Dec 24, 2013 at 6:05 AM,  wxjmfa...@gmail.com wrote:
 Memory? Let me laugh!


Is it a crime to hijack an already-hijacked thread?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-23 Thread Mark Lawrence

On 23/12/2013 19:14, Chris Angelico wrote:

On Tue, Dec 24, 2013 at 6:05 AM,  wxjmfa...@gmail.com wrote:

Memory? Let me laugh!



Is it a crime to hijack an already-hijacked thread?

ChrisA



Yes, especially when written with our favourite bug ridden pile of garbage.

Perhaps we should write up something for the Python wiki so that 
everyone can send double line feeds from any technology, that way 
everybody would feel at home as we'd all be in the same boat.


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-23 Thread Dan Stromberg
On Sat, Dec 14, 2013 at 4:25 AM, Chris Angelico ros...@gmail.com wrote:
 On Sat, Dec 14, 2013 at 11:12 PM, Jai jaiprakashsingh...@gmail.com wrote:
 GUI:-want to learn GUI programming in python  , how should i proceed.

 There are lots of book here so I am  confuse which book  i should refer so 
 that i don't waste time . please answer

 There are many ways to build a GUI with Python. Some of the more
 popular toolkits are Tk (tkinter), wxWidgets (wxpython), and GTK.
 Explore those and see which one you like; I personally quite like GTK,
 and the others have their fans too. There are GUI builders for each of
 the above (I think; definitely wx and GTK do), or you can build
 everything directly in code (my preferred style). Play around with it
 and see what you like!

I also like GTK.  I thought it would be relevant to point out that
pygtk only works on Python 2.x; gi.repository.Gtk works on 2.x and
3.x.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-21 Thread Martin Schöön
Den 2013-12-20 skrev Mark Lawrence breamore...@yahoo.co.uk:
 On 20/12/2013 17:52, Martin Schöön wrote:

 Coming from many years of SUN Solaris experience I may be a bit
 spoiled when it comes to robustness :-)


 You never had the pleasure of working on VMS then? :)

Only very, very little and I have no clear memories of it. It was
back in the days before I learned to save my work every few seconds
just in case because just in case didn't happen to us then.

I took OS stability for granted in those days.

/Martin
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-20 Thread Martin Schöön
This thread hasn't been close to Python for while now and should
be shut down. But, it is actually kind of interesting since you 
debate possible mechanisms behind the behaviour of my Windows box 
at work: Not responding is happening to me daily for any
application including Microsoft's own Office Suite. I hoped it
would go away when we moved from Vista to W7 but it didn't.

In all fairness, our computers have both corporate and HP crapware
installed so Microsoft may be innocent.

Coming from many years of SUN Solaris experience I may be a bit
spoiled when it comes to robustness :-)

Now, let's leave this behind and spend time on Python -- something I
with a formal programming education dating back to 1980 and F77 find
fascinating.

/Martin
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-20 Thread Mark Lawrence

On 20/12/2013 17:52, Martin Schöön wrote:


Coming from many years of SUN Solaris experience I may be a bit
spoiled when it comes to robustness :-)



You never had the pleasure of working on VMS then? :)

--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-20 Thread wxjmfauth
Le vendredi 20 décembre 2013 18:52:44 UTC+1, Martin Schöön a écrit :
 This thread hasn't been close to Python for while now and should
 
 be shut down. But, it is actually kind of interesting since you 
 
 debate possible mechanisms behind the behaviour of my Windows box 
 
 at work: Not responding is happening to me daily for any
 
 application including Microsoft's own Office Suite. I hoped it
 
 would go away when we moved from Vista to W7 but it didn't.
 
 
 
 In all fairness, our computers have both corporate and HP crapware
 
 installed so Microsoft may be innocent.
 
 
 
 Coming from many years of SUN Solaris experience I may be a bit
 
 spoiled when it comes to robustness :-)
 
 
 
 Now, let's leave this behind and spend time on Python -- something I
 
 with a formal programming education dating back to 1980 and F77 find
 
 fascinating.
 

The fact, that a main app window [%] falls in a Ne répond pas,
(Not responding) state [*] with a mouse pointer becoming a
waiting pointer is not so dramatic. As I pointed, despite
this message in the title bar, the app works properly(?).

The fact, that system becomes unstable is more critical.
While being in that [*]-state, any attempt to work with
the mouse, eg clicking on an another app window, leads
to a [%] kill and to a msg box Python has stopped working

The Python process can be killed, it does not hurt the system.

I'm observing this with the Qt-derivatives, PySide and PyQt4,
and Python 3.3. Not with Python 3.2.
From where does it come from? No idea. I'm inclined to
think, it's on the Qt side.

Windows 7 pro

jmf


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread wxjmfauth
Le mardi 17 décembre 2013 20:00:14 UTC+1, wxjm...@gmail.com a écrit :
 Le mardi 17 décembre 2013 19:06:35 UTC+1, Michael Torrie a écrit :
 
  On 12/17/2013 08:00 AM, Wolfgang Keller wrote:
 
  
 
   Python is sooo slow when it waits for the human.
 
  
 
   
 
  
 
   With Windows systems, I waste something like 90% of my work time waiting
 
  
 
   for that system to stop Not Responding.
 
  
 
   
 
  
 
   And no, it's not a matter of hardware.
 
  
 
  
 
  
 
  Something is wrong then.  Windows has its issues, and it does slow down
 
  
 
  over time as cruft in the system accumulates. And Windows XP is getting
 
  
 
  slower and slower due to a bug in the automatic updates service, but in
 
  
 
  general, but your experience with Windows is not normal.  I managed
 
  
 
  hundreds of Windows workstations in my previous life and I did not see
 
  
 
  this occur with any regularity. So something is wrong with your setup.
 
  
 
  Maybe its time for a re-install?  Virus or malware?  Or maybe you need
 
  
 
  to upgrade to Windows 7?
 
 
 
 
 
 
 
 I tend to agree with you. However, I should say
 
 I'm observing a strange phenomenon.
 
 
 
 Among others, I wrote two interactive interpreters
 
 with PySide 1.1.2 for Python 3.3 and Python 3.2.
 
 
 
 If I'm runing such a task with Py3.2 (more than a minute)
 
 
 
  timeit.timeit(a = '\u2345'*10; 'x' in a)
 
 
 
 it runs smoothly.
 
 
 
 but if I run the same task with Py3.3
 
 
 
 my window seems to be idled, and a message like,
 
 Ne répond pas (something like Do no respond)
 
 appeares in the title bar of the window (my application
 
 title + that msg). The cursor get transformed into the
 
 win7 waiting cursor.
 
 
 
 The app seems to freeze, but in fact, it is not and
 
 the resulting values are correct.
 
 
 
 How do I know this? Very simple, the resulting
 
 values are in exact concordance with the values
 
 I obtain with my interactive intepreters, but
 
 built with tkinter!
 
 


Same experience with PyQt4.

Py 3.2 : PyQt4.QtCore.PYQT_VERSION_STR - 4.8.6
Py 3.3 : PyQt4.QtCore.PYQT_VERSION_STR - 4.10

jmf
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Mark Lawrence

On 19/12/2013 08:10, wxjmfa...@gmail.com wrote:



Same experience with PyQt4.

Py 3.2 : PyQt4.QtCore.PYQT_VERSION_STR - 4.8.6
Py 3.3 : PyQt4.QtCore.PYQT_VERSION_STR - 4.10

jmf



Your point being?

--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread wxjmfauth
Le jeudi 19 décembre 2013 09:25:14 UTC+1, Mark Lawrence a écrit :
 On 19/12/2013 08:10, wxjmfa...@gmail.com wrote:
 
 
 
 
 
  Same experience with PyQt4.
 
 
 
  Py 3.2 : PyQt4.QtCore.PYQT_VERSION_STR - 4.8.6
 
  Py 3.3 : PyQt4.QtCore.PYQT_VERSION_STR - 4.10
 
 
 
  jmf
 
 
 
 
 
 Your point being?
 
 
 
 -- 
 
 My fellow Pythonistas, ask not what our language can do for you, ask 
 
 what you can do for our language.
 
 

The point is:
Py3.3 and Qt on Windows 7 pro does not work.

jmf
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Mark Lawrence

On 19/12/2013 09:10, wxjmfa...@gmail.com wrote:

Le jeudi 19 décembre 2013 09:25:14 UTC+1, Mark Lawrence a écrit :

On 19/12/2013 08:10, wxjmfa...@gmail.com wrote:








Same experience with PyQt4.







Py 3.2 : PyQt4.QtCore.PYQT_VERSION_STR - 4.8.6



Py 3.3 : PyQt4.QtCore.PYQT_VERSION_STR - 4.10







jmf








Your point being?



--

My fellow Pythonistas, ask not what our language can do for you, ask

what you can do for our language.




The point is:
Py3.3 and Qt on Windows 7 pro does not work.

jmf



Well that's rather sad, but did you have to send all the blank space 
above just to say that?  With whom have you raised bug reports?  What 
has their response(s) been?


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Wolfgang Keller
  All Java GUI frameworks I know of are ridiculous garbage.
  
  Not only that Java per se is obscenely fat (and unresponsive), but
  the GUI frameworks leak like bottomless barrels and the look and
  feel is so hideous that I would say from personal experience with
  numerous Java applications that there is little that's worse for
  user productivity than a Java application running on Windows. Well,
  a web application might top it.
 
 Pray tell is there anything that is not ridiculous garbage or is your
 computer so hopelessly broken that everything fails on it?  You've
 already dissed on Windows, Firefox, the web, Java.

If Windows, Firefox, the web and Java are everything that you know
of in terms of IT, then I pity those poor people who have to succumb
to your competence.

 Surely Python must suck also because it's slow and interpreted.

I don't draw skewed parallels.

Instead I base my judgments on my personal experience from those
decades of screenwork for various tasks with various applications on
various systems, correlated with the experience of all those
knowledgeable people I've learned to know during that time, as well as
logical deductive thinking.

Sincerely,

Wolfgang
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Ned Batchelder

On 12/19/13 10:10 AM, Wolfgang Keller wrote:

All Java GUI frameworks I know of are ridiculous garbage.

Not only that Java per se is obscenely fat (and unresponsive), but
the GUI frameworks leak like bottomless barrels and the look and
feel is so hideous that I would say from personal experience with
numerous Java applications that there is little that's worse for
user productivity than a Java application running on Windows. Well,
a web application might top it.


Pray tell is there anything that is not ridiculous garbage or is your
computer so hopelessly broken that everything fails on it?  You've
already dissed on Windows, Firefox, the web, Java.


If Windows, Firefox, the web and Java are everything that you know
of in terms of IT, then I pity those poor people who have to succumb
to your competence.


He didn't say it was all he knew. It sounds like you are saying he is 
incompetent.  I hope that isn't what you meant.


--
Ned Batchelder, http://nedbatchelder.com

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Wolfgang Keller
  With Windows systems, I waste something like 90% of my work time
  waiting for that system to stop Not Responding.
  
  And no, it's not a matter of hardware.
 
 Something is wrong then.

You bet.

 Windows has its issues, and it does slow down over time as cruft in
 the system accumulates. And Windows XP is getting slower and slower
 due to a bug in the automatic updates service, but in general, but
 your experience with Windows is not normal.

With Windows it *is* normal. An experienced software developer
once even explained the reason to me. When a single process on Windows
does I/O, then the system essentially falls back to single tasking.
Or (non-)cooperative multitasking at best, depending on how
dissocial the developer of that process is.

  I managed hundreds of Windows workstations in my previous
 life and I did not see this occur with any regularity.

Well, because you only managed those computers, you never tried to
accomplish actual *work* with them.

 So something is wrong with your setup. Maybe its time for a
 re-install?  Virus or malware? 

Windows itself is the problem.

 Or maybe you need to upgrade to Windows 7?

Won't change anything.

Sincerely,

Wolfgang
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Chris Angelico
On Fri, Dec 20, 2013 at 2:32 AM, Wolfgang Keller felip...@gmx.net wrote:
 With Windows it *is* normal. An experienced software developer
 once even explained the reason to me. When a single process on Windows
 does I/O, then the system essentially falls back to single tasking.
 Or (non-)cooperative multitasking at best, depending on how
 dissocial the developer of that process is.

What?!

I've supported Windows for quite a few years now (ever since I stopped
being OS/2-exclusive (and will do until I can be Linux-exclusive...
too many people use it for me to drop it). There is nothing
cooperative or single-threaded about Windows multitasking around I/O.

I don't disagree that it absolutely sucks compared to Linux (even OS/2
from the 1990s beats today's Windows in a few areas), but not that
one.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Dave Angel
On Thu, 19 Dec 2013 16:32:37 +0100, Wolfgang Keller 
felip...@gmx.net wrote:

With Windows it *is* normal. An experienced software developer
once even explained the reason to me. When a single process on 

Windows
does I/O, then the system essentially falls back to single 

tasking.

Or (non-)cooperative multitasking at best, depending on how
dissocial the developer of that process is.


If you were told this 20 years ago, perhaps.  But Windows hasn't been 
running on DOS for a long time. Starting with NT 3.1, that's 
nonsense.


--
DaveA

--
https://mail.python.org/mailman/listinfo/python-list


Re: Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Chris Angelico
On Fri, Dec 20, 2013 at 5:30 PM, Dave Angel da...@davea.name wrote:
 On Thu, 19 Dec 2013 16:32:37 +0100, Wolfgang Keller felip...@gmx.net
 wrote:

 With Windows it *is* normal. An experienced software developer
 once even explained the reason to me. When a single process on

 Windows

 does I/O, then the system essentially falls back to single

 tasking.

 Or (non-)cooperative multitasking at best, depending on how
 dissocial the developer of that process is.


 If you were told this 20 years ago, perhaps.  But Windows hasn't been
 running on DOS for a long time. Starting with NT 3.1, that's nonsense.

Actually, one thing I might believe is that when one process trips a
page fault and has to be swapped back in, all other processes freeze,
waiting on the memory manager. But I'd want to see some evidence that
that's the case. It's plausible (based on some of the problems I've
seen) but by no means necessarily true.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-18 Thread wxjmfauth
Le mardi 17 décembre 2013 20:00:14 UTC+1, wxjm...@gmail.com a écrit :
 Le mardi 17 décembre 2013 19:06:35 UTC+1, Michael Torrie a écrit :
 
  On 12/17/2013 08:00 AM, Wolfgang Keller wrote:
 
  
 
   Python is sooo slow when it waits for the human.
 
  
 
   
 
  
 
   With Windows systems, I waste something like 90% of my work time waiting
 
  
 
   for that system to stop Not Responding.
 
  
 
   
 
  
 
   And no, it's not a matter of hardware.
 
  
 
  
 
  
 
  Something is wrong then.  Windows has its issues, and it does slow down
 
  
 
  over time as cruft in the system accumulates. And Windows XP is getting
 
  
 
  slower and slower due to a bug in the automatic updates service, but in
 
  
 
  general, but your experience with Windows is not normal.  I managed
 
  
 
  hundreds of Windows workstations in my previous life and I did not see
 
  
 
  this occur with any regularity. So something is wrong with your setup.
 
  
 
  Maybe its time for a re-install?  Virus or malware?  Or maybe you need
 
  
 
  to upgrade to Windows 7?
 
 
 
 
 
 
 
 I tend to agree with you. However, I should say
 
 I'm observing a strange phenomenon.
 
 
 
 Among others, I wrote two interactive interpreters
 
 with PySide 1.1.2 for Python 3.3 and Python 3.2.
 
 
 
 If I'm runing such a task with Py3.2 (more than a minute)
 
 
 
  timeit.timeit(a = '\u2345'*10; 'x' in a)
 
 
 
 it runs smoothly.
 
 
 
 but if I run the same task with Py3.3
 
 
 
 my window seems to be idled, and a message like,
 
 Ne répond pas (something like Do no respond)
 
 appeares in the title bar of the window (my application
 
 title + that msg). The cursor get transformed into the
 
 win7 waiting cursor.
 
 
 
 The app seems to freeze, but in fact, it is not and
 
 the resulting values are correct.
 
 
 
 How do I know this? Very simple, the resulting
 
 values are in exact concordance with the values
 
 I obtain with my interactive intepreters, but
 
 built with tkinter!
 
 


Installation of PySide 1.2.1 for Py32, Py33
- same effect.

win32, shiboken, Visual Studio, Qt: ???

jmf
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-18 Thread Mark Lawrence

On 18/12/2013 09:24, wxjmfa...@gmail.com wrote:

[once again snip all the double spaced crap from google groups]



Installation of PySide 1.2.1 for Py32, Py33
- same effect.

win32, shiboken, Visual Studio, Qt: ???

jmf



The point of this is?

--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread wxjmfauth
From all the toolkits, wxPython is probably the most
interesting. I used all versions from 2.0 (?) up to 2.8. Then
it has been decided to go unicode.

Let see in the wx interactive intepreter, it is only
the top of the iceberg. (Py27, wxPy294)

 len('ሴЃ')
5

---

It has alos been decided to rework wxPython and create
wxPhoenix, unicode of course.

Impossible to put a Python string correctly in a widget
supposed to handle text. The design mistake is more
deeper than in wx29 (unicode).

I do not know the present status, but as the mistake
is a consequence of a unicode non understanding (plus
a little bit Python, plus a little bit wxWidgets), I doubt
that some improvement happened.

I attempted to explain unicode...

jmf
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Christian Gollwitzer

Am 17.12.13 06:37, schrieb Rick Johnson:

On Sunday, December 15, 2013 11:01:53 AM UTC-6, Steven D'Aprano wrote:

low-level language with some interface to Python. The main
difference between this hypothetical Python GUI and Tcl
is that Tcl is a Turing-complete interpreter which lives
in it's own process.


And how many times would you take advantage of that turning
complete functionality in reality? My answer... ZERO! How
many Tcl calls have you, or anybody, made that did have
direct business with creating or managing a TK gui? HOW
MANY???


There are some useful extensions to Tk written in Tcl. For example, 
there is tablelist - a tree widget or multicolumn listbox in pure Tcl. 
By passing it to the Tcl interpreter, you can wrap it up for Python - 
that's what Kevin Walzer did at


http://tkinter.unpythonic.net/wiki/TableListWrapper

It would take many man-month to reproduce this thing in Python.


Another example is the file open dialog (import tkFileDialog). On 
Windows and OSX, it uses the native variants, but on X11 it uses a very 
outdated, ugly and hard to use thing bundled with Tk. With just a few 
lines executed by some Tk.eval('source myfixes.tcl'), I overwrite this 
dialog box with the one created by Schelte Bron:

http://wiki.tcl.tk/15897

For reference, here is myfixes.tcl:

lappend auto_path [file dirname [info script]]
if {[tk windowingsystem] == x11 } {
package require fsdialog
interp alias {} tk_getOpenFile {} ttk::getOpenFile
interp alias {} tk_getSaveFile {} ttk::getSaveFile
interp alias {} tk_chooseDirectory {} ttk::chooseDirectory
}

Christian
--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Mark Lawrence

On 17/12/2013 07:58, wxjmfa...@gmail.com wrote:

 From all the toolkits, wxPython is probably the most
interesting. I used all versions from 2.0 (?) up to 2.8. Then
it has been decided to go unicode.

Let see in the wx interactive intepreter, it is only
the top of the iceberg. (Py27, wxPy294)


len('ሴЃ')

5

---

It has alos been decided to rework wxPython and create
wxPhoenix, unicode of course.

Impossible to put a Python string correctly in a widget
supposed to handle text. The design mistake is more
deeper than in wx29 (unicode).

I do not know the present status, but as the mistake
is a consequence of a unicode non understanding (plus
a little bit Python, plus a little bit wxWidgets), I doubt
that some improvement happened.

I attempted to explain unicode...

jmf



wxPython 3 (Phoenix) will be the first version that supports Python 3. 
This will obviously mean that for the first time, wxPython will be able 
to take full advantage of the superb PEP393 Flexible String 
Representation (FSR) which is available in Python 3.3+.


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread wxjmfauth
Le mardi 17 décembre 2013 09:33:24 UTC+1, Mark Lawrence a écrit :
 On 17/12/2013 07:58, wxjmfa...@gmail.com wrote:
 
   From all the toolkits, wxPython is probably the most
 
  interesting. I used all versions from 2.0 (?) up to 2.8. Then
 
  it has been decided to go unicode.
 
 
 
  Let see in the wx interactive intepreter, it is only
 
  the top of the iceberg. (Py27, wxPy294)
 
 
 
  len('ሴЃ')
 
  5
 
 
 
  ---
 
 
 
  It has alos been decided to rework wxPython and create
 
  wxPhoenix, unicode of course.
 
 
 
  Impossible to put a Python string correctly in a widget
 
  supposed to handle text. The design mistake is more
 
  deeper than in wx29 (unicode).
 
 
 
  I do not know the present status, but as the mistake
 
  is a consequence of a unicode non understanding (plus
 
  a little bit Python, plus a little bit wxWidgets), I doubt
 
  that some improvement happened.
 
 
 
  I attempted to explain unicode...
 
 
 
  jmf
 
 
 
 
 
 wxPython 3 (Phoenix) will be the first version that supports Python 3. 
 
 This will obviously mean that for the first time, wxPython will be able 
 
 to take full advantage of the superb PEP393 Flexible String 
 
 Representation (FSR) which is available in Python 3.3+.
 
 
 
 -- 
 
 My fellow Pythonistas, ask not what our language can do for you, ask 
 
 what you can do for our language.
 
 

I'm very happy for you.
You should at least serialized the tasks.

- wxPhoenix (wrapper of wxWidgets) is one thing
- wxPhoenix for Python3 / Python2 is something else
- Ditto for the FSR
- Ditto for unicode

For your information, that's at those times I decided
to have a look at the Qt derivatives, it was a very,
very good idea.

jmf
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Steven D'Aprano
On Mon, 16 Dec 2013 23:58:15 -0800, wxjmfauth wrote:

 From all the toolkits, wxPython is probably the most interesting. I used
 all versions from 2.0 (?) up to 2.8. Then it has been decided to go
 unicode.
 
 Let see in the wx interactive intepreter, it is only the top of the
 iceberg. (Py27, wxPy294)
 
 len('ሴЃ')
 5


What does that have to do with wxPython? It looks like you're just mis-
using Python 2.7.

In Python 2.7, 'ሴЃ' is not a Unicode string, it is a byte string. The 
exact bytes you get are not well-defined but on many systems you may get 
a UTF-8 encoded byte string:


py sys.version
'2.7.4 (default, Apr 18 2013, 17:48:59) \n[GCC 4.4.5]'
py for b in 'ሴЃ':
... print hex(ord(b)), b
... 
0xe1 
0x88 �
0xb4 �
0xd0 
0x83 �


If you use a Unicode string instead:

py for c in u'ሴЃ':
... print hex(ord(c)), c
... 
0x1234 ሴ
0x403 Ѓ

py for b in u'ሴЃ'.encode('utf-8'):
... print hex(ord(b)), b
... 
0xe1 
0x88 �
0xb4 �
0xd0 
0x83 �



Even if it is true that wxPython cannot handle Unicode text, you haven't 
shown it here.



-- 
Steven
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Christian Gollwitzer

Am 16.12.13 23:40, schrieb Chris Angelico:

On Tue, Dec 17, 2013 at 9:06 AM, Christian Gollwitzer aurio...@gmx.de wrote:

Let the flame war begin!


I'll try to avoid flamage :)


:) So let's vigorously discuss about facts;)


But my rule of thumb with bash scripts is: If it exceeds a page or
two in length, it's probably time it got rewritten in an application
language. When a program is the size of gitk (10KLOC), the benefits
relating to interactive use (as you mention below) become less
significant, and benefits relating to discoverability of the more
obscure features become more significant.


I do not know, whether bash has means to structure large programs, I 
suppose not. Tcl has (see below), and concerning discoverability, see 
also below.



It does command substitution (indeed the brackets [] do) and is one of the
key concepts of Tcl. mc is probably the command from msgcat which translates
i18n strings. Complaining about these basic things is like complaining about
indentation in Python.


Okay. Now, how am I to figure out where this command comes from? It's
not a host command (typing mc at the bash prompt comes up failure),
and it's not defined in the script itself (at least, I can't find
proc mc anywhere); is it a Tcl built-in? Where do I start looking?


Usually, I run the program in tkcon, an excellent interactive shell for 
Tcl. There you type edit mc, and it shows you the definition, plus you 
can change it, send it back to the program and see how the modified 
program behaves now (without restarting it!) Under the hood, it executes 
commands like info commands, info args, info body, which do the 
work. If it tells you that there is no such thing as mc, it came from 
a compiled extension (a C procedure). Indeed, in this case you are out 
of luck, to my knowledge there is no info which extension loads that 
thing. But you could observe it before startup by putting up a command 
trace (some sort of callback) on mc.


In the gitk case, mc comes from these lines:

package require msgcat
namespace import ::msgcat::mc

Now, be prepared: These lines do almost the same as

import msgcat
from msgcat import mc

would do in Python.

*What is this? I heard Tcl has no modules?* Don't listen to these 
people, today (well, namespaces exist since 8.0, 1997, packages date 
back further) you can use namespaces and packages to structure your 
programs and separate data. And because Tcl is highly introspective, you 
can ask about almost everything:


(src) 61 % namespace import
mc
(src) 62 % namespace origin mc
::msgcat::mc
(src) 63 %

(there is only one imported command in gitk, namespace import returns a 
list)



About globals: Yes global gives you a true global, but namespaces have 
namespace variables, which you should use instead. The awkward thing is 
that you need to import these (as the globals) into every proc which 
uses them, but by using an OO framework such as Snit, this burden is 
taken away from the programmer.


Still Python *has* advantages here. If there is a docstring, you can get 
help() about the unknown thing, it has a type() and in Tcl, the package 
author is responsible for wrapping the package content into a namespace. 
Something like import Tkinter as Tk is not possible in Tcl (well, you 
could rename the namespace, but if not carefully written, it may break 
the package).



* Interpreters in threads. There is no GIL, Tcl interpreters are thread safe
and more than one can coexist in a process and run concurrently. This is
accessible from script level through the Threads package.


Nice, though Python's threading and/or multiprocessing can do 90% of
what people want. Side point: What about Tk? Can you (a) run separate
GUI threads for separate windows? (b) manipulate widgets created by
another thread?


You can't run Tk more than once, that applies to almost every toolkit I 
know. But you can pass a message to the main thread to do it for you. 
This is quite easy; it looks like


thread::send -async $main [list doit $somedata]

You pass an arbitrary Tcl command which executes in the main thread as 
soon as it is idle. In fact, because of the embedded event loop in Tcl 
(not bound to Tk), you rarely need threads at all. Asynchronous I/O is 
very easy in Tcl (fileevent command).


That one question here with replicating nc to control a device would be 
a textbook example of fileevent usage in Tcl.



So there definitely are some advantages that Tcl has over Python. Put
against them is a superior object model, a large corpus of first-class
object types (dict, set, list, etc[1]), and a syntax that more clearly
differentiates names and strings without making variable references
look like a lot more than they are.


Lists and dicts exist in Tcl as first class objects. You just can't tell 
them apart from strings. Sets are in tcllib. Python is more strongly 
typed than Tcl in that respect, which can be an advantage. Specifically 
doing math is easier in an 

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Mark Lawrence

On 17/12/2013 09:29, Steven D'Aprano wrote:


Even if it is true that wxPython cannot handle Unicode text, you haven't
shown it here.



Personally I am convinced that wxPython can't handle unicode for the 
simple reason that it doesn't yet support Python 3 and we all know that 
Python 2 and unicode don't mix.


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Mark Lawrence

On 17/12/2013 09:18, wxjmfa...@gmail.com wrote:

Le mardi 17 décembre 2013 09:33:24 UTC+1, Mark Lawrence a écrit :

On 17/12/2013 07:58, wxjmfa...@gmail.com wrote:


  From all the toolkits, wxPython is probably the most



interesting. I used all versions from 2.0 (?) up to 2.8. Then



it has been decided to go unicode.







Let see in the wx interactive intepreter, it is only



the top of the iceberg. (Py27, wxPy294)







len('ሴЃ')



5







---







It has alos been decided to rework wxPython and create



wxPhoenix, unicode of course.







Impossible to put a Python string correctly in a widget



supposed to handle text. The design mistake is more



deeper than in wx29 (unicode).







I do not know the present status, but as the mistake



is a consequence of a unicode non understanding (plus



a little bit Python, plus a little bit wxWidgets), I doubt



that some improvement happened.







I attempted to explain unicode...







jmf








wxPython 3 (Phoenix) will be the first version that supports Python 3.

This will obviously mean that for the first time, wxPython will be able

to take full advantage of the superb PEP393 Flexible String

Representation (FSR) which is available in Python 3.3+.



--

My fellow Pythonistas, ask not what our language can do for you, ask

what you can do for our language.




I'm very happy for you.
You should at least serialized the tasks.

- wxPhoenix (wrapper of wxWidgets) is one thing
- wxPhoenix for Python3 / Python2 is something else
- Ditto for the FSR
- Ditto for unicode

For your information, that's at those times I decided
to have a look at the Qt derivatives, it was a very,
very good idea.

jmf



I haven't the faintest idea what your words above are meant to mean. 
Your communication skills are clearly lacking, as you also still insist 
on sending us double spaced google crap.  Do you not understand the 
instructions here https://wiki.python.org/moin/GoogleGroupsPython ?


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Steven D'Aprano
On Tue, 17 Dec 2013 09:39:06 +, Mark Lawrence wrote:

 Personally I am convinced that wxPython can't handle unicode for the
 simple reason that it doesn't yet support Python 3 and we all know that
 Python 2 and unicode don't mix.

I don't think this is right. The Unicode support in Python 2 isn't as 
good as in Python 3, but it is still pretty good. You just have to 
remember to use the u prefix on your strings.

If it is true that wxPython cannot handle Unicode -- and I see no 
evidence that this is correct -- then it is due to the underlying wx* 
library, not Python 2.


-- 
Steven
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread wxjmfauth
Le mardi 17 décembre 2013 10:29:28 UTC+1, Steven D'Aprano a écrit :
 On Mon, 16 Dec 2013 23:58:15 -0800, wxjmfauth wrote:
 
 
 
  From all the toolkits, wxPython is probably the most interesting. I used
 
  all versions from 2.0 (?) up to 2.8. Then it has been decided to go
 
  unicode.
 
  
 
  Let see in the wx interactive intepreter, it is only the top of the
 
  iceberg. (Py27, wxPy294)
 
  
 
  len('ሴЃ')
 
  5
 
 
 
 
 
 What does that have to do with wxPython? It looks like you're just mis-
 
 using Python 2.7.
 
 
 
 In Python 2.7, 'ሴЃ' is not a Unicode string, it is a byte string. The 
 
 exact bytes you get are not well-defined but on many systems you may get 
 
 a UTF-8 encoded byte string:
 
 
 
 
 
 py sys.version
 
 '2.7.4 (default, Apr 18 2013, 17:48:59) \n[GCC 4.4.5]'
 
 py for b in 'ሴЃ':
 
 ... print hex(ord(b)), b
 
 ... 
 
 0xe1 
 
 0x88 �
 
 0xb4 �
 
 0xd0 
 
 0x83 �
 
 
 
 
 
 If you use a Unicode string instead:
 
 
 
 py for c in u'ሴЃ':
 
 ... print hex(ord(c)), c
 
 ... 
 
 0x1234 ሴ
 
 0x403 Ѓ
 
 
 
 py for b in u'ሴЃ'.encode('utf-8'):
 
 ... print hex(ord(b)), b
 
 ... 
 
 0xe1 
 
 0x88 �
 
 0xb4 �
 
 0xd0 
 
 0x83 �
 
 
 
 
 
 
 
 Even if it is true that wxPython cannot handle Unicode text, you haven't 
 
 shown it here.
 
 
 
 
 
 
Quich answer.

That's PyShell, the wxPy interpreter.

You are right in pointing all this missmatch: byte string,
unicode, utf-8, mixing a unicode tool kit wiht a non
unicode native engine, plus plenty of related things, ...

You may be not aware. I contributed to wxPython from
practically 2.0, 2.1. 2.2 during 6, 7, 8 yeaurs, testing,
reporting about/with all versions, then I gave up.

---

Yout quote.
Even if it is true that wxPython cannot handle Unicode text...

It's a confusing vision and that's not correct. It's a little bit
more complicate than this.

jmf


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Robert Kern

On 2013-12-17 11:13, Steven D'Aprano wrote:

On Tue, 17 Dec 2013 09:39:06 +, Mark Lawrence wrote:


Personally I am convinced that wxPython can't handle unicode for the
simple reason that it doesn't yet support Python 3 and we all know that
Python 2 and unicode don't mix.


I don't think this is right. The Unicode support in Python 2 isn't as
good as in Python 3, but it is still pretty good. You just have to
remember to use the u prefix on your strings.

If it is true that wxPython cannot handle Unicode -- and I see no
evidence that this is correct --


It most certainly is not. wxPython has handled Unicode (via `unicode` strings) 
for many, many years now.


--
Robert Kern

I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth.
  -- Umberto Eco

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Chris Angelico
On Tue, Dec 17, 2013 at 8:33 PM, Christian Gollwitzer aurio...@gmx.de wrote:
 Am 16.12.13 23:40, schrieb Chris Angelico:
 But my rule of thumb with bash scripts is: If it exceeds a page or
 two in length, it's probably time it got rewritten in an application
 language. When a program is the size of gitk (10KLOC), the benefits
 relating to interactive use (as you mention below) become less
 significant, and benefits relating to discoverability of the more
 obscure features become more significant.

 I do not know, whether bash has means to structure large programs, I suppose
 not. Tcl has (see below), and concerning discoverability, see also below.

You can create functions, which then effectively become new commands.
You can source (the . command) another file, which mostly is a
#include style of thing. But mainly, a bash script is doing exactly
what would happen at the interactive shell (modulo environment
differences - your interactive shell might well have a different $PATH
or something, but command execution still follows the same rules). If
I look at a bash script and see it execute bc, I can type man bc
and have a reasonable chance of it being the same thing.

 In the gitk case, mc comes from these lines:

 package require msgcat
 namespace import ::msgcat::mc

 Now, be prepared: These lines do almost the same as

 import msgcat
 from msgcat import mc

 would do in Python.

Okay. Now that you've told me that, I can find those lines... down the
very bottom of the script. The first thing I did when trying to figure
this out was to go to the top of the file and search for mc, and I
didn't find a definition.

In Python, it's conventional to put imports at the top, so this would
have worked. (Unless there's a from x import *, but this is
precisely why that's frowned upon.) Is the convention different in
Tcl, or is gitk just laid out unhelpfully?

 You can't run Tk more than once, that applies to almost every toolkit I
 know. But you can pass a message to the main thread to do it for you. This
 is quite easy; it looks like

 thread::send -async $main [list doit $somedata]

Everything I ever did on OS/2 allowed GUI operations from multiple
threads. The C APIs, I think, were restricted to manipulating each
widget from the thread that created it (or at least, you could confuse
yourself thoroughly if you didn't; I always just stuck to this
window, this thread); VX-REXX allowed any thread to manipulate any
object belonging to that process. If you send a message to a widget,
its thread will handle it (and yours will block until you get a
response - or you can post a message, which doesn't block); this
functions the same whether it's a thread in your process or one in
another process.

 You pass an arbitrary Tcl command which executes in the main thread as soon
 as it is idle. In fact, because of the embedded event loop in Tcl (not bound
 to Tk), you rarely need threads at all. Asynchronous I/O is very easy in Tcl
 (fileevent command).

I learned to love async processing a couple of years ago with Pike.
You just return a negative number from main(), which normally has no
meaning, and it goes into a back-end event loop. (And there are other
ways to invoke the back-end.) That can then handle callbacks from
files/sockets, clock-based timeouts (call this function in X
seconds), GUI events, pretty much everything (except signals - they
interrupt everything else, as they should). It takes a bit of getting
your head around, if you're used to thread-based programming (as I had
been for a decade or so), but it's so convenient.

 So there definitely are some advantages that Tcl has over Python. Put
 against them is a superior object model, a large corpus of first-class
 object types (dict, set, list, etc[1]), and a syntax that more clearly
 differentiates names and strings without making variable references
 look like a lot more than they are.

 [1] What is an etc() in Python?

 Is this a quizzy question? I have no idea.

I mentioned four of Python's fundamental types: the dict, the set, the
list, and the etc. :)

 Lists and dicts exist in Tcl as first class objects. You just can't tell
 them apart from strings. Sets are in tcllib. Python is more strongly typed
 than Tcl in that respect, which can be an advantage. Specifically doing math
 is easier in an evaluation based syntax than in a command based syntax, this
 sometimes sucks in Tcl.

Having grown up with REXX, I completely understand the concept of
everything is a string (though REXX does have compound variables,
which aren't quite lists, aren't quite dicts, and aren't quite sets,
and definitely aren't quite multidimensional anything, but are their
own beast with unique semantics); and having since met Python and Pike
and other such languages, I prefer object semantics. The only
first-class type in REXX is the string; a compound variable is a
different sort of name, not a different sort of value, so you can't
actually pass an array as 

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Mark Lawrence

On 17/12/2013 11:13, Steven D'Aprano wrote:

On Tue, 17 Dec 2013 09:39:06 +, Mark Lawrence wrote:


Personally I am convinced that wxPython can't handle unicode for the
simple reason that it doesn't yet support Python 3 and we all know that
Python 2 and unicode don't mix.


I don't think this is right. The Unicode support in Python 2 isn't as
good as in Python 3, but it is still pretty good. You just have to
remember to use the u prefix on your strings.

If it is true that wxPython cannot handle Unicode -- and I see no
evidence that this is correct -- then it is due to the underlying wx*
library, not Python 2.




Sorry folks, I'd been up all night and messed that up completely.  I 
meant to say Personally I am convinced that *IF* wxPython can't handle 
unicode *IT WILL BE* for the simple reason that it doesn't yet support 
Python 3 and we all know that Python 2 and unicode don't mix.  It would 
have been better still if I'd added right at the end particularly 
well, with this being the impression I get from the bug tracker, with 
far fewer bugs being raised against Python 3 unicode that I'm aware of 
rather than Python 2.  I'm now crossing my fingers and legs and hoping 
that my impression is correct.


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread wxjmfauth
Le mardi 17 décembre 2013 14:03:03 UTC+1, Robert Kern a écrit :
 On 2013-12-17 11:13, Steven D'Aprano wrote:
 
  On Tue, 17 Dec 2013 09:39:06 +, Mark Lawrence wrote:
 
 
 
  Personally I am convinced that wxPython can't handle unicode for the
 
  simple reason that it doesn't yet support Python 3 and we all know that
 
  Python 2 and unicode don't mix.
 
 
 
  I don't think this is right. The Unicode support in Python 2 isn't as
 
  good as in Python 3, but it is still pretty good. You just have to
 
  remember to use the u prefix on your strings.
 
 
 
  If it is true that wxPython cannot handle Unicode -- and I see no
 
  evidence that this is correct --
 
 
 
 It most certainly is not. wxPython has handled Unicode (via `unicode` 
 strings) 
 
 for many, many years now.
 
 
 
 -- 
 
 Robert Kern
 

---

Correct.

Output of my last interactive interpreter I wrote with
that toolkit.

Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on 
win32
 
psi runs psizero.py...
...psizero has been executed
 '€'
€
 print('€')
€
 u'€'
?
 print(u'€')
?
 u'\u20ac'
€
 print(u'\u20ac')
€
 

And if I cut/copy/paste something like this:
'ሴ䕧'
into that interpreter, it behaves like this ('??'):

 u'asdf'
asdf
 '??'
??
 999
999
 éléphant
éléphant
 'éléphant'
éléphant
 


jmf
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread wxjmfauth
Addendum.

I should say, I had also a lot of fun in writing my own
styling engine.

Because when one has to deal with a language, which does
not recognize its own keywords...

 1and 444
444


tokenize.py could have been a solution, but it's really
too slow.

jmf
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Mark Lawrence

On 17/12/2013 14:43, wxjmfa...@gmail.com wrote:

Addendum.

I should say, I had also a lot of fun in writing my own
styling engine.

Because when one has to deal with a language, which does
not recognize its own keywords...


1and 444

444




tokenize.py could have been a solution, but it's really
too slow.

jmf



To what, where is your context, my crystal ball is broken again?

--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Wolfgang Keller
 Python is sooo slow when it waits for the human.

With Windows systems, I waste something like 90% of my work time waiting
for that system to stop Not Responding.

And no, it's not a matter of hardware.

Sincerely,

Wolfgang
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Wolfgang Keller
 For example Firefox implements its entire GUI in
 Javascript using XML GUI definitions.

Which has made Firefox essentially unusable because it will fall into
koma (Not Responding) for minutes upon almost each and every
mouseclick. Unfortunately I don't know any significantly better
alternatives.

 And all modern web apps are a combination of many languages and
 domains, most of which are compiled in the traditional sense.

Web apps are the most efficient way I know of to make users who have
to get actual work done as inefficient as possible. It's especially an
extremely effective way, together with Firefox's responsiveness, to
make any operating system as obscenely unusable as Windows.
 
Sincerely,

Wolfgang
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Wolfgang Keller
 The other thing, specially if you would make a customer project, I
 don't know how to pack the app written in python in an installer.

If you want your application to be actually user-friendly, you make it
available as an installer-less zip archive. It works with Python
applications, no matter whether they use PyGTK, wxPython or PyQt.

 Perhaps I am wrong, and you could give me in exchange an advise ?!

Python is probably the best language for application implementation in
general. Anything that would really need to be faster than python
itself allows can easily be implemented in compiled Python à la Pyrex
et al.

 I also believe in performance. An application written in C++, can be 
 compiled easily on the target platform (like on windows systems) with 
 it's native compiler.
 How would it be with wxPython ?!

It isn't an issue.

With that pathological non-operating system Microsoft (Not Responding),
as soon as your application has to do any I/O, or if there's any other
process (virus scanner, file system indexer) running that does I/O,
any computer will be unusable for productive work anyway.

On an actual operating system, the attitude of the developers (do they
actually care or just don't give a darn) is *the* critical issue for
end-user productivity. If a developer makes a statement such as
of just get a faster computer or just get more RAM, then (s)he
probably doesn't give darn. C++ applications, just like Java
applications, tend to leak horrible amounts of memory these days, just
because the vendors/developers don't care.

Sincerely,

Wolfgang
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Wolfgang Keller
 Please check JYTHON and those ready-for-novice GUI tools in java.

All Java GUI frameworks I know of are ridiculous garbage.

Not only that Java per se is obscenely fat (and unresponsive), but the
GUI frameworks leak like bottomless barrels and the look and feel is so
hideous that I would say from personal experience with numerous Java
applications that there is little that's worse for user productivity
than a Java application running on Windows. Well, a web application
might top it.

Sincerely,

Wolfgang
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Wolfgang Keller
 On Sun, Dec 15, 2013 at 4:33 PM, Wolfgang Keller felip...@gmx.net
 wrote:
  And besides, again, a commercially licensed PyQt itself isn't *that*
  expensive.
 
  The cost of a commercial PyQt license for a single developer is £350
  (GBP). You may pay in either US Dollars, Euros or GBP.

I didn't write the second paragraph. Please learn to quote, thanks.
 
 (£420 incl. VAT for UK and select EU entities)

For a commercial developer that doesn't appear much to me. I know Qt
applications that cost ~100.000 EUR per seat. Others are so valuable
that they simply aren't sold at all.

Wingware since recently uses PyQt and their prices don't seem to have
skyrocketed since the migration from PyGTK.

  one [license] per developer
 
 For some people, it might be a lot.  Why waste money on something,
 that has an almost-identical free-for-everyone version? (which also is
 easier to install, BTW)

Because PySide is *far* from identical.
 
  PyQt does not include Qt itself. You must also obtain an
  appropriately licensed copy (either the commercial version from
  Digia or the LGPL version from the Qt Project).

Thanks again for learning to quote correctly. I did not write this
paragraph.
 
 So, you have four options:

If you need something that's actually supported, Pyside (currently)
doesn't look like a credible option to me.

And for home users, education etc., the GPL version of PyQt seems
perfect to me.

Sincerely,

Wolfgang
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Michael Torrie
On 12/17/2013 08:00 AM, Wolfgang Keller wrote:
 Python is sooo slow when it waits for the human.
 
 With Windows systems, I waste something like 90% of my work time waiting
 for that system to stop Not Responding.
 
 And no, it's not a matter of hardware.

Something is wrong then.  Windows has its issues, and it does slow down
over time as cruft in the system accumulates. And Windows XP is getting
slower and slower due to a bug in the automatic updates service, but in
general, but your experience with Windows is not normal.  I managed
hundreds of Windows workstations in my previous life and I did not see
this occur with any regularity. So something is wrong with your setup.
Maybe its time for a re-install?  Virus or malware?  Or maybe you need
to upgrade to Windows 7?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Terry Reedy

On 12/17/2013 10:07 AM, Wolfgang Keller wrote:


On an actual operating system, the attitude of the developers (do they
actually care or just don't give a darn) is *the* critical issue for
end-user productivity. If a developer makes a statement such as
of just get a faster computer or just get more RAM, then (s)he
probably doesn't give darn. C++ applications, just like Java
applications, tend to leak horrible amounts of memory these days, just
because the vendors/developers don't care.


I'll note that Python core developers do care about memory leaks. At 
least one module is tested for memory leaks in a nightly task. When 
found, leaks are patched.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Michael Torrie
On 12/17/2013 08:00 AM, Wolfgang Keller wrote:
 Please check JYTHON and those ready-for-novice GUI tools in java.
 
 All Java GUI frameworks I know of are ridiculous garbage.
 
 Not only that Java per se is obscenely fat (and unresponsive), but the
 GUI frameworks leak like bottomless barrels and the look and feel is so
 hideous that I would say from personal experience with numerous Java
 applications that there is little that's worse for user productivity
 than a Java application running on Windows. Well, a web application
 might top it.

Pray tell is there anything that is not ridiculous garbage or is your
computer so hopelessly broken that everything fails on it?  You've
already dissed on Windows, Firefox, the web, Java.  Surely Python must
suck also because it's slow and interpreted.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread Mark Lawrence

On 17/12/2013 19:00, wxjmfa...@gmail.com wrote:

Le mardi 17 décembre 2013 19:06:35 UTC+1, Michael Torrie a écrit :

On 12/17/2013 08:00 AM, Wolfgang Keller wrote:


Python is sooo slow when it waits for the human.







With Windows systems, I waste something like 90% of my work time waiting



for that system to stop Not Responding.







And no, it's not a matter of hardware.




Something is wrong then.  Windows has its issues, and it does slow down

over time as cruft in the system accumulates. And Windows XP is getting

slower and slower due to a bug in the automatic updates service, but in

general, but your experience with Windows is not normal.  I managed

hundreds of Windows workstations in my previous life and I did not see

this occur with any regularity. So something is wrong with your setup.

Maybe its time for a re-install?  Virus or malware?  Or maybe you need

to upgrade to Windows 7?




I tend to agree with you. However, I should say
I'm observing a strange phenomenon.

Among others, I wrote two interactive interpreters
with PySide 1.1.2 for Python 3.3 and Python 3.2.

If I'm runing such a task with Py3.2 (more than a minute)


timeit.timeit(a = '\u2345'*10; 'x' in a)


it runs smoothly.

but if I run the same task with Py3.3

my window seems to be idled, and a message like,
Ne répond pas (something like Do no respond)
appeares in the title bar of the window (my application
title + that msg). The cursor get transformed into the
win7 waiting cursor.

The app seems to freeze, but in fact, it is not and
the resulting values are correct.

How do I know this? Very simple, the resulting
values are in exact concordance with the values
I obtain with my interactive intepreters, but
built with tkinter!

jmf



Have I understood this correctly?  Your users are using a GUI that 
you've designed and implemented, they type in 10 identical 
characters and then search linearly for a single character that they 
know can't possibly be found, and then they are complaining that their 
systems are too slow, yes?


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-17 Thread wxjmfauth
Le mardi 17 décembre 2013 19:06:35 UTC+1, Michael Torrie a écrit :
 On 12/17/2013 08:00 AM, Wolfgang Keller wrote:
 
  Python is sooo slow when it waits for the human.
 
  
 
  With Windows systems, I waste something like 90% of my work time waiting
 
  for that system to stop Not Responding.
 
  
 
  And no, it's not a matter of hardware.
 
 
 
 Something is wrong then.  Windows has its issues, and it does slow down
 
 over time as cruft in the system accumulates. And Windows XP is getting
 
 slower and slower due to a bug in the automatic updates service, but in
 
 general, but your experience with Windows is not normal.  I managed
 
 hundreds of Windows workstations in my previous life and I did not see
 
 this occur with any regularity. So something is wrong with your setup.
 
 Maybe its time for a re-install?  Virus or malware?  Or maybe you need
 
 to upgrade to Windows 7?



I tend to agree with you. However, I should say
I'm observing a strange phenomenon.

Among others, I wrote two interactive interpreters
with PySide 1.1.2 for Python 3.3 and Python 3.2.

If I'm runing such a task with Py3.2 (more than a minute)

 timeit.timeit(a = '\u2345'*10; 'x' in a)

it runs smoothly.

but if I run the same task with Py3.3

my window seems to be idled, and a message like,
Ne répond pas (something like Do no respond)
appeares in the title bar of the window (my application
title + that msg). The cursor get transformed into the
win7 waiting cursor.

The app seems to freeze, but in fact, it is not and
the resulting values are correct.

How do I know this? Very simple, the resulting
values are in exact concordance with the values
I obtain with my interactive intepreters, but
built with tkinter!

jmf

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Jeremy Sanders
Michael Torrie wrote:

 I think PyQt is slowly being pushed aside in favor of PySide, which is
 more license-friendly for use in closed or open projects.  I would
 recommend using PySide unless PyQt is a requirement for your project.

That's not the impression I get from the PySide mailing lists. Work seems 
slow now everyone is a volunteer. For example, Qt 5 is not yet supported 
(there's no effort towards this according to the mailing list) and bugs seem 
to take a long time to be fixed. PyQt support is much better, even when I'm 
using it for a free project.

Jeremy



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Mark Lawrence

On 16/12/2013 05:08, Chris Angelico wrote:

On Mon, Dec 16, 2013 at 3:51 PM, Michael Torrie torr...@gmail.com wrote:

I think Python is a great overall application development language,
especially for the GUI.  First-class functions for callbacks make it
very nice compared to other languages.  Python  is fast enough for
full-blown apps too.  Slow parts can be factored out to other languages.


Python is sooo slow when it waits for the human. That pesky
input() function can take *minutes* to return. It's terrible! Factor
that out and your job's done.



I've done the latter, but still can't fit all the data for my 100+ 
screens into a one liner, help please :)


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Chris Angelico
On Mon, Dec 16, 2013 at 8:42 PM, Mark Lawrence breamore...@yahoo.co.uk wrote:
 I've done the latter, but still can't fit all the data for my 100+ screens
 into a one liner, help please :)

With 100 screens, you should be able to use lines of text up to 8000
characters long - just make sure your screens are organized
horizontally. Shorten all variable names to a single letter, omit all
unnecessary spaces, and you should be able to fit the code within that
space.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Mark Lawrence

On 16/12/2013 11:58, Chris Angelico wrote:

On Mon, Dec 16, 2013 at 8:42 PM, Mark Lawrence breamore...@yahoo.co.uk wrote:

I've done the latter, but still can't fit all the data for my 100+ screens
into a one liner, help please :)


With 100 screens, you should be able to use lines of text up to 8000
characters long - just make sure your screens are organized
horizontally. Shorten all variable names to a single letter, omit all
unnecessary spaces, and you should be able to fit the code within that
space.

ChrisA



Thanks for this extremely useful advice, it's much appreciated :)

--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Kevin Walzer

On 12/15/13, 5:06 PM, Chris Angelico wrote:


Yeah, but there's a difference between passing your GUI incantations
on to a library function (written in C but now just part of a binary
library) and feeding them to a completely different language
interpreter. When I write something with PyGTK, I can't, even in
theory, give it arbitrary C code to execute. From what I understand
here, that *is* true of Tcl, which means that the Python download
contains a Python interpreter and a Tcl interpreter. I'm not saying
that's a bad thing to do, but it is calculated to provoke remark.


Yes, a Tkinter app has both a Python interpreter and an underlying Tcl 
interpreter. Let's be clear about that.


The technical reason for this is that, during Python's early 
development, Tk was the simplest, most powerful and OSS-friendly GUI 
toolkit out there (compared to, let's say, Motif). Its reliance on Tcl 
was a plus because Tcl's C API is exceptionally clean and easy to 
embed/call from other C libraries (that was Tcl's original main focus, 
embedding in C).


Embedding the Tcl interpreter remains a sound decision today. It makes 
it trivial to keep Tkinter updated in sync with Tk updates, since the 
Tcl interpreter does most of the heavy lifting. The recent effort to 
wrap Tk's new themed widgets is a good one: nearly all of the work was 
done at the Python level. Compare this approach to Perl's original one, 
which stripped out Tcl and implemented Tk integration entirely in C. Any 
updates require heavy lifting in C and, in fact, Perl/Tk has not kept up 
with Tk's main line of development (it does not run natively on the Mac, 
for instance).


Calling through Tkinter to Tcl also provides some other conveniences. If 
you're writing a Tkinter app and want to access some platform-specific 
functionality that requires C calls, that may require a library 
extension written against Tcl/Tk's C API (i.e. the Mac's NSServices 
API--that can't be accessed using ctypes because it hooks into the 
window server). Fortunately, Tk is very easy to extend in C--much 
simpler than extending wxWidgets or Qt.


Finally, Tcl is itself a fully-featured, general programming language 
that is a peer to Python both generationally and in terms of its 
capabilities; the main way it lags is in the size of its development 
community. In other words, you are not handing the ball off to a 
90-pound weakling if you need to call into Tcl from Python via Tkinter. ;-)


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Chris Angelico
On Tue, Dec 17, 2013 at 1:55 AM, Kevin Walzer k...@codebykevin.com wrote:
 Finally, Tcl is itself a fully-featured, general programming language that
 is a peer to Python both generationally and in terms of its capabilities;
 the main way it lags is in the size of its development community. In other
 words, you are not handing the ball off to a 90-pound weakling if you need
 to call into Tcl from Python via Tkinter. ;-)

Having made a tweak to gitk at one point, I have to say Tcl is
definitely inferior to Python. I'd much rather work with Python
itself. :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Kevin Walzer

On 12/16/13, 10:20 AM, Chris Angelico wrote:

Having made a tweak to gitk at one point, I have to say Tcl is
definitely inferior to Python.


Without starting a flame war, can you elaborate? I'm curious about your 
perspective.


(I studied PSL--Python as a Second Language--so develop in it with a 
slight accent. I'm a native Tcl developer, for better or worse.)


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Chris Angelico
On Tue, Dec 17, 2013 at 2:32 AM, Kevin Walzer k...@codebykevin.com wrote:
 On 12/16/13, 10:20 AM, Chris Angelico wrote:

 Having made a tweak to gitk at one point, I have to say Tcl is
 definitely inferior to Python.


 Without starting a flame war, can you elaborate? I'm curious about your
 perspective.

 (I studied PSL--Python as a Second Language--so develop in it with a slight
 accent. I'm a native Tcl developer, for better or worse.)

Here's the Tcl procedure that I tweaked. This is from gitk; I find the
word diff not all that useful, but a character diff at times is very
useful. I haven't found a way to configure the word diff regex through
gitk's options, so I tweaked it in the source code.

proc getblobdiffs {ids} {
global blobdifffd diffids env
global diffinhdr treediffs
global diffcontext
global ignorespace
global worddiff
global limitdiffs vfilelimit curview
global diffencoding targetline diffnparents
global git_version currdiffsubmod

set textconv {}
if {[package vcompare $git_version 1.6.1] = 0} {
set textconv --textconv
}
set submodule {}
if {[package vcompare $git_version 1.6.6] = 0} {
set submodule --submodule
}
set cmd [diffcmd $ids -p $textconv $submodule  -C --cc
--no-commit-id -U$diffcontext]
if {$ignorespace} {
append cmd  -w
}
if {$worddiff ne [mc Line diff]} {
append cmd  --word-diff=porcelain --word-diff-regex=.
}
if {$limitdiffs  $vfilelimit($curview) ne {}} {
set cmd [concat $cmd -- $vfilelimit($curview)]
}
if {[catch {set bdf [open $cmd r]} err]} {
error_popup [mc Error getting diffs: %s $err]
return
}
set targetline {}
set diffnparents 0
set diffinhdr 0
set diffencoding [get_path_encoding {}]
fconfigure $bdf -blocking 0 -encoding binary -eofchar {}
set blobdifffd($ids) $bdf
set currdiffsubmod 
filerun $bdf [list getblobdiffline $bdf $diffids]
}

First off, everything's done with commands, rather than assignment
(set diffinhdr 0), which is very shell-style and not very
programming-style. Can live with that, though even shells can use
equals signs for simplicity. Similarly, the shell style of adorning
variable usage feels messy. There are string literals, some of which
contain interpolated variables; there are dollar-sign adorned
variables; and then there are other words. What are the other words?
Are they implicit strings (as they would be in, say, bash)? I've never
really liked that style. Anyway. Can get past that.

Secondly, what does this do?
if {$worddiff ne [mc Line diff]}

I *think* it means 'if $worddiff is not equal to Line diff (this
code is executed for the options Markup words and Color words, but
what's the mc do? How am I supposed to figure out what it does? Where
do I begin to look?

This is where, IMO, Python tends to be a lot clearer. It's easy to see
what's an object and what's a method on it, and every bare word is
either a local name or a standard built-in name. I'm sure Tcl's a
great language, but I'd rather not have to drop out of Python into it
if I can help it. :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread 88888 Dihedral
On Saturday, December 14, 2013 8:12:16 PM UTC+8, Jai wrote:
 GUI:-want to learn GUI programming in python  , how should i proceed.
 
 
 
 There are lots of book here so I am  confuse which book  i should refer so 
 that i don't waste time . please answer

Please check JYTHON and those 
ready-for-novice GUI tools in java.

Python is a higher level language 
that can support manny lower 
level languages.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Grant Edwards
On 2013-12-16, Chris Angelico ros...@gmail.com wrote:
 On Tue, Dec 17, 2013 at 2:32 AM, Kevin Walzer k...@codebykevin.com wrote:
 On 12/16/13, 10:20 AM, Chris Angelico wrote:

 Having made a tweak to gitk at one point, I have to say Tcl is
 definitely inferior to Python.


 Without starting a flame war, can you elaborate? I'm curious about your
 perspective.

I wrote a few Tcl apps once many, many years ago.  After attempting to
write something more than a few hundred lines long, I gave up and
swore off Tcl completely.  I switched to Scheme, and later to Python.

The things I found infuriating about Tcl:

  * The everything is a string view of the world is severly
limiting if you're not just processing strings.

  * The quoting syntax and semantics appears to have been invented by
somebody at the CIA as a way to torture programmers into doing...
something... I don't know what.

  * Tcl doesn't seem to have any sort of coherent design or philosophy
behind it but rather consists of a bunch of hacks piled on top of
a simple and limited shell-like string processing language.  It
sort of feels like PHP in that regard.

When I finally gave up fighting with Tcl's quoting semantics half way
through a medium/small application and switched to Scheme/Tk, I had my
app written from scratch in a fraction of the time it took to get
about half way done in Tcl, and with about 1/3 the lines of code.

Python probably would have cut both hours and lines by half again
compared to Scheme.

-- 
Grant Edwards   grant.b.edwardsYow! I'd like some JUNK
  at   FOOD ... and then I want to
  gmail.combe ALONE --
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Chris Angelico
On Tue, Dec 17, 2013 at 3:46 AM, Grant Edwards invalid@invalid.invalid wrote:
   * The everything is a string view of the world is severly
 limiting if you're not just processing strings.

I wasn't sure if that was the case, from what I was seeing. Are there
any aggregate types at all?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Grant Edwards
On 2013-12-16, Chris Angelico ros...@gmail.com wrote:
 On Tue, Dec 17, 2013 at 3:46 AM, Grant Edwards invalid@invalid.invalid 
 wrote:
   * The everything is a string view of the world is severly
 limiting if you're not just processing strings.

 I wasn't sure if that was the case, from what I was seeing. Are there
 any aggregate types at all?

There are arrays with string keys (similar to Python dictionaries).

-- 
Grant Edwards   grant.b.edwardsYow! hubub, hubub, HUBUB,
  at   hubub, hubub, hubub, HUBUB,
  gmail.comhubub, hubub, hubub.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Christian Gollwitzer

Let the flame war begin!
Am 16.12.13 17:10, schrieb Chris Angelico:

Here's the Tcl procedure that I tweaked. This is from gitk; I find the
word diff not all that useful, but a character diff at times is very
useful. I haven't found a way to configure the word diff regex through
gitk's options, so I tweaked it in the source code.

proc getblobdiffs {ids} {
 global blobdifffd diffids env
 global diffinhdr treediffs
 global diffcontext
 global ignorespace
 global worddiff
 global limitdiffs vfilelimit curview
 global diffencoding targetline diffnparents
 global git_version currdiffsubmod
.


 }

I'm a long time Tcl developer who has just picked up Python recently; so 
my view is tinted from the other side.


First off, gitk is a huge unstructured mess. You are not obliged to 
write programs like this in Tcl, at least not today. All these global 
statements give already a hint, that this is a procedural thing. Think 
of Python, where classes are stripped. Tcl has object oriented 
frameworks for years. If you use Snit, e.g., all those globals are not 
needed because they are really instance variables.



First off, everything's done with commands, rather than assignment
(set diffinhdr 0), which is very shell-style and not very
programming-style.


This is just syntax and purely a matter of taste.


Can live with that, though even shells can use
equals signs for simplicity. Similarly, the shell style of adorning
variable usage feels messy. There are string literals, some of which
contain interpolated variables; there are dollar-sign adorned
variables; and then there are other words. What are the other words?
Are they implicit strings (as they would be in, say, bash)?


Yes, they are, and it doesn't feel strange if you are used to it. Tcl's 
syntax rules are very compact. Tclers see this as an advantage.



Secondly, what does this do?
 if {$worddiff ne [mc Line diff]}

I *think* it means 'if $worddiff is not equal to Line diff (this
code is executed for the options Markup words and Color words, but
what's the mc do?


It does command substitution (indeed the brackets [] do) and is one of 
the key concepts of Tcl. mc is probably the command from msgcat which 
translates i18n strings. Complaining about these basic things is like 
complaining about indentation in Python.



This is where, IMO, Python tends to be a lot clearer. It's easy to see
what's an object and what's a method on it, and every bare word is
either a local name or a standard built-in name. I'm sure Tcl's a
great language, but I'd rather not have to drop out of Python into it
if I can help it. :)


Python has some advantages over Tcl. To name a few, references, list 
comprehensions, real classes, clean module support, extensive extensions 
such as matplotlib/scipy. But Tcl also has some strengths.


First off, the syntax is quite flexible, and so things like list 
comprehensions[1] or classes[2] can be implemented in Tcl itself. 
Second, it's great at interactive use because at a command prompt, you 
don't want to type all those () call operators, quotes and obey 
indentation just to get a simple loop running. Third, its implementation 
features a few unique things:


* Stubs. Compile a C extension against 8.1 and load it into 8.6. This 
actually works. 8.1 was nearly 15 years ago!


* Safe interpreters. Sometimes requested here for Python, you can create 
a slave interpreter in Tcl that is restricted and cannot do disk I/O, 
has limited execution time etc. You can precisely control which commands 
are passed on to the slave.


* Interpreters in threads. There is no GIL, Tcl interpreters are thread 
safe and more than one can coexist in a process and run concurrently. 
This is accessible from script level through the Threads package.


* Very easy deployment: Starkits/Tclkits bundle an interpreter within a 
single executable. Similar to what pyinstaller does. But in my 
experience, it's much easier to pack all dependencies into a starkit 
than it is with pyinstaller. You can get a rather full-fledged 
interpreter with GUI support into a few megabytes, and I've never seen 
it fail.


Happy flaming,

Christian

[1] http://wiki.tcl.tk/12574
[2] http://wiki.tcl.tk/3963

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Christian Gollwitzer

Am 16.12.13 18:04, schrieb Grant Edwards:

On 2013-12-16, Chris Angelico ros...@gmail.com wrote:

On Tue, Dec 17, 2013 at 3:46 AM, Grant Edwards invalid@invalid.invalid wrote:

   * The everything is a string view of the world is severly
 limiting if you're not just processing strings.


I wasn't sure if that was the case, from what I was seeing. Are there
any aggregate types at all?


There are arrays with string keys (similar to Python dictionaries).


Aggregate types are indeed a weak point, but still there are lists 
(since ever) and dicts (since 8.5, ~6 years) with value semantics. 
Arrays are distinct from dicts and provide no value semantics, i.e. you 
cannot pass them around. Today these issues are overcome by using dicts 
or some OO framework.


Christian



--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Chris Angelico
On Tue, Dec 17, 2013 at 9:06 AM, Christian Gollwitzer aurio...@gmx.de wrote:
 Let the flame war begin!

I'll try to avoid flamage :)

 First off, gitk is a huge unstructured mess. You are not obliged to write
 programs like this in Tcl, at least not today. All these global statements
 give already a hint, that this is a procedural thing. Think of Python, where
 classes are stripped. Tcl has object oriented frameworks for years. If you
 use Snit, e.g., all those globals are not needed because they are really
 instance variables.

Ah, okay. Don't take gitk as representative. Got it. Unfortunately
there are quite a few languages that I've experienced from, really,
only one program that I've tried to modify (Scheme almost falls in
that category too - all I've ever used it for is LilyPond scripting,
and not much of that), and I'm aware that's not really a fair look at
the language.

 First off, everything's done with commands, rather than assignment
 (set diffinhdr 0), which is very shell-style and not very
 programming-style.

 This is just syntax and purely a matter of taste.

Yeah. Like I said,

 Can live with that

. But my rule of thumb with bash scripts is: If it exceeds a page or
two in length, it's probably time it got rewritten in an application
language. When a program is the size of gitk (10KLOC), the benefits
relating to interactive use (as you mention below) become less
significant, and benefits relating to discoverability of the more
obscure features become more significant.

 It does command substitution (indeed the brackets [] do) and is one of the
 key concepts of Tcl. mc is probably the command from msgcat which translates
 i18n strings. Complaining about these basic things is like complaining about
 indentation in Python.

Okay. Now, how am I to figure out where this command comes from? It's
not a host command (typing mc at the bash prompt comes up failure),
and it's not defined in the script itself (at least, I can't find
proc mc anywhere); is it a Tcl built-in? Where do I start looking?

(Yes, I'm aware this is a problem in any language. I'm not now raising
a point in the Python vs Tcl debate, I'm just asking out of
curiosity.)

 Tcl also has some strengths.

 First off, the syntax is quite flexible, and so things like list
 comprehensions[1] or classes[2] can be implemented in Tcl itself. Second,
 it's great at interactive use because at a command prompt, you don't want to
 type all those () call operators, quotes and obey indentation just to get
 a simple loop running. Third, its implementation features a few unique
 things:

Yeah, that's nice for the interactive interpreter... but I already
have bash for that, and Python's not far off. I've used interactive
Pike and REXX interpreters, which are both more demanding than Python
(in terms of syntax requirements and such), so I'm perfectly happy
with Python; but if you're used to something even lighter, then sure,
use something that lets you type almost nothing. No problem. I just
think that - as mentioned above - a ten thousand line program should
be aiming more at maintainability than ease of manual typing.

 * Safe interpreters. Sometimes requested here for Python, you can create a
 slave interpreter in Tcl that is restricted and cannot do disk I/O, has
 limited execution time etc. You can precisely control which commands are
 passed on to the slave.

Cool. Not enough for me to choose the language unless I really REALLY
needed that feature, but there was one time in my programming career
when that was true, so we'll count that a win.

 * Interpreters in threads. There is no GIL, Tcl interpreters are thread safe
 and more than one can coexist in a process and run concurrently. This is
 accessible from script level through the Threads package.

Nice, though Python's threading and/or multiprocessing can do 90% of
what people want. Side point: What about Tk? Can you (a) run separate
GUI threads for separate windows? (b) manipulate widgets created by
another thread?

 * Very easy deployment: Starkits/Tclkits bundle an interpreter within a
 single executable. Similar to what pyinstaller does. But in my experience,
 it's much easier to pack all dependencies into a starkit than it is with
 pyinstaller. You can get a rather full-fledged interpreter with GUI support
 into a few megabytes, and I've never seen it fail.

Never really needed this, but for the people who do, I'm sure that's a
fairly big deal.

So there definitely are some advantages that Tcl has over Python. Put
against them is a superior object model, a large corpus of first-class
object types (dict, set, list, etc[1]), and a syntax that more clearly
differentiates names and strings without making variable references
look like a lot more than they are.

Huge room in the world for both languages to exist and thrive.

ChrisA

[1] What is an etc() in Python?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Gregory Ewing

Grant Edwards wrote:

On 2013-12-16, Chris Angelico ros...@gmail.com wrote:


Are there
any aggregate types at all?


There are arrays with string keys (similar to Python dictionaries).


Well... sort of. They can only hold strings, not other arrays.
They're not first-class entities: you can't pass them around
or keep them in local variables; they're always global. (And
there are no modules, so global is *truly* global.)

In short, they're a very poor substitute for having real data
structures.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Terry Reedy

On 12/16/2013 5:40 PM, Chris Angelico wrote:


Nice, though Python's threading and/or multiprocessing can do 90% of
what people want. Side point: What about Tk? Can you (a) run separate
GUI threads for separate windows? (b) manipulate widgets created by
another thread?


When running tk via tkinter, limiting tkinter/tk calls to the main 
thread is the safest thing to do. I do not know whether the problems 
people have had doing otherwise are due to Python or inherent in tk itself.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Mark Lawrence

On 16/12/2013 22:06, Christian Gollwitzer wrote:

Let the flame war begin!



Surely proper flame wars should have inflammatory titles like this 
https://archive.org/details/SeanKellyRecoveryfromAddiction ?


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Grant Edwards
On 2013-12-16, Gregory Ewing greg.ew...@canterbury.ac.nz wrote:
 Grant Edwards wrote:
 On 2013-12-16, Chris Angelico ros...@gmail.com wrote:
 
 Are there
 any aggregate types at all?
 
 There are arrays with string keys (similar to Python dictionaries).

 Well... sort of. They can only hold strings, not other arrays.
 They're not first-class entities: you can't pass them around
 or keep them in local variables; they're always global. (And
 there are no modules, so global is *truly* global.)

It's worse that I remembered -- I must have repressed most of
my Tcl memories.

 In short, they're a very poor substitute for having real data
 structures.

-- 
Grant

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Rick Johnson
On Sunday, December 15, 2013 11:01:53 AM UTC-6, Steven D'Aprano wrote:
 On Sun, 15 Dec 2013 14:53:45 +, Grant Edwards wrote:
  On 2013-12-14, Steven D'Aprano wrote:
 
  You seem to be equating was compiled from with includes an
  implemenation of.  Do you say that CPython ships with C?

 Well, when you take my comments out of their context, that
 does seem to be a totally stupid thing to say. But in
 context, it's only *mostly* stupid, and mostly stupid
 means a little bit sensible *wink* The context was a
 complaint, or at least expression of surprise, that Python
 use Tcl for a GUI, this being contrasted with
 (paraphrasing the legions of people who have expressed
 surprise about this in the past) some hypothetical GUI
 written in Python. But in practice, it won't be written
 in Python, it will be likely written in C or some other
 low-level language with some interface to Python. The main
 difference between this hypothetical Python GUI and Tcl
 is that Tcl is a Turing-complete interpreter which lives
 in it's own process.

And how many times would you take advantage of that turning
complete functionality in reality? My answer... ZERO! How
many Tcl calls have you, or anybody, made that did have
direct business with creating or managing a TK gui? HOW
MANY???

We don't need that functionality, we ALREADY have a
language... it's called Python and the syntax is MUCH
better. All we want is a damn GUI.

And trying to justify TCL as legit because Tcl just calls C
routines is ludicrous. If the intention is to extend C
routines, then by gawd EXTEND them. Don't go writing a whole
new turning complete monstrosity and forcing all calls to
travel through it's front door, sit in waiting room until
it's eyes bleed, before finally exiting out the back door on
it's way to Cees-ville.

Why should i give a damn about Tcl? All it does is get in my
way. OTOH, if Tcl where more like a Vegas Casino for high
rollers, i might be inclined to overlook the superfluous
pit-stop. A free luxury room , free all you can eat buffet,
free call girls, etc... but it has no endearing qualities.


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Chris Angelico
On Tue, Dec 17, 2013 at 4:37 PM, Rick Johnson
rantingrickjohn...@gmail.com wrote:
 We don't need that functionality, we ALREADY have a
 language... it's called Python and the syntax is MUCH
 better. All we want is a damn GUI.

 And trying to justify TCL as legit because Tcl just calls C
 routines is ludicrous.

Python already ships with another language interpreter - actually,
several wrapped up into one. It's called the pickle module. There's
nothing fundamentally wrong with calling on another language; I was
just curious about it, is all.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Mark Lawrence

On 17/12/2013 05:37, Rick Johnson wrote:


We don't need that functionality, we ALREADY have a
language... it's called Python and the syntax is MUCH
better. All we want is a damn GUI.



Then write it, dear Rick, dear Rick, dear Rick, then write it, dear 
Rick, dear Rick, write it.


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Grant Edwards
On 2013-12-14, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:

 But more seriously, 100% seriously in fact, I think that you'll find that 
 *every* GUI framework for Python ships with an entirely different 
 language under the hood, usually C.

Name one GUI framework that ships with a C implementation.

 Even if the top level of the framework is written in Python, the
 underlying graphics routines used for drawing controls and windows
 will surely not be.

You seem to be equating was compiled from with includes an
implemenation of.  Do you say that CPython ships with C?

-- 
Grant
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Wolfgang Keller
 I think PyQt is slowly being pushed aside in favor of PySide, which is
 more license-friendly for use in closed or open projects.  I would
 recommend using PySide unless PyQt is a requirement for your project.

Except the issue that Pyside always seems to lag a bit behind Qt
releases, while PyQt usually supports more recent releases of Qt.

Besides that, according to what I've been reading on the PyQt mailing
list, support is impressive. The developer often fixes issues over
night, if there actually are any. And besides, again, a commercially
licensed PyQt itself isn't *that* expensive.

Sincerely,

Wolfgang
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Steven D'Aprano
On Sun, 15 Dec 2013 14:53:45 +, Grant Edwards wrote:

 On 2013-12-14, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info
 wrote:
 
 But more seriously, 100% seriously in fact, I think that you'll find
 that *every* GUI framework for Python ships with an entirely different
 language under the hood, usually C.
 
 Name one GUI framework that ships with a C implementation.

Er, all of them? I daresay that Tcl itself eventually calls graphics 
routines written in C. There's not that many languages that commonly get 
used for low-level graphics routines, but C is one of them.

If you mean, ships with a C *compiler*, or even a C interpreter, then no, 
probably not. But it wouldn't surprise me if some of those GUI frameworks 
are powerful enough to count as mini-languages in their own right.


 Even if the top level of the framework is written in Python, the
 underlying graphics routines used for drawing controls and windows will
 surely not be.
 
 You seem to be equating was compiled from with includes an
 implemenation of.  Do you say that CPython ships with C?

Well, when you take my comments out of their context, that does seem to 
be a totally stupid thing to say. But in context, it's only *mostly* 
stupid, and mostly stupid means a little bit sensible *wink*

The context was a complaint, or at least expression of surprise, that 
Python use Tcl for a GUI, this being contrasted with (paraphrasing the 
legions of people who have expressed surprise about this in the past) 
some hypothetical GUI written in Python. But in practice, it won't be 
written in Python, it will be likely written in C or some other low-level 
language with some interface to Python. The main difference between this 
hypothetical Python GUI and Tcl is that Tcl is a Turing-complete 
interpreter which lives in it's own process. 

[Aside: I wonder how many other GUI toolkits are Turing complete?]

As I stated earlier, this is just the Interpreter design pattern, with 
the minor complication that the domain specific language happens to be an 
existing language, Tcl, with an interpreter that usually runs in a 
separate process, instead of some mini-language running inside Python.

So I don't see anything surprising about Tkinter (or for that matter, 
Ruby and it's bindings to Tcl/Tk). Maybe it's because I'm used to Unix/
Linux systems, where it is common for tools that execute in one 
interpreter to call other tools which execute in a different interpreter. 
E.g. a shell script which calls a Ruby script which calls some command 
which happens to be written in Python. Python, after all, was originally 
invented to be a glue language, and I don't really see anything weird 
about Python delegating work to Tcl any more than I see anything strange 
about IronPython delegating work to the .Net runtime.



-- 
Steven
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Michael Torrie
On 12/15/2013 08:33 AM, Wolfgang Keller wrote:
 I think PyQt is slowly being pushed aside in favor of PySide, which is
 more license-friendly for use in closed or open projects.  I would
 recommend using PySide unless PyQt is a requirement for your project.
 
 Except the issue that Pyside always seems to lag a bit behind Qt
 releases, while PyQt usually supports more recent releases of Qt.

Which is a bit odd, seeing as Pyside is an official Qt project.  It was
started by Nokia when they owned Qt, and now is hosted at the official
Qt web site.

 Besides that, according to what I've been reading on the PyQt mailing
 list, support is impressive. The developer often fixes issues over
 night, if there actually are any. And besides, again, a commercially
 licensed PyQt itself isn't *that* expensive.

That's good to know.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Chris “Kwpolska” Warrick
On Sun, Dec 15, 2013 at 4:33 PM, Wolfgang Keller felip...@gmx.net wrote:
 And besides, again, a commercially licensed PyQt itself isn't *that*
 expensive.

 The cost of a commercial PyQt license for a single developer is £350
 (GBP). You may pay in either US Dollars, Euros or GBP.

(£420 incl. VAT for UK and select EU entities)

 one [license] per developer

For some people, it might be a lot.  Why waste money on something,
that has an almost-identical free-for-everyone version? (which also is
easier to install, BTW)

 PyQt does not include Qt itself. You must also obtain an
 appropriately licensed copy (either the commercial version from
 Digia or the LGPL version from the Qt Project).

So, you have four options:

a) use PySide and Qt@Project, pay $0 and be sane (albeit saner than
   person B);
b) use PyQt4 and Qt@Digia, pay £350/£420 + £??? and be sane;
c) use PySide and Qt@Digia, pay £??? and look like a hypocrite (albeit
   less than person D);
d) use PyQt4 and Qt@Project, pay £350/£420 and look like a hypocrite.

DISCLAIMER: Some things are based on assumptions, many of which may be
incorrect.

PS. For those living in the past without proper Unicode support: £ = GBP.

-- 
Chris “Kwpolska” Warrick http://kwpolska.tk
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Mark Lawrence

On 15/12/2013 17:52, Chris “Kwpolska” Warrick wrote:

On Sun, Dec 15, 2013 at 4:33 PM, Wolfgang Keller felip...@gmx.net wrote:

And besides, again, a commercially licensed PyQt itself isn't *that*
expensive.



The cost of a commercial PyQt license for a single developer is £350
(GBP). You may pay in either US Dollars, Euros or GBP.


(£420 incl. VAT for UK and select EU entities)


Four weeks income, no thanks :(




one [license] per developer


For some people, it might be a lot.  Why waste money on something,
that has an almost-identical free-for-everyone version? (which also is
easier to install, BTW)


PyQt does not include Qt itself. You must also obtain an
appropriately licensed copy (either the commercial version from
Digia or the LGPL version from the Qt Project).


So, you have four options:

a) use PySide and Qt@Project, pay $0 and be sane (albeit saner than
person B);
b) use PyQt4 and Qt@Digia, pay £350/£420 + £??? and be sane;
c) use PySide and Qt@Digia, pay £??? and look like a hypocrite (albeit
less than person D);
d) use PyQt4 and Qt@Project, pay £350/£420 and look like a hypocrite.

DISCLAIMER: Some things are based on assumptions, many of which may be
 incorrect.

PS. For those living in the past without proper Unicode support: £ = GBP.



Thanks for making my day, I've roared with laughter at the PS.

--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 4:01 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
 As I stated earlier, this is just the Interpreter design pattern, with
 the minor complication that the domain specific language happens to be an
 existing language, Tcl, with an interpreter that usually runs in a
 separate process, instead of some mini-language running inside Python.

Yeah, but there's a difference between passing your GUI incantations
on to a library function (written in C but now just part of a binary
library) and feeding them to a completely different language
interpreter. When I write something with PyGTK, I can't, even in
theory, give it arbitrary C code to execute. From what I understand
here, that *is* true of Tcl, which means that the Python download
contains a Python interpreter and a Tcl interpreter. I'm not saying
that's a bad thing to do, but it is calculated to provoke remark.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Tamer Higazi

For wxPython there is a good book.
You will feel convinient.


But to be honest, I don't believe that Python is the best choice for GUI 
development, but it's only an opinion.

Otherwise I would advise you going into C++ and code with wxWidgets.


Tamer


On 14.12.2013 14:12, Jai wrote:

GUI:-want to learn GUI programming in python  , how should i proceed.

There are lots of book here so I am  confuse which book  i should refer so that 
i don't waste time . please answer


--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Mark Lawrence

On 16/12/2013 00:34, Tamer Higazi wrote:


But to be honest, I don't believe that Python is the best choice for GUI
development, but it's only an opinion.
Otherwise I would advise you going into C++ and code with wxWidgets.

Tamer



Can you state why you prefer C++ and wxWidgets over Python and wxPython, 
which wraps wxWidgets?


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Tamer Higazi

Hi Mark!

It is an advise, in which language somebody wants to code is of course 
everybodys free choice.


However, I believe according wxWidgets it would be better coding in the 
native language the system had been developed.
The other thing, specially if you would make a customer project, I don't 
know how to pack the app written in python in an installer. Perhaps I am 
wrong, and you could give me in exchange an advise ?!


I also believe in performance. An application written in C++, can be 
compiled easily on the target platform (like on windows systems) with 
it's native compiler.

How would it be with wxPython ?!


Thanks for your response



Tamer

On 16.12.2013 03:18, Mark Lawrence wrote:

On 16/12/2013 00:34, Tamer Higazi wrote:


But to be honest, I don't believe that Python is the best choice for GUI
development, but it's only an opinion.
Otherwise I would advise you going into C++ and code with wxWidgets.

Tamer



Can you state why you prefer C++ and wxWidgets over Python and 
wxPython, which wraps wxWidgets?




--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Michael Torrie
On 12/15/2013 05:34 PM, Tamer Higazi wrote:
 For wxPython there is a good book.
 You will feel convinient.
 
 
 But to be honest, I don't believe that Python is the best choice for GUI 
 development, but it's only an opinion.
 Otherwise I would advise you going into C++ and code with wxWidgets.

Perhaps this is because the wx binding in Python is too C++-like and
lacks python concepts and idioms?  Or are you saying Python in general
is not a good language for GUI development?

GUI design is moving firmly into the realm of interpreted or
non-compiled languages, with compiled languages often doing the real
back end work.  For example Firefox implements its entire GUI in
Javascript using XML GUI definitions.  This all drives a C-based
rendering engine.  Also Qt 5 emphasizes developing GUIs using QtQuick,
which is also Javascript-based with XML and CSS for styling.  And all
modern web apps are a combination of many languages and domains, most of
which are compiled in the traditional sense.

I think Python is a great overall application development language,
especially for the GUI.  First-class functions for callbacks make it
very nice compared to other languages.  Python  is fast enough for
full-blown apps too.  Slow parts can be factored out to other languages.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Michael Torrie
On 12/15/2013 09:09 PM, Tamer Higazi wrote:
 However, I believe according wxWidgets it would be better coding in the 
 native language the system had been developed.
 The other thing, specially if you would make a customer project, I don't 
 know how to pack the app written in python in an installer. Perhaps I am 
 wrong, and you could give me in exchange an advise ?!

Nonsense.  That's what an installer on windows is for, or what a package
on Linux is for.  There are also ways to bundle up everything you need
to run a Python app in a single exe file.

Ever take a look at the e-book manager, Calibre?  It's 90% Python.  You
can install it on Windows like any other app.  If you're curious as to
how they do things, you can always contact their developers.

 I also believe in performance. An application written in C++, can be 
 compiled easily on the target platform (like on windows systems) with 
 it's native compiler.
 How would it be with wxPython ?!

It would probably perform just fine.  Anything that can't get enough
speed to run in Python can easily be delegated to native libraries or
subroutines.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Michael Torrie
On 12/15/2013 09:51 PM, Michael Torrie wrote:
 And all modern web apps are a combination of many languages and
 domains, most of which are compiled in the traditional sense.

Meant to say, *not* compiled.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 3:09 PM, Tamer Higazi tamerito...@arcor.de wrote:
 I also believe in performance. An application written in C++, can be
 compiled easily on the target platform (like on windows systems) with it's
 native compiler.
 How would it be with wxPython ?!

It's going to spend more than 99% of its time waiting for the user.
Most applications aren't performance-bound. Over the past few years, I
can think of *one* case when my GUI program was actually saturating a
CPU core and I had to dig into a performance fault; the simplistic
design had meant that it would iterate over an entire list of strings
to find which ones it needed to draw, and once that list got huge, the
redraw operation started taking time. But there was no visible problem
except when the app was redrawing itself many times a second in
response to user action AND the set of strings got, as I said, huge.
Every other part of that program, and all of every other GUI
interactive program I've written in recent years, has been coded for
simplicity and not for performance. (This particular example is
actually quite pertinent, as it's the designated replacement for a
very similar program written in C++. The C++ one has a tendency to
crash hard if user code does the wrong thing, as there is absolutely
no protection anywhere, while the new code will, at very worst, spew a
traceback and then go back to processing events.)

Of course, performance is a relative thing. If you're running on a PC,
there's no difference at all between taking 1ms and taking 2ms - no
human will notice. But if you're running on a server, that's the
difference between 1000tps and 500tps. And on a phone, that CPU usage
might have an impact on battery life, and running on a tiny PCB the
same coding difference might be the difference between 400ms and
800ms. But in the day-to-day realm of desktop apps, maintainable code
will always be better than marginally faster code.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 3:51 PM, Michael Torrie torr...@gmail.com wrote:
 I think Python is a great overall application development language,
 especially for the GUI.  First-class functions for callbacks make it
 very nice compared to other languages.  Python  is fast enough for
 full-blown apps too.  Slow parts can be factored out to other languages.

Python is sooo slow when it waits for the human. That pesky
input() function can take *minutes* to return. It's terrible! Factor
that out and your job's done.

And yeah. First-class functions *rock*. ECMAScript is almost there -
not supremely, perhaps, but oh so all-but! [1] A function can retain
all sorts of state by being a closure, and yet somehow it doesn't
retain the state of which 'this' (in Python terms, 'self') it should
reference. Why? I don't know. But it's part of the spec now, so
callbacks have to take a function and a context.

var func=document.getElementById;
var foo=func(foo); /* Won't work */

function funcgen(obj)
{
return function(desc) {return obj.getElementById(desc);}
}
var func=funcgen(document);
var foo=func(foo); /* Will work! */

In Python, the simple and obvious thing works, because there's less
magic. The incantation obj.member followed by the incantation
callable(args) has exactly the same meaning as obj.method(args).

ChrisA

[1] http://math.boisestate.edu/gas/patience/webop/pat16d.html
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-14 Thread Chris Angelico
On Sat, Dec 14, 2013 at 11:12 PM, Jai jaiprakashsingh...@gmail.com wrote:
 GUI:-want to learn GUI programming in python  , how should i proceed.

 There are lots of book here so I am  confuse which book  i should refer so 
 that i don't waste time . please answer

There are many ways to build a GUI with Python. Some of the more
popular toolkits are Tk (tkinter), wxWidgets (wxpython), and GTK.
Explore those and see which one you like; I personally quite like GTK,
and the others have their fans too. There are GUI builders for each of
the above (I think; definitely wx and GTK do), or you can build
everything directly in code (my preferred style). Play around with it
and see what you like!

As a side point, though: You're using Google Groups to post, which
means your posts look messy, because GG doesn't follow internet
standards. Short of getting into Google and fixing Groups, the best
solution is to avoid using it; you can either use some other
newsreader (several here swear by Mozilla Thunderbird), or subscribe
to the email list, which carries all the same content:

https://mail.python.org/mailman/listinfo/python-list

Either way will spare you and us the hassles of malformed posts.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-14 Thread Jai

thank you sir 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-14 Thread Wolfgang Keller
 GUI:-want to learn GUI programming in python  , how should i proceed.
 
 There are lots of book here so I am  confuse which book  i should
 refer so that i don't waste time .

It depends on what you want to do with the GUI, since there are many
different GUI frameworks for Python.

E.g. If you absolutely need to run your applications on MacOS X, then
PyGTK is probably not the best choice. WingIDE, a popular IDE, has been
recently ported to PyQt, apparently for this reason. Besides, PyGTK
itself seems to be shelved, PyGObject now (since GTK 3) seems to be
the canonical way to implement GTK GUIs in Python.

Tkinter is a bit special to use since it's not just a library, but
uses some kind of RPC. It seems that look and feel have been greatly
improved lately.

wxWidgets (wxPython) recently (since 2.9/3.0) got support for Cocoa,
it's native on the Mac. It's quite slim, but seems to be a moving
target API-wise, since the developers are not shy from breaking
compatibility. Is it compatible with Python 3 yet?

PyQt looks native everywhere, but it might be a bit overweight,
depending on what you want to do and where your applications need to
run.

And then there's the licensing issue, since PyQt, unlike Qt itself, is
not available under LGPL afaik. For closed-source commercial
applications, there seems to be a way to use a commercially licensed
PyQt (much less expensive than Qt itself) together with LGPL-Qt
however. Pyside would be a LGPL alternative to PyQt, but it doesn't
seem to be as up-to-date as PyQt.

And then, there are even more frameworks, such as Pygame, PyGUI, etc

And each of these frameworks has dedicated mailinglists.

Personally I found it difficult to use any of the wrapped C++
frameworks without being able to understand the documentation made
for C++. :-(

Sincerely,

Wolfgang
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-14 Thread rurpy
On 12/14/2013 05:25 AM, Chris Angelico wrote:
 On Sat, Dec 14, 2013 at 11:12 PM, Jai jaiprakashsingh...@gmail.com wrote:
 GUI:-want to learn GUI programming in python  , how should i proceed.

 There are lots of book here so I am  confuse which book  i should refer so 
 that i don't waste time . please answer
 
 There are many ways to build a GUI with Python. Some of the more
 popular toolkits are Tk (tkinter), wxWidgets (wxpython), and GTK.
 Explore those and see which one you like; I personally quite like GTK,
 and the others have their fans too. There are GUI builders for each of
 the above (I think; definitely wx and GTK do), or you can build
 everything directly in code (my preferred style). Play around with it
 and see what you like!

For learning, tkinter is probably the easiest because it comes 
with Python and you don't need to install anything else.  The
best way to get started with it is to search for tutorials and
examples on web.  Searching for python tkinter on Amazon shows
a few books but I don't know anything about them.

wxPython currently runs only with Python2, not Python3.  There
is a drag-and-drop form designer available for it but it is a 
commercial product that costs money.  It also comes with a 
useable (once you get used to it) form builder tool that works
by graphically manipulating a text tree of widgets.

The other big, widely-used GUI toolkit is PyQt.  It runs on 
both Python2 and Python3.  There is another version of it
called PySide which is API compatible with PyQt but has 
different licensing terms.  PyQt comes with a very good 
drag-and-drop form designer.

I have played a little with both wxPython an PyQt and found 
learning to use them from the web difficult because of their 
size and complexity.  But both of them have pretty good books 
about them available:

  Rapid GUI Programming with Python and Qt (Summerfield)

http://www.amazon.com/Programming-Python-Prentice-Software-Development/dp/0132354187

  WxPython in Action (Dunn and Rapin)
http://www.amazon.com/Wxpython-Action-Noel-Rappin/dp/1932394621/

 As a side point, though: You're using Google Groups to post, which
 means your posts look messy, because GG doesn't follow internet
 standards. Short of getting into Google and fixing Groups, the best
 solution is to avoid using it; you can either use some other
 newsreader (several here swear by Mozilla Thunderbird), or subscribe
 to the email list, which carries all the same content:
 
 https://mail.python.org/mailman/listinfo/python-list
 
 Either way will spare you and us the hassles of malformed posts.

Chris and some other people here dislike Google Groups and 
try to imply that everyone here feels the same way.  Not true.

I and many other people here use Google Groups and have been 
doing so for years so if Google Groups works for you, please
feel free to continue using it.  

If you want to reduce the noise level from people like Chris
you might want to take a look at:

  https://wiki.python.org/moin/GoogleGroupsPython


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-14 Thread Mark Lawrence

On 14/12/2013 17:05, Wolfgang Keller wrote:


wxWidgets (wxPython) recently (since 2.9/3.0) got support for Cocoa,
it's native on the Mac. It's quite slim, but seems to be a moving
target API-wise, since the developers are not shy from breaking
compatibility. Is it compatible with Python 3 yet?



This is one of the goals of the so called Phoenix project 
http://wiki.wxpython.org/ProjectPhoenix


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-14 Thread Mark Lawrence

On 14/12/2013 17:42, ru...@yahoo.com wrote:

On 12/14/2013 05:25 AM, Chris Angelico wrote:

wxPython currently runs only with Python2, not Python3.  There
is a drag-and-drop form designer available for it but it is a
commercial product that costs money.  It also comes with a
useable (once you get used to it) form builder tool that works
by graphically manipulating a text tree of widgets.


Development versions which support Python 3 are available here 
http://wxpython.org/Phoenix/snapshot-builds/  Unfortunately they've not 
been updated since 3rd December.  I've asked why and been told that 
Robin Dunn is simply too busy.  There's Open Source for you :)





As a side point, though: You're using Google Groups to post, which
means your posts look messy, because GG doesn't follow internet
standards. Short of getting into Google and fixing Groups, the best
solution is to avoid using it; you can either use some other
newsreader (several here swear by Mozilla Thunderbird), or subscribe
to the email list, which carries all the same content:

https://mail.python.org/mailman/listinfo/python-list

Either way will spare you and us the hassles of malformed posts.


Chris and some other people here dislike Google Groups and
try to imply that everyone here feels the same way.  Not true.

I and many other people here use Google Groups and have been
doing so for years so if Google Groups works for you, please
feel free to continue using it.

If you want to reduce the noise level from people like Chris
you might want to take a look at:

   https://wiki.python.org/moin/GoogleGroupsPython



Of course I dislike Google Groups, users keep sending double spaced crap 
which I don't want to see.  There is no noise level from people like 
Chris, which obviously includes me.  There is a constant stream of 
polite requests not to send double spaced crap which we do not wish to 
see.  There are at least two solutions to this, follow the instructions 
in the link repeated above for the umpteenth time or use a different tool.


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-14 Thread Michael Torrie
On 12/14/2013 10:05 AM, Wolfgang Keller wrote:
 Tkinter is a bit special to use since it's not just a library, but
 uses some kind of RPC. It seems that look and feel have been greatly
 improved lately.

I know Tkinter originated with the Tcl/Tk language.  With Tkinter in
Python is it still using Tcl/Tk under the hood?  IE embeds the Tcl
language interpreter into Python's interpreter?  If so I've always found
it a bit strange that the de facto GUI library that's shipped with
Python ships an entirely different language with it under the hood.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-14 Thread Michael Torrie
On 12/14/2013 10:05 AM, Wolfgang Keller wrote:
 PyQt looks native everywhere, but it might be a bit overweight,
 depending on what you want to do and where your applications need to
 run.
 
 And then there's the licensing issue, since PyQt, unlike Qt itself, is
 not available under LGPL afaik. For closed-source commercial
 applications, there seems to be a way to use a commercially licensed
 PyQt (much less expensive than Qt itself) together with LGPL-Qt
 however. Pyside would be a LGPL alternative to PyQt, but it doesn't
 seem to be as up-to-date as PyQt.

I think PyQt is slowly being pushed aside in favor of PySide, which is
more license-friendly for use in closed or open projects.  I would
recommend using PySide unless PyQt is a requirement for your project.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-14 Thread Michael Torrie
On 12/14/2013 10:42 AM, ru...@yahoo.com wrote:
 The other big, widely-used GUI toolkit is PyQt.  It runs on 
 both Python2 and Python3.  There is another version of it
 called PySide which is API compatible with PyQt but has 
 different licensing terms.  PyQt comes with a very good 
 drag-and-drop form designer.

Just to be clear, PyQt does not provide the drag and drop form designer.
That comes from QtDesigner or QtCreator, which is part of Qt itself and
you can use it to design GUIs for use in any language that Qt has
bindings for, not just Python.  PyQt probably does come with a code
generator to convert the xml GUI definitions into Python, but these days
such use is discouraged in favor of using Qt itself to load the XML file
at runtime and build the objects on the fly for you.  It's way more
flexible and there's no code generation needed.  (Apple has done this
for years with Cocoa with their nib files in the bundle.)

 I have played a little with both wxPython an PyQt and found 
 learning to use them from the web difficult because of their 
 size and complexity.  But both of them have pretty good books 
 about them available:

Yes there are concepts you'll have to wrap your brain around such as how
to do proper widget layout.  Things aren't placed in a fixed way
usually.  They are allowed to grow and shrink with the window size.  And
you will have to grasp how events work.

Of all the APIs I've used, I think GTK in Python is the cleanest (PyGTK
or PyObject).  But if I was targeting Windows or Mac I'd stick with
PySides/PyQt.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-14 Thread Ned Deily
In article 52acb936.3020...@gmail.com, Michael Torrie torr...@gmail.com 
wrote:
 On 12/14/2013 10:05 AM, Wolfgang Keller wrote:
  Tkinter is a bit special to use since it's not just a library, but
  uses some kind of RPC. It seems that look and feel have been greatly
  improved lately.
 I know Tkinter originated with the Tcl/Tk language.  With Tkinter in
 Python is it still using Tcl/Tk under the hood?  IE embeds the Tcl
 language interpreter into Python's interpreter?

Yes, it does.

 If so I've always found
 it a bit strange that the de facto GUI library that's shipped with
 Python ships an entirely different language with it under the hood.

It is a bit strange but, back in the day, there wasn't a better multi-platform 
GUI option and, even today, Tk (and Tcl) remain attractive because it is 
supported on the many important platforms and does not have the license issues 
that some other GUI toolkits have had.  And because of inertia.  Also, Python 
is not alone in this: Perl and Ruby also have Tk bindings that work the same 
way, AFAIK.

-- 
 Ned Deily,
 n...@acm.org

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-14 Thread Terry Reedy

On 12/14/2013 3:01 PM, Michael Torrie wrote:

On 12/14/2013 10:05 AM, Wolfgang Keller wrote:

Tkinter is a bit special to use since it's not just a library, but
uses some kind of RPC. It seems that look and feel have been greatly
improved lately.


I know Tkinter originated with the Tcl/Tk language.


Tcl is the language. Its standard interpreter is written in C, as with 
Python. (I do not know if there are other Tcl implementations.) Tk is 
the gui framework written, I believe, in a mixture of Tcl and C.


Tkinter (Tk interface) is entirely a Python to Tcl/Tk and back interface.


With Tkinter in Python is it still using Tcl/Tk under the hood?


Yes.  _tkinter.c defines Python-callable functions that call Tcl/Tk C 
api functions. tkinter.py defines Python classes and methods. The 
methods call _tkinter functions. Most of the classes correspond to Tk 
widgets such as Button and Text.



IE embeds the Tcl language interpreter into Python's interpreter?


Both interpreters run in one process.

 If so I've always found

it a bit strange that the de facto GUI library that's shipped with
Python ships an entirely different language with it under the hood.


Tcl/Tk is only shipped with the Windows Python installer. On other 
systems, it is a separate install if not already present.


There once (over 10 years ago) was a project to re-write Tk entirely in 
C. What I read it that people decided that Tk made too much use of Tcl 
functions to make that worthwhile.


There have been starts on projects to write a gui framework based on 
Python and wrapped C libraries. PyGui is one, last updated July 2011.

http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-14 Thread Steven D'Aprano
On Sat, 14 Dec 2013 13:01:58 -0700, Michael Torrie wrote:

 On 12/14/2013 10:05 AM, Wolfgang Keller wrote:
 Tkinter is a bit special to use since it's not just a library, but
 uses some kind of RPC. It seems that look and feel have been greatly
 improved lately.
 
 I know Tkinter originated with the Tcl/Tk language.  With Tkinter in
 Python is it still using Tcl/Tk under the hood?  IE embeds the Tcl
 language interpreter into Python's interpreter?  If so I've always found
 it a bit strange that the de facto GUI library that's shipped with
 Python ships an entirely different language with it under the hood.

That's just the Interpreter design pattern, except the Domain Specific 
Language is already written for you :-)

(I'm half-serious here.)

But more seriously, 100% seriously in fact, I think that you'll find that 
*every* GUI framework for Python ships with an entirely different 
language under the hood, usually C. Even if the top level of the 
framework is written in Python, the underlying graphics routines used for 
drawing controls and windows will surely not be. Given that the actual 
maintenance of the GUI itself is unlikely to be a bottleneck in any real 
application, I don't think it is a significant problem efficiency-wise 
that Python tkinter relies on an intermediate framework written in Tcl.



-- 
Steven
-- 
https://mail.python.org/mailman/listinfo/python-list