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
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:
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)
>
>
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
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
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
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,
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
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
For the purpose of learning I am writing a script that will
return different information about the Linux machine where
it is running. Sort of like the inxi utility.
Below is some code that I found that returns a list of the
network interface devices on the system. It runs as is
perfectly on
10 matches
Mail list logo