Best way to split up lines - RE: About the 79 character linerecommendation

Fredrik Lundh fredrik at pythonware.com
Thu Dec 7 07:04:53 EST 2006


Michael Yanowitz wrote:

> What would be the best way to split the following line (Python doesn't like
> me to split it up between the comma-separated parameters):
>
>    top, ip1, ip2, ip3, ip4, messageCounter, ackRequired, dataType, utc1,
> utc2, utc3, utc4, utc5, utc6, utc7, utc8, utc9, utc10, utc11, utc12, st1,
> st2, st3, st4, st5, st6, numberOfLabels, dataWord =
> struct.unpack("!H4BH20BHI", strMessage)

    data = struct.unpack("!H4BH20BHI", strMessage)

    (top, ip1, ip2, ip3, ip4, messageCounter, ackRequired,
    dataType, utc1, utc2, utc3, utc4, utc5, utc6, utc7, utc8,
    utc9, utc10, utc11, utc12, st1, st2, st3, st4, st5, st6,
    numberOfLabels, dataWord) = data

</F> 






More information about the Python-list mailing list