Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-22 Thread Thomas Passin
't Python (error msg) do the obvious thing and tell me WHAT the actual (offending, arg) values are ? In many cases, it'd help to know what string the var A had , when the error occurred. i wouldn't have to put print(a) just above, to see. ( pypy doesn't do that either, but Pyth

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-22 Thread Hen Hanna
; Why doesn't Python (error msg) do the obvious thing and tell me > WHAT the actual (offending, arg) values are ? > > In many cases, it'd help to know what string the var A had , when the error > occurred. > i wouldn't have to put print(a) just above, to see.

RE: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-22 Thread avi.e.gross
between two objects that have not provided instructions on how to do so. Specifically, an object of type str has not specified anything to do if asked to concatenate an object of type int to it. And, an object of type int has not specified what to do if asked to add itself to an object of type str to th

Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-22 Thread Hen Hanna
vious thing and tell me WHAT the actual (offending, arg) values are ? In many cases, it'd help to know what string the var A had , when the error occurred. i wouldn't have to put print(a) just above, to see. ( pypydoesn't do that eit

I could not install pygame no matter what

2023-01-21 Thread Robbie mezazem
70916814/error-metadata-generation-failed-cant-install-artic-module Sent from Mail for Windows --

RE: Improvement to imports, what is a better way ?

2023-01-19 Thread avi.e.gross
y original question. Now it is about the long and short of it. -Original Message- From: Python-list On Behalf Of Thomas Passin Sent: Thursday, January 19, 2023 9:37 PM To: python-list@python.org Subject: Re: Improvement to imports, what is a better way ? On 1/19/2023 7:33 PM, avi.e.gr...

Re: Improvement to imports, what is a better way ?

2023-01-19 Thread Thomas Passin
variable at the REPL level, then the driver that handles such an object generates a graph to whatever output device is currently set in whatever format is set such as a JPEG image or a PDF file. There are errors in what Thomas wrote as an example but not what is mentioned. Just to be clear,

RE: Improvement to imports, what is a better way ?

2023-01-19 Thread avi.e.gross
ndles such an object generates a graph to whatever output device is currently set in whatever format is set such as a JPEG image or a PDF file. There are errors in what Thomas wrote as an example but not what is mentioned. The overall flow looks like: g2 <- ggplot(ARGS) + geom_poin

Re: Improvement to imports, what is a better way ?

2023-01-19 Thread Cameron Simpson
make callbacks, the callbacks can block (depending what they do). Or they themselves might call update() if you've written your code that way. There's a note on the page mentioned above. Calling update() effectively runs the main event loop _here_, at the call. This is also how things like

Re: Improvement to imports, what is a better way ?

2023-01-19 Thread Thomas Passin
On 1/19/2023 1:30 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: On 2023-01-19 at 12:59:21 -0500, Thomas Passin wrote: Well, it's an art, not a science [...] +1 # Create a plot g2 = ( ggplot(df2, aes('Days Since Jan 22', # Comments can clarify these params +

Re: Improvement to imports, what is a better way ?

2023-01-19 Thread Roel Schroeven
2qdxy4rzwzuui...@potatochowder.com schreef op 19/01/2023 om 19:30: > The PEP-8 rules are good, but they can't cover all cases perfectly. Some the PEP-8 rules are debatable. Regardless, they can't cover all cases perfectly. (IOW, we agree on the bit that's relevant to this thread.) PEP 8 even

Re: Improvement to imports, what is a better way ?

2023-01-19 Thread 2QdxY4RzWzUUiLuE
On 2023-01-19 at 12:59:21 -0500, Thomas Passin wrote: > Well, it's an art, not a science [...] +1 > # Create a plot > g2 = ( > ggplot(df2, > aes('Days Since Jan 22', # Comments can clarify these params > + geom_point(size=.1, color='blue') # size, color params optional >

Re: Improvement to imports, what is a better way ?

2023-01-19 Thread Thomas Passin
On 1/19/2023 11:55 AM, Roel Schroeven wrote: Op 19/01/2023 om 11:32 schreef Stefan Ram: dn writes: >The longer an identifier, the more it 'pushes' code over to the right or >to expand over multiple screen-lines. Some thoughts on this are behind >PEP-008 philosophies, eg line-limit.   

Re: Improvement to imports, what is a better way ?

2023-01-19 Thread Roel Schroeven
es 90-ish, IIRC: he tries to stay under that, but doesn' t mine if a line goes a bit over. Or at least that's what I remember from that talk, I might be wrong. -- "If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed." -― Onbekend (dikw

Re: Improvement to imports, what is a better way ?

2023-01-19 Thread Dan Kolis
On Thursday, January 19, 2023 at 12:09:02 AM UTC-5, cameron wrote: > I know this is vague. Once you find its stalling in a particular > function (if it is) you may be able to run that function directly. Also, > a print() at the top abd bottom/return of the stalling function. And so > on.

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Cameron Simpson
and in VSCode. The other thing you can do is put in a heap of print() calls in strategic places. See if you can get a handle on what its doing when it freezes. This might be iterative, zooming in on where this happens, if it's a specific thing. I know this is vague. Once you find its stalling

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Dan Kolis
I have written a very sizable and elaborate program that uses tKinter for X11 displays of genomics. Yet maybe 1 of 6 times it freezes, so I decided to extract the minimum that works perfectly and add back big pieces. It does it both running .pyc and in VSCode. so even the most minor of

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Dan Kolis
Thank you -- https://mail.python.org/mailman/listinfo/python-list

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Michael Torrie
On 1/18/23 14:42, Dan Kolis wrote: > >> I don't think you've described this. I don't know what you mean here. > > When I trace it in VSCode the imports seem like they endlessly suspend > scanning and go to other ones over and over. Like "Whats this doing ?"

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Greg Ewing
On 19/01/23 10:40 am, Dan Kolis wrote: I guess I don't full understand what bothers me about the repetition of the imports so much. It's doubtful that every module uses every one of those imports. It looks like someone had a standard block of imports that they blindly pasted at the top

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Dan Kolis
> I don't think you've described this. I don't know what you mean here. When I trace it in VSCode the imports seem like they endlessly suspend scanning and go to other ones over and over. Like "Whats this doing ?" -- https://mail.python.org/mailman/listinfo/python-list

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Dan Kolis
for extreme uniformity in the names and so on, there utterly uniform, so there not so bad to consider, ( I hope ). I guess I don't full understand what bothers me about the repetition of the imports so much. The tracing of it seems so bizarre, it just seems like its wrong. Regs Dan -- https

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Cameron Simpson
On 18Jan2023 12:57, Dan Kolis wrote: I'm not sure what to do. Do either / both know if there is a way to make it parse each import list to bytecode in one shot ?? Python usually compiles files to bytecode and leaves those around as .pyc files to be used until the original source is modified

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Paul Bryan
edia.fetch_the_file() > [sic] there is little thinking about the "avMedia" bit. The emphasis > is > on the function-name, and it's parameters. 'I need that file so that > I > can ...'. I'm not entirely sure what you mean by not a Python module. Even in test modules, I woul

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Weatherby,Gerard
at 3:49 PM To: python-list@python.org Subject: Re: Improvement to imports, what is a better way ? *** Attention: This is an external email. Use caution responding, opening attachments or clicking on links. *** On 19/01/2023 08.56, Mats Wichmann wrote: > On 1/18/23 12:29, Paul Bryan wrote: ...

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Dan Kolis
dn and Mats, thanks for your advice. I'm not sure what to do. Do either / both know if there is a way to make it parse each import list to bytecode in one shot ?? The hop around read keeps making me worry it migth leave some memory leak or something. I dont know. Thanks though, both your

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread dn via Python-list
On 19/01/2023 08.56, Mats Wichmann wrote: On 1/18/23 12:29, Paul Bryan wrote: ... import os as    os import sys as   sys import importlib as importlib A general comment: there are some very common "import ... as" idioms (for example,

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Mats Wichmann
On 1/18/23 12:29, Paul Bryan wrote: I would suggest allowing each module to define its own imports, don't import what a module doesn't consume, keep them simple, avoid devising a common namespace for each, and let tools like isort/black work out how to order/express them in source files

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Paul Bryan
I would suggest allowing each module to define its own imports, don't import what a module doesn't consume, keep them simple, avoid devising a common namespace for each, and let tools like isort/black work out how to order/express them in source files. On Wed, 2023-01-18 at 10:43 -0800, Dan Kolis

Improvement to imports, what is a better way ?

2023-01-18 Thread Dan Kolis
This program has lots of files and each is well segregated for a concept. the top of each as a heap of imports, all identical. Well the very top has some one of's import os asos import sys as sys import importlib as importlib import

Python logging (was Re: What should go to stdout/stderr and why Python logging write everything to stderr?)

2023-01-06 Thread Weatherby,Gerard
FWIW, it wasn’t too difficult to build a logging handler to send messages to Slack. https://pypi.org/project/slack-webclient-logger/ -- https://mail.python.org/mailman/listinfo/python-list

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-06 Thread Peter J. Holzer
m my previous project ;-). I think the general structure is clear enough. You need a formatter to format your log messages, a handler to actually write them and finally a logger to determine what goes where. I can look up the details in the docs but generally the logging is always the same (

Re: asyncio and tkinter (was: What should go to stdout/stderr and why Python logging write everything to stderr?)

2023-01-05 Thread Thomas Passin
On 1/5/2023 7:52 PM, Stefan Ram wrote: Thomas Passin writes: On 1/5/2023 4:24 PM, Stefan Ram wrote: You often can replace threads in tkinter by coroutines using asyncio when you write a replacement for the mainloop of tkinter that uses asyncio. Now, try to read only the official documentation

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-05 Thread Thomas Passin
On 1/5/2023 4:24 PM, Stefan Ram wrote: You often can replace threads in tkinter by coroutines using asyncio when you write a replacement for the mainloop of tkinter that uses asyncio. Now, try to read only the official documentation of asyncio and tkinter and figure out only from

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-05 Thread Thomas Passin
ogging.basicConfig(level=logging.DEBUG) >>> logging.info('So should this') INFO:root:So should this : Finally! Not quite straightforward, though it is in the Howto. Now about those handlers ... From: Python-list on behalf of Grant Edwards Date: Thursday, January 5, 2023 at 3:31 P

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-05 Thread Grant Edwards
On 2023-01-05, Weatherby,Gerard wrote: > logging.basicConfig() > logging.info(“Nice to know”) > logging.debug(“Details for when things are funky”) > logging.warn(“Trouble is brewing”) I always seem to need something slightly more complex. Usually something like: * Specify a log level on the

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-05 Thread Weatherby,Gerard
logging.basicConfig() logging.info(“Nice to know”) logging.debug(“Details for when things are funky”) logging.warn(“Trouble is brewing”) From: Python-list on behalf of Grant Edwards Date: Thursday, January 5, 2023 at 3:31 PM To: python-list@python.org Subject: Re: What should go to stdout

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-05 Thread Thomas Passin
writing Python programs for over 20 years, and it's beyond me. I know what you mean! I have never used the Python logging package, but I inherited a java project that uses Log4j. Talk about obscure! The python docs are a wonder of clarity beside Log4j. So most of my Log4j configuration has

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-05 Thread Grant Edwards
On 2023-01-05, Thomas Passin wrote: > The logging system is so configurable that... I find it almost impossible to use unless I copy a working example I find somewhere. ;) I'm not at all surprised that the OP didn't understand how it works. I've been writing Python programs for over 20 years,

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-05 Thread Thomas Passin
stderr for all levels can be answered: "They didn't". Which is almost exactly what I wrote in <20230104162154.uzljittbs6xwt...@hjp.at> ;-) Yup, two minds are better than one :) -- https://mail.python.org/mailman/listinfo/python-list

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-05 Thread Peter J. Holzer
be answered: "They didn't". Which is almost exactly what I wrote in <20230104162154.uzljittbs6xwt...@hjp.at> ;-) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, &q

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-05 Thread Thomas Passin
On 1/5/2023 6:27 AM, Peter J. Holzer wrote: On 2023-01-04 12:32:40 -0500, Thomas Passin wrote: On 1/3/2023 10:35 AM, c.bu...@posteo.jp wrote: The logging module write everything to stderr no matter which logging level is used. The OP wrote this, but it's not so by default. By default it is

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-05 Thread Peter J. Holzer
On 2023-01-04 12:32:40 -0500, Thomas Passin wrote: > On 1/3/2023 10:35 AM, c.bu...@posteo.jp wrote: > > The logging module write everything to stderr no matter which logging > > level is used. > > The OP wrote this, but it's not so by default. By default it is - sort of. That is all log

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-04 Thread Chris Angelico
ke all log levels go to stdout. Just DEBUG and > > INFO. But this would be a workaround. > > > > The main question here is why does Python deciecded to make all logs > > go to stderr? > > Maybe I totally misunderstood the intention of logging.info()?! Isn't > >

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-04 Thread Barry Scott
question here is why does Python deciecded to make all logs go to stderr? Maybe I totally misunderstood the intention of logging.info()?! Isn't this the "usual applicaton output"? If not, what messages should go into logging.info()? Can you name me some examples? Example: wr

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-04 Thread Barry Scott
question here is why does Python deciecded to make all logs go to stderr? Maybe I totally misunderstood the intention of logging.info()?! Isn't this the "usual applicaton output"? If not, what messages should go into logging.info()? Can you name me some examples? It is up to you, th

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-04 Thread Thomas Passin
On 1/3/2023 10:35 AM, c.bu...@posteo.jp wrote: The logging module write everything to stderr no matter which logging level is used. The OP wrote this, but it's not so by default. There is a HOW-TO page that explains this and how to get the logging package to log everything to a file, along

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-04 Thread Peter J. Holzer
riting to stderr, and even that can log to any stream - just pass it as an argument. If none of existing handlers does what you want you can always write your own. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-04 Thread Peter J. Holzer
buffer > > before each raw write to the file descriptor. > > FDs can also be buffered. That depends on what you mean by "buffered". A write to an fd referring to a file on a disk will not usually affect the disk, true. But it will be immediately visible to other processes r

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-04 Thread Barry Scott
On 04/01/2023 06:46, Chris Angelico wrote: I've known some systems to have a trigger of "reading on FD 0 flushes FD 1" C++ has this feature: Quote from https://en.cppreference.com/w/cpp/io/cin "Once |std::cin| is constructed, std::cin.tie() returns ::cout

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-04 Thread Barry Scott
On 04/01/2023 02:26, Chris Angelico wrote: Reading/writing the FD is the same as using stdout (technically you'd write to fd 1 and read from fd 0), but yes, can use /dev/tty to reach for the console directly. I think the logic is more like checking that stdin is a tty then using the tty it

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-04 Thread 2QdxY4RzWzUUiLuE
On 2023-01-04 at 12:02:55 +, "Weatherby,Gerard" wrote: > Dealing with stdout / stderr is bash is just syntax. I don’t always > remember it off the top of my head but … stackoverflow.com. https://tldp.org/LDP/abs/html/io-redirection.html > On Linux at least it’s possible to pipe to

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-04 Thread Weatherby,Gerard
nuary 3, 2023 at 5:18 PM To: python-list@python.org Subject: Re: What should go to stdout/stderr and why Python logging write everything to stderr? *** Attention: This is an external email. Use caution responding, opening attachments or clicking on links. *** Maybe some day an interface and

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Chris Angelico
On Wed, 4 Jan 2023 at 17:26, Eryk Sun wrote: > > On 1/3/23, Chris Angelico wrote: > > > > FDs can also be buffered. If it's buffering you want to avoid, don't > > mess around with exactly which one you're writing to, just flush. > > I meant to flush a C FILE stream or Python file before writing

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Eryk Sun
On 1/3/23, Chris Angelico wrote: > > FDs can also be buffered. If it's buffering you want to avoid, don't > mess around with exactly which one you're writing to, just flush. I meant to flush a C FILE stream or Python file before writing directly to the file descriptor, in order to avoid

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Eryk Sun
On 1/3/23, Grant Edwards wrote: > > That's definitely a better option, but I'm pretty sure I've seen > multiple examples over the decades where fd 0 was used instead. Was > /dev/tty a "recent" enough invention that I would have seen > application code that was written before it existed? Or maybe

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Chris Angelico
On Wed, 4 Jan 2023 at 16:21, Grant Edwards wrote: > > On 2023-01-04, Chris Angelico wrote: > > On Wed, 4 Jan 2023 at 09:52, Grant Edwards > > wrote: > >> > >>> I can't think of a specific example, but I know I have piped the output > >>> of a program while at the same time interacting with a

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Chris Angelico
On Wed, 4 Jan 2023 at 15:11, Eryk Sun wrote: > > On 1/3/23, Chris Angelico wrote: > > > > writing the FD is the same as using stdout > > Except stdout may be buffered. One should probably flush the buffer > before each raw write to the file descriptor. FDs can also be buffered. If it's

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Grant Edwards
On 2023-01-04, Chris Angelico wrote: > On Wed, 4 Jan 2023 at 09:52, Grant Edwards wrote: >> >>> I can't think of a specific example, but I know I have piped the output >>> of a program while at the same time interacting with a prompt on stderr. >>> A rare thing, though. >> >> Programs that ask

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Eryk Sun
On 1/3/23, Chris Angelico wrote: > > writing the FD is the same as using stdout Except stdout may be buffered. One should probably flush the buffer before each raw write to the file descriptor. > use /dev/tty to reach for the console directly. On Windows, open "CON" (read or write), "CONIN$"

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Chris Angelico
;rkachach". Yet another shining example of bad code that does what someone asks, but will make life harder for the next person to come along and try to work with that program. It's like if someone asked for a way to make True equal to -1 instead of 1, for compatibility with BASIC. Bad idea. Chris

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Chris Angelico
On Wed, 4 Jan 2023 at 09:52, Grant Edwards wrote: > > On 2023-01-03, Michael Torrie wrote: > > On 1/3/23 11:45, Keith Thompson wrote: > >> MRAB writes: > >> [...] > >>> The purpose of stderr is to display status messages, logging and error > >>> messages, even user prompts, and not mess up the

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Grant Edwards
On 2023-01-03, Michael Torrie wrote: > On 1/3/23 11:45, Keith Thompson wrote: >> MRAB writes: >> [...] >>> The purpose of stderr is to display status messages, logging and error >>> messages, even user prompts, and not mess up the program's actual >>> output. This is important on a *nix system

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Chris Angelico
On Wed, 4 Jan 2023 at 09:17, Michael Torrie wrote: > > On 1/3/23 11:45, Keith Thompson wrote: > > MRAB writes: > > [...] > >> The purpose of stderr is to display status messages, logging and error > >> messages, even user prompts, and not mess up the program's actual > >> output. This is

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread 2QdxY4RzWzUUiLuE
d read roughly two or three out of a million entries to track down questions from our users. Users wouldn't have understood 99% of what was in the logs anyway. I also worked a lot in embedded systems, like telephone switches. Users (i.e., the people with the telephones) didn't have access to th

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Michael Torrie
On 1/3/23 11:45, Keith Thompson wrote: > MRAB writes: > [...] >> The purpose of stderr is to display status messages, logging and error >> messages, even user prompts, and not mess up the program's actual >> output. This is important on a *nix system where you might be piping >> the output of

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Chris Angelico
d. But why are DEBUG logs part of stdout? That doesn't make any sense. > The main question here is why does Python deciecded to make all logs go > to stderr? > Maybe I totally misunderstood the intention of logging.info()?! Isn't > this the "usual applicaton output

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Cameron Simpson
On Jan 3, 2023, at 10:38 AM, c.bu...@posteo.jp wrote: this posting isn't about asking for a technical solution. My intention is to understand the design decision Python's core developers made in context of that topic. The logging module write everything to stderr no matter which logging level

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread c . buhtz
all logs go to stderr? Maybe I totally misunderstood the intention of logging.info()?! Isn't this the "usual applicaton output"? If not, what messages should go into logging.info()? Can you name me some examples? -- https://mail.python.org/mailman/listinfo/python-list

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Eryk Sun
On 1/3/23, Weatherby,Gerard wrote: > If sys.stdout is a tty, it typically flushes on newline. e. g. Sorry if I wasn't clear. Yes, a tty file will be buffered, but it's line buffering, which isn't an issue as long as lines are written to stdout. I was referring to full buffering of pipe and disk

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Weatherby,Gerard
s From: Python-list on behalf of Eryk Sun Date: Tuesday, January 3, 2023 at 1:33 PM To: c.bu...@posteo.jp Cc: python-list@python.org Subject: Re: What should go to stdout/stderr and why Python logging write everything to stderr? *** Attention: This is an external email. Use caution responding,

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Thomas Passin
On 1/3/2023 11:51 AM, Stefan Ram wrote: Thomas Passin writes: On 1/3/2023 10:35 AM, c.bu...@posteo.jp wrote: Also, I think it would be confusing to sometimes have logging output go to stdout and other times go to stderr. In UNIX, the output of a program can be redirected, so error

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Keith Thompson
MRAB writes: [...] > The purpose of stderr is to display status messages, logging and error > messages, even user prompts, and not mess up the program's actual > output. This is important on a *nix system where you might be piping > the output of one program into the input of another. I would

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Eryk Sun
On 1/3/23, c.bu...@posteo.jp wrote: > > If the user request the usage info via "-h" it goes to stdout. The standard file for application output is sys.stdout. Note that sys.stdout may be buffered, particularly if it isn't a tty. When a file is buffered, writes are aggregated and only written to

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Weatherby,Gerard
is to print that and exit, regardless of any other arguments that are passed. So its behavior is consistent with the concept of standard out. From: Python-list on behalf of MRAB Date: Tuesday, January 3, 2023 at 11:41 AM To: python-list@python.org Subject: Re: What should go to stdout/stderr

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Richard Damon
hon developers when > they decided that. > > My goal is not to divide between the use of print() or logging.info() > in my own code. This would mess up a lot. > -- > https://mail.python.org/mailman/listinfo/python-list My thought are, that a “Log” should be a COMPLETE output

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread MRAB
On 2023-01-03 15:35, c.bu...@posteo.jp wrote: Hello, this posting isn't about asking for a technical solution. My intention is to understand the design decision Python's core developers made in context of that topic. The logging module write everything to stderr no matter which logging level

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Thomas Passin
On 1/3/2023 10:35 AM, c.bu...@posteo.jp wrote: Hello, this posting isn't about asking for a technical solution. My intention is to understand the design decision Python's core developers made in context of that topic. The logging module write everything to stderr no matter which logging level

What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread c.buhtz
Hello, this posting isn't about asking for a technical solution. My intention is to understand the design decision Python's core developers made in context of that topic. The logging module write everything to stderr no matter which logging level is used. The argparse module does it more

Re: What is the reason from different output generate using logical 'and' and 'or' operator in Python 3.10.8

2022-11-11 Thread Exam Guide Publishers
gt;> 0 or True > > True > > >>> 1 and True > > True > > >>> 1 or True > > 1 > Hi, > > The exact explanation of how 'and' and 'or' behave can be read here: > https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-

Re: What to use for finding as many syntax errors as possible.

2022-11-08 Thread Alex Hall
On Sunday, October 9, 2022 at 12:09:45 PM UTC+2, Antoon Pardon wrote: > I would like a tool that tries to find as many syntax errors as possible > in a python file. I know there is the risk of false positives when a > tool tries to recover from a syntax error and proceeds but I would > prefer

Re: What is the reason from different output generate using logical 'and' and 'or' operator in Python 3.10.8

2022-11-07 Thread David
he exact explanation of how 'and' and 'or' behave can be read here: https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not The "Notes" there explain what you see. -- https://mail.python.org/mailman/listinfo/python-list

What is the reason from different output generate using logical 'and' and 'or' operator in Python 3.10.8

2022-11-07 Thread ICT Ezy
Please explain how to generate different output in following logical operations >>> 0 and True 0 >>> 0 or True True >>> 1 and True True >>> 1 or True 1 -- https://mail.python.org/mailman/listinfo/python-list

Re: for -- else: what was the motivation?

2022-11-05 Thread Peter J. Holzer
e special-purpose languages like Scratch which are not simple > > text in that form. > > Yes, I know. > > It has a different goal though: Scratch tries to establish a friendly > learning environment. Get rid of typing and syntax errors that beginners > find so frustrating. >

Re: for -- else: what was the motivation?

2022-10-22 Thread Drew Pierson
> > There are special-purpose languages like Scratch which are not simple > > text in that form. > > Yes, I know. > > It has a different goal though: Scratch tries to establish a friendly > learning environment. Get rid of typing and syntax errors that beginners > fin

Re: for -- else: what was the motivation?

2022-10-22 Thread Peter J. Holzer
e special-purpose languages like Scratch which are not simple > > text in that form. > > Yes, I know. > > It has a different goal though: Scratch tries to establish a friendly > learning environment. Get rid of typing and syntax errors that beginners > find so frustrating. > &g

Re: for -- else: what was the motivation?

2022-10-22 Thread Peter J. Holzer
hat alone might make it a non-starter, even if it > > was really good (which realistically early iterations wouldn't be). > > There are special-purpose languages like Scratch which are not simple > text in that form. Yes, I know. It has a different goal though: Scratch tries to esta

Re: for -- else: what was the motivation?

2022-10-18 Thread Chris Angelico
tically early iterations wouldn't be). > There are special-purpose languages like Scratch which are not simple text in that form. My Twitch channel bot has a command executor whose language, if you call it that, is basically JSON - and the way to edit those commands is very Scratch-inspired. These are not

Re: for -- else: what was the motivation?

2022-10-18 Thread Peter J. Holzer
On 2022-10-17 09:25:00 +0200, Karsten Hilbert wrote: > > which had special combinations for all the BASIC keywords). And if you > > go this way, why not go a step further and dissociate the program from > > its linear text representation? Add footnotes, different views, > > hyperlinks, format

Re: for -- else: what was the motivation?

2022-10-17 Thread Robert Latest via Python-list
wrote: > I had another crazy thought that I AM NOT ASKING anyone to do. OK? > > I was wondering about a sort of catch method you could use that generates a > pseudo-signal only when the enclosed preceding loop exits normally as a > sort of way to handle the ELSE need without the use of a keyword

Re: for -- else: what was the motivation?

2022-10-17 Thread Dennis Lee Bieber
On Wed, 12 Oct 2022 23:19:39 +0100, Rob Cliffe declaimed the following: >I too have occasionally used for ... else.  It does have its uses. But >oh, how I wish it had been called something else more meaningful, >whether 'nobreak' or whatever.  It used to really confuse me.  Now I've

Aw: Re: for -- else: what was the motivation?

2022-10-17 Thread Karsten Hilbert
> which had special combinations for all the BASIC keywords). And if you > go this way, why not go a step further and dissociate the program from > its linear text representation? Add footnotes, different views, > hyperlinks, format mathematical expressions like formulas, etc.

Re: for -- else: what was the motivation?

2022-10-17 Thread Chris Angelico
On Mon, 17 Oct 2022 at 16:36, Antoon Pardon wrote: > > > > Op 17/10/2022 om 04:01 schreef Chris Angelico: > > On Mon, 17 Oct 2022 at 10:46, wrote: > >> My point Chris was that you can have a conversation where you are exploring > >> and not proposing. Brainstorming, perhaps. > > And my point is

Re: for -- else: what was the motivation?

2022-10-16 Thread Antoon Pardon
Op 17/10/2022 om 04:01 schreef Chris Angelico: On Mon, 17 Oct 2022 at 10:46, wrote: My point Chris was that you can have a conversation where you are exploring and not proposing. Brainstorming, perhaps. And my point is that either a proposal is a serious one that can expect serious

Re: for -- else: what was the motivation?

2022-10-16 Thread Chris Angelico
it's not very practical to discuss small features when there's no language to discuss them in. So are you discussing this as a Python feature, or just saying "hey, in a vacuum, we could do this", which is vacuously true? > What may aggravate you is that lots of people keep telling

RE: for -- else: what was the motivation?

2022-10-16 Thread avi.e.gross
the bottom. The code you now put in the ELSE clause might have to be in the lambda or whatever. That may not be a good fit for Python. What may aggravate you is that lots of people keep telling you that the ELSE on a loop feature is not intuitive to many, sometimes even after it is explained. My

Re: for -- else: what was the motivation?

2022-10-16 Thread Chris Angelico
On Mon, 17 Oct 2022 at 08:22, wrote: > I had another crazy thought that I AM NOT ASKING anyone to do. OK? > Here's another proposal: Let's ban you from this mailing list. Don't worry, I AM NOT ASKING anyone to do it. OK? Do you see how ridiculous and pointless it is to have proposals with that

RE: for -- else: what was the motivation?

2022-10-16 Thread avi.e.gross
Realistically an idea about something new is easier to consider than changing what you have. Some newer languages may well be designed from the start in new ways and Julia is an example of a language that allows a wide swath of UNICODE characters to be used in identifiers. They also let you type

Re: for -- else: what was the motivation?

2022-10-16 Thread Peter J. Holzer
underlines the wrong characters (the one to the right instead of the one to the left). The pragmatic action would of course to define "def" as an abbreviation for "퐝퐞퐟" (or "d̲e̲f̲"), but then what have you won? hp -- _ | Peter J. Holzer| Story must ma

Re: for -- else: what was the motivation?

2022-10-16 Thread Axy via Python-list
On 16/10/2022 18:43, Antoon Pardon wrote: Op 16/10/2022 om 17:03 schreef Avi Gross: Interesting idea, Anton. I would be interested in hearing more detail on how it would work. Although much of programming has been centered on the Latin alphabet and especially English, that may change. I can

<    1   2   3   4   5   6   7   8   9   10   >