Re: [Tutor] Info on APIs and handling JSON
thanks a lot Mats, that is what I was thinking. The info on JSON will however be useful to me anyways, thanks a lot, On Fri, Nov 16, 2018, at 6:06 PM, Mats Wichmann wrote: > On 11/16/18 12:31 PM, Anil Duggirala wrote: > > hello, > > > > I have been looking for documentation about how to connect to APIs and > > using the provided info within python. I have found a few websites > > talking about very particular cases. Probably the most enlightening was > > the 'requests' library documentation. Can someone please point me to > > serious and comprehensive info on how to deal with APIs and then > > handling JSON and other provided info in python? Maybe a book? > > json handling is simple: the json module is part of the Python standard > library. > > https://docs.python.org/3/library/json.html > > APIs have no specific answer. An API is an Application Programming > Interface, each is different and specific to the project in question but > refers to how you communicate with the functionality of that project > from your program. Some popular ones have Python adaptations available, > otherwise you read the documentation and figure out how to code your > own. Sometimes the API is a style that lets you use an existing Python > project, even if it doesn't know anything about the thing you want to > talk to. requests is a good example - is the project you're interested > in provides a RESTful API, using HTTP protocols, then requests can > certainly be used to talk to it, but you still need to discover the > specifics and code them up yourself. Other APIs provide other interface > styles. > > > > ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] seniority
Steven, Good question. I do not know how long and in what capacity many people have been involved with anything, including Python in some form. I do know a bit about Alan and plenty about myself. I was saying that I would take seriously what was said by people LIKE Alan because they had more experience and perhaps more internal knowledge than someone like e who took an introductory course in Python maybe five years ago then went on to many other languages and only came back recently and is doing some serious studying. The main difference between me and others here with questions is that I am in the general category Alan mentioned of someone with a mindset that has been very hospitable to mathematics and an algorithmic way of thinking. But that does not give me much knowledge in an experiential sense other than what I have read. And, some of my resources are out of date. Last night I watched several talks by David Beazley that Mats pointed out and plan on doing some more. He kept talking about revolutionary changes in release 3.6 and I note I am now using a 3.7 variant. He suggested you use these such as the f-string or depending on dictionaries to be in the order things were added and so on. My thought was that this would disrupt anyone running not just 2.X but any older version of 3.X but that may have been his point. You may think you know the language, but it is like layers of the onion and some of your favorite features were definitely not in place way back when the people with seniority got into it. Watching him rapidly improvise code live, I also saw how some people can make ever deeper abstractions come to life in ways that even sort of add features to the language if used right. He did an entire talk on using classes and metaclasses and decorators to change the useless annotations added to the language that don't actually check if arguments to functions (or in classes) are of the type or condition expected, such as a positive integer, to one where the invisible wrappers created will check implicitly and return errors. It is very possible to write programs that others may not easily understand just using existing features, let alone as it keeps evolving. Rushing out, as usual. Today is Thanksgiving in my part of the world so will reply to the rest of the message another time. Avi -Original Message- From: Tutor On Behalf Of Steven D'Aprano Sent: Thursday, November 22, 2018 1:06 AM To: tutor@python.org Subject: Re: [Tutor] origins bootstrapped. On Wed, Nov 21, 2018 at 11:31:59AM -0500, Avi Gross wrote: > Alan has been involved with Python for a long time so he has more to > offer historically. I've been involved with Python for a long time too. What exactly are you trying to say? <<>>> https://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] learning languages
Steve, I would go a step further. The word "industry" is used by some to mean THEM. I would suggest it is more like US as the younger people of yesteryear age into becoming the employees and even management of the industries involved. When a language like Python has been around long enough so lot of people are exposed to it in places like College, then when they find work, they often select a place that has what they are used to or try to bring it along at some point. I have had to largely start over several times as the computers and environment at the University of Wisconsin were very different than I had used in N.Y. I used different hardware (as it evolved) and other programming languages and operating systems and so on. When I moved on to Bell Labs, nobody cared about what I could do with PASCAL or with DEC Operating systems. I rapidly adjusted to UNIX and C and all that comes with it. Hence my regular search for novelty and learning new ways. Heck, when I used to teach, I did not want to teach the same course twice. Been there. Done that. But for many people, the idea of leveraging what they are used to has been a factor in bringing many academic versions of software and ideas into industry. But once in a more real world, people may find that the tools may not fit them as well and the choice is to make new ones or try to change the existing ones. I speculate this is one way to look at the pressure. I am puzzled about your question of what I meant by free. Yes, if you want a higher quality product you may have to pay for it or if you want to make commercial use. But for routine purposes, there are many things now for free. Look at many of things in the GNU category. You can take a PC (not free) add free enough operating systems like LINUX, add suite after suite of software including Python and R (but not S) and free mailers and spreadsheets and games. If you want a commercial variant on R, you can buy S. I am not up on it, but Python has many implementations and some may come at a price, especially if you buy it for commercial use. You mention a bunch of variants in your message with some only having a PieceOfThePy and there are many more. But if you just want to learn it, tons of info is free including plenty of documentation and lots of free add-ons like modules or code that does useful things. As pointed out, IDLE is a free editor/environment written in Python and just sitting there to be used or edited or adjusted to other needs. You ask who taught parallel processing in an intro class. True if you mean an intro PROGRAMMING class. But I have seen many classes on topics like Analysis of Algorithms or Machine Learning where a part of the class is to explain partially in the context of one or more computer languages or have you do assignments. Someone recently wanted to know how to program various cryptographic methods in Python and elsewhere asked how to do it in another language. But my point was perhaps not what you assume. My point is that when teaching beginners how to do things within a language, there may be no need for many things. The very basic functionality has lots of black boxes underneath it that can be safely ignored or given as handwaving. Someone wondered if adding generators complicated the language. Yes, but also no. Creating a generator is one thing. Using it is trivial. Isn't it nice to be able to use almost any type or function as a generator and not care how the black box was made? True, it means when you really want it all at once, you might have to wrap a list() command around it or use it in some context that exercises the generator to completion. Now teaching one of umpteen ways to make a generator or convert an existing thing into a generator, is a tad more advanced. Using them, maybe not so much. As a reality, as long as machines get ever faster and with more memory, some bloat is tolerable. If a programming language has features rarely seen or used, you can still use it to teach. But people tend to try to show off and even make a virtue of doing more complex things. How many have been told that python allows something like this: a,b = b,a or 5 < x <= 10 The former can easily be done using a temporary variable and probably is done that way underneath. The latter might also be done a simpler way except you need to make sure x is only evaluated once. As it happens, the first example is of major importance because it pervades the language with things like a function returning a tuple. Last comment. Is it better to teach in a bay language, say showing how you can use turtles moving around to draw objects and then switch to even more complex and complete languages for final use or should you start with something you can grow into? Think starter houses where people move up when kids arrive (and when they can afford it) and maybe downsize after they leave. -Original Message- From: Tutor On Behal
Re: [Tutor] origins bootstrapped.
On 22/11/2018 06:05, Steven D'Aprano wrote: > I don't know of any non-free (free as in beer, or free as in speech) > implementations of Python. Can you elaborate? There are several commercial distributions (as opposed to implementations) of Python, that may be what Avi has in mind. Some of these are commercial IDEs that include python as part of an integrated bundle - I think Blackadder is one such - and others are just uber distros like Enthought Entropy(?) which is a "supported" distro for scientific work - rather like Anaconda. Others are in the Movie industry where it is either tied to a particular tool or again to a support arrangement. The implementations are the standard open source code but the distribution is paid for, with the value add either in the toolset, the packaging or the support. But maybe Avi means something different... -- 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] learning languages
On 22/11/2018 21:45, Avi Gross wrote: [big snip] Please take this up on some other forum as I see nothing here that relates to the purpose of this list, i.e. teaching Python to beginners. TIA. -- My fellow 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