Re: GUI (tkinter) popularity and job prospects for

2020-10-23 Thread John Pote
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 o

Re: Multiple comparisons in a single statement

2020-03-12 Thread John Pote
On 12/03/2020 18:08, Chris Angelico wrote: On Fri, Mar 13, 2020 at 4:55 AM Stephen Tucker wrote: A quickie (I hope!). I am running Python 2.7.10 (and, yes, I know, support for it has been withdrawn.) This is the same in Python 3. I have three tuples that have been generated separately and

Re: Odd truth result with in and ==

2018-11-23 Thread John Pote
On 21/11/2018 19:18, Python wrote: $ python3 Python 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. 1 in [1,2,3] == True False 1 in ([1,2,3] == True) Traceback (most recent call last): File "", line

Re: regex pattern to extract repeating groups

2018-08-27 Thread John Pote
On 26/08/2018 00:55, Malcolm wrote: I am trying to understand why regex is not extracting all of the characters between two delimiters. The complete string is the xmp IFD data extracted from a .CR2 image file. I do have a work around, but it's messy and possibly not future proof. Do you mean f

Re: curses, ncurses or something else

2018-07-25 Thread John Pote
On 24/07/2018 16:13, Peter Pearson wrote: On Mon, 23 Jul 2018 23:24:18 +0100, John Pote wrote: I recently wrote a command line app to take a stream of numbers, do some signal processing on them and display the results on the console. There may be several output columns of data so a title line

curses, ncurses or something else

2018-07-23 Thread John Pote
I recently wrote a command line app to take a stream of numbers, do some signal processing on them and display the results on the console. There may be several output columns of data so a title line is printed first. But the stream of numbers may be several hundred long and the title line disap

Re: csv module and NULL data byte

2018-03-07 Thread John Pote
On 07/03/2018 07:59, Andrew McNamara wrote: Last time I read the documentation, it was recommended that the file be opened in BINARY mode ("rb"). It recommends binary mode, but seems to largely work fine with text/ascii mode or even arbitrary iterables. I've not seen the rationale behin

Re: csv module and NULL data byte

2018-03-01 Thread John Pote
On 01/03/2018 01:35, Tim Chase wrote: While inelegant, I've "solved" this with a wrapper/generator f = file(fname, …) g = (line.replace('\0', '') for line in f) I wondered about something like this but thought if there's a way of avoiding the extra step it would keep the execution speed u

Re: csv module and NULL data byte

2018-03-01 Thread John Pote
On 01/03/2018 02:38, Dennis Lee Bieber wrote: On Wed, 28 Feb 2018 23:40:41 +, John Pote declaimed the following:     with open( fname, 'rt', encoding='iso-8859-1' ) as csvfile: Pardon? Has the CSV module changed in the last year or so? Python 3.6 docs say

csv module and NULL data byte

2018-02-28 Thread John Pote
I have a csv data file that may become corrupted (already happened) resulting in a NULL byte appearing in the file. The NULL byte causes an _csv.Error exception. I'd rather like the csv reader to return csv lines as best it can and subsequent processing of each comma separated field deal with

Re: async serial port in Python.

2017-12-18 Thread John Pote
On 18/12/2017 23:20, Les Cargill wrote: What I'd like to do is set up *some* sort of method in Python to asynchronously use callbacks to receive characters from a serial port or 20 serial ports. If I have to hook an event loop or even spawn a thread - fine! but it needs to allow for making th

Re: f-string

2017-12-08 Thread John Pote
On 06/12/2017 00:16, Steve D'Aprano wrote: > Anyone got a handy copy of Python 3.6 available to test something for me? > > What does compile('f"{spam} {eggs}"', '', 'single') return? > > What does eval()'ing the above compiled object do? If necessary, you may have > to define spam and eggs first.

Re: f-string

2017-12-05 Thread John Pote
On 06/12/2017 00:16, Steve D'Aprano wrote: Anyone got a handy copy of Python 3.6 available to test something for me? What does compile('f"{spam} {eggs}"', '', 'single') return? What does eval()'ing the above compiled object do? If necessary, you may have to define spam and eggs first. Thanks

How to shut down a TCPServer serve_forever() loop?

2017-11-25 Thread John Pote
Hi all, My problem in summary is that my use of the shutdown() method only shuts down a server after the next TCP request is received. I have a TCP server created in the run() method of a thread.     class TCPlistener( Thread ):         def run( self ):       with socketserver.TCPServer(

Easiest way to access C module in Python

2017-11-06 Thread John Pote
Hi all, I have successfully used Python to perform unit and integration tests in the past and I'd like to do the same for some C modules I'm working with at work. There seem to be a number of ways of doing this but being busy at work and home I looking for the approach with the least learning c

Re: Old Man Yells At Cloud

2017-09-16 Thread John Pote
On 16/09/2017 19:00, Stefan Ram wrote: Steve D'Aprano writes: "Hi, I've been programming in Python for what seems like days now, and here's all the things that you guys are doing wrong. I never ever have written a line of Python 2. I started with Python 3.6.0. Yet a very frequent mista

Re: Mapping with continguous ranges of keys

2016-12-16 Thread John Pote
On 16/12/2016 14:27, Steve D'Aprano wrote: (2) The clever solution: use a pair of lists, one holding the starting value of each group of keys, and the other holding the common values. This saves a lot of memory, but is slower. A concrete example might help. Suppose I have 15 keys in five groups

Re: Why doesn't Python include non-blocking keyboard input function?

2016-10-25 Thread John Pote
If you are on a windows platform you could use kbhit() from the msvcrt module as Steven D does in his solution on the activestate site which also works for xNIX. Worth a look at his code to see how these sort of things are done on xNIX. Alternatively you could use a couple of threads. One for

Re: get the sum of differences between integers in a list

2016-09-20 Thread John Pote
On 20/09/2016 12:52, Daiyue Weng wrote: Hi, I have a list numbers say, [1,2,3,4,6,8,9,10,11] First, I want to calculate the sum of the differences between the numbers in the list. At least for this first part a little pencil, paper and algebra yields a simple formula of constant and minimal c

Re: Sharing package data across files

2016-06-28 Thread John Pote
On 28/06/2016 20:55, zackba...@gmail.com wrote: On Tuesday, June 28, 2016 at 1:17:23 PM UTC-6, scott...@gmail.com wrote: I'm trying to create a package in which the constituent files share some state. Apparently, I don't understand scopes, namespaces, and package semantics as well as I thou

Re: Recommendation for GUI lib?

2016-06-04 Thread John Pote
On 02/06/2016 22:57, Dietmar Schwertberger wrote: On 02.06.2016 12:35, John Pote wrote: I've used wxPython (www.wxpython.org) for a few GUI projects and found it ok. It's a wrapper for the wxWidgets C++ library. There's even a reasonable free GUI builder, wxGlade, which I

Re: Recommendation for GUI lib?

2016-06-02 Thread John Pote
On 01/06/2016 18:13, Jan Erik Moström wrote: I want to write a few programs with a GUI but I don't want to use Tk. Instead I'm looking for some other library, I've tried to look around and also asked a few but I don't really know what to use. I've used wxPython (www.wxpython.org) for a few GUI

Re: Serious error in int() function?

2016-04-15 Thread John Pote
On 15/04/2016 03:38, Christian Gollwitzer wrote: Am 15.04.16 um 02:36 schrieb Dennis Lee Bieber: I should also have said that the square root of integer squares with between 15 and 30 decimal digits will only be correct if the square numbers themselves are exactly representable in 53 bits. So

Re: REMOVE ME

2016-04-11 Thread John Pote
On 10/04/2016 04:52, Chris Angelico wrote: On Sun, Apr 10, 2016 at 1:46 PM, fan nie wrote: -- https://mail.python.org/mailman/listinfo/python-list Sure. I presume you mean something like this: class Thing: things = [] def __init__(self): self.things.append(self) def __

Evaluating error strings for 'unittest' assert methods.

2016-04-06 Thread John Pote
I have been writing a very useful test script using the standard Python 'unittest' module. This works fine and has been a huge help in keeping the system I've been writing fully working even when I make changes that could break many features of the system. eg major rewrite of the interrupt rout

Re: How to make Python interpreter a little more strict?

2016-03-26 Thread John Pote
On 26/03/2016 12:05, Chris Angelico wrote: On Fri, Mar 25, 2016 at 11:06 PM, Aleksander Alekseev wrote: Recently I spend half an hour looking for a bug in code like this: eax@fujitsu:~/temp$ cat ./t.py #!/usr/bin/env python3 for x in range(0,5): if x % 2 == 0: next print(

Re: How to do integers to binary lists and back

2015-05-29 Thread John Pote
On 21/05/2015 23:31, MRAB wrote: On 2015-05-21 23:20, John Pote wrote: Hi everyone. I recently had the problem of converting from an integer to its representation as a list of binary bits, each bit being an integer 1 or 0, and vice versa. E.G. 0x53 becomes [ 0, 1, 0, 1, 0, 0, 1, 1 ] This I

How to do integers to binary lists and back

2015-05-21 Thread John Pote
Hi everyone. I recently had the problem of converting from an integer to its representation as a list of binary bits, each bit being an integer 1 or 0, and vice versa. E.G. 0x53 becomes [ 0, 1, 0, 1, 0, 0, 1, 1 ] This I wanted to do for integers of many tens, if not hundreds, of bits. Python

Re: Enumerating loggers iin logging module

2015-01-03 Thread John Pote
Thanks for the replies, thought there'd be a simple answer. Much appreciated. John On 30/12/2014 22:40, Chris Angelico wrote: On Wed, Dec 31, 2014 at 8:24 AM, Tim Chase wrote: While it may involve reaching into the objects may or may not be blessed, the following seems to work for me in Py2.7

Re: Talking to a 'C' program

2013-11-08 Thread John Pote
John On 8 Nov 2013, at 15:00, Grant Edwards wrote: > On 2013-11-08, John Pote wrote: >> Hi all, >> >> I have the task of testing some embedded 'C' code for a small >> micro-controller. Thought it would be a good idea to test it on the >> PC f

Talking to a 'C' program

2013-11-08 Thread John Pote
Hi all, I have the task of testing some embedded 'C' code for a small micro-controller. Thought it would be a good idea to test it on the PC first to make sure the algorithm is correct then perhaps test it on the controller via RS232 and an appropriate wrapper round the 'C' functions. On the P

Re: global variable across modules

2013-09-11 Thread John Pote
Sorry about the html - did not realise. Thanks for your comments. John On 11 Sep 2013, at 22:49, John Pote wrote: > Chris, > Interesting. >> >> # Test1.py >> Debug_Value = " " >> >> # Test2.py >> from Test1 import * >> # is exactly eq

Re: global variable across modules

2013-09-11 Thread John Pote
Chris, Interesting. > > # Test1.py > Debug_Value = " " > > # Test2.py > from Test1 import * > # is exactly equivalent to > Debug_Value = " " > I take it then that assigning to Debug_Value in Test2.py will not change the value of Debug_Value in Test1.py. That being the case it would be wrong t

Re: help needed with subprocess, pipes and parameters

2012-07-17 Thread John Pote
nuffi, Have you tried running your piped commands c:\Programs\bob\bob.exe -x -y "C:\text\path\to some\file.txt" | c:\Programs\kate\kate.exe -A 2 --dc "Print Media Is Dead" --da "Author" --dt "Title" --hf "Times" --bb "14" --aa "" --font "Ariel" - "C:\rtf\path\to some\file.rtf" in a single i

New Python build regr test___all__ fails at 'ctypes.macholib.dyld'

2012-07-13 Thread John Pote
Hi, I have built Python 2.7.3 from source and although the interpreter starts up and runs scripts (so far OK) the 'test___all__' regression test fails. The machine I'm building on is a virtual server running a version of Red Hat Linux Build commands: ./configure --prefix /usr

select module missing/corrupt

2012-07-07 Thread John Pote
ss imports OK. Anyone know why the version 2.6 select .so file should be renamed select_failed.so and so not able to be imported? Of interest the 3.1 installation also has the select module file re-named select_failed.so. Any help appreciated, Regards, John Pote --- Poste

select.poll and winXP

2007-03-20 Thread John Pote
Hi all, I have the standard Python 2.4.4 windows download installed on my win XP box. But the poll class in module select is not available. The docs indicate that it can work with windows as long as only sockets are used which is fine for me. Is there a reason it's not in the standard build, c

where has Stani's Py Editor gone?

2007-01-31 Thread John Pote
Hi everyone, Been trying to get the latest version of Stani's Python Editor the last few days. But I cannot get any response out of 'pythonide.stani.be'. Anyone know what's happened? Ta much, John Pote -- http://mail.python.org/mailman/listinfo/python-list

Re: knowing when file is flushed to disk

2006-08-10 Thread John Pote
Thanks for the replies. I guessed the situation would be flush() and trust. The probability of a crash between flush() returning and data actually written resulting in a trashed disk must be very small. But if you can be certain without too much effort it's got to be a good idea, so I thought I'

knowing when file is flushed to disk

2006-08-09 Thread John Pote
Hello, I'm using a Python CGI script on a web server to log data from a remote site every few minutes. I do not want to lose any data for whatever rare reason - power outage/os crash just at the wrong moment etc. So I would like to know when the data is actually written to disk and the file clo

Re: Python Evangelism

2006-03-17 Thread John Pote
respects. I think the language has already made Python, the rest is down to its 'environment'. Best wishes to everyone, John Pote "Douglas Alan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Andrew Gwozdziewycz <[EMAIL PROTECTED]> writes: &

Re: python2.4.2 + win95, import socket dll error

2006-03-16 Thread John Pote
a variant of the spybot worm. Thanks for helping solve the problem, All the best John Pote "Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 16 Mar 2006 01:09:24 GMT, "John Pote" > <[EMAIL PROTECTED]> declaimed the

python2.4.2 + win95, import socket dll error

2006-03-15 Thread John Pote
ry files needed to run this applic ation cannot be found. Is it the same dll in both cases, any idea what it might be and where could I find a copy? Many thanks, John Pote -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Evangelism

2006-03-09 Thread John Pote
ions that can be thrown. This leaves the programmer with using a catch all (frowned upon) or scanning through hundreds/thousands of lines of code in possibly deeply nested modules. The beer's run out so I'll stop here. keep at it everyone, best regards, John Pote -- http://mail.python.org/mailman/listinfo/python-list

wanted: ftp server class

2006-03-06 Thread John Pote
ource of a Python ftp server class (ftplib only has a client class) out there. (These days I try to keep all my programming to Python!). I seem to remember reading Twisted has some ftp server facilities. Does it? Any comments on it - easy to use, steep learning curve? Any help appreciated,

Re: sockets, where can I find documentation?

2006-03-03 Thread John Pote
Thanks everyone for such a quick response. Brilliant! John Pote "John Pote" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > I want to use python on a server to access incoming TCP port accesses. So > I need to use the socket interface whic

sockets, where can I find documentation?

2006-03-03 Thread John Pote
53 titled Basic Socket Interface Extensions for IPv6. Where can I get the various papers mentioned in the manual? And as I like books sitting on the shelf can someone recommend a book on sockets. many thanks, John Pote -- http://mail.python.org/mailman/listinfo/python-list

Re: Hi reliability files, writing,reading,maintaining

2006-02-09 Thread John Pote
eron Laird" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In article <[EMAIL PROTECTED]>, > Martin P. Hellwig <[EMAIL PROTECTED]> wrote: >>John Pote wrote: >> >>> So my request: >>> 1. Are there any python modules 'out there&#

Hi reliability files, writing,reading,maintaining

2006-02-09 Thread John Pote
g such files. 2. Can anyone suggest a book or two on this kind of file management. (These kind of problems must have been solved in the financial world many times). Many thanks, John Pote -- http://mail.python.org/mailman/listinfo/python-list

Hi reliability files, writing,reading and maintaining

2006-02-07 Thread John Pote
curely writing such files. 2. Can anyone suggest a book or two on this kind of file management. (These kind of problems must have been solved in the financial world many times). Many thanks, John Pote -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter menu bar problem

2005-02-10 Thread John Pote
ound options are being ignored and the window retains its standard windows colour scheme which I assume is overriding the background colour option. I guess my normal windows colour scheme (classic windows!) is not so bad and life is too short to tinker with this any more. Thanks again John

tkinter menu bar problem

2005-02-09 Thread John Pote
so a tick mark against an item would be useful to show the currently selected option. Is this possible? Regards, John Pote System: Win XP, Python 2.3.4 -- http://mail.python.org/mailman/listinfo/python-list

Python application extending, plugins

2005-01-07 Thread John Pote
Any thoughts would be appreciated. John Pote -- http://mail.python.org/mailman/listinfo/python-list

Re: Multithreading tkinter question

2004-12-16 Thread John Pote
ta rather than my continuous polling approach. Would a Queue help here? John Pote "Martin Franklin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 09 Nov 2004 17:41:56 GMT, John Pote <[EMAIL PROTECTED]> > wrote: > >> Running my programme in