Re: Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-08 Thread Martin Di Paola
Then, you must put the initialization (dynamically loading the modules) into the function executed in the foreign process. You could wrap the payload function into a class instances to achieve this. In the foreign process, you call the instance which first performs the initialization and then exe

Re: Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-07 Thread Dieter Maurer
all the modules loaded, including the dynamic ones. Perfect. > >The problem is that `fork` is the default only in Linux. It works in >MacOS but it may lead to crashes if the parent process is multithreaded >(and the my is!) and `fork` does not work in Windows. Then, you must put the ini

Re: Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-07 Thread Martin Di Paola
I understand that yes, pickle.loads() imports any necessary module but only if they can be find in sys.path (like in any "import" statement). Dynamic code loaded from a plugin (which we presume it is *not* in sys.path) will not be loaded. Quick check. Run in one console the followin

Re: Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-07 Thread Barry
> On 7 Mar 2022, at 02:33, Martin Di Paola wrote: > > Yes but I think that unpickle (pickle.loads()) does that plus > importing any module needed Are you sure that unpickle will import code? I thought it did not do that. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-06 Thread Martin Di Paola
Yeup, that would be my first choice but the catch is that "sayhi" may not be a function of the given module. It could be a static method of some class or any other callable. Ah, fair. Are you able to define it by a "path", where each step in the path is a getattr() call? Yes but I think th

Re: Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-06 Thread Martin Di Paola
I'm not so sure about that. The author of the plugin knows they're writing code that will be dynamically loaded, and can therefore expect the kind of problem they're having. It could be argued that it's their responsibility to ensure that all the needed code is loaded into the subprocess. Ye

Re: Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-06 Thread Greg Ewing
On 7/03/22 9:36 am, Martin Di Paola wrote: It *would* be my fault if multiprocessing.Process fails only because I'm loading the code dynamically. I'm not so sure about that. The author of the plugin knows they're writing code that will be dynamically loaded, and can therefore expect the kind of

Re: Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-06 Thread Chris Angelico
On Mon, 7 Mar 2022 at 07:37, Martin Di Paola wrote: > > > > > > >The way you've described it, it's a hack. Allow me to slightly redescribe it. > > > >modules = loader() > >objs = init(modules) > > > >def invoke(mod, func): > ># I'm assuming that the loader is smart enough to not load > >#

Re: Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-06 Thread Martin Di Paola
Try to use `fork` as "start method" (instead of "spawn"). Yes but no. Indeed with `fork` there is no need to pickle anything. In particular the child process will be a copy of the parent so it will have all the modules loaded, including the dynamic ones. Perfect. The probl

Re: Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-06 Thread Martin Di Paola
The way you've described it, it's a hack. Allow me to slightly redescribe it. modules = loader() objs = init(modules) def invoke(mod, func): # I'm assuming that the loader is smart enough to not load # a module that's already loaded. Alternatively, load just the # module you need,

Re: Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-06 Thread Dieter Maurer
Martin Di Paola wrote at 2022-3-6 12:42 +: >Hi everyone. I implemented time ago a small plugin engine to load code >dynamically. > >So far it worked well but a few days ago an user told me that he wasn't >able to run in parallel a piece of code in MacOS. > >He was using multiprocessing.Process

Re: Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-06 Thread Chris Angelico
On Sun, 6 Mar 2022 at 23:43, Martin Di Paola wrote: > > Hi everyone. I implemented time ago a small plugin engine to load code > dynamically. > > So far it worked well but a few days ago an user told me that he wasn't > able to run in parallel a piece of code in MacOS. > > He was using multiproces

Execute in a multiprocessing child dynamic code loaded by the parent process

2022-03-06 Thread Martin Di Paola
Hi everyone. I implemented time ago a small plugin engine to load code dynamically. So far it worked well but a few days ago an user told me that he wasn't able to run in parallel a piece of code in MacOS. He was using multiprocessing.Process to run the code and in MacOS, the default start metho

Re: I discovered a bug in the no-ip dynamic dns free hostname auto renewal/confirmation script written by loblab

2020-08-16 Thread Turritopsis Dohrnii Teo En Ming
Noted with thanks. I will contact the script authors. On 2020-08-17 07:16, Cameron Simpson wrote: On 16Aug2020 17:41, Turritopsis Dohrnii Teo En Ming wrote: Subject: I discovered a bug in the no-ip dynamic dns free hostname auto renewal/confirmation script written by loblab The best thing

Re: I discovered a bug in the no-ip dynamic dns free hostname auto renewal/confirmation script written by loblab

2020-08-16 Thread Cameron Simpson
On 16Aug2020 17:41, Turritopsis Dohrnii Teo En Ming wrote: >Subject: I discovered a bug in the no-ip dynamic dns free hostname >auto renewal/confirmation script written by loblab The best thing to do here is to submit this as an issue here: https://github.com/loblab/noip-renew/

I discovered a bug in the no-ip dynamic dns free hostname auto renewal/confirmation script written by loblab

2020-08-16 Thread Turritopsis Dohrnii Teo En Ming
Subject: I discovered a bug in the no-ip dynamic dns free hostname auto renewal/confirmation script written by loblab Good day from Singapore, Programming code troubleshooting person: Mr. Turritopsis Dohrnii Teo En Ming (Targeted Individual) Country: Singapore Date: 15 to 16 August 2020

Re: Need a Dynamic vlookup using python

2020-07-19 Thread narenchunduri
Any solution possible for this. Please let me know -- https://mail.python.org/mailman/listinfo/python-list

Re: Need a Dynamic vlookup using python

2020-07-12 Thread narenchunduri
Sorry for not making it clear. I tried below code # import modules from openpyxl import * from openpyxl.styles import * import webbrowser import pandas from openpyxl.worksheet.datavalidation import DataValidation # Read all Excels into pandas dataframes sowexcel = pandas.read_excel('Billing Rost

Re: Need a Dynamic vlookup using python

2020-07-11 Thread DL Neil via Python-list
On 11/07/20 8:34 PM, narenchund...@gmail.com wrote: Any suggestions please Clarify the requirements, rather than starting with a 'solution'. Communicate the constraints, eg what is already in-place. "vlookup" has particular meaning in worksheet/spreadsheet packages. Is that what you are usin

Need a Dynamic vlookup using python

2020-07-11 Thread narenchunduri
Any suggestions please -- https://mail.python.org/mailman/listinfo/python-list

Re: dynamic import of dynamically created modules failes

2020-03-31 Thread Peter Otten
Dieter Maurer wrote: > Stephan Lukits wrote at 2020-3-31 17:44 +0300: >>background: >> >>- a daemon creates package p1 (e.g. directory with __init__.py-file) and >>in p1 a module m1 is created. >> >>- Then the daemon wants to import from m1, which functions (so far all >>the time). >> >>- Then a m

[Solved] Re: dynamic import of dynamically created modules failes

2020-03-31 Thread Stephan Lukits
On 3/31/20 8:00 PM, Dieter Maurer wrote: Stephan Lukits wrote at 2020-3-31 17:44 +0300: background: - a daemon creates package p1 (e.g. directory with __init__.py-file) and in p1 a module m1 is created. - Then the daemon wants to import from m1, which functions (so far all the time). - Then

Re: dynamic import of dynamically created modules failes

2020-03-31 Thread Stephan Lukits
On 3/31/20 9:01 PM, Pieter van Oostrum wrote: "Dieter Maurer" writes: Stephan Lukits wrote at 2020-3-31 17:44 +0300: background: - a daemon creates package p1 (e.g. directory with __init__.py-file) and in p1 a module m1 is created. - Then the daemon wants to import from m1, which functions

Re: dynamic import of dynamically created modules failes

2020-03-31 Thread Pieter van Oostrum
Pieter van Oostrum writes: > > The first import creates a file __pycache__ in the directory p1. That should be 'a directory __pycache__' > To remove it use rmtree(path.join(P1,'__pycache__')) > Then the second import will succeed. > -- > Pieter van Oostrum > www: http://pieter.vanoostrum.org/ >

Re: dynamic import of dynamically created modules failes

2020-03-31 Thread Pieter van Oostrum
"Dieter Maurer" writes: > Stephan Lukits wrote at 2020-3-31 17:44 +0300: >>background: >> >>- a daemon creates package p1 (e.g. directory with __init__.py-file) and >>in p1 a module m1 is created. >> >>- Then the daemon wants to import from m1, which functions (so far all >>the time). >> >>- Then

Re: dynamic import of dynamically created modules failes

2020-03-31 Thread Dieter Maurer
Stephan Lukits wrote at 2020-3-31 17:44 +0300: >background: > >- a daemon creates package p1 (e.g. directory with __init__.py-file) and >in p1 a module m1 is created. > >- Then the daemon wants to import from m1, which functions (so far all >the time). > >- Then a module m2 is created in p1 and the

dynamic import of dynamically created modules failes

2020-03-31 Thread Stephan Lukits
prevent or re-trigger it. (neither a reload of p1 nor a deletion of p1 from sys.modules does the trick) -test-script--- """ (python --version: Python 3.8.2) Dynamic import of dynamically created modules right after creation. ""&qu

Re: Was: Dynamic Data type assignment

2020-01-30 Thread Dan Sommers
On Thu, 30 Jan 2020 20:40:50 +1300 DL Neil via Python-list wrote: > Why do we have [argparse] at the cmdLN and yet not have something > similar for input? Because argparse works on input, too? Many examples on https://docs.python.org/3/library/argparse.html¹ explicitly pass a list of strings to

Was: Dynamic Data type assignment

2020-01-29 Thread DL Neil via Python-list
Further thoughts on the OP's point:- On 29/01/20 4:51 PM, sushma ms wrote: ... But why can't we make output of input also dynamic data assignment. ... >>>> when i'm assigning value dynamically and when we comparing in "if" loop >>>> i

Re: [docs] Dynamic Data type assignment

2020-01-28 Thread DL Neil via Python-list
On 29/01/20 4:51 PM, sushma ms wrote: Thanks a lot. But why can't we make output of input also dynamic data assignment. 1 please don't 'top post': the normal sequence of a conversation is question THEN answer! 2 ambiguity! It is not possible for the input() mechanism

Re: [docs] Dynamic Data type assignment

2020-01-28 Thread sushma ms
Thanks a lot. But why can't we make output of input also dynamic data assignment. Thanks & Regards, Sushma MS On Tue, Jan 28, 2020, 9:54 PM Mariatta wrote: > input() returns a string. If you want it to be treated as an int you need > to cast it, example: > > num =int

Re: Dynamic Data type assignment

2020-01-28 Thread Rhodri James
On 28/01/2020 12:03, sushma ms wrote: Hi Please find below example and the compiler error, when i'm assigning value dynamically and when we comparing in "if" loop it is throwing compiler error. It should not throw error It absolutely should throw an error. it should assign and act as int wh

Re: [docs] Dynamic Data type assignment

2020-01-28 Thread Mariatta
input() returns a string. If you want it to be treated as an int you need to cast it, example: num =int(input ("Enter number")) On Tue, Jan 28, 2020, 5:13 AM sushma ms wrote: > Hi > > Please find below example and the compiler error, > > when i'm assigning value dynamically and when we comparin

Dynamic Data type assignment

2020-01-28 Thread sushma ms
Hi Please find below example and the compiler error, when i'm assigning value dynamically and when we comparing in "if" loop it is throwing compiler error. It should not throw error it should assign and act as int why it is thinking as string. *Code Snippet:* print("Hello World") num = input("E

Re: How to get dynamic data in html (javascript?)

2020-01-13 Thread Friedrich Rentsch
On 1/11/20 2:39 PM, Friedrich Rentsch wrote: Hi all, I'm pretty good at hacking html text. But I have no clue how to get dynamic data like this : "At close: {date} {time}". I would appreciate a starting push to narrow my focus, currently awfully unfocused. Thanks. Frede

Re: How to get dynamic data in html (javascript?)

2020-01-13 Thread Chris Angelico
On Sun, Jan 12, 2020 at 4:41 AM Friedrich Rentsch wrote: > > Hi all, > > I'm pretty good at hacking html text. But I have no clue how to get > dynamic data like this : "At close: {date} {time}". I would appreciate a > starting push to narrow my focus, cu

Re: How to get dynamic data in html (javascript?)

2020-01-12 Thread musbur
On Sat, 11 Jan 2020 14:39:38 +0100 Friedrich Rentsch wrote: > I'm pretty good at hacking html text. But I have no clue how to get > dynamic data like this : "At close: {date} {time}". I would > appreciate a starting push to narrow my focus, currently awfully > unfoc

How to get dynamic data in html (javascript?)

2020-01-11 Thread Friedrich Rentsch
Hi all, I'm pretty good at hacking html text. But I have no clue how to get dynamic data like this : "At close: {date} {time}". I would appreciate a starting push to narrow my focus, currently awfully unfocused. Thanks. Frederic -- https://mail.python.org/mailman/listinfo/python-list

Python 3.7.3 - ImportError: dynamic module does not define module export function (PyInit_*)

2019-06-30 Thread gia .
Hi, I was trying to upgrade a python 2 extension in Linux and hit this error upon trying to import it into python 3. The weird thing is that I can see the symbol when I use readelf -a, so it is not missing, it has visibility default and it defines as extern "C" PyObject* return type (using the mac

Re: Python refactoring question and create dynamic attributes

2019-06-23 Thread DL Neil
On 23/06/19 7:56 PM, Arup Rakshit wrote: In the below code: @classmethod def find(self, id): if isinstance(id, list): rows = self.__table__().get_all(*id).run(self.__db__().conn) result = [] for row in rows: acategory = C

Re: Python refactoring question and create dynamic attributes

2019-06-23 Thread MRAB
On 2019-06-23 10:44, Arup Rakshit wrote: On 23-Jun-2019, at 2:31 PM, Cameron Simpson wrote: On 23Jun2019 13:26, Arup Rakshit wrote: In the below code: @classmethod def find(self, id): if isinstance(id, list): rows = self.__table__().get_all(*id).run(self.__db__().conn)

Re: Python refactoring question and create dynamic attributes

2019-06-23 Thread Arup Rakshit
> On 23-Jun-2019, at 2:31 PM, Cameron Simpson wrote: > > On 23Jun2019 13:26, Arup Rakshit wrote: >> In the below code: >> >> @classmethod >> def find(self, id): >> if isinstance(id, list): >> rows = self.__table__().get_all(*id).run(self.__db__().conn) >> result =

Re: Python refactoring question and create dynamic attributes

2019-06-23 Thread Cameron Simpson
On 23Jun2019 13:26, Arup Rakshit wrote: In the below code: @classmethod def find(self, id): if isinstance(id, list): rows = self.__table__().get_all(*id).run(self.__db__().conn) result = [] for row in rows: acategory = Category()

Python refactoring question and create dynamic attributes

2019-06-23 Thread Arup Rakshit
In the below code: @classmethod def find(self, id): if isinstance(id, list): rows = self.__table__().get_all(*id).run(self.__db__().conn) result = [] for row in rows: acategory = Category() acategory.__dict__.updat

Re: Dynamic selection for network service ports?

2019-05-01 Thread dieter
Markus Elfring writes: > ... >> You can avoid this with the SO_REUSEADDR flag. > > Can such a configuration parameter be used also together with > programming interfaces from the module “socketserver”? The "SO" prefix stands for "SOcket" -- "SO_REUSEADDR" is one of many so called "socket option"s

Re: Dynamic selection for network service ports?

2019-05-01 Thread Markus Elfring
> For the truly lazy, we have hash links. Thanks for your reminder. > https://docs.python.org/3/library/socketserver.html#socketserver.BaseServer.allow_reuse_address The relationship of this class attribute with the identifier (or option) “SO_REUSEADDR” might become easier to find. The use of

Re: Dynamic selection for network service ports?

2019-05-01 Thread Chris Angelico
On Thu, May 2, 2019 at 5:15 AM Markus Elfring wrote: > > > https://docs.python.org/3.4/library/socketserver.html > > about the middle of the page... > > It seems that you would like to refer to an other document. > https://docs.python.org/3/library/socket.html#socket-example > > Under which

Re: Dynamic selection for network service ports?

2019-05-01 Thread Markus Elfring
> https://docs.python.org/3.4/library/socketserver.html > about the middle of the page... It seems that you would like to refer to an other document. https://docs.python.org/3/library/socket.html#socket-example Under which circumstances will the execution of the method “socket.setsockopt” b

Re: Dynamic selection for network service ports?

2019-05-01 Thread Markus Elfring
> If your server listens on a random port how does the client know > which port to connect to? I am fiddling also with the data processing variant that such connection properties are passed as parameters for a command which is executed as a child process so that desired data can be sent back to it

Re: Dynamic selection for network service ports?

2019-05-01 Thread Chris Angelico
etail occasionally increase the need to choose > an additional number for a quickly restarted service in a dynamic way? > > > You can avoid this with the SO_REUSEADDR flag. > > Can such a configuration parameter be used also together with > programming interfaces from the module “s

Re: Dynamic selection for network service ports?

2019-05-01 Thread Markus Elfring
this technical detail occasionally increase the need to choose an additional number for a quickly restarted service in a dynamic way? > You can avoid this with the SO_REUSEADDR flag. Can such a configuration parameter be used also together with programming interfaces from the module “socket

Re: Dynamic selection for network service ports?

2019-04-30 Thread Peter J. Holzer
On 2019-04-30 20:37:58 +0200, Markus Elfring wrote: > > In Python, there's a certain amount of support. You can attempt to > > bind to a port, and if you fail, try the next one in a sequence. > > * The zero seems to be also an usable parameter here. Yes. This gives you a random port (just like a

Re: Dynamic selection for network service ports?

2019-04-30 Thread Chris Angelico
On Wed, May 1, 2019 at 4:37 AM Markus Elfring wrote: > > > In Python, there's a certain amount of support. You can attempt to > > bind to a port, and if you fail, try the next one in a sequence. > > * The zero seems to be also an usable parameter here. > Is the system configuration documentation

Re: Dynamic selection for network service ports?

2019-04-30 Thread Markus Elfring
> In Python, there's a certain amount of support. You can attempt to > bind to a port, and if you fail, try the next one in a sequence. * The zero seems to be also an usable parameter here. Is the system configuration documentation unclear about the applied value range for the port allocation?

Re: Dynamic selection for network service ports?

2019-04-30 Thread Chris Angelico
ieve a reasonably safe number allocation. > > But I would occasionally prefer a dynamic selection for some data processing > approaches on my test systems. > How does the support look like for the handling of ephemeral ports by > programming interfaces for Python? > Ultimately, p

Re: Dynamic selection for network service ports?

2019-04-30 Thread Markus Elfring
somehow for the service where the desired input data will be received. It can be nice when a fixed port can be specified for such data exchange. Advanced service management can achieve a reasonably safe number allocation. But I would occasionally prefer a dynamic selection for some data processing a

[CfP] DLS 2019 - 15th Dynamic Languages Symposium, co-located with SPLASH 2019

2019-03-23 Thread Nick Papoylias
Call for Papers DLS 2019 - 15th Dynamic Languages Symposium Co-located with SPLASH 2019, October 22, Athens, Greece https://conf.researchr.org/home/dls-2019

Re: Looking for a recent quote about dynamic typing, possibly on this list

2018-07-07 Thread Stefan Behnel
Ben Finney schrieb am 07.07.2018 um 03:38: > Steven D'Aprano writes: > >> Somebody gave a quote about dynamic typing, along the lines of >> >> "Just because a language allows a lot of dynamic features, doesn't mean >> people's code uses a lot of

Re: Looking for a recent quote about dynamic typing, possibly on this list

2018-07-06 Thread Steven D'Aprano
On Sat, 07 Jul 2018 11:38:37 +1000, Ben Finney wrote: > Steven D'Aprano writes: > >> Somebody gave a quote about dynamic typing, along the lines of >> >> "Just because a language allows a lot of dynamic features, doesn't mean >> people's code

Re: Looking for a recent quote about dynamic typing, possibly on this list

2018-07-06 Thread Ben Finney
Steven D'Aprano writes: > Somebody gave a quote about dynamic typing, along the lines of > > "Just because a language allows a lot of dynamic features, doesn't mean > people's code uses a lot of dynamism." You did refer us to http://lambda-the-ultima

Re: Looking for a recent quote about dynamic typing, possibly on this list

2018-07-06 Thread Steven D'Aprano
On Fri, 06 Jul 2018 14:02:28 +0100, Bart wrote: > On 06/07/2018 13:43, Steven D'Aprano wrote: >> I think it might have been on this list, or possibly one of >> Python-Ideas or Python-Dev. >> >> Somebody gave a quote about dynamic typing, along the lines of >&g

Re: Looking for a recent quote about dynamic typing, possibly on this list

2018-07-06 Thread Bart
On 06/07/2018 13:43, Steven D'Aprano wrote: I think it might have been on this list, or possibly one of Python-Ideas or Python-Dev. Somebody gave a quote about dynamic typing, along the lines of "Just because a language allows a lot of dynamic features, doesn't mean people'

Looking for a recent quote about dynamic typing, possibly on this list

2018-07-06 Thread Steven D'Aprano
I think it might have been on this list, or possibly one of Python-Ideas or Python-Dev. Somebody gave a quote about dynamic typing, along the lines of "Just because a language allows a lot of dynamic features, doesn't mean people's code uses a lot of dynamism." Does anyo

Re: How to Generate dynamic HTML Report using Python

2017-11-22 Thread Rick Johnson
Chris Angelico wrote: > Gregory Ewing > > > > It looks like I'm going to have to filter Mr. Ram's posts > > out of my usenet feed as well, lest I accidentally show > > one of his URIs as a link on my screen. > > Or, just ignore his copyright altogether, and let him prove > its defensibility in co

Re: How to Generate dynamic HTML Report using Python

2017-11-21 Thread Chris Angelico
On Wed, Nov 22, 2017 at 4:10 PM, Gregory Ewing wrote: > Michael Torrie wrote: >> >> You also have this header set: >> >>> X-Copyright: (C) Copyright 2017 Stefan Ram. All rights reserved. >>> ... It is forbidden to change >>> URIs of this article into links... > > > What is "changing a URI into a l

Re: How to Generate dynamic HTML Report using Python

2017-11-21 Thread Gregory Ewing
Michael Torrie wrote: You also have this header set: X-Copyright: (C) Copyright 2017 Stefan Ram. All rights reserved. ... It is forbidden to change URIs of this article into links... What is "changing a URI into a link" meant to mean? Does it include automatically displaying something that l

Re: How to Generate dynamic HTML Report using Python

2017-11-21 Thread Rick Johnson
On Tuesday, November 21, 2017 at 5:57:42 AM UTC-6, Ned Batchelder wrote: [...] > [...] > I don't understand the motivation for limiting how words > are distributed, but others on this list also do it. For > example, Dennis Lee Bieber's messages are not in the > Python-List archives either. I call

Re: How to Generate dynamic HTML Report using Python

2017-11-21 Thread Christopher Reimer
On Nov 21, 2017, at 5:36 AM, Rustom Mody wrote: > >> On Tuesday, November 21, 2017 at 5:27:42 PM UTC+5:30, Ned Batchelder wrote: >>> On 11/20/17 9:50 AM, Stefan Ram wrote: >>> Ned Batchelder writes: Also, why set headers that prevent the Python-List mailing list from archiving your mes

Re: How to Generate dynamic HTML Report using Python

2017-11-21 Thread Rustom Mody
On Tuesday, November 21, 2017 at 7:06:18 PM UTC+5:30, Rustom Mody wrote: > On Tuesday, November 21, 2017 at 5:27:42 PM UTC+5:30, Ned Batchelder wrote: > > On 11/20/17 9:50 AM, Stefan Ram wrote: > > > Ned Batchelder writes: > > >> Also, why set headers that prevent the Python-List mailing list from

Re: How to Generate dynamic HTML Report using Python

2017-11-21 Thread Rustom Mody
On Tuesday, November 21, 2017 at 5:27:42 PM UTC+5:30, Ned Batchelder wrote: > On 11/20/17 9:50 AM, Stefan Ram wrote: > > Ned Batchelder writes: > >> Also, why set headers that prevent the Python-List mailing list from > >> archiving your messages? > >I am posting to a Usenet newsgroup. I am no

Re: How to Generate dynamic HTML Report using Python

2017-11-21 Thread Ned Batchelder
On 11/20/17 9:50 AM, Stefan Ram wrote: Ned Batchelder writes: Also, why set headers that prevent the Python-List mailing list from archiving your messages? I am posting to a Usenet newsgroup. I am not aware of any "Python-List mailing list". I am posting specifically to the Usenet, b

Re: How to Generate dynamic HTML Report using Python

2017-11-20 Thread Chris Angelico
On Tue, Nov 21, 2017 at 5:47 AM, Michael Torrie wrote: > You also have this header set: >> X-Copyright: (C) Copyright 2017 Stefan Ram. All rights reserved. >> Distribution through any means other than regular usenet >> channels is forbidden. It is forbidden to publish this >> article in the world

Re: How to Generate dynamic HTML Report using Python

2017-11-20 Thread Michael Torrie
Your thoughts on scope are interesting, if unorthodox. There is a problem with your deleting names after use, which is why we rarely delete names. The problem is that deleting a name does not not necessarily or immediately destroy an object. This can lead to great confusion for programmers comin

Re: How to Generate dynamic HTML Report using Python

2017-11-19 Thread Kryptxy via Python-list
I have a piece of code (module) implementing dynamic html page generation. What it simply does is writes all the html content (tags + data) to a file, and the file is save with a (.html) extension. Served my purpose. Not really sure is this is something you are looking for. You can view the

Re: How to Generate dynamic HTML Report using Python

2017-11-19 Thread Ned Batchelder
On 11/19/17 8:40 PM, Stefan Ram wrote: mradul dhakad writes: I am new to python . I am trying to generate Dynamic HTML report using Pyhton based on number of rows selected from query .Do any one can suggest some thing for it. main.py import sqlite3 conn = sqlite3.connect( ':memory:

How to Generate dynamic HTML Report using Python

2017-11-19 Thread mradul dhakad
Hi All , I am new to python . I am trying to generate Dynamic HTML report using Pyhton based on number of rows selected from query .Do any one can suggest some thing for it. Thanks, Mradul -- https://mail.python.org/mailman/listinfo/python-list

Re: Help in creating a dynamic/loop based on variables and CSV files

2016-12-11 Thread Peter Otten
Umar Yusuf wrote: > Hi all, > I need your help with any of these questions? > > 1- > http://stackoverflow.com/questions/41083699/python-create-dynamic-loop-based-on-variables-and-csv You should really make a serious attempt to explain the problem in plain english. Throwing a p

Help in creating a dynamic/loop based on variables and CSV files

2016-12-10 Thread Umar Yusuf
Hi all, I need your help with any of these questions? 1- http://stackoverflow.com/questions/41083699/python-create-dynamic-loop-based-on-variables-and-csv 2- http://stackoverflow.com/questions/41081800/python-pandas-how-to-use-dataframe-cell-to-search-another-dataframe-column-and Thanks in

Re: Dynamic query in mongodb and variable

2016-07-11 Thread Chris Angelico
On Mon, Jul 11, 2016 at 10:52 PM, MG wrote: > Ciao, > I have this function: > > > def lockup_info(refer): > info = [] > amb = CONN.db..find({"reference": refer} > for a in amb: > print a > > > > How can I pass this value { "$exists": False } and tell pyt

Dynamic query in mongodb and variable

2016-07-11 Thread MG
Ciao, I have this function: def lockup_info(refer): info = [] amb = CONN.db..find({"reference": refer} for a in amb: print a How can I pass this value { "$exists": False } and tell python to not consider it as a string? var = '{ "$exists": Fals

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Siyi Deng
Here is a summary of what I did with numpy and the dll I have verified that the values entering the last dll call (dl.cfunction) are identical across platforms. The c function has a signature as follows: int cfunction(int len_data, float* data, int* ac, int num_ac, int flag1, int

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Siyi Deng
The c function has a signature as follows: int cfun(int len_data, float* data, int* a, int num_a, int flag1, int flag2, int flag3, float* param, float* out1, float* out2, float* out3) and in python: import numpy as np import ctypes as ct data = np.atleast_2d(np.float32(data

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Chris Angelico
On Wed, May 25, 2016 at 2:32 AM, Steven D'Aprano wrote: > On Wed, 25 May 2016 02:18 am, Siyi Deng wrote: > >> Hello ChrisA, >> I don't quite understand, the binary shared library contains no python >> interfaces, it should be independent of python. > > In your first post, you said you were using n

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Steven D'Aprano
On Wed, 25 May 2016 02:18 am, Siyi Deng wrote: > Hello ChrisA, > I don't quite understand, the binary shared library contains no python > interfaces, it should be independent of python. In your first post, you said you were using numpy. How is that independent of Python? > As a matter of fact,

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Chris Angelico
On Wed, May 25, 2016 at 2:18 AM, Siyi Deng wrote: > I don't quite understand, the binary shared library contains no python > interfaces, it should be independent of python. As a matter of fact, I have > successfully used it in Conda python 2.7, 3.5, Julialang as well as c++ > executables. I th

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Siyi Deng
Hello ChrisA, I don't quite understand, the binary shared library contains no python interfaces, it should be independent of python. As a matter of fact, I have successfully used it in Conda python 2.7, 3.5, Julialang as well as c++ executables. I think the fact that only stock python 2.7 faile

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Chris Angelico
On Tue, May 24, 2016 at 5:15 PM, Siyi Deng wrote: > Thanks for all the replies. > > It turned out that the Apple OS X stock python 2.7 gives the wrong results, > but other distributions like 2.7 from miniconda gives the correct results. > Facepalm. When you use a binary shared library, it has t

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Siyi Deng
Thanks for all the replies. It turned out that the Apple OS X stock python 2.7 gives the wrong results, but other distributions like 2.7 from miniconda gives the correct results. Facepalm. -- https://mail.python.org/mailman/listinfo/python-list

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-23 Thread Steven D'Aprano
On Monday 23 May 2016 13:15, Siyi Deng wrote: > I have a dynamic library doing some numerical computations. > > I used ctypes to interact it by passing numpy arrays back and forth. > > Python 3.5 gives me the correct results. > > Python 2.7 gives me different, erroneous

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-23 Thread Fabien
On 05/23/2016 05:15 AM, Siyi Deng wrote: I have a dynamic library doing some numerical computations. I used ctypes to interact it by passing numpy arrays back and forth. Python 3.5 gives me the correct results. Python 2.7 gives me different, erroneous results, but it never crashes. How is this

Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-22 Thread Siyi Deng
I have a dynamic library doing some numerical computations. I used ctypes to interact it by passing numpy arrays back and forth. Python 3.5 gives me the correct results. Python 2.7 gives me different, erroneous results, but it never crashes. How is this possible? There is no string

Just-in-Time Static Type Checking for Dynamic Languages

2016-04-20 Thread Neal Becker
I saw this article, which might interest some of you. It discusses application to ruby, but perhaps might have ideas useful for python. https://arxiv.org/abs/1604.03641 -- https://mail.python.org/mailman/listinfo/python-list

Re: Dynamic inputs

2016-04-17 Thread Michael Selik
On Sun, Apr 17, 2016, 7:01 AM durgadevi1 < srirajarajeswaridevikr...@gmail.com> wrote: > On Saturday, April 16, 2016 at 5:31:39 PM UTC+8, Michael Selik wrote: > > On Sat, Apr 16, 2016, 9:41 AM durgadevi1 < > > srirajarajeswaridevikr...@gmail.com> wrote: > > > &

Re: Dynamic inputs

2016-04-17 Thread durgadevi1
On Saturday, April 16, 2016 at 5:31:39 PM UTC+8, Michael Selik wrote: > On Sat, Apr 16, 2016, 9:41 AM durgadevi1 < > srirajarajeswaridevikr...@gmail.com> wrote: > > > what does dynamic inputs mean and how is it implemented in python > > programming? > > > &g

Re: Dynamic inputs

2016-04-16 Thread Terry Reedy
On 4/16/2016 3:35 AM, durgadevi1 wrote: what does dynamic inputs mean and how is it implemented in python programming? 'dynamic input' is new to me. I would take it to mean input that is not available until the program is running. Inputs from people and sensors would qualify.

Re: Dynamic inputs

2016-04-16 Thread Michael Selik
On Sat, Apr 16, 2016, 9:41 AM durgadevi1 < srirajarajeswaridevikr...@gmail.com> wrote: > what does dynamic inputs mean and how is it implemented in python > programming? > In what context did you hear or read the phrase "dynamic inputs"? > -- https://mail.python

Dynamic inputs

2016-04-16 Thread durgadevi1
Hi guys, what does dynamic inputs mean and how is it implemented in python programming? -- https://mail.python.org/mailman/listinfo/python-list

Re: Dynamic object attribute creation

2016-02-29 Thread Ian Kelly
On Mon, Feb 29, 2016 at 9:06 AM, Random832 wrote: > On Mon, Feb 29, 2016, at 10:36, ast wrote: >> but why doesn't it work with built-in classes int, float, list ? >> >> L = [1, 8, 0] >> L.test = 'its a list !' >> >> (however lists are mutable, int, float ... are not) > > Because those classes

Re: Dynamic object attribute creation

2016-02-29 Thread Random832
On Mon, Feb 29, 2016, at 10:36, ast wrote: > but why doesn't it work with built-in classes int, float, list ? > > L = [1, 8, 0] > L.test = 'its a list !' > > (however lists are mutable, int, float ... are not) Because those classes do not have attribute dictionaries, in order to save space.

Dynamic object attribute creation

2016-02-29 Thread ast
Hello Object's attributes can be created dynamically, ie class MyClass: pass obj = MyClass() obj.test = 'foo' but why doesn't it work with built-in classes int, float, list ? L = [1, 8, 0] L.test = 'its a list !' (however lists are mutable, int, float ... are not) Traceback (most rec

  1   2   3   4   5   6   7   8   9   10   >