Re: Can one output something other than 'nan' for not a number values?

2024-02-19 Thread Chris Green via Python-list
Grant Edwards wrote: > On 2024-02-16, Chris Green via Python-list wrote: > > > I'm looking for a simple way to make NaN values output as something > > like '-' or even just a space instead of the string 'nan'. > > It would probably help if you told us how you'

Re: Can one output something other than 'nan' for not a number values?

2024-02-19 Thread Chris Green via Python-list
dn wrote: > On 18/02/24 09:53, Grant Edwards via Python-list wrote: > > On 2024-02-17, Cameron Simpson via Python-list > > wrote: > >> On 16Feb2024 22:12, Chris Green wrote: > >>> I'm looking for a simple way to make NaN values output as something > &g

Can one output something other than 'nan' for not a number values?

2024-02-16 Thread Chris Green via Python-list
- nan voltsnan Amps What I would like is for those 'nan' strings to be just a '-' or something similar. Obviously I can write conditional code to check for float('nan') values but is there a neater way with any sort of formatting string or other sort of cleverness? -- Chris Green

Re: How/where to store calibration values - written by program A, read by program B

2023-12-30 Thread Chris Green via Python-list
what I need. The Python json package is very simple to use and with an 'indent=' setting the resulting json is reasonably human readable which is all I need. Thus programs simply read the values from the json file into a dictionary of dictionaries and the 'updater of values' program can write them back after changes. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: How to enter multiple, similar, dictionaries?

2023-12-11 Thread Chris Green via Python-list
Jon Ribbens wrote: > On 2023-12-11, Chris Green wrote: > > Chris Green wrote: > >> Is there a way to abbreviate the following code somehow? > >> > >> lv = {'dev':'bbb', 'input':'1', 'name':'Leisure volts'} > >> sv = {'dev':'bbb', 'input':'0'

Re: How to enter multiple, similar, dictionaries?

2023-12-11 Thread Chris Green via Python-list
Chris Green wrote: > Is there a way to abbreviate the following code somehow? > > lv = {'dev':'bbb', 'input':'1', 'name':'Leisure volts'} > sv = {'dev':'bbb', 'input':'0', 'name':'Starter volts'} > la = {'dev':'bbb', 'input':'2', 'name':'Leisure Amps'} > sa = {'

How to enter multiple, similar, dictionaries?

2023-12-11 Thread Chris Green via Python-list
already but the above sort of format in Python source is more human readable and accessible. I'm just looking for a less laborious way of entering it really. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: How/where to store calibration values - written by program A, read by program B

2023-12-06 Thread Chris Green via Python-list
Thank you everyone for all the suggestions, I now have several possibilities to follow up. :-) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: How/where to store calibration values - written by program A, read by program B

2023-12-06 Thread Chris Green via Python-list
Thomas Passin wrote: > On 12/5/2023 11:50 AM, MRAB via Python-list wrote: > > On 2023-12-05 14:37, Chris Green via Python-list wrote: > >> Is there a neat, pythonic way to store values which are 'sometimes' > >> changed? > >> > >> My particular cas

Re: How/where to store calibration values - written by program A, read by program B

2023-12-06 Thread Chris Green via Python-list
Paul Rubin wrote: > Chris Green writes: > > I could simply write the values to a file (or a database) and I > > suspect that this may be the best answer but it does make retrieving > > the values different from getting all other (nearly) constant values. >

How/where to store calibration values - written by program A, read by program B

2023-12-05 Thread Chris Green via Python-list
retrieving the values different from getting all other (nearly) constant values. Are there any Python modules aimed specifically at this sort of requirement? -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Silly/crazy problem with sqlite

2023-11-26 Thread Chris Green via Python-list
Stefan Ram wrote: > Chris Green writes: > >I have to say this seems very non-pythonesque to me, the 'obvious' > >default simply doesn't work right, and I really can't think of a case > >where the missing comma would make any sense at all. > > |6.15 Expression lists

Re: Silly/crazy problem with sqlite

2023-11-25 Thread Chris Green via Python-list
Chris Green wrote: > This is driving me crazy, I'm running this code:- OK, I've found what's wrong:- > cr.execute(sql, ('%' + "2023-11" + '%')) should be:- cr.execute(sql, ('%' + x + '%',) ) I have to say this seems very non-pythonesque to me, the 'obvious

Silly/crazy problem with sqlite

2023-11-25 Thread Chris Green via Python-list
each end as separate variables to the binding, this is crazy! I've done similar elsewhere and it works OK, what on earth am I doing wrong here? It has to be something very silly but I can't see it at the moment. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: pip/pip3 confusion and keeping up to date

2023-11-05 Thread Chris Green via Python-list
're doing > > ... screen fades to black, title card "3 years later", fade in to ... > > * publish your package > Surely it's not that bad, the vast bulk of Debian, Ubuntu and other distributions are installed via systems that sort out dependencies once given a particular package's requirements. Python is surely not unique in its dependency requirements. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: pip/pip3 confusion and keeping up to date

2023-11-03 Thread Chris Green via Python-list
Jon Ribbens wrote: > On 2023-11-02, Chris Green wrote: > > Jon Ribbens wrote: > >> On 2023-11-02, Chris Green wrote: > >> > I have a couple of systems which used to have python2 as well as > >> > python3 but as Ubuntu and Debian verions have moved

Re: pip/pip3 confusion and keeping up to date

2023-11-02 Thread Chris Green via Python-list
Jon Ribbens wrote: > On 2023-11-02, Chris Green wrote: > > I have a couple of systems which used to have python2 as well as > > python3 but as Ubuntu and Debian verions have moved on they have > > finally eliminated all dependencies on python2. > > > &

Re: pip/pip3 confusion and keeping up to date

2023-11-02 Thread Chris Green via Python-list
Jon Ribbens wrote: > On 2023-11-02, Dieter Maurer wrote: > > Chris Green wrote at 2023-11-2 10:58 +: > >> ... > >>So, going on from this, how do I do the equivalent of "apt update; apt > >>upgrade" for my globally installed pip packages? > >

pip/pip3 confusion and keeping up to date

2023-11-02 Thread Chris Green via Python-list
/pip3 but they're identical so presuably I can now simply use pip and it will be a python3 pip. So, going on from this, how do I do the equivalent of "apt update; apt upgrade" for my globally installed pip packages? -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: How to find any documentation for smbus?

2023-10-30 Thread Chris Green via Python-list
Dan Purgert wrote: > On 2023-10-28, Chris Green wrote: > > I am using the python3 smbus module, but it's hard work because of the > > lack of documentation. Web searches confirm that the documentation is > > somewhat thin! > > > > The SMBus spec is available f

Re: How to find any documentation for smbus?

2023-10-30 Thread Chris Green via Python-list
km wrote: > Il Sat, 28 Oct 2023 17:08:00 +0100, Chris Green ha scritto: > > > I am using the python3 smbus module, but it's hard work because of the > > lack of documentation. Web searches confirm that the documentation is > > somewhat thin! > > > > If you

How to find any documentation for smbus?

2023-10-30 Thread Chris Green via Python-list
FILE /usr/lib/python3/dist-packages/smbus.cpython-39-arm-linux-gnueabihf.so Even a list of available methods would be handy! :-) Presumably python3's smbus is just a wrapper so if I could find the underlying C/C++ documentation it might help. -- Chris Green · -- https://mail.python.

Re: Is a Python event polled or interrupt driven?

2023-10-12 Thread Chris Green via Python-list
Chris Angelico wrote: > On Fri, 13 Oct 2023 at 01:48, Chris Green via Python-list > wrote: > > > > In the following code is the event polled by the Python process > > running the code or is there something cleverer going on such that > > Python sees an interrupt wh

Is a Python event polled or interrupt driven?

2023-10-12 Thread Chris Green via Python-list
set GPIO25 as input (button) def my_callback(channel): if GPIO.input(Pin): print "Rising edge detected on 25" else: # if port 25 != 1 print "Falling edge detected on 25" GPIO.add_event_detect(Pin, GPIO.BOTH, my_

Finding good documentation for gpiod

2023-09-03 Thread Chris Green via Python-list
ell be that I'm simply banging up against the limit of what documentation is available, I have managed to get code working OK. It's just that I'd be happier if I really know what I was doing! :-) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Why do I always get an exception raised in this __init__()?

2023-09-03 Thread Chris Green via Python-list
Alan Gauld wrote: > On 31/08/2023 22:15, Chris Green via Python-list wrote: > > > class Gpiopin: > > > > def __init__(self, pin): > > # > > # > > # scan through t

Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Chris Green via Python-list
ome/chris/.cfg/hosts/bbb/bin/ngp.py", line 24, in __init__ return ValueError: Can't find pin 'P9_23' >>> Does a return in __init__() not do what I think it does? How else could/should I do this? -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Chris Green via Python-list
Chris Green wrote: [snip code and question] Sorry folks, it was a caching problem, I wasn't running the code I thought I was running! When I made sure I had cleared everything out and tried again it all worked as I expected. -- Chris Green · -- https://mail.python.org/mailman/listinfo

Re: What sort of exception when a class can't find something?

2023-08-31 Thread Chris Green via Python-list
Several helpful replies, thank you all. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

What sort of exception when a class can't find something?

2023-08-31 Thread Chris Green via Python-list
. person.Person('Fred') ... ... If Fred doesn't exist in the database what sort of exception should there be? Is it maybe a ValueError? -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a Python module to parse a date like the 'date' command in Linux?

2023-05-23 Thread Chris Green
Mike Dewhirst wrote: > [-- multipart/mixed, encoding 7bit, 22 lines --] > > [-- text/plain, encoding base64, charset: UTF-8, 16 lines --] > > On 21/05/2023 5:53 am, Chris Green wrote: > > I'm converting a bash script to python as it has become rather clumsy > > in

Is there a Python module to parse a date like the 'date' command in Linux?

2023-05-22 Thread Chris Green
nterpreted as a date, in particular it accepts things like "tomorrow", "yesterday" and "next thursday". Is there anything similar in Python or would I be better off simply using os.system() to run date from the python program? -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: What to use instead of nntplib?

2023-05-16 Thread Chris Green
; there must be this list is mirrored on one, and AFAICS some pythoners use > that > way to post (over the list) Yes, me for one, a good newsreader is really a wonderful way to manage technical 'lists' like this one. Usenet news is still very much alive though a minority interest now I suspect. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Chris Green
cters away as the string I'm trying to match in the subject is guaranteed to be ASCII. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Chris Green
Keith Thompson wrote: > Chris Green writes: > > Chris Green wrote: > >> I'm having a real hard time trying to do anything to a string (?) > >> returned by mailbox.MaildirMessage.get(). > >> > > What a twit I am :-) > > > > Strin

Re: Problem with accented characters in mailbox.Maildir()

2023-05-08 Thread Chris Green
Chris Green wrote: > A bit more information, msg.get("subject", "unknown") does return a > string, as follows:- > > Subject: > =?utf-8?Q?aka_Marne_=C3=A0_la_Sa=C3=B4ne_(Waterways_Continental_Europe)?= > > So it's the 'searchTxt in msg.get(&qu

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Chris Green
Chris Green wrote: > I'm having a real hard time trying to do anything to a string (?) > returned by mailbox.MaildirMessage.get(). > What a twit I am :-) Strings are immutable, I have to do:- newstring = oldstring.replace("_", " ") Job done! -- Chris Green

Re: Problem with accented characters in mailbox.Maildir()

2023-05-08 Thread Chris Green
for some reason 'in' isn't working when the searched string has utf-8 characters. Surely there's a way to handle this. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Problem with accented characters in mailbox.Maildir()

2023-05-08 Thread Chris Green
that isn't managing to handle the accented string correctly? Yes, I know that accented characters probably aren't allowed in Subject: but I'm not going to get that changed! :-) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Chris Green
Kushal Kumaran wrote: > On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote: > > I'm sure I'm missing something obvious here but I can't see an elegant > > way to do this. I want to create a directory, but if it exists it's > > not an error and the code should just co

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Chris Green
Chris Angelico wrote: > On Sat, 29 Apr 2023 at 14:27, Kushal Kumaran wrote: > > > > On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote: > > > I'm sure I'm missing something obvious here but I can't see an elegant > > > way to do this. I want to create a

How to 'ignore' an error in Python?

2023-04-28 Thread Chris Green
suppose I could test if the directory exists before the os.mkdir() but again that feels a bit clumsy somehow. I suppose also I could use os.mkdirs() with exist_ok=True but again that feels vaguely wrong somehow. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Looking for package/library to extract MP4 metadata

2023-04-10 Thread Chris Green
jak wrote: > Chris Green ha scritto: > > jak wrote: > >> rbowman ha scritto: > >>> On Sun, 9 Apr 2023 09:40:51 +0100, Chris Green wrote: > >>> > >>>> I'm looking for a Python (3) library to access (read only at present) > >>>&g

Re: Looking for package/library to extract MP4 metadata

2023-04-10 Thread Chris Green
rbowman wrote: > On Sun, 9 Apr 2023 09:40:51 +0100, Chris Green wrote: > > > I'm looking for a Python (3) library to access (read only at present) > > the metadata in MP4 video files, in particular I want to get at dates > > and times. > > > > What's avai

Re: Looking for package/library to extract MP4 metadata

2023-04-10 Thread Chris Green
jak wrote: > rbowman ha scritto: > > On Sun, 9 Apr 2023 09:40:51 +0100, Chris Green wrote: > > > >> I'm looking for a Python (3) library to access (read only at present) > >> the metadata in MP4 video files, in particular I want to get at dates > >> a

Looking for package/library to extract MP4 metadata

2023-04-10 Thread Chris Green
I'm looking for a Python (3) library to access (read only at present) the metadata in MP4 video files, in particular I want to get at dates and times. What's available to do this? Ideally something available in the Ubuntu repositories but I can install with PIP if necessary. -- Chris Green

Re: DeprecationWarning but replacement doesn't work

2023-02-05 Thread Chris Green
Roel Schroeven wrote: > Chris Green schreef op 4/02/2023 om 16:17: > > I am using Image from PIL and I'm getting a deprecation warning as > > follows:- > > > > /home/chris/bin/picShrink.py:80: DeprecationWarning: ANTIALIAS is > > deprecated > and will be re

DeprecationWarning but replacement doesn't work

2023-02-04 Thread Chris Green
ecent call last): File "/home/chris/bin/picShrink.py", line 80, in im.thumbnail(size, Resampling.LANCZOS) NameError: name 'Resampling' is not defined So, presumably there's more I need to change. Where can I find out what I need to do? -- Chris Green · -- https://mai

Re: Usenet vs. Mailing-list

2023-01-28 Thread Chris Green
Chris Green wrote: > Jon Ribbens wrote: > > On 2023-01-28, Peter J. Holzer wrote: > > > On 2023-01-27 21:04:58 +, Ben Bacarisse wrote: > > >> It looks like you posted this question via Usenet. comp.lang.python is > > >> essentially dead as a Usenet

Re: Usenet vs. Mailing-list

2023-01-28 Thread Chris Green
via the newsgroup, > and I can see my postings reach the list because they appear > in the list archive on the web. > As far as I am aware the mirroring of the Python mailing list on comp.lan.python works perfectly. I love gmane! :-) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Mailing-Lists (pointer)

2023-01-11 Thread Chris Green
Cameron Simpson wrote: > On 10Jan2023 08:45, Chris Green wrote: > >dn wrote: > >> See also the wisdom of enabling comp.lang.python and python-list as > >> 'mirrors', enabling those who prefer one mechanism/client to another, > >> yet maintaini

Re: Mailing-Lists (pointer)

2023-01-10 Thread Chris Green
e to a forum format make that accessible by E-Mail. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Single line if statement with a continue

2022-12-15 Thread Chris Green
urns" is often found in programming guidelines. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Does one have to use curses to read single characters from keyboard?

2022-12-12 Thread Chris Green
Barry Scott wrote: > > > > On 11 Dec 2022, at 18:50, Chris Green wrote: > > > > My solution in the end was copied from one I found that was much > > simpler and straightforward than most. I meant to post this earlier > > but it got lost somewhere:-

Re: Does one have to use curses to read single characters from keyboard?

2022-12-12 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >import sys, termios, tty > > There might be some versions of Python and the Microsoft® > Windows operating system where "termios" is not available. > Ah, I did originally say that this was a Unix/Linux only so

Re: Does one have to use curses to read single characters from keyboard?

2022-12-11 Thread Chris Green
() return ch So getyn() reads a y or an n, ignores anything else and doesn't wait for a return key. Keyboard input operation is restored to normal after doing this. Using tty.setcbreak() rather than tty.setraw() means that CTRL/C etc. still work if things go really wrong. -- Chris Green · -- https

Re: Does one have to use curses to read single characters from keyboard?

2022-12-11 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >Is the only way to read single characters from the keyboard to use > >curses.cbreak() or curses.raw()? If so how do I then read characters, > > It seems that you want to detect keypresses and not read > characters from

Does one have to use curses to read single characters from keyboard?

2022-12-11 Thread Chris Green
' answers to questions on the command line. Searching for ways to do this produces what seem to me rather clumsy ways of doing it. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Chris Green
Barry Scott wrote: > > > > On 7 Nov 2022, at 09:28, Chris Green wrote: > > > > Chris Green wrote: > >>> 3: with your pseudo "python3" script in place, make all the scripts use > >>> the "#!/usr/bin/env python3" shebang sug

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Chris Green
tem is my hosting provider's cPanel platform which is running a very old Linux and, as I've said has only python 2. I can ask for python 3 on their system but I suspect that my voice is a very tiny one and there are higher priority things to get done. -- Chris Green · -- https://mail.python.or

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Chris Green
Chris Green wrote: > > 3: with your pseudo "python3" script in place, make all the scripts use > > the "#!/usr/bin/env python3" shebang suggested above. > > > Yes, that sounds a good plan to me, thanks Cameron. > Doesn't '#!/usr/bin/env python3'

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Chris Green
Cameron Simpson wrote: > On 06Nov2022 20:51, jak wrote: > >Il 06/11/2022 11:03, Chris Green ha scritto: > >>I have a number of python scripts that I run on a mix of systems. I > >>have updated them all to run on python 3 but many will also run quite > >>h

Re: How to manage python shebang on mixed systems?

2022-11-06 Thread Chris Green
rbowman wrote: > On Sun, 6 Nov 2022 10:03:50 +0000, Chris Green wrote: > > > > Is there a neat way of handling this? I could write a sort of wrapper > > script to run via the shebang but that seems overkill to me. > > Can you symlink? Not really, since the syst

Re: What might suddenly provoke this poplib error?

2022-10-13 Thread Chris Green
Peter J. Holzer wrote: > [-- text/plain, encoding quoted-printable, charset: us-ascii, 28 lines --] > > On 2022-10-13 13:47:07 +0100, Chris Green wrote: > > I have a short python3 program that collects E-Mails from a 'catchall' > > mailbox, sends the few that might be intere

Re: What might suddenly provoke this poplib error?

2022-10-13 Thread Chris Green
ll bother! :-) The program is only run half-hourly by cron. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

What might suddenly provoke this poplib error?

2022-10-13 Thread Chris Green
if so there's not much I can do about it as it's my hosting provider's mail server. Is it really saying the server has a problem? -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: What might suddenly provoke this poplib error?

2022-10-13 Thread Chris Green
A further little bit of information, I tried running getCatchall.py from the command prompt and there was a long wait before it output the same error message. I.e. it looks rather as if the server is not responding to requests. (A 'long wait' is a minute or two) -- Chris Green · -- https

Re: Find the path of a shell command

2022-10-12 Thread Chris Green
Michael F. Stemper wrote: > On 12/10/2022 07.20, Chris Green wrote: > > jak wrote: > >> Il 12/10/2022 09:40, jkn ha scritto: > >>> On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote: > > >>>> I'm afraid you will have to look for the

Re: Find the path of a shell command

2022-10-12 Thread Chris Green
y comments/responses. > >>> Paulo > >>> > >> I'm afraid you will have to look for the command in every path listed in > >> the PATH environment variable. > > > > erm, or try 'which rm' ? > > You might but if you don't know where the

Re: Best way to check if there is internet?

2022-02-22 Thread Chris Green
o have something that doesn't always give the > right answer, even if it usually does? Is there any value whatsoever > in a lie? > That's sort of in the same area as a stopped clock being right more often than one that runs just a bit slow (or fast). :-) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: How to test for maildir 'folder' in Python?

2022-01-23 Thread Chris Green
Barry Scott wrote: > > > > On 22 Jan 2022, at 21:26, Chris Green wrote: > > > > I have a script that walks a quite deep tree of mail messages to find > > and archive old messages. I'm trying to convert it from mbox to > > maildir (as I now store my mail in

Re: How to test for maildir 'folder' in Python?

2022-01-23 Thread Chris Green
Cameron Simpson wrote: > On 22Jan2022 21:26, Chris Green wrote: > >So I need to test whether a point I have reached in the hierarchy is a > >maildir mailbox or not. Using mbox format it's easy because 'folders' > >are directories and mailboxes are files. However with ma

How to test for maildir 'folder' in Python?

2022-01-22 Thread Chris Green
in python to tell whether a directory is a maildir mailbox? If not I suppose I'll simply have to check if there are 'cur', 'new' and 'tmp' directories within the directory which may or may not be a maildir. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there any way to make sense of these E-Mail subjects?

2021-12-24 Thread Chris Green
Python wrote: > Chris Green wrote: > >Subject: [SPAM] =?UTF-8?B?8J+TtyBKb2huIEJheHRlci1C?= > > =?UTF-8?B?cm93biByZWNlbnRseSBw?= > > =?UTF-8?B?b3N0ZWQgYSBuZXcgcGhv?= > > =?UTF-8?B?dG8=?= > > > > It looks like some sort of mi

Is there any way to make sense of these E-Mail subjects?

2021-12-24 Thread Chris Green
to actually inspect the message as it's disappeared off somewhere else. I guess I could add some code to the script to send it to myself as well but if there's something obvious in the above it would avoid having to do this. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Odd locale error that has disappeared on reboot.

2021-12-09 Thread Chris Green
Inada Naoki wrote: > On Wed, Dec 8, 2021 at 2:52 AM Chris Green wrote: > > > > > > At 03:40 last night it suddenly started throwing the following error every > > time it ran:- > > > > Fatal Python error: initfsencoding: Unable to get the locale encodin

Re: Odd locale error that has disappeared on reboot.

2021-12-09 Thread Chris Green
Julio Di Egidio wrote: > On 08/12/2021 10:50, Chris Green wrote: > > Julio Di Egidio wrote: > >> On 07/12/2021 16:28, Chris Green wrote: > >>> What could have caused this? I certainly wasn't around at 03:40! :-) > >>> There aren't any automat

Re: Odd locale error that has disappeared on reboot.

2021-12-08 Thread Chris Green
Julio Di Egidio wrote: > On 07/12/2021 16:28, Chris Green wrote: > > I have a very short Python program that runs on one of my Raspberry > > Pis to collect temperatures from a 1-wire sensor and write them to a > > database:- > > > > #!/usr/bin/python3 >

Odd locale error that has disappeared on reboot.

2021-12-07 Thread Chris Green
with a big USB drive connected to it. The backups have been running without problems for more than a year. Looking at the system logs shows that a backup was started at 03:35 so I suppose that *could* have provoked something but I fail to understand how. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Why is there no get_body() in mailbox.Maildir?

2021-11-28 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >I thought MaildirMessage inherited from email.message, > > It inherits from mailbox.Message which inherits from > email.message.Message which has no "get_body" method. > So the documentation at:- ht

Re: How to decode ISO8859-1 in Python 3?

2021-11-28 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >I have some text files which are ISO8859-1 encoded and I want to output > >them to screen using Python. > > Well, the first attempt would be: > > import pathlib > name = r"C:\example.txt" > encoding

How to decode ISO8859-1 in Python 3?

2021-11-28 Thread Chris Green
This sounds as if it should be trivial but searching only seems to produce ways ofd doing it in Python 2. I have some text files which are ISO8859-1 encoded and I want to output them to screen using Python. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Why is there no get_body() in mailbox.Maildir?

2021-11-28 Thread Chris Green
et_body() method? I'm running Python 3.9.7 on xubuntu Linux 21.10. Is there another way of doing this or do I have to sort through the message parts and stuff? It sounded like get_body() would make things easier. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Where to keep local Python modules?

2021-07-24 Thread Chris Green
ossible though so maybe I'll keep the lib directory under ~/.config or ~/.local. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Where to keep local Python modules?

2021-07-23 Thread Chris Green
Roland Mueller wrote: > Hello, > > pe 23. heinäk. 2021 klo 21.44 Chris Green (c...@isbd.net) kirjoitti: > > > This isn't a question about how to set PYTHONPATH so that Python code > > can find imported modules, it's about what is a sensible layout for > > one

Where to keep local Python modules?

2021-07-23 Thread Chris Green
' name for the directory containing modules, or a standard place for it? (I don't mean a system-wide standard place, I mean a 'my' standard place). -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Searching pypi.org, is there an 'advanced search'?

2021-07-18 Thread Chris Green
Peter Otten <__pete...@web.de> wrote: > On 18/07/2021 03:40, MRAB wrote: > > On 2021-07-17 13:01, Chris Green wrote: > > >> pypi.org is a wonderful resource but its size now demands a better > >> search engine. > >> > > There's always Google.

Re: Searching pypi.org, is there an 'advanced search'?

2021-07-18 Thread Chris Green
Mark Lawrence wrote: > On Saturday, July 17, 2021 at 1:03:21 PM UTC+1, Chris Green wrote: > > Every time I go to pypi.org to look for a neat utility or something I > > curse the stupid search. > > > > Is there really no better search available? Apart from an

Searching pypi.org, is there an 'advanced search'?

2021-07-17 Thread Chris Green
. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: How to iterate through maildir messages in python 3?

2021-06-27 Thread Chris Green
Dennis Lee Bieber wrote: > On Fri, 25 Jun 2021 09:19:49 +0100, Chris Green declaimed the > following: > > > > >Here's the full program where I'm encountering the error (yes, I > >should have posted this first time around) :- > > > >#!/usr/bin/python3

Re: How to iterate through maildir messages in python 3?

2021-06-26 Thread Chris Green
Chris Angelico wrote: > On Sat, Jun 26, 2021 at 12:28 AM Chris Green wrote: > > > > Greg Ewing wrote: > > > On 25/06/21 7:06 am, Chris Green wrote: > > > > In python 2 one can do:- > > > > > > > > for msg in maildir: &g

Re: How to iterate through maildir messages in python 3?

2021-06-25 Thread Chris Green
Gilmeh Serda wrote: > On Fri, 25 Jun 2021 09:19:49 +0100, Chris Green wrote: > > > TypeError: string argument expected, got 'bytes' > > couple things comes to mind: > > 1. find py2 as archive, put it somewhere and run it from that > Hmm! :-) > 2. convert the

Re: How to iterate through maildir messages in python 3?

2021-06-25 Thread Chris Green
Greg Ewing wrote: > On 25/06/21 7:06 am, Chris Green wrote: > > In python 2 one can do:- > > > > for msg in maildir: > >print msg # or whatever you want to do with the message > > > > > > However in python 3 this produces

How to iterate through maildir messages in python 3?

2021-06-24 Thread Chris Green
ere before but this problem is subtly different from the one I had before and I can't find the answer) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-07 Thread Chris Green
Grant Edwards wrote: > On 2021-05-06, Chris Green wrote: > > Grant Edwards wrote: > >> On 2021-05-06, Chris Green wrote: > >> > Grant Edwards wrote: > >> > > >> >> Pointing a newsreader at news.gmane.io allows one to participate i

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Chris Green
Grant Edwards wrote: > On 2021-05-06, Chris Green wrote: > > Grant Edwards wrote: > > > >> Pointing a newsreader at news.gmane.io allows one to participate in > >> the mailing list just fine without using Usenet. > >> > > ??? Surely that *is

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Chris Green
mailing list just fine without using Usenet. > ??? Surely that *is* using Usenet, at least you're using NNTP which is the Usenet protocol. What's "not Usenet" about it? > Not that I support shutting down the Usenet/email gateway -- the > signal/noise ration seems fine to me. > On that I quite agree. :-) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Chris Green
now are OK to continue then let's not change anything. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: editor recommendations?

2021-03-08 Thread Chris Green
has a gnuclient type mode where it runs as a server and you can squirt files at it to be edited. It's available in most distributions and is actively maintained and developed still. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: I need some help interpreting this error

2021-02-17 Thread Chris Green
ry to reproduce it that way. > That's a point, with the clues you have given me I can try some 'bad' subject text and see if I can reproduce the error. Thanks again. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   >