Re: graph edge generators

2009-06-09 Thread Rafael
William Clifford writes: > I've become interested in basic graphs and networks and I'm wondering > about what algorithms are there for generating basic regular graphs > like the simplex graph or dodecahedron graph, etc (I'm sure there are > many). I'm particularly keen on understanding the very b

Reinstalling

2021-01-29 Thread Rafael Llera
just uninstalled both apps again and found a lot of *.pyc files, my questions would it help to delete them all before reinstalling again, or is this a different issue. thank you in advance. best regards, Rafael -- https://mail.python.org/mailman/listinfo/python-list

Running Jupyter Notebook

2021-02-10 Thread Rafael Llera
I installed Python and jupyter via pip, but when I run jupyter notebook I keep getting the following error. Requirement already satisfied: pyparsing>=2.0.2 in c:\users\mitzi\appdata\roaming\python\python39\site-packages (from packaging->bleach->nbconvert->jupyter) (2.4.7) Requirement already sati

Pompem Exploit and Vulnerability Finder Tool v0.2.0 Python 3.5

2016-08-05 Thread Rafael Francischini
Hello, I would like to share with you my personal project, Pompem. https://github.com/rfunix/Pompem/ I hope you enjoy it. -- https://mail.python.org/mailman/listinfo/python-list

Problem with lists

2015-09-15 Thread Rafael David
n't see. In the code I'm printing the list values just after the assignment and they are ok, but when I try to print the list at the end of the function the values are different (repeated). Below is the code and the result in Python 3.4.0. Could you guys please help me with that?

Re: Problem with lists

2015-09-15 Thread Rafael David
Em terça-feira, 15 de setembro de 2015 21:11:38 UTC-3, MRAB escreveu: > On 2015-09-16 00:45, Rafael David wrote: > > Hi guys, > > > > I'm newbie in Python (but not a newbie developer). I'm facing a > > problem with a bidimensional list (list of lists) contain

Re: Problem with lists

2015-09-16 Thread Rafael David
Em terça-feira, 15 de setembro de 2015 21:47:10 UTC-3, Chris Angelico escreveu: > On Wed, Sep 16, 2015 at 10:29 AM, Rafael David wrote: > > Oooohhh ... I think I got it! I'm assigning a reference to peca and not the > > value itself! Thank you very much MRAB and C Smith f

Re: PyMatch Tool.

2014-08-18 Thread Rafael Francischini
Em sexta-feira, 15 de agosto de 2014 17h59min28s UTC-3, Christian Gollwitzer escreveu: > Am 14.08.14 21:50, schrieb rafinha.u...@gmail.com: > > > Hello, I created this tool to help me develop on formatting text using > > regular expressions. > > > Any questions, I am available. > > > Thank yo

Re: PyMatch Tool.

2014-08-18 Thread Rafael Francischini
Cristian you are right, never experienced visual regexp, is incredible. I created pyMatch to help me in the automation scripts and text formatting, so I decided to work from the command line. You're right, you can also do this with sed, but sed has a small defect "in my view", you will be able

Re: Subprocess and pipe-fork-exec primitive

2007-08-01 Thread Rafael V.
nformixdb, not Python, is handling the signals and reaping the subprocesses. Now Martin, do you think I can use informixdb.py and subprocess.py in the same application? I was thinking on forking subprocesses from the main thread and using other threads to access the Informix database, would that

Understanding Python's interpreter

2007-04-06 Thread Rafael Almeida
ts, I couldn't figure out any. I hope I'm not too offtopic here, but I thought this was probably the best news to ask this. If someone thinks there's another news that's more appropriate, please tell me. []'s Rafael -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding Python's interpreter

2007-04-07 Thread Rafael Almeida
On Sat, 07 Apr 2007 04:35:49 +0200 Gabriel Genellina <[EMAIL PROTECTED]> wrote: > Speed? Eficiency? File size? Ease of use? > A .pyc *could* be written in ASCII, but what do you gain? Replacing a > few trivial functions in the Python core with a printf/scanf equivalent? > At the same time you

Re: cannot create python packages

2007-10-10 Thread Rafael Sachetto
ructure > inside /usr/lib/pythonX.Y/, whithout success however. > Any ideas? > > Thnx > > > ___ > Want ideas for reducing your carbon footprint? Visit Yahoo! For Good > http://uk.promotions.yahoo.com/forgood/environment.html

Re: for loop question

2007-10-10 Thread Rafael Sachetto
course, the for loop above isn't valid at all. I am just giving an > example of what I'm trying to accomplish. Anyone know how I can achieve the > goal in the example above? Thanks. > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Rafael Sachetto Oliveira Sir - Simple Image Resizer http://rsachetto.googlepages.com -- http://mail.python.org/mailman/listinfo/python-list

Re: for loop question

2007-10-10 Thread Rafael Sachetto
isn't valid at all. I am just giving an > > > example of what I'm trying to accomplish. Anyone know how I can > achieve the > > > goal in the example above? Thanks. > > > > A "works-for-me": > > > > >>> pair

Re: Best Python Linux distribution

2007-10-17 Thread Rafael Sachetto
sure > > about previous versions. > > > Also, I am sure a lot of it (with most distributions) depends on the > packages you select during the installation. > -- > http://mail.python.org/mailman/listinfo/python-list > -- Rafael Sachetto Oliveira Sir - Simple Imag

Re: open remote terminal

2007-10-20 Thread Rafael Sachetto
rrectly with your virtual terminal. > >> > >>http://pexpect.sourceforge.net/ > > I actually gave it a first very simple try: > > import pexpect > child=pexpect.spawn('xterm') > child.sendline('ls') > > Unfortunately nothing

Re: Iteration for Factorials

2007-10-22 Thread Rafael Sachetto
n range(b, -1, -1): > >> for d in range(a): > >> c += 1 > >> a = c > >> return a > > > > Not simple enough for my taste: > > > >>>> import gmpy > >>>> gmpy.fac(10) > > mpz(3628800)

Re: Iteration for Factorials

2007-10-22 Thread Rafael Sachetto
ef fact(x): > return reduce(operator.mul,xrange(1,x)) > > >>> fact(3) > 2 > >>> fact(2) > 1 > >>> fact(1) > > Traceback (most recent call last): > File "", line 1, in > fact(1) > File "", line 2,

Re: pyuno and calc

2007-11-06 Thread Rafael Sachetto
ttp://mail.python.org/mailman/listinfo/python-list > -- Rafael Sachetto Oliveira Sir - Simple Image Resizer http://rsachetto.googlepages.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to browse a C Library with Python

2007-12-05 Thread Rafael Sachetto
This could be a solution import commands callables = commands.getoutput("nm -D /lib/libc.so.6 | egrep ' T ' ").split("\n") callables = [c.split()[2] for c in callables] print callables On Dec 5, 2007 5:26 PM, Rafael Sachetto <[EMAIL PROTECTED]> wrote: &g

Re: How to browse a C Library with Python

2007-12-05 Thread Rafael Sachetto
ibc.so' and look > at lines with type T. To do this on a dynamic library you have to use nm -D /lib/libc.so -- Rafael Sachetto Oliveira Sir - Simple Image Resizer http://rsachetto.googlepages.com -- http://mail.python.org/mailman/listinfo/python-list

Re: arrays in lists

2007-12-17 Thread Rafael Sachetto
n mad attempt to interpret it as though it had > an underlying truth." > -- Umberto Eco > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Rafael Sachetto Oliveira Sir - Simple Image Resizer http://rsachetto.googlepages.com -- http://mail.python.org/mailman/listinfo/python-list

Fwd: Regular Expression for Prime Numbers (or How I came to fail at them, and love the bomb)

2008-02-13 Thread Rafael Sachetto
eing read as "\x01". > > -- > Carsten Haese > http://informixdb.sourceforge.net > > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Rafael Sachetto Oliveira Sir - Simple Image Resizer http://rsachetto.googlepages.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I execute a command from within python and wait on that command?

2008-02-15 Thread Rafael Sachetto
thanks > black_13 > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Rafael Sachetto Oliveira Sir - Simple Image Resizer http://rsachetto.googlepages.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Last 4 Letters of String

2008-02-21 Thread Rafael Sachetto
ing. I'm sure it's a very simple task but I couldn't find anything > of it. > > > > Any ideas? > > > > Rob > -- > http://mail.python.org/mailman/listinfo/python-list > -- Rafael Sachetto Oliveira Sir - Simple Image Resizer http://rsachetto.googlepages.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a list of lists to a single list

2013-07-23 Thread Rafael Durán Castañeda
El 23/07/13 23:52, st...@divillo.com escribió: [[A0,A1,A2], [B0,B1,B2] [C0,C1,C2]] Hi, I think you are looking for itertools.chain, or in this case, itertools.chain.from_iterable: In [1]: x = [['A0','A1','A2'], ['B0','B1','B2'], ['C0','C1','C2']] In [2]: import itertools In [3]: [ y for y

Re: Can't get around HTTP/401 response using SUDS

2012-03-08 Thread Rafael Durán Castañeda
El 08/03/12 16:44, Adam Tauno Williams escribió: SUDS version 0.4 pn x86_64 Python 2.7 I'm having a bear of a time getting HTTP Basic Authentication to work for a SOAP request via suds. Also using an HTTP proxy server. In WireShark I just see a request - GET http://./services/services/JobS

try/except KeyboardInterrupt vs signal handler for SIGINT

2012-05-07 Thread Rafael Durán Castañeda
Hi, I was wondering which approach is better to stop several servers from just on python application when 'ctrl-c' is pressed, a try/except KeyboardInterrupt or just registering a SIGINT handler and exit when the signal is triggered. Any advantage/disadvantage from one approach over the other

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-17 Thread Rafael Durán Castañeda
El 17/06/12 06:48, Chris Angelico escribió: On Sun, Jun 17, 2012 at 2:18 PM, Steven D'Aprano wrote: Safe from what? What is your threat model? Are you worried about your little sister reading your diary? Or the NSA discovering your plans to assassinate the President? Or something in between?

Re: How can I make a program automatically run once per day?

2011-07-10 Thread Rafael Durán Castañeda
On 10/07/11 04:01, John Salerno wrote: Thanks everyone! I probably should have said something like "Python, if possible and efficient, otherwise any other method" ! :) I'll look into the Task Scheduler. Thanks again! You may use Celery http://docs.celeryproject.org/en/latest/userguide/periodic-

Python ++ Operator?

2011-07-15 Thread Rafael Durán Castañeda
Hello all, I seem something like this on python code: for : for : spam[i][eggs] = ham ++i . . . What's the meaning of using i++? Even, does exist ++ operator in python? Bye -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I implement two decorators in Python both of which would eventually want to call the calling function

2011-08-06 Thread Rafael Durán Castañeda
You don't need doing something special, each decorator returns a new function that and only the result function formed by all decorators will be run. Consider this: def clear_cache(func): def decorator(*args, **kwargs): print "cache cleared" return func(*args, **kwargs)

Re: Restricted attribute writing

2011-08-07 Thread Rafael Durán Castañeda
I think you might use a tuple instead of a list for OrderElement, that would make much easier your code: class OrderElement(tuple): def __new__(cls, x, y): if not isinstance(x, int) or not isinstance(y, int): raise TypeError("Order element must receives two integers")

Re: Restricted attribute writing

2011-08-07 Thread Rafael Durán Castañeda
The assert on Order should be an if ... raise, like OrderElement, sorry for the mistake and repost El 7 de agosto de 2011 18:53, Rafael Durán Castañeda < rafadurancastan...@gmail.com> escribió: > I think you might use a tuple instead of a list for OrderElement, that > would make much

Re: How do I convert String into Date object

2011-08-13 Thread Rafael Durán Castañeda
You can use datetime objects: >>> dt1 = datetime.datetime.strptime('07/27/2011',"%m/%d/%Y") >>> dt2 =datetime.datetime.strptime('07/28/2011',"%m/%d/%Y") >>> dt1 == dt2 False >>> dt1 > dt2 False >>> dt1 < dt2 True >>> dt1 - dt2 datetime.timedelta(-1) On 13/08/11 21:26, MrPink wrote: I have file

Re: login with urllib2

2011-08-14 Thread Rafael Durán Castañeda
I'm not sure but you probably need using HTTPS handler, but without exact error code/message... On 14/08/11 16:50, 守株待兔 wrote: please to see my code: import urllib import urllib2 url = 'http://hi.baidu.com/' values = {'username' : '**','password' : '**' } data = urllib.urlencode(value

Re: same code to login,one is ok,another is not

2011-08-15 Thread Rafael Durán Castañeda
First one is using http and second one https, did you try an https handler? as I already pointed out to you in other thread with the same topic... Please don't spam the list, if you aren 't getting the answers you was looking for, wait for a while and then repost not just open threads until get th

Re: How to structure packages

2011-09-07 Thread Rafael Durán Castañeda
Check python pep8: http://www.python.org/dev/peps/pep-0008/ And you will see than you shouldn't named modules as you did, so you should do something like: mypackage __init__.py mymodule ... mypackage.mymodule.MyClass On 07/09/11 18:11, John Gordon wrote: In<2a4f542c-a8c1-46c7-98

Re: Problem with python 3.2 and circular imports

2011-02-28 Thread Rafael Durán Castañeda
I'm stil totally stuck with relative imports, i' ve tried the example tree from PEP 328 without any result: package/ __init__.py subpackage1/ __init__.py moduleX.py moduleY.py subpackage2/ __init__.py moduleZ.py moduleA.py Assuming that the

Re: question about endswith()

2011-03-03 Thread Rafael Durán Castañeda
I think you want do this: >>> files = ['file1.hdf', 'file2.hdf', 'file3.hdf5','file4.hdf'] >>> print(''.join(x for x in files if x.endswith('5'))) file3.hdf5 >>> But if you need to use it later: >>> file_hdf5 = [x for x in files if x.endswith('5')] >>> file_hdf5 ['file3.hdf5'] >>> 2011/3/4 Gra

Re: Problem with python 3.2 and circular imports

2011-03-05 Thread Rafael Durán Castañeda
from subpackage2? 2011/3/4 Frank Millman > > On February 28 2011 Rafael Durán Castañeda wrote > > I'm stil totally stuck with relative imports, i' ve tried the example tree >> from PEP 328 without any result: >> >> package/ >> __init__.py >>

Re: strange QLineEdit problem in PyQt

2011-03-16 Thread Rafael Durán Castañeda
Just one remark about this line: QtGui.QWidget.__init__(self, parent) I think you should use this: super(Contract, self).__init__(parent) so you will be following PEP 3135 2011/3/16 taco > taco wrote: > > ah, I solved it myself. for completeness reasons. I had upgraded python for > reportla

Re: Use cookies from a script in a browser

2011-03-21 Thread Rafael Durán Castañeda
I think thiscould help you 2011/3/18 gervaz > On 18 Mar, 22:52, Miki Tebeka wrote: > > You can use mechanize, which holds a cookie jar and can user the browser > cookies as w

Re: Converting an array of string to array of float

2011-03-25 Thread Rafael Durán Castañeda
But you must be sure that the list only contains objects than can be converted into float, if not you'll get: >>> float('something') Traceback (most recent call last): File "", line 1, in float('something') ValueError: could not convert string to float: something >>> 2011/3/25 Blockheads O

Re: Amazon Simple Queue Service Worker

2011-04-07 Thread Rafael Durán Castañeda
I'm not sure about what you want to do, but you could check http://www.openstack.org/ web and look for ideas for using with Amazon. 2011/4/7 Joseph Ziegler > Hi all, > > Little new to the python world, please excuse the Noobness. > > We are writing a server which will subscribe to the Amazon Sim

Re: How to re import a module

2011-04-08 Thread Rafael Durán Castañeda
That's really easy: >>> import re >>> reload(re) >>> In python2.x, but if you are using python3.x I think is different, really easy to know if you search in python docs. 2011/4/8 > Hello i want to know the best way to re import a module, because i have a > web server with just one Apache sess

Re: Signal on qt

2011-04-12 Thread Rafael Durán Castañeda
I don't know what are you trying with this for, but I think you may be connecting signal to a combo_test and after that changing combo_test, losing connection, but I'm not really sure. Anyway, this is a python list for PyQt (I think you are using it) you should ask in PyQt list. 2011/4/12 luca72

Re: A question about Python Classes

2011-04-21 Thread Rafael Durán Castañeda
You did: >>> class BaseHandler: ... def foo(self): ... print "Hello" ... >>> class HomerHandler(BaseHandler): ... pass ... >>> test = HomerHandler() >>> test.foo() Hello >>> isinstance(test, BaseHandler) True >>> isinstance(test, HomerHandler) True >>> You could say test is a

Re: Py / VNC Automation

2011-05-03 Thread Rafael Durán Castañeda
You can check this https://github.com/kanaka/noVNC 2011/5/3 Dan Stromberg > > On Mon, May 2, 2011 at 5:23 PM, PyNewbie wrote: > >> Hi, >> I'm looking for a python class or open source code that is tightly >> integrated with VNC protocols - any ideas? >> -- >> http://mail.python.org/mailman/list

Re: Python drawing library?

2011-05-15 Thread Rafael Durán Castañeda
On 15/05/11 01:01, OKB (not okblacke) wrote: Is there any Python library for interactive drawing? I've done some googling but most searches for "drawing" lead me to libraries for programmatic creation of shapes on some GUI canvas. I'm looking for GUI widgets that allow the user to draw

Re: python logging

2011-05-17 Thread Rafael Durán Castañeda
On 17/05/11 22:55, Fei wrote: where is default logging file on Mac? I saw lots of app just import logging, and begins to logging.info(...) etc. I'm not sure where to look at the logging configuration to figure out the log location. I just get in touch of python about 1month ago, and I appreciat

Re: python logging

2011-05-18 Thread Rafael Durán Castañeda
On 18/05/11 03:09, Fei wrote: On May 17, 6:55 pm, Ian Kelly wrote: On Tue, May 17, 2011 at 2:55 PM, Fei wrote: where is default logging file on Mac? I saw lots of app just import logging, and begins to logging.info(...) etc. I'm not sure where to look at the logging configuration to figure o

Re: python logging

2011-05-18 Thread Rafael Durán Castañeda
On 18/05/11 23:29, Ian Kelly wrote: 2011/5/18 Rafael Durán Castañeda: That's not exactly how it works. You can use logging without any configuration and the default output will be console. In addition default logging level is warning, so: logging.info("Some text") won'

Re: python logging

2011-05-18 Thread Rafael Durán Castañeda
On 19/05/11 00:10, Ian Kelly wrote: 2011/5/18 Rafael Durán Castañeda: I think you are confuse because of you are looking at advanced logging, where getLogger is being used. Simple logging works without any configuration, getLogger doesn't. It seems to work without any configuration ju

Re: python logging

2011-05-19 Thread Rafael Durán Castañeda
You are right that behavior isn't documented and might be a bug. You could report it. Bye El 19 de mayo de 2011 00:42, Ian Kelly escribió: > 2011/5/18 Ian Kelly : > > Ah, that's it. I was using Python 2.5. Using 2.7 I get the same > > result that you do. > > > > Still, it's a surprising chang

Re: Python Style Question

2014-10-29 Thread Rafael Romero Carmona
Hi, first in Python 2.7.6 and Python 3.4.0 list haven't got any add function but they have append. I think you could do better with something like == import json l = [1, -1, 0, '1', '-1', '0', json.dumps(-1), json.dumps(1), json.dumps(0), 'x', 'sqjklsqjk__', (1, 2)] values = [] for c in

Re: Python Style Question

2014-10-29 Thread Rafael Romero Carmona
2014-10-29 12:25 GMT+01:00 Martin Kemp : > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 29/10/2014 10:45, Anton wrote: >> Let's say I have an incoming list of values *l*. Every element of >> *l* can be one of the following options: 1) an integer value 2) a >> string in form of '', e.g. '7

Re: [argparse] mutually exclusive group with 2 sets of options

2013-08-05 Thread Rafael Durán Castañeda
El 04/08/13 04:10, Francois Lafont escribió: Hi, Is it possible with argparse to have this syntax for a script? my-script (-a -b VALUE-B | -c -d VALUE-D) I would like to do this with the argparse module. Thanks in advance. I think you are looking for exclusive groups: http://docs.python.o

Re: Python Debugger tool

2013-09-05 Thread Rafael Durán Castañeda
El 06/09/2013, a las 08:14, chandan kumar escribió: > Hi > > Is any one aware of free ipython debugger tool.How good is this tool for a > beginner to use like ,placing breakpoints,checking variables ,call stack > (function flow) etc.I don't like to use python PDB . > I have heard about wing

Re: optionparse: how to add a line break to the help text

2011-09-10 Thread Rafael Durán Castañeda
On 10/09/11 22:43, Gelonida N wrote: I'm having a small question about optionparse. Normaly optionparser will format the help text according to the console's width. I just wondered if there is any way to insert a line breakk into an options help text. Example: from optparse import OptionParse

Re: create a directory structure

2011-09-17 Thread Rafael Durán Castañeda
2011/9/16 Andrea Crotti > After some research, I think that paste-script is the best choice in this > case. > > I can define templates and I'll get my directory structure nicely populated > for me. > > -- > http://mail.python.org/**mailman/listinfo/python-list

Re: Use and usefulness of the as syntax

2011-11-12 Thread Rafael Durán Castañeda
El 12/11/11 13:43, Tim Chase escribió: I hate trying to track down variable-names if one did something like from Tkinter import * +1 -- http://mail.python.org/mailman/listinfo/python-list

Re: redis beginner question

2011-11-16 Thread Rafael Durán Castañeda
El 16/11/11 03:22, Jabba Laci escribió: Hi, I'm reading the redis documentation and there is one thing that bothers me. For redis, you need to start a server on localhost. Is there an easy way that my Python script starts this server automatically? Before using my script, I don't want to start r

Re: memory efficient set/dictionary

2007-06-10 Thread Rafael Darder Calvo
> > > Please recommend a module that allows persistent set/dict storage + > > > fast query that best fits my problem, > > > > What is the problem you are trying to solve? How many keys do you have? > > Corpus processing. There are in the order of billions to tens of > billions keys (64bit integers)

Re: skip next item in list

2007-06-11 Thread Rafael Darder Calvo
On 6/11/07, Andre Engels <[EMAIL PROTECTED]> wrote: > 2007/6/11, ahlongxp <[EMAIL PROTECTED]>: > > list=('a','d','c','d') > > for a in list: > > if a=='a' : > > #skip the letter affer 'a' > > > > what am I supposed to do? > > There might be better ways to do it, but I would do: > > flag

Subprocess and pipe-fork-exec primitive

2007-07-30 Thread Rafael Giannetti Viotti
eap the process before the parent has the chance to do it. I would like to know if this is correct, or am I missing something here? --- Rafael. -- http://mail.python.org/mailman/listinfo/python-list

compile for ARM

2007-09-19 Thread Rafael Marin Perez
Hello I'm Rafael Marin, and work as reseacher in University of Murcia (Spain). I want to install and compile modules of python2.4 in a ARMv5b architecture. Any idea? Thank for your time. Regards, Rafa. -- http://mail.python.org/mailman/listinfo/python-list

Python for NSLU2

2007-09-20 Thread Rafael Marin Perez
Hello, I am Rafael Marin Perez, and work as a researcher in University of Murcia (Spain). We are using the Network Storage Link for USB2.0 (NSLU2) device to desploy a wireless sensor network (WSN). And I need to install a bootstrap-loader of MSP430 in my NSLU2 to transfer the compiled images to

Read header and data from a binary file

2009-09-22 Thread Jose Rafael Pacheco
Hello, I want to read from a binary file called myaudio.dat Then I've tried the next code: import struct name = "myaudio.dat" f = open(name,'rb') f.seek(0) chain = "< 4s 4s I 4s I 20s I I i 4s I 67s s 4s I" s = f.read(4*1+4*1+4*1+4*1+4*1+20*1+4*1+4*1+4*1+4*1+4*1+67*1+1+4*1+4*1) a = struct.unpack(

Read header and data from a binary file [LONG]

2009-09-23 Thread Jose Rafael Pacheco
Hello, I want to read from a binary file called myaudio.dat Then I've tried the next code: import struct name = "myaudio.dat" f = open(name,'rb') f.seek(0) chain = "< 4s 4s I 4s I 20s I I i 4s I 67s s 4s I" s = f.read(4*1+4*1+4*1+4*1+4*1+20*1+4*1+4*1+4*1+4*1+4*1+67*1+1+4*1+4*1) a = struct.unpack(