[Tutor] Saving GUIs

2012-10-09 Thread tayo rotimi

Hi,


I have started creating GUIs. But my current challenge now is saving the GUIs 
created. I have observed that 
whenever I close the console, the GUIs also get closed. So, please what do I 
need to do to save the GUIs, or call them back when next needed, if they don't 
actually get extinguished when the console is closed?
I use Python 3.2 on windows 7.


Regards. 

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


Re: [Tutor] I Need Help With Using Tkinter/Console/Creating GUIs

2012-10-05 Thread tayo rotimi
Thank you Steven; I am now running. I just followed your hint. I later noticed 
the author was actually referring to an earlier version of Python, with the 
console not looking the same with Python 3.2. 

Regards.

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


[Tutor] I Need Help With Using Tkinter/Console/Creating GUIs

2012-10-04 Thread tayo rotimi
Hi,

I recently started learning as a python programming 'absolute beginner'. I have 
Python 3.2 installed on my laptop, and I have learned to a point where I need 
to create GUIs. I understand from the text book I am reading that all I need to 
have access to the Tkinter toolkits in a window-OS is double click on the 
Python icon to run Tkinter program directly; but I don't have Python icon on my 
desktop. I went to the program list and the relevant stuffs I have there are 
the IDLE (Python GUI) and Python (command line). Double clicking on any of 
these did not bring out the console described for creating GUIs. I am in a 
fixed. Its either the Tkinter module is not available on my Python installation 
or there are things I am not doing right. Please I need help, I need some 
practical guides on how to start creating GUI. Again, I have Python 3.2 
installed on my system.   


Regards.

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


Re: [Tutor] Help - My First Program Fails

2012-09-10 Thread tayo rotimi
Hi Steven. 


Thank you for your answer below. The program now runs, using print("Game 
Over"). 

I use Python 3..; but the book - python for absolute beginner - that I have is 
an old (2003) edition. I don't know how this combination may affect my 
learning, going forward. Could you please suggest how I can something current. 


Regards.

Tayo.


My answer to your question appears below:



On Sun, Sep 09, 2012 at 03:56:22PM -0700, tayo rotimi wrote:
> My first exercise: print "Game Over" does not run! Where have I missed it? 
> The error message is as follows:
> 
> ?File "", line 1
> ?? print "Game Over"
> ??? ??? ??? ??? ??? ^
> ?SyntaxError: invalid syntax 


Are you using Python 3 instead of Python 2?

One of the changes between the 2.x versions and the 3.x versions is that 
print is no longer a statement, but is now a function. That means you 
have to write it using round brackets (parentheses for Americans):

# version 2.x
print "Game Over"

# version 3.x
print("Game Over")


For simple printing, there's not much advantage either way, but for more 
advanced printing, the function form is much better.



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


[Tutor] Help - My First Program Fails

2012-09-09 Thread tayo rotimi
My first exercise: print "Game Over" does not run! Where have I missed it? The 
error message is as follows:

 File "", line 1
   print "Game Over"
                    ^
 SyntaxError: invalid syntax 


I am still surprised at this error. I 'll appreciate your help.

Regards.

Tayo




 From: "tutor-requ...@python.org" 
To: tutor@python.org 
Sent: Sunday, September 9, 2012 10:14 PM
Subject: Tutor Digest, Vol 103, Issue 40
 
Send Tutor mailing list submissions to
    tutor@python.org

To subscribe or unsubscribe via the World Wide Web, visit
    http://mail.python.org/mailman/listinfo/tutor
or, via email, send a message with subject or body 'help' to
    tutor-requ...@python.org

You can reach the person managing the list at
    tutor-ow...@python.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tutor digest..."


Today's Topics:

   1. Re: Help with class in class (leam hall)
   2. Re: I Need Help - further details now provided. (Matthew Ngaha)
   3. web frameworks (Matthew Ngaha)
   4. Re: web frameworks (Steven D'Aprano)
   5. Re: Help with class in class (leam hall)
   6. Re: web frameworks (Matthew Ngaha)
   7. Re: Help with class in class (Dave Angel)


--

Message: 1
Date: Sun, 9 Sep 2012 14:12:48 -0500
From: leam hall 
To: tutor 
Subject: Re: [Tutor] Help with class in class
Message-ID:
    
Content-Type: text/plain; charset="utf-8"

On Sun, Sep 9, 2012 at 12:12 PM, Peter Otten <__pete...@web.de> wrote:

> the above will no longer complain about a missing attribute.
>
> > root = Tk()
> > project = ch8_Project(master=root)
> > project.mainloop()
>
>
> Another problem that caught my attention:
>
> >     self.green = Button(root, text="Green",
> command=self.change_text_color("green"))
>
>
> The command argument is supposed to be a function; you are instead
> assigning
> the result of a method call (which is None in this case, but as a side
> effect will set the color to green immediately. The simplest fix is to
> define a helper function that takes no arguments
>      ...
>      def change_to_green():
>          self.change_text_color("green")
>      self.green = Button(root, text="Green", command=change_to_green)
>      ...
>
> If you already know about lambda you can try to rewrite this using that.
>
>
Peter, thank you for helping me understand the scope issue I was missing! I
knew it was something like that but forget that omitting "this." meant the
variables were limited in scope to that method.

I have seen lamba but do not understand it. The project requires four
buttons, each one turns the same text a different color. The class is also
Python 3 based.  :)

Leam



-- 
Mind on a Mission 
-- next part --
An HTML attachment was scrubbed...
URL: 


--

Message: 2
Date: Sun, 9 Sep 2012 20:20:19 +0100
From: Matthew Ngaha 
To: tutor@python.org
Subject: Re: [Tutor] I Need Help - further details now provided.
Message-ID:
    
Content-Type: text/plain; charset=ISO-8859-1

SORRY i wrote to you not the mailing list:(

im a beginner myself, and those instructions seem very complicated for
me. But i did install Python and everything included with no problem.
You need at least Python 3.1 for this book we have. its what the
author recommended. version 2.7 as you have shown in the link is too
old as it has different syntax. Try downloading Python from the link i
included, you will have no trouble installing IDLE with this link.


--

Message: 3
Date: Sun, 9 Sep 2012 20:41:24 +0100
From: Matthew Ngaha 
To: tutor@python.org
Subject: [Tutor] web frameworks
Message-ID:
    
Content-Type: text/plain; charset=ISO-8859-1

Hi all, i had a recent post about learning about guis and web
applications. i decided to try guis 1st, but i also decided that maybe
a very very very simple web framework would not be too much work for
me to study once in  while. I decided on Flask because i read it's the
simpliest framework out of all the others i've researched, only to
find out it's not supported on Python 3:(.. i wondered if someone with
experience can tell me, in their opinion a framework with a similar
learning curve to Flask that a beginner can easily understand and is
supported on Python 3. i thought cherrypy, but was told it's not
nearly as simple as Flask, and since my main focus is learning GUIs, a
simple web framework will be ideal only to understand how they work. i
understand Javascript  only a little, but html and css a bit better
etc..

also is mod_python similar to a framework? does it perform the same
tasks and also make good web applications? would this be a better
option?


--

Message: 4
Date: Mon, 10 Sep 2012 06:29:50 +1000
From: Steven D'Aprano

Re: [Tutor] I Need Help - thank you all, its now done

2012-09-09 Thread tayo rotimi
Thank you, Matthew and all,

I have just installed the Python IDLE. Now I an ready to begin learning how to 
write programs. That means you may see more questions from me as I am ready to 
leverage on your experiences. I appreciate everyone who has helped and guided 
me in one way or the other.

Regards to all.

Tayo.




 From: tayo rotimi 
To: "tutor@python.org"  
Sent: Sunday, September 9, 2012 10:34 PM
Subject: Re: I Need Help
 

Hi Matthew,

The link you provided, http://www.programgames.com/page4.html, leads to where I 
can only download the book but not the software. I will appreciate if you could 
click on it to check again and provide me with further guide.

Regards.
Tayo.


SORRY i wrote to you not the mailing list:(

im a beginner myself, and those instructions seem very complicated for
me. But i did install Python and everything included with no problem.
You need at least Python 3.1 for this book we have. its what the
author recommended. version 2.7 as you have shown in the link is
 too
old as it has different syntax. Try downloading Python from the link i
included, you will have no trouble installing IDLE with this link.___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] I Need Help

2012-09-09 Thread tayo rotimi
Hi Matthew,

The link you provided, http://www.programgames.com/page4.html, leads to where I 
can only download the book but not the software. I will appreciate if you could 
click on it to check again and provide me with further guide.

Regards.
Tayo.


SORRY i wrote to you not the mailing list:(

im a beginner myself, and those instructions seem very complicated for
me. But i did install Python and everything included with no problem.
You need at least Python 3.1 for this book we have. its what the
author recommended. version 2.7 as you have shown in the link is too
old as it has different syntax. Try downloading Python from the link i
included, you will have no trouble installing IDLE with this link.___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] I Need Help - further details now provided.

2012-09-09 Thread tayo rotimi
Hi Steven,

Please see my answers (bold, and in blue) after each of your questions below. 
Hope you would be able to help, with these further notes I have provided. 
Regards.

Tayo




Message: 3
Date: Sun, 09 Sep 2012 02:44:33 +1000
From: Steven D'Aprano 
To: tutor@python.org
Subject: Re: [Tutor] I need Help
Message-ID: <504b75f1.9070...@pearwood.info>
Content-Type: text/plain; charset=UTF-8; format=flowed

Hi Tavo,

My responses are interleaved between your comments, shown with > markers.


On 09/09/12 02:24, tayo rotimi wrote:
> Hi,
>
>
> I am a new beginner/learner of Python.

Welcome and good luck!

> My first challenge is that I am unable to install the Python IDLE after
> downloading it from Python website. When I hit on the 'run' button, i
>got the error message below:
>
> "This installation package could not be opened. Contact the application
>vendor to verify that this a valid Window Installer Package."

What are you downloading? As far as I can see, there is no installer for
IDLE on the Python website. IDLE comes automatically with the rest of the
Python installer. Please tell us:  

Please go to:  http://www.python.org/download/  

* what page you go to on the Python website to find this installer - Please 
click on:http://www.python.org/download/

* which installer link you click on - on the page look for and click on the 
following:Python 2.7.3 Windows X86-64 Installer(Windows AMD64 / Intel 64 / 
X86-64
binary [1]-- does not include source)

* the exact name of the installer file you download - exact name is: Python 
2.7.3 Windows X86-64 Installer(Windows AMD64 / Intel 64 / X86-64
binary [1]-- does not include source)

* whether your version of Windows is 32-bit or 64-bit -my version is 64-bit 
Windows 7


> Furthermore, I read from the 'python for absolute beginners' text book
>that I need to add some code to the end of path in my computer property.

Really? Does it say what code to add, or will any old code do?

Without knowing exactly what the book says, and the context, I have no
idea what that means. Below is the context, verbatim: 

"If you have a trouble running the IDLE, you may have to modify the your 
Windows System Path - a list of the directories where your system looks to find 
program files. you 'll want to add the following to the end of the Path: 
;C:\Python27;C:\Program Files\Tcl;C:\Program Files\Tcl\bin. The process of 
modifying your Path is different for each version of windows, so check your 
Windows Help documentation for Environment Variable (since the Path is one of 
your Environment Variables)." 



-- 
Steven


--

Message: 4
Date: Sat, 8 Sep 2012 19:06:17 +0100
From: Matthew Ngaha 
To: tutor@python.org
Subject: Re: [Tutor] I need Help
Message-ID:
    
Content-Type: text/plain; charset=ISO-8859-1

this is the same book i bought a few months ago to get me started. the
instructions i remember where clear for windows. if there is a problem
with the download files on the site, the author has the files on his
own site also:

http://www.programgames.com/page4.html

save or run the file, once installed go to your start menu, choose All
Programs, choose Python 3.1, then choose IDLE(Python GUI)


--

Subject: Digest Footer

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


--

End of Tutor Digest, Vol 103, Issue 37
**___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] I need Help

2012-09-08 Thread tayo rotimi
Hi,


I am a new beginner/learner of Python. My first challenge is that I am unable 
to install the Python IDLE after downloading it from Python website. When I hit 
on the 'run' button, i got the error message below:

"This installation package could not be opened. Contact the application vendor 
to verify that this a valid Window Installer Package."

Furthermore, I read from the 'python for absolute beginners' text book that I 
need to add some code to the end of path in my computer property. Could this 
really be the solution to my problem? If it is, then I don't know how get such 
code to add. 


I don't know what to do.

I use Windows 7 OS.

Could someone help provide me a guide?

Regards to all.

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