_pydoc.css

2020-10-25 Thread Ian Gay
The default colors of pydoc are truly horrendous! Has anyone written a
_pydoc.css file to produce something reasonable?

(running 3.6 on OpenSuse 15.1)

Ian

-- 
*** To reply by e-mail, make w single in address **
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a log file that tracks every statement that is being executed when a program is running?

2020-10-25 Thread Mladen Gogala via Python-list
On Sun, 25 Oct 2020 12:14:52 +0100, Maxime S wrote:

> Hi,
> 
> You can use the trace module for that:
> https://docs.python.org/3.8/library/trace.html
> 
> Personally I tend to put print statement at strategic places instead, I
> find that easier to analyse than a full trace but YMMV.
> 
> Maxime

Thank you. I am a YAPN (yet another Python newbie) and this helps me a 
lot.

-- 
Mladen Gogala
Database Consultant
http://mgogala.byethost5.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question on ABC classes

2020-10-25 Thread Peter J. Holzer
On 2020-10-22 23:35:21 -0700, Julio Di Egidio wrote:
> On Friday, 23 October 2020 07:36:39 UTC+2, Greg Ewing  wrote:
> > On 23/10/20 2:13 pm, Julio Di Egidio wrote:
> > > I am now thinking whether I could achieve the "standard"
> > > behaviour via another approach, say with decorators, somehow
> > > intercepting calls to __new__... maybe.
> > 
> > I'm inclined to step back and ask -- why do you care about this?
> > 
> > Would it actually do any harm if someone instantiated your
> > base class? If not, then it's probably not worth going out
> > of your way to prevent it.
> 
> This is the first little library I try to put together
> in Python, and it was natural for me to hit it with all
> the relevant decorations as well as type annotations in
> order to expose *strict* contracts, plus hopefully have
> intellisense work all over the place.

I think you are trying to use Python in a way contrary to its nature.
Python is a dynamically typed language. Its variables don't have types,
only its objects. And basically everything can be changed at runtime ...

It now has type annotations, but they are ignored both by the compiler
and at run-time. They are only for the benefit of linting tools like
mypy and editor features like intellisense.

> and the whole lot, indeed why even subclass ABC?

Good question. In six years of programming Python, I've never used ABC.
But then I came from another dynamically typed language to Python.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI (tkinter) popularity and job prospects for

2020-10-25 Thread Barry Scott



> On 23 Oct 2020, at 17:52, John Pote  wrote:
> 
> 
> On 23/10/2020 05:47, Grant Edwards wrote:
>> 
>>> I think that commercial desktop applications with a python
>>> compatible GUI would likely use QT or a Python binding thereof.
>> Agreed. If you want to improve you "hirability" for GUI application
>> development, I would probably put Qt first.  Then gobject or
>> wx. Tkinter would probably be last.

Agreed.

> 
> I've used tkinter and wxPython occasionally in the past for 1 off test tasks 
> (and interest). What's the advantage of Qt?

I have not looked at tk for a very long time, cannot comment on it.

I used to use wxPython but ported all my code to PyQt.
They took too long to get to python 3 support.

PyQt has far fewer platform specific behaviours that need working
around than wxPython does (did?).

It should be noted that the developer of PyQt does it as his job, so there is 
enough
work to keep him well payed.

Barry


> 
> John
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Is there a log file that tracks every statement that is being executed when a program is running?

2020-10-25 Thread Steve
Yes, I have been doing this already.  I include the line number to help me 
find, or search for, the location of the print statement.  Unfortunately, it 
requires a keen understanding in which the program has progressed in order to 
trace.

A printout of every line number executed could help.

 

 

FootNote:
If money does not grow on trees, then why do banks have branches?

 

From: Maxime S  
Sent: Sunday, October 25, 2020 7:15 AM
To: Steve 
Cc: Python 
Subject: Re: Is there a log file that tracks every statement that is being 
executed when a program is running?

 

Hi,

 

You can use the trace module for that: 
https://docs.python.org/3.8/library/trace.html

 

Personally I tend to put print statement at strategic places instead, I find 
that easier to analyse than a full trace but YMMV.

 

Maxime

 

Le dim. 25 oct. 2020 à 01:25, Steve mailto:Gronicus@sga.ninja> > a écrit :

This would seriously help troubleshooting for me.  I updated a data file and
now my main program is choking on it.  When the program encounters an error,
it dumps a bit of information to the screen for a few steps before the error
but that is not enough.




Footnote:
English sprakers on a roller coaster: "W"
Spanish speakers on a rollercoaster:  " Nosostros"

-Original Message-
From: Python-list mailto:sga.ni...@python.org> > On
Behalf Of shrimp_banana
Sent: Saturday, October 17, 2020 9:47 PM
To: python-list@python.org  
Subject: Re: File Name issue

On 10/17/20 4:12 PM, Steve wrote:
 > The line:
 > with open("HOURLYLOG.txt", 'r') as infile:
 > works but, when I rename the file, the line:
 > with open("HOURLY-LOG.txt", 'r') as infile:
 > does not.  The complaint is: Cannot Assign to operator  >  > However, I
have:
 > BPM_O2s=open("BPM-O2-Readings.txt","a")
 > And it works.
 >
 > At first, I thought the issue was due to having the - in the filename.
 >
 > Is there a fix or explanation for this?
 > Steve

I am unsure if this will help but you could try putting an r in front of the
quotes to make it take raw data only.
ie.

with open(r"HOURLY-LOG.txt", 'r') as infile
--
https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a log file that tracks every statement that is being executed when a program is running?

2020-10-25 Thread Maxime S
Hi,

You can use the trace module for that:
https://docs.python.org/3.8/library/trace.html

Personally I tend to put print statement at strategic places instead, I
find that easier to analyse than a full trace but YMMV.

Maxime


Le dim. 25 oct. 2020 à 01:25, Steve  a écrit :

> This would seriously help troubleshooting for me.  I updated a data file
> and
> now my main program is choking on it.  When the program encounters an
> error,
> it dumps a bit of information to the screen for a few steps before the
> error
> but that is not enough.
>
>
>
>
> Footnote:
> English sprakers on a roller coaster: "W"
> Spanish speakers on a rollercoaster:  " Nosostros"
>
> -Original Message-
> From: Python-list  On
> Behalf Of shrimp_banana
> Sent: Saturday, October 17, 2020 9:47 PM
> To: python-list@python.org
> Subject: Re: File Name issue
>
> On 10/17/20 4:12 PM, Steve wrote:
>  > The line:
>  > with open("HOURLYLOG.txt", 'r') as infile:
>  > works but, when I rename the file, the line:
>  > with open("HOURLY-LOG.txt", 'r') as infile:
>  > does not.  The complaint is: Cannot Assign to operator  >  > However, I
> have:
>  > BPM_O2s=open("BPM-O2-Readings.txt","a")
>  > And it works.
>  >
>  > At first, I thought the issue was due to having the - in the filename.
>  >
>  > Is there a fix or explanation for this?
>  > Steve
>
> I am unsure if this will help but you could try putting an r in front of
> the
> quotes to make it take raw data only.
> ie.
>
> with open(r"HOURLY-LOG.txt", 'r') as infile
> --
> https://mail.python.org/mailman/listinfo/python-list
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list