[Tutor] Flatten a list in tuples and remove doubles

2012-07-19 Thread PyProg PyProg
Hi all,

I would get a new list as:

[(0, '3eA', 'Dupont', 'Juliette', '11.0/10.0', '4.0/5.0', '17.5/30.0',
'3.0/5.0', '4.5/10.0', '35.5/60.0'), (1, '3eA', 'Pop', 'Iggy',
'12.0/10.0', '3.5/5.0', '11.5/30.0', '4.0/5.0', '5.5/10.0',
'7.5/10.0', '40.5/60.0')]

... from this one:

[(0, '3eA', 'Dupont', 'Juliette', 0, 11.0, 10.0), (0, '3eA', 'Dupont',
'Juliette', 1, 4.0, 5.0), (0, '3eA', 'Dupont', 'Juliette', 2, 17.5,
30.0), (0, '3eA', 'Dupont', 'Juliette', 3, 3.0, 5.0), (0, '3eA',
'Dupont', 'Juliette', 4, 4.5, 10.0), (0, '3eA', 'Dupont', 'Juliette',
5, 35.5, 60.0), (1, '3eA', 'Pop', 'Iggy', 0, 12.0, 10.0), (1, '3eA',
'Pop', 'Iggy', 1, 3.5, 5.0), (1, '3eA', 'Pop', 'Iggy', 2, 11.5, 30.0),
(1, '3eA', 'Pop', 'Iggy', 3, 4.0, 5.0), (1, '3eA', 'Pop', 'Iggy', 4,
5.5, 10.0), (1, '3eA', 'Pop', 'Iggy', 5, 40.5, 60.0)]

How to make that ? I'm looking for but for now I can't do it.

Thanks in advance.

a+

-- 
http://ekd.tuxfamily.org
http://ekdm.wordpress.com
http://glouk.legtux.org/guiescputil
http://lcs.dunois.clg14.ac-caen.fr/~alama/blog
http://lprod.org/wiki/doku.php/video:encodage:avchd_converter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Flatten a list in tuples and remove doubles

2012-07-19 Thread PyProg PyProg
Oh I forgot to mention, with Python 2 (2.7).

-- 
http://ekd.tuxfamily.org
http://ekdm.wordpress.com
http://glouk.legtux.org/guiescputil
http://lcs.dunois.clg14.ac-caen.fr/~alama/blog
http://lprod.org/wiki/doku.php/video:encodage:avchd_converter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Parse MPL files

2011-01-07 Thread PyProg PyProg
Hi all,

I'm looking for a way to parse MPL files (.MPL or .mpl extension).
These files are contained in the tree of some cameras that support the
AVCHD ... and some cameras filming with a stream mpeg-ts.

I know a person who seeks to recover the data contained in these
files. MPL (or .mpl). The data in this kind of file are the date and
location (by GPS info), I would help him recover the data.

Is there a Python module who make that ?, or how to proceed ?

Thank you in advance.

a+

-- 
http://ekd.tuxfamily.org
http://ekdm.wordpress.com
http://lcs.dunois.clg14.ac-caen.fr/~alama/blog
http://lprod.org/wiki/doku.php/video:encodage:avchd_converter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] [PyQt4] Parent problems with QThread and QProgressDialog

2009-08-14 Thread PyProg PyProg
Hi All,

Benefiting from this excellent ticket:
http://snippets.prendreuncafe.com/snippets/tagged/pyqt/order_by/date

... I can implement the behavior that I want and with QThread
QProgressDialog (knowing that the progress bar updates whenever a new
file is processed) in my application.

Nevertheless I can not get rid of the parent window (the
QProgressDialog comes with its parent window, which is really ugly).
So I would like to get rid of this window relative to QProgressDialog
that can display properly during treatment. How ?.

In addition I would like to display the file being processed in the
progress bar, but I can not (for now all files loaded are displayed in
the bar).

You can see the code here: http://pastebin.com/d71e7bd6b

... and the screenshot showing the parent window that cause me problems here:

http://irruption.net/bla/ekd/ekd_developp/14_08_09_problem_avec_parent_dans_le_QThread_001.jpg

Can you help me solve these problems ?.

Excuse me for my bad English (it's a google translation of my message
in french).

I Hope you can help me.

a+

-- 
http://ekd.tuxfamily.org
http://lprod.org/wiki/doku.php/video:encodage:avchd_converter
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] sets module equivalent with Python 2.6

2009-03-17 Thread PyProg PyProg
Hello all,

I want to use an equivalent of sets module with Python 2.6 ... but
sets module is deprecated on 2.6 version.

In fact I want to make that but with Python 2.6:

 toto_1 = [0, 1, 2, 3, 4]
 toto_2 = [1, 127, 4, 7, 12]

 import sets
 a = sets.Set(toto_1)
 b = sets.Set(toto_2)
 c = a.symmetric_difference(b)
 d = [p for p in c]
 d.sort()
 print d
[0, 2, 3, 7, 12, 127]

Can you help me ?.

Thanks in advance.

a+

-- 
http://ekd.tuxfamily.org
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Can you help me with subprocess module ?.

2009-02-03 Thread PyProg PyProg
Hello everyone,

I have a problem with the subprocess module. In fact I wish that when
I run the command with subprocess I can retrieve the data immediately
without waiting for the end of the command. I tried this way but
ordering must end so that I can recover the data:

import subprocess, os, sys

# Commande FFmpeg
com_1 = 'ffmpeg -i /home/user/path/in.avi -s 160x120 -ac 1 -ar 22050
-qmin 3 -qmax 3 -y /home/user/path/out.avi'

p = [subprocess.Popen(com_1, stderr=subprocess.STDOUT,
stdout=subprocess.PIPE, shell=True).communicate()[0]]

for toto in p:
if '\r' in toto:
tampon = str(toto).split(' ')
# ..., 'time=151.6', ...
for vb in tampon:
if 'time' in vb:
tempsEcoule = vb[5:]
print u'Temps écoulé', tempsEcoule

My version of Python:

Python 2.5.2 (r252:60911, Jul 31 2008, 17:31:22)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2

Can you help me?.

Excuse me in advance for my bad English.

a +

-- 
http://ekd.tuxfamily.org
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Help with a loop

2008-03-18 Thread PyProg PyProg
Hello,

I have a little problem, I have two lists:

 a=[1, 2, 3, 4, 5, 6]
 b=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

... and I want to obtain:

 [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5), ('f', 6), ('g',
1), ('h', 2), ('i', 3), ('j', 4)]

I want to obtain that with a comprehension-list.

Lists can have dimension completely different.

Can you help me please ?.

a+

-- 
http://ekd.tolosano.info
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Test

2008-01-03 Thread PyProg PyProg
It's just a test message

-- 
http://ekd.tolosano.info
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor