Re: stderr writting before stdout

2020-05-23 Thread Souvik Dutta
Thank you I understood. Sorry for top posting... 😛 On Sun, 24 May, 2020, 11:34 am Cameron Simpson, wrote: > Please don't top post; I have rearranged your message so that the > discussion reads from top to bottom. Reponse below. > > On 24May2020 10:04, Souvik Dutta wrote: > >On Sun, 24 May, 202

Re: stderr writting before stdout

2020-05-23 Thread Cameron Simpson
Please don't top post; I have rearranged your message so that the discussion reads from top to bottom. Reponse below. On 24May2020 10:04, Souvik Dutta wrote: On Sun, 24 May, 2020, 9:57 am Souvik Dutta, wrote: Is there any precedence or priority order by which sys.stderr.write() and sys.stdo

Re: Strings: double versus single quotes

2020-05-23 Thread Frank Millman
On 2020-05-23 9:45 PM, DL Neil via Python-list wrote: My habit with SQL queries is to separate them from other code, cf the usual illustration of having them 'buried' within the code, immediately before, or even part of, the query call. I like that idea, as I find that I am embedding more

Re: Strings: double versus single quotes

2020-05-23 Thread Abdur-Rahmaan Janhangeer
Kind Regards, Abdur-Rahmaan Janhangeer compileralchemy | blog github Mauritius On Sun, May 24, 2020 at 12:03 AM DL Neil via Python-list < python-list@python.org> wrote: > > I'm highly am

Re: Strings: double versus single quotes

2020-05-23 Thread Abdur-Rahmaan Janhangeer
Greetings, Nice idea >>> '''You said "No it doesn't"''' 'You said "No it doesn\'t"' Kind Regards, Abdur-Rahmaan Janhangeer compileralchemy | blog github Mauritius On Sun, May 24, 2020

Re: Strings: double versus single quotes

2020-05-23 Thread Manfred Lotz
On Sat, 23 May 2020 14:46:04 -0400 Dennis Lee Bieber wrote: > On Sat, 23 May 2020 11:03:09 -0500, Tim Chase > declaimed the following: > > > > > >But when a string contains both, it biases towards single quotes: > > > > >>> "You said \"No it doesn't\"" > > 'You said "No it doesn\'t"'

Re: stderr writting before stdout

2020-05-23 Thread Souvik Dutta
Also this code maintains order i.e. writting is displayed before no errors. Why is that? import sys sys.stdout.write("Writting \n") sys.stderr.write("No errors \n") On Sun, 24 May, 2020, 9:57 am Souvik Dutta, wrote: > Hi, > Is there any precedence or priority order by which sys.stderr.write() a

Re: Enums are Singletons - but not always?

2020-05-23 Thread Terry Reedy
On 5/23/2020 2:21 PM, Ralf M. wrote: # Code of mod1.py # import enum, mod2 class En(enum.Enum):     A = 1     B = 2 def main():     a = mod2.getA()     print("a is En.A:", a is En.A)     print("a:", repr(a), "    En.A:", repr(En.A))     print("id(a), id(a.__class__)", id(a), id(a._

Re: Strings: double versus single quotes

2020-05-23 Thread Souvik Dutta
This seems to be a life long debate... On Sun, 24 May, 2020, 5:25 am Tim Chase, wrote: > On 2020-05-23 14:46, Dennis Lee Bieber wrote: > > On Sat, 23 May 2020 11:03:09 -0500, Tim Chase > > >But when a string contains both, it biases towards single quotes: > > > > > > >>> "You said \"No it does

Re: Strings: double versus single quotes

2020-05-23 Thread Tim Chase
On 2020-05-23 14:46, Dennis Lee Bieber wrote: > On Sat, 23 May 2020 11:03:09 -0500, Tim Chase > >But when a string contains both, it biases towards single quotes: > > > > >>> "You said \"No it doesn't\"" > > 'You said "No it doesn\'t"' > > This is where using triple quotes (or trip

Re: Strings: double versus single quotes

2020-05-23 Thread DL Neil via Python-list
On 24/05/20 8:39 AM, Skip Montanaro wrote: May I ask why not simply like this: stmt = """ select foo from bar where a = 'bag' and c = 'dog' """ Sorry, I don't recall. I wouldn't be at all surprised that it has something to do with Emacs's Python mode behavio

Re: Fwd: installed but doesn't boot

2020-05-23 Thread DL Neil via Python-list
On 24/05/20 4:55 AM, Ben Hansen wrote: -- Forwarded message - From: Ben Hansen Date: Sat, May 23, 2020 at 11:44 AM Subject: Fwd: installed but doesn't boot To: -- Forwarded message - From: Ben Hansen Date: Fri, May 22, 2020 at 3:18 PM Subject: installed b

Re: Strings: double versus single quotes

2020-05-23 Thread Skip Montanaro
> > > May I ask why not simply like this: > > stmt = """ > select foo from bar > where a = 'bag' > and c = 'dog' > """ > Sorry, I don't recall. I wouldn't be at all surprised that it has something to do with Emacs's Python mode behavior. Emacs wouldn't know what to do

Re: Enums are Singletons - but not always?

2020-05-23 Thread Roel Schroeven
Richard Damon schreef op 23/05/2020 om 20:57: On 5/23/20 2:21 PM, Ralf M. wrote: Hello, recently I wrote a small library that uses an Enum. That worked as expected. Then I added a main() and if __name__ == "__main__" to make it runable as script. Now Enum members that should be the same aren't

Subject: Python Open-Source Snippets Newsletter

2020-05-23 Thread Aswin K
Hi, I am creating a Python newsletter showcasing useful code snippets from popular open-source libraries. I will also be providing a runnable demo link to better understand the working. Newsletter subscription link: https://www.pythonninja.xyz/subscribe A sample snippet from the newsletter:

Re: Strings: double versus single quotes

2020-05-23 Thread Roel Schroeven
Skip Montanaro schreef op 23/05/2020 om 13:03: I also agree about SQL. I found that something like this: stmt = ( """select foo from bar""" """ where a = 'bag'""" """and c = 'dog'""" ) worked pretty well, served to both satisfy my brain's desire for semantic indentation (you

Fwd: installed but doesn't boot

2020-05-23 Thread Ben Hansen
-- Forwarded message - From: Ben Hansen Date: Sat, May 23, 2020 at 11:44 AM Subject: Fwd: installed but doesn't boot To: -- Forwarded message - From: Ben Hansen Date: Fri, May 22, 2020 at 3:18 PM Subject: installed but doesn't boot To: I have installed pyth

Re: Enums are Singletons - but not always?

2020-05-23 Thread Ethan Furman
On 05/23/2020 11:57 AM, Richard Damon wrote: I don't think Python anywhere defines that a enum will be a singleton, and you should be checking for equality (==) not identity (is) If you're not sure, please do a little research first. We have enough bad information on the 'nets already. Acco

Re: Enums are Singletons - but not always?

2020-05-23 Thread Chris Angelico
On Sun, May 24, 2020 at 5:58 AM Kushal Kumaran wrote: > > "Ralf M." writes: > > > Below are a simplified code sample, the results when I run it and my > > thoughts. > > > > # Code of mod1.py # > > import enum, mod2 > > def main(): > > a = mod2.getA() > > # End of mod1.py # > >

Re: Strings: double versus single quotes

2020-05-23 Thread DL Neil via Python-list
On 24/05/20 4:03 AM, Tim Chase wrote: On 2020-05-24 01:40, Chris Angelico wrote: On Sat, May 23, 2020 at 10:52 PM Abdur-Rahmaan Janhangeer wrote: The interpreter prefers single-quotes "single or double" 'single or double' 'not all that strongly, it doesn\'t' "not all that strongly,

Re: Enums are Singletons - but not always?

2020-05-23 Thread Kushal Kumaran
"Ralf M." writes: > Hello, > > recently I wrote a small library that uses an Enum. That worked as > expected. Then I added a main() and if __name__ == "__main__" to make > it runable as script. Now Enum members that should be the same aren't > identical any more, there seem to be two instances of

Re: Enums are Singletons - but not always?

2020-05-23 Thread Peter Otten
Peter Otten wrote: >> # Code of mod2.py # > import __main__ as mod1 >> def getA(): >>return mod1.En.A >> # End of mod2.py # > > but that would hardcode the assumption that __main__ is always mod1.py. I should have mentioned the cyclic dependency -- if two modules import each oth

Re: Enums are Singletons - but not always?

2020-05-23 Thread Kushal Kumaran
Richard Damon writes: > On 5/23/20 2:21 PM, Ralf M. wrote: >> Hello, >> >> recently I wrote a small library that uses an Enum. That worked as >> expected. Then I added a main() and if __name__ == "__main__" to make >> it runable as script. Now Enum members that should be the same aren't >> identi

Re: Strings: double versus single quotes

2020-05-23 Thread DL Neil via Python-list
On 23/05/20 11:03 PM, Skip Montanaro wrote: I also agree about SQL. I found that something like this: stmt = ( """select foo from bar""" """ where a = 'bag'""" """and c = 'dog'""" ) worked pretty well, served to both satisfy my brain's desire for semantic indentation (you sh

Re: Enums are Singletons - but not always?

2020-05-23 Thread Peter Otten
Ralf M. wrote: > Hello, > > recently I wrote a small library that uses an Enum. That worked as > expected. Then I added a main() and if __name__ == "__main__" to make it > runable as script. Now Enum members that should be the same aren't > identical any more, there seem to be two instances of th

Re: Is there some reason that recent Windows 3.6 releases don't included executable nor msi installers?

2020-05-23 Thread Mats Wichmann
On 5/23/20 12:23 AM, Adam Preble wrote: > I wanted to update from 3.6.8 on Windows without necessarily moving on to > 3.7+ (yet), so I thought I'd try 3.6.9 or 3.6.10. > > All I see for both are source archives: > > https://www.python.org/downloads/release/python-369/ > https://www.python.org/d

Re: Enums are Singletons - but not always?

2020-05-23 Thread Richard Damon
On 5/23/20 2:21 PM, Ralf M. wrote: > Hello, > > recently I wrote a small library that uses an Enum. That worked as > expected. Then I added a main() and if __name__ == "__main__" to make > it runable as script. Now Enum members that should be the same aren't > identical any more, there seem to be t

Enums are Singletons - but not always?

2020-05-23 Thread Ralf M.
Hello, recently I wrote a small library that uses an Enum. That worked as expected. Then I added a main() and if __name__ == "__main__" to make it runable as script. Now Enum members that should be the same aren't identical any more, there seem to be two instances of the same Enum. I think I

Re: Strings: double versus single quotes

2020-05-23 Thread Abdur-Rahmaan Janhangeer
Nice one, Was requoting: <>> "hello" 'hello'>> from R Hettinger Kind Regards, Abdur-Rahmaan Janhangeer https://www.github.com/Abdur-RahmaanJ Mauritius sent from gmail client on Android, that's why the signature is so ugly. -- https://mail.python.org/mailman/listinfo/python-list

Re: Strings: double versus single quotes

2020-05-23 Thread Tim Chase
On 2020-05-24 01:40, Chris Angelico wrote: > On Sat, May 23, 2020 at 10:52 PM Abdur-Rahmaan Janhangeer > wrote: > > > > The interpreter prefers single-quotes > > > > >>> "single or double" > > 'single or double' > > > >>> 'not all that strongly, it doesn\'t' > "not all that strongly, it do

Re: How to design a class that will listen on stdin?

2020-05-23 Thread Dan Sommers
On Saturday, May 23, 2020, at 07:24 -0400, zljubi...@gmail.com wrote: > I have to talk to outer system by stdin/stdout. > Each line that comes to stdin should be processed and its result returned > back to stdout. Logging should go to stderr. > > How to design a class that will listed to stdin

Re: How to design a class that will listen on stdin?

2020-05-23 Thread Dieter Maurer
zljubi...@gmail.com wrote at 2020-5-23 04:24 -0700: >I have to talk to outer system by stdin/stdout. >Each line that comes to stdin should be processed and its result returned back >to stdout. Logging should go to stderr. > >How to design a class that will listed to stdin and call required methods

How to design a class that will listen on stdin?

2020-05-23 Thread zljubisic
Hi, I have to talk to outer system by stdin/stdout. Each line that comes to stdin should be processed and its result returned back to stdout. Logging should go to stderr. How to design a class that will listed to stdin and call required methods in order to process the data? Regards -- https:/

Re: exiting a while loop

2020-05-23 Thread Grant Edwards
On 2020-05-22, DL Neil via Python-list wrote: > On 23/05/20 4:31 AM, Grant Edwards wrote: >> On 2020-05-22, Peter Otten <__pete...@web.de> wrote: >> >>> If you want to terminate the script you can use exit. However exit >>> is a function, and you have to call it >>> >>> exit() >> >> >> >> Actu

FlaskCon Call For Papers

2020-05-23 Thread Abdur-Rahmaan Janhangeer
Greetings list, The call for papers for FlaskCon is open: https://flaskcon.com/ It is a community-run event, 100% free and remote with reviewers from the Pallets, Flask maintainers and more Feel free to pass the word around! Kind Regards, Abdur-Rahmaan Janhangeer Mauritius -- https://mail.pyt

Re: exiting a while loop

2020-05-23 Thread Terry Reedy
On 5/22/2020 12:31 PM, Grant Edwards wrote: On 2020-05-22, Peter Otten <__pete...@web.de> wrote: If you want to terminate the script you can use exit. However exit is a function, and you have to call it exit() Actually it's an instance of _sitebuiltins.Quitter not a function. Which means

Re: Strings: double versus single quotes

2020-05-23 Thread Chris Angelico
On Sat, May 23, 2020 at 10:52 PM Abdur-Rahmaan Janhangeer wrote: > > The interpreter prefers single-quotes > > >>> "single or double" > 'single or double' > >>> 'not all that strongly, it doesn\'t' "not all that strongly, it doesn't" ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Strings: double versus single quotes

2020-05-23 Thread Abdur-Rahmaan Janhangeer
The interpreter prefers single-quotes >>> "single or double" 'single or double' I read a recent quote from Raymond Hettinger saying that the Python world prefers double ones. If Mr Hettinger is around i'd like to ask him where he pulled the theory from https://twitter.com/raymondh/status/12592097

Re: Strings: double versus single quotes

2020-05-23 Thread Rhodri James
On 22/05/2020 20:57, Manfred Lotz wrote: I also believe that transferring habits from C, Rust or whatever to Python doesn't make much sense as Python does not distinguish between a character and string from a type perspective. From a logical perspective, you are correct. From the point of view

Re: PyCharm, how to setup self contained subprojects

2020-05-23 Thread zljubisic
You are probably right. -- https://mail.python.org/mailman/listinfo/python-list

Re: Strings: double versus single quotes

2020-05-23 Thread Skip Montanaro
> Nothing strong. I tend to use double quotes because I have a > background in C (where double quotes are for strings, single quotes > for characters), and double quotes are the recommendation for > docstrings (see PEP 258). If you tend to work a lot with SQL, you > might prefer single quotes. Use

Re: Is there some reason that recent Windows 3.6 releases don't included executable nor msi installers?

2020-05-23 Thread Souvik Dutta
And that there are no files for an installer. Souvik flutter dev On Sat, May 23, 2020, 4:04 PM Souvik Dutta wrote: > If you take a look at this page then you will find out that 3.6.10 was not > intended to be used in windows... > https://www.python.org/downloads/windows/ > > Souvik flutter dev

Re: Is there some reason that recent Windows 3.6 releases don't included executable nor msi installers?

2020-05-23 Thread Souvik Dutta
If you take a look at this page then you will find out that 3.6.10 was not intended to be used in windows... https://www.python.org/downloads/windows/ Souvik flutter dev On Sat, May 23, 2020, 11:55 AM Adam Preble wrote: > I wanted to update from 3.6.8 on Windows without necessarily moving on t