[Tutor] Newbie struggling with Tkinter/canvas tags

2005-01-30 Thread Glen
As a Python/Tkinter newbie, I thought I was getting on ok... then I hit this problem. I have a canvas (c1) A group of objects are drawn on c1 and given a tag c1.addtag_all('group_A') Another group of objects are drawn, I wish to tag these 'group_B'. At the moment I 'get by' with.

Re: [Tutor] Newbie struggling with Tkinter/canvas tags

2005-01-31 Thread Glen
of the built-in set if it is > available, otherwise use sets.Set. > In 2.4 I tried 'from sets import set' Traceback (most recent call last): File "/home/glen/set4.py", line 1, in -toplevel- from sets import set ImportError: cannot import name set It did allow '

Re: [Tutor] Newbie struggling with Tkinter/canvas tags

2005-01-31 Thread Glen
On Mon, 2005-01-31 at 09:06, Danny Yoo wrote > > Here's a small example with sets to make it more clear how this set > manipulation stuff will work: > > ### > >>> from sets import Set > >>> numbers = range(20) > >>> primes = [2, 3, 5, 7, 11, 13, 17, 19] > >>> Set(numbers) - Set(primes) > Set([0,

Re: [Tutor] Newbie struggling with Tkinter/canvas tags

2005-01-31 Thread Glen
t got the same result > > > > Traceback (most recent call last): > > File "/home/glen/set4.py", line 1, in -toplevel- > > from sets import set > > ImportError: cannot import name set > > > > It did allow 'from sets import *' but wh

Re: [Tutor] Newbie struggling with Tkinter/canvas tags

2005-01-31 Thread Glen
). > > itemconfig() also looks promising. > > http://www.pythonware.com/library/tkinter/introduction/x2017-concepts.htm > Thanks Danny and Kent, I see it now. With so many options on offer it's easy to miss the obvious. All of this new information sh

[Tutor] Python 2.4 with Mandrake 10.0 query

2005-02-02 Thread Glen
immediatly, the timer still remains for the 30 seconds. Idle/Python has always seemed to run perfectly so I have ignored the timer until I recently thought to run Idle from a console. Idle/Python still works great but this output appears in the console... [EMAIL PROTECTED] glen]$ idle set([34, 36

Re: [Tutor] Python 2.4 with Mandrake 10.0 query

2005-02-02 Thread Glen
On Wed, 2005-02-02 at 22:02, Danny Yoo wrote: > On Wed, 2 Feb 2005, Glen wrote: > > > [EMAIL PROTECTED] glen]$ idle > > set([34, 36, 38, 39]) > > Failed to load extension 'CodeContext' > > Traceback (most recent call last): > > File "/usr/loc

Re: [Tutor] help

2005-03-07 Thread glen
ot; by Michael Dawson. Thanks again. On page 25 there is a paragraph called 'trap' that warns about this. Hope this has helped, a little. Glen ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] XML Programs

2018-04-16 Thread Glen
Hey guys, I'm writing a save-game editor for a game I play (just a project to learn). But I am struggling on how to structure the code, how to store the xml data in data structure etc, Can anyone recommend some source I can review that reads and writes data from an xml file. Thanks,

Re: [Tutor] XML Programs

2018-04-16 Thread Glen
I understand, I'd love to use something else but the save game files are in XML so I have no choice :'( On 16 April 2018 at 13:54, leam hall wrote: > On Mon, Apr 16, 2018 at 7:10 AM, Glen wrote: > > Hey guys, > > > > I'm writing a save-game editor for a ga

Re: [Tutor] XML Programs

2018-04-18 Thread Glen
Hello Stefan, Thank you for this. That's actually quite helpful! Regards, On 17 April 2018 at 19:56, Stefan Behnel wrote: > Glen schrieb am 16.04.2018 um 13:10: > > I'm writing a save-game editor for a game I play (just a project to > learn). > > But I am strugg

Re: [Tutor] XML Programs

2018-04-19 Thread Glen
t the penny is not dropping. On 18 April 2018 at 08:39, Glen wrote: > Hello Stefan, > > Thank you for this. That's actually quite helpful! > > Regards, > > On 17 April 2018 at 19:56, Stefan Behnel wrote: > >> Glen schrieb am 16.04.2018 um 13:10: >> >

[Tutor] Return keys with unique values from a dict

2018-05-08 Thread Glen
Hello, I had a task to define a function that would take a dict input and return only the keys with unique values into a list. Here is my code, which was awarded full marks, but I am pretty unhappy with it. I feel like I did a band-aid job after my first submission did pass mall the unit tests. I

[Tutor] RAD GUI Development (like Visual Studio/VBA)

2018-06-29 Thread Glen
Hey guys, Can someone advise on a RAD, drag and drop style graphical form/dialog creator? Akin to VBA or Visual Studio that will work with Python? I currently use the PyCharm IDE, which is fantastic. But I don't have the time or the skill to craft it all by hand. Thanks,

Re: [Tutor] apache2.2 - django deployment

2010-02-09 Thread Glen Zangirolami
Joson, Everything looks good but I think the *module name is incorrect.* Change: LoadModule *python_module *modules/mod_wsgi.so To: LoadModule *wsgi_module *modules/mod_wsgi.so Glen On Tue, Feb 9, 2010 at 2:27 PM, Joson wrote: > Hi all, > I wanna deploy a django program on apache2.2

Re: [Tutor] apache2.2 - django deployment

2010-02-09 Thread Glen Zangirolami
Joson, Everything looks good but I think the *module name is incorrect.* Change: LoadModule *python_module *modules/mod_wsgi.so To: LoadModule *wsgi_module *modules/mod_wsgi.so Glen On Tue, Feb 9, 2010 at 2:27 PM, Joson wrote: > Hi all, > I wanna deploy a django program on apache2.2

Re: [Tutor] Bowing out

2010-03-03 Thread Glen Zangirolami
Thank you for all your hard work! I learned a ton from your tutorials. Good luck on your future endeavors. On Wed, Mar 3, 2010 at 10:18 AM, Albert-Jan Roskam wrote: > Hi Kent, > > Thank you very much for sharing your knowledge. Much appreciated! > > Cheers!! > Albert-Jan > > ~~~

Re: [Tutor] getting diagonals from a matrix

2010-03-03 Thread Glen Zangirolami
I am not really sure of a better way but if your looking for a way to make your code cleaner or more efficient you can try Numpy - http://numpy.scipy.org/ On Tue, Mar 2, 2010 at 4:54 PM, David Eccles (gringer) wrote: > I've managed to drum up some code to obtain a list containing joined > diagon

Re: [Tutor] sorting algorithm

2010-03-03 Thread Glen Zangirolami
http://www.sorting-algorithms.com/ It is a fantastic website that explains each kind of sort and how it works. They also show you visuals how the sorts work and how fast they go based on the amount of data. Depending on the amount/kind of data I would choose a sorting algorithm that fits your nee

Re: [Tutor] Read XML records one by one

2010-03-08 Thread Glen Zangirolami
Another alternative to parsing XML is beautiful soup. Website: http://www.crummy.com/software/BeautifulSoup/ Documentation for parsing xml: http://www.crummy.com/software/BeautifulSoup/documentation.html#Parsing%20XML sample code: from BeautifulSoup import BeautifulStoneSoup xml = "Contents 1Con

Re: [Tutor] Communicate between a thread and the main program

2010-03-08 Thread Glen Zangirolami
I think you can use Queue to communicate between threads. "The Queue module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be exchanged safely between multiple threads" http://docs.python.org/library/queue.html On Mon, Mar

[Tutor] if statement

2010-11-02 Thread Glen Clark
File "/home/glen/workspace/test.py", line 19 if confirmed == "y": ^ SyntaxError: invalid syntax Why does this not work??? PyDev says "Expected:else" ___ Tutor maillist - Tutor@pytho

Re: [Tutor] if statement

2010-11-02 Thread Glen Clark
input("Please enter a nem name: ") else: #do nothing print(Entries) On Tue, 2010-11-02 at 15:05 -0400, Alex Hall wrote: > On 11/2/10, Glen Clark wrote: > > File "/home/glen/workspace/test.py", line 19 > > if confirmed == "y": > >

Re: [Tutor] if statement

2010-11-02 Thread Glen Clark
: > optional: do something else when the above condition is false and > this condition is True. > else: > do something else when the above conditions are false. > > > You can try this, > > > if confirmed == "y": > stuff > els

Re: [Tutor] if statement

2010-11-02 Thread Glen Clark
Okay, Thank you very much for the help guys :) On a side note.. I didn't know you could do something like this: x = z if (thus why I needed the closing parenthesis) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription o

[Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-11-04 Thread Glen Clark
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". The idea was to create a script that asked the u

Re: [Tutor] Looking for a tutor to review my code and provideconstructive feedback.

2010-11-05 Thread Glen Clark
oper code before moving onto learning modules and such. On 5 November 2010 08:32, Mark Tolonen > wrote: > > "Glen Clark" wrote in message > news:aanlktimabbj8ae35q3ao9+xzbvtnyzbz3wrudahmn...@mail.gmail.com... > > Hello, >> >> I have completed my first pyt

Re: [Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-11-05 Thread Glen Clark
> Sent from a mobile device with a bad e-mail client. > ----- > > 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

Re: [Tutor] Hi

2010-11-06 Thread Glen Clark
e 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 :)

Re: [Tutor] Hi

2010-11-06 Thread Glen Clark
, 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

Re: [Tutor] reading complex data types from text file

2009-07-16 Thread Glen Zangirolami
All lines that come back from a text file come back as strings. You can use string methods to detect the data like so: f = open('test.txt') lines = f.readlines() numbers = [] strings = [] for line in lines: if line.strip().isdigit(): numbers.append(int(line)) else: strings.

Re: [Tutor] Question from a newbie

2009-07-22 Thread Glen Zangirolami
Deb, For starters most of the Google enterprise runs on python. Google App Engin e is for developers to develop web applications on Google There are many applications ranging from web frameworks to math modules. Web frameworks: Django

Re: [Tutor] code structure terminology and advice

2009-07-22 Thread Glen Zangirolami
Che, You should check out the python styling guide here. It give examples about how to write python code. PEP 8 -- Style Guide for Python Code Hope this helps! ___ Tutor maillist - Tutor@python.org http://mai

[Tutor] Possible bug in django models when assigning model attribute

2009-08-19 Thread Glen Zangirolami
I ran into something weird in Django and i'm completely stumped. I got it to work but i'm trying to understand the logic behind it. *I have the following data model:* from django.db import models class Setting(models.Model): name = models.CharField(max_length=200) value = models.TextFiel

[Tutor] Finding and Inserting missing dates in a date range.

2009-10-09 Thread Glen Zangirolami
If i have a list of dates:date_list = ['2008-12-29','2008-12-31','2008-01-01','2008-01-02','2008-01-03','2008-01-05'] How do I find the missing dates in the range of dates and insert them into the list so I get? date_list = ['2008-12-29','2008-12-30','2008-12-31','2008-01-01','2008-01-02','2008-01

Re: [Tutor] Finding and Inserting missing dates in a date range.

2009-10-09 Thread Glen Zangirolami
that is missing. > > On Fri, 09 Oct 2009 16:43 -0400, "Kent Johnson" wrote: > > On Fri, Oct 9, 2009 at 3:16 PM, Glen Zangirolami > > > wrote: > > > If i have a list of dates: > > > date_list = > > > > ['2008-12-29','20

Re: [Tutor] Finding and Inserting missing dates in a date range.

2009-10-14 Thread Glen Zangirolami
I went ahead and used a date range generator: http://dpaste.com/107140/ to iterate over the range.I then compared the original list with the generated one and inserted the missing dates. I was comparing the generated dates to dates in a list list of tuples: [(date, count), (date, count) . (dat

Re: [Tutor] help with prime number program

2005-10-31 Thread Glen Wheeler
lease > demonstrate what you mean for my education. > The problem is that composite numbers over 25 will be recognised. 11 is prime, but 55 is not. Your program will tell me that 55 is prime. Similarly with 34, etc. A reasonably easy to understand prime number generator, that also op

Re: [Tutor] inside

2005-11-06 Thread Glen Wheeler
> why the following code does not work? > [snip script] Give us an error message, please. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Fw: point and polygon

2005-11-06 Thread Glen Wheeler
ion is correct, the asserts are failing, and python is telling you about it. Asserts exist for many reasons but not for output. What you most likely want is: if pointInPoly(pointA, poly): print "pointA in poly" else: print "pointA not in poly" With a similar condit

Re: [Tutor] overlay

2005-11-06 Thread Glen Wheeler
I would do this by clipping the two polygons together, and then calculating the area of the resultant polygon. You can do that using the Weiler-Atherton polygon clipping algorithm, which is rather common. Glen From: "Shi Mu" <[EMAIL PROTECTED]> > Is there any sampl

Re: [Tutor] Sending email as html

2008-09-06 Thread Glen Wheeler
From: "Alan Gauld" <[EMAIL PROTECTED]> "Lie Ryan" <[EMAIL PROTECTED]> wrote programs which can edit PDFs which has somewhat destroyed their value as a read-only document format for contracts, invoices etc... If you have used tried using any PDF editor for more than correcting typos, you'd st

[Tutor] Multiple windows in Tkinter

2008-10-02 Thread Glen Clark
Hello, I am a little confused how multi-windows work in Tkinter. I am currently using it while learning to program. Using it for single window apps/scripts is fine. However what I dont understand is: What is toplevel? Is it the same as Tk()? Do I initialise a root using Tk() and then use toplevel

[Tutor] Looking for feedback on improving my code.

2011-05-17 Thread Glen Clark
Hello tutors, Have not posted in a while. Started learning python a while back but had to stop after a couple of weeks due to lack of time. Anyway pretty much forgotten most things but if anyone has time I would love some feedback on my application. My main aim to to learn python, as a hobby, and

Re: [Tutor] How can I have type "function" in my script?

2012-05-07 Thread Glen Zangirolami
Xan, it's "not defined" because you haven't defined a function called "function" or any variable called "function". Nom: descripci, Tipus: , Valor: primera tasca Nom: unmes, Tipus: , Valor: at 0x10df736e0> str comes back as because str is a built-in method and python and will always be in the n

Re: [Tutor] Curious dictionary printing

2012-05-08 Thread Glen Zangirolami
mport it from collections. See http://docs.python.org/library/collections.html#collections.OrderedDict Hope this helps. Glen On Tue, May 8, 2012 at 6:27 AM, Cranky Frankie wrote: > On Mon, May 7, 2012 at 10:31 PM, bob gailer wrote: > > > Asking why does it not do what I want is not

Re: [Tutor] shutil.rmtree clarification

2012-05-17 Thread Glen Zangirolami
Garry, It should be able to remove the tree. I am not able to replicate this on OSX .. yet. What are the contents of the directory and the permissions of the directories/files? Although it should throw an exception if it is a symbolic link or a file it can't remove. On Thu, May 17, 2012 at 8:32

Re: [Tutor] Joining all strings in stringList into one string

2012-05-30 Thread Glen Zangirolami
Seems like a lot of extra work for joining the strings. You should only need: ''.join(['very', 'hot', 'day']) (no spaces) ' '.join(['very', 'hot', 'day']) (if you want spaces) glen On Wed, May 30, 2012 at 11:21 A

[Tutor] Need reference materials to learn flask + python for payroll project that would run both in windows (PC) and android/iOS.

2016-09-13 Thread Glen Reytas
could provide me a series of topics that would help me code my first python project and be online at the end of it. Accessible through PC and mobile. Hoping, Glen ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

[Tutor] Help with Python

2014-05-11 Thread Glen Chan
Hello, I am a student trying to figure out Python. I am getting errors that I don't know how to fix. What do you do after you get the error message and something is highlighted? Does that have to be deleted? Anyway, here is what I mean... #>>> The Dice Game #add libraries needed import rando

[Tutor] Help with Python

2014-05-16 Thread Glen Chan
Hello, I am student trying to fugure out why when I enter any number it says error. It's only suppose to do that if it's out the 1-10 range. Please help. Thank you. number = input('Enter a number between 1 and 10: ') while number < 1 or number > 10: print 'Please enter a number between 1

[Tutor] Pease help

2014-06-06 Thread Glen Chan
Hello I am a student trying to figure out this program. Here is my objective and program below. What am I doing wrong? I can't get this to work. Calculate the average pints of blood donated during a blood drive. The program should take in the number of pints donated during the drive, based o

Re: [Tutor] how to expand "../../myfile"

2014-07-18 Thread Glen Jarvis
fice. (I > could use a shell command if I had to but was hoping it could be done all > within Python. > You can also glean just the current working directory: import os print "pwd", os.getcwd() And it's output: prompt> python example02.py pwd /Users/glenjarvis/Desktop/