Re: [Tutor] Chunking list/array data?

2019-08-22 Thread Cameron Simpson
hunks lazily. Cheers, Cameron Simpson _______ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Chunking list/array data?

2019-08-22 Thread Peter Otten
chunks(items, n): ... return zip_longest(*[iter(items)]*n) ... >>> chunked = chunks("abcdefgh", 3) >>> next(chunked) ('a', 'b', 'c') >>> list(chunked) [('d', 'e', 'f'), ('g', 'h', None)] ___ Tutor maillist - Tutor

[Tutor] Chunking list/array data?

2019-08-22 Thread Sarah Hembree
ily so as to keep memory drag at a minimum? --- We not only inherit the Earth from our Ancestors, we borrow it from our Children. Aspire to grace. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.

Re: [Tutor] Is nesting functions only for data hiding overkill?

2019-08-22 Thread Cameron Simpson
ameron Simpson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Is nesting functions only for data hiding overkill?

2019-08-22 Thread James Hartley
ient code. Is nesting considered Pythonic? Thanks! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Is nesting functions only for data hiding overkill?

2019-08-21 Thread James Hartley
ould not ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What is Tuple in the typing module?

2019-08-20 Thread C W
Thank you, Peter and Alan. Both very helpful. I was able to figure it out. Cheers! On Sat, Aug 17, 2019 at 5:45 AM Alan Gauld via Tutor wrote: > On 17/08/2019 00:46, C W wrote: > > The formatting seems messed up I'll try to straighten it out. > I hope I get it right! > > Cav

Re: [Tutor] which of these is more efficient?

2019-08-19 Thread nathan tech
> > > Micro-comment: a piece of code I'd hope to never see again: > > for x in range(len(map)): > map[x].append(default_grid_format) > > this lazily produces a counter from the size of an iterable object > (similar in concept to a generator), and then uses the cou

Re: [Tutor] which of these is more efficient?

2019-08-19 Thread Mats Wichmann
since you can just iterate the object directly. Instead write it like this: for m in map: m.append(default_grid_format) Micro-comment: you can use anything (well, anything "hashable") as the key for a dict. So for: key=str(x)+":"+str(y) you can just do: key = (x, y) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] which of these is more efficient?

2019-08-19 Thread Alan Gauld via Tutor
web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: ht

Re: [Tutor] which of these is more efficient?

2019-08-19 Thread Mark Lawrence
low Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] which of these is more efficient?

2019-08-19 Thread Peter Otten
_default_format(): return "whatever" def show_cell(x, y): print(f"x = {x}, y = {y}, format = {grid_formats[x,y]!r}") grid_formats = defaultdict(get_default_format) grid_formats[42, 42] = "this cell is special" player_location = 3, 4 show_cell(*player_loca

[Tutor] which of these is more efficient?

2019-08-19 Thread nathan tech
r(player_x)+":"+str(player_y) map[key]=default_grid_format Is this an efficient method compared to 1? Is it, code wise, sound logic? I guess I'm just looking for a second opinion from experienced peoples. thanks everyone. Nathan __

Re: [Tutor] python question

2019-08-18 Thread Steven D'Aprano
On Sun, Aug 18, 2019 at 12:35:52PM +0800, Thejal Ramesh wrote: > Hi, i have a question regarding this question. I'm not quite sure what the > question is asking. Ask your tutor. We can help you with learning Python the programming language, not graph theory. https://en.wikipedia.or

Re: [Tutor] python question

2019-08-18 Thread Alan Gauld via Tutor
mal for loop) HTH -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______ Tutor maillist - Tutor@python.org T

[Tutor] python question

2019-08-18 Thread Thejal Ramesh
list,3) returns [0] . c) Calling popular(clayton list,0) returns [0,1,2,3,4]. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What is Tuple in the typing module?

2019-08-17 Thread Alan Gauld via Tutor
n.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What is Tuple in the typing module?

2019-08-17 Thread Peter Otten
oat], b: Tuple[float, float, float] ) --> float: ... Basically, use descriptive names for types rather than repeating their definition. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] What is Tuple in the typing module?

2019-08-17 Thread C W
kground. Thanks a lot! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Search for Text in File

2019-08-15 Thread Alan Gauld via Tutor
mments above. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Search for Text in File

2019-08-15 Thread Peter Otten
e two years ago I really meant it. If you can't be bothered have a look at preshrunk tools like grep, or find someone to write the code for you. > Thanks in advance. You're welcome. ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Search for Text in File

2019-08-15 Thread David Rock
@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Search for Text in File

2019-08-15 Thread Stephen P. Molnar
' object is not callable'. Assistance will be much appreciated. Thanks in advance. -- Stephen P. Molnar, Ph.D.Life is a fuzzy set http://www.Molecular-Modeling.net Multivariate and stochastic 614.312.7528 (c) Skype: smolnar1 _______ Tutor mail

Re: [Tutor] Package which can extract data from pdf

2019-08-14 Thread William Ray Wing via Tutor
that > sends your data off to a web service and you get answers back. > > There are probably dozens more... this seems to be an area with a lot of > reinvention going on. > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe

Re: [Tutor] cgi module help (original poster)

2019-08-14 Thread rmlibre
On 2019-08-13 15:49, tutor-requ...@python.org wrote: > Send Tutor mailing list submissions to > tutor@python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/tutor > or, via email, send a message with sub

Re: [Tutor] Package which can extract data from pdf

2019-08-14 Thread Mats Wichmann
e and you get answers back. There are probably dozens more... this seems to be an area with a lot of reinvention going on. _______ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Package which can extract data from pdf

2019-08-14 Thread Nupur Jha
Hi All, I have many pdf invoices with different formats. I want to extract the line items from these pdf files using python coding. I would request you all to guide me how can i achieve this. -- *Thanks & Regards,Nupur Jha* ___ Tutor mail

Re: [Tutor] class functions/staticmethod?

2019-08-13 Thread Cameron Simpson
ghtly wrong code just brings confusion. Cheers, Cameron Simpson _______ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] class functions/staticmethod?

2019-08-13 Thread Steven D'Aprano
s' first method, "dimensions()", which he describes as a "class method", isn't a class method and doesn't actually work correctly, even though it appears to at first glance. -- Steven ___ Tutor maillist - Tutor@python.org To uns

Re: [Tutor] class functions/staticmethod?

2019-08-13 Thread Cameron Simpson
a function from a nicely named class. (Also, I wouldn't have to import the area function explicitly - it comes along with the class nicely.) So the static method is used to associate it with the class it supports, for use when the caller doesn't have an instance to hand. Cheers, Cameron Simps

Re: [Tutor] cgi module help

2019-08-13 Thread Peter Otten
ip, deflate, compress Accept: */* User-Agent: python-requests/2.2.1 CPython/2.7.6 Linux/3.13.0-170-generic Body: metadata=date=id 127.0.0.1 - - [13/Aug/2019 17:45:35] "POST / HTTP/1.1" 200 - It looks like the data doesn't even get through. ___

Re: [Tutor] HELP PLEASE

2019-08-13 Thread Alan Gauld via Tutor
on my own tutorial linked in my .sig below :-) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tu

Re: [Tutor] HELP PLEASE

2019-08-13 Thread Sithembewena L. Dube
> but you're handing it "nums". > > Presently "nums" is a list of strings, thus the addition of the initial > 0 to a str in the exception message. > > If you move your misplaced "return to_ints(nums), to_ints(nums2)" > statement up into the get_numbers function you should be better off, >

Re: [Tutor] HELP PLEASE

2019-08-13 Thread Cameron Simpson
ed "return to_ints(nums), to_ints(nums2)" statement up into the get_numbers function you should be better off, because then it will return a list of numbers, not strings. Cheers, Cameron Simpson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] HELP PLEASE

2019-08-13 Thread David L Neil
ou know the difference between an "int" and a "str[ing]"? Given that both sum() and len() return numbers, what do you think is the "str"? Might this refer back to the earlier suggestion that you need to 'see' the data being read? -- Regards =dn

Re: [Tutor] Fwd: Re: HELP PLEASE

2019-08-12 Thread Alan Gauld via Tutor
On 12/08/2019 19:35, Alan Gauld via Tutor wrote: > To save some typing convert the?? int conversion loop into a function: > > > def?? to_ints(strings): > ?? num_copy = [] > ?? for num in nums: > num_copy.append(float(num)) > > ?? retur

[Tutor] cgi module help

2019-08-12 Thread rmlibre
quot;. But I need the actual values, not just the name of the element. Any idea how I can maintain this nested structure and retrieve the data within a nested dictionary in an elegant way? Constraints: For simplicity, I omitted the actual payload which is also a nested dictionary that goes two leve

Re: [Tutor] HELP PLEASE

2019-08-12 Thread Marissa Russo
def mean2(nums2): >for num in nums2: >_sum += nums2 > return _sum / len(nums2) > > def main(): >data = get_numbers() > >print("The mean of the first file is: ", mean) >print("The mean of the second file is: ", mean2) > main() > ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Fwd: Re: HELP PLEASE

2019-08-12 Thread Alan Gauld via Tutor
Forwarding to tutorblist for info... Forwarded Message Subject:Re: [Tutor] HELP PLEASE Date: Mon, 12 Aug 2019 19:34:48 +0100 From: Alan Gauld Reply-To: alan.ga...@yahoo.co.uk To: Marissa Russo On 12/08/2019 19:17, Marissa Russo wrote: > I fixed s

Re: [Tutor] Union

2019-08-12 Thread Jim
[str, str] Can be either a filename or Base64 value. What is the usage of "Union". I don't recall seeing anything like it before. it's type annotation. Search here: https://docs.python.org/3/library/typing.html OK, thanks. Jim ___ Tuto

Re: [Tutor] Union

2019-08-12 Thread Mats Wichmann
ther a filename > or Base64 value. > > What is the usage of "Union". I don't recall seeing anything like it > before. it's type annotation. Search here: https://docs.python.org/3/library/typing.html _______ Tutor maillist - Tuto

[Tutor] Union

2019-08-12 Thread Jim
of "Union". I don't recall seeing anything like it before. Thanks, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] HELP PLEASE

2019-08-12 Thread Mats Wichmann
ou got comments on other stuff already: >>> def foo(): ... return "string from foo()" ... >>> print(foo) >>> print(foo()) string from foo() >>> ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] HELP PLEASE

2019-08-12 Thread Alan Gauld via Tutor
web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] HELP PLEASE

2019-08-12 Thread Sithembewena L. Dube
for num in nums: > _sum += num > return _sum / len(nums) > > def mean2(nums2): > for num in nums2: > _sum += nums2 > return _sum / len(nums2) > > def main(): > data = get_numbers() > > print("The mean of the first f

Re: [Tutor] HELP PLEASE

2019-08-12 Thread Joel Goldstick
his here: m = mean(data[0]) m2 = mean2(data[1]) then print m and m2 > > print("The mean of the first file is: ", mean) > print("The mean of the second file is: ", mean2) > main() > So, first, show the complete error message here. > __

[Tutor] HELP PLEASE

2019-08-12 Thread Marissa Russo
_sum += num return _sum / len(nums) def mean2(nums2): for num in nums2: _sum += nums2 return _sum / len(nums2) def main(): data = get_numbers() print("The mean of the first file is: ", mean) print("The mean of the second file is: "

Re: [Tutor] class functions/staticmethod?

2019-08-12 Thread Steven D'Aprano
unate clash in terminology. A "static method" in Java is closer to a *classmethod* in Python, not a staticmethod. The main difference being that in Java, class variables (attributes) are automatically in scope; in Python you have to access them through the "cls" parame

Re: [Tutor] class functions/staticmethod?

2019-08-12 Thread Peter Otten
organize your code; by writing class Foo: @staticmethod def bar(...): do stuff instead of def foo_bar(...): do stuff class Foo: pass you make the mental association between the class and the function a bit stronger. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] class functions/staticmethod?

2019-08-11 Thread James Hartley
ons))) return _dimensions =8<-- The class method Foo.dimensions() is capable of accessing class members, but Foo.dimensions1() cannot. What does the @staticmethod decorator really add? Thanks! ___ Tutor maillist - Tutor@pyth

Re: [Tutor] Object creation query

2019-08-10 Thread Alan Gauld via Tutor
ase quite a lot more effort. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______ Tutor maillist - Tuto

Re: [Tutor] instantiate and name a class from / with a string

2019-08-10 Thread ingo
data base setattr(root.channel, name, SSE(name)) is what I was looking for, time to read up on attributes, Thanks, Ingo _______ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] instantiate and name a class from / with a string

2019-08-09 Thread Mats Wichmann
e argumentative; you have to help us know enough before we can help you. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Object creation query

2019-08-09 Thread bob gailer
On 8/9/2019 7:39 AM, Alan Gauld via Tutor wrote: On 09/08/2019 09:54, mhysnm1...@gmail.com wrote: updates and insertions. I have multiple tables with the same structure with differe I agree 100% with Peter and Alan's responses. -- Bob Gailer

Re: [Tutor] instantiate and name a class from / with a string

2019-08-09 Thread bob gailer
to dynamically create instances assigned to root.channel attributes? Assuming the latter: name = # get from data base setattr(root.channel, name, SSE(name)) -- Bob Gailer ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options

[Tutor] instantiate and name a class from / with a string

2019-08-09 Thread ingo
/weather/ will then become the emitter of the weather event stream. I'd like create the instances of SSE programmatically by pulling the string 'weather', 'energy' etc. from a database. Ingo ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Object creation query

2019-08-09 Thread Alan Gauld via Tutor
n to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https

Re: [Tutor] Object creation query

2019-08-09 Thread Peter Otten
unts where name = account # find records for account records = select * from AccountEntries where accountId = wanted_accountId order by date desc That design would greatly simplify adding accounts 3 to, say, 30. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Object creation query

2019-08-09 Thread mhysnm1964
than using a list of if tests? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Error terminal

2019-08-07 Thread Mats Wichmann
his way (this is a snip from my system, where the Python 3 came from homebrew, which is how I happen to install it): $ which python /usr/bin/python# system version, you don't want this one $ which python3 /usr/local/bin/python ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] flask_sqlalchemy query in relation to SQL relationships.

2019-08-07 Thread mhysnm1964
. Sean ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Error terminal

2019-08-07 Thread Cameron Simpson
loose verbal descriptions alone). Cheers, Cameron Simpson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Error terminal

2019-08-07 Thread Richard Rizk
Hello I wanted to send you this email to ask if you would have someone that can solve the problem I'm having with python. I'm having issues with terminal on mac, is there someone that can help with this? Best regards, Richard ___ Tutor maillist

Re: [Tutor] Name for this type of class?

2019-08-06 Thread Roel Schroeven
graps the meaning. Every time again. If you use plural to indicate counts, what do you use for collections of items? -- "Honest criticism is hard to take, particularly from a relative, a friend, an acquaintance, or a stranger." -- Franklin P. Jones Roel Schroeven ___

[Tutor] (no subject)

2019-08-06 Thread Stephen Tenbrink
___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Flask and flask_wtf issue -- I hpe someone can help.

2019-08-05 Thread mhysnm1964
e database isn't being updated with the new sub_category. All the database relationships are working when I manually insert the data into the table via SQLIte3. Any thoughts? Have I made myself clear enough? Sean ___ Tutor maillist - Tutor@

Re: [Tutor] Inserting long URL's into comments & docstrings?

2019-08-05 Thread Ben Finney
“An expert is a man who has made all the mistakes which can be | `\ made in a very narrow field.” —Niels Bohr | _o__) | Ben Finney _______ Tutor maillist - Tutor@pyth

Re: [Tutor] Name for this type of class?

2019-08-04 Thread Alan Gauld via Tutor
On 04/08/2019 09:15, Alan Gauld via Tutor wrote: >>> Classes should never be named for their data but for their function. > I was not suggesting that a class name should be a verb, I think my biggest mistake here was the use of the word "function" which, in a programming

Re: [Tutor] Name for this type of class?

2019-08-04 Thread Alan Gauld via Tutor
lt in programs that are procedural code disguised inside classes. And that usually results in the worst of both worlds. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Name for this type of class?

2019-08-03 Thread David L Neil
NB am heading somewhat OT NBB Python3+ On 3/08/19 12:38 PM, Alan Gauld via Tutor wrote: On 03/08/2019 00:47, Malcolm Greene wrote: Anyways, I'm looking for help coming up for the proper name for a class that collects the following type of telemetry data Classes should never be named

Re: [Tutor] Name for this type of class?

2019-08-03 Thread Alan Gauld via Tutor
kr.com/photos/alangauldphotos _______ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Name for this type of class?

2019-08-03 Thread Richard Damon
ons of files, lines > bytes. (i.e. arrays or tuples...) > "___count" implies an integer. > If the latter, I'd use "n_files", "n_lines" ... (possibly without the > underscores if you find typing them a bother.) > Comments? I agree, plural nouns im

Re: [Tutor] Name for this type of class?

2019-08-03 Thread Alex Kleider
ot;files", "lines", "bytes" implies collections of files, lines bytes. (i.e. arrays or tuples...) "___count" implies an integer. If the latter, I'd use "n_files", "n_lines" ... (possibly without the underscores if you find typing them a bo

Re: [Tutor] Name for this type of class?

2019-08-03 Thread Mats Wichmann
"bytes"... the plural form already tells you it's a counter. Opinions, we all have 'em :) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Name for this type of class?

2019-08-03 Thread Malcolm Greene
Thanks for everyone's feedback. Some interesting thoughts including Alan's "classes should never be named for their data but for their function" feedback. I'm going to have to noodle on that one. Good stuff! Malcolm ___ Tutor maillist

Re: [Tutor] Name for this type of class?

2019-08-02 Thread Alex Kleider
ather than the class name. Sounds like a question for "an English Major". (Any Garrison Keillor fans out there?) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Name for this type of class?

2019-08-02 Thread Alan Gauld via Tutor
//www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Name for this type of class?

2019-08-02 Thread Cameron Simpson
escription. Unless they're snapshots/samples, in which case "Telemetric" ?-) Cheers, Cameron Simpson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Name for this type of class?

2019-08-02 Thread Malcolm Greene
s JobStats or JobStatistics JobTelemetry None of these feel right and of course everyone on our team has a different opinion. Does this question ring any bells? Thank you, Malcolm ___ Tutor maillist - Tutor@python.org To unsubscribe or change su

Re: [Tutor] Difference between decorator and inheritance

2019-08-02 Thread Cameron Simpson
your @collect returns. This is the other argument for always returning a callable: to interoperate with other decorators, or of course anything else which works with a callable. Cheers, Cameron Simpson _______ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Difference between decorator and inheritance

2019-08-02 Thread bob gailer
>') func = cmd_dict.get(cmd) -- Bob Gailer ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Difference between decorator and inheritance

2019-08-02 Thread Mats Wichmann
ccomplish some of that with decorators, but not all. _______ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

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

2019-08-02 Thread nathan tech
Hi Alan, thanks for that! I realise I provided quite a lot of unnecessary info, but I've been bitten a few times with the not providing enough so thought it best. Thanks again for confirming my thoughts, that's very helpful. Nate On 02/08/2019 01:27, Alan Gauld via Tutor wrote: > On 01

Re: [Tutor] Create Logging module

2019-08-02 Thread Sinardy Xing
'.format(orig_func.__name__, t2)) return result @logme def hello(name, age): print('I am {}, and I am {} years old'.format(name, age)) hello('Peter Parker', 20) On Fri, Aug 2, 2019 at 12:14 AM Alan Gauld via Tutor wrote: > On 01/08/2019 10:11, Sinardy Xing wrote: > > &g

Re: [Tutor] Create Logging module

2019-08-02 Thread Sinardy Xing
AM Alan Gauld via Tutor wrote: > On 01/08/2019 10:11, Sinardy Xing wrote: > > > start here--- > > > > import logging > > > > ..snip... > > > > from functools import wraps > > > > def logme(func_to_log): > > import loggi

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

2019-08-01 Thread Alan Gauld via Tutor
author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

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

2019-08-01 Thread nathan tech
___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python code

2019-08-01 Thread David Rock
> Thank you so much! > > > What do you mean by "and change the directory before"? > > Python will start searching for 61.py in the *current* directory! > > -- > Regards =dn > ___ > Tutor maillis

Re: [Tutor] Python code

2019-08-01 Thread David L Neil
is blank. Please let me know what I'm doing wrong. Thank you so much! What do you mean by "and change the directory before"? Python will start searching for 61.py in the *current* directory! -- Regards =dn ___ Tutor maillist - Tutor@

Re: [Tutor] Python code

2019-08-01 Thread Cameron Simpson
n Windows here). So it may be that when you issue the command "python" it isn't running the Python interpreter but something else. Cheers, Cameron Simpson _______ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Python code

2019-08-01 Thread Spencer Wannemacher
. Thank you so much! Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Create Logging module

2019-08-01 Thread Sinardy Xing
> the text into your email. > > (P.S. please reply to the mailing list, not to me personally.) > > > -- > Steven > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.pytho

Re: [Tutor] Create Logging module

2019-08-01 Thread Sinardy Xing
the line "Traceback..." to the end. > > Don't take a screen shot or photo and send that, instead copy and paste > the text into your email. > > (P.S. please reply to the mailing list, not to me personally.) > > > -- > Steven > _

[Tutor] Python and Django dev available

2019-08-01 Thread Sithembewena L. Dube
. Kind regards, Sithembewena *Sent with Shift <https://tryshift.com/?utm_source=SentWithShift_campaign=Sent%20with%20Shift%20Signature_medium=Email%20Signature_content=General%20Email%20Group>* ___ Tutor maillist - Tutor@python.org To unsub

Re: [Tutor] Create Logging module

2019-08-01 Thread Peter Otten
e): print('Hello {}, I am {}'.format(name, age)) say_hello('Tonny', 8) _______ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Create Logging module

2019-08-01 Thread Alan Gauld via Tutor
kwargs)) > return func_to_log(*args, **kwargs) > > return wrapper -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos __

Re: [Tutor] Create Logging module

2019-08-01 Thread Steven D'Aprano
t or photo and send that, instead copy and paste the text into your email. (P.S. please reply to the mailing list, not to me personally.) -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail

[Tutor] Create Logging module

2019-08-01 Thread Sinardy Xing
___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Difference between decorator and inheritance

2019-08-01 Thread Alan Gauld via Tutor
alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Difference between decorator and inheritance

2019-08-01 Thread Gursimran Maken
___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

  1   2   3   4   5   6   7   8   9   10   >