Re: Cleaning up conditionals

2016-12-30 Thread Jussi Piitulainen
"Deborah Swanson" writes: > Michael Torrie wrote: >> On 12/30/2016 05:26 PM, Deborah Swanson wrote: >> > I'm still wondering if these 4 lines can be collapsed to one or two >> > lines. >> >> If the logic is clearly expressed in the if blocks that you >> have, I don't see why collapsing an if b

Re: Problem with running python 3.6.0 on a 32 bit windows 7 ultimate operating system.

2016-12-30 Thread Ian Kelly
On Fri, Dec 30, 2016 at 10:53 PM, Sagar Utlas wrote: > I am new to python, I've been using C++ as as a student till last 3 years. > To expand my knowledge, I installed Python 3.6.0 and when tried to open it, > a pop up window appeared saying- "The program can't start because > api-ms-win-crt-runti

Re: learning and experimenting python.

2016-12-30 Thread Steve D'Aprano
On Sat, 31 Dec 2016 02:24 pm, einstein1...@gmail.com wrote: > Ethan, > If you think I am wasting time, don't read my posts. > Why wasting your time in reading my post. > > Are you having the answer of my question? > Till now no one is able to give answer, everybody just assuming something > and a

Re: learning and experimenting python.

2016-12-30 Thread Wildman via Python-list
On Fri, 30 Dec 2016 19:23:17 -0700, Michael Torrie wrote: > On 12/30/2016 07:05 PM, Wildman via Python-list wrote: >> On Fri, 30 Dec 2016 23:39:43 +, Erik wrote: >> >>> On 30/12/16 23:34, einstein1...@gmail.com wrote: You are also confusing me. But there mustbe some reason. Wh

Problem with running python 3.6.0 on a 32 bit windows 7 ultimate operating system.

2016-12-30 Thread Sagar Utlas
I am new to python, I've been using C++ as as a student till last 3 years. To expand my knowledge, I installed Python 3.6.0 and when tried to open it, a pop up window appeared saying- "The program can't start because api-ms-win-crt-runtime-|1-1-0.dll is missing from your computer. try reinstalling

Re: learning and experimenting python.

2016-12-30 Thread Steve D'Aprano
On Sat, 31 Dec 2016 10:26 am, einstein1...@gmail.com wrote: > That's not the answer. > If you don't have answer, please don't answer like this, because that will > confuse others also. What's not the answer? What's the question? -- Steve “Cheer up,” they said, “things could be worse.” So I che

Re: List comprehension

2016-12-30 Thread Terry Reedy
On 12/30/2016 2:37 PM, Jason Friedman wrote: Now, this puzzles me: [x,y for a in data] File "", line 1 [x,y for a in data] ^ SyntaxError: invalid syntax I believe that python begins to parse this as [x, (y for a in data)], a list of 2 items, except that the required () are

Re: List comprehension

2016-12-30 Thread Jason Friedman
> data = ( >> ... (1,2), >> ... (3,4), >> ... ) >> > [x,y for a in data] >> File "", line 1 >> [x,y for a in data] >>^ >> SyntaxError: invalid syntax >> >> I expected: >> [(1, 2), (3, 4)] > > > Why would you expect that? I would expect the global variables x and y, or > if

Re: learning and experimenting python.

2016-12-30 Thread Ian Kelly
On Fri, Dec 30, 2016 at 6:05 PM, wrote: > But in his website, he recommended that post your questions here, he will > answer it. > But still as you told me I will send him an personal e-mail. This is a good place for asking questions about Python, but you should know that Guido himself doesn't

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
Michael Torrie wrote: > On 12/30/2016 05:26 PM, Deborah Swanson wrote: > > I'm still wondering if these 4 lines can be collapsed to one or two > > lines. > > If the logic is clearly expressed in the if blocks that you > have, I don't see why collapsing an if block into one or two > lines would

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 2016-12-31 00:48, Deborah Swanson wrote: > >> On 30/12/16 23:00, Deborah Swanson wrote: > >> > Oops, indentation was messed up when I copied it into the email. > >> > Should be this: > >> > > >> > if len(l1[st]) == 0: > >> > if len(l2[st]) > 0: > >> >

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 30Dec2016 15:17, Deborah Swanson wrote: > >>Ever consider using conjunctions? > >> > >>if len(l1[st]) and not len(l2[st]): > >>#0 is considered a false -- no need to test for "==0" > >>#non-0 is considered true -- no need to test for ">0" > >>#copy

Re: Re: Cleaning up conditionals

2016-12-30 Thread MRAB
On 2016-12-31 01:59, Cameron Simpson wrote: On 30Dec2016 15:17, Deborah Swanson wrote: Ever consider using conjunctions? if len(l1[st]) and not len(l2[st]): #0 is considered a false -- no need to test for "==0" #non-0 is considered true -- no nee

Re: learning and experimenting python.

2016-12-30 Thread Chris Angelico
On Sat, Dec 31, 2016 at 12:46 PM, eryk sun wrote: > In modern Windows, cmd and PowerShell change the console title instead > of the prompt. The title starts with "Administrator: " if the user is > an administrator (i.e. the BUILTIN\Administrators group is present and > enabled in the process token

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Thanks everyone. My all posted messages will be deleted within 1 hour. I got my answer, its time to good bye. If new questions arise then I will put it by creating new topic. Good Bye all. Once again thanks David Froger for your answer. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Sorry everyone it's not LAN, its David Rogers. Please accept my apology. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Thanks once again. Its only you who gave me the satisfied answer. Now it's my task to identify the reason why ABC used >>> ? -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Ethan, If you think I am wasting time, don't read my posts. Why wasting your time in reading my post. Are you having the answer of my question? Till now no one is able to give answer, everybody just assuming something and answering. No answer is perfect that satisfy why it uses >>>. Except lan's

Re: Cleaning up conditionals

2016-12-30 Thread Cameron Simpson
On 30Dec2016 15:17, Deborah Swanson wrote: Ever consider using conjunctions? if len(l1[st]) and not len(l2[st]): #0 is considered a false -- no need to test for "==0" #non-0 is considered true -- no need to test for ">0" #copy l1 t

Re: Cleaning up conditionals

2016-12-30 Thread MRAB
On 2016-12-31 00:48, Deborah Swanson wrote: On 30/12/16 23:00, Deborah Swanson wrote: > Oops, indentation was messed up when I copied it into the email. > Should be this: > >if len(l1[st]) == 0: > if len(l2[st]) > 0: > l1[st] = l2[st] >

Re: Cleaning up conditionals

2016-12-30 Thread Michael Torrie
On 12/30/2016 05:26 PM, Deborah Swanson wrote: > I'm still wondering if these 4 lines can be collapsed to one or two > lines. If the logic is clearly expressed in the if blocks that you have, I don't see why collapsing an if block into one or two lines would even be desirable. Making a clever one

Re: learning and experimenting python.

2016-12-30 Thread Ethan Furman
On 12/30/2016 06:05 PM, Wildman via Python-list wrote: On Fri, 30 Dec 2016 23:39:43 +, Erik wrote: Do not feed the troll. Please explain how what I said is trolling. Perhaps it was a little snide but I tend to get that way when trying to explain the obvious. I suspect Erik was referri

Re: learning and experimenting python.

2016-12-30 Thread Michael Torrie
On 12/30/2016 07:05 PM, Wildman via Python-list wrote: > On Fri, 30 Dec 2016 23:39:43 +, Erik wrote: > >> On 30/12/16 23:34, einstein1...@gmail.com wrote: >>> You are also confusing me. >>> But there mustbe some reason. >>> What happens if your student questions you like this.? >>> And may be

Re: learning and experimenting python.

2016-12-30 Thread Michael Torrie
On 12/30/2016 04:26 PM, einstein1...@gmail.com wrote: > That's not the answer. > If you don't have answer, please don't answer like this, because that will > confuse others also. I don't believe anyone will be confused. Clearly there's no answer that you understand, or one that would satisfy you

Re: learning and experimenting python.

2016-12-30 Thread Michael Torrie
On 12/30/2016 06:46 PM, eryk sun wrote: > On Fri, Dec 30, 2016 at 7:49 PM, Michael Torrie wrote: >> >> Is there a special reason bourne shell uses $ and #? > > To me, "$" is for the [$]tandard shell prompt, and "#" noticeably > distinguishes root shells. Yes of course. You missed my point compl

Re: learning and experimenting python.

2016-12-30 Thread Wildman via Python-list
On Fri, 30 Dec 2016 23:39:43 +, Erik wrote: > On 30/12/16 23:34, einstein1...@gmail.com wrote: >> You are also confusing me. >> But there mustbe some reason. >> What happens if your student questions you like this.? >> And may be those who questions like this will surely be the developer of i

Re: learning and experimenting python.

2016-12-30 Thread Wildman via Python-list
On Fri, 30 Dec 2016 15:34:16 -0800, einstein1410 wrote: > You are also confusing me. > But there mustbe some reason. > What happens if your student questions you like this.? I am not a teacher. > And may be those who questions like this will surely be the developer of its > successor language.

Re: learning and experimenting python.

2016-12-30 Thread eryk sun
On Fri, Dec 30, 2016 at 7:49 PM, Michael Torrie wrote: > > Is there a special reason bourne shell uses $ and #? To me, "$" is for the [$]tandard shell prompt, and "#" noticeably distinguishes root shells. > Coming from an old DOS background (>) I found that rather jarring at first. DOS is a si

Re: Simulating int arithmetic with wrap-around

2016-12-30 Thread Serhiy Storchaka
On 31.12.16 02:30, Steve D'Aprano wrote: Are you saying that the best way of doing this is this? (1) convert signed Python ints to unsigned; (2) perform operation and bitmask; (3) convert unsigned back to signed. Here's an example. I want to multiply 7*3 using a signed 4-bit int, getting 5 a

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 31/12/16 00:26, Deborah Swanson wrote: > > As Mr. Bieber points out, what I had above greatly benefits > from the > > use of conjunctions. It now reads: > > > > if not len(l1[st]) and len(l2[st]): > > IMHO, "if not len(l)" is a _terrible_ way of spelling "if > len(l) == 0" > (mentally, I

Re: learning and experimenting python.

2016-12-30 Thread Steve D'Aprano
On Sat, 31 Dec 2016 05:51 am, BartC wrote: > In usenet posts >>> gets confused for quoted material 3 levels deep > (which on my newsreader is shown as coloured vertical bars on the left). Indeed, which is why my Python startup file contains this: # Change the main prompt. Consider using '≻≻≻

RE: Re: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 30/12/16 23:00, Deborah Swanson wrote: > > Oops, indentation was messed up when I copied it into the email. > > Should be this: > > > > if len(l1[st]) == 0: > > if len(l2[st]) > 0: > > l1[st] = l2[st] > > elif len(l2[st]) == 0: > >

Re: Cleaning up conditionals

2016-12-30 Thread Erik
On 31/12/16 00:26, Deborah Swanson wrote: As Mr. Bieber points out, what I had above greatly benefits from the use of conjunctions. It now reads: if not len(l1[st]) and len(l2[st]): IMHO, "if not len(l)" is a _terrible_ way of spelling "if len(l) == 0" (mentally, I have to read that as "if le

Re: List comprehension

2016-12-30 Thread Steve D'Aprano
On Sat, 31 Dec 2016 06:37 am, Jason Friedman wrote: > $ python > Python 3.6.0 (default, Dec 26 2016, 18:23:08) > [GCC 4.8.4] on linux > Type "help", "copyright", "credits" or "license" for more information. data = ( > ... (1,2), > ... (3,4), > ... ) [a for a in data] > [(1, 2), (3, 4)] >

Re: Simulating int arithmetic with wrap-around

2016-12-30 Thread Steve D'Aprano
On Sat, 31 Dec 2016 02:14 am, Serhiy Storchaka wrote: > On 30.12.16 16:47, Steve D'Aprano wrote: >> Again, assume both operands are in range for an N-bit signed integer. >> What's a good way to efficiently, or at least not too inefficiently, do >> the calculations in Python? > > def to_unsigned(b

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 31 December 2016 at 10:00, Deborah Swanson > wrote: > > > > Oops, indentation was messed up when I copied it into the email. > > The indentation of your latest message looks completely > broken now, you can see it here: > https://mail.python.org/pipermail/python-list/2016-December/71 775

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
But in his website, he recommended that post your questions here, he will answer it. But still as you told me I will send him an personal e-mail. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
And if this is unimportant, as you thought, then you must not be the part of this group. This group is to share knowledge, nott for deciding what is trivia and what's not. If you think it's it, simply leave it, any else will answer. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Im not feeding the troll. If you don't have answer to this, then there would be no question that you are the python developer. And if this is troll, leave it. But respect every question, they are the gift of God. And if there is no question, there will be no answer. And may the question is the an

Re: learning and experimenting python.

2016-12-30 Thread Ian Kelly
On Dec 30, 2016 4:42 PM, wrote: Yes, I am not confusing you all, rather I thought that this is the best place to solve any doubts, soy only question for you is Why python uses >>> instead of >, or any other special characters? Do you know about this, if yes then please answer it. I will be so mu

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
No I have a question not answer, but if I got the answer then I will tell you. Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Then again the question is same for ABC. Why >>>? -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread Erik
On 30/12/16 23:34, einstein1...@gmail.com wrote: You are also confusing me. But there mustbe some reason. What happens if your student questions you like this.? And may be those who questions like this will surely be the developer of its successor language. Because out of thousands, only one ma

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Yes, I am not confusing you all, rather I thought that this is the best place to solve any doubts, soy only question for you is Why python uses >>> instead of >, or any other special characters? Do you know about this, if yes then please answer it. I will be so much thankful of you. -- https://m

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
You are also confusing me. But there mustbe some reason. What happens if your student questions you like this.? And may be those who questions like this will surely be the developer of its successor language. Because out of thousands, only one may asks this, whom you all will consider fool, but

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
I am not getting you. Please simplify it. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
That's not the answer. If you don't have answer, please don't answer like this, because that will confuse others also. -- https://mail.python.org/mailman/listinfo/python-list

Re: Cleaning up conditionals

2016-12-30 Thread Erik
On 30/12/16 23:00, Deborah Swanson wrote: Oops, indentation was messed up when I copied it into the email. Should be this: if len(l1[st]) == 0: if len(l2[st]) > 0: l1[st] = l2[st] elif len(l2[st]) == 0: if len(l1[st]

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On Fri, 30 Dec 2016 13:20:15 -0800, "Deborah Swanson" > declaimed the following: > > >I've already learned one neat trick to collapse a conditional: > > > > a = expression1 if condition else expression2 > > > >Here I have a real mess, in my opinion: > > > > if len(l1[st]) == 0: > >

Re: Cleaning up conditionals

2016-12-30 Thread David
On 31 December 2016 at 10:00, Deborah Swanson wrote: > > Oops, indentation was messed up when I copied it into the email. The indentation of your latest message looks completely broken now, you can see it here: https://mail.python.org/pipermail/python-list/2016-December/717758.html -- https://m

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
BartC wrote: > Sent: Friday, December 30, 2016 2:11 PM > > On 30/12/2016 21:20, Deborah Swanson wrote: > > I've already learned one neat trick to collapse a conditional: > > > > a = expression1 if condition else expression2 > > > > Here I have a real mess, in my opinion: > > > > if len(l1[

Re: List comprehension

2016-12-30 Thread Joel Goldstick
On Fri, Dec 30, 2016 at 2:58 PM, Joaquin Alzola wrote: > > >>Now, this puzzles me: > > [x,y for a in data] >> File "", line 1 >>[x,y for a in data] > > ^ >>SyntaxError: invalid syntax > >>I expected: >>[(1, 2), (3, 4)] > > You can try [(x,z) for x,z in data]. > In your situation

Re: Cleaning up conditionals

2016-12-30 Thread BartC
On 30/12/2016 21:20, Deborah Swanson wrote: I've already learned one neat trick to collapse a conditional: a = expression1 if condition else expression2 Here I have a real mess, in my opinion: if len(l1[st]) == 0: if len(l2[st]) > 0: l1[st] = l2[st]

Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
I've already learned one neat trick to collapse a conditional: a = expression1 if condition else expression2 Here I have a real mess, in my opinion: if len(l1[st]) == 0: if len(l2[st]) > 0: l1[st] = l2[st] elif len(l2[st]) == 0: if

RE: List comprehension

2016-12-30 Thread Joaquin Alzola
>Now, this puzzles me: [x,y for a in data] > File "", line 1 >[x,y for a in data] > ^ >SyntaxError: invalid syntax >I expected: >[(1, 2), (3, 4)] You can try [(x,z) for x,z in data]. In your situation a takes the values (1,2) or (3,4) in the one that I put x and z take the

Re: learning and experimenting python.

2016-12-30 Thread David Froger
Quoting einstein1...@gmail.com (2016-12-30 18:50:19) > Hello everyone, > I am the new comer and learner of python. > I have a doubt that when I type python and press enter it shows a prompt like > >>> > But why it is >>> ? > Is there any special reason? > Why it is not setted as @,& or any other sp

Re: List comprehension

2016-12-30 Thread Joel Goldstick
On Fri, Dec 30, 2016 at 2:37 PM, Jason Friedman wrote: > $ python > Python 3.6.0 (default, Dec 26 2016, 18:23:08) > [GCC 4.8.4] on linux > Type "help", "copyright", "credits" or "license" for more information. data = ( > ... (1,2), > ... (3,4), > ... ) [a for a in data] > [(1, 2), (3, 4)

Re: learning and experimenting python.

2016-12-30 Thread Chris Angelico
On Sat, Dec 31, 2016 at 6:49 AM, Michael Torrie wrote: > Is there a special reason bourne shell uses $ and #? Coming from an old > DOS background (>) I found that rather jarring at first. There's no > particular reason for any of those shell prompts. You say "%" is for > "other shell." Which s

Re: learning and experimenting python.

2016-12-30 Thread Michael Torrie
On 12/30/2016 12:08 PM, einstein1...@gmail.com wrote: > LAN you are right. I am agree with you that it's easy to recognise. > > But look > $ for normal user > # for special user/root > % for other shell For python > And so on... > Why? > Why their developer selected that? > Is there any spec

List comprehension

2016-12-30 Thread Jason Friedman
$ python Python 3.6.0 (default, Dec 26 2016, 18:23:08) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information. >>> data = ( ... (1,2), ... (3,4), ... ) >>> [a for a in data] [(1, 2), (3, 4)] Now, this puzzles me: >>> [x,y for a in data] File "", line 1 [x

Re: learning and experimenting python.

2016-12-30 Thread Wildman via Python-list
On Fri, 30 Dec 2016 11:08:30 -0800, einstein1410 wrote: > LAN you are right. I am agree with you that it's easy to recognise. > > But look > $ for normal user > # for special user/root > % for other shell For python > And so on... > Why? > Why their developer selected that? > Is there any s

Re: learning and experimenting python.

2016-12-30 Thread BartC
On 30/12/2016 19:09, einstein1...@gmail.com wrote: So what bartc? What until you have to try and figure out which is which! It's a disadvantage of using >>> -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread mm0fmf
On 30/12/2016 19:08, einstein1...@gmail.com wrote: LAN you are right. I am agree with you that it's easy to recognise. But look $ for normal user # for special user/root % for other shell For python And so on... Why? Why their developer selected that? Is there any special reason? It is what i

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
So what bartc? -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
LAN you are right. I am agree with you that it's easy to recognise. But look $ for normal user # for special user/root % for other shell >>> For python And so on... Why? Why their developer selected that? Is there any special reason? -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread BartC
On 30/12/2016 18:44, Ian Kelly wrote: On Fri, Dec 30, 2016 at 11:50 AM, wrote: Hello everyone, I am the new comer and learner of python. I have a doubt that when I type python and press enter it shows a prompt like But why it is >>> ? Is there any special reason? Why it is not setted as @,&

Re: learning and experimenting python.

2016-12-30 Thread Ian Kelly
On Fri, Dec 30, 2016 at 11:50 AM, wrote: > Hello everyone, > I am the new comer and learner of python. > I have a doubt that when I type python and press enter it shows a prompt like > But why it is >>> ? > Is there any special reason? > Why it is not setted as @,& or any other special chara

learning and experimenting python.

2016-12-30 Thread einstein1410
Hello everyone, I am the new comer and learner of python. I have a doubt that when I type python and press enter it shows a prompt like >>> But why it is >>> ? Is there any special reason? Why it is not setted as @,& or any other special characters? -- https://mail.python.org/mailman/listinfo/pyth

Re: Parse a Wireshark pcap file

2016-12-30 Thread Grant Edwards
On 2016-12-27, 1991manish.ku...@gmail.com <1991manish.ku...@gmail.com> wrote: > > I have a pcap file, I want to parse that file & fetch some > information like Timestamp, Packet Size, Source/Dest IP Address, > Source/Dest Port, Source/ Dest MAC address. I've been using pylibpcap for ages. It's a

Re: Simulating int arithmetic with wrap-around

2016-12-30 Thread Chris Angelico
On Sat, Dec 31, 2016 at 1:47 AM, Steve D'Aprano wrote: > How about *signed* integers? > > 7 + 1 => -8 > 7 + 2 => -7 > 7 + 7 => -2 > > 7 * 2 => -2 > 7 * 3 => 5 > 7 * 4 => -4 > > > Again, assume both operands are in range for an N-bit signed integer. What's > a good way to efficiently, or at least n

Re: Simulating int arithmetic with wrap-around

2016-12-30 Thread Serhiy Storchaka
On 30.12.16 16:47, Steve D'Aprano wrote: Again, assume both operands are in range for an N-bit signed integer. What's a good way to efficiently, or at least not too inefficiently, do the calculations in Python? def to_unsigned(bits, x): return x & ((1

Re: [OT] Security question

2016-12-30 Thread Marko Rauhamaa
Chris Angelico : > On Fri, Dec 30, 2016 at 10:47 PM, Anssi Saari wrote: >> I'd say it depends on what the password is actually used for. You seem >> to indicate it's just so you can access the internet? To me it seems >> abusing that password is hard to impossible since it's your fibre to >> your

Simulating int arithmetic with wrap-around

2016-12-30 Thread Steve D'Aprano
It's easy to simulate integer arithmetic with wrap-around for *unsigned* ints. For example, imagine a four-bit integer (0 through 15): # Addition py> (7 + 8) & 0xF 15 py> (7 + 9) & 0xF 0 py> (7 + 10) & 0xF 1 # Multiplication py> (7 * 2) & 0xF 14 py> (7 * 3) & 0xF 5 py> (7 * 4) & 0xF 12 And in g

Re: [OT] Security question

2016-12-30 Thread Chris Angelico
On Fri, Dec 30, 2016 at 10:47 PM, Anssi Saari wrote: > I'd say it depends on what the password is actually used for. You seem > to indicate it's just so you can access the internet? To me it seems > abusing that password is hard to impossible since it's your fibre to > your home. If the password i

Re: [OT] Security question

2016-12-30 Thread Marko Rauhamaa
Anssi Saari : > "Frank Millman" writes: >> To my surprise, they sent me my existing username *and* my existing >> password, all in clear text. > > I'd say it depends on what the password is actually used for. You seem > to indicate it's just so you can access the internet? To me it seems > abusin

Re: [OT] Security question

2016-12-30 Thread Anssi Saari
"Frank Millman" writes: > Hi all > > This is off-topic, but I would appreciate a comment on this matter. > > I have just upgraded my internet connection from ADSL to Fibre. > > As part of the process, my ISP sent a text message to my cell phone > with the username and password I must use to conne

Re: python3 - set '\n\n' as the terminator when writing a formatted LogRecord

2016-12-30 Thread Peter Otten
iMath wrote: > Is it possible to set '\n\n' as the terminator when writing a formatted > LogRecord to a stream by changing the format parameter of > logging.basicConfig? > > I know it is possible using the terminator attribute of StreamHandler > class to implement this, I just wonder Is it possib

Re: ctypes, memory mapped files and context manager

2016-12-30 Thread Peter Otten
eryk sun wrote: > On Thu, Dec 29, 2016 at 12:18 PM, Hans-Peter Jansen wrote: >>> >>> import weakref, ctypes >>> >>> T = ctypes.c_ubyte * 3 >>> >>> t = T() >>> >>> bytes(t) == b"\0" * 3 >>> >>> True >>> >>> >>> bytes(weakref.proxy(t)) == b"\0" * 3 >>> >>> Traceback (most recent call last): >>> F