Re: Using astype(int) for strings with thousand separator

2021-11-14 Thread Thomas Jollans
On 14.11.21 16:41, Mahmood Naderan via Python-list wrote: Hi While reading a csv file, some cells have values like '1,024' which I mean they contains thousand separator ','. Therefore, when I want to process them with   row = df.iloc[0].astype(int) If you are reading a CSV with pandas.read

Re: Confusing error message: lambda walruses

2021-10-06 Thread Thomas Jollans
On 06/10/2021 23:53, Chris Angelico wrote: On Thu, Oct 7, 2021 at 8:51 AM Thomas Jollans wrote: On 03/10/2021 01:39, Chris Angelico wrote: Using assignment expressions in lambda functions sometimes works, but sometimes doesn't. Does this commit by a certain Chris Angelico help clear t

Re: Confusing error message: lambda walruses

2021-10-06 Thread Thomas Jollans
On 03/10/2021 01:39, Chris Angelico wrote: Using assignment expressions in lambda functions sometimes works, but sometimes doesn't. Does this commit by a certain Chris Angelico help clear things up? https://github.com/python/peps/commit/f906b988b20c9a8e7e13a2262f5381bd2b1399e2 -- https://mail.

Re: matplotlib graph white space

2021-10-06 Thread Thomas Jollans
On 04/10/2021 10:39, Steve wrote: I am using the first bar graph listed at this site: https://matplotlib.org/stable/gallery/index.html The problem I have is that there is too much white space around the graph. My data would be better displayed if I could widen the graph into the space to the rig

Re: The split() function of Python's built-in module has changed in a puzzling way - is this a bug?

2021-04-23 Thread Thomas Jollans
On 23/04/2021 01:53, Andy AO wrote: Upgrading from Python 3.6.8 to Python 3.9.0 and executing unit tests revealed a significant change in the behavior of re.split(). but looking at the relevant documentation — Changelog and re - Regular expres

Re: pandas/jupyther notebook?

2021-04-09 Thread Thomas Jollans
employees.csv. If I type: df.h type head, but if I type: df['Gender'] = df['Gender'].ast  it will not complete astype. I wonder if someone can tell me why this is happening and maybe how to fix it. Thanks,  Jim -- Dr. Thomas Jollans m ☎ +49 6201 8759879 e ✉ t...@tjol.eu -- htt

Re: Matplotlib scale

2021-04-05 Thread Thomas Jollans
np.meshgrid(x, y) zi = interpolator(Xi, Yi) cntr1 = ax.contourf(x, y, z.reshape(nb_lignes,nb_colonnes), levels=150, cmap="jet") cbar = fig.colorbar(cntr1, ax=ax) ax.axis('on') -- Dr. Thomas Jollans ☎ +49 6201 8759879 ✉ t...@tjol.eu -- https://mail.python.org/mailman/listinfo/python-list

Re: python documentation

2021-03-27 Thread Thomas Jollans
On 27/03/2021 06:20, pyt...@blackward.eu wrote: Chris, you seem to imply, that I have compiled said versions without reason and that the same would be possible on basis of Python 3 - which is simply not true. Maybe you are not enough acquainted with Qt and belonging libraries alike PyQtGraph.

Re: .title() - annoying mistake

2021-03-19 Thread Thomas Jollans
On 19/03/2021 20:33, dn via Python-list wrote: On 20/03/2021 07.49, Grant Edwards wrote: On 2021-03-19, MRAB wrote: You want English "man's" to become "Man's", but French "l'homme" to become "L'Homme". It's language-dependant. In English, certain words are not capitalized in titles unless the

Re: yield from () Was: Re: weirdness with list()

2021-03-12 Thread Thomas Jollans
On 03/03/2021 01:01, Cameron Simpson wrote: On 02Mar2021 15:06, Larry Martell wrote: I discovered something new (to me) yesterday. Was writing a unit test for generator function and I found that none of the function got executed at all until I iterated on the return value. Aye. Generators are

Re: Application problems

2021-03-11 Thread Thomas Jollans
On 11/03/2021 15:06, Anssi Saari wrote: Thomas Jollans writes: On 10/03/2021 21:50, Mats Wichmann wrote: For the first one, don't feel too bad, this ("opening the normal python") seems to be biting a lot of people recently I wonder why. Python's installation process

Re: Application problems

2021-03-10 Thread Thomas Jollans
On 10/03/2021 21:50, Mats Wichmann wrote: For the first one, don't feel too bad, this ("opening the normal python") seems to be biting a lot of people recently I wonder why. Python's installation process isn't any different from most other Windows software released the past 25-ish years. Is

Re: How to create both a c extension and a pure python package

2021-03-10 Thread Thomas Jollans
On 10/03/2021 20:57, Mats Wichmann wrote: On 3/10/21 11:56 AM, Thomas Jollans wrote: On 10/03/2021 18:42, Marco Sulla wrote: On Wed, 10 Mar 2021 at 16:45, Thomas Jollans wrote: Why are you doing this? If all you want is for it to be possible to install the package from source on a system

Re: How to create both a c extension and a pure python package

2021-03-10 Thread Thomas Jollans
On 10/03/2021 18:42, Marco Sulla wrote: On Wed, 10 Mar 2021 at 16:45, Thomas Jollans wrote: Why are you doing this? If all you want is for it to be possible to install the package from source on a system that can't use the C part, you could just declare your extension modules opt

Re: How to create both a c extension and a pure python package

2021-03-10 Thread Thomas Jollans
On 09/03/2021 23:42, Marco Sulla wrote: As title. Currently I ended up using this trick in my setup.py: if len(argv) > 1 and argv[1] == "c": sys.argv = [sys.argv[0]] + sys.argv[2:] setuptools.setup(ext_modules = ext_modules, **common_setup_args) else: setuptools.setup(**common_se

Re: Best practices regarding PYTHONPATH

2021-03-10 Thread Thomas Jollans
On 09/03/2021 22:52, Cameron Simpson wrote: On 09Mar2021 05:00, Larry Martell wrote: Which is considered better? Having a long import path or setting PYTHONPATH? For example, in a project where 50% of the imports come from the same top level directory is it better to add that dir to the path o

Re: Choosable dependency

2021-03-08 Thread Thomas Jollans
n_api.html#matplotlib.use there the user imports matplotlib and then optionally calls a function to select a backend. Then every function within matplotlib that uses the backend has to defer to some wrapper (not sure where or how) Hope that helps Thomas -- Dr. Thomas Jollans e ✉ t...@tjol.eu

Re: editor recommendations?

2021-02-26 Thread Thomas Jollans
On 26/02/2021 15:51, Ethan Furman wrote: > > So, what's the state-of-the-art with regards to editors supporting > dark color themes? You’re in luck, “Dark Mode” is very much en vogue these days. Most modern programmer's editors (meaning editors that think of themselves as modern) are either dark b

Re: python 2.6: Need some advise for installing modules on a legacy system

2021-02-26 Thread Thomas Jollans
, why can't you install a newer Python interpreter? Are you running Windows 2000? Have fun I guess Thomas -- Dr. Thomas Jollans ✉ t...@tjol.eu -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7 and 3.9

2021-02-17 Thread Thomas Jollans
On 16/02/2021 22:16, Ethan Furman wrote: Kevin, please reply to the list (preferably Reply-to-list, or Reply-all), that way others can chime in with help. On 2/16/21 12:55 PM, Kevin M. Wilson wrote: Windows 7 OS, and typically run in conjunction with testing SSD', as for stand alone scripts.

Re: IDE tools to debug in Python?

2021-02-04 Thread Thomas Jollans
On 27/01/2021 19:32, flaskee via Python-list wrote: > > While print() is groovy and all, > if anyone runs across a non-pdb python debugger (standalone or IDE-based) > please let me know. > > I too was blessed with IDE-based debugging (in the 90's!) > * where you can set break point(s); > * have

Re: Letter replacer - suggestions?

2020-12-08 Thread Thomas Jollans
On 07/12/2020 16:48, Bischoop wrote: I worked on my wee script that replaces a letters: https://bpa.st/OYBQ . I would like to have some suggestions about the code from more experienced programmers, the code does work and do its job but perhaps could work in a better way. Thanks Sure! First o

Re: how to plot the FFT of a list of values

2020-12-07 Thread Thomas Jollans
On 05/12/2020 23:08, Christian Gollwitzer wrote: Am 05.12.20 um 18:16 schrieb Boris Dorestand: I have 16 values of the period sequence 1, 2, 4, 8, 1, 2, 4, 8, ...  I compute its fourier transform using from scipy import fft, ifft x = [1,2,4,8,1,2,4,8] fft(x) array([ 30. +0.j,   0. +0.j,  -6.+

Re: Saying bye bye to Python 2

2020-01-11 Thread Thomas Jollans
On 11/01/2020 00:16, tommy yama wrote: As many know, python 2 was retired. 🐍 This means imminent migration to 3 will be a must ? Upgrading to Python 3 has been a "bloody well should" for many, many years now. Though in a shock announcement a few weeks ago the end of Python 2 was delayed AG

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

2019-12-19 Thread Thomas Jollans
On 19/12/2019 11.52, 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 > import struct > import numpy as np

Re: Using Makefiles in Python projects

2019-11-11 Thread Thomas Jollans
On 11/11/2019 14:23, Rhodri James wrote: On 09/11/2019 23:50, Thomas Jollans wrote: On 09/11/2019 21:30, Chris Angelico wrote: On Sun, Nov 10, 2019 at 2:10 AM Thomas Jollans wrote: On 07/11/2019 20:20, Vitaly Potyarkin wrote: What do you think of using Makefiles for automating common chores

Re: Using Makefiles in Python projects

2019-11-09 Thread Thomas Jollans
On 09/11/2019 21:30, Chris Angelico wrote: On Sun, Nov 10, 2019 at 2:10 AM Thomas Jollans wrote: On 07/11/2019 20:20, Vitaly Potyarkin wrote: What do you think of using Makefiles for automating common chores in Python projects? Like linting, type checking and testing? I've come up w

Re: Using Makefiles in Python projects

2019-11-09 Thread Thomas Jollans
On 07/11/2019 20:20, Vitaly Potyarkin wrote: What do you think of using Makefiles for automating common chores in Python projects? Like linting, type checking and testing? I've come up with a reusable Makefile for automating virtual environment management in Python projects. I think it can be us

Re: return a ctypes object to C

2019-10-31 Thread Thomas Jollans
On 31/10/2019 14.13, Arnaud Loonstra wrote: > On 30-10-2019 09:32, Arnaud Loonstra wrote: >> Hi all, >> >> I'm trying to wrap my head around the ctypes API. I have a C >> structure I wish to create in Python and then return from python to C. >> >> So a python method is called from C and needs to re

Re: Convert a scientific notation to decimal number, and still keeping the data format as float64

2019-10-18 Thread Thomas Jollans
On 18/10/2019 10:35, doganad...@gmail.com wrote: Here is my question: I am using the numpy.std formula to calculate the standart deviation. However, the result comes as a number in scientific notation. Therefore I am asking, How to convert a scientific notation to decimal number, and still ke

Re: Generate simple image on a standalone Raspberrry Pi

2019-09-27 Thread Thomas Jollans
On 27/09/2019 14.43, Roy Hann wrote: > I am designing a mobile application to run on a Raspberry Pi 3 model B. > It will not have any Internet access. I need to generate a static image > consisting of a simple arc representing (say) a speedometer or a > pressure gauge. The image will need to be reg

Fwd: numpy results in segmentation fault

2019-09-16 Thread Thomas Jollans
Please reply on-list. (both of you) Forwarded Message Subject:Re: numpy results in segmentation fault Date: Mon, 16 Sep 2019 17:04:57 +0530 From: Test Bot To: Pradeep Patra CC: Thomas Jollans Firstly, in response to this " I tried to install

Re: numpy results in segmentation fault

2019-09-12 Thread Thomas Jollans
On 12/09/2019 15.53, Pradeep Patra wrote: > Hi , > > I was trying to solve the hackerrank and was using python 3.7.x. > https://www.hackerrank.com/challenges/np-concatenate/problem > > While running the code sometimes I get success result and sometimes it > fails with "Segmentation Fault" at Hacker

Re: For the code to generate `zen of python'.

2019-08-07 Thread Thomas Jollans
On 07/08/2019 15.11, Hongyi Zhao wrote: > Hi here, > > I noticed that the `zen of python' is generated by the following code: > > d = {} > for c in (65, 97): > for i in range(26): > d[chr(i+c)] = chr((i+13) % 26 + c) > > print("".join([d.get(c, c) for c in s])) > > > But the above code

Re: how to generate a standard email form by default OS mail client?

2019-07-30 Thread Thomas Jollans
On 30/07/2019 10.06, dmitre...@gmail.com wrote: > Hello, > > is Python capable of generating a email form (from standard data - address, > topic, string message) with raising it by a default OS email client, e.g. > Thunderbird? User would like to have a possibility to review/modify email > conte

Re: .python_history file

2019-07-29 Thread Thomas Jollans
On 29/07/2019 23:06, Harry Grey wrote: > Hy to Everyone > first of all : Sorry for my english > > what do you think about introducing a feature that allows you to group > by date > and after to filter the istruction that are written in the > .python_history file: > maybe with a new structure for .

Re: Definite or indefinite article for non-singletons?

2019-07-28 Thread Thomas Jollans
On 28/07/2019 17:13, MRAB wrote: > [snip] > > It's strange that "all the things" (meaning "all of the things") is OK, > but otherwise it's "one of the things", "some of the things", etc. Is it? It's the same in French, Dutch and German. Can't tell if it just makes sense or if it's Common Average

Re: Python 3.7 - Reading text from Terminal window

2019-07-26 Thread Thomas Jollans
On 26/07/2019 06.33, nir.za...@gmail.com wrote: > Hi, > > I want it to wait for a specific text on the terminal window that it opens > (putty.exe), how can i do it? > > from pywinauto.application import Application > from pynput.keyboard import Key, Controller > > print('Configuring') > > app

Re: Namespaces: memory vs 'pollution'

2019-07-23 Thread Thomas Jollans
On 23/07/2019 04.27, DL Neil wrote: > On 23/07/19 11:00 AM, Ethan Furman wrote: >> On 07/20/2019 05:02 PM, DL Neil wrote: >> >>> Upon closer inspection, I realised it didn't just fail; it failed >>> badly! Some silly, little, boy had imported the PythonEnvironment >>> class but failed to ALSO impor

Re: Namespaces: memory vs 'pollution'

2019-07-22 Thread Thomas Jollans
On 22/07/2019 07.06, DL Neil wrote: > > Current thoughts: > > import environment_module as em > > - so, even more of an abbreviation than suggested!? > - I rarely need to write a long list of import statements, so there > won't be many. > - not normally using such abbreviations in my code, they

Re: Counting Python threads vs C/C++ threads

2019-07-17 Thread Thomas Jollans
On 17/07/2019 09.58, Barry Scott wrote: > >> On 16 Jul 2019, at 20:48, Dan Stromberg wrote: >> >> >> >> A question arises though: Does threading.active_count() only show Python >> threads created with the threading module? What about threads created with >> the thread module? > Only pythons t

Re: Accumulate , Range and Zeros

2019-07-13 Thread Thomas Jollans
On 13/07/2019 11:54, Abdur-Rahmaan Janhangeer wrote: > Greetings, > > Given this snippet > > from itertools import * > import operator > > > x = [1, 2, 3] # [0, 1, 2, 3, ..., 10] > > y = accumulate(x, operator.mul) > > print(list(y)) > > why does x = list(range(5)) produces only zeros? What

Re: super or not super?

2019-07-12 Thread Thomas Jollans
On 12/07/2019 16.12, Paulo da Silva wrote: > Hi all! > > Is there any difference between using the base class name or super to > call __init__ from base class? There is, when multiple inheritance is involved. super() can call different 'branches' of the inheritance tree if necessary. Let me demo

Re: Matplotlib import image as float32

2019-07-05 Thread Thomas Jollans
On 01/07/2019 21:08, Markos wrote: > Hi, > > I observed that matplotlib reads an image file (PNG) as float32: > > Please, how to read this file as int8 to get RGB in range of 0-255? You may want to try a different library. scikit-image's imread function will give you the image as an integer arr

Re: Multiprocessing and memory management

2019-07-04 Thread Thomas Jollans
On 03/07/2019 18.37, Israel Brewster wrote: > I have a script that benefits greatly from multiprocessing (it’s generating a > bunch of images from data). Of course, as expected each process uses a chunk > of memory, and the more processes there are, the more memory used. The amount > used per pr

Re: Do I need a parser?

2019-07-02 Thread Thomas Jollans
On 01/07/2019 17:23, josé mariano wrote: > Dear All, > > Thank you very much for your valuable input. > Thanks Alan for your kind words. I'm not Spanish, I'm Portuguese, but I know > what you mean. > Thomas, I was able to track down the author but he is not willing to release > the source code.

Re: Plumbing behind super()

2019-06-29 Thread Thomas Jollans
On 30/06/2019 01:15, adam.pre...@gmail.com wrote: Whoops. Now I need to figure out how the interpreter knows that change_a is a method and knows what self to feed it. I'm assuming that's in the cell variables similar to what super()'s doing as explained here. I haven't implemented cell variab

Re: Handle foreign character web input

2019-06-29 Thread Thomas Jollans
On 28/06/2019 22:25, Tobiah wrote: A guy comes in and enters his last name as RÖnngren. With a capital Ö in the middle? That's unusual. So what did the browser really give me; is it encoded in some way, like latin-1?  Does it depend on whether the name was cut and pasted from a Word doc. etc?

Re: Do I need a parser?

2019-06-29 Thread Thomas Jollans
On 29/06/2019 14:39, josé mariano wrote: Dear all, I'm sure that this subject has been addressed many times before on this forum, but my poor knowledge of English and of computer jargon and concepts results on not being able to find the answer i'm looking for when I search the forum. So here

Re: Plumbing behind super()

2019-06-28 Thread Thomas Jollans
On 28/06/2019 02:13, adam.pre...@gmail.com wrote: I'm trying to mimick Python 3.6 as a .NET science project and have started to get into subclassing. The super() not-a-keyword-honestly-guys has tripped me up. I have to admit that I've professionally been doing a ton Python 2.7, so I'm not good

Re: pip vs python -m pip?

2019-06-21 Thread Thomas Jollans
On 21/06/2019 15.27, Malcolm Greene wrote: > 64-bit Python 3.6.8 running on Windows with a virtual environment activated. > > "pip -v" reports 19.0.3 > "python -m pip" reports 19.1.1 > > Is this behavior by design or a bug? If the pip and python executables you're calling both live in the virtual

Re: python 2 to 3 conversion

2019-06-17 Thread Thomas Jollans
On 17/06/2019 15.14, Igor Korot wrote: > Hi, > Is there a place where there is a full list of incompatibilities between > python 2 and python 3 is available and how to fix them? ‘What’s new in Python 3.0’ is a good starting point https://docs.python.org/3/whatsnew/3.0.html It doesn’t list all st

Re: How control a GUI for an unrelated application from a Python script?

2019-06-14 Thread Thomas Jollans
On 14/06/2019 01.49, Christian Seberino wrote: > I have a third party GUI that manages some hardware. > > I want to control the hardware from a Python script. Forget about the GUI, see if you can control your device without it. See how well the device is documented. Maybe there's an API? If not f

Re: Questions about the IO modules and C-api

2019-06-02 Thread Thomas Jollans
On 03/06/2019 04:02, Windson Yang wrote: > I have some questions about the IO modules. > > 1. My script: > > f = open('myfile, 'a+b') > f.close() > > I added a printf statement at the beginning of _io_open_impl >

Re: Why Python has no equivalent of JDBC of Java?

2019-05-20 Thread Thomas Jollans
On 19/05/2019 14.27, Marco Sulla via Python-list wrote: > I programmed in Python 2 and 3 for many years, and I find it a fantastic > language. > > Now I'm programming in Java by m ore than 2 years, and even if I found its > code much more boilerplate, I admit that JDBC is fantastic. Python has a

Re: Using a Variable Inside the String

2019-05-10 Thread Thomas Jollans
On 07/05/2019 18.43, Rob Gaddi wrote: > This over here is my friend Bob.  What's 31 + 18 + Bob? That's Numberwang! -- https://mail.python.org/mailman/listinfo/python-list

Re: Building a statically linked Python, and pip

2019-05-08 Thread Thomas Jollans
On 08/05/2019 03:18, Simon Michnowicz via Python-list wrote: > Dear Group, > I need to build a statically linked Python that has pip. What a curious thing to need. > I built a version following the instructions at > https://wiki.python.org/moin/BuildStatically > but pip was not present in the bin

Re: PYTHON equivalents of BITAND and BITSHIFT of MATLAB

2019-05-01 Thread Thomas Jollans
On 02/05/2019 06:47, blmadha...@gmail.com wrote: > Hello Brian, > > Thanks for your suggestion. Which is correct for MATLAB command: typeBits = > FCF << -9? > > typeBits = FCF >> 9 > > or > > typeBits = FCF >> -9 > > I mean to ask if it should be -9 or +9? Why don't you just, you know, try

Re: EmailMessage and RFC 2047

2019-04-30 Thread Thomas Jollans
On 30/04/2019 13.11, Peter J. Holzer wrote: > Hi, > > https://docs.python.org/3.7/library/email.header.html states: > > | This module is part of the legacy (Compat32) email API. In the current > | API encoding and decoding of headers is handled transparently by the > | dictionary-like API of the

Re: Most "pythonic" syntax to use for an API client library

2019-04-30 Thread Thomas Jollans
On 30/04/2019 09.52, Peter Otten wrote: > Thomas Jollans wrote: > >> On 29/04/2019 09.18, Peter Otten wrote: >>> Jonathan Leroy - Inikup via Python-list wrote: >>> alice.name = "Bob" # __setattr__ >>> >>> del customers[42] # __de

Re: Most "pythonic" syntax to use for an API client library

2019-04-29 Thread Thomas Jollans
On 29/04/2019 09.18, Peter Otten wrote: > Jonathan Leroy - Inikup via Python-list wrote: > >> Hi all, >> >> I'm writing a client library for a REST API. The API endpoints looks like >> this: /customers >> /customers/1 >> /customers/1/update >> /customers/1/delete >> >> Which of the following synta

Re: A request for examples of successful abstracts to scientific python conferences

2019-04-03 Thread Thomas Jollans
On 03/04/2019 18:18, Manolo Martínez wrote: > Dear all, > > I am thinking of submitting an abstract to EuroSciPy 2019, but (although > I am an academic), I am not familiar with the conventions, do's and > don'ts of submissions to CS conferences, and this one in particular. > Would any kind reader

Re: Jinja and non-ASCII characters (was Re: Prepare accented characters for HTML)

2019-03-29 Thread Thomas Jollans
On 29/03/2019 12.39, Tony van der Hoff wrote: > On 29/03/2019 11:08, Chris Angelico wrote: >> On Fri, Mar 29, 2019 at 9:12 PM Tony van der Hoff >> wrote: >>> >>> Hello Chris. >>> Thanks for your interest. >>> >>> On 28/03/2019 18:04, Chris Angelico wrote: On Fri, Mar 29, 2019 at 4:10 AM Tony

Re: Jinja and non-ASCII characters (was Re: Prepare accented characters for HTML)

2019-03-29 Thread Thomas Jollans
On 29/03/2019 11.10, Tony van der Hoff wrote: > and running it in a browser (tried both chrome and Firefox), How? > it fails as before: blank web page. No traceback? There must be a traceback somewhere. In a log file perhaps. -- https://mail.python.org/mailman/listinfo/python-list

Re: uWISGI with Qt for Python

2019-03-14 Thread Thomas Jollans
On 13/03/2019 22:42, Israel Brewster wrote: > 1) Is there a “better way”? This GitHub repo: > https://github.com/unbit/uwsgi-qtloop seems to indicate that it should be > possible to run a Qt event loop from within a uWSGI app, thus eliminating the > extra “subprocess” spinoff, but it hasn’t been

Re: Convert Windows paths to Linux style paths

2019-03-12 Thread Thomas Jollans
On 12/03/2019 15.51, Malcolm Greene wrote: > Looking for best practice technique for converting Windows style paths to > Linux paths. Is there an os function or pathlib method that I'm missing or is > it some combination of replacing Windows path separators with Linux path > separators plus some

Re: Configuring the REPL's tab completion

2019-03-11 Thread Thomas Jollans
On 10/03/2019 15.20, Chris Angelico wrote: > I have absolutely no idea how to do this or even where to go looking, > so I'd appreciate a starting pointer :) > > When you're in the Python REPL (just the basic core one, not IDLE or > anything), you can tab-complete global and built-in names, attribu

Re: Totally Legit Signing Key?

2019-03-04 Thread Thomas Jollans
On 04/03/2019 20:37, Peter Otten wrote: > For once I tried to verify a download from python.org, following the steps > outlined at > > https://www.python.org/downloads/#pubkeys > > """ > You can import the release manager public keys by either downloading the > public key file from here and the

Re: Version numbers in Standard Library

2019-03-03 Thread Thomas Jollans
On 01/03/2019 16:35, Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC] via Python-list wrote: > Dear Python List, > > A question. I help maintain a Python stack for users in my division here > at NASA and one user asked about updating the re module to 2.4. I > believe because he re

Re: Lifetime of a local reference

2019-02-27 Thread Thomas Jollans
On 27/02/2019 22:39, Roel Schroeven wrote: > Aren't we overthinking this? No, it's just that nobody had found the evidence you did. > > I think it's pretty clear that a variable is never deleted before it > goes out of scope. A quick search in the documentation points me to > (https://docs.pytho

Re: Lifetime of a local reference

2019-02-27 Thread Thomas Jollans
On 27/02/2019 16.41, Marko Rauhamaa wrote: > Rhodri James : >> The description of the with statement does explicitly say that the >> context manager's __exit__() method won't be called until the suite >> has been executed, so the reference to the open file must exist for at >> least that long. > >

Re: Lifetime of a local reference

2019-02-27 Thread Thomas Jollans
On 27/02/2019 04.14, Alan Bawden wrote: > Marko Rauhamaa writes: >> I couldn't find an immediate answer in the documentation. > > I suspect that given the history of Python, pretty much everybody has > always assumed that a Python implementation will not delete local variables > early. But I agr

Re: Quirk difference between classes and functions

2019-02-26 Thread Thomas Jollans
On 25/02/2019 21.15, Chris Angelico wrote: > On Tue, Feb 26, 2019 at 6:58 AM DL Neil > wrote: >> >> On 26/02/19 5:25 AM, ast wrote: >>> I noticed a quirk difference between classes and functions >>> >>> x=0 >>> >>> class Test: >>> x = x+1 >>> print(x) >>> x = x+1 >>>

Re: Feature suggestion: "Using declarations" i.e. context managers ("with" blocks) tied to scope/lifetime of the variable rather than to nesting

2019-02-21 Thread Thomas Jollans
On 21/02/2019 19:35, mnl.p...@gmail.com wrote: > (I sent this a few days ago but got bounced without a reason—don’t see it > posted, so I’m trying one more time.) No, it got through. And it's in the archive: https://mail.python.org/pipermail/python-list/2019-February/739548.html -- https://mail

Re: revisiting the "What am I running on?" question

2019-02-20 Thread Thomas Jollans
On 20/02/2019 08.13, eryk sun wrote: > On 2/19/19, Chris Angelico wrote: >> >> The value "win32" means Windows (or, more technically, "Windows NT >> family", as opposed to Win95/Win98 - but since Win XP, that's the only >> type of Windows there is). If you actually care about whether it's a >> 32-

Re: Feature suggestions: "Using declarations" i.e. context managers ("with" blocks) tied to scope/lifetime of the variable rather than to nesting

2019-02-19 Thread Thomas Jollans
On 19/02/2019 05.15, mnl.p...@gmail.com wrote: > This becomes more ugly if multiple withs get nested. > This is what contextlib.ExitStack is for. -- https://mail.python.org/mailman/listinfo/python-list

Re: What's up with Activestate Python?

2019-02-18 Thread Thomas Jollans
On 18/02/2019 10.21, Barry Scott wrote: > > >> On 18 Feb 2019, at 08:49, Thomas Jollans wrote: >> >> Anaconda also has its moments, and has some packages that PyPI doesn't >> (for my use case, this is primarily PyQt5). > > Odd I use PyQt5 from PyPI

Re: What's up with Activestate Python?

2019-02-18 Thread Thomas Jollans
On 18/02/2019 10.21, Barry Scott wrote: > > >> On 18 Feb 2019, at 08:49, Thomas Jollans wrote: >> >> Anaconda also has its moments, and has some packages that PyPI doesn't >> (for my use case, this is primarily PyQt5). > > Odd I use PyQt5 from PyPI

Re: What's up with Activestate Python?

2019-02-18 Thread Thomas Jollans
On 14/02/2019 19:10, Grant Edwards wrote: > On 2019-02-14, Liste guru wrote: >> Il 14/02/2019 00:06, Grant Edwards ha scritto: >>> For many, many years I've always installed ActiveState's ActivePython >>> Community edition when forced to use Windows. It has always included >>> ... >>> I guess it'

Re: get the terminal's size

2019-01-14 Thread Thomas Jollans
On 14/01/2019 12.57, Alex Ternaute wrote: > Hi there, > > I want to know the number of columns of the terminal where python2 writes > it's outputs. > > In a terminal, I type > $ echo $COLUMNS > 100 > > But in Python, os.getenv("COLUMNS") gets nothing. > It gets nothing as well if I try to read

Re: Kivy native GUI examples

2019-01-07 Thread Thomas Jollans
On 07/01/2019 15.51, Dave wrote: > I need to select a Python GUI.  It needs to cover all of the desktops > (Linux, Windows, Apple) and hopefully mobile (Android and Ios).  I'm > looking at Kivy, but have yet to find an example app. that has a native > looking GUI (Windows, Mac, Linux/Gnome/KDE).  I

Re: Kivy native GUI examples

2019-01-07 Thread Thomas Jollans
On 07/01/2019 15.51, Dave wrote: > I need to select a Python GUI.  It needs to cover all of the desktops > (Linux, Windows, Apple) and hopefully mobile (Android and Ios).  I'm > looking at Kivy, but have yet to find an example app. that has a native > looking GUI (Windows, Mac, Linux/Gnome/KDE).  I

Re: Creating type evaluation annotation

2018-12-06 Thread Thomas Jollans
On 06/12/2018 11:48, Marek Mosiewicz wrote: > I'm Java developer,but had some experience with Python based > ERP software. It is quite serious application and I feel > unconfortable with not having type checking. I do not say language > should be static, but having checking method signature > is b

Re: Import module from file path

2018-12-05 Thread Thomas Jollans
On 05/12/2018 02:30, Oscar Benjamin wrote: > Hi all, > > I'm looking to import a module given a string representing the path to > the .py file defining the module. For example given this setup > > mkdir -p a/b/c > touch a/__init__.py > touch a/b/__init__.py > touch a/b/c/__init__.py > touch a/b/c

Re: How to run an infinite loop on Menu?

2018-12-03 Thread Thomas Jollans
On 03/12/2018 08:58, huey.y.ji...@gmail.com wrote: > Hi Folks, > > I need to run an infinite loop on a Menu button, like this: > > from Tkinter import * > > def run_job(): > i = 0 > while 1: > i = i + 1 > if i > 100: > break > ... > > root = Tk() > m

Re: Injecting methods into instance / class

2018-12-02 Thread Thomas Jollans
On 02/12/2018 18:56, duncan smith wrote: > Hello, > I have a lot of functions that take an instance of a particular > class as the first argument. I want to create corresponding methods in > the class. I have tried the following, which (when called from __init__) > creates the relevant method

Re: multiple JSON documents in one file, change proposal

2018-11-30 Thread Thomas Jollans
On 30/11/2018 23:40, Marko Rauhamaa wrote: > Paul Rubin : >> Maybe someone can convince me I'm misusing JSON but I often want to >> write out a file containing multiple records, and it's convenient to >> use JSON to represent the record data. >> >> The obvious way to read a JSON doc from a file is

Re: Python2.7 unicode conundrum

2018-11-25 Thread Thomas Jollans
On 25/11/2018 18:51, Robert Latest via Python-list wrote: > Hi folks, > what semmingly started out as a weird database character encoding mix-up > could be boiled down to a few lines of pure Python. The source-code > below is real utf8 (as evidenced by the UTF code point 'c3 a4' in the > third line

Re: Odd truth result with in and ==

2018-11-23 Thread Thomas Jollans
On 2018-11-22 09:58, Chris Angelico wrote: > On Thu, Nov 22, 2018 at 7:51 PM Thomas Jollans wrote: >> >> On 21/11/2018 20:18, Python wrote: >>> $ python3 >>> Python 3.5.2 (default, Nov 23 2017, 16:37:01) >>> [GCC 5.4.0 20160609] on linux >>> T

Re: Question about implementing immutability

2018-11-22 Thread Thomas Jollans
On 2018-11-21 17:45, Iwo Herka wrote: > Hello, > > Let's say I want to implement immutability for user-defined class. > More precisely, a class that can be modified only in its (or its > super-class') __init__ method. My initial idea was to do it the > following fashion: > > def __setattr__(s

Re: Question about implementing immutability

2018-11-22 Thread Thomas Jollans
On 2018-11-21 21:36, Calvin Spealman wrote: > If you want to create your own immutable class, maybe inherit from a > namedtuple? If you're tempted to go down that route and can require Python 3.7, use dataclasses! > > On Wed, Nov 21, 2018 at 11:45 AM Iwo Herka wrote: > >> Hello, >> >> Let's s

Re: Odd truth result with in and ==

2018-11-22 Thread Thomas Jollans
On 21/11/2018 20: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):

Re: Reading 'scientific' csv using Pandas?

2018-11-19 Thread Thomas Jollans
On 2018-11-18 19:22, Martin Schöön wrote: > Den 2018-11-18 skrev Shakti Kumar : >> On Sun, 18 Nov 2018 at 18:18, Martin Schöön wrote: >>> >>> Now I hit a bump in the road when some of the data is not in plain >>> decimal notation (xxx,xx) but in 'scientific' (xx,xxxe-xx) notation. >>> >> >> Martin

Re: IDLE Default Working Directory

2018-11-12 Thread Thomas Jollans
On 13/11/2018 00:45, Terry Reedy wrote: > > On Windows, a simple alternate is a .bat file.  I belive the folloiwing > should work. > > cd c:/desired/startup/directory > py -x.y -m idlelib > > The default for x.y is latest 3.x or latest 2.x if no 3.x. Correct me if I'm wrong, but won't that crea

Re: distribute python interpreter and dependencies

2018-11-12 Thread Thomas Jollans
On 12/11/2018 17:40, Juan Cristóbal Quesada wrote: > Hello, > this is my first mail. I resorted to the list after some prior struggling. Welcome! > Im facing the need to distribute a python installation folder and > interpreter in a shared network drive. > > Im also distributing the application'

Re: Issue in parsing the strings in python code

2018-11-12 Thread Thomas Jollans
On 2018-11-12 10:23, srinivasan wrote: > Hi Thomas, > > Great to hear from you, Could you please let me know how do I get the UUID > "1da7d068-4548-4446-bf88-a440e49db1b1" by passing the name of the SSID > "Funkloch' using "nmcli --terse" ?? Have a look at the output. It appears to me that the f

Re: Issue in parsing the strings in python code

2018-11-12 Thread Thomas Jollans
On 12/11/2018 09:28, srinivasan wrote: > Dear Python Experts team, > > This question might be very simple for you, As am newbie to python, could > you please how to parse the below strings > > [snip] > > > root:~/qa/robot_tests# nmcli c show Pro tip: many *nix tools have a flag that makes them

Re: Good editor for python

2018-11-11 Thread Thomas Jollans
On 11/11/2018 10:14, Olive wrote: > I am not a professional programmer but I use Python regularly for custom > scripts (and plot with matplotlib). I have just learned VBA for Excel: what I > found amazing was their editor: it is able to suggest on the spot all the > methods an object support and

Re: installing modules problem

2018-11-08 Thread Thomas Jollans
On 2018-11-08 06:04, Ian K. wrote: > Hello, > > My name is Ian Kilty and I have been having trouble with pip. I have pip > installed, and I have tried to install modules they say they are installed > in cmd, but when I go into python and import the module, it can't find it. > I hope there is a sim

Re: Overwhelmed by the Simplicity of Python. Any Recommendation?

2018-11-07 Thread Thomas Jollans
On 07/11/2018 21:31, MRAB wrote: > On 2018-11-07 09:20, Thomas Jollans wrote: >> On 06/11/2018 22:51, Lie Ryan wrote: >>>> I like to step through my code line by line, >>>> it's impossible to do it with >>>> object-oriented programming language. &g

  1   2   3   4   5   6   7   8   9   10   >