Re: Symlinks already present

2020-09-03 Thread Greg Ewing
On 2/09/20 6:55 am, Eryk Sun wrote: According to POSIX (st_dev, st_ino), it's the same directory, yet the ".." entry evaluates depending on the path parsing context: >>> os.lstat('test1/spam/..').st_ino == os.lstat('test1').st_ino True >>> os.lstat('test2/spam/..').st_ino == os.ls

Re: Symlinks already present

2020-09-03 Thread Eryk Sun
On 9/3/20, Greg Ewing wrote: > On 2/09/20 6:55 am, Eryk Sun wrote: >> According to POSIX (st_dev, st_ino), it's the same directory, yet the >> ".." entry evaluates depending on the path parsing context: >> >> >>> os.lstat('test1/spam/..').st_ino == os.lstat('test1').st_ino >> True >>

Regex to change multiple lines

2020-09-03 Thread Termoregolato
Hi. I've on file, containing multiple lines, and I need to change every occurrence of a sequence between two chars, in this case "%%". -- original This is the %%text that i must modify%%, on a line, %%but also on the others%% that are following I need to change to -- desidered This is the text

Re: Regex to change multiple lines

2020-09-03 Thread Chris Angelico
On Fri, Sep 4, 2020 at 12:16 AM Termoregolato wrote: > > Hi. I've on file, containing multiple lines, and I need to change every > occurrence of a sequence between two chars, in this case "%%". > > -- original > This is the %%text that i must modify%%, on a line, %%but also > on the others%% that

Re: Regex to change multiple lines

2020-09-03 Thread Tim Chase
On 2020-09-03 16:10, Termoregolato wrote: > -- original > This is the %%text that i must modify%%, on a line, %%but also > on the others%% that are following > > I need to change to > > -- desidered > This is the text that i must modify, on a line, but > also on the others that are following Sho

Re: Regex to change multiple lines

2020-09-03 Thread Tim Chase
Derp, sorry about the noise. I mistook this message for a similar dialog over on the Vim mailing list. For Python, you want re.sub(r"%%(.*?)%%", r"\1", s, flags=re.S) or put the flag inline re.sub(r"(?s)%%(.*?)%%", r"\1", s) -tim On 2020-09-03 09:27, Tim Chase wrote: > On 2020-09-03 16:1

Re: What kind of magic do I need to get python to talk to Excel xlsm file?

2020-09-03 Thread Ian Hill
If you don't need to do any specific data analysis using pandas, try openpyxl. It will read xlsm files and it quite straight forward to use. https://openpyxl.readthedocs.io/en/stable/ pip install openpyxl. Ian -- https://mail.python.org/mailman/listinfo/python-list

Replacement for pygtk?

2020-09-03 Thread Grant Edwards
Many years ago I wrote an app that uses pygtk for it's GUI. I still use the app occasionally, and would like to keep it alive. Emerge informs me that dev-python/pygtk is scheduled for removal. Is pygobject the replacement for pygtk? -- Grant -- https://mail.python.org/mailman/listinfo/python

Pyserial and some half-duplex woes.

2020-09-03 Thread Mark Barton
Hey All, I am using Microchip's Python program to download code to a PIC32 microprocessor via Pyserial. There is also Microchip's bootloader code running on the PIC side. This works very well using the a standard serial hardware directly connected to a USB to serial adapter to one of the PIC

Re: Regex to change multiple lines

2020-09-03 Thread Termoregolato
Il 03/09/20 16:10, Termoregolato wrote: I need to change every occurrence of a sequence between two chars Thanks to all for your replies, it's time to learn regular expressions, but now I've some valid pointers from you. The work I must do here, to explain, is to get some markdown files, an

Re: Replacement for pygtk?

2020-09-03 Thread Grant Edwards
On 2020-09-03, Grant Edwards wrote: > [...] > > Is pygobject the replacement for pygtk? It seems to be. I've started porting my pygtk app, and it's going pretty smoothly. I've already got my two custom widgets working. Oddly, the main module provided by the gobject package is called "gi". --

Re: Regex to change multiple lines

2020-09-03 Thread Chris Angelico
On Fri, Sep 4, 2020 at 5:36 AM Termoregolato wrote: > > Il 03/09/20 16:10, Termoregolato wrote: > > > I need to change every occurrence of a sequence between two chars > > Thanks to all for your replies, it's time to learn regular expressions, > but now I've some valid pointers from you. > > The w

Re: Replacement for pygtk?

2020-09-03 Thread Michael Torrie
On 9/3/20 1:17 PM, Grant Edwards wrote: > On 2020-09-03, Grant Edwards wrote: >> [...] >> >> Is pygobject the replacement for pygtk? > > It seems to be. I've started porting my pygtk app, and it's going > pretty smoothly. I've already got my two custom widgets working. > Oddly, the main module

Re: Threading plus multiprocessing plus cv2 error

2020-09-03 Thread Python
On Sat, Aug 29, 2020 at 06:24:10PM +1000, John O'Hagan wrote: > Dear list > > Thanks to this list, I haven't needed to ask a question for > a very long time, but this one has me stumped. > > Here's the minimal 3.8 code, on Debian testing: > > - > from multiprocessing import Process > from th

compile error building building Python-3.8.5 on Debian 8.11 (yes, old!)

2020-09-03 Thread Cameron Simpson
I've built 3.8.5 on a few other machines happily recently. Building Python 3.8.5, running make and gcc (Debian 4.9.2-10+deb8u2) 4.9.2 I get this: % gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -

Re: compile error building building Python-3.8.5 on Debian 8.11 (yes, old!)

2020-09-03 Thread Chris Angelico
On Fri, Sep 4, 2020 at 3:01 PM Cameron Simpson wrote: > > I've built 3.8.5 on a few other machines happily recently. > > Building Python 3.8.5, running make and gcc (Debian 4.9.2-10+deb8u2) > 4.9.2 I get this: > > % gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv > -O3 -