Need help creating variable for unpack statement
alfred6465 at my-deja.com
alfred6465 at my-deja.com
Mon Oct 23 16:15:36 EDT 2000
WOULDN'T YA KNOW IT -- I POST A MESSAGE AND MINUTES LATER FIGURE IT OUT
FOR MYSELF!!! MY PROBLEM HAS BEEN FIXED.
In article <8t24rf$hg0$1 at nnrp1.deja.com>,
alfred6465 at my-deja.com wrote:
> I'm new to Python and have a dumb question (please be patient with
> me!!!!)....
>
> I have a variable called length which contains a value of 6 and a
> variable called fmt which contains 's'.
>
> length = 6
> fmt = 's'
>
> How do I combine those into one variable with the value of '6s'.
>
> Once I have a variable called fmt holding the value of 6s, I want to
> place it into a struct.unpack statement (see below).
>
> test = struct.unpack(fmt, f[38:44])
>
> Thanks for the help in advance.
> Alfred
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
More information about the Python-list
mailing list