Re: IoT automation

2018-01-28 Thread Dale Marvin via Python-list
On 1/28/18 7:39 AM, Prahallad Achar wrote: Hello team, Could you please help me out in automation of IoT product end to end Regards Prahallad ? --Dale -- https://mail.python.org/mailman/listinfo/python-list

Re: Welcome to the "Python-list" mailing list (Digest mode)

2018-01-28 Thread nelson jon kane
When I enter the word python in the search box on my Chrome Windows 10, this is what comes up. Can you tell me what each of these "types" of Python mean? Thank you. [cid:aa3fd74d-d71d-42c0-b063-4f20c463987b] From: Python-list on behalf of python-list-requ...@p

Re: Welcome to the "Python-list" mailing list (Digest mode)

2018-01-28 Thread nelson jon kane
Where did this guy in the video below get the version of Python that he's using? I don't have it in my computer.His version has this across the top: *for.py - C:/Users/Madhur/Desktop/for.py* https://www.youtub

IoT automation

2018-01-28 Thread Prahallad Achar
Hello team, Could you please help me out in automation of IoT product end to end Regards Prahallad -- https://mail.python.org/mailman/listinfo/python-list

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Dan Stromberg
On Sun, Jan 28, 2018 at 8:24 PM, Dan Stromberg wrote: > If an NN can ... play go on a level that can beat the best human in the > world Correcting myself: I think Google's AlphaGo used more than one NN, plus perhaps a little traditional reading algorithm. So I probably should have said "If NN's

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Dan Stromberg
On Sun, Jan 28, 2018 at 5:46 PM, Steven D'Aprano wrote: > On Sun, 28 Jan 2018 17:13:05 -0800, Dan Stromberg wrote: >> It feel like it'd be possible to train a neural network to translate >> text in a screenshot to plain text though. > > That would be OCR, which has been around long before neural n

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Jason Qian via Python-list
The message type is bytes, this may make different ? print(type(message)) On Sun, Jan 28, 2018 at 8:41 PM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > On Sun, 28 Jan 2018 20:31:39 -0500, Jason Qian via Python-list wrote: > > > Thanks a lot :) > > > > os.write(1, message)

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Larry Martell
On Sun, Jan 28, 2018 at 10:04 AM, Steven D'Aprano wrote: > I'm seeing this annoying practice more and more often. Even for trivial > pieces of text, a few lines, people post screenshots instead of copying > the code. > > Where has this meme come from? It seems to be one which inconveniences > *eve

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Dan Stromberg
On Sun, Jan 28, 2018 at 6:04 PM, Steven D'Aprano wrote: > On Sun, 28 Jan 2018 17:49:44 -0800, Dan Stromberg wrote: > So what was the clue that it was bytes that you saw that (nearly) > everyone else missed? Especially me. Can I get away with saying "it was just a good guess"? I've been using byt

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 17:49:44 -0800, Dan Stromberg wrote: > On Sun, Jan 28, 2018 at 5:35 PM, Steven D'Aprano > wrote: >> On Sun, 28 Jan 2018 17:04:56 -0800, Dan Stromberg wrote: >>> How about: >> os.write(1, message) >> >> What do you think that will do that print() doesn't do? > message

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 19:51:06 -0500, Jason Qian via Python-list wrote: > print(repr(message)) out : > > *does not exist\r\n\tat com.* For the record, I'd just like to say that this is not the output of Jason's call to print(). It has been edited to remove the b' ' delimiters which would have

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 17:13:05 -0800, Dan Stromberg wrote: > I'm afraid the perspective may be: > Text == primitive > GUI == modern > > It feel like it'd be possible to train a neural network to translate > text in a screenshot to plain text though. That would be OCR, which has been around long be

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Dan Stromberg
On Sun, Jan 28, 2018 at 5:35 PM, Steven D'Aprano wrote: > On Sun, 28 Jan 2018 17:04:56 -0800, Dan Stromberg wrote: >> How about: > os.write(1, message) > > What do you think that will do that print() doesn't do? >>> message = b'*does not exist\r\n\tat com.*' >>> os.write(1, message) *does not

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 20:31:39 -0500, Jason Qian via Python-list wrote: > Thanks a lot :) > > os.write(1, message) works ! I still do not believe that print(message) doesn't work. I can see no reason why you need to use os.write(). -- Steve -- https://mail.python.org/mailman/listinfo/pyth

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 17:04:56 -0800, Dan Stromberg wrote: > How about: os.write(1, message) What do you think that will do that print() doesn't do? -- Steve -- https://mail.python.org/mailman/listinfo/python-list

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Steven D'Aprano
Jason, your Python output and the C output are not the same. Also, it looks like your email client is adding formatting codes to the email, or something. Please look at your post here: https://mail.python.org/pipermail/python-list/2018-January/730384.html Do you notice the extra asterisks added

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Jason Qian via Python-list
Thanks Peter, replace print with os.write fixed the problem. On Sun, Jan 28, 2018 at 3:57 AM, Peter Otten <__pete...@web.de> wrote: > Jason Qian via Python-list wrote: > > > HI > > > >I have a string that contains \r\n\t > > > >[Ljava.lang.Object; does not exist*\r\n\t*at > >[co

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Jason Qian via Python-list
Thanks a lot :) os.write(1, message) works ! On Sun, Jan 28, 2018 at 8:04 PM, Dan Stromberg wrote: > How about: > >>> os.write(1, message) > > On Sun, Jan 28, 2018 at 4:51 PM, Jason Qian via Python-list > wrote: > > print(repr(message)) out : > > > > *does not exist\r\n\tat com.* > > > > > >

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Dan Sommers
On Mon, 29 Jan 2018 00:27:07 +, Steven D'Aprano wrote: > On Mon, 29 Jan 2018 08:55:54 +1100, Tim Delaney wrote: > >> I got back a Word document containing about 10 screenshots where they'd >> apparently taken a screenshot, moved the horizontal scrollbar one >> screen, taken another screenshot

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Dan Stromberg
I'm afraid the perspective may be: Text == primitive GUI == modern It feel like it'd be possible to train a neural network to translate text in a screenshot to plain text though. On Sun, Jan 28, 2018 at 7:04 AM, Steven D'Aprano wrote: > I'm seeing this annoying practice more and more often. Even

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Tim Delaney
On 29 January 2018 at 11:27, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > On Mon, 29 Jan 2018 08:55:54 +1100, Tim Delaney wrote: > > > I got back a Word document containing about 10 screenshots where they'd > > apparently taken a screenshot, moved the horizontal scrollbar one >

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Dan Stromberg
How about: >>> os.write(1, message) On Sun, Jan 28, 2018 at 4:51 PM, Jason Qian via Python-list wrote: > print(repr(message)) out : > > *does not exist\r\n\tat com.* > > > for ch in message: > printf("%d %c",ch, chr(ch)) > > > %d %c 110 n > %d %c 111 o > %d %c 116 t > %d %c 32 > %d %c 101 e >

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Jason Qian via Python-list
print(repr(message)) out : *does not exist\r\n\tat com.* for ch in message: printf("%d %c",ch, chr(ch)) %d %c 110 n %d %c 111 o %d %c 116 t %d %c 32 %d %c 101 e %d %c 120 x %d %c 105 i %d %c 115 s %d %c 116 t *%d %c 13%d %c 10* *%d %c 9* %d %c 97 a %d %c 116 t %d %c 32 %d %c 99 c %d %c 111

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Steven D'Aprano
On Mon, 29 Jan 2018 08:55:54 +1100, Tim Delaney wrote: > I got back a Word document containing about 10 screenshots where they'd > apparently taken a screenshot, moved the horizontal scrollbar one > screen, taken another screenshot, etc. You're lucky they didn't just take a single screen shot, th

Re: Data-structure for multiway associativity in Python

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 14:48:02 -0800, qrious wrote: > First list = { 1, 2, 3} > Second list = { 4, 5, 6} > Third list = { 7, 8, 9} > > If I pass 9 as the argument, the return value of the function would be > {7, 8}. subsets = [{1, 2, 3}, {4, 5, 6}, {7, 8, 9}] data = {} for subset in subsets:

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Gregory Ewing
Steven D'Aprano wrote: (The day a programmer posts a WAV file of themselves reading their code out aloud, is the day I turn my modem off and leave the internet forever.) Shh! Don't give them ideas! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Data-structure for multiway associativity in Python

2018-01-28 Thread qrious
On Sunday, January 28, 2018 at 7:00:38 AM UTC-8, Steven D'Aprano wrote: > > Since you specified that there are no lists with shared members, why > bother returning a list of lists? There will only ever be a single > matching list. > That's correct. It will be a single list. My mistake in typi

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Tim Delaney
On 29 January 2018 at 02:04, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > I'm seeing this annoying practice more and more often. Even for trivial > pieces of text, a few lines, people post screenshots instead of copying > the code. I don't tend to see this from programmers I

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Chris Angelico
On Mon, Jan 29, 2018 at 7:41 AM, wrote: > On Sunday, January 28, 2018 at 3:27:06 PM UTC-5, Chris Angelico wrote: >> On Mon, Jan 29, 2018 at 7:13 AM, Chris Warrick wrote: >> > On 28 January 2018 at 20:19, Chris Angelico wrote: >> >> The vanilla Windows console (conhost.exe IIRC) is far from idea

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread codewizard
On Sunday, January 28, 2018 at 3:27:06 PM UTC-5, Chris Angelico wrote: > On Mon, Jan 29, 2018 at 7:13 AM, Chris Warrick wrote: > > On 28 January 2018 at 20:19, Chris Angelico wrote: > >> The vanilla Windows console (conhost.exe IIRC) is far from ideal for > >> copying and pasting from > > > > It’

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread eryk sun
On Sun, Jan 28, 2018 at 4:36 PM, Steven D'Aprano wrote: > On Sun, 28 Jan 2018 15:54:31 +, Tim Golden wrote: > >> At least for Windows users, grabbing a partial screenshot (eg of text) >> has been very easy since Windows 7 when the "Snipping Tool" was added to >> the builtins. > > Thanks, I did

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Chris Angelico
On Mon, Jan 29, 2018 at 7:13 AM, Chris Warrick wrote: > On 28 January 2018 at 20:19, Chris Angelico wrote: >> The vanilla Windows console (conhost.exe IIRC) is far from ideal for >> copying and pasting from > > It’s been fixed in recent Windows 10 releases (select and Ctrl+C works now). Haven't

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Chris Warrick
On 28 January 2018 at 20:19, Chris Angelico wrote: > The vanilla Windows console (conhost.exe IIRC) is far from ideal for > copying and pasting from It’s been fixed in recent Windows 10 releases (select and Ctrl+C works now). > Windows error popups are *impossible* to copy text from. Most stand

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Terry Reedy
On 1/28/2018 10:54 AM, Tim Golden wrote: On 28/01/2018 15:04, Steven D'Aprano wrote: I'm seeing this annoying practice more and more often. Even for trivial pieces of text, a few lines, people post screenshots instead of copying the code. This happens on Stackoverflow too. There, one can vote

Re: How to embed a native JIT compiler to a django app?

2018-01-28 Thread Etienne Robillard
Hi Stephane, Thank you for your reply. As you suggested, I believe my approach was too complex. So I decided to replace Cython with PyPy in order to enable experimental support of JIT compilation for my Python/Django web applications. Best regards, Etienne Le 2018-01-28 à 08:32, Stephane

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Grant Edwards
On 2018-01-28, Skip Montanaro wrote: > I've noticed it as well. I suspect it's from the Windows universe where > it's common to snip a bit of the screen which isn't pure text when asking > about some problematic GUI thing which is causing problems. It's definitely a Windows thing. Most Windows

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Chris Angelico
On Mon, Jan 29, 2018 at 3:36 AM, Steven D'Aprano wrote: >> Certainly easier for the average user than trying to do a >> slightly tricky rectangle selection within the Windows console. > > But I'm not seeing that it could possibly be easier than selecting text > and hitting copy and paste. Not even

Re: Compression of random binary data

2018-01-28 Thread Peter Pearson
On Sat, 27 Jan 2018 21:26:06 -0800 (PST), pendrysamm...@gmail.com wrote: > If it is then show him this > > 387,420,489 >= > 00110011 00111000 00110111 00101100 00110100 00110010 0011 0 ... To save the casual reader a moment of disorientation, the above binary string is just the ASCII represent

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Gene Heskett
On Sunday 28 January 2018 10:55:30 Peter J. Holzer wrote: > On 2018-01-28 15:04:26 +, Steven D'Aprano wrote: > > I'm seeing this annoying practice more and more often. Even for > > trivial pieces of text, a few lines, people post screenshots instead > > of copying the code. > > > > Where has t

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 15:54:31 +, Tim Golden wrote: > At least for Windows users, grabbing a partial screenshot (eg of text) > has been very easy since Windows 7 when the "Snipping Tool" was added to > the builtins. Thanks, I didn't know that. > Certainly easier for the average user than try

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Peter J. Holzer
On 2018-01-28 15:04:26 +, Steven D'Aprano wrote: > I'm seeing this annoying practice more and more often. Even for trivial > pieces of text, a few lines, people post screenshots instead of copying > the code. > > Where has this meme come from? Twitter? You can't send more than 140 character

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Tim Golden
On 28/01/2018 15:04, Steven D'Aprano wrote: I'm seeing this annoying practice more and more often. Even for trivial pieces of text, a few lines, people post screenshots instead of copying the code. Where has this meme come from? It seems to be one which inconveniences *everyone* involved: - for

Re: Compression of random binary data (Posting On Python-List Prohibited)

2018-01-28 Thread Grant Edwards
On 2018-01-28, pendrysamm...@gmail.com wrote: > I have it in my head, just need someone to write the program for me, > I know nothing about data compression or binary data other than 1s > and 0s and that you can not take 2 number without a possible value > more or less than them selves and compre

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Skip Montanaro
I've noticed it as well. I suspect it's from the Windows universe where it's common to snip a bit of the screen which isn't pure text when asking about some problematic GUI thing which is causing problems. I've never been a Windows user, but at my current job, Windows is core to just about everyth

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Karsten Hilbert
On Sun, Jan 28, 2018 at 03:04:26PM +, Steven D'Aprano wrote: > (The day a programmer posts a WAV file of themselves reading their code > out aloud, is the day I turn my modem off and leave the internet forever.) And the clever hack will be to send a WAV that tricks your modem into surprising

Re: Sending Email using examples From Tutorials

2018-01-28 Thread Skip Montanaro
Your code is fine, ... In addition to what Jason wrote, note that the way you need to authenticate to most email servers has changed substantially since this tutorial example was written. The OP has a yahoo.com email address. Even assuming you used something like smtp.yahoo.com as the SMTP server

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Wildman via Python-list
On Sun, 28 Jan 2018 15:04:26 +, Steven D'Aprano wrote: > I'm seeing this annoying practice more and more often. Even for trivial > pieces of text, a few lines, people post screenshots instead of copying > the code. > > Where has this meme come from? It seems to be one which inconveniences

Re: Compression of random binary data

2018-01-28 Thread Steven D'Aprano
On Sat, 27 Jan 2018 21:50:24 -0800, pendrysammuel wrote: > 387,420,489 is a number with only 2 repeating binary sequences Okay. Now try these two numbers: 387420479 387420499 -- Steve -- https://mail.python.org/mailman/listinfo/python-list

Re: Compression of random binary data

2018-01-28 Thread Steven D'Aprano
On Sat, 27 Jan 2018 22:14:46 -0800, pendrysammuel wrote: > I have it in my head, just need someone to write the program for me, Sure, my rate is $150 an hour. > I > know nothing about data compression or binary data other than 1s and 0s > and that you can not take 2 number without a possible v

Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Steven D'Aprano
I'm seeing this annoying practice more and more often. Even for trivial pieces of text, a few lines, people post screenshots instead of copying the code. Where has this meme come from? It seems to be one which inconveniences *everyone* involved: - for the sender, instead of a simple copy and p

Re: Data-structure for multiway associativity in Python

2018-01-28 Thread Steven D'Aprano
On Sat, 27 Jan 2018 10:01:47 -0800, qrious wrote: > I need a data structure and a corresponding (hopefully fast) mechanism > associated with it to do the following. While I am looking for the > concept first, my preference for implementation of this will be in > Python. > > [c1, c2,..., cn] is a

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Steven D'Aprano
On Sat, 27 Jan 2018 21:23:02 -0500, Jason Qian via Python-list wrote: > there are 0D 0A 09 If your string actually contains CARRIAGE RETURN (OD) NEWLINE (OA), and TAB (09) characters, then you don't need to do anything. Just call print, and they will be printed correctly. If that doesn't work,

Re: Fwd: Text Strip() now working constantly.

2018-01-28 Thread Chris Angelico
On Mon, Jan 29, 2018 at 1:07 AM, Steven D'Aprano wrote: > On Sat, 27 Jan 2018 11:25:35 -0600, George Shen wrote: > >> I have attached a JPG that clearly illustrate the issue. > [...] >> Please see the JPG. > > And what of us who are blind or visually impaired and use a screen reader > to read text

Re: Fwd: Text Strip() now working constantly.

2018-01-28 Thread Steven D'Aprano
On Sat, 27 Jan 2018 11:25:35 -0600, George Shen wrote: > I have attached a JPG that clearly illustrate the issue. [...] > Please see the JPG. And what of us who are blind or visually impaired and use a screen reader to read text? Unless you use Photoshop to edit your source code, why are you us

Re: How to embed a native JIT compiler to a django app?

2018-01-28 Thread Stephane Wirtel via Python-list
On 01/27, Etienne Robillard wrote: Hi, I want to compile a Django application into a C source file and embed a JIT compiler into the binary. Is there any way of doing this with llvm/clang? Hi Etienne, I think no, Django will use Python and this one is interpreted. Answer, no... Now, you

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Peter Otten
Jason Qian via Python-list wrote: > HI > >I have a string that contains \r\n\t > >[Ljava.lang.Object; does not exist*\r\n\t*at >[com.livecluster.core.tasklet > > >I would like to print it as : > > [Ljava.lang.Object; does not exist > tat com.livecluster.core.tasklet > >