Re: Numpy and Terabyte data

2018-01-02 Thread Paul Moore
On 2 January 2018 at 17:24, Rustom Mody wrote: > Someone who works in hadoop asked me: > > If our data is in terabytes can we do statistical (ie numpy pandas etc) > analysis on it? > > I said: No (I dont think so at least!) ie I expect numpy (pandas etc) > to not work if the data does not fit in m

Re: Progress migrating cffi and pycparser to libclang

2018-01-04 Thread Paul Moore
On 4 January 2018 at 09:50, Etienne Robillard wrote: > Hi, > > I will be creating a repository for this: > https://bitbucket.org/tkadm30/cffi-libclang > > The goal is to generate a AST object from a C header by preprocessing with > clang -E then compile the python bindings with CFFI... > > ffi.cde

Re: Progress migrating cffi and pycparser to libclang

2018-01-04 Thread Paul Moore
On 4 January 2018 at 21:02, Etienne Robillard wrote: >> As a fork/extension for cffi, I have no particular opinion (I'm >> unlikely to ever use it). But the advantage of pycparser is that it's >> cross-platform and pure Python, so I doubt this will be acceptable for >> inclusion into CFFI itself.

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread Paul Moore
On 9 January 2018 at 16:18, Chris Angelico wrote: > On Wed, Jan 10, 2018 at 2:21 AM, Robert O'Shea > wrote: >> Hey all, >> >> Been subscribed to this thread for a while but haven't contributed much. >> One of my ultimate goals this year is to get under the hood of CPython and >> get a decent unde

Re: Pandas printing in jupyter

2018-01-11 Thread Paul Moore
The HTML representation is supplied by the object's _repr_html_ method. See https://ipython.org/ipython-doc/3/config/integrating.html for some details. >>> import pandas as pd >>> df = pd.DataFrame() >>> df._repr_html_() '\n\n.dataframe tbody tr th:only-of-type {\n vertical-align: middle;\

Re: PIP message: Fatal error in launcher: Unable to create process using '"'

2018-01-11 Thread Paul Moore
Have you done any research (google, for example) and tried any of the suggested solutions on the web? >From a quick search, I'd suggest: 1. Can you confirm if "python -m pip " has the same error? 2. What is the exact path of the pip executable you're running, and if you go into the Python prompt

Re: PIP message: Fatal error in launcher: Unable to create process using '"'

2018-01-11 Thread Paul Moore
ocal\Programs\Python\Python36\lib\site-packages\pip\__init__.py >>>> > > > C:\Users\harriett.xing-adm>python --version > Python 3.6.1 > > pip is getting the error regardless of which directory I run it. > > Thank you for your help. > > > > On Th

Re: Simple graphic library for beginners

2018-01-11 Thread Paul Moore
On 11 January 2018 at 18:33, bartc wrote: >> Go. Fetch. Stop fudding. > > And you know this link, how? Because googling for 'download pygame', it > doesn't appear on the first page (or in any of the next half dozen). Using your search phrase, the first results I get are: 1. Downloads - Pygame

Re: Simple graphic library for beginners

2018-01-11 Thread Paul Moore
On 11 January 2018 at 19:51, bartc wrote: > I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled it, > this time with the 'set environment variables' option (to allow 'pip' to be > typed from anywhere). Stop trolling. Python 3.7 final hasn't been released yet. OF COURSE you will

Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
On 12 January 2018 at 01:21, bartc wrote: > On 11/01/2018 23:23, Chris Angelico wrote: >> >> On Fri, Jan 12, 2018 at 10:11 AM, bartc wrote: > > >> I'm almost ready to plonk you, but I think there is still SOME value >> in your posts. But please, stop denigrating what you don't understand. > > > A

Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
On 12 January 2018 at 06:45, Steven D'Aprano wrote: >> The recommendation was already given to use "python3 -m pip". That gets >> around those problems. > > If you google for installation instructions, they're nearly always given > in terms of "use pip", not "use python3.4 -m pip". > > My point is

Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
On 12 January 2018 at 06:47, Steven D'Aprano wrote: > On Fri, 12 Jan 2018 12:45:04 +1300, Gregory Ewing wrote: > >> Seems to me it would help if pip were to announce which version of >> Python it's installing things into. And instead of just saying "not >> compatible with this version of Python",

Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
On 12 January 2018 at 09:12, Tim Golden wrote: > I think the shame here is that there is a learning opportunity on both > sides. As Paul says: by and large, the huge amount of work which the Python > Packaging team, especially the pip developers, have put in has paid off. > It's now usually possib

Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
On 12 January 2018 at 17:25, Mikhail V wrote: > And the target Python where the package will be installed should be defined by > a switch, e.g. 'pip -2', 'pip -3' (in analogy with 'py -2', 'py -3'). > The question is though, how pip will know what version(s) of python I have, > and > if I install

Re: Where are the moderators?

2018-01-18 Thread Paul Moore
On 18 January 2018 at 22:38, Mike Driscoll wrote: > Hi, > > What happened to the moderators? I have always liked this forum, but there's > so much spam now. Is there a way to become a moderator so this can be cleaned > up? > > Thanks, > Mike You seem to be using the Google Groups interface. The

Re: Can't get python running

2018-01-21 Thread Paul Moore
On 21 January 2018 at 01:53, Chris Angelico wrote: > On Sun, Jan 21, 2018 at 12:46 PM, Steven D'Aprano > wrote: >> On Sun, 21 Jan 2018 12:21:40 +1100, Chris Angelico wrote: >> >>> Jim, let the installer put it where it wants to, and make sure you've >>> added it to PATH. Then you should be able t

Re: Installing "kitchen" module

2018-01-22 Thread Paul Moore
You need to run that command from a CMD prompt, not from inside the Python interpreter. On 22 January 2018 at 16:19, wrote: > On Tuesday, 23 January 2018 02:41:04 UTC+10:30, bream...@gmail.com wrote: >> On Monday, January 22, 2018 at 3:37:44 PM UTC, codyda...@gmail.com wrote: >> > So here's the

Re: Installing "kitchen" module

2018-01-22 Thread Paul Moore
"python -m pip install kitchen" is probably your best approach (from the CMD prompt). On 22 January 2018 at 16:31, wrote: > On Tuesday, 23 January 2018 02:56:56 UTC+10:30, Paul Moore wrote: >> You need to run that command from a CMD prompt, not from inside the >> Pyt

Re: Installing "kitchen" module

2018-01-22 Thread Paul Moore
On 22 January 2018 at 17:20, wrote: > On Tuesday, 23 January 2018 03:41:28 UTC+10:30, Paul Moore wrote: >> "python -m pip install kitchen" is probably your best approach (from >> the CMD prompt). >> >> On 22 January 2018 at 16:31, wrote: >> >

Re: What is more Pythonic: subclass or adding functionality to base class?

2018-02-11 Thread Paul Moore
On 11 February 2018 at 12:55, D'Arcy Cain wrote: > On 02/11/18 06:30, Victor Porton wrote: >> What is more pythonic? >> >> 1. Create its subclass PredicateParserWithError and add the additional field >> on_error to this class. >> >> 2. Add on_error field to the base class, setting it to None by de

Re: Fw: [issue22167] iglob() has misleading documentation (does indeed store names internally)

2018-02-18 Thread Paul Moore
You're shown as nosy on that issue: 2014-08-08 01:24:52 Gumnos set nosy: + Gumnos Paul On 17 February 2018 at 13:47, Tim Chase wrote: > Has anybody else been getting unexpected/unsolicited emails from the > Python bug-tracker? > > I'm not associated with (didn't submit/lurk/follow/sign-up-for)

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Paul Moore
On 19 February 2018 at 13:06, Anders Wegge Keller wrote: > Python isn't particular strong typed. In fact, apart from asking an object > what type it is, types are not that important. It's the interface that > matters. I wonder why this is a sore point for Python developers? Because there's a lon

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Paul Moore
On 19 February 2018 at 15:18, Ned Batchelder wrote: > On 2/19/18 9:54 AM, Steven D'Aprano wrote: >> >> On Mon, 19 Feb 2018 13:28:26 +, Paul Moore wrote: >> >>> [1] The most basic question, which people making such claims often can't >>> answe

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Paul Moore
On 19 February 2018 at 17:11, Ned Batchelder wrote: > On 2/19/18 10:39 AM, Paul Moore wrote: >> >> I'm curious - How would you explain Python's "variables" to someone >> who knows how C variables work, in a way that ensures they don't carry >>

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-20 Thread Paul Moore
On 20 February 2018 at 11:18, Antoon Pardon wrote: > Personnally I would prefer the type system of Pascal and Modula2 with > their interval type > above a Digit class in python. For the simple reason that once you had > declared a variable > like this: > x: 1 .. 10; > > Each assignment to x wo

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-20 Thread Paul Moore
On 20 February 2018 at 13:04, Antoon Pardon wrote: > On 20-02-18 13:11, Paul Moore wrote: >> On 20 February 2018 at 11:18, Antoon Pardon wrote: >>> Personnally I would prefer the type system of Pascal and Modula2 with >>> their interval type >>> above a D

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-20 Thread Paul Moore
On 20 February 2018 at 13:53, Antoon Pardon wrote: > You can't put such constraints on names in Python. I know. That's what *I* said some time ago. >> Sigh. Languages are different. That's my point. > > So, if languages are different, why the difficulty in accepting one can > do something the o

Re: Strange problem with pip2

2018-03-01 Thread Paul Moore
On 1 March 2018 at 16:32, Dennis Lee Bieber wrote: > Note that a google search shows lots of problems apparently caused by > the --single-version-externally-managed option. --single-version-externally-managed is how pip calls setuptools, and is required. It doesn't cause any problems the

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-02 Thread Paul Moore
On 2 March 2018 at 15:09, wrote: > We must be discussing a different RAII. That is the raison d'etre of RAII: > RAII directly addresses this problem in an exception-safe way that does not > burden the resource user at all. RAII works in C++ (where it was initially invented) because it's used w

Re: The Joys Of Data-Driven Programming

2016-08-31 Thread Paul Moore
On Sunday, 21 August 2016 15:20:39 UTC+1, Marko Rauhamaa wrote: > > Aren’t makefiles data-driven? > > Yes, "make" should be added to my sin list. > > > [Personally Ive always believed that jam is better than make and is > > less used for entirely historical reasons; something like half the > > w

Re: The Joys Of Data-Driven Programming

2016-08-31 Thread Paul Moore
On 31 August 2016 at 13:49, Cem Karan wrote: >> Has anyone else found this to be the case? Is there any "make replacement" >> out there that focuses more on named sets of actions (maybe with >> prerequisite/successor type interdependencies), and less on building file >> dependency graphs? > > M

Re: [python-committers] [RELEASE] Python 3.6.0b1 is now available

2016-09-14 Thread Paul Moore
On 14 September 2016 at 11:32, Serhiy Storchaka wrote: > On 13.09.16 02:35, Ned Deily wrote: >> >> On behalf of the Python development community and the Python 3.6 release >> team, I'm happy to announce the availability of Python 3.6.0b1. 3.6.0b1 >> is the first of four planned beta releases of Py

Re: Looking for tips and gotchas for working with Python 3.5 zipapp feature

2016-09-19 Thread Paul Moore
On 16 September 2016 19:48 at 21:08, Malcolm Greene wrote: > Looking for tips or edge case gotchas associated with using Python 3.5's > new zipapp feature. It's worth pointing out that support for executing zipped applications has been part of Python since Python 2.6 or so. The pyz files created

Re: Looking for tips and gotchas for working with Python 3.5 zipapp feature

2016-09-23 Thread Paul Moore
On Tuesday, 20 September 2016 05:45:53 UTC+1, Malcolm Greene wrote: > I really appreciate the detailed response. You answered all my > questions. I'm looking forward to testing out your pylaunch wrapper. Just one further note, which may or may not be obvious. If your application uses external

Re: How to call a method returning a value from a main function

2016-09-28 Thread Paul Moore
On Wednesday, 28 September 2016 07:47:38 UTC+1, prasanth kotagiri wrote: > def GenAccessToken(mackey,authid,configid,tokenexp,*perm): > args=JWTParms() > args.configurationId=configid > args.authzSystemMacKey=mackey > args.authzSystemId=authid > args.tokenExpiryInSeconds=tokene

Using the Windows "embedded" distribution of Python

2016-09-28 Thread Paul Moore
This is probably more of a Windows question than a Python question, but as it's related to embedding Python, I thought I'd try here anyway. I'm writing some command line applications in Python, and I want to bundle them into a standalone form using the new "embedding" distribution of Python. The

Re: How to make a foreign function run as fast as possible in Windows?

2016-09-28 Thread Paul Moore
On Tuesday, 27 September 2016 02:49:08 UTC+1, jf...@ms4.hinet.net wrote: > This function is in a DLL. It's small but may run for days before complete. I > want it takes 100% core usage. Threading seems not a good idea for it shares > the core with others. Will the multiprocessing module do it? A

Re: Is there a way to change the closure of a python function?

2016-09-28 Thread Paul Moore
On Wednesday, 28 September 2016 10:19:01 UTC+1, Chris Angelico wrote: > If monads allow mutations or side effects, they are by definition not > pure functions, and violate your bullet point. Languages like Haskell > have them not because they are an intrinsic part of functional > programming langu

Re: Using the Windows "embedded" distribution of Python

2016-09-29 Thread Paul Moore
On Wednesday, 28 September 2016 21:50:54 UTC+1, eryk sun wrote: > On Wed, Sep 28, 2016 at 2:35 PM, Paul Moore wrote: > > So I thought I'd try SetDllDirectory. That works for python36.dll, but if I > > load > > python3.dll, it can't find Py_Main - the export shows

Re: Using the Windows "embedded" distribution of Python

2016-09-29 Thread Paul Moore
On Thursday, 29 September 2016 10:39:10 UTC+1, eryk sun wrote: > On Thu, Sep 29, 2016 at 8:35 AM, Paul Moore wrote: > > PS It's a shame there's no way to put the embedded distribution in a > > subdirectory > > *without* needing to use dynamic loading, but I gu

Re: Using the Windows "embedded" distribution of Python

2016-09-29 Thread Paul Moore
On Thursday, 29 September 2016 12:56:28 UTC+1, eryk sun wrote: >> Oh, wow. Now you mention it, I recall that convention (from somewhere). >> >> I'll investigate that option (although it may not suit my use case, as >> I want multiple exes in the one "main" directory sharing a single >> "local" Py

Re: Using the Windows "embedded" distribution of Python

2016-09-30 Thread Paul Moore
On Thursday, 29 September 2016 12:56:28 UTC+1, eryk sun wrote: > In that case you can use an application manifest with a dependent > assembly. Say embedded Python 3.6 is in the "py3embed" subdirectory. > Add the following manifest file to that directory: > > py3embed.manifest: > > > >

Re: How to make a foreign function run as fast as possible in Windows?

2016-09-30 Thread Paul Moore
On Thursday, 29 September 2016 02:23:13 UTC+1, jf...@ms4.hinet.net wrote: > Paul Moore at 2016/9/28 11:31:50PM wrote: > > Taking a step back from the more detailed answers, would I be right to > > assume that you want to call this external function multiple times from > >

Re: Using the Windows "embedded" distribution of Python

2016-09-30 Thread Paul Moore
On Friday, 30 September 2016 12:50:45 UTC+1, eryk sun wrote: > On Fri, Sep 30, 2016 at 11:02 AM, Paul Moore wrote: > > When I run ssh.exe, it fails with the message "The program cannot start > > because > > python3.dll is missing from your computer". I trie

Python GUI application embedding a web browser - Options?

2016-10-19 Thread Paul Moore
I'm looking to write a GUI application in Python (to run on Windows, using Python 3.5). The application is just a relatively thin wrapper around a browser - it's presenting an existing web application, just in its own window rather than in a standard browser window. I'm looking for advice on a g

Re: Python GUI application embedding a web browser - Options?

2016-10-19 Thread Paul Moore
On 19 October 2016 at 12:10, Phil Thompson wrote: > The Chrome-based QWebEngineView (http://doc.qt.io/qt-5/qwebengineview.html) > is fully supported by PyQt. Nice. Thanks for the pointer. Looks like the various bits of advice I found on the web are a little out of date, is all. Cheers, Paul --

Re: Python GUI application embedding a web browser - Options?

2016-10-19 Thread Paul Moore
On Wednesday, 19 October 2016 13:54:09 UTC+1, Mark Summerfield wrote: > > Since the application is a web app have you looked at: > https://github.com/r0x0r/pywebview + https://github.com/dddomodossola/remi > or at > https://flexx.readthedocs.io/en/stable/ > These basically wrap the platform's web

Re: The Case Against Python 3

2016-12-01 Thread Paul Moore
On Tuesday, 29 November 2016 01:01:01 UTC, Chris Angelico wrote: > So what is it that's trying to read something and is calling an > f-string a mere string? gettext.c2py: """Gets a C expression as used in PO files for plural forms and returns a Python lambda function that implements an e

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-05 Thread Paul Moore
On Monday, 5 December 2016 14:11:34 UTC, BartC wrote: > On 05/12/2016 12:23, Chris Angelico wrote: > > On Mon, Dec 5, 2016 at 10:42 PM, BartC wrote: > >> At least Windows does it properly. It doesn't even chop the command line > >> into different parameters, making it considerably more flexible.

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-05 Thread Paul Moore
On Monday, 5 December 2016 15:06:05 UTC, Chris Angelico wrote: > On Tue, Dec 6, 2016 at 1:11 AM, BartC wrote: > > > > BTW what does Popen() do when one argument is '*.*'? Will that get expanded > > to multiple extra arguments, and at what point will it be expanded? > > Nope. Popen is not a shell

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-05 Thread Paul Moore
On Monday, 5 December 2016 15:41:59 UTC, BartC wrote: > On 05/12/2016 15:05, Chris Angelico wrote: > > On Tue, Dec 6, 2016 at 1:11 AM, BartC wrote: > >> > >> BTW what does Popen() do when one argument is '*.*'? Will that get expanded > >> to multiple extra arguments, and at what point will it be

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-06 Thread Paul Moore
On Monday, 5 December 2016 18:21:57 UTC, Chris Angelico wrote: > On Tue, Dec 6, 2016 at 5:02 AM, BartC wrote: > > > > how do you tell whether the last file in an argument list is the optional > > 'file', or the last file of the expansion of 'filespec'? > > Why should you care? I have used shell

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-06 Thread Paul Moore
On Monday, 5 December 2016 17:14:27 UTC, Skip Montanaro wrote: > ISTR that the way DOS/Windows operate at the text prompt level was > modeled on VMS. As you indicated, each command was responsible for its > own "globbing". I've never programmed in DOS or Windows, and its been > decades since I pro

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-06 Thread Paul Moore
On Tuesday, 6 December 2016 13:25:40 UTC, BartC wrote: > On 06/12/2016 12:40, Gregory Ewing wrote: > > BartC wrote: > >> I've given a dozen examples where the shell's auto-expansion can screw > >> things up. > > > > Only because you're taking Windows conventions and trying > > to apply them to Uni

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Paul Moore
On Tuesday, 6 December 2016 16:34:10 UTC, Michael Torrie wrote: > On 12/06/2016 06:52 AM, BartC wrote: > > Then you don't get utterly ridiculous and dangerous behaviour such as > > the cp example Paul Moore came up with (that trumps most of mine actually): > > It'

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Paul Moore
On Tuesday, 6 December 2016 21:44:18 UTC, Gregory Ewing wrote: > BartC wrote: > > But those would be silly. > > > > Some special syntax is known about: | < and > for example. % less so > > What you need to understand is that, to a Unix user, > * and ? are *just as well known* as |, < and >. And

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Paul Moore
On Wednesday, 7 December 2016 11:55:01 UTC, BartC wrote: > With automatic expansion, then EVERY program can become dangerous. Can > no one else see this? Please start an elevated command prompt on your PC, and type the command rmdir /s /q C:\WINDOWS There are no special characters here, so

Re: calling a program from Python batch file

2016-12-08 Thread Paul Moore
On Wednesday, 7 December 2016 18:23:23 UTC, Michael Torrie wrote: > Does Pexpect work on Windows? Apparently yes: https://pexpect.readthedocs.io/en/stable/overview.html#pexpect-on-windows "New in version 4.0: Windows support" > In the OP's case it looks like the standard in pipe is sufficient

Parsing a potentially corrupted file

2016-12-14 Thread Paul Moore
I'm looking for a reasonably "clean" way to parse a log file that potentially has incomplete records in it. The basic structure of the file is a set of multi-line records. Each record starts with a series of fields delimited by [...] (the first of which is always a date), optionally separated b

Re: Parsing a potentially corrupted file

2016-12-14 Thread Paul Moore
On Wednesday, 14 December 2016 12:57:23 UTC, Chris Angelico wrote: > Is the "[Component]" section something you could verify? (That is - is > there a known list of components?) If so, I would include that as a > secondary check. Ditto anything else you can check (I'm guessing the > [level] is one

Re: Temporary variables in list comprehensions

2017-01-10 Thread Paul Moore
On Monday, 9 January 2017 03:53:37 UTC, Steven D'Aprano wrote: > Suppose you have an expensive calculation that gets used two or more times > in a loop. [...] > [(tmp, tmp + 1) for x in data for tmp in [expensive_calculation(x)]] > > I can't decide whether that's an awesome trick or a horrible

Re: The hardest problem in computer science...

2017-01-10 Thread Paul Moore
On Saturday, 7 January 2017 19:14:43 UTC, Ethan Furman wrote: > Ya know, that looks an /awful/ lot like a collection! Maybe even an Enum? ;) > > -- 8< --- > from aenum import Enum # note the 'a' before the 'enum' :) > > class Theme(Enum, i

Re: The hardest problem in computer science...

2017-01-10 Thread Paul Moore
On Tuesday, 10 January 2017 15:47:20 UTC, Paul Moore wrote: > On Saturday, 7 January 2017 19:14:43 UTC, Ethan Furman wrote: > > Ya know, that looks an /awful/ lot like a collection! Maybe even an Enum? > > ;) > > > > -- 8< --

Re: A detailed description on virtualenv's packaging dependecies? (pip, easy_install, wheel, setuptools, distlib, etc.)

2017-01-16 Thread Paul Moore
On Friday, 13 January 2017 09:27:21 UTC, haraldn...@gmail.com wrote: > I was working on a bugfix for Virtualenv, regarding very long shebang lines > that are breaking things. In the process, I realized that if I want really > fix to my particular issue it likely needs to be done on the lower lev

Re: Running Virtualenv with a custom distlib?

2017-01-16 Thread Paul Moore
On Friday, 13 January 2017 09:27:59 UTC, haraldn...@gmail.com wrote: > I want to do some development on `distlib`, and in the process run the code > via `virtualenv` which has distlib as a dependency. > > That is, not run the process inside a virtualenv, but run virtualenv's code > using a cust

Re: Is shutil.get_terminal_size useless?

2017-01-30 Thread Paul Moore
On Monday, 30 January 2017 05:37:32 UTC, Steven D'Aprano wrote: > On Monday 30 January 2017 08:12, Serhiy Storchaka wrote: > > > On 28.01.17 10:03, Steve D'Aprano wrote: > >> Is shutil.get_terminal_size useless? When, if ever, should I use it in > >> preference to the os version? If the shutil ve

Re: I found strange thing while studying through idle

2018-03-09 Thread Paul Moore
On 9 March 2018 at 17:46, Rob Gaddi wrote: > On 03/08/2018 07:57 PM, Steven D'Aprano wrote: >> >> [snip] >> >> But it is possible that due to differences between platforms, the >> OP's version of IDLE doesn't display a carriage return as \r but >> rather as an invisible zero-width space. >> > > Ju

Re: Enumerating all 3-tuples

2018-03-10 Thread Paul Moore
On 10 March 2018 at 02:18, MRAB wrote: > On 2018-03-10 01:13, Steven D'Aprano wrote: >> >> I am trying to enumerate all the three-tuples (x, y, z) where each of x, >> y, z can range from 1 to ∞ (infinity). >> >> This is clearly unhelpful: >> >> for x in itertools.count(1): >> for y in itertoo

Re: __import__ fails randomly due to missing file

2018-03-12 Thread Paul Moore
On 12 March 2018 at 09:12, Arkadiusz Bulski wrote: > Hi, > > For the record, I am the developer of Construct library. And the question > relates to it. > https://construct.readthedocs.io/en/latest/# > > I have an issue of Travis failing randomly at test cases. The cause is > always __import__ fail

Re: Enumerating all 3-tuples

2018-03-13 Thread Paul Moore
On 13 March 2018 at 11:01, Steven D'Aprano wrote: > On Sat, 10 Mar 2018 11:15:49 +0000, Paul Moore wrote: > >> On 10 March 2018 at 02:18, MRAB wrote: > [...] >>> This might help, although the order they come out might not be what you >>> want: >&

Re: Restore via pip to new OS

2018-03-14 Thread Paul Moore
Use pip freeze rather than pip list. That will give you the information in "requirements file" format that pip install -r can read. Paul On 14 March 2018 at 23:20, Tim Johnson wrote: > I'm currently running both python and python3 on ubuntu 14.04. > Plan is to do a complete re-install of ubuntu

Re: Writing a C extension - borrowed references

2018-03-20 Thread Paul Moore
On 20 March 2018 at 16:22, Tom Evans via Python-list wrote: > Hi all > > I'm writing my first C extension for Python here, and all is going > well. However, I was reading [1], and the author there is advocating > Py_INCREF 'ing *every* borrowed reference. > > Now, I get that if I do something to m

Re: Reg python regexp

2018-03-21 Thread Paul Moore
Hi, You don't need a regexp for this, the "replace" method on a string will do what you want: >>> s = 'this is a [string' >>> print(s.replace('[', '\\[')) this is a \[string Paul On 21 March 2018 at 10:44, wrote: > Hi, > > I have a requirement. > > cmd="cat |grep -c 'if [ -t 1 ]; then mesg n

Re: Putting Unicode characters in JSON

2018-03-23 Thread Paul Moore
On 23 March 2018 at 00:27, Thomas Jollans wrote: > On 22/03/18 20:46, Tobiah wrote: >> I was reading though, that JSON files must be encoded with UTF-8. So >> should I be doing string.decode('latin-1').encode('utf-8')? Or does >> the json module do that for me when I give it a unicode object? >

Re: Using object as a class

2018-03-26 Thread Paul Moore
In fact, object acts just like a user-defined class, with __slots__ set to empty: >>> class MyObj(object): ... __slots__ = () ... >>> o = MyObj() >>> o.x = 3 Traceback (most recent call last): File "", line 1, in AttributeError: 'MyObj' object has no attribute 'x' See https://docs.python.o

Re: please test the new PyPI (now in beta)

2018-03-27 Thread Paul Moore
On 27 March 2018 at 09:35, Steven D'Aprano wrote: > On Mon, 26 Mar 2018 18:16:26 -0400, Sumana Harihareswara wrote: > >> The new Python Package Index at https://pypi.org is now in beta. >> >> This means the site is robust, but we anticipate needing more user >> testing and changes before it is "pr

Re: please test the new PyPI (now in beta)

2018-03-27 Thread Paul Moore
On 27 March 2018 at 10:48, Paul Moore wrote: > Same is true of your comment about the site design, > although I suspect it's a bit late for that to be changed in the > immediate future - the site design has been basically unchanged since > very early in the redesign. Personall

Re: Pep8 for long pattern

2018-03-27 Thread Paul Moore
Use re.X - see https://docs.python.org/3.6/library/re.html#re.X for details. On 27 March 2018 at 15:17, Ganesh Pal wrote: > Hello Python friends, > > How do I split the below regex , so that it fits within the character > limit of 79 words > > > pattern = [ > r'(?P([0-9a-fA-F]+:[0-9a-fA-F]+:[0-

Re: Calling Matlab (2016a) function from Python(3.6)

2018-03-28 Thread Paul Moore
On 28 March 2018 at 10:23, wrote: > So I am using the following code to call a Matlab(2016a) function from > python(3.6). > >>>import win32com.client >>>h = win32com.client.Dispatch('matlab.application') >>>h.Execute ("plot([0 18], [7 23])") > > When I am using the 'Execute' statement to run a m

Re: Distributing Python virtual environments

2018-03-29 Thread Paul Moore
On 29 March 2018 at 15:06, Malcolm Greene wrote: > We're using virtual environments with Python 3.6. Since all our pip > installed modules are in our environment's local site-packages folder, > is the distribution of a virtual environment as simple as recursively > zipping the environment's root f

Re: please test the new PyPI (now in beta)

2018-03-30 Thread Paul Moore
On 30 March 2018 at 14:38, William Ray Wing wrote: > Sumana, I want to be sure we aren’t just talking past each other. I notice > that the URL you seem to always reference is: > > https://pypi.org/search/ > > and if I go there, I get the filter list immediately. The place I don’t see >

Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-30 Thread Paul Moore
On 30 March 2018 at 16:45, Terry Reedy wrote: > https://www.jetbrains.com/research/python-developers-survey-2017/ > “Which version of Python do you use the most?” > 2014 80% 2.x, 20% 3.x > 2016 60% 2.x, 40% 3.x > 2017 25% 2.x, 75% 3.x > > This is a bigger jump than I anticipated. Nice! -- https:

Beta release of pip version 10

2018-03-31 Thread Paul Moore
On behalf of the PyPA, I am pleased to announce that a beta release 10.0.0b1 of pip has just been released for testing by the community. We're planning on a final release in 2 weeks' time, over the weekend of 14/15 April. To install pip 10.0.0.b1, you can run python -m pip install --upgrade -

Re: Beta release of pip version 10

2018-04-01 Thread Paul Moore
On 1 April 2018 at 04:15, Mikhail V wrote: > MRAB writes: > > >> > UnicodeEncodeError: 'charmap' codec can't encode character >> > >> > when it meets a non-ascii char. >> > >> > e.g. tried this: >> > pip search pygame > a.txt >> > >> Well, _I_ didn't get an error! >> >> One of the lines is: >> >>

Re: Beta release of pip version 10

2018-04-01 Thread Paul Moore
On 1 April 2018 at 03:16, MRAB wrote: > On 2018-04-01 02:50, Mikhail V wrote: >> >> Steven D'Aprano writes: >> PS: was looking forward to PIP improvements on Windows, on 9.0.3 still some issues. E.g. trying to redirect output from 'pip search ... > a.txt' gives a wall of errors

Re: Beta release of pip version 10

2018-04-02 Thread Paul Moore
have had problems with the 10.0.0b1 release should upgrade to 10.0.0b2. Thanks, Paul On 31 March 2018 at 12:11, Paul Moore wrote: > On behalf of the PyPA, I am pleased to announce that a beta release > 10.0.0b1 of pip has just been released for testing by the community. > We're plann

Re: Python aliases under Windows?

2018-04-03 Thread Paul Moore
On 3 April 2018 at 10:24, Kirill Balunov wrote: > Perhaps this is a silly question but still...There is PEP 394 "The "python" > Command on Unix-Like Systems" which I find very reasonable, no matter how > it is respected. Why was not _somewhat_ the same done for Windows? History, mainly. Plus the

Re: logging.FileHandler diff Py2 v Py3

2018-04-03 Thread Paul Moore
On 3 April 2018 at 17:54, Peter Otten <__pete...@web.de> wrote: > I think the culprit is io.open() rather than the logging module. Why does > io.open("/dev/stderr", "a") > Traceback (most recent call last): > File "", line 1, in > OSError: [Errno 29] Illegal seek > > even try to seek()? Be

Re: Asynchronous processing is more efficient -- surely not?

2018-04-04 Thread Paul Moore
On 4 April 2018 at 08:27, Steven D'Aprano wrote: > "Asynchronous programming has been gaining a lot of traction in the past > few years, and for good reason. Although it can be more difficult than > the traditional linear style, it is also much more efficient." > > I can agree with the first part

Pip 10.0 has been released

2018-04-14 Thread Paul Moore
On behalf of the PyPA, I am pleased to announce that pip 10.0 has just been released. This release has been the culmination of many months of work by the community. To install pip 10.0, you can run python -m pip install --upgrade pip or use get-pip, as described in https://pip.pypa.io/en/lat

Re: The basics of the logging module mystify me

2018-04-19 Thread Paul Moore
On 19 April 2018 at 02:00, Skip Montanaro wrote: > I really don't like the logging module, but it looks like I'm stuck > with it. Why aren't simple/obvious things either simple or obvious? If you can use non-stdlib things there are alternatives. I've heard good things about logbok (https://logboo

Pip 10.0.1 has been released

2018-04-19 Thread Paul Moore
On behalf of the PyPA, I am pleased to announce that pip 10.0.1 has just been released. This release fixes a number of issues with the initial release of pip 10.0, notably: * A problem with running the "pip.exe" wrapper script on Windows from a directory with a space in the name. * A problem with

Re: Determining whether a package or module should be installed globally using pip

2018-04-25 Thread Paul Moore
On 25 April 2018 at 16:32, Rodrigo Acosta wrote: > Is there a rule of thumb in deciding where to install a package? What makes a > package, other than security vulnerabilities, better to install globally e.g. > using sudo pip install, or by changing directory to tmp folder, or by using > virtua

Re: Installation of tensorflow via pip -- messages?

2018-04-26 Thread Paul Moore
On 26 April 2018 at 19:33, Virgil Stokes wrote: > Why am I getting this message, that I need to consider adding this directory > to PATH when it is already in PATH? > Note, all of these *.exe files are in C:\Python36\Scripts. The PATH entry ends with a backslash, which is confusing the check done

Re: Installation of tensorflow via pip -- messages?

2018-04-26 Thread Paul Moore
On 26 April 2018 at 20:04, Virgil Stokes wrote: > IMHO it would have been useful to have "warning" somewhere in these > messages. Ha, I'd never even noticed that it didn't... I think it's in a different colour, FWIW, but your point is good. Paul -- https://mail.python.org/mailman/listinfo/pytho

Re: Installation of tensorflow via pip -- messages?

2018-04-26 Thread Paul Moore
On 26 April 2018 at 21:18, Terry Reedy wrote: >> If my memory is correct, this is the default for path directories. > > The Python entries do, as added by the Windows Installer written by a > Microsoft engineer, so this must at least be a correct alternative. It's definitely acceptable - there's

Re: www.python.org down

2018-04-30 Thread Paul Moore
It's working for me now. Paul On 30 April 2018 at 18:38, Jorge Gimeno wrote: > Not sure who to report to, but the site comes back with a 503. Anyone know > where I can direct this to? > > -Jorge L. Gimeno > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mail

Re: venv: make installed modules visible

2018-05-01 Thread Paul Moore
On 1 May 2018 at 17:06, Rich Shepard wrote: > Activating venv and trying to run the project Python tells me it cannot > find the wxPython4 modules: > > Traceback (most recent call last): > File "./openEDMS.py", line 12, in > import wx > ModuleNotFoundError: No module named 'wx' > > I've

Re: Python 2.7.15 Windows MSI removes previous 2.7.x binaries?

2018-05-01 Thread Paul Moore
It's intended behaviour (to my knowledge). Or at least, we don't intend for people to install two different patch versions in parallel (at least not with the official installers). I thought this behaviour was always the case. It may be related to the installer technology involved, though, so it may

Re: random.choices() Suggest that the code confirm that cum_weights sequence is in ascending order

2018-05-14 Thread Paul Moore
The problem is that supplying cum_weights allows the code to run in O(log n) by using bisection. This is significantly faster on large populations. Adding a test that the cumulative weights are nondecreasing would add an O(n) step to the code. So while I understand the OP's problem, I don't think

<    1   2   3   4   5   >