Pandas/dataexplore, how do you get data into them?

2017-10-08 Thread Chris Green
seful. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Pandas/dataexplore, how do you get data into them?

2017-10-08 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >How do you load a large table into dataexplore? > > I have not tested the following lines, I have no experience > with "dataexplore", this is just from what I heard: > > from pandastable.app import DataExp

Re: Pandas/dataexplore, how do you get data into them?

2017-10-08 Thread Chris Green
Thomas Jollans wrote: > On 08/10/17 18:02, Chris Green wrote: > > I am looking at dataexplore and Pandas, they look as if they may > > provide useful tools but at the moment I can't quite understand how > > you get data into them. > > > > How do y

Re: how to read in the newsreader

2017-10-16 Thread Chris Green
7;t that useful anyway. > The mostly very silly spam is trivial to filter with some very simple rules, most newsreaders have easy ways to specify subjects and/or senders to ignore. I have (I think) just three or four rules that eliminate just about all the junk. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: how to read in the newsreader

2017-10-16 Thread Chris Green
that matter) I use mutt which is also a text mode program. It makes reading mailing lists easy because it provides threading etc. I use like I use tin, alway on my desktop machine using ssh where necessary. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: how to read in the newsreader

2017-10-16 Thread Chris Green
Marko Rauhamaa wrote: > Chris Green : > > > I read newsgroups using tin, a text-mode/command line newsreader. I > > always run tin on my home desktop machine, even if I'm away from home > > by using ssh. So I maintain my settings that way. By the way tin *is* >

Re: Please tell me how to execute python file in Ubuntu by double clicking on file. (Posting On Python-List Prohibited)

2017-12-10 Thread Chris Green
ut a GUI? Anyhow, your first part is > correct: without a GUI, you can't exactly double-click on a file. > You'd have to install 'ubuntu server' to get an Ubuntu without a GUI, -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread Chris Green
n "if ...: > return"). I have always tried to enforce 'only one return per function'. If there are multiple returns it makes maintenance very difficult as 'clear up' code can get bypassed. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

How to diagnose this, fails on 3.6.3, works on 3.5.2?

2018-01-24 Thread Chris Green
f = open(monthFile, 'w') f.write(monthName + " " + str(year) + "\n") for i in range(len(monthName) + 5): f.write("=") f.write("\n") f.close() os.execvp("vi", ("", monthFile,)) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: How to diagnose this, fails on 3.6.3, works on 3.5.2?

2018-01-26 Thread Chris Green
Peter Otten <__pete...@web.de> wrote: > Chris Green wrote: > > > I have a fairly simple little python program to automate starting an > > editor on a wiki page. It works fine on the system where I wrote it > > (xubuntu 16.04, python 3 version 3.5.2) but it comes u

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Groups

2018-02-02 Thread Chris Green
gure) that aggregates feeds from two public NNTP servers which provides some robustness if things go wrong with either. By configuring the time for which posts are retained by leafnode (to quite a long time) I can search back a long way. As I only read a few tens of newsgroups this doesn't

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-09 Thread Chris Green
and you've Surely you mean NNTP/Usenet client. > access to hundreds of Python lists and thousands of other technical > lists. I find the search facilities perfectly adequate. > -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-09 Thread Chris Green
Steven D'Aprano wrote: > On Fri, 09 Feb 2018 12:45:29 +0000, Chris Green wrote: > > > Mark Lawrence wrote: > [...] > >> Please don't waste your time with the gmane website. Just point any > >> (semi-)decent mail client like Thunderbird at news.gmane.o

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-09 Thread Chris Green
vironment. If you can't even ssh from work then you can always use an 'ssh from the web' app from your wenb browser. The newsreader I use is tin by the way. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-10 Thread Chris Green
Michael F. Stemper wrote: > On 2018-02-09 13:37, Chris Green wrote: > > > Alternative approach, what I do:- > > > > Run a text mode (but very capable and mouse aware) newsreader on > > my home system, read news locally using that. > > > >

Re: Gmane seems to be gone

2018-02-18 Thread Chris Green
TP<->mailing-list gateway > continue to work -- until tonight. Now the domain is gone. Perhaps > it's just an oversight, but I've got a bad feeling... > I think it was a short term hiccough, a posting of mine got bounced yesterday but subsequent ones worked OK. --

Re: Gmane seems to be gone

2018-02-18 Thread Chris Green
ting a > server from scratch wouldn't be too bad, either. > > However, the simplest way forward might be to just take an off-the-shelf > NNTP server and write a IMAP/NNTP gateway bot that acts as a client > bothways. Then you can use Python's nntplib and imaplib. > L

Re: Gmane seems to be gone

2018-02-18 Thread Chris Green
Grant Edwards wrote: > On 2018-02-18, Chris Green wrote: > > Grant Edwards wrote: > >> I've been dreading this moment for a couple years: it looks like > >> gmane.org is gone. The original operator/maintainer gave up a couple > >> years ago and pulled

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&#

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 fo

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 ·

What might suddenly provoke this poplib error?

2022-10-13 Thread Chris Green
break It seems to be saying that the POP3 server has a problem, 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
e a few years so I'm not sure if I;ll bother! :-) The program is only run half-hourly by cron. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

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

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 system

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/en

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 > >>hap

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Chris Green
m. The system 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 · -- ht

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

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

2022-12-11 Thread Chris Green
'Y' or 'N' 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: 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 a li

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

2022-12-11 Thread Chris Green
;n': ch = getch().lower() 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 g

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-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: Single line if statement with a continue

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

Re: Mailing-Lists (pointer)

2023-01-10 Thread Chris Green
it's decided to move to a forum format make that accessible by E-Mail. -- 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 maintain

Re: Usenet vs. Mailing-list

2023-01-28 Thread Chris Green
post 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: 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

DeprecationWarning but replacement doesn't work

2023-02-04 Thread Chris Green
ost recent 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 Gre

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

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. -- C

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 > >&

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&#

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) > >>&

How to 'ignore' an error in Python?

2023-04-28 Thread Chris Green
k? It feels rather clumsy. I 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: 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

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 w

Problem with accented characters in mailbox.Maildir()

2023-05-08 Thread Chris Green
msg.get() 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: Problem with accented characters in mailbox.Maildir()

2023-05-08 Thread Chris Green
#x27;s failing. I.e. 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

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 G

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.ge

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 :-) > > > >

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

2023-05-08 Thread Chris Green
nt to do is throw the non-ASCII characters 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 to use instead of nntplib?

2023-05-16 Thread Chris Green
round > > 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

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

2023-05-22 Thread Chris Green
interpreted 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: 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 > &g

Re: why sqrt is not a built-in function?

2021-01-15 Thread Chris Green
r versions. > Surely III, IV and V. I was definitely Fortran IV -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Chris Green
edited in one window, run the code in another window and sometimes a third window for looking at configuration etc. Add print statement etc. for debugging. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Is email.message.get() case insensitive for the header name?

2021-02-14 Thread Chris Green
t;List-Id:", "unknown") find all of them? -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Change first occurrence of character x in a string - how?

2021-02-14 Thread Chris Green
RE 'match' function that would test if linux-r...@vger.kernel.org matches linux-raid.vger.kernel.org? I don't really care if the '.' are all regarded as wild cards, the match will be accurate enough. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Change first occurrence of character x in a string - how?

2021-02-14 Thread Chris Green
> >>> s = 'linux-raid.vger.kernel.org' > >>> new_s = s.replace('.', '@', 1) > >>> new_s > 'linux-r...@vger.kernel.org' > A new string is fine, thank you, that'll do what I need. Efficiency isn't a major issue with this. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Change first occurrence of character x in a string - how?

2021-02-14 Thread Chris Green
MRAB wrote: > On 2021-02-14 21:14, Chris Green wrote: > > What's the easiest way to change the first occurrence of a specified > > character in a string? > > > > E.g. I want to change linux-raid.vger.kernel.org to > > linux-r...@vger.kernel.org, it's

Re: Is email.message.get() case insensitive for the header name?

2021-02-15 Thread Chris Green
Peter Otten <__pete...@web.de> wrote: > On 14/02/2021 21:50, Chris Green wrote: > > > It isn't clear from the documentation. Does email.message.get() care > > about the case of the header it's getting? > > > > I checking mailing list mails and the &

I need some help interpreting this error

2021-02-17 Thread Chris Green
oes the address in the header match this entry # if (address in msghdr[header]): # # # set the destination directory # dest = mldir + destdir + nm # # # Strip out list name (4th field) from subject if it's there # if sbstrip in msghdr["subject"]: msg.replace_header("Subject", msghdr["subject"].replace(sbstrip, '')) # # # we've found a match so assume we won't get another # break # # # deliver the message # mailLib.deliverMdMsg(dest, msg, log) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: I need some help interpreting this error

2021-02-17 Thread Chris Green
2qdxy4rzwzuui...@potatochowder.com wrote: > On 2021-02-17 at 15:40:27 +, > Chris Green wrote: > > > I'm running this using Python 3.7 on a Linux system. > > > > Most of the time (i.e. for a couple of days now) the program has been > > satifactorily deli

Re: I need some help interpreting this error

2021-02-17 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >But msghdr["subject"] is surely just a string isn't it? Why is it > >complaining about something of type 'Header'? > > What would you do to debug-print the type of an object? > I don't know, wh

Re: I need some help interpreting this error

2021-02-17 Thread Chris Green
2qdxy4rzwzuui...@potatochowder.com wrote: > On 2021-02-17 at 16:42:03 +, > Chris Green wrote: > > > 2qdxy4rzwzuui...@potatochowder.com wrote: > > > On 2021-02-17 at 15:40:27 +, > > > Chris Green wrote: > > > > > > &g

Re: I need some help interpreting this error

2021-02-17 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >chris@cheddar$ tail mail.err > >Traceback (most recent call last): > > File "/home/chris/.mutt/bin/filter.py", line 95, in > >if sbstrip in msghdr["subject"]: > >TypeEr

Re: I need some help interpreting this error

2021-02-17 Thread Chris Green
tes in the > subject, and try 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

Re: editor recommendations?

2021-03-08 Thread Chris Green
ke abiliities. For example it 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: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Chris Green
able, if the people who deal with it now are OK to continue then let's not change anything. -- 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
ticipate in > the 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
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-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

How to iterate through maildir messages in python 3?

2021-06-24 Thread Chris Green
been here 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: 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

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. co

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: > > &

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/bi

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

2021-07-17 Thread Chris Green
ce but its size now demands a better search engine. -- 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 Goo

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 anything

Where to keep local Python modules?

2021-07-23 Thread Chris Green
pproach? Is there a 'standard' 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: 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 > &

Re: Where to keep local Python modules?

2021-07-24 Thread Chris Green
as uncluttered as possible though so maybe I'll keep the lib directory under ~/.config or ~/.local. -- 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
s inherited the get() method so why not the get_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

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

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

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

Odd locale error that has disappeared on reboot.

2021-12-07 Thread Chris Green
also my 'NAS' 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: 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 >

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 a

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

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

2021-12-24 Thread Chris Green
an't see an easy way 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: 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

How to test for maildir 'folder' in Python?

2022-01-22 Thread Chris Green
27;, 'new' and 'tmp'. Is there any 'ready made' way 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: 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.

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 ma

Re: Best way to check if there is internet?

2022-02-22 Thread Chris Green
seful to 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

  1   2   3   >