Re: [Tutor] just a quick logic check if someone has two seconds

2019-08-01 Thread Alan Gauld via Tutor
On 01/08/2019 23:10, nathan tech wrote: > > import speedtest This is not a standard library module so I have no idea what it does so obviously there could be magic afoot of which I am unaware. But assuming it behaves like most Python code... > def do-test(): > test=speedtest.Speedtest() > t

[Tutor] just a quick logic check if someone has two seconds

2019-08-01 Thread nathan tech
Hi there, I wondered if someone wouldn't mind just taking two seconds to make sure i understand this concept: Here is a code snippet: import speedtest def do-test(): test=speedtest.Speedtest() test.download() test.upload() return [test.download_speed, test.upload_speed] Now. If I

Re: [Tutor] Python code

2019-08-01 Thread David Rock
maybe a copy/paste of your terminal session so we can see the text of the steps you are actually performing will give use some clues. — David > On Aug 1, 2019, at 18:22, David L Neil wrote: > > On 2/08/19 3:23 AM, Spencer Wannemacher wrote: >> I'm new to python and I was trying to perform a si

Re: [Tutor] Python code

2019-08-01 Thread David L Neil
On 2/08/19 3:23 AM, Spencer Wannemacher wrote: I'm new to python and I was trying to perform a simple one code. All that is included in the code is print(61). I save it as 61.py and change the directory before typing in python 61.py and I don't get an output. There is no error and the output i

Re: [Tutor] Python code

2019-08-01 Thread Cameron Simpson
On 01Aug2019 15:23, Spencer Wannemacher wrote: I'm new to python and I was trying to perform a simple one code. All that is included in the code is print(61). I save it as 61.py and change the directory before typing in python 61.py and I don't get an output. There is no error and the output i

[Tutor] Python code

2019-08-01 Thread Spencer Wannemacher
I'm new to python and I was trying to perform a simple one code. All that is included in the code is print(61). I save it as 61.py and change the directory before typing in python 61.py and I don't get an output. There is no error and the output is blank. Please let me know what I'm doing wrong.

Re: [Tutor] Create Logging module

2019-08-01 Thread Sinardy Xing
Hi I solve my problem, the decorator need to be above the function not when executed. :) Thanks for reading. :) On Thu, Aug 1, 2019 at 8:42 PM Steven D'Aprano wrote: > On Thu, Aug 01, 2019 at 05:11:04PM +0800, Sinardy Xing wrote: > > > I have error look like in the wrapper. > > > > Can some

Re: [Tutor] Create Logging module

2019-08-01 Thread Sinardy Xing
Hi Steven, Thanks for your reply, I was copy and paste the code in the email as a text. I dont know why it becoming photo or screen shot when you view it ? When I run the module individually it is no error only when I use as decorator I have error. $ cat mainapp.py from loggingme import logme

[Tutor] Python and Django dev available

2019-08-01 Thread Sithembewena L. Dube
Hi everyone, I'm a developer with just over 10 years' experience under my belt. I've worked with many languages and frameworks, including the popular Django web framework. I'm currently in the market for remote opportunities. Please reply if looking for a resource. Serious enquiries only please.

Re: [Tutor] Create Logging module

2019-08-01 Thread Peter Otten
Sinardy Xing wrote: > following is my main app > > -- start here-- > from loggingme import logme > > def say_hello(name, age): > print('Hello {}, I am {}'.format(name, age)) > > #say_hello=logme(say_hello('Sinardy')) > @logme > say_hello('Tonny', 8) Isn't this a SyntaxError? You can de

Re: [Tutor] Create Logging module

2019-08-01 Thread Alan Gauld via Tutor
On 01/08/2019 10:11, Sinardy Xing wrote: > start here--- > > import logging > > ..snip... > from functools import wraps > > def logme(func_to_log): > import logging You don't need the import, it's already done in the first line. > #Check log level within understanable paramet

Re: [Tutor] Create Logging module

2019-08-01 Thread Steven D'Aprano
On Thu, Aug 01, 2019 at 05:11:04PM +0800, Sinardy Xing wrote: > I have error look like in the wrapper. > > Can someone point to me where is the issue No, but you can. When the error occurs, Python will print a traceback containing a list of the lines of code being executed, and the final error

[Tutor] Create Logging module

2019-08-01 Thread Sinardy Xing
Hi, I am learning to create python logging. My goal is to create a logging module where I can use as decorator in my main app following is the logging code start here--- import logging #DEBUG: Detailed information, typically of interest only when diagnosing problems. #INFO : Conf

Re: [Tutor] Difference between decorator and inheritance

2019-08-01 Thread Alan Gauld via Tutor
On 31/07/2019 18:57, Gursimran Maken wrote: > Anyone could please let me know the difference between decorators and > inheritance in python. > > Both are required to add additional functionality to a method then why are > we having 2 separate things in python for doing same kind of work. Inherit

[Tutor] Difference between decorator and inheritance

2019-08-01 Thread Gursimran Maken
Hi, Anyone could please let me know the difference between decorators and inheritance in python. Both are required to add additional functionality to a method then why are we having 2 separate things in python for doing same kind of work. Thank you, Gursimran