Re: Issues regarding running of application.

2020-05-27 Thread Barry Scott
> On 26 May 2020, at 15:45, Meet Agrawal wrote: > > I have tried and installed the python application a lot of times but after > the installation get completed and I try to run the application, it say > that api-ms-win-crt-runtime-l1-1-0.dll is missing from your computer. That DLL is part of

Re: Behaviour of os.path.join

2020-05-27 Thread Barry Scott
> On 26 May 2020, at 17:46, MRAB wrote: > > On 2020-05-26 16:48, BlindAnagram wrote: >> On 26/05/2020 16:22, Ben Bacarisse wrote: >>> BlindAnagram writes: I came across an issue that I am wondering whether I should report as an issue. If I have a directory, say: base='C

Re: Issues regarding running of application.

2020-05-27 Thread Souvik Dutta
Do have the latest version of DirectX installed? If not then do that or you can google out the dll file you need (or is missing) and download it and cut - paste it wherever needed. Missing dll files is a very common issue in windows and thus Microsoft made DirectX. On Tue, 26 May, 2020, 11:14 pm M

Re: Behaviour of os.path.join

2020-05-27 Thread Barry Scott
> On 26 May 2020, at 18:01, BlindAnagram wrote: > > On 26/05/2020 17:09, Stefan Ram wrote: >> Mats Wichmann writes: >>> an absolute path is one that starts with the pathname separator. >> >> The Python Library Reference does not use the term >> "pathname separator". It uses "directory sepa

Re: Behaviour of os.path.join

2020-05-27 Thread Chris Angelico
On Wed, May 27, 2020 at 6:50 PM Barry Scott wrote: > > > > > On 26 May 2020, at 18:01, BlindAnagram wrote: > > > > On 26/05/2020 17:09, Stefan Ram wrote: > >> Mats Wichmann writes: > >>> an absolute path is one that starts with the pathname separator. > >> > >> The Python Library Reference does

Re: Behaviour of os.path.join

2020-05-27 Thread BlindAnagram
On 27/05/2020 09:13, Barry Scott wrote: > > >> On 26 May 2020, at 18:01, BlindAnagram wrote: >> >> On 26/05/2020 17:09, Stefan Ram wrote: >>> Mats Wichmann writes: an absolute path is one that starts with the pathname separator. >>> >>> The Python Library Reference does not use the term >

Re: Behaviour of os.path.join

2020-05-27 Thread Ben Bacarisse
BlindAnagram writes: > The issue that I raised here was whether the behaviour of os.path.join() > in treating the Windows directory separator '\\' as an absolute path > should be considered a bug. You think it should be considered to be a relative path? The only meaning that would give you want

Re: Behaviour of os.path.join

2020-05-27 Thread BlindAnagram
On 27/05/2020 13:30, Ben Bacarisse wrote: > BlindAnagram writes: > >> The issue that I raised here was whether the behaviour of os.path.join() >> in treating the Windows directory separator '\\' as an absolute path >> should be considered a bug. > > You think it should be considered to be a rela

Re: Behaviour of os.path.join

2020-05-27 Thread Rhodri James
On 27/05/2020 14:41, BlindAnagram wrote: That is true if you know for sure how your path will be used. But if you don't, there is a world of difference between passing the paths 'name' and 'name\\' on for others to use. And in this situation it doesn't help when os.path functions strip the direc

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

2020-05-27 Thread BBT
I am trying to parse a word (.docx) for tables, then copy these tables over to excel using xlsxwriter. This is my code: from docx.api import Document import xlsxwriter document = Document('/Users/xxx/Documents/xxx/Clauses Sample - Copy v1 - for merge.docx') tables = document.tables wb = xlsx

Re: Behaviour of os.path.join

2020-05-27 Thread BlindAnagram
On 27/05/2020 14:53, Rhodri James wrote: > On 27/05/2020 14:41, BlindAnagram wrote: >> That is true if you know for sure how your path will be used. >> >> But if you don't, there is a world of difference between passing the >> paths 'name' and 'name\\' on for others to use. And in this situation it

Re: Behaviour of os.path.join

2020-05-27 Thread Rhodri James
On 27/05/2020 16:12, BlindAnagram wrote: I'm sorry that you don't believe me but all I know is how I intend the path to be used. And the os.path functions aren't helpful here when they actually_change_ the meanings of paths on Windows: fp= "C:\\Documents\finance\\" abspath(fp) 'C:\\Documents

Re: Behaviour of os.path.join

2020-05-27 Thread Ben Bacarisse
BlindAnagram writes: > On 27/05/2020 13:30, Ben Bacarisse wrote: >> BlindAnagram writes: >> >>> The issue that I raised here was whether the behaviour of os.path.join() >>> in treating the Windows directory separator '\\' as an absolute path >>> should be considered a bug. >> >> You think it s

Re: Behaviour of os.path.join

2020-05-27 Thread BlindAnagram
On 27/05/2020 16:49, Rhodri James wrote: > On 27/05/2020 16:12, BlindAnagram wrote: >> I'm sorry that you don't believe me but all I know is how I intend the >> path to be used.  And the os.path functions aren't helpful here when >> they actually_change_  the meanings of paths on Windows: >> f

Re: Behaviour of os.path.join

2020-05-27 Thread BlindAnagram
On 27/05/2020 16:53, Ben Bacarisse wrote: > BlindAnagram writes: > >> On 27/05/2020 13:30, Ben Bacarisse wrote: >>> BlindAnagram writes: >>> The issue that I raised here was whether the behaviour of os.path.join() in treating the Windows directory separator '\\' as an absolute path >>>

Re: Behaviour of os.path.join

2020-05-27 Thread Rhodri James
On 27/05/2020 17:39, BlindAnagram wrote: I believe by attempting to make the directory I send absolute with abspath() and then copying a file to this path. They expected this to copy the file into the directory with its original name but instead it copies it to the file that abspath 'kindly' con

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

2020-05-27 Thread Peter Otten
BBT wrote: > I am trying to parse a word (.docx) for tables, then copy these tables > over to excel using xlsxwriter. This is my code: > > from docx.api import Document > import xlsxwriter > > document = Document('/Users/xxx/Documents/xxx/Clauses Sample - Copy v1 - > for merge.docx') tables = d

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

2020-05-27 Thread BBT
On Thursday, 28 May 2020 01:36:26 UTC+8, Peter Otten wrote: > BBT wrote: > > > I am trying to parse a word (.docx) for tables, then copy these tables > > over to excel using xlsxwriter. This is my code: > > > > from docx.api import Document > > import xlsxwriter > > > > document = Document('/U

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

2020-05-27 Thread Peter Otten
BBT wrote: > On Thursday, 28 May 2020 01:36:26 UTC+8, Peter Otten wrote: >> BBT wrote: >> >> > I am trying to parse a word (.docx) for tables, then copy these tables >> > over to excel using xlsxwriter. This is my code: >> > >> > from docx.api import Document >> > import xlsxwriter >> > >> >

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

2020-05-27 Thread BBT
On Thursday, 28 May 2020 02:40:49 UTC+8, Peter Otten wrote: > BBT wrote: > > > On Thursday, 28 May 2020 01:36:26 UTC+8, Peter Otten wrote: > >> BBT wrote: > >> > >> > I am trying to parse a word (.docx) for tables, then copy these tables > >> > over to excel using xlsxwriter. This is my code: >

Re: Behaviour of os.path.join

2020-05-27 Thread Beverly Pope
I wasn’t going to say anything because I haven’t used MS Windows for years. The OP wants to add a path separator at the end of a path. Why the OP wants to do that doesn’t concern me. OTOH, as others have already mentioned, the documentation explicitly says, "If a component is an absolute path

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

2020-05-27 Thread BBT
On Thursday, 28 May 2020 02:40:49 UTC+8, Peter Otten wrote: > BBT wrote: > > > On Thursday, 28 May 2020 01:36:26 UTC+8, Peter Otten wrote: > >> BBT wrote: > >> > >> > I am trying to parse a word (.docx) for tables, then copy these tables > >> > over to excel using xlsxwriter. This is my code: >

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

2020-05-27 Thread Peter Otten
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. Here is the suggested script spelt out: import xlsxwriter from docx.api i

Access an object to which being bound

2020-05-27 Thread Abdur-Rahmaan Janhangeer
Greetings, Lets say i have class A: ... class B: self.x = A then used b = B() z = b.x() now how in A i get a reference to B when z is assigned to b.x? Thanks Kind Regards, Abdur-Rahmaan Janhangeer compileralchemy | blog

Re: Managing plug-ins

2020-05-27 Thread George Fischhof
DL Neil via Python-list ezt írta (időpont: 2020. máj. 26., K, 3:10): > On 26/05/20 11:35 AM, Benjamin Schollnick wrote: > > Did you ever find anything that met your requirements? > > > > If not, I have a prototype that I need to build out some more… > > > > https://github.com/bschollnick/PyPlugIn

Re: Phyton 32 or 64 bit?

2020-05-27 Thread Bischoop
On 2020-05-26, Alex Kaye wrote: > To all: > > The only stupid question is one that wasn't asked ! > > Alex > Well, visit FB and you'll change your mind. -- https://mail.python.org/mailman/listinfo/python-list

Re: Behaviour of os.path.join

2020-05-27 Thread Andrew Jaffe
Dear all, \On 26/05/2020 15:56, BlindAnagram wrote: I came across an issue that I am wondering whether I should report as an issue. If I have a directory, say: base='C:\\Documents' and I use os.path.join() as follows: join(base, '..\\..\\', 'build', '') I obtain as expected from the d

Re: Behaviour of os.path.join

2020-05-27 Thread Roel Schroeven
BlindAnagram schreef op 27/05/2020 om 18:39: On 27/05/2020 16:49, Rhodri James wrote: On 27/05/2020 16:12, BlindAnagram wrote: I'm sorry that you don't believe me but all I know is how I intend the path to be used.  And the os.path functions aren't helpful here when they actually_change_  the m

Re: Behaviour of os.path.join

2020-05-27 Thread Roel Schroeven
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 the first time I see any mention of those semantics, and I've been using Windows since the Windows 3.1 days (and MS-DOS before that, since 3.2 IIRC).

Re: Behaviour of os.path.join

2020-05-27 Thread Roel Schroeven
Ben Bacarisse schreef op 27/05/2020 om 17:53: There is well-known (*nix) software that relies on a/b/c/ meaning something different to a/b/c but I don't know anyone who thinks this is a good idea. It causes no end of confusion. rsync? I always have to look up whether or not I need to use a tra

Re: Access an object to which being bound

2020-05-27 Thread Chris Angelico
On Thu, May 28, 2020 at 5:48 AM Abdur-Rahmaan Janhangeer wrote: > > Greetings, > > Lets say i have > > class A: > ... > > class B: >self.x = A > > then used > > b = B() > z = b.x() > > now how in A i get a reference to B when z is assigned to b.x? > Things are very tangled here. What exactl

Re: Behaviour of os.path.join

2020-05-27 Thread Ben Bacarisse
BlindAnagram writes: > On 27/05/2020 16:53, Ben Bacarisse wrote: >> As it should. Relying on a trailing \ having the right effect is >> brittle to say the least. > > In my case less brittle than leaving it out. Brittle does not mean broken. I know you can fix it by making sure the trailing \

Re: Behaviour of os.path.join

2020-05-27 Thread Chris Angelico
On Thu, May 28, 2020 at 6:14 AM Roel Schroeven wrote: > > Ben Bacarisse schreef op 27/05/2020 om 17:53: > > There is well-known (*nix) software that relies on a/b/c/ meaning > > something different to a/b/c but I don't know anyone who thinks this is > > a good idea. It causes no end of confusion.

Re: Access an object to which being bound

2020-05-27 Thread Abdur-Rahmaan Janhangeer
Thanks, Actually i want to keep a reference from B to all A instantiated like in the case of z I have class A and i want to call class B via A You can have def x(self, *args, **kwargs): return A(*args, **kwargs) but was wondering if we could keep track while doing it via z = ... Kind Rega

Re: Access an object to which being bound

2020-05-27 Thread Abdur-Rahmaan Janhangeer
i have this: https://github.com/Abdur-rahmaanJ/hooman/blob/master/hooman/hooman.py someone PRed a Button class i want the class button to be available to the class Hooman via Human.button self.button = Button but button has update() which must be called individually one way to update all butto

Re: Access an object to which being bound

2020-05-27 Thread Chris Angelico
On Thu, May 28, 2020 at 6:27 AM Abdur-Rahmaan Janhangeer wrote: > > Thanks, > > Actually i want to keep a reference from B to all A > instantiated like in the case of z > > I have class A and i want to call class B via A > > You can have > > def x(self, *args, **kwargs): > return A(*args, **kw

Re: Access an object to which being bound

2020-05-27 Thread Abdur-Rahmaan Janhangeer
Hum yes a third class is a nice option! btw managed to do it with those in Hooman self._all_widgets = [] def button(self, *args, **kwargs): b = Button(*args, **kwargs) self._all_widgets.append(b) return b def update_all(self): for widget in self._all_

Re: Behaviour of os.path.join

2020-05-27 Thread Ben Bacarisse
Roel Schroeven writes: > Ben Bacarisse schreef op 27/05/2020 om 17:53: >> There is well-known (*nix) software that relies on a/b/c/ meaning >> something different to a/b/c but I don't know anyone who thinks this is >> a good idea. It causes no end of confusion. > > rsync? I always have to look u

Re: Behaviour of os.path.join

2020-05-27 Thread BlindAnagram
On 27/05/2020 18:37, Roel Schroeven wrote: > BlindAnagram schreef op 27/05/2020 om 18:39: >> On 27/05/2020 16:49, Rhodri James wrote: >>> On 27/05/2020 16:12, BlindAnagram wrote: I'm sorry that you don't believe me but all I know is how I intend the path to be used.  And the os.path func

Re: Behaviour of os.path.join

2020-05-27 Thread BlindAnagram
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 the first time I see any mention of those semantics, and I've > been using Windows since the Windows

Re: Behaviour of os.path.join

2020-05-27 Thread DL Neil via Python-list
... Again, a pathname is never inherently a directory or a file. See previous contribution: until YOU define YOUR arena of operations, it will be difficult to select the correct tool or library - or for others to assist you. If dealing with strings (which happen to look as if they are fil

Re: Issues regarding running of application.

2020-05-27 Thread Barry
> On 27 May 2020, at 09:44, Souvik Dutta wrote: > > Do have the latest version of DirectX installed? If not then do that or you > can google out the dll file you need (or is missing) and download it and > cut - paste it wherever needed. Missing dll files is a very common issue in > windows and

Re: Access an object to which being bound

2020-05-27 Thread DL Neil via Python-list
@AR, On 28/05/20 8:41 AM, Chris Angelico wrote: On Thu, May 28, 2020 at 6:27 AM Abdur-Rahmaan Janhangeer wrote: Thanks, Actually i want to keep a reference from B to all A instantiated like in the case of z I have class A and i want to call class B via A You can have def x(self, *args, *

Re: Behaviour of os.path.join

2020-05-27 Thread Roel Schroeven
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 the first time I see any mention of those semantics, and I've b

Re: Behaviour of os.path.join

2020-05-27 Thread Chris Angelico
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. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Elegant hack or gross hack? TextWrapper and escape codes

2020-05-27 Thread Chris Angelico
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( initial_indent=label, subseque

Re: Access an object to which being bound

2020-05-27 Thread Abdur-Rahmaan Janhangeer
Greetings, .append(self) is a hit idea Updated the project with the button demo https://github.com/Abdur-rahmaanJ/hooman/ Next i will be attempting to add a grid system. I feel myself developing tkinter from scratch Thanks for the help everybody ^^_ Kind Regards, Abdur-Rahmaan Janhangeer comp

Re: Custom logging function

2020-05-27 Thread zljubisic
> 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? import logging LOG_LEVEL = logging.getLevelName('DEBUG')

Ram memory not freed after executing python script on ubuntu system

2020-05-27 Thread Rahul Gupta
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 nothing is running on the system. I have go

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

2020-05-27 Thread Chris Angelico
On Thu, May 28, 2020 at 3:51 PM 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 occupi