Re: [Tutor] How Do I Put an Image on a Canvas and Display it?

2009-01-26 Thread Alan Gauld
"Wayne Watson" wrote I'm not familiar with the Image and ImageDraw modules but what I think is happening is... import Image, ImageDraw from Tkinter import * By doing this you have hidden Image because Tkinter has its own Image class. im = Image.open("wagon.tif") This is calling ope

Re: [Tutor] clipboard questions

2009-01-26 Thread Alan Gauld
"Che M" wrote I'm curious about how to interact with the contents of the clipboard effectively and have a couple of questions... 1) Is there one cross-platform way to read the clipboard, In a generic sense no. But if the cut n paste is within a single application then yes, you can use a cro

Re: [Tutor] clipboard questions

2009-01-26 Thread spir
Le Mon, 26 Jan 2009 02:23:05 -0500, Che M a écrit : > > I'm curious about how to interact with the contents of the clipboard > effectively and have a couple of questions... > > 1) Is there one cross-platform way to read the clipboard, or does one > have to have a different way to do it for Win

Re: [Tutor] import confusion

2009-01-26 Thread Kent Johnson
On Mon, Jan 26, 2009 at 12:31 AM, Marc Tompkins wrote: > Someone will no doubt phrase this better, but let's take a shot... > > 2) "import django" makes the entire django package and all sub-modules > available. You could then refer to django.forms.DecimalField and > django.contrib.auth.Improp

[Tutor] Sort of database & "family tree" question

2009-01-26 Thread Timo
Hello, I'm writing an application that stores people with some info. I'm doing this with ConfigParser and it works, but currently (for testing), there are only 10 persons in it. What if I add, let's say, about 500-600 or even more? Is this still a good choice? So my entry's look like this (m

Re: [Tutor] Sort of database & "family tree" question

2009-01-26 Thread A.T.Hofkamp
Timo wrote: Hello, I'm writing an application that stores people with some info. I'm doing this with ConfigParser and it works, but currently (for testing), there are only 10 persons in it. What if I add, let's say, about 500-600 or even more? Is this still a good choice? Last week, I creat

Re: [Tutor] Sort of database & "family tree" question

2009-01-26 Thread spir
Le Mon, 26 Jan 2009 14:58:43 +0100, Timo a écrit : > Hello, > > I'm writing an application that stores people with some info. I'm doing > this with ConfigParser and it works, but currently (for testing), there > are only 10 persons in it. What if I add, let's say, about 500-600 or > even more

Re: [Tutor] Sort of database & "family tree" question

2009-01-26 Thread Alan Gauld
"Timo" wrote I'm writing an application that stores people with some info. I'm doing this with ConfigParser and it works, but currently (for testing), there are only 10 persons in it. What if I add, let's say, about 500-600 or even more? Is this still a good choice? I'd be happy with this f

Re: [Tutor] How Do I Put an Image on a Canvas and Display it?

2009-01-26 Thread Wayne Watson
Title: Signature.html Its own image class. Interesting. ImageTk, apparently. Looking for more on the web finds: From a NM Tech PIL pdf: This module is for use with the graphical user interface functions of the Tkinter package. For more information about the Tkinter widget set, see the local T

Re: [Tutor] How Do I Put an Image on a Canvas and Display it?

2009-01-26 Thread Alan Gauld
"Wayne Watson" wrote lIts own image class. Interesting. ImageTk, apparently. No just image. imageTk wouldn't hide your Image. from Tkinter import * Image help(Image) Help on class Image in module Tkinter: class Image | Base class for images. | | Methods defined here: | | __del__(s

Re: [Tutor] Python Program: Newton's Method

2009-01-26 Thread bob gailer
Welcome - this seems to be your first encounter with Python Tutor. It is essential when asking questions like this that you state explicitly what problem you are having. If the program runs and gives unexpected results, tell us that, and show some input, the expected results and the actual re

Re: [Tutor] How Do I Put an Image on a Canvas and Display it?

2009-01-26 Thread Wayne Watson
(Ah, if I could only learn to press Reply All! ) Glad you jogged my memory on the interactive facility. BTW, how do I clear the keyboard imports? Using >>> from Image import * >>> Image >>> help(Image) Help on class Image in module Image: class Image  |  Methods defined here:  |   |  __get

Re: [Tutor] How Do I Put an Image on a Canvas and Display it?

2009-01-26 Thread Alan Gauld
"Wayne Watson" wrote Image help(Image) Help on class Image in module Image: ... This is definitely different than the Tkimage help you showed. So what's happening? You import your Image module as Image. Then you import all; the names from Tkinter which includes the name Image. Thus t

Re: [Tutor] How Do I Put an Image on a Canvas and Display it?

2009-01-26 Thread ALAN GAULD
> how do I clear the keyboard imports? I'm not sure what you mean by keyboard imports? Do you mean how to restore an interactive session? If so, then in IDLE you can use: Shell->Restart shell. I don't know how to do that in any of the other IDEs... You can of course del() any name, including m

[Tutor] What Centroid Algorithm Is This?

2009-01-26 Thread Wayne Watson
I'm looking at a GUI program that handles meteor images. They leave a trail across the sky. Each video frame (30 fps) provides data on the track, and a centroid is found around each track point. 'm not familiar with the algorithm that does this, but part of it is in the three def stmts below. M

Re: [Tutor] clipboard questions

2009-01-26 Thread Che M
> To: tutor@python.org > From: alan.ga...@btinternet.com > Date: Mon, 26 Jan 2009 10:13:15 + > Subject: Re: [Tutor] clipboard questions > > > "Che M" wrote > >> I'm curious about how to interact with the contents of the clipboard >> effectively and h

[Tutor] import imports

2009-01-26 Thread spir
Hello, Here are some ideas around import. I wish to receive comments and to learn whether they fit python. As I am not a highly experimented programmer, there may be some features or practices I do know know or do not know well. The following ideas are not dependant of each other, but as they a

Re: [Tutor] How Do I Put an Image on a Canvas and Display it?

2009-01-26 Thread Wayne Watson
Title: Signature.html Thanks. Very good. That'll give me something to think about. Where is your namespace tutorial? Alan Gauld wrote: "Wayne Watson" wrote Image help(Image) Help

Re: [Tutor] How Do I Put an Image on a Canvas and Display it?

2009-01-26 Thread Wayne Watson
I'm using pythonWin. Yes, basically, restore the interactive session. I had done several imports, and wanted the clear them to see what would happen with others I planned on entering without having them affected by earlier ones. Keyboard imports. Just entering "import Tkinter" at the >>> promp

Re: [Tutor] What Centroid Algorithm Is This?

2009-01-26 Thread Eike Welk
On Monday 26 January 2009, Wayne Watson wrote: > the three def stmts below. Maybe someone can hazard a guess? It > looks like someone had fun doing this. First bookmark this webpage. It explains every important function in Numpy: http://www.scipy.org/Numpy_Example_List_With_Doc > def Centro

[Tutor] Tk+Ipython unexpected behavior

2009-01-26 Thread W W
Hi all, I'm going through "An Introduction to Tkinter" by Fredrik Lundh and came across (what seems to be) some slightly unexpected behavior. I'm editing the python file with my favorite text editor, and using the %run magic function in Ipython to test my program(s). On the second example(pg 4

[Tutor] using a for loop with feedparser

2009-01-26 Thread Tonu Mikk
Hello, I am trying to parse a feed and insert some feed elements into a Django project database. I believe I should be able to use for loop to iterate over the list elements. I am using the Universal Feed parser (http://www.feedparser.org/). I am able to extract items one by one and inser

Re: [Tutor] using a for loop with feedparser

2009-01-26 Thread Tonu Mikk
Tonu Mikk wrote: Hello, I am trying to parse a feed and insert some feed elements into a Django project database. I believe I should be able to use for loop to iterate over the list elements. I am using the Universal Feed parser (http://www.feedparser.org/). I am able to extract items one

Re: [Tutor] What Centroid Algorithm Is This?

2009-01-26 Thread Wayne Watson
Title: Signature.html Thanks for the annotations and references. I see a fair number of functions in Numpy, but none called centroid. Is there a name for this particular algorithm? I suspect there are many such methods. It looks like there many be several concepts at play here that fit together

Re: [Tutor] using a for loop with feedparser

2009-01-26 Thread Tonu Mikk
I now have a new question related to the same project. I currently have a code snippet like this: 1.for item in d.entries: 2.link = Link(url=item.link) 3.link.save() 4.user = User.objects.get(id=1) 5.link = Link.objects.get(id=1) 6.bookmark = Bookmark ( 7.title = ite

Re: [Tutor] How Do I Put an Image on a Canvas and Display it?

2009-01-26 Thread Alan Gauld
"Wayne Watson" wrote Where is your namespace tutorial? Check my .sig... :-) -- 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] import imports

2009-01-26 Thread Alan Gauld
"spir" wrote Here are some ideas around import. I wish to receive comments The module attribute __all__ allows defining names to be exported. I always use it for my own modules, and also sometimes define it in external modules, when absent, or adapt it to my needs. I've never defined it in

Re: [Tutor] Tk+Ipython unexpected behavior

2009-01-26 Thread Alan Gauld
"W W" wrote the frame.quit method is bound to a quit button. When I double click the .py file to run it, it closes when the quit button is pressed. But with Ipython, when the quit button is pressed, it unblocks the Ipython input but doesn't actually quit the window. I don't know what fram

Re: [Tutor] using a for loop with feedparser

2009-01-26 Thread Kent Johnson
On Mon, Jan 26, 2009 at 4:53 PM, Tonu Mikk wrote: > I now have a new question related to the same project. I currently have a > code snippet like this: > > 1.for item in d.entries: > 2.link = Link(url=item.link) > 3.link.save() > 4.user = User.objects.get(id=1) > 5.link = Link.obj

Re: [Tutor] Tk+Ipython unexpected behavior

2009-01-26 Thread Kent Johnson
On Mon, Jan 26, 2009 at 5:41 PM, Alan Gauld wrote: > I don't know what framework IPython uses None, it is an enhanced Python interactive shell, you should check it out! Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listin

[Tutor] datetime year problem, default year available?

2009-01-26 Thread Sander Sweers
Hello Tutors, I have some questions on setting the year in a datetime object via strptime. The issues is that in my date string I only have a day and a month ('11/27' for example). Now when I use datetime.strptime('11/27', ''%m/%d) I get a datetime object but the year is 1900. This makes sense as

Re: [Tutor] Tk+Ipython unexpected behavior

2009-01-26 Thread Alan Gauld
"Kent Johnson" wrote I don't know what framework IPython uses None, it is an enhanced Python interactive shell, you should check it out! I've looked a couple of times at the web site but never bothered downloading it. I got the impression it was a GUI shell window like PyCrust but from yo

Re: [Tutor] Tk+Ipython unexpected behavior

2009-01-26 Thread Kent Johnson
On Mon, Jan 26, 2009 at 8:17 PM, Alan Gauld wrote: > > "Kent Johnson" wrote > >>> I don't know what framework IPython uses >> >> None, it is an enhanced Python interactive shell, you should check it out! > > I've looked a couple of times at the web site but never bothered > downloading it. I got

Re: [Tutor] Tk+Ipython unexpected behavior

2009-01-26 Thread Jörg Wölke
* Kent Johnson [090127 03:39]: > Yes, it is a text app that runs in a console window. It has many > features; my favorites are listed here: > http://personalpages.tds.net/~kent37/kk/00011.html The links on your page are broken: See: http://ipython.scipy.org/doc/manual/html/ In fact Ipython is so

[Tutor] import site failed (WinXP)

2009-01-26 Thread Alexei Vinidiktov
Hello, Since yesterday I've been having problems running Python. I've been getting the error "import site failed; use -v for traceback". IDLE won't start either. The traceback seems to sugget that Python "cannot import name aliases". I've tried uninstalling and reinstalling Python and also insta

Re: [Tutor] How Do I Put an Image on a Canvas and Display it?

2009-01-26 Thread Wayne Watson
I'm missing it. Author of the Learn to Program web site http://www.alan-g.me.uk/  ?? I don't see anything about namespaces there. Alan Gauld wrote: "Wayne Watson" wrote  Where is your namespace tutorial? Check my .sig... :-) -- Signature.html Wayne W