Re: Making 'compiled' modules work with multiple python versions on Linux

2024-04-02 Thread Barry via Python-list
> On 1 Apr 2024, at 18:14, Left Right via Python-list > wrote: > > It sounds weird that symbols from Limited API are _missing_ (I'd > expect them to be there no matter what library version you link with). You have to specify the version of the limited API that you want to use. Each release ad

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-04-01 Thread Left Right via Python-list
It sounds weird that symbols from Limited API are _missing_ (I'd expect them to be there no matter what library version you link with). But, I haven't done this myself, so, what do I know? It would help though to see the actual error. That aside: why do you want to do this? One side effect of doi

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-03-29 Thread Barry Scott via Python-list
> On 29 Mar 2024, at 16:09, Olivier B. > wrote: > > It is not a symlink on my system, where i built python myself, but a > 15KB so file. But it seems to lack lots of python symbols. > > Maybe what i should do is actually make libpython.so a physical copy > of libpyton311.so before linking to

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-03-29 Thread Olivier B. via Python-list
It is not a symlink on my system, where i built python myself, but a 15KB so file. But it seems to lack lots of python symbols. Maybe what i should do is actually make libpython.so a physical copy of libpyton311.so before linking to it, so now on any system the module would look to load libpython.

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-03-29 Thread Barry via Python-list
> On 28 Mar 2024, at 16:13, Olivier B. via Python-list > wrote: > > But on Linux, it seems that linking to libpython3.so instead of > libpython3.11.so.1.0 does not have the same effect, and results in > many unresolved python symbols at link time > > Is this functionality only available on W

Making 'compiled' modules work with multiple python versions on Linux

2024-03-28 Thread Olivier B. via Python-list
I have a python module that includes some C++ code that links with the Python C API I have now modified the c++ code so that it only uses the Limited API, and linked with python3.lib instead of python311.lib. I can now use that python module with different python versions on Windows But on Linux

Accessing configuration across multiple modules

2023-11-28 Thread Loris Bennett via Python-list
les-across-modules-from-user-defined-config-file I think I could probably get that to work, but are there any better alternatives? Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

Re: Organizing modules and their code

2023-02-05 Thread Greg Ewing via Python-list
On 6/02/23 4:23 am, Weatherby,Gerard wrote: Well, first of all, while there is no doubt as to Dijkstra’s contribution to computer science, I don’t think his description of scientific thought is correct. The acceptance of Einstein’s theory of relativity has nothing to do with internal consisten

Re: Organizing modules and their code

2023-02-05 Thread Weatherby,Gerard
sure that’s true. If it’s not, I’d be interested in a counterexample). From: Python-list on behalf of transreductionist Date: Saturday, February 4, 2023 at 7:42 PM To: python-list@python.org Subject: Re: Organizing modules and their code *** Attention: This is an external email. Use caution

Re: Organizing modules and their code

2023-02-04 Thread transreductionist
ns below) > containing code, that as the name suggests, manages an ETL pipeline. A > directory is created called etl_helpers that organizes several modules > responsible for making up the pipeline. The discussion concerns the Python > language, which supports OOP as well as Structural/Func

Re: Organizing modules and their code

2023-02-04 Thread Greg Ewing via Python-list
On 5/02/23 11:18 am, transreductionist wrote: This analogy came to me the other day. For me, I would rather walk into a grocery store where the bananas, apples, and oranges are separated in to their own bins, instead of one common crate. On the other hand, if the store has an entire aisle dev

Re: Organizing modules and their code

2023-02-04 Thread transreductionist
directory is created called etl_helpers that organizes several modules > > responsible for making up the pipeline. The discussion concerns the Python > > language, which supports OOP as well as Structural/Functional approaches to > > programming. > > > > I am int

Re: Organizing modules and their code

2023-02-04 Thread Weatherby,Gerard
transreductionist Date: Friday, February 3, 2023 at 4:48 PM To: python-list@python.org Subject: Organizing modules and their code *** Attention: This is an external email. Use caution responding, opening attachments or clicking on links. *** Here is the situation. There is a top-level module (see designs

Re: Organizing modules and their code

2023-02-03 Thread Thomas Passin
paration of concerns, decoupled modules and APIs, and so forth. Doing this does not require a full, future-proof suite of alternative database adapters, for example, right from the start. On top of everything else, you can't know the future perfectly. And you can't know enough at the

Re: Organizing modules and their code

2023-02-03 Thread dn via Python-list
On 04/02/2023 16.24, Thomas Passin wrote: On 2/3/2023 5:14 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: Keep It Simple:  Put all four modules at the top level, and run with it until you falsify it.  Yes, I would give you that same advice no matter what language you're using. In my r

Re: Organizing modules and their code

2023-02-03 Thread Thomas Passin
On 2/3/2023 5:14 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: Keep It Simple: Put all four modules at the top level, and run with it until you falsify it. Yes, I would give you that same advice no matter what language you're using. In my recent message I supported DESIGN 1. But I r

Re: Organizing modules and their code

2023-02-03 Thread Thomas Passin
On 2/3/2023 4:18 PM, transreductionist wrote: Here is the situation. There is a top-level module (see designs below) containing code, that as the name suggests, manages an ETL pipeline. A directory is created called etl_helpers that organizes several modules responsible for making up the

Re: Organizing modules and their code

2023-02-03 Thread 2QdxY4RzWzUUiLuE
On 2023-02-03 at 13:18:46 -0800, transreductionist wrote: > Here is the situation. There is a top-level module (see designs below) > containing code, that as the name suggests, manages an ETL pipeline. A > directory is created called etl_helpers that organizes several modules > res

Organizing modules and their code

2023-02-03 Thread transreductionist
Here is the situation. There is a top-level module (see designs below) containing code, that as the name suggests, manages an ETL pipeline. A directory is created called etl_helpers that organizes several modules responsible for making up the pipeline. The discussion concerns the Python

Re: Passing information between modules

2022-11-21 Thread Barry
> On 21 Nov 2022, at 21:23, r...@zedat.fu-berlin.de wrote: > > dn writes: >> Now, at the config stage, take the instructions to define whichever the >> user prefers, and instantiate that class. Then the 'calling-routine' can >> use the instantiated object as an interface to whichever type of

Re: Passing information between modules

2022-11-21 Thread Thomas Passin
can happen today if, for example, a class is changed to use slots for everything. Between slots and type checking, it can become impossible to add an arbitrary attribute. *You* may be able to avoid this, but if you use someone else's modules or classes it could happen at any time. I might

Re: Passing information between modules

2022-11-20 Thread Chris Angelico
On Mon, 21 Nov 2022 at 16:26, dn wrote: > Am put-off by the 'smell' of subverting/adapting names like print() = > surprise/confusion factor - but I think I understand where you're going. To be fair, redefining the "print" function IS one of the reasons that it's no longer a statement. Though I wo

Re: Passing information between modules

2022-11-20 Thread dn
On 21/11/2022 01.29, Stefan Ram wrote: dn writes: A 'standard' solution is to collect all such configuration-data at the start of the application, into an object (or other data-structure) - I usually call it "env" (an instantiation of "Environment"). Yeah, I had some functions of my librar

Re: Passing information between modules

2022-11-20 Thread Thomas Passin
On 11/21/2022 12:01 AM, dn wrote: On 21/11/2022 12.07, Dan Kolis wrote: If you understand its meaning, it achieves my purpose. If you don't I you're perhaps not a programmer... Ouch! Does the first sentence imply who is the more important person in the interaction? Does the second further th

Re: Passing information between modules

2022-11-20 Thread dn
On 21/11/2022 12.07, Dan Kolis wrote: If you understand its meaning, it achieves my purpose. If you don't I you're perhaps not a programmer... Ouch! Does the first sentence imply who is the more important person in the interaction? Does the second further the idea that anyone/everyone who i

Re: Passing information between modules

2022-11-20 Thread Thomas Passin
On 11/20/2022 4:07 PM, Roel Schroeven wrote: Thomas Passin schreef op 20/11/2022 om 20:33: https://devblogs.microsoft.com/oldnewthing/20050607-00/?p=35413 https://devblogs.microsoft.com/oldnewthing/20101125-00/?p=12203 Now that I think about it, The Old New Thing is also where I got the global

Re: Passing information between modules

2022-11-20 Thread Dan Kolis
Its advice, I don't think the style issue is particularly important. If you understand its meaning, it achieves my purpose. If you don't I you're perhaps not a programmer... I like the abruptness of technical writing as a style, actually. If that is how machine learning ( aka 'A.I.' ) tends to

Re: Passing information between modules

2022-11-20 Thread Chris Angelico
On Mon, 21 Nov 2022 at 09:37, Dan Kolis wrote: > > Using sys.stdout / is simply nonsense. The more I think about it, the more I > realise how bad it is. > > Going on about it endlessly seems pointless. > > If the even mini threading thing is turned on, now what ? some other module > eats the mes

Re: Passing information between modules

2022-11-20 Thread Dan Kolis
'other' modules 4) When a shared idea is apparent concat a new named portion to the name for this purpose. Then use those fairly without fussing as required. If one scares you, set it to {} after some scary moment if you are feeling fussy. 5) All 'ideas' will be at a 3rd or

Re: Passing information between modules

2022-11-20 Thread Roel Schroeven
Thomas Passin schreef op 20/11/2022 om 20:33: https://devblogs.microsoft.com/oldnewthing/20050607-00/?p=35413 https://devblogs.microsoft.com/oldnewthing/20101125-00/?p=12203 Now that I think about it, The Old New Thing is also where I got the global vs local thing: "Don’t use global state to ma

Re: Passing information between modules

2022-11-20 Thread Thomas Passin
M would use sys.stdin for input and sys.stdout    for output. I feel this is a bad idea. This uses global state for customizing local behavior. Yes, maybe you want to customize behavior in one of your modules, or even only in some functions, or maybe in several or even all of your modules. But by c

Re: Passing information between modules

2022-11-20 Thread dn
On 21/11/2022 01.03, Stefan Ram wrote: dn writes: In some respects we have the (OP) problem because Python does not have "interfaces" as a formal component of the language. What one can do today is, class my_interface( metaclass=abc.ABCMeta ): """This interface ...""" @abc.abst

Re: Passing information between modules

2022-11-20 Thread Roel Schroeven
for output. I feel this is a bad idea. This uses global state for customizing local behavior. Yes, maybe you want to customize behavior in one of your modules, or even only in some functions, or maybe in several or even all of your modules. But by changing module "M", you're chan

Re: Passing information between modules

2022-11-20 Thread Dan Kolis
It's certainly not an "incredibly bad idea", it is a mildly bad idea however. Why be stuck with maybe's and just text strings ? Functions as "first class operators" and object oriented languages are a natural pair with a bit of heavy thinking. The problem is... there is nobody giving you a 3

Re: Passing information between modules

2022-11-20 Thread Avi Gross
There is no guarantee that argv is consulted earlier in the program than other modules will use it for communication. Consider a case where a program does look at argv but later wants to call another program using some or all of the components of argv and now there are added components there

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: 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

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

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!" )   

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 ca

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 sai

Re: Passing information between modules

2022-11-18 Thread Axy via Python-list
On 18/11/2022 10: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 ] This idea has a couple of flaws so ca

Re: Passing information between modules

2022-11-18 Thread Thomas Passin
On 11/18/2022 10:19 AM, Tobiah wrote: On 11/18/22 02: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 ] Kind

Re: Passing information between modules

2022-11-18 Thread Tobiah
On 11/18/22 02: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 ] Kind of seems like a code smell. I think you

Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-27 Thread Peter J. Holzer
On 2022-06-21 02:04:52 -0700, Chethan Kumar S wrote: > I have a main process which makes use of different other modules. And > these modules also use other modules. I need to log all the logs into > single log file. Due to use of TimedRotatingFileHandler, my log > behaves diffe

Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-22 Thread Dieter Maurer
Chethan Kumar S wrote at 2022-6-21 02:04 -0700: > ... >I have a main process which makes use of different other modules. And these >modules also use other modules. I need to log all the logs into single log >file. Due to use of TimedRotatingFileHandler, my log behaves diffe

Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-22 Thread Lars Liedtke
The process that is writing the file must be told that rotation has happened for it to work. Other wise all the logs keep being write to the original file via the FD that the process has. logrotate's config include how to tell the process the log file needs reopening. Thanks for clearing.

Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-22 Thread Barry Scott
> On 22 Jun 2022, at 11:06, Lars Liedtke wrote: > > Could be unrelated and only a part of a solution, but if you are on a unixoid > system, you could use logrotate, instead of TimedRotatingFileHandler. > logfrotate ensures that the logging service does not realize, its logs have > been rota

Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-22 Thread Lars Liedtke
privacy policy http://solute.de/ger/datenschutz/grundsaetze-der-datenverarbeitung.php Am 21.06.22 um 11:04 schrieb Chethan Kumar S: I have a main process which makes use of different other modules. And these modules also use other modules. I need to log all the logs into single log file. Due to use

Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-21 Thread Chethan Kumar S
Hi all, Need help with below query on python logging module. I have a main process which makes use of different other modules. And these modules also use other modules. I need to log all the logs into single log file. Due to use of TimedRotatingFileHandler, my log behaves differently after

Re: Can Python call and use FME modules and functions such as StreamOrderCalculator?

2021-12-23 Thread Mats Wichmann
On 12/23/21 09:38, Shaozhong SHI wrote: > Can we do something like import an fme.something and make use of FME > modules and functions? And what, pray tell, is FME? -- https://mail.python.org/mailman/listinfo/python-list

Can Python call and use FME modules and functions such as StreamOrderCalculator?

2021-12-23 Thread Shaozhong SHI
Can we do something like import an fme.something and make use of FME modules and functions? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Re: on perhaps unloading modules?

2021-09-04 Thread Hope Rouselle
Dennis Lee Bieber writes: > On Sun, 22 Aug 2021 16:28:12 -0300, Hope Rouselle > declaimed the following: > > >>That's wild. :-) Was this created by Brian Kernighan? It's hard to >>believe. Oh, I think he wrote AMPL, wasn't it? A Mathematical >>Programming Language, or something like that. > >

Setup.py + src: Modules not found

2021-08-30 Thread Abdur-Rahmaan Janhangeer
bot.x, the package was installed but on a fresh release, it does not know what exactly is honeybot for the first time Q: In my case in modules what should i write to import from /api? Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://ww

Re: on perhaps unloading modules?

2021-08-28 Thread Hope Rouselle
"Peter J. Holzer" writes: > On 2021-08-22 16:28:12 -0300, Hope Rouselle wrote: >> I have a certain distaste for syntax too. For instance, I would much >> rather write and read ``first(ls)'' than ``ls[0]''. > > Would you also prefer `twothousandthreehundredandtwentythird(ls)` over > `ls[2322]`?

Re: on perhaps unloading modules?

2021-08-24 Thread Peter J. Holzer
On 2021-08-22 16:28:12 -0300, Hope Rouselle wrote: > I have a certain distaste for syntax too. For instance, I would much > rather write and read ``first(ls)'' than ``ls[0]''. Would you also prefer `twothousandthreehundredandtwentythird(ls)` over `ls[2322]`? hp -- _ | Peter J. Holz

Re: on perhaps unloading modules?

2021-08-23 Thread Dennis Lee Bieber
On Sun, 22 Aug 2021 16:28:12 -0300, Hope Rouselle declaimed the following: >That's wild. :-) Was this created by Brian Kernighan? It's hard to >believe. Oh, I think he wrote AMPL, wasn't it? A Mathematical >Programming Language, or something like that. Kenneth Iverson, early 1960s fo

Re: on perhaps unloading modules?

2021-08-23 Thread Hope Rouselle
Dennis Lee Bieber writes: > On Sat, 21 Aug 2021 17:15:14 -0300, Hope Rouselle > declaimed the following: > >>write some PHP precisely because it looked so much more cryptic than >>Allaire ColdFusion. Then C looked even more cryptic, so I fell in love >>with C. >> > Try APL then... Lol.

Re: on perhaps unloading modules?

2021-08-22 Thread MRAB
On 2021-08-22 17:18, Dennis Lee Bieber wrote: On Sat, 21 Aug 2021 17:15:14 -0300, Hope Rouselle declaimed the following: write some PHP precisely because it looked so much more cryptic than Allaire ColdFusion. Then C looked even more cryptic, so I fell in love with C. Try APL then..

Re: on perhaps unloading modules?

2021-08-22 Thread Dennis Lee Bieber
On Sat, 21 Aug 2021 17:15:14 -0300, Hope Rouselle declaimed the following: >write some PHP precisely because it looked so much more cryptic than >Allaire ColdFusion. Then C looked even more cryptic, so I fell in love >with C. > Try APL then... (I suspect this will get garbaged in proces

Re: on perhaps unloading modules?

2021-08-22 Thread Hope Rouselle
;> sys.modules and don't have to worry about somehow unloading the >>> module. >> >> I would agree with this. If you need to mess around with modules and >> you don't want them to be cached, avoid the normal "import" mechanism, >> and just ex

Re: on perhaps unloading modules?

2021-08-21 Thread Hope Rouselle
Chris Angelico writes: > On Sun, Aug 22, 2021 at 4:37 AM Hope Rouselle wrote: >> >> Greg Ewing writes: >> >> > On 21/08/21 1:36 pm, Hope Rouselle wrote: >> >> I wish I could restrict their syntax too, though, but I fear that's >> >> not possible. For instance, it would be very useful if I coul

Re: on perhaps unloading modules?

2021-08-21 Thread Chris Angelico
On Sun, Aug 22, 2021 at 4:37 AM Hope Rouselle wrote: > > Greg Ewing writes: > > > On 21/08/21 1:36 pm, Hope Rouselle wrote: > >> I wish I could restrict their syntax too, though, but I fear that's > >> not possible. For instance, it would be very useful if I could > >> remove loops. > > > > Actu

Re: on perhaps unloading modules?

2021-08-21 Thread Greg Ewing
On 21/08/21 1:36 pm, Hope Rouselle wrote: I wish I could restrict their syntax too, though, but I fear that's not possible. For instance, it would be very useful if I could remove loops. Actually you could, using ast.parse to get an AST and then walk it looking for things you don't want to all

Re: on perhaps unloading modules?

2021-08-21 Thread Hope Rouselle
Greg Ewing writes: > On 21/08/21 1:36 pm, Hope Rouselle wrote: >> I wish I could restrict their syntax too, though, but I fear that's >> not possible. For instance, it would be very useful if I could >> remove loops. > > Actually you could, using ast.parse to get an AST and then walk > it lookin

Re: on perhaps unloading modules?

2021-08-20 Thread Hope Rouselle
Greg Ewing writes: > On 21/08/21 6:15 am, Hope Rouselle wrote: > code() >> 'def p():\n import math\n return math.e\n' > exec(code()) > p >> > p() >> 2.718281828459045 > > Note that this pollutes the globals of the module that you're calling > exec() from. For better isolation y

Re: on perhaps unloading modules?

2021-08-20 Thread Greg Ewing
On 21/08/21 6:15 am, Hope Rouselle wrote: code() 'def p():\n import math\n return math.e\n' exec(code()) p p() 2.718281828459045 Note that this pollutes the globals of the module that you're calling exec() from. For better isolation you can pass in an explicit globals dict: g = {} exec

Re: on perhaps unloading modules?

2021-08-20 Thread Hope Rouselle
somehow unloading the >> module. > > I would agree with this. If you need to mess around with modules and > you don't want them to be cached, avoid the normal "import" mechanism, > and just exec yourself a module's worth of code. This is looks very interesti

Re: on perhaps unloading modules?

2021-08-19 Thread Hope Rouselle
Martin Di Paola writes: > This may not answer your question but it may provide an alternative > solution. > > I had the same challenge that you an year ago so may be my solution will > work for you too. > > Imagine that you have a Markdown file that *documents* the expected > results. > > This

Re: on perhaps unloading modules?

2021-08-19 Thread Hope Rouselle
somehow unloading the >> module. > > I would agree with this. If you need to mess around with modules and > you don't want them to be cached, avoid the normal "import" mechanism, > and just exec yourself a module's worth of code. Sounds like a plan. Bu

Re: on perhaps unloading modules?

2021-08-17 Thread Martin Di Paola
[...] reproducible_problem() student.py, total losses 10 other.py, total losses 10 The the problem: reproducible_problem() student.py, total losses 0 other.py, total losses 0 They lose nothing because both modules are now permanently modified. (*) The code of grading.py --8<---cut

Re: on perhaps unloading modules?

2021-08-16 Thread Chris Angelico
e with this. If you need to mess around with modules and you don't want them to be cached, avoid the normal "import" mechanism, and just exec yourself a module's worth of code. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: on perhaps unloading modules?

2021-08-16 Thread Hope Rouselle
> > Python 3.5.2 [...] on win32 > [...] >>>> reproducible_problem() > student.py, total losses 10 > other.py, total losses 10 > > The the problem: > >>>> reproducible_problem() > student.py, total losses 0 > other.py, total losses 0 > >

Re: on perhaps unloading modules?

2021-08-16 Thread Hope Rouselle
_problem() student.py, total losses 0 other.py, total losses 0 They lose nothing because both modules are now permanently modified. (*) The code of grading.py --8<---cut here---start->8--- # -*- mode: python; python-indent-offset: 2 -*- def key_question1(t):

Re: on perhaps unloading modules?

2021-08-16 Thread Hope Rouselle
st interested in understanding more about >> modules. > > Okay, I'll assume all the security issues have been taken are of, e.g. > by running all of this in a virtual machine... Oh, good idea. :-D >> Notice how student m0 (who really scored a zero) >> first gets his grade r

Re: on perhaps unloading modules?

2021-08-16 Thread Greg Ewing
On 16/08/21 1:50 am, Hope Rouselle wrote: By the way, I'm aware that what I'm doing here is totally unsafe and I could get my system destroyed. I'm not planning on using this --- thank you for your concern. I'm just interested in understanding more about modules. Okay,

on perhaps unloading modules?

2021-08-16 Thread Hope Rouselle
(*) Introduction By the way, I'm aware that what I'm doing here is totally unsafe and I could get my system destroyed. I'm not planning on using this --- thank you for your concern. I'm just interested in understanding more about modules. (*) The problem I got myself into

Re: Importing modules with arguments

2021-07-30 Thread Chris Angelico
On Sat, Jul 31, 2021 at 5:11 AM Charles Smith wrote: > > First off, thanks for the answer. I don't see the cached module as a problem > here. If you provide arguments to a module, the goal is "most likely" to > alter/parameterize the behavior of the first import. Now, I agree that > behavior be

Re: Importing modules with arguments

2021-07-30 Thread Charles Smith
First off, thanks for the answer. I don't see the cached module as a problem here. If you provide arguments to a module, the goal is "most likely" to alter/parameterize the behavior of the first import. Now, I agree that behavior becomes unpredictable because passing different parameters on subs

Re: Importing modules with arguments

2021-07-30 Thread Chris Angelico
y changing > the design. The second reason is to invert dependencies between two modules. > It occurred to me when using libraries like FastAPI or Flask that it would be > nicer to use and leaner if instead of: > 1. Import FastAPI Router or FastAPI object directly > 2. Create a Rout

Importing modules with arguments

2021-07-30 Thread Charles Smith
n two modules. It occurred to me when using libraries like FastAPI or Flask that it would be nicer to use and leaner if instead of: 1. Import FastAPI Router or FastAPI object directly 2. Create a Router 3. Use the route decorators We could simply import a module with importlib and provide the r

Re: Where to keep local Python modules?

2021-07-24 Thread Chris Green
Cameron Simpson wrote: > > Almost everything I use comes either from pip or from my own modules. My > $PYTHONPATH on the Mac has this: > > /Users/cameron/lib/python:/Users/cameron/rc/python > > being, respectively, my personal modules and a place for third party &

Re: Where to keep local Python modules?

2021-07-23 Thread Cameron Simpson
On 23Jul2021 11:33, Chris Green wrote: >This isn't a question about how to set PYTHONPATH so that Python code >can find imported modules, it's about what is a sensible layout for >one's home directory - i.e. where to put Python modules. > >I'm running Linux

Re: Where to keep local Python modules?

2021-07-23 Thread Chris Green
Roland Mueller wrote: > Hello, > > pe 23. heinäk. 2021 klo 21.44 Chris Green (c...@isbd.net) kirjoitti: > > > This isn't a question about how to set PYTHONPATH so that Python code > > can find imported modules, it's about what is a sensible layout for > &

Re: Where to keep local Python modules?

2021-07-23 Thread Paul Bryan
23 at 22:46 +0300, Roland Mueller via Python-list wrote: > Hello, > > pe 23. heinäk. 2021 klo 21.44 Chris Green (c...@isbd.net) kirjoitti: > > > This isn't a question about how to set PYTHONPATH so that Python > > code > > can find imported modules, it's about

Re: Where to keep local Python modules?

2021-07-23 Thread Roland Mueller via Python-list
Hello, pe 23. heinäk. 2021 klo 21.44 Chris Green (c...@isbd.net) kirjoitti: > This isn't a question about how to set PYTHONPATH so that Python code > can find imported modules, it's about what is a sensible layout for > one's home directory - i.e. where to put Python

Where to keep local Python modules?

2021-07-23 Thread Chris Green
This isn't a question about how to set PYTHONPATH so that Python code can find imported modules, it's about what is a sensible layout for one's home directory - i.e. where to put Python modules. I'm running Linux and have a number of Python modules that are only used by my own

Re: Are there Python modules that allow a program to write to the screen?

2021-04-26 Thread Grant Edwards
On 2021-04-26, Stephen Tucker wrote: > I have old software written in GWBASIC that I use to plot diagrams on the > screen. Pygame is probably the closest thing to what you're describing. If you want to produce professional looking plots from data, then matplotlib or one of the Gnuplot wrappers (

Re: Are there Python modules that allow a program to write to the screen?

2021-04-26 Thread Michael Torrie
On 4/26/21 12:38 AM, Stephen Tucker wrote: > Hi, > > I have old software written in GWBASIC that I use to plot diagrams on the > screen. > > In Windows 10, I have to resort to using the DOSBox emulator to run it. > > I would dearly like to re-write it in Python - ideally Python 2.7. > > What, i

Re: Are there Python modules that allow a program to write to the screen?

2021-04-26 Thread Chris Angelico
On Mon, Apr 26, 2021 at 4:40 PM Stephen Tucker wrote: > > Hi, > > I have old software written in GWBASIC that I use to plot diagrams on the > screen. > > In Windows 10, I have to resort to using the DOSBox emulator to run it. > "The screen" isn't really a viable target in a modern world, so it de

Are there Python modules that allow a program to write to the screen?

2021-04-25 Thread Stephen Tucker
Hi, I have old software written in GWBASIC that I use to plot diagrams on the screen. In Windows 10, I have to resort to using the DOSBox emulator to run it. I would dearly like to re-write it in Python - ideally Python 2.7. What, if anything, is available? Stephen Tucker. -- https://mail.pyt

Re: python 2.6: Need some advise for installing modules on a legacy system

2021-02-26 Thread Thomas Jollans
On 24/02/2021 14:13, Antoon Pardon wrote: > I need to do some development on this legacy system. It only runs > python2.6 and there is little hope of installing an other version. How > can I best proceed to install modules for working with mysql and ldap? > The answer very much de

Re: python 2.6: Need some advise for installing modules on a legacy system

2021-02-24 Thread Dan Stromberg
You also could try getting the modules (of suitable versions) you need from their homepage, possibly github, and then use the setup.py to install your packages. pypi usually has a link to a project's homepage. On Wed, Feb 24, 2021 at 6:08 AM Dan Stromberg wrote: > > I don't th

Re: python 2.6: Need some advise for installing modules on a legacy system

2021-02-24 Thread Dan Stromberg
I don't think pip supports 2.x anymore. You might be able to: 1) Look up what versions of your desired modules support Python 2.x on pypi's website 2) Install them on another system that has Python 3.x using pip 3) Copy them to the moribund system 4) Test On Wed, Feb 24, 2021 at 5:15

python 2.6: Need some advise for installing modules on a legacy system

2021-02-24 Thread Antoon Pardon
I need to do some development on this legacy system. It only runs python2.6 and there is little hope of installing an other version. How can I best proceed to install modules for working with mysql and ldap? -- Antoon. -- https://mail.python.org/mailman/listinfo/python-list

Re: Why am I unable to using rsync to install modules and appear to have to use pip install instead?

2021-02-10 Thread Robert Nicholson
Ok this was due to an install of miniconda then choosing to unconditionally install an older version of cryptography. > On Feb 10, 2021, at 3:40 PM, Robert Nicholson > wrote: > > Just reinstalling cryptography with pip install seems to have fixed my issue. > > Any pointers on why? > >> On Fe

Re: Why am I unable to using rsync to install modules and appear to have to use pip install instead?

2021-02-10 Thread Robert Nicholson
Just reinstalling cryptography with pip install seems to have fixed my issue. Any pointers on why? > On Feb 10, 2021, at 3:21 PM, Robert Nicholson > wrote: > > I’m using Python 3.7.0 > > so I have multiple environments all on the same architecture with the same > python release using anoncon

Why am I unable to using rsync to install modules and appear to have to use pip install instead?

2021-02-10 Thread Robert Nicholson
I’m using Python 3.7.0 so I have multiple environments all on the same architecture with the same python release using anonconda. What I discovered was that if I install the cryptography module in my dev / uat and then tried to synchronize to production server using rsync I ended up with error

Re: How to accept argparse.log_level parameter and propagate its value to all other modules

2021-01-27 Thread Zoran
Yes you are right. I changed the files: # main.py import argparse import mymodule import logging logger = logging.getLogger(__name__) def log_some_messages(): logger.debug(f'{__name__} - debug message') logger.info(f'{__name__} - info message') logger.warning(f'{__name__} - warning m

Re: How to accept argparse.log_level parameter and propagate its value to all other modules

2021-01-27 Thread Peter Otten
_some_messages(11) - mymodule - info message 2021-01-25 13:22:12,761 - [WARNING] - mymodule - (mymodule.py).log_some_messages(12) - mymodule - warning message As you can see, in main.py log level is set correctly, but in mymodule.py it is not. How to accept argparse.log_level parameter in i

  1   2   3   4   5   6   7   8   9   10   >