What exactly can you do with Python? Here are Python’s 3 main applications.

Here are Python’s 3 main applications.YK SugiBlockedUnblockFollowFollowingJun 14If you’re thinking of learning Python — or if you recently started learning it — you may be asking yourself:“What exactly can I use Python for?”Well that’s a tricky question to answer, because there are so many applications for Python.But over time, I have observed that there are 3 main popular applications for Python:Web DevelopmentData Science — including machine learning, data analysis, and data visualizationScriptingLet’s talk about each of them in turn.Web DevelopmentWeb frameworks that are based on Python like Django and Flask have recently become very popular for web development.These web frameworks help you create server-side code (backend code) in Python..That’s the code that runs on your server, as opposed to on users’ devices and browsers (front-end code)..If you’re not familiar with the difference between backend code and front-end code, please see my footnote below.But wait, why do I need a web framework?That’s because a web framework makes it easier to build common backend logic..This includes mapping different URLs to chunks of Python code, dealing with databases, and generating HTML files users see on their browsers.Which Python web framework should I use?Django and Flask are two of the most popular Python web frameworks..I’d recommend using one of them if you’re just getting started.What’s the difference between Django and Flask?There’s an excellent article about this topic by Gareth Dwyer, so let me quote it here:<begin quote>Main contrasts:Flask provides simplicity, flexibility and fine-grained control..It is unopinionated (it lets you decide how you want to implement things).Django provides an all-inclusive experience: you get an admin panel, database interfaces, an ORM [object-relational mapping], and directory structure for your apps and projects out of the box.You should probably choose:Flask, if you’re focused on the experience and learning opportunities, or if you want more control about which components to use (such as what databases you want to use and how you want to interact with them).Django, if you’re focused on the final product..Especially if you’re working on a straight-forward application such as a news site, an e-store, or blog, and you want there to always be a single, obvious way of doing things.</end quote>In other words, If you’re a beginner, Flask is probably a better choice because it has fewer components to deal with..Also, Flask is a better choice if you want more customization.On the other hand, if you’re looking to build something straight-forward, Django will probably let you get there faster.Now, if you’re looking to learn Django, I recommend the book called Django for Beginners..You can find it here.You can also find the free sample chapters of that book here.Okay, let’s go to the next topic!Data Science — including machine learning, data analysis, and data visualizationFirst of all, let’s review what machine learning is.I think the best way to explain what machine learning is would be to give you a simple example.Let’s say you want to develop a program that automatically detects what’s in a picture.So, given this picture below (Picture 1), you want your program to recognize that it’s a dog.Picture 1Given this other one below (Picture 2), you want your program to recognize that it’s a table.Picture 2You might say, well, I can just write some code to do that..For example, maybe if there are a lot of light brown pixels in the picture, then we can say that it’s a dog.Or maybe, you can figure out how to detect edges in a picture..Then, you might say, if there are many straight edges, then it’s a table.However, this kind of approach gets tricky pretty quickly..What if there’s a white dog in the picture with no brown hair?. More details

Leave a Reply