On Fri, 02 Dec 2016 19:39:39 +, Grant Edwards wrote:
> On 2016-12-02, Wildman via Python-list wrote:
>> On Fri, 02 Dec 2016 15:11:18 +, Grant Edwards wrote:
>>
>>> I don't know what the "addr" array contains, but if addr is a byte
>>> string, then the "int()" call is not needed, in Python
On 2016-12-02, Wildman via Python-list wrote:
> On Fri, 02 Dec 2016 15:11:18 +, Grant Edwards wrote:
>
>> I don't know what the "addr" array contains, but if addr is a byte
>> string, then the "int()" call is not needed, in Pythong 3, a byte is
>> already an integer:
>>
>> def format_ip(a
On Fri, 02 Dec 2016 15:11:18 +, Grant Edwards wrote:
> I don't know what the "addr" array contains, but if addr is a byte
> string, then the "int()" call is not needed, in Pythong 3, a byte is
> already an integer:
>
> def format_ip(a):
>return '.'.join(str(b) for b in a)
>
> add
On 2016-12-02, Wildman via Python-list wrote:
> On Wed, 30 Nov 2016 14:39:02 +0200, Anssi Saari wrote:
>
>> There'll be a couple more issues with the printing but they should be
>> easy enough.
>
> I finally figured it out, I think. I'm not sure if my changes are
> what you had in mind but it is
On Wed, 30 Nov 2016 14:39:02 +0200, Anssi Saari wrote:
> There'll be a couple more issues with the printing but they should be
> easy enough.
I finally figured it out, I think. I'm not sure if my changes are
what you had in mind but it is working. Below is the updated code.
Thank you for not gi
On Wed, 30 Nov 2016 07:54:45 -0500, Dennis Lee Bieber wrote:
> On Tue, 29 Nov 2016 22:01:51 -0600, Wildman via Python-list
> declaimed the following:
>
>>I really appreciate your reply. Your suggestion fixed that
>>problem, however, a new error appeared. I am doing some
>>research to try to fi
Wildman via Python-list writes:
> On Tue, 29 Nov 2016 18:29:51 -0800, Paul Rubin wrote:
>
>> Wildman writes:
>>> names = array.array("B", '\0' * bytes)
>>> TypeError: cannot use a str to initialize an array with typecode 'B'
>>
>> In Python 2, str is a byte string and you can do that. In P
On Tue, 29 Nov 2016 18:29:51 -0800, Paul Rubin wrote:
> Wildman writes:
>> names = array.array("B", '\0' * bytes)
>> TypeError: cannot use a str to initialize an array with typecode 'B'
>
> In Python 2, str is a byte string and you can do that. In Python 3,
> str is a unicode string, and if
Wildman writes:
> names = array.array("B", '\0' * bytes)
> TypeError: cannot use a str to initialize an array with typecode 'B'
In Python 2, str is a byte string and you can do that. In Python 3,
str is a unicode string, and if you want a byte string you have to
specify that explicitly, like