Re: Write tables from Word (.docx) to Excel (.xlsx) using xlsxwriter

2020-05-28 Thread BBT
On Thursday, 28 May 2020 03:07:48 UTC+8, Peter Otten wrote: > BBT wrote: > > > I tried your code by replacing the Document portion: > > > But I received an error: > > TypeError: __init__() takes 1 positional argument but 2 were given > > We seem to have different ideas of what replacing means.

Re: Ram memory not freed after executing python script on ubuntu system (rmlibre)

2020-05-28 Thread Inada Naoki
pymalloc manages only small blocks of memory. Large (more than 512 byte) memory blocks are managed by malloc/free. glibc malloc doesn't return much freed memory to OS. You can try jemalloc instead of glibc. On Ubuntu 20.04, you can try it by: LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so

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

2020-05-28 Thread Chris Angelico
On Fri, May 29, 2020 at 3:15 PM Mike Dewhirst wrote: > > On 29/05/2020 12:26 pm, Chris Angelico wrote: > > On Fri, May 29, 2020 at 11:57 AM Mike Dewhirst > > wrote: > >> I am an example > >> > >> I installed all the Pythons on my Windows 10 dev machine (locked into > >> Windows by having clients

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

2020-05-28 Thread Mike Dewhirst
On 29/05/2020 2:59 pm, Dieter Maurer wrote: Mike Dewhirst wrote at 2020-5-29 11:55 +1000: On 29/05/2020 10:51 am, Terry Reedy wrote: ... Source only releases only block Windows/Mac users who choose not to upgrade to a released installer and who cannot or choose not to compile. I am an example

Re: Ram memory not freed after executing python script on ubuntu system (rmlibre)

2020-05-28 Thread Dieter Maurer
rmli...@riseup.net wrote at 2020-5-28 18:56 -0700: >We just ran into this problem when running our aiootp package's memory >hard password hashing function (https://github.com/rmlibre/aiootp/). The >memory was not being cleared after the function finished running but the >script was still live. I h

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

2020-05-28 Thread Mike Dewhirst
On 29/05/2020 12:26 pm, Chris Angelico wrote: On Fri, May 29, 2020 at 11:57 AM Mike Dewhirst wrote: I am an example I installed all the Pythons on my Windows 10 dev machine (locked into Windows by having clients) but I'm also locked into Python 3.6.9 on my Ubuntu 18.04 production machines. Be

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

2020-05-28 Thread Dieter Maurer
Mike Dewhirst wrote at 2020-5-29 11:55 +1000: >On 29/05/2020 10:51 am, Terry Reedy wrote: > ... >> Source only releases only block Windows/Mac users who choose not to >> upgrade to a released installer and who cannot or choose not to compile. > >I am an example > >I installed all the Pythons on my

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

2020-05-28 Thread Chris Angelico
On Fri, May 29, 2020 at 1:46 PM Adam Preble wrote: > I'm now concerned about how long we have with 3.6 because people clearly > want us to move on even beyond that. I look online and the official support > window for it ends at the end of next year, but it looks like the real > support window for

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

2020-05-28 Thread Adam Preble
On Thursday, May 28, 2020 at 7:57:04 PM UTC-5, Terry Reedy wrote: > The OP is so far choosing to not use an installer with those fixes. By > not doing so, he is missing out on the maybe 2000 non-security fixes and > some enhancements that likely would benefit him more than maybe 50 > mostly obs

Re: Ram memory not freed after executing python script on ubuntu system (rmlibre)

2020-05-28 Thread Chris Angelico
On Fri, May 29, 2020 at 12:08 PM wrote: > > > We just ran into this problem when running our aiootp package's memory > hard password hashing function (https://github.com/rmlibre/aiootp/). Have you considered implementing that module in something else? Try Cythonizing it and see if suddenly your m

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

2020-05-28 Thread Chris Angelico
On Fri, May 29, 2020 at 11:57 AM Mike Dewhirst wrote: > > I am an example > > I installed all the Pythons on my Windows 10 dev machine (locked into > Windows by having clients) but I'm also locked into Python 3.6.9 on my > Ubuntu 18.04 production machines. Be careful of assuming too much here. Th

Re: Ram memory not freed after executing python script on ubuntu system (rmlibre)

2020-05-28 Thread rmlibre
We just ran into this problem when running our aiootp package's memory hard password hashing function (https://github.com/rmlibre/aiootp/). The memory was not being cleared after the function finished running but the script was still live. We tried making sure everything went out of scope and del

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

2020-05-28 Thread Mike Dewhirst
On 29/05/2020 10:51 am, Terry Reedy wrote: On 5/28/2020 5:20 PM, Peter J. Holzer wrote: On 2020-05-23 13:22:26 -0600, Mats Wichmann wrote: On 5/23/20 12:23 AM, Adam Preble wrote: I wanted to update from 3.6.8 on Windows without necessarily moving on to 3.7+ (yet), so I thought I'd try 3.6.9 or

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

2020-05-28 Thread Terry Reedy
On 5/28/2020 5:20 PM, Peter J. Holzer wrote: On 2020-05-23 13:22:26 -0600, Mats Wichmann wrote: On 5/23/20 12:23 AM, Adam Preble wrote: I wanted to update from 3.6.8 on Windows without necessarily moving on to 3.7+ (yet), so I thought I'd try 3.6.9 or 3.6.10. All I see for both are source arch

Re: Behaviour of os.path.join

2020-05-28 Thread Eryk Sun
On 5/28/20, Roel Schroeven wrote: > Eryk Sun schreef op 28/05/2020 om 15:51: >> On 5/27/20, Chris Angelico wrote: >>> On Thu, May 28, 2020 at 7:07 AM BlindAnagram >>> wrote: You can define a path however you want but it won't change the fact that on Windows a path that ends in '\\' is

Re: why no camelCase in PEP 8?

2020-05-28 Thread Terry Reedy
On 5/28/2020 4:18 PM, Peter J. Holzer wrote: On 2020-05-19 05:59:30 +1000, Chris Angelico wrote: PEP 8 is a style guide for the Python standard library. It is the rules you must comply with if you are submitting a patch *to Python itself*. Nobody ever requires you to comply with it for any other

Re: Behaviour of os.path.join

2020-05-28 Thread MRAB
On 2020-05-28 22:34, Terry Reedy wrote: On 5/28/2020 9:19 AM, Eryk Sun wrote: On 5/26/20, BlindAnagram wrote: But if I try to make the directory myself (as I tried first): join(base, '..\\..\\', 'build', '\\') I obtain: 'C:\\' The documentation says that an absolute path in the paramet

Re: why no camelCase in PEP 8?

2020-05-28 Thread Peter J. Holzer
On 2020-05-29 06:27:31 +1000, Chris Angelico wrote: > On Fri, May 29, 2020 at 6:20 AM Peter J. Holzer wrote: > > On 2020-05-19 05:59:30 +1000, Chris Angelico wrote: > > > PEP 8 is a style guide for the Python standard library. It is the > > > rules you must comply with if you are submitting a patc

Re: Constructing mime image attachment

2020-05-28 Thread DL Neil via Python-list
On 28/05/20 11:48 PM, Joseph L. Casale wrote: I have some json encoded input for nodemailer (https://nodemailer.com/message/embedded-images) where the path key is a string value which contains the base64 encoded data such as: { html: 'Embedded image: ', attachments: [{ filen

Re: Ram memory not freed after executing python script on ubuntu system

2020-05-28 Thread Peter J. Holzer
On 2020-05-27 22:49:53 -0700, Rahul Gupta wrote: > I am having a Ubuntu system which has 125 Gb of RAM. I executed few > python scripts on that system. Those scripts uses numpy arrays and > pandas. Now execution was over but still 50 gb of RAM and 2 Gb cache > and 8.4 Gb of swap is occupied. At thi

Re: Behaviour of os.path.join

2020-05-28 Thread Roel Schroeven
BlindAnagram schreef op 28/05/2020 om 11:00: On 27/05/2020 23:39, Roel Schroeven wrote: I find no hints of adding a backslash at the end to indicate directories. If you can point me to convincing evidence in the documentation I'll change my mind. And if you find a counterexample, I will change

Re: Behaviour of os.path.join

2020-05-28 Thread Roel Schroeven
Eryk Sun schreef op 28/05/2020 om 15:51: On 5/27/20, Chris Angelico wrote: On Thu, May 28, 2020 at 7:07 AM BlindAnagram wrote: You can define a path however you want but it won't change the fact that on Windows a path that ends in '\\' is inherently a path to a directory. Citation needed.

Re: Behaviour of os.path.join

2020-05-28 Thread Terry Reedy
On 5/28/2020 9:19 AM, Eryk Sun wrote: On 5/26/20, BlindAnagram wrote: But if I try to make the directory myself (as I tried first): join(base, '..\\..\\', 'build', '\\') I obtain: 'C:\\' The documentation says that an absolute path in the parameter list for join will discard all previou

Re: why no camelCase in PEP 8?

2020-05-28 Thread Roel Schroeven
Peter J. Holzer schreef op 28/05/2020 om 22:09: On 2020-05-19 09:53:01 +0100, Rhodri James wrote: On 18/05/2020 22:07, Eli the Bearded wrote: camelCase ->noCamelCase snake_case ->no_snake_case One of those is easier to "grep" for than the other. Eh. A chan

Re: Behaviour of os.path.join

2020-05-28 Thread Grant Edwards
On 2020-05-27, Roel Schroeven wrote: > I find no hints of adding a backslash at the end to indicate directories. I suspect that, like Unix, that's not an OS/filesystem thing but merely a convention used by some user space applications to allow the user to provide an additional hint as to his int

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

2020-05-28 Thread Peter J. Holzer
On 2020-05-23 13:22:26 -0600, Mats Wichmann wrote: > On 5/23/20 12:23 AM, Adam Preble wrote: > > I wanted to update from 3.6.8 on Windows without necessarily moving > > on to 3.7+ (yet), so I thought I'd try 3.6.9 or 3.6.10. > > > > All I see for both are source archives: [...] > > During the ea

Re: creating a table within python code

2020-05-28 Thread Peter J. Holzer
On 2020-05-22 10:22:40 -0400, Buddy Peacock wrote: > Thank you Souvik, but still having issues. I have pasted the command line > interaction this time. My prior message is what appeared in the browser. > =

Re: Ram memory not freed after executing python script on ubuntu system

2020-05-28 Thread Sam
On 5/28/20 12:49 AM, Rahul Gupta wrote: I am having a Ubuntu system which has 125 Gb of RAM. I executed few python scripts on that system. Those scripts uses numpy arrays and pandas. Now execution was over but still 50 gb of RAM and 2 Gb cache and 8.4 Gb of swap is occupied. At this moment no

Re: why no camelCase in PEP 8?

2020-05-28 Thread Chris Angelico
On Fri, May 29, 2020 at 6:20 AM Peter J. Holzer wrote: > > On 2020-05-19 05:59:30 +1000, Chris Angelico wrote: > > PEP 8 is a style guide for the Python standard library. It is the > > rules you must comply with if you are submitting a patch *to Python > > itself*. Nobody ever requires you to comp

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Buddy Peacock
Yes, after commenting out all flask related lines and then running the print, I do see all the authors. Al (Buddy) Peacock, PMP, MCCT, ITILv3, SMC, CSM, SPOC (920) 740-3411 linkedin.com/in/buddypeacock On Thu, May 28, 2020 at 3:48 PM Abdur-Rahmaan J

Re: why no camelCase in PEP 8?

2020-05-28 Thread Peter J. Holzer
On 2020-05-19 05:59:30 +1000, Chris Angelico wrote: > PEP 8 is a style guide for the Python standard library. It is the > rules you must comply with if you are submitting a patch *to Python > itself*. Nobody ever requires you to comply with it for any other > code. That's obviously not true: Many

Re: why no camelCase in PEP 8?

2020-05-28 Thread Peter J. Holzer
On 2020-05-19 09:53:01 +0100, Rhodri James wrote: > On 18/05/2020 22:07, Eli the Bearded wrote: > > camelCase -> noCamelCase > > snake_case -> no_snake_case > > > > One of those is easier to "grep" for than the other. > > Eh. A changed case in the one, an extra cha

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Abdur-Rahmaan Janhangeer
You tried for isbn, title, author, year in reader: without flask, do you actually see a value for author? Like using a normal print Kind Regards, Abdur-Rahmaan Janhangeer https://www.github.com/Abdur-RahmaanJ Mauritius sent from gmail client on Android, that's why the signature is so ugl

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Rich Shepard
On Thu, 28 May 2020, Buddy Peacock wrote: I'm not sure what you mean by models? Am I missing something in my environment perhaps? The model (or models if you prefer) define the sqlalchemy classes that reflect the structure and content of the postgrep table(s). I put all classes (for all data

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Buddy Peacock
Thanks for your response Abdur-Rahmaan, The tables already exist and I have tried both "name = author" and "name = :author" Regards, Al (Buddy) Peacock, PMP, MCCT, ITILv3, SMC, CSM, SPOC (920) 740-3411 linkedin.com/in/buddypeacock On Thu, May 28,

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Peter Otten
Buddy Peacock wrote: > Hello group, > I have a pretty good background in MySQL & MSSQL as well as VB & Php, but > I am new to Python and Postgresql. > > I am taking a class and working on a project to insert authors and books > into a table. My code for this is: > ===

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Abdur-Rahmaan Janhangeer
Well, See for isbn, title, author, year in reader: if db.execute("SELECT * FROM authors WHERE name = :author", {"name": author}).rowcount == 0: db.execute("INSERT INTO authors (name) VALUES (author)") but i don't see any code for creating the authors table also did you mean

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Buddy Peacock
I'm not sure what you mean by models? Am I missing something in my environment perhaps? Al (Buddy) Peacock, PMP, MCCT, ITILv3, SMC, CSM, SPOC (920) 740-3411 linkedin.com/in/buddypeacock On Thu, May 28, 2020 at 2:26 PM Abdur-Rahmaan Janhangeer < arj

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Abdur-Rahmaan Janhangeer
Greetings, where did you define your models? Kind Regards, Abdur-Rahmaan Janhangeer https://www.github.com/Abdur-RahmaanJ Mauritius sent from gmail client on Android, that's why the signature is so ugly. On Thu, 28 May 2020, 22:22 Buddy Peacock, wrote: > Hello group, > I have a pretty go

SQLAlchemy & Postgresql

2020-05-28 Thread Buddy Peacock
Hello group, I have a pretty good background in MySQL & MSSQL as well as VB & Php, but I am new to Python and Postgresql. I am taking a class and working on a project to insert authors and books into a table. My code for this is: === imp

Re: Behaviour of os.path.join

2020-05-28 Thread BlindAnagram
On 27/05/2020 23:39, Roel Schroeven wrote: > I find no hints of adding a backslash at the end to indicate directories. > > If you can point me to convincing evidence in the documentation I'll > change my mind. See the post from Eryk Sun, later in this thread. -- https://mail.python.org/mailman/

Re: Behaviour of os.path.join

2020-05-28 Thread Eryk Sun
On 5/28/20, BlindAnagram wrote: > > Thank you for making the effort to answer a number of issues raaised in > this thread. I much appreciate your input. For a more practical POV, see the topic on "File System Navigation" [1] for the C++ standard API. In the C++ standard library, trailing slashe

Re: Behaviour of os.path.join

2020-05-28 Thread BlindAnagram
On 28/05/2020 14:51, Eryk Sun wrote: > On 5/27/20, Chris Angelico wrote: >> On Thu, May 28, 2020 at 7:07 AM BlindAnagram >> wrote: >>> You can define a path however you want but it won't change the fact that >>> on Windows a path that ends in '\\' is inherently a path to a directory. >> >> Citati

Re: Behaviour of os.path.join

2020-05-28 Thread Eryk Sun
On 5/27/20, Chris Angelico wrote: > On Thu, May 28, 2020 at 7:07 AM BlindAnagram > wrote: >> You can define a path however you want but it won't change the fact that >> on Windows a path that ends in '\\' is inherently a path to a directory. > > Citation needed. See [MS-FSA] 2.1.5.1 Server Reque

Re: Behaviour of os.path.join

2020-05-28 Thread Eryk Sun
On 5/26/20, BlindAnagram wrote: > > But if I try to make the directory myself (as I tried first): > > join(base, '..\\..\\', 'build', '\\') > > I obtain: > > 'C:\\' > > The documentation says that an absolute path in the parameter list for > join will discard all previous parameters but '\\' is

Constructing mime image attachment

2020-05-28 Thread Joseph L. Casale
I have some json encoded input for nodemailer (https://nodemailer.com/message/embedded-images) where the path key is a string value which contains the base64 encoded data such as: { html: 'Embedded image: ', attachments: [{ filename: 'image.png', path: 'data:image/png;bas

Re: Behaviour of os.path.join

2020-05-28 Thread BlindAnagram
On 27/05/2020 23:39, Roel Schroeven wrote: > BlindAnagram schreef op 27/05/2020 om 22:55: >> On 27/05/2020 18:42, Roel Schroeven wrote: >>> BlindAnagram schreef op 27/05/2020 om 18:53: Its not my bug to fix - the semantics of what I send is very clear on any Windows system. >>> >>> That's

Re: Ram memory not freed after executing python script on ubuntu system

2020-05-28 Thread Chris Angelico
On Thu, May 28, 2020 at 6:26 PM Rahul Gupta wrote: > > On Thursday, May 28, 2020 at 11:20:05 AM UTC+5:30, Rahul Gupta wrote: > > I am having a Ubuntu system which has 125 Gb of RAM. I executed few python > > scripts on that system. Those scripts uses numpy arrays and pandas. Now > > execution wa

Re: Ram memory not freed after executing python script on ubuntu system

2020-05-28 Thread Rahul Gupta
On Thursday, May 28, 2020 at 11:20:05 AM UTC+5:30, Rahul Gupta wrote: > I am having a Ubuntu system which has 125 Gb of RAM. I executed few python > scripts on that system. Those scripts uses numpy arrays and pandas. Now > execution was over but still 50 gb of RAM and 2 Gb cache and 8.4 Gb of swa

Re: Elegant hack or gross hack? TextWrapper and escape codes

2020-05-28 Thread Peter Otten
Chris Angelico wrote: > On Thu, May 28, 2020 at 5:54 PM Peter Otten <__pete...@web.de> wrote: >> But at least now you have two -- elegant or gross -- hacks to choose from >> ;) >> > > Yeah, I thought of this originally as a challenge in redefining the > concept of "length". But the trouble is th

Re: Elegant hack or gross hack? TextWrapper and escape codes

2020-05-28 Thread Chris Angelico
On Thu, May 28, 2020 at 5:54 PM Peter Otten <__pete...@web.de> wrote: > > Chris Angelico wrote: > > > Situation: A terminal application. Requirement: Display nicely-wrapped > > text. With colour codes in it. And that text might be indented to any > > depth. > > > > label = f"{indent}\U0010cc32{code

Re: Elegant hack or gross hack? TextWrapper and escape codes

2020-05-28 Thread Peter Otten
Chris Angelico wrote: > Situation: A terminal application. Requirement: Display nicely-wrapped > text. With colour codes in it. And that text might be indented to any > depth. > > label = f"{indent}\U0010cc32{code}\U0010cc00 > @{tweet['user']['screen_name']}: " wrapper = textwrap.TextWrapper( >

Re: Custom logging function

2020-05-28 Thread Peter Otten
zljubi...@gmail.com wrote: >> You create two stream handlers that both log to stderr -- one with >> basicConfig() and one explicitly in your code. That's probably not what >> you want. > > How can I just add terminator = '\r\n' to the code bellow? > Where should I put it? I already answered that