Re: Help on PyImport_Import(pNAme)

2018-02-04 Thread dieter
Jason Qian via Python-list writes: > This only works when loading modules from the current directory. > Is there a way I can load from somewhere else ? Have a look at the module `importlib` and especially its function `import_module`. Python knows about two forms of "import": "absolute imp

Why no '|' operator for dict?

2018-02-04 Thread Frank Millman
Hi all I recently learned that you can create a set 'on-the-fly' from two existing sets using the '|' operator - Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. set_1 = set

Re: auto-correct a speech-to-text output and relate to of the words based on syllables

2018-02-04 Thread dieter
"Peter J. Holzer" writes: > On 2018-02-03 09:34:57 +0100, dieter wrote: > ... > The difficulty is to *recognise* it correctly. Was that tangle of sound > waves an "l" or an "r"? This not as unambiguous as you seem to think. > So a speech-to-text program may hear "right" when the speaker was really

Re: Parsing Nested List

2018-02-04 Thread Stanley Denman
On Sunday, February 4, 2018 at 5:32:51 PM UTC-6, Stanley Denman wrote: > On Sunday, February 4, 2018 at 4:26:24 PM UTC-6, Stanley Denman wrote: > > I am trying to parse a Python nested list that is the result of the > > getOutlines() function of module PyPFD2 using pyparsing module. This is the >

Re: 3.6.4 IDLE

2018-02-04 Thread MRAB
On 2018-02-04 21:09, Rob Alspach wrote: Hi Everybody! I just installed python 3.6.4 it was a fresh install (no former versions). I have never used python but have some IS background. The videos I am seeing online all show the IDE / IDLE; however, it does not install for me. I am installing from t

Re: 3.6.4 IDLE

2018-02-04 Thread Terry Reedy
On 2/4/2018 4:09 PM, Rob Alspach wrote: Hi Everybody! I just installed python 3.6.4 it was a fresh install (no former versions). I have never used python but have some IS background. The videos I am seeing online all show the IDE / IDLE; however, it does not install for me. I am installing from t

Re: Why not have a recvall method?

2018-02-04 Thread 陶青云
Thank you, it's very helpful. I think the recvall should builtin to the _socket module like sendall. -- Original -- From: "Dan Stromberg"; Date: Mon, Feb 5, 2018 06:01 AM To: "陶青云"; Cc: "python-list"; Subject: Re: Why not have a recvall method? On Sun, Feb

[RELEASED] Python 3.4.8 and Python 3.5.5 are now available

2018-02-04 Thread Larry Hastings
On behalf of the Python development community, I'm happy to announce the availability of Python 3.4.8 and Python 3.5.5. Both Python 3.4 and 3.5 are in "security fixes only" mode.  Both versions only accept security fixes, not conventional bug fixes, and both releases are source-only. You

Re: Parsing Nested List

2018-02-04 Thread Stanley Denman
On Sunday, February 4, 2018 at 5:06:26 PM UTC-6, Steven D'Aprano wrote: > On Sun, 04 Feb 2018 14:26:10 -0800, Stanley Denman wrote: > > > I am trying to parse a Python nested list that is the result of the > > getOutlines() function of module PyPFD2 using pyparsing module. > > pyparsing parses st

Re: Parsing Nested List

2018-02-04 Thread Stanley Denman
On Sunday, February 4, 2018 at 4:26:24 PM UTC-6, Stanley Denman wrote: > I am trying to parse a Python nested list that is the result of the > getOutlines() function of module PyPFD2 using pyparsing module. This is the > result I get. what in the world are 'expandtabs' and why is that making a >

Re: 3.6.4 IDLE

2018-02-04 Thread Chris Angelico
On Mon, Feb 5, 2018 at 8:09 AM, Rob Alspach wrote: > Hi Everybody! I just installed python 3.6.4 it was a fresh install (no > former versions). I have never used python but have some IS background. The > videos I am seeing online all show the IDE / IDLE; however, it does not > install for me. I am

Re: Parsing Nested List

2018-02-04 Thread Steven D'Aprano
On Sun, 04 Feb 2018 14:26:10 -0800, Stanley Denman wrote: > I am trying to parse a Python nested list that is the result of the > getOutlines() function of module PyPFD2 using pyparsing module. pyparsing parses strings, not lists. I fear that you have completely misunderstood what pyparsing does

Can't load Python program on my HP ENVY computer

2018-02-04 Thread Bernard via Python-list
I have an HP ENVY TouchSmart 17 Notebook PC. Windows 8.1. Intel(R) Core(TM) i7-4700 mQ cpu @ 2.40 ghz 2.40ghz 64-bit operation system x64 based processor Full Windows touch support with 10 touch points Can you send me the link to the correct Python version that will run on this computer.

3.6.4 IDLE

2018-02-04 Thread Rob Alspach
Hi Everybody! I just installed python 3.6.4 it was a fresh install (no former versions). I have never used python but have some IS background. The videos I am seeing online all show the IDE / IDLE; however, it does not install for me. I am installing from the download python-3.6.4-embed-amd64.zip.

Re: Parsing Nested List

2018-02-04 Thread Chris Angelico
On Mon, Feb 5, 2018 at 9:26 AM, Stanley Denman wrote: > I am trying to parse a Python nested list that is the result of the > getOutlines() function of module PyPFD2 using pyparsing module. This is the > result I get. what in the world are 'expandtabs' and why is that making a > difference to m

Parsing Nested List

2018-02-04 Thread Stanley Denman
I am trying to parse a Python nested list that is the result of the getOutlines() function of module PyPFD2 using pyparsing module. This is the result I get. what in the world are 'expandtabs' and why is that making a difference to my parse attempt? Python Code 7 import PPDF2,pyparsing from pyp

Re: Why not have a recvall method?

2018-02-04 Thread Dan Stromberg
On Sun, Feb 4, 2018 at 5:26 AM, 陶青云 wrote: > Hello, all > The socket object has a `sendall` method that can send all bytes you > specified. > Oppositely, socket only has a recv method. I wonder why there is not a > `recvall` method? > To workaround this, I use `f = socket.makefile('rb')`, then a

Help on PyImport_Import(pNAme)

2018-02-04 Thread Jason Qian via Python-list
Hi, This only works when loading modules from the current directory. Is there a way I can load from somewhere else ? Thanks for help, -- https://mail.python.org/mailman/listinfo/python-list

Re: Help on convert PyObject to string (c) Python 3.6

2018-02-04 Thread Jason Qian via Python-list
Hi Chris, Thanks a lot ! Using PyUnicode_DecodeUTF8 fix the problem. On Sun, Feb 4, 2018 at 12:02 PM, Chris Angelico wrote: > On Mon, Feb 5, 2018 at 3:52 AM, Jason Qian via Python-list > wrote: > > Hi, > > > >This is the case of calling python from c and the python function > will > >

Re: Help on convert PyObject to string (c) Python 3.6

2018-02-04 Thread Chris Angelico
On Mon, Feb 5, 2018 at 3:52 AM, Jason Qian via Python-list wrote: > Hi, > >This is the case of calling python from c and the python function will > return a string. > >It seems python been called correctly, but got error when convert the > python string to c string. > > -- c -- > >PyO

Help on convert PyObject to string (c) Python 3.6

2018-02-04 Thread Jason Qian via Python-list
Hi, This is the case of calling python from c and the python function will return a string. It seems python been called correctly, but got error when convert the python string to c string. -- c -- PyObject* pValue = PyObject_CallObject(pFunc, pArgs); -- python -- import string, ran

Re: 2.6.7: Does socket.gethostbyaddr truncate?

2018-02-04 Thread Chris Angelico
On Tue, Jan 30, 2018 at 11:05 PM, Antoon Pardon wrote: > I am using python 2.6.7 to do a little network programming, but it seems I > don't > get all the results. > > When I call socket.gethostbyaddr(IP) entry [1] of the result is a list of 34 > addresses. > > However when I use: dig -x IP I get

Re: Why not have a recvall method?

2018-02-04 Thread 陶青云
makefile('rb') return a io.BufferedReader and the doc(https://docs.python.org/3/library/io.html#io.BufferedIOBase.read) says: If the argument is positive, and the underlying raw stream is not interactive, multiple raw reads may be issued to satisfy the byte count (unless EOF is reached firs

Re: Why not have a recvall method?

2018-02-04 Thread Steven D'Aprano
On Sun, 04 Feb 2018 19:26:36 +0800, 陶青云 wrote: > Hello, allThe socket object has a `sendall` method that can send all > bytes you specified. Oppositely, socket only has a recv method. I wonder > why there is not a `recvall` method? To workaround this, I use `f = > socket.makefile('rb')`, then `cal

Why not have a recvall method?

2018-02-04 Thread 陶青云
Hello, all The socket object has a `sendall` method that can send all bytes you specified. Oppositely, socket only has a recv method. I wonder why there is not a `recvall` method? To workaround this, I use `f = socket.makefile('rb')`, then all `f.read(n)` Thanks. -- https://mail.python.or

Re: 2.6.7: Does socket.gethostbyaddr truncate?

2018-02-04 Thread Emil Natan
On Sat, Feb 3, 2018 at 1:11 PM, Peter J. Holzer wrote: > On 2018-01-30 08:56:16 -0800, Dan Stromberg wrote: > > dig -x should return a single PTR in all cases, shouldn't it? > > No. dig -x should return *all* PTR records. There is usually at most one > of them, but there may be several. (46 seems

Why not have a recvall method?

2018-02-04 Thread 陶青云
Hello, allThe socket object has a `sendall` method that can send all bytes you specified. Oppositely, socket only has a recv method. I wonder why there is not a `recvall` method? To workaround this, I use `f = socket.makefile('rb')`, then `call f.read(n)` Thanks. -- https://mail.python.org/mailma

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Groups

2018-02-04 Thread Steven D'Aprano
On Sun, 04 Feb 2018 06:49:57 +1100, Chris Angelico wrote: > On Sun, Feb 4, 2018 at 6:34 AM, Mark Lawrence > wrote: >> On 03/02/18 17:56, Peter J. Holzer wrote: >>> You seem to confuse the mailing-list and the newsgroup. The >>> mailing-list doesn't have a spam problem, and it is already (lightly)