Re: python socket dns query will get the correct result while the dig will not.

2019-10-01 Thread Chris Angelico
On Wed, Oct 2, 2019 at 4:41 PM Hongyi Zhao wrote: > > On Wed, 02 Oct 2019 16:28:40 +1000, Chris Angelico wrote: > > > When you ask dig, you are always asking for a DNS lookup. But > > gethostbyname does a lot of other things too. > > What other things, could you please give more detailed hints? S

Re: python socket dns query will get the correct result while the dig will not.

2019-10-01 Thread Hongyi Zhao
On Wed, 02 Oct 2019 16:28:40 +1000, Chris Angelico wrote: > When you ask dig, you are always asking for a DNS lookup. But > gethostbyname does a lot of other things too. What other things, could you please give more detailed hints? > My guess is that your > /etc/hosts has an entry for that doma

Re: python socket dns query will get the correct result while the dig will not.

2019-10-01 Thread Chris Angelico
On Wed, Oct 2, 2019 at 2:31 PM Hongyi Zhao wrote: > > Hi, > > See my following test: > > With ipython: > > In [1]: import > socket > > In [2]: socket.gethostbyname > ('www.vpngate.net') > Out[2]: '130.158.75.44' > > > With dig: > > $ dig www.vpngate.net @114.114.114.114 +short > 31.13.65.1 > $ dig

Re: pymysql.err.InterfaceError after some hours of usage

2019-10-01 Thread Inada Naoki
MySQL connection can be closed automatically by various reasons. For example, `wait_timeout` is the most common but not only reason for closing the connection. You should connect and close MySQL connection for each HTTP request. Or you can use more smart connection pool (e.g. Engine in SQLAlchemy

pymysql.err.InterfaceError after some hours of usage

2019-10-01 Thread Νίκος Βέργος
Hello, i use 'module pymysql' for connectivity in my wsgi scripts. For some reason after some hours of i.e. 'http://superhost.gr/files' i get the following error when the script tries to run: Do you know why this is happening?! Error: 500 Internal Server Error Sorry, the requested URL 'http://s

Re: Recursive method in class

2019-10-01 Thread ast
Le 01/10/2019 à 20:56, Timur Tabi a écrit : Could you please fix your email software so that it shows a legitimate email address in the From: line? Your emails all show this: From: ast All of your emails are being caught in my spam filter because of this address. I would email you priva

[RELEASE] Python 3.7.5rc1 is now available for testing

2019-10-01 Thread Ned Deily
Python 3.7.5rc1 is now available for testing. 3.7.5rc1 is the release preview of the next maintenance release of Python 3.7, the latest feature release of Python. Assuming no critical problems are found prior to 2019-10-14, no code changes are planned between now and the final release. This rele

python socket dns query will get the correct result while the dig will not.

2019-10-01 Thread Hongyi Zhao
Hi, See my following test: With ipython: In [1]: import socket In [2]: socket.gethostbyname ('www.vpngate.net') Out[2]: '130.158.75.44' With dig: $ dig www.vpngate.net @114.114.114.114 +short 31.13.6

Re: Recursive method in class

2019-10-01 Thread Grant Edwards
On 2019-10-01, Timur Tabi wrote: > Could you please fix your email software so that it shows a legitimate > email address in the From: line? Your emails all show this: > > From: ast > > All of your emails are being caught in my spam filter because of this > address. I would email you privat

Re: Announcing colour-text and colour-print

2019-10-01 Thread Barry
> On 1 Oct 2019, at 10:12, Gisle Vanem wrote: > > Barry Scott wrote: > >> Here is an example: >> from colour_text import ColourText >> ct = ColourText() >> ct.initTerminal() >> print( ct( "The next section is in green: <>green example<>." ) ) > > Looking at the sources, it seems 'win32' shou

Re: Recursive method in class

2019-10-01 Thread Timur Tabi
Could you please fix your email software so that it shows a legitimate email address in the From: line? Your emails all show this: From: ast All of your emails are being caught in my spam filter because of this address. I would email you privately, but I know n...@gmail.com isn't your real

[RELEASE] Python 3.8.0rc1 is now available

2019-10-01 Thread Łukasz Langa
Python 3.8.0 is almost ready. After a rather tumultuous few days, we are very happy to announce the availability of the release candidate: https://www.python.org/downloads/release/python-380rc1/ This release, 3.8.0rc1, is the final plann

Re: How can I set the value of the textedit box and slider of ui with the value from a config file when it has been created?

2019-10-01 Thread Michael Torrie
On 10/1/19 9:51 AM, Spencer Du wrote: > Hi > How can I set the value of the textedit box and slider of ui with the value > from a config file when it has been created meaning if a configuration file > exists then set the UI with value from the config file otherwise load ui with > nothing set to

Re: Recursive method in class

2019-10-01 Thread ast
Le 01/10/2019 à 13:18, Rhodri James a écrit : On 01/10/2019 08:37, ast wrote: The problem is that "factorial" in line "return n * factorial(self, n - 1)" should not have been found because there is no factorial function defined in the current scope. Not so.  "factorial" is in the global sco

How can I set the value of the textedit box and slider of ui with the value from a config file when it has been created?

2019-10-01 Thread Spencer Du
Hi How can I set the value of the textedit box and slider of ui with the value from a config file when it has been created meaning if a configuration file exists then set the UI with value from the config file otherwise load ui with nothing set to any value. ui.py import sys from PyQt5.QtWidgets

Re: Recursive method in class

2019-10-01 Thread Rhodri James
On 01/10/2019 08:37, ast wrote: I understood your example, but it doesn't answer my initial question. I try to rewrite my question: The following code is working well and I don't really understand why def factorial(self, n):     if not n:     return 1     else:     return n * factor

Re: pathlib

2019-10-01 Thread Rhodri James
On 01/10/2019 06:03, DL Neil via Python-list wrote: On 30/09/19 9:28 PM, Barry Scott wrote: On 30 Sep 2019, at 05:40, DL Neil via Python-list wrote: Should pathlib reflect changes it has made to the file-system? I think it should not. The term "concrete" is applied to Path(), PosixPath(),

Re: Recursive method in class

2019-10-01 Thread Terry Reedy
On 10/1/2019 3:37 AM, ast wrote: The following code is working well and I don't really understand why def factorial(self, n):     if not n:     return 1     else:     return n * factorial(self, n - 1) This creates a function that looks up 'factorial' in the global (module) scope

"Regular Expression Objects" scanner method

2019-10-01 Thread ast
Hello I am trying to understand a program which use a method named scanner on a re compiled object. This program is named "Simple compiler" here: https://www.pythonsheets.com/notes/python-generator.html But unfortunately it is not documented nor here: https://docs.python.org/3.7/library/re.htm

Re: pathlib

2019-10-01 Thread Richard Damon
On 10/1/19 1:24 AM, DL Neil via Python-list wrote: > On 1/10/19 1:09 AM, Chris Angelico wrote: >> On Mon, Sep 30, 2019 at 9:54 PM Dan Sommers >> <2qdxy4rzwzuui...@potatochowder.com> wrote: >>> I would have said the same thing, but the docs⁰ disagree:  a >>> PurePath represents the name of (or the p

EuroPython 2019 - Videos for Friday available

2019-10-01 Thread M.-A. Lemburg
We are pleased to announce the third and final batch of cut videos from EuroPython 2019 in Basel, Switzerland, with another 49 videos. * EuroPython 2019 on our YouTube Channel * http://europython.tv/ In this batch, we have included all videos for Friday,

Re: pathlib

2019-10-01 Thread DL Neil via Python-list
On 1/10/19 2:58 PM, Dan Sommers wrote: On 9/30/19 3:56 PM, Barry Scott wrote: On 30 Sep 2019, at 16:49, Dan Sommers <2qdxy4rzwzuui...@potatochowder.com > wrote: In the totality of a Path object that claims to represent paths to files, It represent

Re: Announcing colour-text and colour-print

2019-10-01 Thread Gisle Vanem
Barry Scott wrote: Here is an example: from colour_text import ColourText ct = ColourText() ct.initTerminal() print( ct( "The next section is in green: <>green example<>." ) ) Looking at the sources, it seems 'win32' should be supported. But no; with the above example: c:\>py -3 example.py

Re: pathlib

2019-10-01 Thread Chris Angelico
On Tue, Oct 1, 2019 at 3:05 PM DL Neil via Python-list wrote: > BUT... Path() does keep track of changes in the file system for other > attributes! So, why not also name? Does it actually track changes? > Here's a code-snippet illustrating both of the above points: > > import pathlib > p = pathl

Re: pathlib

2019-10-01 Thread Chris Angelico
On Tue, Oct 1, 2019 at 3:26 PM DL Neil via Python-list wrote: > > On 1/10/19 1:09 AM, Chris Angelico wrote: > > I don't think it represents the actual file. If it did, equality would > > be defined by samefile, NOT by the file name. > > > from pathlib import Path > import os > open(

Re: Recursive method in class

2019-10-01 Thread ast
Le 30/09/2019 à 13:11, Anders Märak Leffler a écrit : What do you mean by transformed? This is probably your understanding already, but a further consequence of when arguments are evaluated plus what you said about data attributes is that the fib(self, n - 1) call will follow the standard LEGB-lo