[Tutor] parsing an array

2007-11-14 Thread sith .
a = [[1,2],[3,1.5],[5,6]] for i in a: print i if i[1]>i[0]: print "second index is larger" else: print "second index is smaller" [1, 2] second index is larger [3, 1.5] second index is small er [5, 6] second index is larger What I'd like do is compare if 1.

Re: [Tutor] Obtaining image date of creation

2007-11-14 Thread Scott SA
On 11/14/07, Roy Chen ([EMAIL PROTECTED]) wrote: >I would like to write a simple script that would rename a bunch of >photos according to their creation date, i.e. the date which the >photo was taken. > >Is there a way to use Python to obtain that information from the >image file, or is that

[Tutor] retrieve data from an online database without knowing the url

2007-11-14 Thread pileux systeme
Hello, I was wondering whether it was possible to write a program which could directly write some word in a box and click 'search' on a typical online database without using the url. (e.g. is there a way to write a program which would write some keyword, say 'tomato' on google and click 'google

Re: [Tutor] Obtaining image date of creation

2007-11-14 Thread pyprog
Hello, I'm new here . To read EXIF with Python Imaging Library : >>> import Image >>> ouv=Image.open('path_to_your_picture_with_exif_data__jpeg') >>> exifdata=imgExif._getexif() >>> # Here a personnal exemple >>> for keyExif, valueExif in zip(exifdata.keys(), exifdata.values()): ... print ke

Re: [Tutor] Obtaining image date of creation

2007-11-14 Thread Eric Abrahamsen
> And while I haven't tried it, this page (http://effbot.org/zone/pil- > changes-114.htm) appears to indicate exif format is somewhat > supported in PIL; perhaps pyexif does a better job though? PIL does a pretty job, though it's a pain. from PIL import Image from PIL.ExifTags import TAGS def get

[Tutor] [wxPython-users] Loading default values for text box and choice

2007-11-14 Thread Varsha Purohit
Hello, I wanted to know how to load text box with the default value Eg. In these lines there is a static text and a text box created ... and if i want to load value '3' in the text box how can i do that ?? wx.StaticText(panel, -1, "Random Seed", (550,200)) wx.TextCtrl(panel,-1,pos=(620,2

Re: [Tutor] global is bad but ... okay

2007-11-14 Thread Dinesh B Vadhia
Kent et al I reworked the code to pass parameters (mainly arrays) to the functions. It works and performs faster. Thank-you all very much for the insights. Dinesh - Original Message - From: Kent Johnson To: Dinesh B Vadhia Cc: tutor@python.org Sent: Wednesday, November 14, 2007

Re: [Tutor] Interactive Menu Woes

2007-11-14 Thread Bryan Magalski
Thank you for your suggestion. I did not create the original script, so it will stay as is and my addition for the menu has been adjusted. Now that I can make a clear distinction of what I am returning, I am getting a new error that leads me that I am trying to call a function that cannot be

Re: [Tutor] Obtaining image date of creation

2007-11-14 Thread Marc Tompkins
Thus spake Roy Chen: > Hello, > > I would like to write a simple script that would rename a bunch of > photos according to their creation date, i.e. the date which the > photo was taken. > > Is there a way to use Python to obtain that information from the > image file, or is that information not s

Re: [Tutor] Obtaining image date of creation

2007-11-14 Thread Evert Rol
> I'm assuming you don't want the last changed date you see on the file > on your PC, but the creation date that the camera stored when the > picture was taken. > > Now I don't know much about that, but I thought it was interesting, so > I did some Googling :-) > > I don't know whether it's always

Re: [Tutor] Obtaining image date of creation

2007-11-14 Thread Remco Gerlich
Hi, I'm assuming you don't want the last changed date you see on the file on your PC, but the creation date that the camera stored when the picture was taken. Now I don't know much about that, but I thought it was interesting, so I did some Googling :-) I don't know whether it's always stored, b

Re: [Tutor] Obtaining image date of creation

2007-11-14 Thread Eric Abrahamsen
On Nov 14, 2007, at 9:05 PM, Kent Johnson wrote: > Roy Chen wrote: >> Hello, >> >> I would like to write a simple script that would rename a bunch of >> photos according to their creation date, i.e. the date which the >> photo was taken. >> >> Is there a way to use Python to obtain that informatio

Re: [Tutor] class accessing another's updated property

2007-11-14 Thread Kent Johnson
ted b wrote: > I want class One to be able to access access class > Two's value property after its been updated. Everytime > I try (by running, say testTwo().value) I get the > __init__ value. The update method fro class Two is > called elsewhere in the program, and I want class > One's "getTwo" me

Re: [Tutor] Obtaining image date of creation

2007-11-14 Thread Kent Johnson
Roy Chen wrote: > Hello, > > I would like to write a simple script that would rename a bunch of > photos according to their creation date, i.e. the date which the > photo was taken. > > Is there a way to use Python to obtain that information from the > image file, or is that information not

[Tutor] class accessing another's updated property

2007-11-14 Thread ted b
I want class One to be able to access access class Two's value property after its been updated. Everytime I try (by running, say testTwo().value) I get the __init__ value. The update method fro class Two is called elsewhere in the program, and I want class One's "getTwo" method to access class Two'

Re: [Tutor] global is bad but ...

2007-11-14 Thread Kent Johnson
Dinesh B Vadhia wrote: > Alan/Jim: > > It's good to hear some pragmatic advice. > > This particular module has 8 small functions that share common data > (structures, primarily in arrays and vectors). I tried passing array_G > as a parameter but that doesn't work because everything in the f

Re: [Tutor] Interactive Menu Woes

2007-11-14 Thread Evert Rol
> I am trying to build a menu for the following script to make it > more "user friendly". Nothing fancy, just a simple add data and > look up the entered results. > > The problem is that when I run my modified version with this > snippet (please see attachment for original and my modified ve

[Tutor] Obtaining image date of creation

2007-11-14 Thread Roy Chen
Hello, I would like to write a simple script that would rename a bunch of photos according to their creation date, i.e. the date which the photo was taken. Is there a way to use Python to obtain that information from the image file, or is that information not stored in the file? Thanks, Ro

Re: [Tutor] Interactive Menu Woes

2007-11-14 Thread Wesley Brooks
In the middle of your addName function you have defined another function that requires 'self' and you've got a default argument 'get=1'; def numberType(self, get = 1): You call this further down the function with the line; self.type = numberType(self.get) This should have been; self.type = num

[Tutor] Interactive Menu Woes

2007-11-14 Thread Bryan Magalski
Greetings all!! This is my first post and I am going to probably be vague at first, but, I will try my best to be specific. I am a very GREEN scripter/programmer, so please be as descriptive as possible. Ok, enough excuses, on with my question! Here is my issue: I am trying to build a menu f

[Tutor] [wxPython-users] Displaying filename of open dialog box

2007-11-14 Thread Varsha Purohit
Hello, I am new to wxPython. I have made an application where i created a button which opens the file from a directory. I created a static text box near the button. I want to display the filename of file which is opened using this open button. How can i read the file opened and put that text