Re: Passing information between modules

2022-11-19 Thread Dan Kolis
In a module mostly for this purpose; ( big program means many modules aka files ): -- globalIdeas.py -- # Empty object maker ( M T ) ...

Re: Logging

2022-11-19 Thread Cameron Simpson
On 20Nov2022 12:36, Chris Angelico wrote: On Sun, 20 Nov 2022 at 12:27, Cameron Simpson wrote: But really, is there any problem which cannot be solved with a decorator? I've even got a @decorator decorator for my decorators. Do you have a @toomanydecorators decorator to reduce the number of

Re: Superclass static method name from subclass

2022-11-19 Thread Thomas Passin
On 11/13/2022 7:27 AM, Axy via Python-list wrote: On 11/11/2022 16:21, Ian Pilcher wrote: Is it possible to access the name of a superclass static method, when defining a subclass attribute, without specifically naming the super- class? A instance's __bases__ attribute is a sequence that conta

Re: Logging

2022-11-19 Thread Chris Angelico
On Sun, 20 Nov 2022 at 12:27, Cameron Simpson wrote: > > On 19Nov2022 18:26, Thomas Passin wrote: > >>The alternative is to just replace every calling function which uses > >>my_ugly_debug() to directly call a logging.whatever() call. > > > >Maybe a place for a decorator... > > Indeed, though I d

Re: Logging

2022-11-19 Thread Cameron Simpson
On 19Nov2022 18:26, Thomas Passin wrote: The alternative is to just replace every calling function which uses my_ugly_debug() to directly call a logging.whatever() call. Maybe a place for a decorator... Indeed, though I don't think the OP is up to decorators yet. But really, is there any pr

Re: Logging

2022-11-19 Thread Thomas Passin
On 11/19/2022 5:27 PM, Cameron Simpson wrote: On 19Nov2022 11:08, Stefan Ram wrote: writes: You are expected to implement logging feature to an existing code which uses the function below. [...] You are not allowed to make changes in my_ugly_debug, so find another way.  If found a solution

Re: Passing information between modules

2022-11-19 Thread Cameron Simpson
On 18Nov2022 10:53, Stefan Ram wrote: Can I use "sys.argv" to pass information between modules as follows? [...] Stefan, it looks like most of the replies take the form: yes you can do that but it is probably a bad idea. Could you outline the larger situation where you want to do this? O

Re: Logging

2022-11-19 Thread Cameron Simpson
On 19Nov2022 11:08, Stefan Ram wrote: writes: You are expected to implement logging feature to an existing code which uses the function below. [...] You are not allowed to make changes in my_ugly_debug, so find another way. If found a solution that is even more ugly than your function. I

Re: Passing information between modules

2022-11-19 Thread Thomas Passin
On 11/19/2022 3:46 PM, Michael F. Stemper wrote: On 18/11/2022 04.53, Stefan Ram wrote:    Can I use "sys.argv" to pass information between modules    as follows?    in module A: import sys sys.argv.append( "Hi there!" )    in module B: import sys message = sys.argv[ -1 ] I just tried and

Re: Passing information between modules

2022-11-19 Thread Thomas Passin
On 11/19/2022 4:28 PM, Thomas Passin wrote: On 11/19/2022 3:46 PM, Michael F. Stemper wrote: On 18/11/2022 04.53, Stefan Ram wrote:    Can I use "sys.argv" to pass information between modules    as follows?    in module A: import sys sys.argv.append( "Hi there!" )    in module B: import sys

Re: Passing information between modules

2022-11-19 Thread Michael F. Stemper
On 18/11/2022 04.53, Stefan Ram wrote: Can I use "sys.argv" to pass information between modules as follows? in module A: import sys sys.argv.append( "Hi there!" ) in module B: import sys message = sys.argv[ -1 ] I just tried and it appears that one can append to sys.argv. Howeve

Re: Passing information between modules

2022-11-19 Thread dn
On 18/11/2022 23.53, Stefan Ram wrote: Can I use "sys.argv" to pass information between modules as follows? in module A: import sys sys.argv.append( "Hi there!" ) in module B: import sys message = sys.argv[ -1 ] . "sys.argv" is said to be a list by the standard documentatio

Logging

2022-11-19 Thread Baran Gökçekli
How can I solve this question? There is a module called ‘logging’ to employ logging facility in Python. import logging logging. info('Just a normal message' ) Logging.warning('Not fatal but still noted') logging.error('There is something wrong') You are expected to implement logging feature t

Re: Help Merging Of Separate Python Codes

2022-11-19 Thread dn
On 20/11/2022 02.20, maria python wrote: Hello, I have these two python codes that work well separately and I want to combine them, but I am not sure how to do it. Also after that, I want to print the result in txt cvs or another file format. Do you have a code for that? Thank you. Have you