Re: TypeError with map with no len()

2017-09-26 Thread john polo
On 9/25/2017 5:37 PM, Thomas Jollans wrote: On 25/09/17 18:44, john polo wrote: Python List, I am trying to make practice data for plotting purposes. I am using Python 3.6. The instructions I have are import matplotlib.pyplot as plt import math import numpy as np t = np.arange(0, 2.5, 0.1) y1

Re: The "loop and a half"

2017-10-04 Thread john polo
ndition that gets you out of the while loop and the first time through it must be set to get your code to execute the while loop at least one." best, John -- https://mail.python.org/mailman/listinfo/python-list

Is there a way to globally set the print function separator?

2017-10-09 Thread John Black
I want sep="" to be the default without having to specify it every time I call print. Is that possible? John Black -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to globally set the print function separator?

2017-10-09 Thread John Black
In article , __pete...@web.de says... > > John Black wrote: > > > I want sep="" to be the default without having to specify it every time I > > call print. Is that possible? > > No, but you can replace the print function with your own: > &g

Re: Is there a way to globally set the print function separator?

2017-10-09 Thread John Black
In article , python@example.invalid says... > > Le 09/10/2017 à 18:22, John Black a écrit : > > I want sep="" to be the default without having to specify it every time I > > call print. Is that possible? > > >>> oldprint = print > >>> def

Re: Is there a way to globally set the print function separator?

2017-10-09 Thread John Black
In article , eryk...@gmail.com says... > > On Mon, Oct 9, 2017 at 10:04 PM, John Black wrote: > > In article , python@example.invalid says... > >> > >> Le 09/10/2017 à 18:22, John Black a écrit : > >> > I want sep="" to be the default without

Re: choice of web-framework

2017-10-23 Thread John Black
. You say you teach SQLAlchemy but generally use PostgreSQL yourself. I can maybe guess why there seems to be this contradiction. Perhaps PostgreSQL is better but too advanced for the class you are teaching? Can you clarify on which you think is the better choice? Thanks. John Black -- https://mail.python.org/mailman/listinfo/python-list

Re: choice of web-framework

2017-10-24 Thread John Black
In article , ros...@gmail.com says... > > On Tue, Oct 24, 2017 at 6:57 AM, Chris Warrick wrote: > > On 23 October 2017 at 21:37, John Black wrote: > >> Chris, thanks for all this detailed information. I am confused though > >> with your database recommendation.

Re: The syntax of replacement fields in format strings

2017-10-31 Thread John Smith
If we keep the current implementation as is, perhaps the documentation should at least be altered ? -- https://mail.python.org/mailman/listinfo/python-list

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: converting numbers into words (Posting On Python-List Prohibited)

2017-11-09 Thread John Ladasky
On Wednesday, November 8, 2017 at 11:40:18 PM UTC-8, Lawrence D’Oliveiro wrote: > On Thursday, November 9, 2017 at 7:51:35 PM UTC+13, r16...@rguktrkv.ac.in > wrote: > > > How can I covert numbers into word like ex:-123 One hundred twenty three? > > Here’s

How to shut down a TCPServer serve_forever() loop?

2017-11-25 Thread John Pote
tener on: localhost: q #pressed 'q' key 127.0.0.1 wrote: #Sent some text from PuTTY b'SOME TEXT' TCPlistener:run() ending main ending How can I get shutdown()to shut down the server immediately without waiting for the next TCP connection? Regards, JOhn -- https://mail.python.org/mailman/listinfo/python-list

Meaning of "Add Python to environment variables"

2017-12-03 Thread John Yeung
In the custom installation options for Python 3.6, what *exactly* does "Add Python to environment variables" mean? Which environment variables are we talking about? I imagine one of them would have to be PATH. Are there any others? John Y. -- https://mail.python.org/mailman/listi

Re: f-string

2017-12-05 Thread John Pote
7; ) print( eRslt ) Ran above test file and got, >>python36 compiletest.py at 0x02120E40, file "", line 1> SPAM scrambled >> Py version on Win 7 box Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32 Any help? John -- https://mail.python.org/mailman/listinfo/python-list

Re: f-string

2017-12-08 Thread John Pote
Rslt = eval( 'f"{spam} {eggs}"' ) print( eRslt ) Ran above test file and got, >>python36 compiletest.py at 0x02120E40, file "", line 1> SPAM scrambled >> Py version on Win 7 box Python 3.6.3 (v3.6.3:2c5fed8, Octâ 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32 Any help? John -- https://mail.python.org/mailman/listinfo/python-list

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: Problem with assignment. Python error or mine?

2017-12-21 Thread John Ladasky
On Thursday, December 21, 2017 at 7:37:39 AM UTC-8, MRAB wrote: > Python never makes a copy unless you ask it to. > > What x1=X does is make the name x1 refer to the same object that X > refers to. No copying. Well, except with very simple, mutable data types like scalars... compare this: >>>

Re: Goto

2018-01-02 Thread John Wong
exact what C goto is. Who knows. Much like in Go - the other day, slice there has a different behavior to Python’s slice. I brought this up to show that don’t expect everything to be equal. John On Tue, Jan 2, 2018 at 12:35 bartc wrote: > On 02/01/2018 15:20, Chris Angelico wrote: > &g

Re: has sourceforge exposed the dirty little secret ?

2018-01-05 Thread John Gordon
hy should software be any different? -- 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" -- https://mail.python.org/mailman/listinfo/python-list

Re: has sourceforge exposed the dirty little secret ?

2018-01-05 Thread John Gordon
In <151517608506.368831.5093080329614058603@welt.netz> "Kim of K." writes: > print(emo('now you see emos')) > OF COURSE THIS SHIT DOES NOT WORK. What device did you run this on? Your average terminal window isn't going to support emojis... -- John

Re: Where has the practice of sending screen shots as source code come from?

2018-01-29 Thread John Gordon
te column. Without this screenshot, we would have had only the user's (incorrect) assertion that the file existed, and no way to diagnose the true issue. Granted, this was an environment issue and not a code issue, but I can imagine situations where the same sort of thing could apply t

Re: Where has the practice of sending screen shots as source code come from?

2018-01-29 Thread John Ladasky
On Sunday, January 28, 2018 at 7:07:11 AM UTC-8, Steven D'Aprano wrote: > > (The day a programmer posts a WAV file of themselves reading their code > out aloud, is the day I turn my modem off and leave the internet forever.) What's a... modem? -- https://mail.python.org/mailman/listinfo/python-l

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

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

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

[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

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

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

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

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

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

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

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

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

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

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

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-16 Thread John Griner
thanks Virus-free. www.avast.com <#m_4567368322047

Re: Multi-Line Strings: A Modest Proposal

2016-08-13 Thread John Wong
uot;.format(v1=v1, v2=v2)) You get the point... by wrapping, I ended up breaking this into multiple lines. In some cases I would build the string before calling the exception. That seems a little tangent, but relevant. The problem with this proposal is that could break existing application. It's impossible to switch to this convention. John -- https://mail.python.org/mailman/listinfo/python-list

Re: How to split value where is comma ?

2016-09-08 Thread John Gordon
for x in newlist: print(x) -- 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" -- https://mail.python.org/mailman/listinfo/python-list

Re: Mysterious Logging Handlers

2016-09-09 Thread John Gordon
default logging format; it's used when you haven't supplied any format of your own. The snippet of xlreader.py does not define any format, so it seems like that's where it's coming from. (This seems pretty straightforward; am I missing something?) -- John Gordon

Re: ldap or active directory module

2016-09-09 Thread John Gordon
particular group Do the same search as above, returning the "member" attribute. Get the search result and then inspect the list of returned members. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for

Re: memberof example using ldap

2016-09-12 Thread John Gordon
fine even if group doesn't exist, > It always says that user is member of The query returns a user who is not a member of the named group? That's odd. What is the search base and scope? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com

Re: How to extend a tuple of tuples?

2016-09-12 Thread John Gordon
has been mutated in the very statement that > you are quoting No. An entirely new tuple is created, and 'a' is rebound to it. The existing tuple is not mutated. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assa

Re: Requests for webbrowser module

2016-09-14 Thread John Gordon
controls whether new pages are opened in a new tab or a new window. Perhaps that is your issue? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gash

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: strings and ints consistency - isinstance

2016-09-21 Thread John Gordon
sented as a string*. The same is not true for integers. * Okay, python 2.7 does have some issues with Unicode. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Go

Re: Why does the insert after list function fail?

2016-09-22 Thread John Gordon
thing; it modifies the existing list in-place. -- 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" -- https://mail.python.org/mailman/listinfo/python-list

Re: how to append to list in list comprehension

2016-09-30 Thread John Gordon
(0) Or, if you really want to use a list comprehension: [f.append(0) for f in fups if len(f) < 5] However there's no reason to use a list comprehension here. The whole point of list comprehensions is to create a *new* list, which you don't appear to need; you just need to modify

PyQt5, OpenGL, where to start, minimal example code?

2016-10-02 Thread John Ladasky
Hi there, I am making my first attempt at 3D rendering. My system configuration: OS : Ubuntu 16.04 64-bit Python : 3.5.1 Qt : 5.5.1 PyQt : 5.5.1 OpenGL : 4.5.0 (I have a modern GPU) All software was installed from the Canonical repository. I didn't build any binaries myself. >From

Re: PyQt5, OpenGL, where to start, minimal example code?

2016-10-02 Thread John Ladasky
On Sunday, October 2, 2016 at 7:45:50 PM UTC-7, Lawrence D’Oliveiro wrote: > On Monday, October 3, 2016 at 2:14:13 PM UTC+13, John Ladasky wrote: > > > > I am making my first attempt at 3D rendering. > > Bear in mind there are two kinds of 3D rendering: realtime (with OpenGL

Re: PyQt5, OpenGL, where to start, minimal example code?

2016-10-02 Thread John Ladasky
On Sunday, October 2, 2016 at 7:21:15 PM UTC-7, blue wrote: > You have here a PyQt5 Reference Guide > http://pyqt.sourceforge.net/Docs/PyQt5/index.html > Some example can be found here 4 and 5 > http://codeprogress.com/python/libraries/pyqt/ That's a nice page of examples, but there are no OpenG

Re: PyQt5, OpenGL, where to start, minimal example code?

2016-10-03 Thread John Ladasky
On Monday, October 3, 2016 at 1:30:29 AM UTC-7, Phil Thompson wrote: > On 3 Oct 2016, at 4:29 am, John Ladasky wrote: > > And as you can see: trying to call versionFunctions() is exactly where my > > program failed. > > Try passing a QOpenGLVersionProfile object to versio

Passing Variable to Function

2016-10-05 Thread John McKenzie
Hello, all. I have a function that takes three arguments, arguments to express an RGB colour. The function controls an LED light strip (a Blinkytape). Sometimes I might need to be change what colour is sent to the function, so I set a variable with the idea that I can change just the variab

Re: Passing Variable to Function

2016-10-07 Thread John McKenzie
Brendan and Alister, thank you both for responding. I am very inexperienced with python, but not new to computers so on my own I realized the strings vs number mistake. (I seem to work with and learn about Python for a few weeks at a time with 6 to 12 months in between. Need to change that a

Re: xml parsing with lxml

2016-10-07 Thread John Gordon
In <622ea3b0-88b4-420b-89e0-9e7c6e866...@googlegroups.com> Doug OLeary writes: > >>> from lxml import etree > >>> doc =3D etree.parse('config.xml') > Now what? For instance, how do I list the top level children of > ? root = doc.getroot() for

Re: PyQt5, OpenGL, where to start, minimal example code?

2016-10-08 Thread John Ladasky
ext() f = QSurfaceFormat() # The default p = QOpenGLVersionProfile(f) self.GL = c.versionFunctions(p) super().initializeGL() On Tuesday, October 4, 2016 at 12:56:53 AM UTC-7, Phil Thompson wrote: > On 4 Oct 2016, at 5:57 am, John Ladasky wrote: > > > &

Re: Free Python e-books from O'Reilly

2016-10-10 Thread John Gordon
ed that they were all fairly short, none more than 80 pages or so. I suspect these books are somewhat lighter fare than the typical O'Reilly tome. Not necessarily a bad thing, but worth mentioning. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com

Re: Build desktop application using django

2016-10-17 Thread John Gordon
omething which runs locally on your computer, such as Microsoft Word or a game. But Django is for building websites, not local applications. So Django probably isn't what you want. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for B

Re: Inplace shuffle function returns none

2016-10-18 Thread John Gordon
le(a) > print(b[:3]) > For example here i just want to slice the first 3 numbers which should > be shuffled. However you can't slice a noneType object that b becomes. > So how do i get shuffle to give me my numbers? a = [1,2,3,4,5] shuffle(a) print(a[:3]) -- John Gord

Re: Inplace shuffle function returns none

2016-10-18 Thread John Gordon
In <9d24f23c-b578-4029-ab80-f117599e2...@googlegroups.com> Sayth Renshaw writes: > So why can't i assign the result slice to a variable b? Because shuffle() modifies the list directly, and returns None. It does NOT return the shuffled list. -- John Gordon A i

Re: How to handle errors?

2016-10-20 Thread John Gordon
In <8500044a-c8d1-43ad-91d9-e836d52bd...@googlegroups.com> SS writes: > I would like to be able to handle that error a bit better. Any ideas? Wrap the socket.gethostbyname() call in a try/except block. -- John Gordon A is for Amy, who fell down the stairs gor...@

Re: Quick way to calculate lines of code/comments in a collection of Python scripts?

2016-10-20 Thread John Strick
://www.pylint.org/ Just install and use: pylint *.py Regards, John -- https://mail.python.org/mailman/listinfo/python-list

Re: How to handle errors?

2016-10-22 Thread John Gordon
Then I ran it: > ~$ python test.py argument1 argument2 > ['test.py', 'argument1', 'argument2'] Options cannot be passed *on the hash-bang line*. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basi

Re: exist loop by pressing esc

2016-10-24 Thread John Gordon
In <6e030fd0-93c1-4d23-8656-e06c411b6...@googlegroups.com> chris alindi writes: > simple while loop range(10) if user press esc exits loop range() is typically used with for loops, not while loops. what is your while condition? what use is the range() value? -- Jo

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

2016-10-25 Thread John Pote
your worker code and one for the keyboard entry code. Use a message queue to pass received lines from the keyboard thread to the worker thread. OK you still have to press Enter but you don't need the windows msvcrt library or xNIX termios modules. Regards John On 25/10/2016 07:39, S

After import, some submodules are accessible and some aren't

2016-10-28 Thread John Gordon
object has no attribute 'modlist' >>> ldap.dn >>> import ldap.modlist >>> ldap.modlist Why the difference? -- 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" -- https://mail.python.org/mailman/listinfo/python-list

Re: comapring 2 sequences of DNA ouput the silent and non mutations

2016-10-29 Thread John Ladasky
Disha, Before you struggle to reinvent the wheel, you might want to check out the Biopython package. http://biopython.org/wiki/Biopython I haven't used it for a few years, but the version that I did use was very comprehensive. -- https://mail.python.org/mailman/listinfo/python-list

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-08 Thread John Ladasky
On Monday, November 7, 2016 at 5:23:25 PM UTC-8, Steve D'Aprano wrote: > On Tue, 8 Nov 2016 05:47 am, j...@i...edu wrote: > > It has been very important for the field of computational molecular > > dynamics (and probably several other fields) to get floating-point > > arithmetic working right on GP

Re: Parsing a single-level JSON file

2016-11-18 Thread John Gordon
value. That data looks like a list of dictionaries: import json with open("json.dat", "r") as fp: data = json.load(fp) for item in data: if item['name'] == 'myField2': print item['id'] -

Re: Parsing a single-level JSON file

2016-11-18 Thread John Gordon
In John Gordon writes: > In > mike.rei...@gmail.com writes: > with open("json.dat", "r") as fp: > data = json.load(fp) > for item in data: > if item['name'] == 'myField2': Oops, that should be 'm

Re: MemoryError and Pickle

2016-11-21 Thread John Gordon
oesn't use pickle format, so your reader program would have to be modified to read this format. And you'll run into the same problem if the reader expects to keep all the data in memory. -- John Gordon A is for Amy, who fell down the st

Re: Python while loop

2016-11-30 Thread John Gordon
name; you could have called it "hamburger" and python would treat it just the same. -- 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" -- https://mail.python.org/mailman/listinfo/python-list

Re: Can json.dumps create multiple lines

2016-12-01 Thread John Gordon
", > "with several strings", > "as a demo" > ]' json.dumps() has an 'indent' keyword argument, but I believe it only enables indenting of each whole element, not individual members of a list. Perhaps somet

Re: Error In querying Genderize.io. Can someone please help

2016-12-01 Thread John Gordon
(r.content) You're using http: instead of https:, and you're using ?katty instead of ?name=katty, and therefore the host does not recognize your request as an API call and redirects you to the normal webpage. -- John Gordon A is for Amy, who fell down the

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-05 Thread John Gordon
ERROR No file named '$HOME/file.txt' vi $(grep -l foo *.txt) ERROR No file named '$(grep -l foo *.txt)' None of these commands would work if bash didn't "alter the input going to another program". -- John Gordon A is for Amy, who fell

Re: calling a program from Python batch file

2016-12-07 Thread John Gordon
responding to expected patterns in their output. Pexpect allows your script to spawn a child application and control it as if a human were typing commands. https://pexpect.readthedocs.io/en/stable/ -- John Gordon A is for Amy, who fell down the stairs gor...@pa

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread John Gordon
ever one you prefer. self.class_attr may be more convenient because you don't have to provide a specific class name. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey,

Re: Install Problem

2016-12-13 Thread John Gordon
Python. How can this problem be fixed? When does the error occur? During installation? Or after installation when you're trying to run a python program? What version of Windows do you have? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B

Re: OT - "Soft" ESC key on the new MacBook Pro

2016-12-14 Thread John Gordon
In Gregory Ewing writes: > Once you're in the clutches of Apple, there is no Escape. Ha! -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "Th

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: Using python to start programs after logging in

2017-01-19 Thread John Gordon
lt-in facilities for starting programs would be better. Why are you using Python instead? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashl

Re: Using python to start programs after logging in

2017-01-20 Thread John Gordon
hen all > programs will be started on the same virtual desktop and I want to > start them on different ones. The window manager doesn't allow you to specify a target desktop? That seems like a pretty heinous feature omission. -- John Gordon A is for Amy, who fell down the s

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread John Gordon
e interactive, you could require that the user supply a file in the current directory containing the username and password. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edw

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

<    4   5   6   7   8   9   10   11   12   13   >