Re: [Tutor] list sort problem

2009-09-19 Thread Dave Angel
Rayon wrote: ok so here it is I think this one should be very clear: I have some data in a list, the data in question: 0.0046,0.095,0.0904,521456,['MCI 521456 0.0904'],['ATT 521 0.0919'],['IDT 521 0.095'],['None'] 0.0083,0.0192,0.0109,39023821,['MCI 39023821 0.0109'],['ATT 39 0.012'],['IDT

[Tutor] list sort problem

2009-09-19 Thread Rayon
ok so here it is I think this one should be very clear: I have some data in a list, the data in question: 0.0046,0.095,0.0904,521456,['MCI 521456 0.0904'],['ATT 521 0.0919'],['IDT 521 0.095'],['None'] 0.0083,0.0192,0.0109,39023821,['MCI 39023821 0.0109'],['ATT 39 0.012'],['IDT 39 0.0192'],['S

Re: [Tutor] how can I append a iteration to a tow dimensional array

2009-09-19 Thread Mark Tolonen
"Rayon" wrote in message news:bay122ds664a5c474fbf157089866c3...@phx.gbl... how can I append a iteration to a tow dimensional array so that one value can be like a key in a dir. It's unclear what behavior you are looking for, but there are a number of errors in your code below. Describe wh

[Tutor] how can I append a iteration to a tow dimensional array

2009-09-19 Thread Rayon
how can I append a iteration to a tow dimensional array so that one value can be like a key in a dir. I can't use a directory because some of the values repeat and the dir throws them out. def getMark(record): for x in record.split(','): return str(x).strip() array = [] for x in

Re: [Tutor] Determine Filetype

2009-09-19 Thread Alan Gauld
ad...@gg-lab.net wrote: if OBJECT in LIST: Well, but i'd like to read the page of the python tutorial regarding this. I'm not able to locate it. Can you help me? Not everything is covered in the odfficial tutorial, its only meant to be an introduction to the language. You should find it in

Re: [Tutor] Determine Filetype

2009-09-19 Thread Sander Sweers
On Sat, 2009-09-19 at 17:36 +0200, ad...@gg-lab.net wrote: > if OBJECT in LIST: > > Well, but i'd like to read the page of the python tutorial regarding > this. I'm not able to locate it. Can you help me? When in the python interpreter type help('in') and you should have all info you need about t

Re: [Tutor] Determine Filetype

2009-09-19 Thread ad...@gg-lab.net
2009/9/19 Sander Sweers : > On Sat, 2009-09-19 at 17:20 +0200, ad...@gg-lab.net wrote: >> I want to check the extension of an uploaded file. So i've created a >> list with allowed extensions: >> >> enabled_ext = ['gif', 'jpeg', 'png', 'bmp', 'tiff'] > > If this does not change make it s tuple. It d

Re: [Tutor] Determine Filetype

2009-09-19 Thread Sander Sweers
On Sat, 2009-09-19 at 17:20 +0200, ad...@gg-lab.net wrote: > I want to check the extension of an uploaded file. So i've created a > list with allowed extensions: > > enabled_ext = ['gif', 'jpeg', 'png', 'bmp', 'tiff'] If this does not change make it s tuple. It does not change what is written bel

Re: [Tutor] Determine Filetype

2009-09-19 Thread ad...@gg-lab.net
if file_ext in enabled_ext Found an example some seconds ago in another mailing lists. I'm not able to find the python tutorial that describes this statement. Can you help me please? 2009/9/19 ad...@gg-lab.net : > Ops, i have another question, it seems very simple. > > I want to check the extensi

Re: [Tutor] Determine Filetype

2009-09-19 Thread ad...@gg-lab.net
Ops, i have another question, it seems very simple. I want to check the extension of an uploaded file. So i've created a list with allowed extensions: enabled_ext = ['gif', 'jpeg', 'png', 'bmp', 'tiff'] How can i create a simple if that check if the file ext (file_ext) is in the list? I've sear

Re: [Tutor] Determine Filetype

2009-09-19 Thread ad...@gg-lab.net
Hi All, the solution was in the link i've posted before. If i use: type = imghdr.what('img.test', image.data) The imghdr modules ignore the filename (first argument) and takes the second as a data stream assumed to contain the filetype. The solution only works for images, but that's what i need

Re: [Tutor] Problem running visual python files at home

2009-09-19 Thread Dave Angel
shsu012 shsu012 wrote: Hi Tutor, After installing python 2.6.2, there was no problem running it and completing the simple maths operations at home. However, a Microsoft Visual C++ Runtime library error keeps turning up whenever I tried to run the files which use functions imported from the visual

Re: [Tutor] Problem running visual python files at home

2009-09-19 Thread Kent Johnson
On Sat, Sep 19, 2009 at 5:03 AM, shsu012 shsu012 wrote: > However, a Microsoft Visual C++ Runtime library error keeps turning up > whenever I tried to run the files which use functions imported from the > visual library(please see the attached pic) Please show the code that causes the error.

Re: [Tutor] Using the TIME module to extract a semi-random number

2009-09-19 Thread Kent Johnson
On Sat, Sep 19, 2009 at 12:24 AM, Katt wrote: > One last question on the TIME module: Is there one version of these examples > that is not portable to other systems?  I read something about some > functions not working on other systems and I would like to ensure that the > programs that I write a

Re: [Tutor] Determine Filetype

2009-09-19 Thread Sander Sweers
On Fri, 2009-09-18 at 16:48 -0400, Kent Johnson wrote: > > So, the __init__.py file of the GAE evinronment's ctypes library is > > broken, as it's importing from a package that doesn't exist. Right? > > Probably ctypes is not supported in GAE, that would be a pretty big > security hole. There is