Re: [Tutor] GUI for ANSI colors

2017-02-13 Thread Alan Gauld via Tutor
On 13/02/17 09:40, Freedom Peacemaker wrote:

> I'm trying to put my script with randomly colored letters (ANSI escape
> code) into GUI but cant find any. I've tried tkinter but it isn't good
> choice. 

Why not? It can certainly do what you want. As can virtually
any other GUI toolkit. But programming GUIs is much harder
than programming the console regardless of toolkit choice.

Here is a sample Tkinter program that displays text in
different colors:

###
from Tkinter import *

n = 0
top = Tk()
t = Text(top, width=25, height=2)
t.pack()

# set up tags for the colors
colors = ['red','blue','green']
for col in colors:
t.tag_config(col, foreground=col)

def addWords():
n = 0
for word in "Hello ", "bright ", "world ":
t.insert(END,word,colors[n])  #use the color tags
n +=1

Button(top,text="Add words",command=addWords).pack()

top.mainloop()
##

Most other GUIs will be similar.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI for ANSI colors

2017-02-13 Thread Freedom Peacemaker
Hi tutor,
I'm trying to put my script with randomly colored letters (ANSI escape
code) into GUI but cant find any. I've tried tkinter but it isn't good
choice. Then i was searching for capabilities of PyQt4 again without
success. Thats why im writing this message. Is there any GUI that can print
word with randomly colored letters?
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI program

2015-06-30 Thread Alan Gauld

On 30/06/15 06:02, Stephanie Quiles wrote:

Hello, i am attempting to create a GUI program using Python 3.4. please see the 
pasted code below.

>  Why is nothing showing up?

Because you have defined the GUI inside a class. But you
never instantiate that class so the code never gets executed.

However, there are several other issue that you should
think about...


import tkinter

class AddressGUI:
 def __init__(self):
 self.main_window = tkinter.Tk()

 self.top_frame= tkinter.Frame()


Your widgets, including Frames should always have
an explicit parent defined. Things can get awfully
confused otherwise and debugging what's happening
is a pain. So use self.main_window as your parent
for these frames.


 self.mid_frame= tkinter.Frame()
 self.bottom_frame = tkinter.Frame()

 self.name_label= tkinter.Label(self.top_frame,\
  text='Steven Marcus')

 self.name_label.pack(side='left')


 self.value = tkinter.StringVar()
 self.address_label = tkinter.Label(self.mid_frame,\
text='274 Baily Drive Waynesville, 
NC 27999')

 self.address_label.pack(side='left')

 self.show_button = tkinter.Button(self.bottom_frame,\
   text="show info",\
   command=self.showinfo)
 self.quit_button = tkinter.Button(self.bottom_frame,\
   tect ='Quit',\
   command=self.main_window.destroy)


Personally I'd probably use quit() rather than destroy(). The latter 
leaves the objects in memory, and the evebnt loop running, only removing 
the window widgets. quit() closes the event loop and

shuts things down a bit more thoroughly in my experience.



 self.show_button.pack(side='left')
 self.quit_button.pack(side='left')

 self.top_frame.pack()
 self.mid_frame.pack()
 self.bottom_frame.pack()

 tkinter.mainloop()


Its usually better to start the mainloop outside the application class.
Not least because it makes reuse easier. But also because it offers 
better control of initialisation/ finalisation actions.



 def showinfo(self):
 name = 'Steven Marcus'
 address = '274 Baily Drive Waynesville, NC 27999'
 info = name + address

 allinfo = AddressGUI()


And a recursive call to the app inside an event handler is a
recipe for confusion. You will have multiple instances around
in memory with potentially multiple event loops (see note on
destroy) above. Especially since you don;t even store a reference
to the new app instance. The allinfo variable gets deleted when
the method completes.

In general its a good idea to byui8ld your program in small
chunks.  Get a basic GUI with windows to display then add
the widgets one by one and test them as you go. Its much easier
to debug things when you only have a small amount of new code
to look at.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI program

2015-06-30 Thread Stephanie Quiles
Hello, i am attempting to create a GUI program using Python 3.4. please see the 
pasted code below. Why is nothing showing up? i am using Pycharm to run the 
program to see what it does and it says there are no errors but it does not 
show me an output. please let me know where i am falling short on this. 

Thank you 

__author__ = 'stephaniequiles'

""" Write a GUI program that displays your name and address when a button is 
clicked. when the user clicks the 'show info' button, the
program should display your name and address, as shown in the sketch."""

import tkinter


class AddressGUI:
def __init__(self):
self.main_window = tkinter.Tk()

self.top_frame= tkinter.Frame()
self.mid_frame= tkinter.Frame()
self.bottom_frame = tkinter.Frame()

self.name_label= tkinter.Label(self.top_frame,\
 text='Steven Marcus')

self.name_label.pack(side='left')


self.value = tkinter.StringVar()
self.address_label = tkinter.Label(self.mid_frame,\
   text='274 Baily Drive Waynesville, 
NC 27999')

self.address_label.pack(side='left')

self.show_button = tkinter.Button(self.bottom_frame,\
  text="show info",\
  command=self.showinfo)
self.quit_button = tkinter.Button(self.bottom_frame,\
  tect ='Quit',\
  command=self.main_window.destroy)

self.show_button.pack(side='left')
self.quit_button.pack(side='left')

self.top_frame.pack()
self.mid_frame.pack()
self.bottom_frame.pack()

tkinter.mainloop()

def showinfo(self):
name = 'Steven Marcus'
address = '274 Baily Drive Waynesville, NC 27999'
info = name + address

allinfo = AddressGUI()

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2015-02-02 Thread Alan Gauld

On 02/02/15 20:59, Marc Tompkins wrote:


I suspect the standard GUI framework Tkinter is not going to be your best
bet. You might find that PyQt or PyGTK will offer better multi lingual
support  (although thats just a guess on my part!).


Might I also suggest wxPython?  I tried Tk and Qt early on, but found that
wx fit my needs much better (and I like the looks of the result better too.)


I, too, like wxPython, but I don't recall it having any explicit support 
for multi-lingual display whereas I think I've seen references to Qt and 
GTk supporting it via native widgets. That's why I left it out this time.



--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2015-02-02 Thread Mark Lawrence

On 02/02/2015 21:48, Marc Tompkins wrote:

On Mon, Feb 2, 2015 at 1:18 PM, Mark Lawrence 
wrote:


On 02/02/2015 20:59, Marc Tompkins wrote:


On Mon, Feb 2, 2015 at 9:13 AM, Alan Gauld 
wrote:

  Don't expect a whole heap of support from the GUIs. A lot of the work

will
have to come from you.
I suspect the standard GUI framework Tkinter is not going to be your best
bet. You might find that PyQt or PyGTK will offer better multi lingual
support  (although thats just a guess on my part!).



Might I also suggest wxPython?  I tried Tk and Qt early on, but found that
wx fit my needs much better (and I like the looks of the result better
too.)
I have little to no experience with LTR handling myself, but there's a
very
good, active support list for wxPython and I suspect that someone on that
list may have insights that can help...
wxpython-us...@googlegroups.com



For the type of work the OP has previously described I doubt that wxPython
fits the bill as the Python 3 version called Phoenix is still in
development.  More here http://wiki.wxpython.org/ProjectPhoenix



Still under development, true - but all but a few of the controls are up
and running, and a lot of the people on the list are using Phoenix now.
(Not I - I'm still using 2.7 - but I've been following developments with
interest.)



So wxPython Phoenix 1.0 doesn't get released until all controls are up 
and running, which might be tomorrow, might be this time next year.  I 
therefore could not recommend using it to someone who's trying to put a 
Hebrew Dictionary database together.  Much better IMHO to use something 
that's already proven in the field.


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

Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2015-02-02 Thread Marc Tompkins
On Mon, Feb 2, 2015 at 1:18 PM, Mark Lawrence 
wrote:

> On 02/02/2015 20:59, Marc Tompkins wrote:
>
>> On Mon, Feb 2, 2015 at 9:13 AM, Alan Gauld 
>> wrote:
>>
>>  Don't expect a whole heap of support from the GUIs. A lot of the work
>>> will
>>> have to come from you.
>>> I suspect the standard GUI framework Tkinter is not going to be your best
>>> bet. You might find that PyQt or PyGTK will offer better multi lingual
>>> support  (although thats just a guess on my part!).
>>>
>>>
>> Might I also suggest wxPython?  I tried Tk and Qt early on, but found that
>> wx fit my needs much better (and I like the looks of the result better
>> too.)
>> I have little to no experience with LTR handling myself, but there's a
>> very
>> good, active support list for wxPython and I suspect that someone on that
>> list may have insights that can help...
>> wxpython-us...@googlegroups.com
>>
>
> For the type of work the OP has previously described I doubt that wxPython
> fits the bill as the Python 3 version called Phoenix is still in
> development.  More here http://wiki.wxpython.org/ProjectPhoenix
>

Still under development, true - but all but a few of the controls are up
and running, and a lot of the people on the list are using Phoenix now.
(Not I - I'm still using 2.7 - but I've been following developments with
interest.)
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2015-02-02 Thread Mark Lawrence

On 02/02/2015 20:59, Marc Tompkins wrote:

On Mon, Feb 2, 2015 at 9:13 AM, Alan Gauld 
wrote:


Don't expect a whole heap of support from the GUIs. A lot of the work will
have to come from you.
I suspect the standard GUI framework Tkinter is not going to be your best
bet. You might find that PyQt or PyGTK will offer better multi lingual
support  (although thats just a guess on my part!).



Might I also suggest wxPython?  I tried Tk and Qt early on, but found that
wx fit my needs much better (and I like the looks of the result better too.)
I have little to no experience with LTR handling myself, but there's a very
good, active support list for wxPython and I suspect that someone on that
list may have insights that can help...
wxpython-us...@googlegroups.com


For the type of work the OP has previously described I doubt that 
wxPython fits the bill as the Python 3 version called Phoenix is still 
in development.  More here 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

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2015-02-02 Thread Marc Tompkins
On Mon, Feb 2, 2015 at 9:13 AM, Alan Gauld 
wrote:

> Don't expect a whole heap of support from the GUIs. A lot of the work will
> have to come from you.
> I suspect the standard GUI framework Tkinter is not going to be your best
> bet. You might find that PyQt or PyGTK will offer better multi lingual
> support  (although thats just a guess on my part!).
>

Might I also suggest wxPython?  I tried Tk and Qt early on, but found that
wx fit my needs much better (and I like the looks of the result better too.)
I have little to no experience with LTR handling myself, but there's a very
good, active support list for wxPython and I suspect that someone on that
list may have insights that can help...
wxpython-us...@googlegroups.com
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2015-02-02 Thread Alan Gauld

On 01/02/15 20:16, D.Edmons wrote:


I've compiled both python2 and python3 and am starting to learn them
well enough to do a GUI application that requires UTF-8.


OK, We can help with the basics, thats what this group is for.
Learning Python and its standard library.


Anyway, I suspect that I'll have to use python3 to take advantage of the
UTF-8 (is there a __FUTURE__ option for python2?).


Python2 can work with unicode but its more effort than in Python 3 so I 
suspect you should go straight to Python 3.



minor GUI stuff, but what I need is an application that will do Hebrew
(left <-- right) that actually attempts to "get it right".  Also, I'm
creating a Hebrew Dictionary database and my GUI will have to work with
it (ie. it is the whole purpose of this exercise).


Don't expect a whole heap of support from the GUIs. A lot of the work 
will have to come from you.
I suspect the standard GUI framework Tkinter is not going to be your 
best bet. You might find that PyQt or PyGTK will offer better multi 
lingual support  (although thats just a guess on my part!).



I started out with Perl, but haven't made much progress.  Python kept
coming up in my searches, so I'm attempting to switch over.


Python or Perl do much the same thing. Python is easier to read 
(although being a Python group I'm biased...)



the major features I hope to incorporate into the application:
 א) Hebrew keyboard application that will easily switch back and
forth between English and Hebrew character sets.  Key assignments will
be user defined or easily reprogrammed so that both standard and custom
configurations can be made: (ie similar to
http://www.lexilogos.com/keyboard/hebrew.htm )


I've no idea how you support that in a GUI. It may well be beyond the 
scope of this list too. I suspect that once you identify your target GUI 
framework that their support forums will be better suited to answer.



 ב) Dual screen editor for simplified search and replace (hebrew
with nikkud, with option to ignore the nikkud/vowels to find
shoreshim/roots) feature.  One window will be the compiled dictionary.
The second window will be any Hebrew text (Torah, Siddur, etc...).  The
application will--hopefully--automatically search the "dictionary" based
upon the current cursor and add the English definition of the Hebrew
word with a click or two.  (I'm learning Hebrew, as I go, studying every
week, if not every day.)


This sounds very advanced for a first project (but then, so is a device 
driver!) Certainly probably beyond this lists scope.



 ג) Obviously, a menu bar with tools and other standard GUI bits and
pieces.


Yep, that kind of stuff we might help with. But again the GUI support 
forum is likely to be better still.



Actual Request:

I'm running an older Debian Linux, that doesn't upgrade very well.  Is
there anybody willing to help me at least get started or point me in the
right direction?


We don't really provide 1-1 mentoring. You ask questions on the list and 
the list members answer. You might be very lucky and find someone who is 
familiar with your problem domain, but its a long shot.



Knowledge of Hebrew would be a *huge* plus, but isn't required in any
...  Thus, leafpad would be a reasonable model for the editor.


Again thats a pretty specialized set of skills on top of Python. You 
might try the main Python mailing list/nesgroup. You have a bigger 
audience there to find someone suitable to help you.


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI

2015-02-01 Thread D.Edmons

Hi,

Background:
I've compiled both python2 and python3 and am starting to learn them 
well enough to do a GUI application that requires UTF-8.  I've done 
quite a bit of maintenance programming (fixing bugs, minor updates, etc) 
but the only major application I've written was a disk driver for RT-11X 
on Linux using FUSE (quite a project, considering that I had no 
specification!).


Anyway, I suspect that I'll have to use python3 to take advantage of the 
UTF-8 (is there a __FUTURE__ option for python2?).  I've done some very 
minor GUI stuff, but what I need is an application that will do Hebrew 
(left <-- right) that actually attempts to "get it right".  Also, I'm 
creating a Hebrew Dictionary database and my GUI will have to work with 
it (ie. it is the whole purpose of this exercise).


I started out with Perl, but haven't made much progress.  Python kept 
coming up in my searches, so I'm attempting to switch over.  Here are 
the major features I hope to incorporate into the application:
	א) Hebrew keyboard application that will easily switch back and forth 
between English and Hebrew character sets.  Key assignments will be user 
defined or easily reprogrammed so that both standard and custom 
configurations can be made: (ie similar to 
http://www.lexilogos.com/keyboard/hebrew.htm )
	ב) Dual screen editor for simplified search and replace (hebrew with 
nikkud, with option to ignore the nikkud/vowels to find shoreshim/roots) 
feature.  One window will be the compiled dictionary.  The second window 
will be any Hebrew text (Torah, Siddur, etc...).  The application 
will--hopefully--automatically search the "dictionary" based upon the 
current cursor and add the English definition of the Hebrew word with a 
click or two.  (I'm learning Hebrew, as I go, studying every week, if 
not every day.)

ג) Obviously, a menu bar with tools and other standard GUI bits and 
pieces.


Actual Request:

I'm running an older Debian Linux, that doesn't upgrade very well.  Is 
there anybody willing to help me at least get started or point me in the 
right direction?  Time isn't a huge factor.  I've been working on the 
database for five years now (using sqlite 3.7.3 and UTF-8 text). 
Knowledge of Hebrew would be a *huge* plus, but isn't required in any 
way.  I'm currently reading the Tutorials I've gleaned from the Python 
homepage.  I've never written more than trivial GUI applications.


I currently use leafpad for my UTF-8 editor.  Though it is a little 
buggy--this should be fixed if I can get my libraries uptodate--it 
handles the UTF-8 text as well as I expect it to, whereas others don't. 
 Thus, leafpad would be a reasonable model for the editor.


(btw, I got this e-mail link from the Website Tutorial which is supposed 
to be included in the distro--I haven't checked.)



Shalom,

Dale Edmons/
אֱלְעָד בֶּן אָבְרָהָם
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI development with Python 3.4.1

2014-09-18 Thread Sebastian Silva



El jue, 18 de sep 2014 a las 8:07 AM, Juan Christian 
 escribió:
On Wed, Sep 17, 2014 at 2:01 PM, Juan Christian 
 wrote:
I need to develop a GUI for my Python pogram, I already read the 
GuiProgramming page (https://wiki.python.org/moin/GuiProgramming). 
For me, the best so far was 'gui2py'.


The problem is that I need a simple "C#/Java-ish" GUI builder, that 
is easy and simple, coding all the GUI by hand is boring, I prefer 
to focus on the logic, on the actual program code, than coding the 
GUI.


Anyone here already used 'gui2py' 
(https://github.com/reingart/gui2py)? Any other good alternatives?


Anyone?


I personally like GTK quite a lot. You can use a GUI designer like 
Gazpacho or Glade to create basic XML UIs, but it's good to get 
familiar with the APIs of your toolkit of choice.


Regards,
Sebastian
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI development with Python 3.4.1

2014-09-18 Thread john

On 09/18/2014 06:07 AM, Juan Christian wrote:
On Wed, Sep 17, 2014 at 2:01 PM, Juan Christian 
mailto:juan0christ...@gmail.com>> wrote:


I need to develop a GUI for my Python pogram, I already read the
GuiProgramming page (https://wiki.python.org/moin/GuiProgramming).
For me, the best so far was 'gui2py'.

The problem is that I need a simple "C#/Java-ish" GUI builder,
that is easy and simple, coding all the GUI by hand is boring, I
prefer to focus on the logic, on the actual program code, than
coding the GUI.

Anyone here already used 'gui2py'
(https://github.com/reingart/gui2py)? Any other good alternatives?


Anyone?


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Dabo has a designer (currently moving to support wxPython 3.x). That 
said, the link you first provided suggested there was a designer for 
gui2py?


Johnf
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI development with Python 3.4.1

2014-09-18 Thread Laszlo Z. Antal
Hi,

I used to use wxPython.com Comes with a ton of examples and has many different 
drag and drop tools. 

Laszlo
http://twitter.com/LZAntal


> On Sep 18, 2014, at 6:27, Matthew Ngaha  wrote:
> 
> PyQt or PySide offers QtDesigner. Which is a drag and drop builder.
> They are both quite complex GUI toolkits so you will need some basic
> knowledge on them first, but I Imagine there are good guides on using
> QtDesigner if it's your last option.
> 
> On Thu, Sep 18, 2014 at 2:14 PM, Juan Christian
>  wrote:
>> On Thu, Sep 18, 2014 at 10:12 AM, Joel Goldstick 
>> wrote:
>>> 
>>> I've not used it but Tkinter seems to be well used.
>>> 
>>> I'm not sure what a C#/Java-ish thing is, but python isn't that.
>> 
>> 
>> "C#/Java-ish" in terms of GUI Builder, drag and drop, like Glade and gui2py.
>> 
>> ___
>> Tutor maillist  -  Tutor@python.org
>> To unsubscribe or change subscription options:
>> https://mail.python.org/mailman/listinfo/tutor
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI development with Python 3.4.1

2014-09-18 Thread Matthew Ngaha
PyQt or PySide offers QtDesigner. Which is a drag and drop builder.
They are both quite complex GUI toolkits so you will need some basic
knowledge on them first, but I Imagine there are good guides on using
QtDesigner if it's your last option.

On Thu, Sep 18, 2014 at 2:14 PM, Juan Christian
 wrote:
> On Thu, Sep 18, 2014 at 10:12 AM, Joel Goldstick 
> wrote:
>>
>> I've not used it but Tkinter seems to be well used.
>>
>> I'm not sure what a C#/Java-ish thing is, but python isn't that.
>
>
> "C#/Java-ish" in terms of GUI Builder, drag and drop, like Glade and gui2py.
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI development with Python 3.4.1

2014-09-18 Thread Juan Christian
On Thu, Sep 18, 2014 at 10:12 AM, Joel Goldstick 
wrote:
>
> I've not used it but Tkinter seems to be well used.
>
> I'm not sure what a C#/Java-ish thing is, but python isn't that.
>

"C#/Java-ish" in terms of GUI Builder, drag and drop, like Glade and
gui2py.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI development with Python 3.4.1

2014-09-18 Thread Joel Goldstick
On Thu, Sep 18, 2014 at 9:07 AM, Juan Christian
 wrote:
> On Wed, Sep 17, 2014 at 2:01 PM, Juan Christian 
> wrote:
>>
>> I need to develop a GUI for my Python pogram, I already read the
>> GuiProgramming page (https://wiki.python.org/moin/GuiProgramming). For me,
>> the best so far was 'gui2py'.
>>
>> The problem is that I need a simple "C#/Java-ish" GUI builder, that is
>> easy and simple, coding all the GUI by hand is boring, I prefer to focus on
>> the logic, on the actual program code, than coding the GUI.
>>
>> Anyone here already used 'gui2py' (https://github.com/reingart/gui2py)?
>> Any other good alternatives?
>
>
> Anyone?
>
I've not used it but Tkinter seems to be well used.

I'm not sure what a C#/Java-ish thing is, but python isn't that.


-- 
Joel Goldstick
http://joelgoldstick.com
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI development with Python 3.4.1

2014-09-18 Thread Juan Christian
On Wed, Sep 17, 2014 at 2:01 PM, Juan Christian 
wrote:

> I need to develop a GUI for my Python pogram, I already read the
> GuiProgramming page (https://wiki.python.org/moin/GuiProgramming). For
> me, the best so far was 'gui2py'.
>
> The problem is that I need a simple "C#/Java-ish" GUI builder, that is
> easy and simple, coding all the GUI by hand is boring, I prefer to focus on
> the logic, on the actual program code, than coding the GUI.
>
> Anyone here already used 'gui2py' (https://github.com/reingart/gui2py)?
> Any other good alternatives?
>

Anyone?
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI development with Python 3.4.1

2014-09-17 Thread Juan Christian
I need to develop a GUI for my Python pogram, I already read the
GuiProgramming page (https://wiki.python.org/moin/GuiProgramming). For me,
the best so far was 'gui2py'.

The problem is that I need a simple "C#/Java-ish" GUI builder, that is easy
and simple, coding all the GUI by hand is boring, I prefer to focus on the
logic, on the actual program code, than coding the GUI.

Anyone here already used 'gui2py' (https://github.com/reingart/gui2py)? Any
other good alternatives?
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI for python Google App Engine

2012-04-09 Thread Surya K

Hi there,

I just wrote a small game in python and would like to make it a facebook app.
These are the things I wish to know:
1. How to write GUI for my app. I believe, PyQt or Wx wouldn't work in Google 
App Engine.2. How to integrate my app with facebook. I went through facebook 
documentation but couldn't get it clearly..
this is what I require as per the game:
Two players join a game and each player inputs a character..

Any small tutorials that would teach me would be appreciated.. 
Right now I don't want to learn about GAE or Facebook API in detail. I just 
want to build my app.
  ___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI selection help

2011-07-14 Thread Shwinn Ricci
by the way, I'm on a MAC if that helps/hurts at all.

On Wed, Jul 13, 2011 at 10:41 AM, Shwinn Ricci  wrote:

> Hey all,
>
> I am browsing through the large list of apps for creating GUIs from python
> on http://wiki.python.org/moin/GuiProgramming but unfortunately don't know
> which one is the best for my project, which involves mapping a point on a
> 2-Dimensional surface to a 3-Dimensional structure by having users move
> their mouse over the 2-D surface to light up a respective point on the 3-D
> surface. The GUI should also allow me to implement rotated camera angles for
> the 3-D structure. Does the GUI I select matter at all? Any pointers would
> be appreciated.
>
>
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI selection help

2011-07-13 Thread Wayne Werner
On Wed, Jul 13, 2011 at 9:41 AM, Shwinn Ricci  wrote:

> Hey all,
>
> I am browsing through the large list of apps for creating GUIs from python
> on http://wiki.python.org/moin/GuiProgramming but unfortunately don't know
> which one is the best for my project, which involves mapping a point on a
> 2-Dimensional surface to a 3-Dimensional structure by having users move
> their mouse over the 2-D surface to light up a respective point on the 3-D
> surface. The GUI should also allow me to implement rotated camera angles for
> the 3-D structure. Does the GUI I select matter at all? Any pointers would
> be appreciated.
>

Do you have any experience with 3d programming? If you've already familiar
with OpenGL, you can use the pyglet framework that gives you OpenGL
bindings.

Of course, if you already have a way to do the 3d part, then your GUI
framework really doesn't matter - Tkinter is probably the easiest one to
use, wxPython give you native-looking widgets (if you're using Windows, your
apps will look like other Windows apps), PyGTK+ is great if you plan to use
the Gnome window manager under Linux, and PyQT is good for KDE and contains
everything but the kitchen sink. Also you'll be using your left pinky /all/
the time because everything you use has "q" in it.

If all you need to do is display an image and track where the mouse
click/drags are happening, I'd probably use Tkinter.

-HTH,
Wayne
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI selection help

2011-07-13 Thread Shwinn Ricci
Hey all,

I am browsing through the large list of apps for creating GUIs from python
on http://wiki.python.org/moin/GuiProgramming but unfortunately don't know
which one is the best for my project, which involves mapping a point on a
2-Dimensional surface to a 3-Dimensional structure by having users move
their mouse over the 2-D surface to light up a respective point on the 3-D
surface. The GUI should also allow me to implement rotated camera angles for
the 3-D structure. Does the GUI I select matter at all? Any pointers would
be appreciated.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI IDLE for UBUNTU 10

2011-04-06 Thread Andrés Chandía


Sorry, the command is Crtl+F9, not only F9

On Wed, April 6, 2011 12:43,
"Andrés Chandía" wrote:
  Actually
the default text editor in Ubuntu, "gedit" has a plugin named Python console, 
that
you can activate at "edit > preferences" menu, then at the menu "view >
inferior subwindow" (F9) you can activate it, maybe the menu names are not 
exact, because
I'm translating from catalan.

Good luck!

On Wed, April 6, 2011 11:34,
Ratna Banjara wrote:
  As i know python comes as default in ubuntu and can be accessed
from terminal.
But i found difficulty to write programs in editor and run from terminal.
I need GUI
Before this i used to run in windows with python IDLE which makes easy to
write python codes and run using Run command or pressing F5.
 
Now i want to ask if
there is python GUI IDLE equivalent in Ubuntu. Please help.
-- 
Regards,
Ratna
P Banjara


   


___
   
andrés chandía

P No imprima innecesariamente. ¡Cuide el medio
ambiente!  


___
andrés
chandía

P No imprima
innecesariamente. ¡Cuide el medio ambiente!
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI IDLE for UBUNTU 10

2011-04-06 Thread Andrés Chandía


Actually the default text editor in Ubuntu, "gedit" has a plugin named Python
console, that you can activate at "edit > preferences" menu, then at the menu
"view > inferior subwindow" (F9) you can activate it, maybe the menu names are
not exact, because I'm translating from catalan.

Good luck!

On Wed,
April 6, 2011 11:34, Ratna Banjara wrote:
  As i know python
comes as default in ubuntu and can be accessed from terminal.
But i found difficulty to
write programs in editor and run from terminal. I need GUI
Before this i used to run in
windows with python IDLE which makes easy to write python codes and run using 
Run command or
pressing F5.
 
Now i want to ask if there is python GUI IDLE equivalent in Ubuntu.
Please help.
-- 
Regards,
Ratna P Banjara


   


___
andrés
chandía

P No imprima
innecesariamente. ¡Cuide el medio ambiente!
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI IDLE for UBUNTU 10

2011-04-06 Thread Corey Richardson
On 04/06/2011 05:34 AM, Ratna Banjara wrote:
> Before this i used to run in windows with python IDLE which makes easy to
> write python codes and run using Run command or pressing F5.
> 
> Now i want to ask if there is python GUI IDLE equivalent in Ubuntu. Please
> help.

At the terminal, sudo apt-get install idle.

When you need software, search in Synaptic (Package Manager) or google
first, it's usually very accessible!
-- 
Corey Richardson
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI IDLE for UBUNTU 10

2011-04-06 Thread Ratna Banjara
As i know python comes as default in ubuntu and can be accessed from
terminal.
But i found difficulty to write programs in editor and run from terminal. I
need GUI
Before this i used to run in windows with python IDLE which makes easy to
write python codes and run using Run command or pressing F5.

Now i want to ask if there is python GUI IDLE equivalent in Ubuntu. Please
help.
-- 
Regards,
Ratna P Banjara
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI + python program

2011-02-14 Thread Patrick Sabin

You have a lot of options:

GUI: Any major gui toolkit will do the job. It's probobly easiest to 
stick with tkinter.


HTML Template: Use a template language, e.g. mako or django templates
Pdf Templates: Reportlab is an option.

File Access: Of course you could just open a file and write to it, but 
it probably gets messy. I would recommend using a database. Sqlite is 
maybe a good choice, or sqlalchemy.


- Patrick

On 2011-02-14 20:55, Mitch Seymour wrote:

Hello,

I am trying to design a program and GUI that will allow the user to
select from a series of options and, depending on which options are
selected in the GUI, information will then be placed in a html or pdf
template.

Here's an example.

Option A
Option B
Option C

If Option A, insert _ into the template.
If Option B, insert _ into the template.
If Option C, insert _ into the template.

The reason I used __ is because the user needs to be able to edit,
from the GUI, which information is associated with each option, and,
subsequently, which information will be placed into the template.

However, I am very new to python and I don't how to do this. A friend
suggested that I create a python file that would store the user defined
information, which would be read by the program before the information
is placed into the template. So the user could select the options from
the GUI, edit the associated information from a preferences tab, and
then initiate the process of placing the info into the templates.

My question is, how would you do this and, if I do create a file to
store the information, could you please give me some examples of code to
get me started?

Thanks so much!




___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI + python program

2011-02-14 Thread Mitch Seymour
Hello,

I am trying to design a program and GUI that will allow the user to select
from a series of options and, depending on which options are selected in the
GUI, information will then be placed in a html or pdf template.

Here's an example.

Option A
Option B
Option C

If Option A, insert _ into the template.
If Option B, insert _ into the template.
If Option C, insert _ into the template.

The reason I used __ is because the user needs to be able to edit, from
the GUI, which information is associated with each option, and,
subsequently, which information will be placed into the template.

However, I am very new to python and I don't how to do this. A friend
suggested that I create a python file that would store the user defined
information, which would be read by the program before the information is
placed into the template. So the user could select the options from the GUI,
edit the associated information from a preferences tab, and then initiate
the process of placing the info into the templates.

My question is, how would you do this and, if I do create a file to store
the information, could you please give me some examples of code to get me
started?

Thanks so much!
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui coding

2010-12-13 Thread Wayne Werner
On Mon, Dec 13, 2010 at 2:08 PM, Alan Gauld wrote:

> 
>
>> Does anyone have or know of a good tutorial or explanation of class
>> based coding that I could have a run at?
>>
>
> Try my tutor. It has topics on both OOP and GUIs.
> And before doing the GUI one also  read the event-driven topic because
> GUIs are, without exception, event-driven frameworks. Most folks find
> the shift to thinking in terms of events harder than the shift to objects.
> But thinking in events makes objects more natural, so they are connected.


I think the thing that helped me most was in my assembly class where I
actually created an event-driven painting program using non-blocking calls
to check the keyboard, etc.

That may be part of why GUI programming was so easy for me to pick up (and
as an extension, threading).

-Wayne
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui coding

2010-12-13 Thread Alan Gauld


"Rance Hall"  wrote


When I learned FORTRAN years ago they didn't teach us OOP or what I
like to call Class based programming.


One of the requirements of OOP is to be able to group data together
and from memory FORTRAN didn't have any such construct being
based primarily on arrays. I beliebve Fortran 95 had some kind of
limited OOP facilities but prior to that it was impossible. And my
experience on Fortran was in the 80's!

I'm intrigued and want to learn but all the samples seem to be OOP 
or

class based.


Try not to think of it as class based. Languages like Java tend to
emphasise the class but really you need to think about the actual
objects as the basis of the program. The class is just a template
from which to generate objects. Focussing on the classes as the
core item will lead to bad habits.


can not find any tkinter samples that use a procedural approach.


The GUI topic in my tutor does not use OOP till near the end.
It is extremely basic but it does show the basics needed to front
a CLI app with a GUI.


finding it very difficult to understand what I need to get from
tkinter because the classes are getting in the way and I'm not 
seeing

what I need to see.


Tkinter is, like most GUI toolkits heabvily based on objects itself.
But then, so is Python. Strings, files, lists etc are all objects in 
Python.

If you can use those you can use Tkinter.

Is there something about class based programming that GUI apps 
prefer

to work better in?


GUIs are conceptially made up of objects - buttons, menus, windows,
scroll bars etc. There is a very natural mapping from the visual 
objects

(widgets/controls) that you see on-screen and the code objects of the
toolkit. The whole ethos of OOP is that each object is like an 
independent

mini-program responding to events/messages from other objects.
GUI windows reflect that model - a dialog box acts like a mini app
within the parent app and sends data back to it...


Does anyone have or know of a good tutorial or explanation of class
based coding that I could have a run at?


Try my tutor. It has topics on both OOP and GUIs.
And before doing the GUI one also  read the event-driven topic because
GUIs are, without exception, event-driven frameworks. Most folks find
the shift to thinking in terms of events harder than the shift to 
objects.
But thinking in events makes objects more natural, so they are 
connected.


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui coding

2010-12-13 Thread Wayne Werner
On Mon, Dec 13, 2010 at 11:51 AM, Rance Hall  wrote:

> When I learned FORTRAN years ago they didn't teach us OOP or what I
> like to call Class based programming.
>

That must have been a few years ago, then ;)


> since then I've sort of always fallen back to be a procedural
> programmer with lots of functions.
>

There's nothing really wrong with a lot of functions, and that also
highlights one of the great advantages of Python - you can still program
procedurally or using any other type of paradigm, more or less.


>
> Python and the tkinter (Tkinter on Versions < 3) seem like a great way
> to write cross platform GUI apps for small light duty apps.
>

Perfect, really. You can quickly throw a nice little GUI together with few
problems. And there are other people doing some rather
nice
things
with Tkinter.


> I've tried to wrap my head around class based programming before and
> it didn't take.  But it appears I'm going to have to try again as I
> can not find any tkinter samples that use a procedural approach.  I'm
> finding it very difficult to understand what I need to get from
> tkinter because the classes are getting in the way and I'm not seeing
> what I need to see.
>
> Is there something about class based programming that GUI apps prefer
> to work better in?


> Does anyone have or know of a good tutorial or explanation of class
> based coding that I could have a run at?


I'm not aware of any specific tutorials, but I'll try to answer your
question and give a bit of an explanation.

First, if you're used to writing plenty of functions, you're about halfway
to OOP. The only real difference between what you do already (using
functions) and using classes is on a conceptual level. Classes can be
defined as a collection of data and functions that operate on that data.

Think back to a program that you've written with several related functions.
Perhaps you wrote something with several records that you may have stored in
a list or array or some such. So you may write a function called
get_new_record() that gets data for a record, either from the user or
somewhere else. Then you might have an update_record() function that
modifies a given record. And perhaps even a delete_record(). You could think
for a few minutes and come up with the rudimentary functions, I'm sure.

Now, instead of thinking about them as either lists inside a list or a
series of data elements stored in a list, imagine those records really are
"things" - objects that can stand alone. And you can tell that record that
you want to modify it, or you want it displayed some certain way, or any
number of things. The hardest part about OOP is deciding how much
responsibility an object really should have. Anyhow, that's all OOP is -
just taking the related functions that you would normally write and sticking
them inside a class. So instead of:

['somename', 'somedata', 'anothername', 'more data', 'no name', '']

you could have

[record1, record2, record3]

which you could modify the __repr__/__string__ methods to print out however
you want.

If you haven't made the link yet, GUIs tend to be objects because it's just
easier to think of them that way. If you have a (real life) bottle, you can
open the lid, close the lid, put stuff in, take it out, or throw it in the
garbage. It's a lot easier to think of a text entry box as something you can
put text in, or get text out of, or .

It's a different way of thinking about programming that begins feeling
entirely natural because we, as humans, are used to talking about things
that can do stuff and we can do stuff with. You might have hedge clippers
that have certain attributes - number and sharpness of blades, for instance.
They also have a function that you can .open() them and .close() them. But
if you close them with something inside they will .cut() the object you
place inside the clippers.

Alan Gauld (frequent contributor of this list) has a tutorial on OOP at
http://alan-g.me.uk/ that has some pretty solid examples about class-based
programming.

Of course, this discussion wouldn't be complete without telling you that it
is quite possible (using Tkinter especially) to actually adhere to
procedural programming. You could do something like this:

import Tkinter as tk

def buttonclicked():
print "Yay, you clicked me!"

root = tk.Tk()
button = tk.Button(root, text='Click me!', command=buttonclicked)
button.pack()

root.mainloop()

If you're more comfortable with procedural programming you can certainly do
it that way, but you'll probably find it a lot easier to spend some time
getting used to the concept of OOP and writing your GUI programs in a
class-based fashion.

HTH,
Wayne
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] gui coding

2010-12-13 Thread Rance Hall
When I learned FORTRAN years ago they didn't teach us OOP or what I
like to call Class based programming.

since then I've sort of always fallen back to be a procedural
programmer with lots of functions.

Python and the tkinter (Tkinter on Versions < 3) seem like a great way
to write cross platform GUI apps for small light duty apps.

I'm intrigued and want to learn but all the samples seem to be OOP or
class based.

I've tried to wrap my head around class based programming before and
it didn't take.  But it appears I'm going to have to try again as I
can not find any tkinter samples that use a procedural approach.  I'm
finding it very difficult to understand what I need to get from
tkinter because the classes are getting in the way and I'm not seeing
what I need to see.

Is there something about class based programming that GUI apps prefer
to work better in?

Does anyone have or know of a good tutorial or explanation of class
based coding that I could have a run at?

Thanks
Rance
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI Creation Aide

2010-07-14 Thread Wayne Werner
On Wed, Jul 14, 2010 at 7:18 AM, Corey Richardson  wrote:

> Hey tutors! I'm creating a GUI for a program. Really simple. I don't mind
> coding it out, but I was looking into things like Glade and the like. Do you
> recommend those over just coding it out by hand, or should I try Glade (or
> similiar) out? Also, I don't really have a preference for which toolkit I
> use, wx/Tk/GTK, etc.


Honestly it depends on how "pretty" you want it to look. Tkinter is the
ugliest GUI toolkit, but it's the easiest one to create simple GUIs.  To
create a window with a button with the text "hello world" that quits when
you push the button:

import Tkinter as tk

root = tk.Tk()
btn = tk.Button(root, text="Hello World", command=root.quit)
btn.pack()
root.mainloop()

And it's as simple as that. There are some fairly powerful widgets, but
nothing quite as advanced as you'll find in other frameworks. However, the
other frameworks do a have the benefit of a lot more power, so it really
comes down to what you want and what you need. If you need a simple GUI with
maybe a list or some text entry and some buttons, and maybe a menu, Tk is
the way to go.

If you want an advanced GUI with all sorts of pretty widgets and drawing
capabilities and bells and whistles, wx or GTK (my personal fave) are all
great options.

Of course, it's also my personal opinion that every python programmer should
learn Tkinter - it's a quick and easy way to throw up a GUI - so if you need
to just slap something together, it's right there. Plus it introduces you to
layout managers and callbacks, both of which are super useful programming
GUIs down the road.

HTH,
Wayne
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI Creation Aide

2010-07-14 Thread Alan Gauld


"Corey Richardson"  wrote

Hey tutors! I'm creating a GUI for a program. Really simple. I don't 
mind coding it out, but I was looking into things like Glade and the 
like. Do you recommend those over just coding it out by hand, or 
should I try Glade (or similiar) out? Also, I don't really have a 
preference for which toolkit I use, wx/Tk/GTK, etc.


I spent some time a couple of years back looking at different GUI
builders for Python. Frankly I didn't like any of them. Nothing comes
close to the tools used in VisualBasic or Delphi etc.

Things may have improved in recent years and there are a few 
commercial
tools that I didn't look at but for my limited GUI programming needs I 
find

I'm just as well hand coding the GUI.

Just a personal view, others may differ. And if you intend to do a lot 
of
GUI work (especially if you get paid for it!)  then it may be worth 
paying for

something that really does a good job.

HTH,

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI Creation Aide

2010-07-14 Thread Alex Hall
On 7/14/10, Corey Richardson  wrote:
> Hey tutors! I'm creating a GUI for a program. Really simple. I don't
> mind coding it out, but I was looking into things like Glade and the
> like. Do you recommend those over just coding it out by hand, or should
> I try Glade (or similiar) out? Also, I don't really have a preference
> for which toolkit I use, wx/Tk/GTK, etc.
I have only ever used wx with the XRCed program, but I really like it.
Learning xrc is pretty straightforward, and there are some good
tutorials for it. It also has the advantage of keeping the code
generating your gui separate from your program, so code management is
easier. I have heard xrc/python compared to css/html regarding code
separation. For a really simple gui it is probably not too important,
but if you do larger projects later on it will probably make life
easier.
>
> Thanks,
> ~Corey Richardson
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>


-- 
Have a great day,
Alex (msg sent from GMail website)
mehg...@gmail.com; http://www.facebook.com/mehgcap
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI Creation Aide

2010-07-14 Thread Corey Richardson
Hey tutors! I'm creating a GUI for a program. Really simple. I don't 
mind coding it out, but I was looking into things like Glade and the 
like. Do you recommend those over just coding it out by hand, or should 
I try Glade (or similiar) out? Also, I don't really have a preference 
for which toolkit I use, wx/Tk/GTK, etc.


Thanks,
~Corey Richardson
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI Buttons

2009-10-14 Thread ALAN GAULD


> But when is the configure() method more appropriate to change e.g. the button 
> status?


configure is better when you need to change more than one attribute of a 
widget at a time. The dictionary style access is just a convenience feature. 
If you prefer you can use configure() all the time.

Alan G.

> > > How can I programmatically create a list of all
> > available buttons?
> > 
> > Just add your buttons to a list when you create them
> > Then in your reset method do
> > 
> > for button in ButtonList:
> >button['state'] = NORMAL
> > 
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI Buttons

2009-10-14 Thread Albert-Jan Roskam
Hi Alan and Kent,

Thank you for helping me. This is a lot simpler than the solution I had in 
mind. The button names in my program always start with "button_", so I wanted 
to use locals() in a list comprehension to compile a list of the buttons. But 
then I'd still have the names and not the instances. 

But when is the configure() method more appropriate to change e.g. the button 
status?

Cheers!!
Albert-Jan

~~
Before you criticize someone, walk a mile in their shoes, that way 
when you do criticize them, you're a mile away and you have their shoes! 
~~


--- On Tue, 10/13/09, Alan Gauld  wrote:

> From: Alan Gauld 
> Subject: [Tutor] GUI Buttons
> To: tutor@python.org
> Date: Tuesday, October 13, 2009, 10:06 AM
> Please provide a subject when sending
> mail to the list.
> And please create a new message so it doesn't get lost in
> an old thread...
> 
> "Albert-Jan Roskam" 
> wrote in message
> 
> > I'm using Tkinter to program my very frist GUI.
> > Each button grays out after it has been used so the
> user knows what next steps to take.
> > Now I want to define a Reset button to 'ungray' all
> buttons (state='normal').
> > How can I programmatically create a list of all
> available buttons?
> 
> Just add your buttons to a list when you create them
> Then in your reset method do
> 
> for button in ButtonList:
>    button['state'] = NORMAL
> 
> HTH,
> 
> 
> -- Alan Gauld
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/ 
> 
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
> 


  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI Buttons

2009-10-13 Thread Alan Gauld

Please provide a subject when sending mail to the list.
And please create a new message so it doesn't get lost in an old thread...

"Albert-Jan Roskam"  wrote in message


I'm using Tkinter to program my very frist GUI.
Each button grays out after it has been used so the user knows what next 
steps to take.
Now I want to define a Reset button to 'ungray' all buttons 
(state='normal').

How can I programmatically create a list of all available buttons?


Just add your buttons to a list when you create them
Then in your reset method do

for button in ButtonList:
   button['state'] = NORMAL

HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/ 



___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI recommendations/tutorials?

2009-06-10 Thread Alan Gauld


"taserian"  wrote

My problem is that I have no GUI experience outside of Visual 
Studio-style

drag-and-drop IDEs. Which Python GUI system would you recommend for
neophytes that would allow line drawing and a simple graphic load of a
honeycomb structure in a JPG, for example, as a background?


The two most common Python GUI frameworks are Tkinter (in the
standard library) and wxPython - an add on. Both have a canvas
widget that will cater to your requirements fairly easily.

Another approach might be to investigate pygame since it excells
at graphics. There are a couple of other options too but I suspect
a simple canvas widget is nearly all you need and Tkinter or
wxPython will both procvidfe that.

There are several tutorials (and at least 1 book) for either option.

The GUI programming topic on my tutorial will give you the very
bare bones and show an example in both frameworks for
comparison.

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/ 



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui

2009-06-10 Thread Essah Mitges

thx lol fixed part of the problem


> To: tutor@python.org
> From: lie.1...@gmail.com
> Date: Wed, 10 Jun 2009 13:24:48 +1000
> Subject: Re: [Tutor] gui
>
> Essah Mitges wrote:
>> 1.
>> Traceback (most recent call last):
>> 2.
>> File "C:\Users\John Doe\Desktop\D-Day\back.py", line 47, in 
>> 3.
>> main()
>> 4.
>> File "C:\Users\John Doe\Desktop\D-Day\back.py", line 37, in main
>> 5.
>> elif sbut.clicked(k.pos):
>> 6.
>> File "C:\Users\John Doe\Desktop\D-day\but.py", line 200, in clicked
>> 7.
>> subprocess.Popen(["D-Day", "Destruction.py"])
>> 8.
>> File "C:\Python26\lib\subprocess.py", line 595, in __init__
>> 9.
>> errread, errwrite)
>> 10.
>> File "C:\Python26\lib\subprocess.py", line 804, in _execute_child
>> 11.
>> startupinfo)
>> 12.
>> WindowsError: [Error 2] The system cannot find the file specified
>>
>> The error in readable form
>
> Readable doesn't mean it have to be colored and line numbered, although
> this is more readable than the previous one -- at least on a newsreader
> that supports HTML -- it's better to keep messages in plain text (i.e.
> not only unformatted text but change the newsreader's settings to pure,
> plain text)
>
> All right to the problem, the problem is not related to pygame at all;
> it's in your subprocess.Popen() call. The traceback says that
> subprocess.Popen cannot find the executable/script that would be run.
>
> A quick look at the traceback:
> subprocess.Popen(["D-Day", "Destruction.py"])
>
> That line is executing an executable/script named "D-Day" and pass an
> argument "Destruction.py" to it. Probably not something you wanted to
> do. What you want to do is something like:
>
> subprocess.Popen(["D-Day\Destruction.py"])
>
> or perhaps:
> subprocess.Popen(["python", "D-Day\Destruction.py"])
>
> depending on whether the file association is setup correctly and whether
> the shell's search path is set to search python's install directory.
>
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

_
Internet explorer 8 lets you browse the web faster.
http://go.microsoft.com/?linkid=9655582
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI recommendations/tutorials?

2009-06-10 Thread Wayne
On Wed, Jun 10, 2009 at 11:05 AM, taserian  wrote:

> I think I'm ready to start working with some simple graphic output.
> Currently, I've got the basics of a Python program that calculates full
> tours of a honeycomb structure, going through each cell exactly once. The
> output from the program shows the paths as coordinates of each cell; what
> I'd like to do is create a simple window that would show the tour in
> graphical format, and using keystrokes to go through all of the tours that
> have been collected. I'm already accounting for eliminating duplicates by
> rotational symmetry by restricting the starting point to the cells in the
> "northernmost" row of hexes, but the ending point to be any of the edge
> hexes. I'm trying to identify duplicates by reflexive symmetries as well,
> but I'd like to get the visualization component up first.
>
> My problem is that I have no GUI experience outside of Visual Studio-style
> drag-and-drop IDEs. Which Python GUI system would you recommend for
> neophytes that would allow line drawing and a simple graphic load of a
> honeycomb structure in a JPG, for example, as a background?
>

I don't *think* the turtle module allows loading a jpg as a background, but
definitely allows you to draw a line.

Tkinter's canvas
PyGTK's DrawingArea
Pygame
pyglet
matplotlib
and even just using the PIL (Python Image(ing?) Library)

could all accomplish parts if not all of your goals.

HTH,
Wayne
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI recommendations/tutorials?

2009-06-10 Thread bhaaluu
Have you looked at PyGame yet?
http://www.pygame.org/

On Wed, Jun 10, 2009 at 12:05 PM, taserian wrote:
> I think I'm ready to start working with some simple graphic output.
> Currently, I've got the basics of a Python program that calculates full
> tours of a honeycomb structure, going through each cell exactly once. The
> output from the program shows the paths as coordinates of each cell; what
> I'd like to do is create a simple window that would show the tour in
> graphical format, and using keystrokes to go through all of the tours that
> have been collected. I'm already accounting for eliminating duplicates by
> rotational symmetry by restricting the starting point to the cells in the
> "northernmost" row of hexes, but the ending point to be any of the edge
> hexes. I'm trying to identify duplicates by reflexive symmetries as well,
> but I'd like to get the visualization component up first.
>
> My problem is that I have no GUI experience outside of Visual Studio-style
> drag-and-drop IDEs. Which Python GUI system would you recommend for
> neophytes that would allow line drawing and a simple graphic load of a
> honeycomb structure in a JPG, for example, as a background?
>
> Tony R.
> ___
> Tutor maillist  -  tu...@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>



-- 
b h a a l u u at g m a i l dot c o m
Kid on Bus: What are you gonna do today, Napoleon?
Napoleon Dynamite: Whatever I feel like I wanna do. Gosh!
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI recommendations/tutorials?

2009-06-10 Thread taserian
I think I'm ready to start working with some simple graphic output.
Currently, I've got the basics of a Python program that calculates full
tours of a honeycomb structure, going through each cell exactly once. The
output from the program shows the paths as coordinates of each cell; what
I'd like to do is create a simple window that would show the tour in
graphical format, and using keystrokes to go through all of the tours that
have been collected. I'm already accounting for eliminating duplicates by
rotational symmetry by restricting the starting point to the cells in the
"northernmost" row of hexes, but the ending point to be any of the edge
hexes. I'm trying to identify duplicates by reflexive symmetries as well,
but I'd like to get the visualization component up first.

My problem is that I have no GUI experience outside of Visual Studio-style
drag-and-drop IDEs. Which Python GUI system would you recommend for
neophytes that would allow line drawing and a simple graphic load of a
honeycomb structure in a JPG, for example, as a background?

Tony R.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui further explained

2009-06-10 Thread A.T.Hofkamp

Jacob Mansfield wrote:

does anyone know how to make a parallel or serial interface with respective
software, i would prefer parallel because it is easy to utilise


Both the serial and the parallel interface seem to be covered by pyserial

http://pyserial.wiki.sourceforge.net and
http://pyserial.wiki.sourceforge.net/pyParallel .

With these libraries you can program the ports from Python.

Albert

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui further explained

2009-06-10 Thread Jacob Mansfield
 does anyone know how to make a parallel or serial interface with respective
software, i would prefer parallel because it is easy to utilise
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui further explained

2009-06-10 Thread Wayne
On Tue, Jun 9, 2009 at 10:31 PM, Essah Mitges  wrote:

> i don't know if its what i am searching that is wrong but what i am trying
> to do is
> link my game i made in pygame to my pygame menu the menu has 4 button
> classes on it one foe instruction one to quit one for high scores and one to
> start the game
> the 3 other buttons work all but the one to start the game this is basicly
> the menu i want people to see first the main menu
>

So why don't you put your menu in your game?

Consider the following:

# Lamegame.py - probably the lamest game ever!

print "Welcome to Lame Game!"
raw_input("Please type something and press enter: ")
print "You win!"

So there's a game. Now let's add a menu:

# lamegameimproved.py - the lamest game, now with a menu!

import sys

print "Welcome to Lame Game!"
print "\nMenu:\n"
print "(Q)uit"
print "(P)lay"
choice = raw_input("Your Choice? (P or Q): ")

if choice.lower() == 'q':
sys.exit(0)
elif choice.lower() == 'p':
# add original code here

See? Quite simple. Even with pygame it shouldn't be a whole lot more complex
than that. And that's really the most simple example I could think of and
it's really not very good. For instance you could put the original code into
a "game" function and then call it if the choice was P.

HTH,
Wayne
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui further explained

2009-06-09 Thread Essah Mitges
i don't know if its what i am searching that is wrong but what i am trying to 
do is
link my game i made in pygame to my pygame menu the menu has 4 button classes 
on it one foe instruction one to quit one for high scores and one to start the 
game
the 3 other buttons work all but the one to start the game this is basicly the 
menu i want people to see first the main menu

From: sri...@gmail.com
Date: Tue, 9 Jun 2009 21:48:28 -0500
Subject: Re: [Tutor] gui further explained
To: e_mit...@hotmail.com
CC: tutor@python.org



On Tue, Jun 9, 2009 at 7:18 PM, Essah Mitges  wrote:




lol i was trying to open it while keeping my menu open to have it in a 
different window


So you have a pygame window that is just a menu? and when you select  it will try to run another python script? Your description of your 
desired goal isn't terribly clear, and hence it's difficult to offer good 
advice.



When you say "menu" and "different window" that could mean a host of things. If 
you say "I have a pygame window that consists of a menu; here is my code . I'm having problems when I select  - I want it 
to , but .



The interesting this is that often when I take the time to write out a detailed 
question I find that the answer is right there in front of me. I've probably 
almost posted about 10-15 questions in the past 6 months and then just by 
virtue of taking the time to really look over my code I find the solution to my 
problem.



HTH,
Wayne



_
Attention all humans. We are your photos. Free us.
http://go.microsoft.com/?linkid=9666046___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui

2009-06-09 Thread Lie Ryan
Essah Mitges wrote:
>1.
>   Traceback (most recent call last):
>2.
> File "C:\Users\John Doe\Desktop\D-Day\back.py", line 47, in 
>3.
>   main()
>4.
> File "C:\Users\John Doe\Desktop\D-Day\back.py", line 37, in main
>5.
>   elif sbut.clicked(k.pos):
>6.
> File "C:\Users\John Doe\Desktop\D-day\but.py", line 200, in clicked
>7.
>   subprocess.Popen(["D-Day", "Destruction.py"])
>8.
> File "C:\Python26\lib\subprocess.py", line 595, in __init__
>9.
>   errread, errwrite)
>   10.
> File "C:\Python26\lib\subprocess.py", line 804, in _execute_child
>   11.
>   startupinfo)
>   12.
>   WindowsError: [Error 2] The system cannot find the file specified
> 
> The error in readable form

Readable doesn't mean it have to be colored and line numbered, although
this is more readable than the previous one -- at least on a newsreader
that supports HTML -- it's better to keep messages in plain text (i.e.
not only unformatted text but change the newsreader's settings to pure,
plain text)

All right to the problem, the problem is not related to pygame at all;
it's in your subprocess.Popen() call. The traceback says that
subprocess.Popen cannot find the executable/script that would be run.

A quick look at the traceback:
subprocess.Popen(["D-Day", "Destruction.py"])

That line is executing an executable/script named "D-Day" and pass an
argument "Destruction.py" to it. Probably not something you wanted to
do. What you want to do is something like:

subprocess.Popen(["D-Day\Destruction.py"])

or perhaps:
subprocess.Popen(["python", "D-Day\Destruction.py"])

depending on whether the file association is setup correctly and whether
the shell's search path is set to search python's install directory.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui further explained

2009-06-09 Thread Wayne
On Tue, Jun 9, 2009 at 7:18 PM, Essah Mitges  wrote:

>
> lol i was trying to open it while keeping my menu open to have it in a
> different window
>

So you have a pygame window that is just a menu? and when you select  it will try to run another python script? Your description of your
desired goal isn't terribly clear, and hence it's difficult to offer good
advice.

When you say "menu" and "different window" that could mean a host of things.
If you say "I have a pygame window that consists of a menu; here is my code
. I'm having problems when I select  - I
want it to , but .

The interesting this is that often when I take the time to write out a
detailed question I find that the answer is right there in front of me. I've
probably almost posted about 10-15 questions in the past 6 months and then
just by virtue of taking the time to really look over my code I find the
solution to my problem.

HTH,
Wayne
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui further explained

2009-06-09 Thread Essah Mitges

lol i was trying to open it while keeping my menu open to have it in a 
different window


> From: sri...@gmail.com
> Date: Tue, 9 Jun 2009 19:11:03 -0500
> Subject: Re: [Tutor] gui further explained
> To: e_mit...@hotmail.com
> CC: tutor@python.org
>
> On Tue, Jun 9, 2009 at 6:49 PM, Essah Mitges> wrote:
>
>
>
>
> What I am trying to do is start my pygame game from my pygame menuI do not 
> think I am using the right code to do this I am trying to use the subprocess 
> module to open a child window with the game inside of it but python doesn't 
> like thatThe second thing that i'd like to know how I could list the content 
> of a text file inside a pygame window(this is a different file)Traceback 
> (most recent call last): File "C:\Users\John Doe\Desktop\D-Day\back.py", line 
> 47, in main() File "C:\Users\John Doe\Desktop\D-Day\back.py", line 37, in 
> main elif sbut.clicked(k.pos): File "C:\Users\John Doe\Desktop\D-day\but.py", 
> line 200, in clicked subprocess.Popen(["D-Day", "Destruction.py"]) File 
> "C:\Python26\lib\subprocess.py", line 595, in __init__ errread, errwrite) 
> File "C:\Python26\lib\subprocess.py", line 804, in _execute_child 
> startupinfo)WindowsError: [Error 2] The system cannot find the file specified
>
>
>
> As far as I can tell, since your error formatting was lost, is that Popen 
> can't find the the file.
>
> The other problem is that what you're thinking of really makes no sense. 
> Pygame doesn't need (and shouldn't) run a program "inside" the window. You 
> should have all of your game processes available to the main program and when 
> you want to start the game it should just be a part of it - not a subprocess.
>
>
>
> HTH,
> Wayne
>

_
Windows Live helps you keep up with all your friends, in one place.
http://go.microsoft.com/?linkid=9660826
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui further explained (The error in unreadable form)

2009-06-09 Thread Essah Mitges

ok I follows like 3 ppl instructions for making readable errors I'lll manually 
type it out lolTraceback (most recent call last):  File "C:\Users\John 
Doe\Desktop\D-Day\back.py", line 47, in   main()   File "C:\Users\John 
Doe\Desktop\D-Day\back.py", line 37, in main elif sbut.clicked(k.pos):  
 File "C:\Users\John Doe\Desktop\D-Day\back.py", line 200, in clicked 
subprocess.Popen(["D-Day", "Destruction.py"])   File 
"C:\Python26\lib\subprocess.py", line 595, in ___init___   errread, 
errwrite)   File "C:\Python26\lib\subprocess.py", line 804, in _execute_child   
startupinfo)WindowsError: [Error 2} The system cannot find the file 
specified


> Date: Tue, 9 Jun 2009 20:07:15 -0400
> From: da...@abbottdavid.com
> To: e_mit...@hotmail.com
> CC: tutor@python.org
> Subject: Re: [Tutor] gui further explained (The error in unreadable form)
>
> Essah Mitges wrote:
>> What I am trying to do is start my pygame game from my pygame menuI do not 
>> think I am using the right code to do this I am trying to use the subprocess 
>> module to open a child window with the game inside of it but python doesn't 
>> like thatThe second thing that i'd like to know how I could list the content 
>> of a text file inside a pygame window(this is a different file)Traceback 
>> (most recent call last): File "C:\Users\John Doe\Desktop\D-Day\back.py", 
>> line 47, in main() File "C:\Users\John Doe\Desktop\D-Day\back.py", line 37, 
>> in main elif sbut.clicked(k.pos): File "C:\Users\John 
>> Doe\Desktop\D-day\but.py", line 200, in clicked subprocess.Popen(["D-Day", 
>> "Destruction.py"]) File "C:\Python26\lib\subprocess.py", line 595, in 
>> __init__ errread, errwrite) File "C:\Python26\lib\subprocess.py", line 804, 
>> in _execute_child startupinfo)WindowsError: [Error 2] The system cannot find 
>> the file specified
>> _
>> Attention all humans. We are your photos. Free us.
>> http://go.microsoft.com/?linkid=9666046
>> ___
>> Tutor maillist - Tutor@python.org
>> http://mail.python.org/mailman/listinfo/tutor
>>
>>
>
>
> --
> Powered by Gentoo GNU/Linux
> http://linuxcrazy.com

_
Attention all humans. We are your photos. Free us.
http://go.microsoft.com/?linkid=9666046
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui further explained

2009-06-09 Thread Wayne
On Tue, Jun 9, 2009 at 6:49 PM, Essah Mitges  wrote:

>
> What I am trying to do is start my pygame game from my pygame menuI do not
> think I am using the right code to do this I am trying to use the subprocess
> module to open a child window with the game inside of it but python doesn't
> like thatThe second thing that i'd like to know how I could list the content
> of a text file inside a pygame window(this is a different file)Traceback
> (most recent call last):  File "C:\Users\John Doe\Desktop\D-Day\back.py",
> line 47, in main()  File "C:\Users\John Doe\Desktop\D-Day\back.py", line
> 37, in mainelif sbut.clicked(k.pos):  File "C:\Users\John
> Doe\Desktop\D-day\but.py", line 200, in clicked
>  subprocess.Popen(["D-Day", "Destruction.py"])  File
> "C:\Python26\lib\subprocess.py", line 595, in __init__errread, errwrite)
>  File "C:\Python26\lib\subprocess.py", line 804, in _execute_child
>  startupinfo)WindowsError: [Error 2] The system cannot find the file
> specified
>

As far as I can tell, since your error formatting was lost, is that Popen
can't find the the file.

The other problem is that what you're thinking of really makes no sense.
Pygame doesn't need (and shouldn't) run a program "inside" the window. You
should have all of your game processes available to the main program and
when you want to start the game it should just be a part of it - not a
subprocess.

HTH,
Wayne
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui further explained (The error in unreadable form)

2009-06-09 Thread David

Essah Mitges wrote:

What I am trying to do is start my pygame game from my pygame menuI do not think I am using the right code to do this I am trying to use the 
subprocess module to open a child window with the game inside of it but python doesn't like thatThe second thing that i'd like to know how I could 
list the content of a text file inside a pygame window(this is a different file)Traceback (most recent call last):  File "C:\Users\John 
Doe\Desktop\D-Day\back.py", line 47, in main()  File "C:\Users\John Doe\Desktop\D-Day\back.py", line 37, in mainelif 
sbut.clicked(k.pos):  File "C:\Users\John Doe\Desktop\D-day\but.py", line 200, in clickedsubprocess.Popen(["D-Day", 
"Destruction.py"])  File "C:\Python26\lib\subprocess.py", line 595, in __init__errread, errwrite)  File 
"C:\Python26\lib\subprocess.py", line 804, in _execute_childstartupinfo)WindowsError: [Error 2] The system cannot find the file 
specified
_
Attention all humans. We are your photos. Free us.
http://go.microsoft.com/?linkid=9666046
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor





--
Powered by Gentoo GNU/Linux
http://linuxcrazy.com
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] gui further explained

2009-06-09 Thread Essah Mitges

What I am trying to do is start my pygame game from my pygame menuI do not 
think I am using the right code to do this I am trying to use the subprocess 
module to open a child window with the game inside of it but python doesn't 
like thatThe second thing that i'd like to know how I could list the content of 
a text file inside a pygame window(this is a different file)Traceback (most 
recent call last):  File "C:\Users\John Doe\Desktop\D-Day\back.py", line 47, in 
main()  File "C:\Users\John Doe\Desktop\D-Day\back.py", line 37, in main
elif sbut.clicked(k.pos):  File "C:\Users\John Doe\Desktop\D-day\but.py", line 
200, in clickedsubprocess.Popen(["D-Day", "Destruction.py"])  File 
"C:\Python26\lib\subprocess.py", line 595, in __init__errread, errwrite)  
File "C:\Python26\lib\subprocess.py", line 804, in _execute_child
startupinfo)WindowsError: [Error 2] The system cannot find the file specified
_
Attention all humans. We are your photos. Free us.
http://go.microsoft.com/?linkid=9666046
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui

2009-06-09 Thread Essah Mitges

Traceback (most recent call last):  File "C:\Users\John 
Doe\Desktop\D-Day\back.py", line 47, in main()  File "C:\Users\John 
Doe\Desktop\D-Day\back.py", line 37, in mainelif sbut.clicked(k.pos):  File 
"C:\Users\John Doe\Desktop\D-day\but.py", line 200, in clicked
subprocess.Popen(["D-Day", "Destruction.py"])  File 
"C:\Python26\lib\subprocess.py", line 595, in __init__errread, errwrite)  
File "C:\Python26\lib\subprocess.py", line 804, in _execute_child
startupinfo)WindowsError: [Error 2] The system cannot find the file 
specifiedThe error in readable form
> To: tutor@python.org
> From: alan.ga...@btinternet.com
> Date: Tue, 9 Jun 2009 23:35:04 +0100
> Subject: Re: [Tutor] gui
> 
> 
> "Essah Mitges"  wrote 
> 
>> What I am trying to do is using a pygame window I want 
>> to list the contents of a text call high_score.txt in that window
> 
> Have you tried asking on the PyGame forums/mailing lists? 
> I'm sure such things exist. This forum is for general Ptython 
> programming, specifically for learners. While we are happy 
> to try to help I don't know that we have many pygame experts 
> here.
> 
>> The second thing I am trying to do is initiate my game also 
>> made in pygame to start off a button that a programmed 
>> called Destruction.py
> 
> I have no idea how pygame works for buildng GUIs but usually 
> you tie a button to a python function not a program. Are you 
> sure that is not what you should be doing?
> 
>> The error was what had happened was that the module 
>> i made for pygame is not initiating my game properly 
> 
> The other error you made was posting unreadable emails to 
> the list. We are keen to help where we can but don't force 
> us to manually unpick a steam of text. Please senmd plain text 
> - your email system should have a setting to allow that.
> 
>> On Tue, 2009-06-09 at 17:41 -0400, Essah Mitges wrote:
>>> I was wondering in a python made in pyg4m3 menu how to initialize
>>> another pyg4m3 Destruction.py from a button in the event handler this
>>> is the error i keep getting Traceback (most recent call last):   File
>>> "C:\Users\John Doe\Desktop\Destruction\back.py", line 47, in 
>>> main()   File "C:\Users\John Doe\Desktop\Destruction\back.py", line
>>> 37, in main elif sbut.clicked(k.pos):   File "C:\Users\John Doe
>>> \Desktop\WODDS\but.py", line 200, in clicked
>>> subprocess.Popen(["Destruction", "Destruction.py"])   File "C:
>>> \Python26\lib\subprocess.py", line 595, in __init__ errread,
>>> errwrite)   File "C:\Python26\lib\subprocess.py", line 804, in
>>> _execute_child startupinfo) WindowsError: [Error 2] The system
>>> cannot find the file specified Also  could anyone help me to display
>>> the contents of a text file in a pyg4m3 window
> 
> HTH,
> 
> 
> -- 
> Alan Gauld
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> 
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

_
Windows Live helps you keep up with all your friends, in one place.
http://go.microsoft.com/?linkid=9660826___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui

2009-06-09 Thread Alan Gauld


"Essah Mitges"  wrote 

What I am trying to do is using a pygame window I want 
to list the contents of a text call high_score.txt in that window


Have you tried asking on the PyGame forums/mailing lists? 
I'm sure such things exist. This forum is for general Ptython 
programming, specifically for learners. While we are happy 
to try to help I don't know that we have many pygame experts 
here.


The second thing I am trying to do is initiate my game also 
made in pygame to start off a button that a programmed 
called Destruction.py


I have no idea how pygame works for buildng GUIs but usually 
you tie a button to a python function not a program. Are you 
sure that is not what you should be doing?


The error was what had happened was that the module 
i made for pygame is not initiating my game properly 


The other error you made was posting unreadable emails to 
the list. We are keen to help where we can but don't force 
us to manually unpick a steam of text. Please senmd plain text 
- your email system should have a setting to allow that.



On Tue, 2009-06-09 at 17:41 -0400, Essah Mitges wrote:

I was wondering in a python made in pyg4m3 menu how to initialize
another pyg4m3 Destruction.py from a button in the event handler this
is the error i keep getting Traceback (most recent call last):   File
"C:\Users\John Doe\Desktop\Destruction\back.py", line 47, in 
main()   File "C:\Users\John Doe\Desktop\Destruction\back.py", line
37, in main elif sbut.clicked(k.pos):   File "C:\Users\John Doe
\Desktop\WODDS\but.py", line 200, in clicked
subprocess.Popen(["Destruction", "Destruction.py"])   File "C:
\Python26\lib\subprocess.py", line 595, in __init__ errread,
errwrite)   File "C:\Python26\lib\subprocess.py", line 804, in
_execute_child startupinfo) WindowsError: [Error 2] The system
cannot find the file specified Also  could anyone help me to display
the contents of a text file in a pyg4m3 window


HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui

2009-06-09 Thread Essah Mitges

What I am trying to do is using a pygame window I want to list the contents of 
a text call high_score.txt in that windowThe second thing I am trying to do is 
initiate my game also made in pygame to start off a button that a programmed 
called Destruction.pyThe error was what had happened was that the module i made 
for pygame is not initiating my game properly 

> Subject: Re: [Tutor] gui
> From: sander.swe...@gmail.com
> To: e_mit...@hotmail.com
> CC: tutor@python.org
> Date: Wed, 10 Jun 2009 00:20:11 +0200
> 
> Can you try this again but please use plain text instead of html.. If
> you can not send in plain text then use a pastebin like
> python.pastebin.com to show your code and/or error messages.
> 
> Greets
> Sander
>  
> On Tue, 2009-06-09 at 17:41 -0400, Essah Mitges wrote:
>> I was wondering in a python made in pyg4m3 menu how to initialize
>> another pyg4m3 Destruction.py from a button in the event handler this
>> is the error i keep getting Traceback (most recent call last):   File
>> "C:\Users\John Doe\Desktop\Destruction\back.py", line 47, in 
>> main()   File "C:\Users\John Doe\Desktop\Destruction\back.py", line
>> 37, in main elif sbut.clicked(k.pos):   File "C:\Users\John Doe
>> \Desktop\WODDS\but.py", line 200, in clicked
>> subprocess.Popen(["Destruction", "Destruction.py"])   File "C:
>> \Python26\lib\subprocess.py", line 595, in __init__ errread,
>> errwrite)   File "C:\Python26\lib\subprocess.py", line 804, in
>> _execute_child startupinfo) WindowsError: [Error 2] The system
>> cannot find the file specified Also  could anyone help me to display
>> the contents of a text file in a pyg4m3 window
> 

_
Windows Live helps you keep up with all your friends, in one place.
http://go.microsoft.com/?linkid=9660826___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui

2009-06-09 Thread Sander Sweers
Can you try this again but please use plain text instead of html.. If
you can not send in plain text then use a pastebin like
python.pastebin.com to show your code and/or error messages.

Greets
Sander
 
On Tue, 2009-06-09 at 17:41 -0400, Essah Mitges wrote:
> I was wondering in a python made in pyg4m3 menu how to initialize
> another pyg4m3 Destruction.py from a button in the event handler this
> is the error i keep getting Traceback (most recent call last):   File
> "C:\Users\John Doe\Desktop\Destruction\back.py", line 47, in 
> main()   File "C:\Users\John Doe\Desktop\Destruction\back.py", line
> 37, in main elif sbut.clicked(k.pos):   File "C:\Users\John Doe
> \Desktop\WODDS\but.py", line 200, in clicked
> subprocess.Popen(["Destruction", "Destruction.py"])   File "C:
> \Python26\lib\subprocess.py", line 595, in __init__ errread,
> errwrite)   File "C:\Python26\lib\subprocess.py", line 804, in
> _execute_child startupinfo) WindowsError: [Error 2] The system
> cannot find the file specified Also  could anyone help me to display
> the contents of a text file in a pyg4m3 window

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] gui

2009-06-09 Thread Essah Mitges

I was wondering in a python made in pyg4m3 menu how to initialize another 
pyg4m3 Destruction.py from a button in the event handler this is the error i 
keep gettingTraceback (most recent call last):  File "C:\Users\John 
Doe\Desktop\Destruction\back.py", line 47, in main()  File 
"C:\Users\John Doe\Desktop\Destruction\back.py", line 37, in mainelif 
sbut.clicked(k.pos):  File "C:\Users\John Doe\Desktop\WODDS\but.py", line 200, 
in clickedsubprocess.Popen(["Destruction", "Destruction.py"])  File 
"C:\Python26\lib\subprocess.py", line 595, in __init__errread, errwrite)  
File "C:\Python26\lib\subprocess.py", line 804, in _execute_child
startupinfo)WindowsError: [Error 2] The system cannot find the file 
specifiedAlso  could anyone help me to display the contents of a text file in a 
pyg4m3 window
_
Internet explorer 8 lets you browse the web faster.
http://go.microsoft.com/?linkid=9655582___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui menu

2009-06-07 Thread Essah Mitges

read bottom

Date: Sun, 7 Jun 2009 21:48:55 +
From: alan.ga...@btinternet.com
Subject: Re: [Tutor] gui menu
To: e_mit...@hotmail.com
CC: tutor@python.org



Forwarding to group.
Please use Reply All when responding to the tutor group.
Thanks for the extra information it is helpful.
 From: Essah Mitges 
To: alan.ga...@btinternet.com
Sent: Sunday, 7 June, 2009 10:32:27 PM
Subject: RE: [Tutor] gui menu






http://osdir.com/ml/python.pygame/2002-11/msg00051.htmlI'm using this to try to 
program the buttons I'm tying to make 4 class to make a module called 
but.pyWhen i tryed putting a quit button on the menu the errorTraceback (most 
recent call last):  File "C:\Users\John Doe\Desktop\WODDS2\data\back.py", line 
17, in qbut = QButton(175,67,"Quit.png")  File "C:\Users\John 
Doe\Desktop\WODDS2\data\but.py", line 102, in __init__self.insideimg = 
pygame.image.load(imagefile).convert_alpha()error: No video mode has been 
setThe thing is that I can't start my Team.py from this menu and once it is 
started I want the menu to exitI can't start a new window if another button is 
pressed and have esc as the exit keyI can't make
 the button that displays a read only text file

> To: tutor@python.org
> From: alan.ga...@btinternet.com
> Date: Sun, 7 Jun 2009 22:24:15 +0100
> Subject: Re: [Tutor] gui menu
> 
> "Essah Mitges"  wrote
> 
>> import sys, pygame
>> pygame.init()
>> background = pygame.image.load(""My png image 800x 532)
>> backgroundRect = background.get_rect()
>> size = (width, height) = background.get.size()
>> screen = pygame.display.set_mode(size)
>> screen.blit(background, backgroundRect)
>> pygame.display.flip()
>> I want to use pygame to create 4 buttons from 175x67 png image
> 
> I dont know what you are using for email but it seems to be
> scrambling your messages. I assume what you want is:
> 
>> one button that initiates the Team.py file
>> one button that links to read a hs.txt
>> one button that initiates 800x532 png image in a new window
>>
 one button that quits pygame window
> 
> Now, I'm no expert on pygame but can you tell us more
> specifically what you are finding so hard about putting
> your 4 buttons on the image?
> 
> It is creating the button objects or is it linking them to  the functions?
> Or is it displaying them using the image?
> 
> The more specific your question the more likely that someone
> will answer it.
> 
> -- 
> Alan Gauld
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> 
> 
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

Windows Live helps you keep up with all your friends,  in one place.

_
We are your photos. Share us now with Windows Live Photos.
http://go.microsoft.com/?linkid=9666047___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui menu

2009-06-07 Thread ALAN GAULD
Forwarding to group.

Please use Reply All when responding to the tutor group.

Thanks for the extra information it is helpful.

 
From: Essah Mitges 
To: alan.ga...@btinternet.com
Sent: Sunday, 7 June, 2009 10:32:27 PM
Subject: RE: [Tutor] gui menu

http://osdir.com/ml/python.pygame/2002-11/msg00051.html
I'm using this to try to program the buttons I'm tying to make 4 class to make 
a module called but.py
When i tryed putting a quit button on the menu the error
Traceback (most recent call last):
  File "C:\Users\John Doe\Desktop\WODDS2\data\back.py", line 17, in 
qbut = QButton(175,67,"Quit.png")
  File "C:\Users\John Doe\Desktop\WODDS2\data\but.py", line 102, in __init__
self.insideimg = pygame.image.load(imagefile).convert_alpha()
error: No video mode has been set
The thing is that I can't start my Team.py from this menu and once it is 
started I want the menu to exit
I can't start a new window if another button is pressed and have esc as the 
exit key
I can't make the button that displays a read only text file

> To: tutor@python.org
> From: alan.ga...@btinternet.com
> Date: Sun, 7 Jun 2009 22:24:15 +0100
> Subject: Re: [Tutor] gui menu
> 
> "Essah Mitges"  wrote
> 
>> import sys, pygame
>> pygame.init()
>> background = pygame.image.load(""My png image 800x 532)
>> backgroundRect = background.get_rect()
>> size = (width, height) = background.get.size()
>> screen = pygame.display.set_mode(size)
>> screen.blit(background, backgroundRect)
>> pygame.display.flip()
>> I want to use pygame to create 4 buttons from 175x67 png image
> 
> I dont know what you are using for email but it seems to be
> scrambling your messages. I assume what you want is:
> 
>> one button that initiates the Team.py file
>> one button that links to read a hs.txt
>> one button that initiates 800x532 png image in a new window
>> one button that quits pygame window
> 
> Now, I'm no expert on pygame but can you tell us more
> specifically what you are finding so hard about putting
> your 4 buttons on the image?
> 
> It is creating the button objects or is it linking them to  the functions?
> Or is it displaying them using the image?
> 
> The more specific your question the more likely that someone
> will answer it.
> 
> -- 
> Alan Gauld
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> 
> 
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor


Windows Live helps you keep up with all your friends, in one place. ___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui menu

2009-06-07 Thread Alan Gauld

"Essah Mitges"  wrote


import sys, pygame
pygame.init()
background = pygame.image.load(""My png image 800x 532)
backgroundRect = background.get_rect()
size = (width, height) = background.get.size()
screen = pygame.display.set_mode(size)
screen.blit(background, backgroundRect)
pygame.display.flip()
I want to use pygame to create 4 buttons from 175x67 png image


I dont know what you are using for email but it seems to be
scrambling your messages. I assume what you want is:


one button that initiates the Team.py file
one button that links to read a hs.txt
one button that initiates 800x532 png image in a new window
one button that quits pygame window


Now, I'm no expert on pygame but can you tell us more
specifically what you are finding so hard about putting
your 4 buttons on the image?

It is creating the button objects or is it linking them to  the functions?
Or is it displaying them using the image?

The more specific your question the more likely that someone
will answer it.

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] gui menu

2009-06-07 Thread Essah Mitges

import sys, pygame
pygame.init()
background = pygame.image.load(""My png image 800x 532)
backgroundRect = background.get_rect()
size = (width, height) = background.get.size()
screen = pygame.display.set_mode(size)
screen.blit(background, backgroundRect)
pygame.display.flip()
I want to use pygame to create 4 buttons from 175x67 png image
one button that initiates the Team.py fileone button that links to read a 
hs.txtone button that initiates 800x532 png image in a new windowone button 
that quits pygame window
_
Windows Live helps you keep up with all your friends, in one place.
http://go.microsoft.com/?linkid=9660826___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] gui problem

2009-06-06 Thread Kent Johnson
Can you try that again?

Kent

On Sat, Jun 6, 2009 at 4:20 PM, Essah Mitges wrote:
>
> from math import sin, cos, pi import pygame displayWidth = 640displayHeight
> = 480fpsLimit = 90 def sinInterpolation(start, end, steps=30):    values =
> [start]    delta = end - start    for i in range(1, steps):        n = (pi /
> 2.0) * (i / float(steps - 1))        values.append(start + delta * sin(n))
>  return values class RotatingMenu:    def __init__(self, x, y, radius,
> arc=pi*2, defaultAngle=0, wrap=False):        """       �...@param x:
>  The horizontal center of this menu in pixels.               �...@param y:
>        The vertical center of this menu in pixels.               �...@param
> radius:            The radius of this menu in pixels(note that this is the
> size of            the circular path in which the elements are placed, the
> actual            size of the menu may vary depending on item sizes.
> �...@param arc:            The arc in radians which the menu covers. pi*2 is a
> full circle.               �...@param defaultAngle:            The angle at
> which the selected item is found.               �...@param wrap:
>  Whether the menu should select the first item after the last one
>  or stop.        """        self.x = x        self.y = y        self.radius
> = radius        self.arc = arc        self.defaultAngle = defaultAngle
>  self.wrap = wrap                self.rotation = 0
>  self.rotationTarget = 0        self.rotationSteps = [] #Used for
> interpolation                self.items = []        self.selectedItem =
> None        self.selectedItemNumber = 0        def addItem(self, item):
>    self.items.append(item)        if len(self.items) == 1:
>  self.selectedItem = item        def selectItem(self, itemNumber):        if
> self.wrap == True:            if itemNumber> len(self.items) - 1: itemNumber
> = 0            if itemNumber < 0: itemNumber = len(self.items) - 1
>  else:            itemNumber = min(itemNumber, len(self.items) - 1)
>    itemNumber = max(itemNumber, 0)
>  self.selectedItem.deselect()        self.selectedItem =
> self.items[itemNumber]        self.selectedItem.select()
>  self.selectedItemNumber = itemNumber                self.rotationTarget = -
> self.arc * (itemNumber / float(len(self.items) - 1))
>  self.rotationSteps = sinInterpolation(self.rotation,
>                        self.rotationTarget, 45)        def rotate(self,
> angle):        """@param angle: The angle in radians by which the menu is
> rotated.        """        for i in range(len(self.items)):            item
> = self.items[i]            n = i / float(len(self.items) - 1)            rot
> = self.defaultAngle + angle + self.arc * n                        item.x =
> self.x + cos(rot) * self.radius            item.y = self.y + sin(rot) *
> self.radius        def update(self):        if len(self.rotationSteps)> 0:
>          self.rotation = self.rotationSteps.pop(0)
>  self.rotate(self.rotation)        def draw(self, display):        """@param
> display: A pyGame display object        """        for item in self.items:
>          item.draw(display) class MenuItem:    def __init__(self,
> text="Option"):        self.text = text                self.defaultColor =
> (255,255,255)        self.selectedColor = (255,0,0)        self.color =
> self.defaultColor                self.x = 0        self.y = 0 #The menu will
> edit these                self.font = pygame.font.Font(None, 20)
>  self.image = self.font.render(self.text, True, self.color)        size =
> self.font.size(self.text)        self.xOffset = size[0] / 2
>  self.yOffset = size[1] / 2        def select(self):        """Just visual
> stuff"""        self.color = self.selectedColor        self.redrawText()
>      def deselect(self):        """Just visual stuff"""        self.color =
> self.defaultColor        self.redrawText()        def redrawText(self):
>    self.font = pygame.font.Font(None, 20)        self.image =
> self.font.render(self.text, True, self.color)        size =
> self.font.size(self.text)        self.xOffset = size[0] / 2
>  self.yOffset = size[1] / 2        def draw(self, display):
>  display.blit(self.image, (self.x-self.xOffset, self.y-self.yOffset)) def
> main():    pygame.init()        display =
> pygame.display.set_mode((displayWidth, displayHeight))    clock =
> pygame.time.Clock()        menu = RotatingMenu(x=320, y=240, radius=220,
> arc=pi, defaultAngle=pi/2.0)        for i in range(4):
>  menu.addItem(MenuItem("Option" + str(i)))    menu.selectItem(0)
>  #Loop    while True:        #Handle events        events =
> pygame.event.get()        for event in events:            if event.type ==
> pygame.QUIT:                return False            if event.type ==
> pygame.KEYDOWN:                if event.key == pygame.K_LEFT:
>      menu.selectItem(menu.selectedItemNumber + 1)                if
> event.key == pygame.K_RIGHT:
>  menu.selectItem(menu.selectedItemNumber - 1)                #Update stuff
>      menu.update() 

[Tutor] gui problem

2009-06-06 Thread Essah Mitges


from math import sin, cos, pi
import pygame
displayWidth = 640displayHeight = 480fpsLimit = 90
def sinInterpolation(start, end, steps=30):values = [start]delta = end 
- startfor i in range(1, steps):n = (pi / 2.0) * (i / float(steps - 
1))values.append(start + delta * sin(n))return values
class RotatingMenu:def __init__(self, x, y, radius, arc=pi*2, 
defaultAngle=0, wrap=False):"""@param x:The 
horizontal center of this menu in pixels.@param y:
The vertical center of this menu in pixels.@param radius:   
 The radius of this menu in pixels(note that this is the size of
the circular path in which the elements are placed, the actualsize 
of the menu may vary depending on item sizes.@param arc:The 
arc in radians which the menu covers. pi*2 is a full circle.
@param defaultAngle:The angle at which the selected item is found.  
  @param wrap:Whether the menu should select the first 
item after the last oneor stop."""self.x = x
self.y = yself.radius = radiusself.arc = arc
self.defaultAngle = defaultAngleself.wrap = wrap
self.rotation = 0self.rotationTarget = 0self.rotationSteps = [] 
#Used for interpolationself.items = []self.selectedItem 
= Noneself.selectedItemNumber = 0def addItem(self, item):   
 self.items.append(item)if len(self.items) == 1:
self.selectedItem = itemdef selectItem(self, itemNumber):if 
self.wrap == True:if itemNumber> len(self.items) - 1: itemNumber = 
0if itemNumber < 0: itemNumber = len(self.items) - 1else:   
 itemNumber = min(itemNumber, len(self.items) - 1)
itemNumber = max(itemNumber, 0)self.selectedItem.deselect() 
   self.selectedItem = self.items[itemNumber]self.selectedItem.select() 
   self.selectedItemNumber = itemNumber
self.rotationTarget = - self.arc * (itemNumber / float(len(self.items) - 1))
self.rotationSteps = sinInterpolation(self.rotation,
  self.rotationTarget, 45)def rotate(self, 
angle):"""@param angle: The angle in radians by which the menu is 
rotated."""for i in range(len(self.items)):item = 
self.items[i]n = i / float(len(self.items) - 1)rot = 
self.defaultAngle + angle + self.arc * nitem.x = self.x 
+ cos(rot) * self.radiusitem.y = self.y + sin(rot) * self.radius
def update(self):if len(self.rotationSteps)> 0:
self.rotation = self.rotationSteps.pop(0)self.rotate(self.rotation) 
   def draw(self, display):"""@param display: A pyGame display 
object"""for item in self.items:item.draw(display)
class MenuItem:def __init__(self, text="Option"):self.text = text   
 self.defaultColor = (255,255,255)self.selectedColor = 
(255,0,0)self.color = self.defaultColorself.x = 0   
 self.y = 0 #The menu will edit theseself.font = 
pygame.font.Font(None, 20)self.image = self.font.render(self.text, 
True, self.color)size = self.font.size(self.text)self.xOffset = 
size[0] / 2self.yOffset = size[1] / 2def select(self):
"""Just visual stuff"""self.color = self.selectedColor
self.redrawText()def deselect(self):"""Just visual stuff""" 
   self.color = self.defaultColorself.redrawText()def 
redrawText(self):self.font = pygame.font.Font(None, 20)
self.image = self.font.render(self.text, True, self.color)size = 
self.font.size(self.text)self.xOffset = size[0] / 2self.yOffset 
= size[1] / 2def draw(self, display):display.blit(self.image, 
(self.x-self.xOffset, self.y-self.yOffset))
def main():pygame.init()display = 
pygame.display.set_mode((displayWidth, displayHeight))clock = 
pygame.time.Clock()menu = RotatingMenu(x=320, y=240, radius=220, 
arc=pi, defaultAngle=pi/2.0)for i in range(4):
menu.addItem(MenuItem("Option" + str(i)))menu.selectItem(0)#Loop
while True:#Handle eventsevents = pygame.event.get()for 
event in events:if event.type == pygame.QUIT:return 
Falseif event.type == pygame.KEYDOWN:if event.key 
== pygame.K_LEFT:menu.selectItem(menu.selectedItemNumber + 
1)if event.key == pygame.K_RIGHT:
menu.selectItem(menu.selectedItemNumber -

Re: [Tutor] GUI backgrounds using Tk

2007-07-10 Thread Alan Gauld

"Dave Pata" <[EMAIL PROTECTED]> wrote

> I was wondering if anyone knows how to insert graphic images, 
> such as JPEG and BMP, into a simple Tk GUI and use them 
> as the background. Any help will be appreciated.

since its for homework onl;y hints are allowed.

You need to look at the Image object in Tk and insert 
one of those into your GUI

Alan G

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI backgrounds using Tk

2007-07-10 Thread Dave Pata
Hello,
 
I was wondering if anyone knows how to insert graphic images, such as JPEG and BMP, into a simple Tk GUI and use them as the background. Any help will be appreciated.
 
Cheers.Crowded House Time on Earth – catch them live in the USA! Enter here. 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI with Designer

2006-11-05 Thread Jonathon Sisson
Wow...

SPE is in the Gentoo repository as well.  I've been looking for 
something to replace Eric, so thanks for the tip, Chris!  I'll check it out.

Jonathon


Chris Hengge wrote:
> Well, I use SPE which comes with wxGlade and XRC. For the small amount 
> of gui I've done with python I think SPE offers the best IDE coder 
> experience (coming from a VS world). The tools make sense to me.
> 
> wxGlade is a GUI designer written in Python with the popular GUI toolkit 
> wxPython , that helps you create 
> wxWidgets/wxPython user interfaces. At the moment it can generate 
> Python, C++, Perl and XRC (wxWidgets' XML resources) code.
> 
> XRC(wxWidgets' XML resources) is nice because it allows you to abstract 
> your interface design (think of any program that uses XML to format skins).
> 
> Overall, I think everyone using python should give SPE a try, even 
> without gui programming its a great tool for writing code. It's free, 
> and written in python using wxPython.. Stani (the Dev) is a great person 
> for helping out with questions on using his package, he puts out regular 
> updates and fixes. He's got some help from a few other people so its 
> packaged in .exe, .rpm and standalone .zip formats. It's also on the 
> standard repo's for Ubuntu.
> 
> If you like it, be kind and toss the guy a few bucks for his efforts. If 
> you do, you will get your name mentioned on the SPE news page and get a 
> nice copy of his user manual (pdf).
> 
> If you want to know more about SPE, check out:
> http://www.serpia.org/spe
> or video demonstations at:
> http://showmedo.com/videos/series?name=PythonDevelopmentWithSPE 
> 
> 
> On 11/3/06, *Dick Moores* <[EMAIL PROTECTED] > 
> wrote:
> 
> At 02:10 PM 11/3/2006, Chris Hengge wrote:
>> I vouch for the SPE with wxGlade and XRC! (packaged together with IDE)
> 
> I'd be very interested in hearing why you suggest that combination.
> 
> Dick Moores
> 
> 
>> On 11/3/06, *Carlos Daniel Ruvalcaba Valenzuela* <
>> [EMAIL PROTECTED] > wrote:
>>
>> wxPython is good for cross-platform stuff and has a few gui
>> designers
>> (Boa Constructor and others comes to mind), I don't know much
>> about
>> PyQT state in this, but PyGtk + Glade (Gui Designer) is a very
>> good
>> combo.
>>
>> Is about choise, I suggest you to do some simple tests with
>> everything
>> until you find something to be confortable with.
>>
>> * PyGtk + Glade
>> * Boa Contructor
>> * SPE + wxPython
>>
>> On 11/3/06, Todd Dahl <[EMAIL PROTECTED]
>> > wrote:
>> > I am wanting to get into some GUI coding with Python and have
>> heard about
>> > PyQT and wxPython. Now I am definately not looking for some
>> type of holy war
>> > but can anyone give me a good reason to pick one over the other.
>> >
>> > Also I would like to have a designer with it or a seperate
>> designer that
>> > could be used with either. I plan on coding in Windows XP.
>> >
>> > Thanks,
>> >
>> > -Todd
>> >
>> > ___
>> > Tutor maillist  -  Tutor@python.org 
>> > http://mail.python.org/mailman/listinfo/tutor
>> >
>> >
>> >
>> ___
>> Tutor maillist  -  Tutor@python.org 
>> http://mail.python.org/mailman/listinfo/tutor
>> 
>>
>>
>> ___
>> Tutor maillist  -  Tutor@python.org 
>> http://mail.python.org/mailman/listinfo/tutor
> 
> 
> 
> 
> 
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI with Designer

2006-11-03 Thread Chris Hengge
Well, I use SPE which comes with wxGlade and XRC. For the small amount of gui I've done with python I think SPE offers the best IDE coder experience (coming from a VS world). The tools make sense to me.wxGlade is a GUI designer written in Python with the popular GUI toolkit 
wxPython,
that helps you create wxWidgets/wxPython user interfaces. At the moment
it can generate Python, C++, Perl and XRC (wxWidgets' XML resources)
code.XRC(wxWidgets' XML resources) is nice because it allows you to abstract your interface design (think of any program that uses XML to format skins). Overall, I think everyone using python should give SPE a try, even without gui programming its a great tool for writing code. It's free, and written in python using wxPython.. Stani (the Dev) is a great person for helping out with questions on using his package, he puts out regular updates and fixes. He's got some help from a few other people so its packaged in .exe, .rpm and standalone .zip formats. It's also on the standard repo's for Ubuntu. 
If you like it, be kind and toss the guy a few bucks for his efforts. If you do, you will get your name mentioned on the SPE news page and get a nice copy of his user manual (pdf).If you want to know more about SPE, check out:
http://www.serpia.org/speor video demonstations at:http://showmedo.com/videos/series?name=PythonDevelopmentWithSPE
On 11/3/06, Dick Moores <[EMAIL PROTECTED]> wrote:


At 02:10 PM 11/3/2006, Chris Hengge wrote:
I vouch for the SPE with wxGlade
and XRC! (packaged together with IDE)
I'd be very interested in hearing why you suggest that
combination.
Dick Moores

On 11/3/06, Carlos Daniel
Ruvalcaba Valenzuela <
[EMAIL PROTECTED]> wrote:


wxPython is good for cross-platform stuff and has a few gui designers


(Boa Constructor and others comes to mind), I don't know much
about

PyQT state in this, but PyGtk + Glade (Gui Designer) is a very
good

combo.

Is about choise, I suggest you to do some simple tests with
everything 

until you find something to be confortable with.

* PyGtk + Glade

* Boa Contructor

* SPE + wxPython

On 11/3/06, Todd Dahl
<[EMAIL PROTECTED]>
wrote:

> I am wanting to get into some GUI coding with Python and have
heard about

> PyQT and wxPython. Now I am definately not looking for some type
of holy war

> but can anyone give me a good reason to pick one over the other.


>

> Also I would like to have a designer with it or a seperate
designer that

> could be used with either. I plan on coding in Windows XP.

>

> Thanks,

>

> -Todd

>

> ___ 

> Tutor maillist  - 
Tutor@python.org

>

http://mail.python.org/mailman/listinfo/tutor

>

>

>

___

Tutor maillist  - 
Tutor@python.org


http://mail.python.org/mailman/listinfo/tutor 


___
Tutor maillist  -  Tutor@python.org

http://mail.python.org/mailman/listinfo/tutor




___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI with Designer

2006-11-03 Thread Dick Moores


At 02:10 PM 11/3/2006, Chris Hengge wrote:
I vouch for the SPE with wxGlade
and XRC! (packaged together with IDE)
I'd be very interested in hearing why you suggest that
combination.
Dick Moores

On 11/3/06, Carlos Daniel
Ruvalcaba Valenzuela <
[EMAIL PROTECTED]> wrote:


wxPython is good for cross-platform stuff and has a few gui designers


(Boa Constructor and others comes to mind), I don't know much
about

PyQT state in this, but PyGtk + Glade (Gui Designer) is a very
good

combo.

Is about choise, I suggest you to do some simple tests with
everything 

until you find something to be confortable with.

* PyGtk + Glade

* Boa Contructor

* SPE + wxPython

On 11/3/06, Todd Dahl
<[EMAIL PROTECTED]>
wrote:

> I am wanting to get into some GUI coding with Python and have
heard about

> PyQT and wxPython. Now I am definately not looking for some type
of holy war

> but can anyone give me a good reason to pick one over the other.


>

> Also I would like to have a designer with it or a seperate
designer that

> could be used with either. I plan on coding in Windows XP.

>

> Thanks,

>

> -Todd

>

> ___ 

> Tutor maillist  - 
Tutor@python.org

>

http://mail.python.org/mailman/listinfo/tutor

>

>

>

___

Tutor maillist  - 
Tutor@python.org


http://mail.python.org/mailman/listinfo/tutor 


___
Tutor maillist  -  Tutor@python.org

http://mail.python.org/mailman/listinfo/tutor



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI with Designer

2006-11-03 Thread Chris Hengge
I vouch for the SPE with wxGlade and XRC! (packaged together with IDE)On 11/3/06, Carlos Daniel Ruvalcaba Valenzuela <
[EMAIL PROTECTED]> wrote:wxPython is good for cross-platform stuff and has a few gui designers
(Boa Constructor and others comes to mind), I don't know much aboutPyQT state in this, but PyGtk + Glade (Gui Designer) is a very goodcombo.Is about choise, I suggest you to do some simple tests with everything
until you find something to be confortable with.* PyGtk + Glade* Boa Contructor* SPE + wxPythonOn 11/3/06, Todd Dahl <[EMAIL PROTECTED]> wrote:
> I am wanting to get into some GUI coding with Python and have heard about> PyQT and wxPython. Now I am definately not looking for some type of holy war> but can anyone give me a good reason to pick one over the other.
>> Also I would like to have a designer with it or a seperate designer that> could be used with either. I plan on coding in Windows XP.>> Thanks,>> -Todd>> ___
> Tutor maillist  -  Tutor@python.org> http://mail.python.org/mailman/listinfo/tutor>>>
___Tutor maillist  -  Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutor

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI with Designer

2006-11-03 Thread Carlos Daniel Ruvalcaba Valenzuela
wxPython is good for cross-platform stuff and has a few gui designers
(Boa Constructor and others comes to mind), I don't know much about
PyQT state in this, but PyGtk + Glade (Gui Designer) is a very good
combo.

Is about choise, I suggest you to do some simple tests with everything
until you find something to be confortable with.

* PyGtk + Glade
* Boa Contructor
* SPE + wxPython

On 11/3/06, Todd Dahl <[EMAIL PROTECTED]> wrote:
> I am wanting to get into some GUI coding with Python and have heard about
> PyQT and wxPython. Now I am definately not looking for some type of holy war
> but can anyone give me a good reason to pick one over the other.
>
> Also I would like to have a designer with it or a seperate designer that
> could be used with either. I plan on coding in Windows XP.
>
> Thanks,
>
> -Todd
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
>
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI with Designer

2006-11-03 Thread Todd Dahl
I am wanting to get into some GUI coding with Python and have heard about PyQT and wxPython. Now I am definately not looking for some type of holy war but can anyone give me a good reason to pick one over the other.

 
Also I would like to have a designer with it or a seperate designer that could be used with either. I plan on coding in Windows XP.
 
Thanks,
 
-Todd
 
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI new project

2006-10-22 Thread Luke Paireepinart
johnf wrote:
> On Sunday 22 October 2006 20:03, Luke Paireepinart wrote:
>   
>>>   """Create the Second ListBox"""
>>>
>>>   self.lbRSSItems = Listbox(self, exportselection=0
>>> ,command=self.reveal
>>> , relief=SUNKEN)
>>>   
>> Because whitespace is important in python,
>> you can't arbitrarily put newlines into your text.
>> Your program is getting confused because it doesn't know what ',
>> relief=SUNKEN)' means.
>> Try putting a '\' before your newlines.
>> Like:
>> x = \
>> 'a'
>>
>>
>> HTH,
>> -Luke
>> 
> I'm not an expert Luke but I thought a statement can take more than one line 
> when enclosed in parentheses, square brackets or braces (also when triple 
> quoted).  Is this correct
>   
Yep, yep.
I confess, I didn't look too closely at that, and I guess I heard one 
should use backslashes whenever a command goes to a new line,
and I assumed it was always true, and never tried without them!
You're right, of course, John, and I apologize to the OP.  Alan had the 
correct answer to the problem.
Listboxes don't take a command argument.

Hope that helps!
-Luke
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI new project

2006-10-22 Thread johnf
On Sunday 22 October 2006 20:03, Luke Paireepinart wrote:
> >   """Create the Second ListBox"""
> >
> >   self.lbRSSItems = Listbox(self, exportselection=0
> > ,command=self.reveal
> > , relief=SUNKEN)
>
> Because whitespace is important in python,
> you can't arbitrarily put newlines into your text.
> Your program is getting confused because it doesn't know what ',
> relief=SUNKEN)' means.
> Try putting a '\' before your newlines.
> Like:
> x = \
> 'a'
>
>
> HTH,
> -Luke
I'm not an expert Luke but I thought a statement can take more than one line 
when enclosed in parentheses, square brackets or braces (also when triple 
quoted).  Is this correct

John
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor



Re: [Tutor] GUI new project

2006-10-22 Thread Alan Gauld

"Joe Cox" <[EMAIL PROTECTED]> wrote
> As a new guy, I was trying to write a simple unit conversion
> program in Tk. I got this error message:TclError: unknown option 
> "-command"

Which says that you are using an unknown option command...

ie. Listboxes don't have a command option.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI new project

2006-10-22 Thread Luke Paireepinart
Joe Cox wrote:
> As a new guy, I was trying to write a simple unit conversion
> program in Tk. I got this error message:TclError: unknown option "-command"
>
>
>   
 Traceback (most recent call last):
 
>   File
> "D:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
> line 310, in RunScript
> exec codeObject in __main__.__dict__
>   File "D:\Python24\Convert it\Tk Grid demo2py.py", line 70, in ?
> main()
>   File "D:\Python24\Convert it\Tk Grid demo2py.py", line 67, in main
> Application().mainloop()
>   File "D:\Python24\Convert it\Tk Grid demo2py.py", line 22, in __init__
> , relief=SUNKEN)
>   File "D:\Python24\lib\lib-tk\Tkinter.py", line 2409, in __init__
> Widget.__init__(self, master, 'listbox', cnf, kw)
>   File "D:\Python24\lib\lib-tk\Tkinter.py", line 1862, in __init__
> self.tk.call(
> TclError: unknown option "-command"
>
> Any Ideas?
>   
>   self.lbSites = Listbox(self,command=self.reveal, exportselection=0
>  , relief=SUNKEN)
>   
Acually I think it was this line that was causing trouble first :)
Same reason, though.
Cheers,
-Luke
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI new project

2006-10-22 Thread Luke Paireepinart

>
> 
>   """Create the Second ListBox"""
>   
>   self.lbRSSItems = Listbox(self, exportselection=0
> ,command=self.reveal
> , relief=SUNKEN)
>   
Because whitespace is important in python,
you can't arbitrarily put newlines into your text.
Your program is getting confused because it doesn't know what ', 
relief=SUNKEN)' means.
Try putting a '\' before your newlines.
Like:
x = \
'a'


HTH,
-Luke
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI new project

2006-10-22 Thread Joe Cox
As a new guy, I was trying to write a simple unit conversion
program in Tk. I got this error message:TclError: unknown option "-command"


>>> Traceback (most recent call last):
  File
"D:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
line 310, in RunScript
exec codeObject in __main__.__dict__
  File "D:\Python24\Convert it\Tk Grid demo2py.py", line 70, in ?
main()
  File "D:\Python24\Convert it\Tk Grid demo2py.py", line 67, in main
Application().mainloop()
  File "D:\Python24\Convert it\Tk Grid demo2py.py", line 22, in __init__
, relief=SUNKEN)
  File "D:\Python24\lib\lib-tk\Tkinter.py", line 2409, in __init__
Widget.__init__(self, master, 'listbox', cnf, kw)
  File "D:\Python24\lib\lib-tk\Tkinter.py", line 1862, in __init__
self.tk.call(
TclError: unknown option "-command"

Any Ideas?











Joe Cox
513-293-4830
from Tkinter import *

class Application( Frame ):
   def __init__(self):
  Frame.__init__(self)
  self.master.title( "Conver Units" )

  self.master.rowconfigure( 0, weight = 1 )
  self.master.columnconfigure( 0, weight = 1 )
  self.grid( sticky = W+E+N+S )

  """Create the Text"""
  self.lbRSSSiteText = Label(self, text="Convert Length Units From:")
  self.lbRSSSiteText.grid(row=0, column=0, sticky=W)
  self.lbRSSItemText = Label(self, text="Convert Length Units To:")
  self.lbRSSItemText.grid(row=0, column=2, sticky=W)  

  """Create the First ListBox"""
  scrollbarV = Scrollbar(self, orient=VERTICAL)
  
  self.lbSites = Listbox(self,command=self.reveal, exportselection=0
 , relief=SUNKEN)
  self.lbSites.grid(row=1, column=0, columnspan=1, sticky=N+W+S+E)
  for line in  ['Miles','Yards','Feet','Inches']:
  self.lbSites.insert(END, line)
  
   

  """Create the Second ListBox"""
  
  self.lbRSSItems = Listbox(self, exportselection=0
,command=self.reveal
, relief=SUNKEN)
  self.lbRSSItems.grid(row=1, column=2, sticky=N+W+S+E)
  for line in  ['Miles','Yards','Feet','Inches']:
  self.lbRSSItems.insert(END, line)
  
   

  self.button1 = Button( self, text = "Convert", width = 25 )
  self.button1.grid( row = 7, column = 1, columnspan = 2, sticky = W+E+N+S )

  """Create the Text"""
  self.entry = Label(self, text="Input:")
  self.entry.grid(row=8, column=0, sticky=W)
  self.text2 = Label(self, text="Output:")
  self.text2.grid(row=8, column=2, sticky=W)

  self.entry = Entry( self )
  self.entry.grid( row = 11, columnspan = 2, sticky = W+E+N+S )
 

  self.text2 = Text( self, width = 2, height = 2 )
  self.text2.grid( row = 11, column = 2, sticky = W+E+N+S )

   def reveal(self):
   a = self.entry.get()
   b = self.text2.get()
   c = self.lbSites.get(exportselection)
   d = self.lbRSSItems.get(exportselection)
   if c == Miles and d == Feet:
message ="Equals"+ a*5280
  
   self.text2.insert(0.0,message)  
  
def main():
   Application().mainloop()   

if __name__ == "__main__":
   main()
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI Programing

2006-09-01 Thread Amadeo Bellotti
thank you all im reading up on it all its a diffreent mindset that i have tog et used toOn 9/1/06, Terry Carroll <[EMAIL PROTECTED]
> wrote:On Fri, 1 Sep 2006, Alan Gauld wrote:> Fred Lundh's tutorial is much better nowadays - although longer.
Tkinter docs are tough enough to come by that, in my view, longer isbetter.___Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI Programing

2006-09-01 Thread Terry Carroll
On Fri, 1 Sep 2006, Alan Gauld wrote:

> Fred Lundh's tutorial is much better nowadays - although longer.

Tkinter docs are tough enough to come by that, in my view, longer is 
better.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI Programing

2006-09-01 Thread Alan Gauld
> Tkinter is (IMO) easier to learn.  In particular, check out 
> "Thinking
> in Tkinter" (google for it); it's an excellent way to learn Tkinter.

Last time I looked that was very out of date and still recommended
the now obsolete parameters by dictionary stuyle of widget
configuration.

Fred Lundh's tutorial is much better nowadays - although longer.

Alan G.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI Programing

2006-09-01 Thread Alan Gauld

> I'm going to try some GUI programming does anyone know where the 
> start like
> using tk or wx or what ever i want it to it will run on Windows UNIX 
> and Mac
> systems can you tell me whats best to use and give me a link to a 
> good
> tutorial?

This is like asking which programming language is best,
or which editor/IDE to use. Everyone has their own favourite.

My personal view is:

If you have used any GUI before then use wxPython - it looks
better and has more widgets.

But if you have never used a GUI toolkit before use Tkinter,
its easier to learn (and use IMHO) and has much more documentation.
Once you know Tkinter moving to wxPythobn is relatively
straightforward because the underlying prionciples of all GUIs
are the same.

And of course Tkinter is based on Tk whicgh is also available
for Perl and Tcl/Tk and Scheme. So its worth learning for its
portability too.

You can start with my GUI intro topic which teahches Tkinter
but finishes with a wxPython example so you can quickly switch
if you want to.

BTW I strongly recommend startiung out with the raw toolkit
and manual programming to understand how itall hangs
together. Later you can pick up a GUI Builder like
Glade/Blackadder/SpecTix etc. But its best to understand
what these tools are doing first IMHO...

Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI Programing

2006-08-31 Thread John Fouhy
On 01/09/06, Amadeo Bellotti <[EMAIL PROTECTED]> wrote:
> I'm going to try some GUI programming does anyone know where the start like
> using tk or wx or what ever i want it to it will run on Windows UNIX and Mac
> systems can you tell me whats best to use and give me a link to a good
> tutorial?

Tkinter is (IMO) easier to learn.  In particular, check out "Thinking
in Tkinter" (google for it); it's an excellent way to learn Tkinter.

Tkinter is also very basic.  wx has many more widgets and controls
available.  wx also looks a lot better.  But the documentation for wx
isn't very good.  wxpython has been evolving -- it started out as a
direct python port of some C++ libraries, and
has been becoming more pythonic as time goes by.  So if you go looking
for example code, you could find something written in the modern,
pythonic style, or you could get something written in the traditional,
C++ style.  Until you learn to recognise the latter and transform it
to the former, you may find learning from the web difficult.

Both Tkinter and wxpython should work across all platforms.

-- 
John.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI Programing

2006-08-31 Thread Henry Dominik



This guy has been documenting his progress as he 
learns Python GUI programming. See if you can pick up a few tips http://www.learningpython.com/
 

  - Original Message - 
  From: 
  Amadeo Bellotti 
  To: Tutor 
  Sent: Thursday, August 31, 2006 9:12 
  PM
  Subject: [Tutor] GUI Programing
  I'm going to try some GUI programming does anyone know where 
  the start like using tk or wx or what ever i want it to it will run on Windows 
  UNIX and Mac systems can you tell me whats best to use and give me a link to a 
  good tutorial?Thanks
  
  

  ___Tutor maillist  
  -  Tutor@python.orghttp://mail.pythonorg/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI Programing

2006-08-31 Thread Amadeo Bellotti
I'm going to try some GUI programming does anyone know where the start
like using tk or wx or what ever i want it to it will run on Windows
UNIX and Mac systems can you tell me whats best to use and give me a
link to a good tutorial?

Thanks
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2006-04-21 Thread Don Taylor
Eric Walker wrote:

> Ok,
> If I can get it for free, I might as well go with say wxPython. Thanks

However, you really should spend a few bucks buying the recently 
published "wxPython In Action" book by Noel Rappin and Robin Dunn (the 
designer of wxPython).  It will save you lots of time.

You also might like to check out wxGlade which is a FOSS GUI designer 
for wxPython.  It will play happily with your chosen editor.  I have 
tried most of the available GUI designers and liked this one the best 
although is is a little brittle.

http://wxglade.sourceforge.net/

Another _very_ promising system is Dabo but this is not quite ready for 
prime-time.  I think that Dabo is going to be a dynamite system for 
building GUI db apps.

http://dabodev.com/

Don.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2006-04-20 Thread Liam Clarke
Tkinter is simpler to use, wxPython is far more powerful but a bit
harder to learn. It's based on the C++ library wxWidgets, and
sometimes the abstraction leaks a bit, but this is just my opinion.

Check out pythoncard though, it simplifies wx development
dramatically; even has a drag and drop interface; but you can still
use wxPython method calls and objects directly if Pythoncard doesn't
do what you want.

Regards,

Liam Clarke

On 4/20/06, Valone, Toren W. <[EMAIL PROTECTED]> wrote:
> So I have been how does wxPython measure to Tkinter or vice versa?
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Liam Clarke
> Sent: Wednesday, April 19, 2006 3:25 PM
> To: R. Alan Monroe
> Cc: Python[Tutor]
> Subject: Re: [Tutor] GUI
>
> Hmm? How so? I'm using a whole lot of raw wxPython mixed with
> Pythoncard for a project, and the entire process sits at 7Mb RAM usage
> idle. WinXP btw.
>
> Considering my small command line appns to start/stop Windows services
> written in C use just over 1Mb, 7Mb isn't overly bad.
>
> The other good thing about wxPython is stuff like Pythoncard and Wax,
> although development on Pythoncard seems to have slowed right down,
> Kevin Altis got busy, I guess; Wax is nice looking but... not very
> well documented... It's great being able to use Pythoncard for the not
> overly complicated stuff, but with the wxPython still lurking beneath
> the surface.
>
> Regards,
>
> Liam Clarke
>
> On 4/20/06, R. Alan Monroe <[EMAIL PROTECTED]> wrote:
> > >> If I can get it for free, I might as well go with say wxPython.
> Thanks
> >
> > > Yes, free as in beer, as in speech, and cross platform. Oh, and
> better
> > > documented.
> >
> > Sadly, you still pay for it in RAM usage :^)
> >
> > Alan
> >
> > ___
> > Tutor maillist  -  Tutor@python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2006-04-19 Thread Liam Clarke
Hmm? How so? I'm using a whole lot of raw wxPython mixed with
Pythoncard for a project, and the entire process sits at 7Mb RAM usage
idle. WinXP btw.

Considering my small command line appns to start/stop Windows services
written in C use just over 1Mb, 7Mb isn't overly bad.

The other good thing about wxPython is stuff like Pythoncard and Wax,
although development on Pythoncard seems to have slowed right down,
Kevin Altis got busy, I guess; Wax is nice looking but... not very
well documented... It's great being able to use Pythoncard for the not
overly complicated stuff, but with the wxPython still lurking beneath
the surface.

Regards,

Liam Clarke

On 4/20/06, R. Alan Monroe <[EMAIL PROTECTED]> wrote:
> >> If I can get it for free, I might as well go with say wxPython. Thanks
>
> > Yes, free as in beer, as in speech, and cross platform. Oh, and better
> > documented.
>
> Sadly, you still pay for it in RAM usage :^)
>
> Alan
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2006-04-19 Thread R. Alan Monroe
>> If I can get it for free, I might as well go with say wxPython. Thanks

> Yes, free as in beer, as in speech, and cross platform. Oh, and better 
> documented.

Sadly, you still pay for it in RAM usage :^)

Alan

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2006-04-19 Thread Hugo González Monteverde
> Ok,
> If I can get it for free, I might as well go with say wxPython. Thanks

Yes, free as in beer, as in speech, and cross platform. Oh, and better 
documented.

Hugo
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2006-04-19 Thread Chris Lasher
It's a dual license. If you use Qt in non-commercial software, the GPL
applies and you pay no licensing fees. If you use Qt in commercial
software, licensing fees are due to TrollTech.

Chris

On 4/18/06, Alan Gauld <[EMAIL PROTECTED]> wrote:
> [snip]
> TrollTech own Qt, their licensing arrangements seem a tad complex to me.
> Try their web site.
>
> Alan G.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2006-04-18 Thread Eric Walker
Alan Gauld wrote:

>> I want to create a GUI, and I downloaded the pyQT stuff. 
>
>
> Any reason why you must use PyQt?
>
> Not that it's a bad toolkit but there is less expertise in using it so 
> unless you already use it from another language - like C++ - its going 
> to be a lot harder to learn than Tkinter or wxPython which are the two 
> most commonly used GUI tookits.
>
> Both Tkinter and wxPython are free, Tkinter comes with Python, 
> wxPython is a searate download. wxPython tends to look nicer and has 
> some fancier widgets. You pays yer money etc...
>
>>  read some stuff about having to purchase licenses. For commercial 
>> development, who do I need to contact for licensing?
>
>
> TrollTech own Qt, their licensing arrangements seem a tad complex to me.
> Try their web site.
>
> Alan G.
>
>
Ok,
If I can get it for free, I might as well go with say wxPython. Thanks

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI

2006-04-18 Thread Alan Gauld
> I want to create a GUI, and I downloaded the pyQT stuff. 

Any reason why you must use PyQt?

Not that it's a bad toolkit but there is less expertise in using 
it so unless you already use it from another language 
- like C++ - its going to be a lot harder to learn than Tkinter 
or wxPython which are the two most commonly used GUI 
tookits.

Both Tkinter and wxPython are free, Tkinter comes with Python, 
wxPython is a searate download. wxPython tends to look nicer 
and has some fancier widgets. You pays yer money etc...

>  read some stuff about having to purchase licenses. 
> For commercial development, who do I need to contact for licensing?

TrollTech own Qt, their licensing arrangements seem a tad complex to me.
Try their web site.

Alan G.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI

2006-04-18 Thread Eric Walker
All,
I want to create a GUI, and I downloaded the pyQT stuff. Ok, now that I 
am reading my but off
trying to figure out how to use this thing and learn python at the same 
time, I read some stuff about
having to purchase licenses. For commercial development, who do I need 
to contact for licensing?

Thanks
Python Newbie
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI Development - Which toolkit

2006-02-06 Thread Alan Gauld
>I am developing applications that need to run without work on both windows 
>and
> linux and was wondering what gui toolkits everyone uses and why.
>
> I have been looking at wxpython and tkinter.

If you just wqant to wrap up some scropts Tkinter is probably slightly
easier to use (IMHO), but it doesn't look as nice.

wxPython looks better and is only slightly more complex. But it does have
a couple of GUI builder options in the shape of Glade and PythonCard.
If you want to build full blown GUI apps then WxPython is the way to go.

But search the archives, this gets debated at least every 6 months or so :-)

Alan G. 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] GUI Development - Which toolkit

2006-02-06 Thread Michael Lange
On Mon, 6 Feb 2006 09:44:48 -0500
Paul Kraus <[EMAIL PROTECTED]> wrote:

> I am developing applications that need to run without work on both windows 
> and 
> linux and was wondering what gui toolkits everyone uses and why.
> 
> I have been looking at wxpython and tkinter.
> 

I have only used Tkinter so far, so I cannot say much about wx.

Tkinter's biggest disadvantage is that some advanced widgets are missing, like
a spreadsheet widget or a html viewer. There is also no built-in drag&drop 
support.
A lot of these things are available by installing extension modules, though.

If you don't need any of these Tkinter is worth a try; it is well documented, 
stable
and easy to learn, and the biggest advantage over other toolits, it is included 
in
the standard python distribution.

If you want to use Tkinter you should also have a look at Tix, which is now 
included
in python's windows installer (and also in any recent linux distro) and which
adds a lot of nice extra widgets to Tkinter, like Combobox and Tree widget.

A good place to find out more about Tkinter is the wiki: 
.

I hope this helps

Michael


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI Development - Which toolkit

2006-02-06 Thread Paul Kraus
I am developing applications that need to run without work on both windows and 
linux and was wondering what gui toolkits everyone uses and why.

I have been looking at wxpython and tkinter.

Thanks in advance,
-- 
Paul Kraus
=-=-=-=-=-=-=-=-=-=-=
PEL Supply Company
Network Administrator
216.267.5775 Voice
216.267.6176 Fax
www.pelsupply.com
=-=-=-=-=-=-=-=-=-=-=
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


  1   2   >