Re: [Tutor] Reading the CDROM in Linux

2010-11-06 Thread Alan Gauld


"Steven D'Aprano"  wrote


I usually mount cdroms on /dev/cdrom


Surely that's where you mount cdroms *from*? I can't think that 
using /dev/cdrom as the mount point would be a good idea!


Oops, yes, that should be /usr/cdrom, sorry.

Alan G. 



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


Re: [Tutor] Hi

2010-11-06 Thread Alan Gauld


"Luke Pettit"  wrote

I was interested in which video tutorials Glen was watching, and if 
anyone

else could recommend some video tutorials to watch,


I don;t know what Glen was watching but thhere are a whole bunch of
videos at showmedo.com

Alan G.


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


Re: [Tutor] Hi

2010-11-06 Thread Luke Pettit
Thanks Alan I found those about an hour ago :)

On 6 November 2010 20:11, Alan Gauld  wrote:

>
> "Luke Pettit"  wrote
>
>
>  I was interested in which video tutorials Glen was watching, and if anyone
>> else could recommend some video tutorials to watch,
>>
>
> I don;t know what Glen was watching but thhere are a whole bunch of
> videos at showmedo.com
>
> Alan G.
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>



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


[Tutor] Newbie Programming puzzles, etc.

2010-11-06 Thread Seekker

Unfortunately, most of them seem to be aimed at people who aren't 
newbies. I think the world needs a good set of programming puzzles for 
beginners.


It would sure be helpful to have a library of newbie type projects ... I'm 
teaching myself with the "think like a computer scientist' books, and thus far 
 I've been able to follow and/or figure out the exercises ... 
but I'm only in chapter 03 at time moment.  I'm sure it'll get more challenging 
as I go.  I'm not the greatest 'problem solver' ... I've been hoping that 
learning a programming language would help in that area.

Thanks

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


Re: [Tutor] Displaying Pictures & Text

2010-11-06 Thread Wayne Werner
On Fri, Nov 5, 2010 at 11:53 PM, Patty  wrote:

>  Hi Alan -
>
> I tried using ImageTk from the PIL library to display jpegs (and hopefully
> any picture type)  instead of just gif as you suggested below.  I read
> online that these these types of programs should
> be run from executables not in the interpreter but it crashes and I can't
> read the error.  Here is the program:
>
> import Image
> import ImageTk
>
> fhdl = Image.open("C:\Users\StarShip\PyProgs\SuitGirl.jpg")
> ImageTk.PhotoImage(fhdl)
>

Before you convert to an ImageTk, you need to first create a toplevel
window:

import Image
import ImageTk
import Tkinter as tk

root = tk.Tk()
#put your code here

And that should work. You'll still have to add the widgets and what-nots so
you can present your image, but in order to create an image with ImageTk,
you need to have a toplevel window created.

That's what this is telling you

Traceback (most recent call last):

  File "", line 1, in 

  File "C:\Python26\lib\site-packages\PIL\ImageTk.py", line 113, in __init__

self.__photo = apply(Tkinter.PhotoImage, (), kw)

  File "C:\Python26\lib\lib-tk\Tkinter.py", line 3285, in __init__

Image.__init__(self, 'photo', name, cnf, master, **kw)

  File "C:\Python26\lib\lib-tk\Tkinter.py", line 3226, in __init__

raise RuntimeError, 'Too early to create image'

RuntimeError: Too early to create image



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


Re: [Tutor] Hi

2010-11-06 Thread Glen Clark
Luke,

I used a video from Lynda.com, simply because I already had a
subscription. The price was about $25 per month which I think is more
expensive that showmedo. Or you could buy it for $99 (Python 3 Essential
Training (DVD-ROM)). 

The video's were very good for me personally because he was straight to
the point which kept me from getting bored. 

I have recently found showmedo though and they does loog very good also.
It seems to have a lot of content on there.

Regards, 
Glen

On Sat, 2010-11-06 at 21:29 +1100, Luke Pettit wrote:
> Thanks Alan I found those about an hour ago :)
> 
> On 6 November 2010 20:11, Alan Gauld 
> wrote:
> 
> "Luke Pettit"  wrote
> 
> 
> I was interested in which video tutorials Glen was
> watching, and if anyone
> else could recommend some video tutorials to watch,
> 
> 
> I don;t know what Glen was watching but thhere are a whole
> bunch of
> videos at showmedo.com
> 
> Alan G.
> 
> 
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
> 
> 
> 
> -- 
> Luke Pettit
> ___
> 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


Re: [Tutor] Hi

2010-11-06 Thread Glen Clark
Also, if you have not yet chosen an IDE I recommend eclipse with the
pydev extension. Google them or if you use gnu/linux (like ubuntu) you
can get it from the package manager. It is a very simple interface, with
syntax highlighting, debug mode and console. 

On Sat, 2010-11-06 at 14:45 +, Glen Clark wrote:
> Luke,
> 
> I used a video from Lynda.com, simply because I already had a
> subscription. The price was about $25 per month which I think is more
> expensive that showmedo. Or you could buy it for $99 (Python 3 Essential
> Training (DVD-ROM)). 
> 
> The video's were very good for me personally because he was straight to
> the point which kept me from getting bored. 
> 
> I have recently found showmedo though and they does loog very good also.
> It seems to have a lot of content on there.
> 
> Regards, 
> Glen
> 
> On Sat, 2010-11-06 at 21:29 +1100, Luke Pettit wrote:
> > Thanks Alan I found those about an hour ago :)
> > 
> > On 6 November 2010 20:11, Alan Gauld 
> > wrote:
> > 
> > "Luke Pettit"  wrote
> > 
> > 
> > I was interested in which video tutorials Glen was
> > watching, and if anyone
> > else could recommend some video tutorials to watch,
> > 
> > 
> > I don;t know what Glen was watching but thhere are a whole
> > bunch of
> > videos at showmedo.com
> > 
> > Alan G.
> > 
> > 
> > ___
> > Tutor maillist  -  Tutor@python.org
> > To unsubscribe or change subscription options:
> > http://mail.python.org/mailman/listinfo/tutor
> > 
> > 
> > 
> > -- 
> > Luke Pettit
> > ___
> > 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


Re: [Tutor] Displaying Pictures & Text

2010-11-06 Thread Patty
Thank you!  I was getting confused, I thought I wouldn't need Tkinter.  I 
thought Tkinter is yet another addon library besides PIL.  Am I right or wrong? 
 So I actually need both?  And this brings me back to my _other_  question 
which is that as individuals go about downloading these addon libraries and 
their doc, how do you organize this on your computer system?   I can imagine 
that in corporations there are guidelines for this, but I am wondering what you 
all do? You could end up with addon libraries, doc and Readmes all over your 
hard disk

Patty
  - Original Message - 
  From: Wayne Werner 
  To: Patty 
  Cc: tutor@python.org 
  Sent: Saturday, November 06, 2010 7:16 AM
  Subject: Re: [Tutor] Displaying Pictures & Text


  On Fri, Nov 5, 2010 at 11:53 PM, Patty  wrote:

Hi Alan - 

I tried using ImageTk from the PIL library to display jpegs (and hopefully 
any picture type)  instead of just gif as you suggested below.  I read online 
that these these types of programs should 
be run from executables not in the interpreter but it crashes and I can't 
read the error.  Here is the program:

import Image
import ImageTk

fhdl = Image.open("C:\Users\StarShip\PyProgs\SuitGirl.jpg")
ImageTk.PhotoImage(fhdl)


  Before you convert to an ImageTk, you need to first create a toplevel window:


  import Image
  import ImageTk
  import Tkinter as tk


  root = tk.Tk()
  #put your code here


  And that should work. You'll still have to add the widgets and what-nots so 
you can present your image, but in order to create an image with ImageTk, you 
need to have a toplevel window created.


  That's what this is telling you


Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python26\lib\site-packages\PIL\ImageTk.py", line 113, in __init__
self.__photo = apply(Tkinter.PhotoImage, (), kw)
  File "C:\Python26\lib\lib-tk\Tkinter.py", line 3285, in __init__
Image.__init__(self, 'photo', name, cnf, master, **kw)
  File "C:\Python26\lib\lib-tk\Tkinter.py", line 3226, in __init__
raise RuntimeError, 'Too early to create image'
RuntimeError: Too early to create image




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


Re: [Tutor] Programs for Newbies?

2010-11-06 Thread Patty
For my first program, I liked creating a number game, simple and where the 
user made a choice.  That was good for learning how to interact with the 
user.  The raw_input() function.


Patty

- Original Message - 
From: "Steven D'Aprano" 

To: 
Sent: Friday, November 05, 2010 10:55 PM
Subject: Re: [Tutor] Programs for Newbies?



Danyelle Davis wrote:

Hi all,

Any suggestions for a newbie to program while learning python?  I am new 
to

programming and python.



Here's a few suggestions:


Write a program that asks the user to enter a word, then counts how many 
vowels and consonants are in the word.


Write a program that asks the user for a list of numbers, separated by 
spaces or commas, and then calculated the average.


A program that prints the time.

A program that prints how many days to go until their next birthday.

A program that counts how many palindrome numbers there are between two 
other numbers. (A palindrome number is one like 12321, or 473374.)


A program that sings (well, prints) the "There were ten in the bed" song. 
If you don't know it, it is a children's song. You start off by holding up 
ten fingers, or you can use actual children. You don't have to start with 
ten. Then you sing:


There were ten in the bed, and the little one said,
Roll over! Roll over!
And they all rolled over and ONE FELL OUT!
There were nine in the bed, and the little one said,
Roll over! Roll over!
And they all rolled over and ONE FELL OUT!
There were eight in the bed, and the little one said,
...

Well you get the idea. Eventually you've left with only the little one 
left, and the song ends:


There was one in a bed, and the little one said
Good night!




--
Steven

___
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


Re: [Tutor] Displaying Pictures & Text

2010-11-06 Thread Alan Gauld


"Patty"  wrote

 I thought I wouldn't need Tkinter.  I thought Tkinter is yet 
another addon library


Tkinter is the standfard GUI toolkit for Python and as such comes as 
part of the
standard library. (Although you do have to compile Python with that 
option

enabled in some Linux distros)


  So I actually need both?


Yes PUIL is for transforming the graphics and creatnf the image 
object.

Tkinter can then displaty that image object in a GUI.


And this brings me back to my _other_  question which is that
as individuals go about downloading these addon libraries and
their doc, how do you organize this on your computer system?


Most common add-on libraries will install themselves in the
site-packages dirtectory structure under your Python root folder
So they remain fairly well organized.

Some thoird party tools are kist a single python module and you have
to decide where to put it yourselfd. In my case thats usually in
site-packages too.

This does mean that when you upgrade you have to decide which,
if any, of your site-package files to migrate to the new version and
which to re-download. I usually opt for the re-download route just
to be safe.

Alan G. 



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


Re: [Tutor] Displaying Pictures & Text

2010-11-06 Thread Patty
Thanks for the explanation.  I will go ahead and trying using these 
functions in my program.


Patty

- Original Message - 
From: "Alan Gauld" 

To: 
Sent: Saturday, November 06, 2010 10:55 AM
Subject: Re: [Tutor] Displaying Pictures & Text




"Patty"  wrote

 I thought I wouldn't need Tkinter.  I thought Tkinter is yet another 
addon library


Tkinter is the standfard GUI toolkit for Python and as such comes as part 
of the

standard library. (Although you do have to compile Python with that option
enabled in some Linux distros)


  So I actually need both?


Yes PUIL is for transforming the graphics and creatnf the image object.
Tkinter can then displaty that image object in a GUI.


And this brings me back to my _other_  question which is that
as individuals go about downloading these addon libraries and
their doc, how do you organize this on your computer system?


Most common add-on libraries will install themselves in the
site-packages dirtectory structure under your Python root folder
So they remain fairly well organized.

Some thoird party tools are kist a single python module and you have
to decide where to put it yourselfd. In my case thats usually in
site-packages too.

This does mean that when you upgrade you have to decide which,
if any, of your site-package files to migrate to the new version and
which to re-download. I usually opt for the re-download route just
to be safe.

Alan G.

___
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


Re: [Tutor] Programs for Newbies?

2010-11-06 Thread Wayne Werner
On Sat, Nov 6, 2010 at 11:54 AM, Patty  wrote:

> For my first program, I liked creating a number game, simple and where the
> user made a choice.  That was good for learning how to interact with the
> user.  The raw_input() function.
>
> Patty
>

My favorite one is a simple guessing game, where the computer "thinks" of a
number 1-10 (inclusive) and then the user guesses the number, with the
computer responding "Too High" or "Too low!".

For more variation, keeping "score" - number of guesses, # of rounds played,
etc. are fun additions to the program.

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


Re: [Tutor] Displaying Pictures & Text

2010-11-06 Thread Alan Gauld


"Patty"  wrote

Thanks for the explanation.  I will go ahead and trying using these 
functions in my program.


Tkinrer is quite easy once you get the hang of it.
Its also a good intro to GUI frameworks in general if you ever
need to move top something more advanced.

There are good tutorials for both PIL and Tkinter on
the Pythonware site:

http://www.pythonware.com/products/pil/index.htm

http://www.pythonware.com/products/tkinter/index.htm

Or you can try the intro to GUI programming in my tuitorial.


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] Hi

2010-11-06 Thread trench
I'd also point out that Google has created a very awesome Python course
which is heavily dependent on video lectures by Nick Parlante. Included in
the course are downloadable exercises and examples (all mentioned in the
video lectures). After you review all of this quality (not to mention free)
material... I think you'll fully understand what separates Google from its
competitors. (By this, I simply mean that you will not see similar offerings
from, say, Facebook, Apple, or MS.)

http://code.google.com/edu/languages/google-python-class/index.html

This is
a part of Google's "Google Code University". Here's the root URL for the
entire project: http://code.google.com/edu/  -- definitely worth checking
out.

-trench

On Fri, Nov 5, 2010 at 8:12 PM, Luke Pettit  wrote:

> Hi everyone,
> I'm just about to begin to learn python and have bookmarked a number of
> sites to learn from
> http://www.alan-g.me.uk/ is the main one but after reading this
>
> ""On Nov 4, 2010, at 3:10 PM, Glen Clark  wrote:
>
> Hello,
>
> I have completed my first python script. This is after watching a video
> guide on python and is my first attempt at writing code in python. While the
> code is not very useful I got the idea for it when googling "python projects
> for beginners".""
>
>
> I was interested in which video tutorials Glen was watching, and if anyone
> else could recommend some video tutorials to watch, mainly because of a mild
> dyslexia and preference for video tutorials.
>
> I have been learning Autodesk 3d Studio Max
> http://south-apac.autodesk.com/adsk/servlet/pc/index?siteID=1157326&id=15474303
>  for
> several years and learning it's scripting language Maxscript
> http://rosettacode.org/wiki/Category:MAXScript and since Autodesk now own
> all the competitors software and they all (except Max) use Python for
> their coding I thought it would be the way to go when learning a new
> language. Blender also uses Python btw.
>
> My 3d site http://lukepettit-3d.blogspot.com/
>
> --
> Luke Pettit
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>


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


Re: [Tutor] Hi

2010-11-06 Thread Luke Pettit
Wow information overload lol Thanks everyone this is great.

On 7 November 2010 13:43, trench  wrote:

> I'd also point out that Google has created a very awesome Python course
> which is heavily dependent on video lectures by Nick Parlante. Included in
> the course are downloadable exercises and examples (all mentioned in the
> video lectures). After you review all of this quality (not to mention free)
> material... I think you'll fully understand what separates Google from its
> competitors. (By this, I simply mean that you will not see similar offerings
> from, say, Facebook, Apple, or MS.)
>
> http://code.google.com/edu/languages/google-python-class/index.html
>
> This
> is a part of Google's "Google Code University". Here's the root URL for the
> entire project: http://code.google.com/edu/  -- definitely worth checking
> out.
>
> -trench
>
> On Fri, Nov 5, 2010 at 8:12 PM, Luke Pettit  wrote:
>
>> Hi everyone,
>> I'm just about to begin to learn python and have bookmarked a number of
>> sites to learn from
>> http://www.alan-g.me.uk/ is the main one but after reading this
>>
>> ""On Nov 4, 2010, at 3:10 PM, Glen Clark  wrote:
>>
>> Hello,
>>
>> I have completed my first python script. This is after watching a video
>> guide on python and is my first attempt at writing code in python. While the
>> code is not very useful I got the idea for it when googling "python projects
>> for beginners".""
>>
>>
>> I was interested in which video tutorials Glen was watching, and if anyone
>> else could recommend some video tutorials to watch, mainly because of a mild
>> dyslexia and preference for video tutorials.
>>
>> I have been learning Autodesk 3d Studio Max
>> http://south-apac.autodesk.com/adsk/servlet/pc/index?siteID=1157326&id=15474303
>>  for
>> several years and learning it's scripting language Maxscript
>> http://rosettacode.org/wiki/Category:MAXScript and since Autodesk now own
>> all the competitors software and they all (except Max) use Python for
>> their coding I thought it would be the way to go when learning a new
>> language. Blender also uses Python btw.
>>
>> My 3d site http://lukepettit-3d.blogspot.com/
>>
>> --
>> Luke Pettit
>>
>> ___
>> Tutor maillist  -  Tutor@python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/mailman/listinfo/tutor
>>
>>
>
>
> --
> - t
>



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