OT language barrier, was: How execute at least two python files at once when imported?

2019-11-07 Thread Christian Gollwitzer
Am 06.11.19 um 17:34 schrieb Igor Korot: On Wed, Nov 6, 2019 at 10:22 AM Spencer Du wrote: Sorry if I haven't stated my requirements clearly. I just wanted a way to import at least two python files in parallel and I wanted to know how this can be done or a reason why its bad as stated in a

Re: psutil.boot_time() ... doesn't ?

2019-11-07 Thread R.Wieser
Dennis, > Which is probably... last file system modification time Nope. Its from a file it saves at shutdown, and which gets updated once an hour (I also thought of that one, but the once-an-hour update threw a wrench into it). > There is no way for a freshly booted system to differentiate be

Re: SSL/TLS in Python using STARTTLS and ssl/ssltelnet and telnetlib

2019-11-07 Thread Colin McPhail via Python-list
> On 7 Nov 2019, at 03:24, Veek M wrote: > > Could someone suggest some introductory reading material that will allow > me to use 'telnetlib' with 'ssl' or 'ssltelnet'. > (currently using Pan since Knode is dropped on Debian) > > I'm trying to write something that will download the NNTP hea

Re: SSL/TLS in Python using STARTTLS and ssl/ssltelnet and telnetlib

2019-11-07 Thread Jon Ribbens via Python-list
On 2019-11-07, Veek M wrote: > Could someone suggest some introductory reading material that will allow > me to use 'telnetlib' with 'ssl' or 'ssltelnet'. > (currently using Pan since Knode is dropped on Debian) > > I'm trying to write something that will download the NNTP headers over > TLS.

Re: How execute at least two python files at once when imported?

2019-11-07 Thread Gregory Ewing
Cameron Simpson wrote: Spencer's modules run unconditional stuff in addition to defining classes. That may cause trouble. It will -- because of the import lock, they won't run simultaneously in the same process. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: OOP - how to abort an __init__ when the initialisation code fails ?

2019-11-07 Thread Gregory Ewing
Oscar Benjamin wrote: In Python the original exception message plus traceback is often very informative (to a programmer!) about the problem. That's okay, exception chaining preserves the whole traceback if you want to dig down that far. Catching and reraising can mean that you end up craftin

Syntax Suggestion: Pass Function Definition as Argument

2019-11-07 Thread Stephen Waldron
Hi, I'm new to the group and to Python, so forgive me if I make any faux-pas here. As I can tell, the only way to pass a function as an argument is to reference its name as follows: def foo1(message): print(message) def foo2(foo, message): print("Your function says:") foo(message)

Python 3.8 install

2019-11-07 Thread Daniel
How to install Python 3.8 on top of Python 3.6? -- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus -- https://mail.python.org/mailman/listinfo/python-list

Re: psutil.boot_time() ... doesn't ?

2019-11-07 Thread R.Wieser
Chris, > Yes, but even if it's not recorded as a timestamp but as an > uptime counter, that counter can be referenced against the > current time in UTC. Absolutily. Though the keyword here is "can". My "could easily imagine" considers the other possibility. I guess I should sit down sometime

Re: Syntax Suggestion: Pass Function Definition as Argument

2019-11-07 Thread Antoon Pardon
On 7/11/19 14:36, Stephen Waldron wrote: > Hi, I'm new to the group and to Python, so forgive me if I make any faux-pas > here. As I can tell, the only way to pass a function as an argument is to > reference its name as follows: > > def foo1(message): > print(message) > > def foo2(foo, messag

Re: SSL/TLS in Python using STARTTLS and ssl/ssltelnet and telnetlib

2019-11-07 Thread Grant Edwards
On 2019-11-07, Jon Ribbens via Python-list wrote: > On 2019-11-07, Veek M wrote: >> Could someone suggest some introductory reading material that will allow >> me to use 'telnetlib' with 'ssl' or 'ssltelnet'. >> (currently using Pan since Knode is dropped on Debian) >> >> I'm trying to write so

Re: return a ctypes object to C

2019-11-07 Thread Arnaud Loonstra
On 31-10-2019 15:39, Arnaud Loonstra wrote: On 31-10-2019 14:44, Thomas Jollans wrote: 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 ret

Re: Python 3.8 install

2019-11-07 Thread MRAB
On 2019-11-07 13:52, Daniel wrote: How to install Python 3.8 on top of Python 3.6? Don't do that. If you're using Windows, you install into a separate folder, usually called Python36 for Python 3.6 and Python38 for Python 3.8. -- https://mail.python.org/mailman/listinfo/python-list

Re: Syntax Suggestion: Pass Function Definition as Argument

2019-11-07 Thread Stephen Waldron
Thanks Antoon. I do suppose that it is kind of wrong to say the only way is to "reference its [the function's] name" as an argument, however the point I was trying to make was that you cannot pass a function that is either not in some way previously defined or a reference to something previously

Re: Syntax Suggestion: Pass Function Definition as Argument

2019-11-07 Thread Stephen Waldron
Thanks Antoon. I do suppose that it is kind of wrong to say the only way is to "reference its [the function's] name" as an argument, however the point I was trying to make was that it isn't possible to pass a function that is either not in some way previously defined or a reference to something

Re: Python 3.8 install

2019-11-07 Thread Terry Reedy
On 11/7/2019 11:59 AM, MRAB wrote: On 2019-11-07 13:52, Daniel wrote: How to install Python 3.8 on top of Python 3.6? Don't do that. If you're using Windows, you install into a separate folder, usually called Python36 for Python 3.6 and Python38 for Python 3.8. Both the Windows and macOS i

RE: Syntax Suggestion: Pass Function Definition as Argument

2019-11-07 Thread David Raymond
Here is it rewritten using the proposal: ``` #Definition def myFoo (str1, str2, foo, str = " "): print( foo(str = str1), foo(str = str2) ) #Call myFoo ("hello", "world!"): str = list(str)[0].upper() + str[1:] return str ``` Are you looking for multi-line l

Re: psutil.boot_time() ... doesn't ?

2019-11-07 Thread Chris Angelico
On Fri, Nov 8, 2019 at 1:24 AM R.Wieser wrote: > > Chris, > > > Yes, but even if it's not recorded as a timestamp but as an > > uptime counter, that counter can be referenced against the > > current time in UTC. > > Absolutily. Though the keyword here is "can". My "could easily imagine" > consi

can't install http module

2019-11-07 Thread tony van der Hoff
Hi, I'm attempting to install (among other things) the "http" module on my debian10 box, and am encountering the following problem: ## tony@tony-lx:~/_pycharm/pygallery$ python3 -m pip install http Collecting http   Using cached https://files.pythonhosted.org/packages

Re: can't install http module

2019-11-07 Thread Chris Angelico
On Fri, Nov 8, 2019 at 5:47 AM tony van der Hoff wrote: > > Hi, > I'm attempting to install (among other things) the "http" module on my > debian10 box, and am encountering the following problem: > Can you link to the documentation for the package you're trying to install? Python already ships wi

Using Makefiles in Python projects

2019-11-07 Thread Vitaly Potyarkin
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 useful for simplifying the onboarding of new deve

Re: can't install http module

2019-11-07 Thread Tony van der Hoff
On 07/11/2019 19:00, Chris Angelico wrote: On Fri, Nov 8, 2019 at 5:47 AM tony van der Hoff wrote: Hi, I'm attempting to install (among other things) the "http" module on my debian10 box, and am encountering the following problem: Can you link to the documentation for the package you're

Re: can't install http module

2019-11-07 Thread Chris Angelico
On Fri, Nov 8, 2019 at 6:34 AM Tony van der Hoff wrote: > > > > On 07/11/2019 19:00, Chris Angelico wrote: > > On Fri, Nov 8, 2019 at 5:47 AM tony van der Hoff > > wrote: > >> > >> Hi, > >> I'm attempting to install (among other things) the "http" module on my > >> debian10 box, and am encounter

Can't run easy_install even though setuptools is installed

2019-11-07 Thread Chris Green
I'm a bit flummoxed. I'm trying to install a Python package from pypi.org, it says it should be installed by running "easy_install onkyo-eiscp" but I just get "easy_install: command not found" when I try that. I do have setuptools installed on my system and I can see "easy_install.py" in the pac

Re: Can't run easy_install even though setuptools is installed

2019-11-07 Thread Cameron Simpson
On 07Nov2019 21:38, Chris Green wrote: I'm a bit flummoxed. I'm trying to install a Python package from pypi.org, it says it should be installed by running "easy_install onkyo-eiscp" but I just get "easy_install: command not found" when I try that. I do have setuptools installed on my system

Re: Using Makefiles in Python projects

2019-11-07 Thread Skip Montanaro
On Thu, Nov 7, 2019 at 1:24 PM Vitaly Potyarkin wrote: > > What do you think of using Makefiles for automating common chores in > Python projects? Like linting, type checking and testing? Kinda unsure why this needs to be asked (says the guy who's used Make longer than Python and nearly as long a

Re: Using Makefiles in Python projects

2019-11-07 Thread Grant Edwards
On 2019-11-07, Skip Montanaro wrote: > In short, if you have to type a command more than once, you need a > Makefile. It will save you time and serve as documentation to > yourself and others about how the various pieces of your project fit > together. Definitely. Some of the projects I work on

Re: Using Makefiles in Python projects

2019-11-07 Thread Cameron Simpson
On 07Nov2019 22: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 do use one for some things. (Not linting, which I'll describe lower down.) I do like to use it for what make's strengt

Re: How execute at least two python files at once when imported?

2019-11-07 Thread Cameron Simpson
On 08Nov2019 00:52, Greg Ewing wrote: Cameron Simpson wrote: Spencer's modules run unconditional stuff in addition to defining classes. That may cause trouble. It will -- because of the import lock, they won't run simultaneously in the same process. I was unsure as to how serialised this wa

Re: Using Makefiles in Python projects

2019-11-07 Thread David
On Fri, 8 Nov 2019 at 09:43, Cameron Simpson wrote: [...] > _help: > @echo '_build: make $(py_static_bundle)' > @echo '_deploy_tip: formally deploy the current tip to the dev > host dev tree:' > @echo '_sync_dev: rsync the current working files into the d

Re: Using Makefiles in Python projects

2019-11-07 Thread Cameron Simpson
On 08Nov2019 10:30, David wrote: On Fri, 8 Nov 2019 at 09:43, Cameron Simpson wrote: [...] _help: @echo '_build: make $(py_static_bundle)' @echo '_deploy_tip: formally deploy the current tip to the dev host dev tree:' @echo '_sync_dev: rsync the curren

Questions on working with unittest.IsolatedAsyncioTestCase

2019-11-07 Thread Mond Wan
Hello all, I would like to ask for helps on working with **unittest.IsolatedAsyncioTestCase**. Q1: How to handle asyncio.CancelledError inside IsolatedAsyncioTestCase. My test is hanging up if there are futures being cancelled some how. Is there a way for me to configure IsolatedAsyncioTestCas