SOLVED: Tkinter button-motion event behaves differently under Windows and Linux

2024-11-11 Thread John O'Hagan via Python-list
I'm posting this in case anyone else encounters the same problem, and to ask for suggestions, if any, about a better way to do it. I'm implementing a method for dragging embedded widgets on a Text widget. When the left mouse button is held down over an embedded widget and the mouse is dragged acro

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-12 Thread John O'Hagan via Python-list
On Wed, 2023-09-13 at 01:33 +0100, MRAB via Python-list wrote: > On 2023-09-13 00:40, John O'Hagan via Python-list wrote: > > On Tue, 2023-09-12 at 20:51 +0200, Mirko via Python-list wrote: > > > Am 12.09.23 um 07:43 schrieb John O'Hagan via Python-list: > >

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-12 Thread John O'Hagan via Python-list
On Tue, 2023-09-12 at 20:51 +0200, Mirko via Python-list wrote: > Am 12.09.23 um 07:43 schrieb John O'Hagan via Python-list: > > > My issue is solved, but I'm still curious about what is happening > > here. > > MRAB already said it: When you enter the callbac

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-12 Thread John O'Hagan via Python-list
On Mon, 2023-09-11 at 22:25 +0200, Mirko via Python-list wrote: > Am 11.09.23 um 14:30 schrieb John O'Hagan via Python-list: > > I was surprised that the code below prints 'called' three times. > > > > > > from tkinter import * > > from tkin

Tkinter ttk Treeview binding responds to past events!

2023-09-11 Thread John O'Hagan via Python-list
ound this by using a regular button-click binding for selection instead, but I'm curious if anyone can cast any light on this. Cheers John -- https://mail.python.org/mailman/listinfo/python-list

pip module not found

2023-05-12 Thread David John
Hi, I recently have been experiencing issues with the pip installation module. I have python version 3.11 installed. I've checked the directory installed in the systems variables window and nothing is amiss. Kindly assist. Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Re: Tkinter and cv2: "not responding" popup when imshow launched from tk app

2023-03-18 Thread John O'Hagan
On Tue, 2023-03-14 at 21:54 +1100, John O'Hagan wrote: [...] > Here is minimal code that demonstrates the problem in the subject > line: > > import cv2 > from tkinter import * > > images=['a.jpg', 'b.jpg', 'c.jpg'] #change to image paths

Re: Tkinter and cv2: "not responding" popup when imshow launched from tk app

2023-03-17 Thread John O'Hagan
On Thu, 2023-03-16 at 04:21 -0400, aapost wrote: > On 3/15/23 07:37, John O'Hagan wrote: > > On Tue, 2023-03-14 at 16:22 -0400, aapost wrote: > > > On 3/14/23 06:54, John O'Hagan wrote: > > > > [...] > > > > > > > Read an alter

Re: Tkinter and cv2: "not responding" popup when imshow launched from tk app

2023-03-15 Thread John O'Hagan
On Tue, 2023-03-14 at 16:22 -0400, aapost wrote: > On 3/14/23 06:54, John O'Hagan wrote: [...] > > > > Here is minimal code that demonstrates the problem in the subject > > line: > > > > import cv2 > > from tkinter import * > > > > i

Re: Tkinter and cv2: "not responding" popup when imshow launched from tk app

2023-03-14 Thread John O'Hagan
this query? Thanks -- John > -- https://mail.python.org/mailman/listinfo/python-list

Re: Tkinter and cv2: "not responding" popup when imshow launched from tk app

2023-03-14 Thread John O'Hagan
On Tue, 2023-03-14 at 08:07 -0400, Thomas Passin wrote: > On 3/14/2023 6:54 AM, John O'Hagan wrote: > > Hi list > > > > I'm trying to use cv2 to display images created as numpy arrays, > > from > > within a tkinter app (which does other things with the

Tkinter and cv2: "not responding" popup when imshow launched from tk app

2023-03-14 Thread John O'Hagan
omething similar to detect stuck apps. But the app is not stuck. I suspect this is some kind of interaction between the call to cv2.waitKey (which is necessary but I've never understood why!) and the tkinter event loop, but it's beyond my knowledge. Any suggestions about causes or workarounds? Thanks -- John -- https://mail.python.org/mailman/listinfo/python-list

Re: tkinter ttk.Treeview: changing background colour of single item when selected

2023-02-12 Thread John O'Hagan
On Sun, 2023-02-12 at 08:59 -0500, Thomas Passin wrote: [...] > On 2/12/2023 6:10 AM, John O'Hagan wrote: [...] > > > > My goal was to be able to change the colour of an individual item > > regardless of whether it is selected or not. To do that, it is > > ne

Re: tkinter ttk.Treeview: changing background colour of single item when selected

2023-02-12 Thread John O'Hagan
On Mon, 2023-02-06 at 10:19 -0800, stefalem wrote: > Il giorno sabato 4 febbraio 2023 alle 11:43:29 UTC+1 John O'Hagan ha > scritto: > ... > > > Is there another way to do what I want?  > > from tkinter import * > from tkinter.ttk import * > > root = T

tkinter ttk.Treeview: changing background colour of single item when selected

2023-02-04 Thread John O'Hagan
em, but they apply to all items in the Treeview and would flash all selected items, not just the one I want to keep flashing. Is there another way to do what I want? Thanks -- John -- https://mail.python.org/mailman/listinfo/python-list

[Help Request] Embedding Python in a CPP Application Responsibly & Functionally

2023-01-25 Thread John McCardle
leave me with a working pip: `$ LD_LIBRARY_PATH=./Python-3.11.1 ./Python-3.11.1/python >>> import venv >>> venv.create("./venv", with_pip=True) subprocess.CalledProcessError: Command '['/home/john/Development/7DRL/cpp_embedded_python/venv/bin/python', '-m

Re: sqlite3 double quote behavior

2022-12-15 Thread John K. Parejko
hard it would be to raise up the `sqlite3_db_config` generically, or have a specific function to set just the DQS_DDL and DQS_DML settings? It looks like everything interesting is in `Modules/_sqlite/module.c`, but I’m not familiar with the cpython internals. John > On 13Dec 2022, at 13

sqlite3 double quote behavior

2022-12-12 Thread John K. Parejko
`sqlite3_db_config` is used within the python sqlite3 codebase at all, so this might not be a trivial change? I only see two references to it in the cpython github. Thank you in advance for any suggestions, John 1: https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted 2: https

Issues

2022-04-08 Thread Stevenson, John B via Python-list
do to fix this? Error sent back is "'python' is not recognized as an internal or external command, operable program or batch file." Thank you. John B. (Jack) Stevenson -- https://mail.python.org/mailman/listinfo/python-list

Recoding Categorical to Numerical

2021-08-16 Thread John Griner
thanks Virus-free. www.avast.com <#m_4567368322047

Re: Regarding inability of Python Module Winsound to produce beep in decimal frequency

2021-08-14 Thread John O'Hagan
aren't too many options in pure python for playing audio - to do anything complicated I've used applications such as Fluidsynth and sox as python subprocesses. But for playing purely generated tones, here's an example that doesn't limit frequency precision, using pyaudio to play a num

Recoding Categorical to Numerical

2021-08-13 Thread John Griner
City to 2, and Town to 4, etc. Again, thanks, John loca <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon> Virus-free. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_sourc

John Griner Python Tutor Available

2021-08-09 Thread John Griner
etime, I will offer other, more advanced courses. If you would like the link to join, I can provide the link, and if you ae unsure of whether or not you want to take the courses, just take the free workshop. Best, John Griner [1][IMG] Virus-free. [2]www.avast.com Refer

Re: Tkinter long-running window freezes

2021-03-02 Thread John O'Hagan
On Wed, 24 Feb 2021 22:35:32 +1100 John O'Hagan wrote: > Hi list > > I have a 3.9 tkinter interface that displays data from an arbitrary > number of threads, each of which runs for an arbitrary period of time. > A frame opens in the root window when each thread starts and cl

Re: Tkinter long-running window freezes

2021-02-26 Thread John O'Hagan
On Sat, 27 Feb 2021 10:59:24 +1100 John O'Hagan wrote: > On Fri, 26 Feb 2021 08:19:14 +0100 > Christian Gollwitzer wrote: [...] > > > Can you also check this program, which reuses the same widget path > > name, albeit does the crea

Re: Tkinter long-running window freezes

2021-02-26 Thread John O'Hagan
On Sat, 27 Feb 2021 01:06:06 + MRAB wrote: > On 2021-02-26 23:59, John O'Hagan wrote: > > On Fri, 26 Feb 2021 08:19:14 +0100 > > Christian Gollwitzer wrote: > > > >> Am 26.02.21 um 06:15 schrieb John O'Hagan: > > [...] > >> >

Re: Tkinter long-running window freezes

2021-02-26 Thread John O'Hagan
On Fri, 26 Feb 2021 08:19:14 +0100 Christian Gollwitzer wrote: > Am 26.02.21 um 06:15 schrieb John O'Hagan: [...] > > > > I've followed your suggestions as per my last post, and can confirm > > the same freezing behaviour when running your code directly as a >

Re: Tkinter long-running window freezes

2021-02-25 Thread John O'Hagan
On Thu, 25 Feb 2021 21:57:19 +0100 Christian Gollwitzer wrote: > Am 24.02.21 um 12:35 schrieb John O'Hagan: > > Hi list > > > > I have a 3.9 tkinter interface that displays data from an arbitrary > > number of threads, each of which runs for an arbitrary period o

Re: Tkinter long-running window freezes

2021-02-25 Thread John O'Hagan
On Thu, 25 Feb 2021 11:06:05 -0500 Richard Damon wrote: > On 2/24/21 6:35 AM, John O'Hagan wrote: > > Here is some minimal, non-threaded code that reproduces the problem > > on my system (Xfce4 on Debian testing): > > > > from tkinter import * > > from r

Re: Tkinter long-running window freezes

2021-02-25 Thread John O'Hagan
On Thu, 25 Feb 2021 09:54:15 -0500 Terry Reedy wrote: > On 2/24/2021 6:53 PM, John O'Hagan wrote: > > On Wed, 24 Feb 2021 11:03:30 -0500 > > Terry Reedy wrote: > > > >> On 2/24/2021 6:35 AM, John O'Hagan wrote: > > [...] > >> >

Re: Tkinter long-running window freezes

2021-02-24 Thread John O'Hagan
On Thu, 25 Feb 2021 00:27:33 + MRAB wrote: > On 2021-02-24 23:23, John O'Hagan wrote: [...] > > In case it's relevant, to clarify what I mean by "freeze": the > > window continues to display the digits indefinitely if no attempt > > is made to inter

Re: Tkinter long-running window freezes

2021-02-24 Thread John O'Hagan
On Wed, 24 Feb 2021 11:03:30 -0500 Terry Reedy wrote: > On 2/24/2021 6:35 AM, John O'Hagan wrote: [...] > > I am trying this out on Windows 10, with a wider label (so I can move > the window) and a button that changes when pressed, and a sequential > counter. Will re

Re: Tkinter long-running window freezes

2021-02-24 Thread John O'Hagan
On Wed, 24 Feb 2021 13:07:24 + MRAB wrote: > On 2021-02-24 11:35, John O'Hagan wrote: [...] > > > > Here is some minimal, non-threaded code that reproduces the problem > > on my system (Xfce4 on Debian testing): > > > > from tkinter import * > &

Tkinter long-running window freezes

2021-02-24 Thread John O'Hagan
increases to around 30 or so by the time it freezes. Any ideas what could be causing this, or even how to approach debugging or workarounds? Thanks -- John -- https://mail.python.org/mailman/listinfo/python-list

Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2021-01-01 Thread john steve
On Wednesday, December 30, 2020 at 9:03:28 AM UTC-8, Chris Green wrote: > Anssi Saari wrote: > > Chris Green writes: > > > > > Why are there both /usr/lib/python3 and /usr/lib/python3.8 on my > > > x[ubuntu] system? > > > > While it's more of an Ubuntu (or Debian) question better asked in s

Re: GUI (tkinter) popularity and job prospects for

2020-10-23 Thread John Pote
en gobject or wx. Tkinter would probably be last. I've used tkinter and wxPython occasionally in the past for 1 off test tasks (and interest). What's the advantage of Qt? John -- https://mail.python.org/mailman/listinfo/python-list

Re: Threading plus multiprocessing plus cv2 error

2020-09-01 Thread John O'Hagan
On Sun, 30 Aug 2020 09:59:15 +0100 Barry Scott wrote: > > > > On 29 Aug 2020, at 18:01, Dennis Lee Bieber > > wrote: > > > > On Sat, 29 Aug 2020 18:24:10 +1000, John O'Hagan > > declaimed the following: > > > >> There's no e

Re: Threading plus multiprocessing plus cv2 error

2020-08-30 Thread John O'Hagan
On Sat, 29 Aug 2020 13:01:12 -0400 Dennis Lee Bieber wrote: > On Sat, 29 Aug 2020 18:24:10 +1000, John O'Hagan > declaimed the following: > > >There's no error without the sleep(1), nor if the Process is started > >before the Thread, nor if two Processes are used

Threading plus multiprocessing plus cv2 error

2020-08-29 Thread John O'Hagan
ad. IOW the error only occurs if a Thread is started first, and a Process is started a little later. Any ideas what might be causing the error? Thanks. -- John -- https://mail.python.org/mailman/listinfo/python-list

RE: Syntax Help

2020-06-11 Thread John Weller
the family IT guru 😊 I have been able to find answers to most problems by Googling but couldn't work out a suitable query for this one. I have signed up for the tutors list. Thanks again John Weller 01380 723235 07976 393631 -Original Message- From: Python-list On Behalf Of DL

Syntax Help

2020-06-10 Thread John Weller
Hi I am trying to learn python. Looking at an example on the web I found this line: def plot(*args, **kwargs): What do the stars mean? TIA John Weller 01380 723235 07976 393631 -- https://mail.python.org/mailman/listinfo/python-list

exiting a while loop

2020-05-22 Thread John Yeadon via Python-list
Am I unreasonable in expecting this code to exit when required? # Add up the powers of 2 starting with 2**0 until 2 million is met. n = 1 target = 200 sum = 0 while True: x = 2 ** (n - 1) sum += x print(n, sum) if sum >= target: print("Target met.") exit

Re: Should setuptools version propagate to a module's __version__? If so, how?

2020-05-10 Thread John Ladasky
On Saturday, May 9, 2020 at 8:17:19 PM UTC-7, Cameron Simpson wrote: > I also autopatch the module itself to > set __version__ to match when I make that release tag. Yes, that's exactly what the module I wrote for my company's internal use does. The official version number is hard-coded into se

Re: Should setuptools version propagate to a module's __version__? If so, how?

2020-05-08 Thread John Ladasky
On Friday, May 8, 2020 at 6:07:33 PM UTC-7, John Ladasky wrote: > Is there a recommended way to keep the internal reference and the setup.py > reference in sync? Is there any reason someone would NOT want these numbers > to match? Replying to myself... I just found thi

Should setuptools version propagate to a module's __version__? If so, how?

2020-05-08 Thread John Ladasky
I just came across a package in PyPI which is in a state of neglect. The official version on the PyPI page is 1.3.1 -- but the installed module reports its version as 1.2.0. This is confusing. There are several bugs in this package besides the mismatched version number. I've forked a copy of

Re: Multiprocessing vs. concurrent.futures, Linux vs. Windows

2020-05-04 Thread John Ladasky
On Monday, May 4, 2020 at 4:09:53 PM UTC-7, Terry Reedy wrote: > On 5/4/2020 3:26 PM, John Ladasky wrote: > > Several years ago I built an application using multiprocessing. It only > > needed to work in Linux. I got it working fine. At the time, > > concurrent.

Multiprocessing vs. concurrent.futures, Linux vs. Windows

2020-05-04 Thread John Ladasky
Several years ago I built an application using multiprocessing. It only needed to work in Linux. I got it working fine. At the time, concurrent.futures did not exist. My current project is an application which includes a PyQt5 GUI, and a live video feed with some real-time image processing.

Re: ModuleNotFoundError, even though I can see module in dist-packages folder, Setuptools / EGG issue?

2020-04-08 Thread John Ladasky
On Wednesday, April 8, 2020 at 10:47:42 AM UTC-7, John Ladasky wrote: > Hi folks, > > Something broke in my Python installation in the past two or three days. I'm > working in Ubuntu 19.10 and Python 3.7, without virtual environments. > > I have two modules of Pytho

ModuleNotFoundError, even though I can see module in dist-packages folder, Setuptools / EGG issue?

2020-04-08 Thread John Ladasky
Hi folks, Something broke in my Python installation in the past two or three days. I'm working in Ubuntu 19.10 and Python 3.7, without virtual environments. I have two modules of Python source code that I am developing. I regularly change this code and "distribute" it to myself using setupt

Re: Multiple comparisons in a single statement

2020-03-12 Thread John Pote
chained comparisons to change to an 'or' operation (Python always does the 'and' operation in chained comparisions). EG for simple integers instead of tuples, >>> not (1==1==1) False >>> not (2==1==1) True >>> (1!=1!=1) False  correct as before >>> (2!=1!=1) False  oops! John ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Threading hang problems with requests module

2020-01-13 Thread John Levine
join() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 1011, in join self._wait_for_tstate_lock() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 1027, in _wait_for_tstate_lock elif lock.acquire(block, timeout): KeyboardInterrupt -- Regards, John Levine, jo...@taugh.com, Primary Perpetrator of "The Internet for Dummies", Please consider the environment before reading this e-mail. https://jl.ly -- https://mail.python.org/mailman/listinfo/python-list

Re: How to specific multiple dtypes in numpy.ndarray?

2019-12-21 Thread John Ladasky
On Thursday, December 19, 2019 at 2:53:18 AM UTC-8, lampahome wrote: > I meet performance is low when I use struct.unpack to unpack binary data. > > So I tried to use numpy.ndarray > But meet error when I want to unpack multiple dtypes > > Can anyone teach me~ > > Code like below: > # python3 >

Re: "Don't install on the system Python"

2019-12-01 Thread John Ladasky
On Sunday, December 1, 2019 at 12:47:43 AM UTC-8, Cameron Simpson wrote: > On 01Dec2019 09:29, Manfred Lotz <...@posteo.de> wrote: > >On Sat, 30 Nov 2019 20:42:21 -0800 (PST) > >John Ladasky <...@sbcglobal.net> wrote: > >> For years, I've read war

"Don't install on the system Python"

2019-11-30 Thread John Ladasky
Long-time Ubuntu user here. For years, I've read warnings about not installing one's personal stack of Python modules on top of the system Python. It is possible to corrupt the OS, or so I've gathered. Well, I've never heeded this advice, and so far nothing bad has happened to me. I don't li

Full stack trace in pdb.post_mortem() ?

2019-11-01 Thread John W
I'm trying to understand pdb.post_mortem(), and why the backtrace available in the debugger session seems limited. I posted a similar question on stackoverflow[1], but figured I'd try here as well. Here's a simple program import pdb def inner(): raise Exception("bad stuff")

Re: Meanwhile Norwegian trolls created ...

2019-08-19 Thread John Ladasky
On Saturday, August 17, 2019 at 2:40:14 AM UTC-7, Abdur-Rahmaan Janhangeer wrote: > But it is not so easy to combine different memory management paradigms. Oh, I feel this. I love the look and feel of PyQt5, but object management has bitten me more than once. -- https://mail.python.org/mailman

Re: Amber Brown: Batteries Included, But They're Leaking

2019-05-19 Thread John Ladasky
mpy is not part of the Python stdlib. On Monday, September 18, 2017 at 10:21:55 PM UTC+1, John Ladasky wrote: > OK, I found this statement intriguing. Honestly, I can't function without > Numpy, but I have always assumed that many Python programmers do so. > Meanwhile: most of th

Re: python book

2019-04-16 Thread John Doe
On 2019-04-16, Larry Martell wrote: > https://www.reddit.com/r/Python/comments/bc2606/just_found_the_best_python_bookcover NOT FOUND -- https://mail.python.org/mailman/listinfo/python-list

newer version

2019-04-09 Thread John Doe
I've already -X555UJ:~$ python python python3python3.6m python3m python2python3.6 python3.6m-config python3m-config python2.7 python3.6-config python3-config Wondering if not add Python3.7 yet if so should I just do: sudo apt instal

Re: Losing words

2019-04-02 Thread John Doe
On 2019-04-01, Paul Rubin wrote: > John Doe writes: >> sendall also is not sending a whole sentence. > > Have you observed that with something like wireshark? > I was about colon ":" before message with a colon a whole message is " before message wit

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Abdur-Rahmaan Janhangeer wrote: > Since this is IRC, you might want to see a demo here: > https://github.com/Abdur-rahmaanJ/honeybot/blob/master/honeybot/main.py Yes. However get these def text() and loop while 1: working together. def text(): while True: mess = input

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Rhodri James wrote: > > I'm not an expert, but looking at RFC-1459 it looks like your final > parameter (the message) needs to be preceded by a colon. In other words > you want: > > s.send(bytes("PRIVMSG " + channel + " :" + mess + "\n", "UTF-8")) > > (Try printing out the line y

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Chris Angelico wrote: > > Cool. Please don't post context-free messages though - not everyone > knows that you were talking about IRC. (Part of that is because your > subject line didn't mention IRC either.) > I've mentioned it in a mother post mate. > If you're going to do a lot w

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Roel Schroeven wrote: > This is what 'while' is made for: > > def text(): > while True: > mess = input("> ") > s.send(bytes("PRIVMSG " + " "+ channel + " " + mess + "\n", > "UTF-8")) > see it working thanks, indeed while is powerful, had to add colon to b

Re: Losing words

2019-04-01 Thread John Doe
The colon was the solution, thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Chris Angelico wrote: > > Use a loop, not recursion :) > I can guess only you mean: while but I've got no idea while what. -- https://mail.python.org/mailman/listinfo/python-list

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Joel Goldstick wrote: >> >> def text(): >> mess = input("> ") >> s.send(bytes("PRIVMSG " + " "+ channel + " " + mess + "\n", "UTF-8")) >> >> text() >> > > Is this a typo or are you calling text() from within text()? >> Indeed I do :-) I was thinking on another way but

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Jon Ribbens wrote: > On 2019-04-01, John Doe wrote: >> I'm learning SOCKETS and working with Irc. >> --- >> s.send(bytes("PRIVMSG " + channel +" "+ message + "\n", "UTF-8")) >> --

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, David Raymond wrote: > https://docs.python.org/3.7/library/socket.html#socket.socket.send > > .send returns the number of bytes that it actually succeeded in sending. From > the docs: "Applications are responsible for checking that all data has been > sent; if only some of the dat

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Chris Angelico wrote: >> >> I'm learning SOCKETS and working with Irc. >> --- >> s.send(bytes("PRIVMSG " + channel +" "+ message + "\n", "UTF-8")) >> >> When more than one word ( for example: This is a message) >> in

Losing words

2019-04-01 Thread John Doe
I'm learning SOCKETS and working with Irc. --- s.send(bytes("PRIVMSG " + channel +" "+ message + "\n", "UTF-8")) When more than one word ( for example: This is a message) in *message* it sends the FIRST word only "This" and skips th

Your IDE's?

2019-03-25 Thread John Doe
What is your favorite Python IDE? -- https://mail.python.org/mailman/listinfo/python-list

Re: Implement C's Switch in Python 3

2019-02-05 Thread John Sanders
On Saturday, February 2, 2019 at 6:47:49 PM UTC-6, Sayth Renshaw wrote: > Hi > > I am trying to convert a switch statement from C into Python. (why? > practising). > > This is the C code. > > printf("Dated this %d", day); > switch (day) { > case 1: case 21: case 31: > printf("st"

Re: cant use def command

2019-02-02 Thread John Doe
On 2019-02-01, mb1541def 0 <12345678mb1541...@gmail.com> wrote: > > Hello, > I need help on the def command. > > My script: > > Import os > Test > > def Test(): > print(“test”) > os.system(“pause”) > > someone please help,it gives me an error in python 3. > I did everything right. > On 2019-02-01,

Re: get the terminal's size

2019-01-14 Thread John Doe
On 2019-01-14, Bob van der Poel wrote: > try this: > > > http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python > and have a look at this one too: https://stackoverflow.com/questions/1396820/apt-like-column-output-python-library/1446973#1446973 > -- https://mail.pyth

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

Creating Win .exe file from *.py on Linux

2018-10-02 Thread John Doe
Hello World Is it possible to create on Linux win .exe file from *.py file? -- https://mail.python.org/mailman/listinfo/python-list

Re: What's needed for jpegtran in Python 3?

2018-09-27 Thread John Ladasky
On Thursday, September 27, 2018 at 10:48:16 AM UTC-7, Chris Green wrote: > I think that must be what I have already installed, it doesn't make > the module available in Python 3, it just says this when I try and > install it:- > > root@t470:~# pip install jpegtran-cffi > Requirement alread

Re: clever exit of nested loops

2018-09-27 Thread John Ladasky
On Wednesday, September 26, 2018 at 12:50:20 AM UTC-7, vito.d...@gmail.com wrote: > I have "abused" the "else" clause of the loops to makes a break "broke" more > loops I did this once upon a time. In recent years, when I start writing tricky nested loops, I frequently find myself reaching fo

Re: How to sort over dictionaries

2018-08-28 Thread John Ladasky
The top-level object you are showing is a list [], not a dictionary {}. It has dictionaries inside of it though. Do you want to sort the list? Python's sorted() function returns a sorted copy of a sequence. Sorted() has an optional argument called "key". Key accepts a second function which c

Re: regex pattern to extract repeating groups

2018-08-27 Thread John Pote
s from the camera to the digital negative format which many photo editors can handle.) Can send you sample .CR3 if you want to compare. Regards, John -- https://mail.python.org/mailman/listinfo/python-list

Re: Can pip install packages for all users (on a Linux system)?

2018-07-25 Thread John Ladasky
On Wednesday, July 25, 2018 at 7:15:35 AM UTC-7, Stephan Houben wrote: > Op 2018-07-24, John Ladasky schreef : > > I believe that I now have tensorflow 1.8 installed twice on my system, > > once for each user. If anyone can share how to convince pip to behave > > like Synapti

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

Can pip install packages for all users (on a Linux system)?

2018-07-24 Thread John Ladasky
I've been using "sudo pip3 install" to add packages from the PyPI repository. I have multiple user accounts on the computer in question. My goal is to install packages that are accessible to all user accounts. I know that using the Synaptic Package Manager in Ubuntu will install for all users

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

Getting process details on an operating system process/question answer by vouce

2018-07-16 Thread John T. Haggerty
So, it's early for me---and I'm not sure if these things can be done but I'd like to know the following: 1. How can Python connect to a running operating system process on a host operating system to see what part of the execution is like?---ie keep track of health stats like it's stuck on disk acc

Re: Matplotlib 3D limitations, please recommend alternative

2018-07-07 Thread John Ladasky
On Saturday, July 7, 2018 at 6:36:16 AM UTC-7, Rick Johnson wrote: > John Ladasky wrote: > > > Back then I wrote: > > > > "I have concluded that Qt, PyQt, and OpenGL are all > > rapidly-evolving, and huge, software packages. There may > > be compatibi

Re: Matplotlib 3D limitations, please recommend alternative

2018-07-06 Thread John Ladasky
On Wednesday, July 4, 2018 at 6:38:18 PM UTC-7, William Ray Wing wrote: > > On Jul 4, 2018, at 5:53 PM, John Ladasky wrote: [snip] > > I explored Python OpenGL bindings about three years ago, and quickly got > > bogged down. Even with Python to assist, dealing with OpenGL wa

Re: Matplotlib 3D limitations, please recommend alternative

2018-07-06 Thread John Ladasky
On Wednesday, July 4, 2018 at 3:30:32 PM UTC-7, Rick Johnson wrote: > On Wednesday, July 4, 2018 at 4:53:19 PM UTC-5, John Ladasky wrote: > > There are many 3D graphics packages on PyPI. Some appear to be quite > > specialized. I would appreciate your recommendations. Thanks! &g

Matplotlib 3D limitations, please recommend alternative

2018-07-04 Thread John Ladasky
I'm a regular Matplotlib user. Normally, I graph functions. I just attempted to graph an icosahedral surface using the plot_trisurf() methods of Matplotlib's Axes3D. I have discovered that Matplotlib is basically hard-wired for graphing functions, and therefore will not work for general-purpos

Re: Posting warning message

2018-06-10 Thread John Ladasky
On Sunday, June 10, 2018 at 7:47:01 AM UTC-7, T Berger wrote: > When I go to post a reply, I get a warning asking if I want my email address > (or other email addresses listed) visible to all, and do I want to edit my > post. What should I do? Are you posting through Google Groups? Sometimes I

Re: Target WSGI script cannot be loaded as Python module.

2018-05-23 Thread John Gordon
led successfully. Is your web server using Python 2 or Python 3 to execute WSGI? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies&quo

Re: Plot not working

2018-05-04 Thread John Ladasky
On Friday, May 4, 2018 at 9:13:02 PM UTC-7, Sharan Basappa wrote: > I am new to Python and using it to learn machine learning. > > Below is a sample program I am running to plot IRIS data set. > The code runs but no plot comes up. I am not sure what the issue is with the > code. > > # Imports >

Re: Thank you Python community!

2018-03-20 Thread John Ladasky
On Monday, March 19, 2018 at 9:28:09 AM UTC-7, Etienne Robillard wrote: > I would like to thank you guys sincerely for helping a lot of people to > stay clean, and focus on programming high-level stuff in Python instead > of doing some really nasty drugs. Yeah, it's either Python or that horrif

Re: csv module and NULL data byte

2018-03-07 Thread John Pote
that it is still compatible with recent versions of Excel. Any idea why it might throw an exception on encountering a NULL in the input stream? It accepts all other 255 byte values. Was this behaviour intended? Perhaps a comment should be added to the docs. Thanks for your work on the module

Re: csv module and NULL data byte

2018-03-01 Thread John Pote
a step it would keep the execution speed up. My next thought was to pass a custom encoder to the open() that translates NULLs to, say, 0x01. It won't make any difference to change one corrupt value to a different corrupt value. reader = csv.reader(g, …) for row in reader

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

Re: Detection of ultrasonic side channels in mobile devices with Python?

2018-02-28 Thread John Gordon
whack-job newsgroups that would love to > discuss that aspect of it. Sounds like the plot to the latest Kingsman movie. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears

csv module and NULL data byte

2018-02-28 Thread John Pote
svTest.py Traceback (most recent call last):   File "csvTest.py", line 22, in     data = list( csvreader ) _csv.Error: line contains NULL byte strict=False or True makes no difference. Help appreciated, John -- 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 John Ladasky
On Friday, February 9, 2018 at 12:50:16 AM UTC-8, Tim Golden wrote: [snip and rearrange] > So dropping GG altogether would probably not add very much, as we're > generally blocking undesirable posts from there and we'd rather not > block genuine posts which happen to be made through the relativ

  1   2   3   4   5   6   7   8   9   10   >