mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-08-07 00:58:13 +00:00
Refactor theme (#1)
This commit is contained in:
@@ -40,4 +40,4 @@ sequenceDiagrams:
|
||||
|
||||
---
|
||||
|
||||
Hello. This is the first post. My plan is to pour useful code snippets, tips and tricks into these pages. I have a fond interest in programming (especially with Python, TypeScript and Golang). Hopefully something within these pages will help you out in your journey.
|
||||
Hello. My plan is to pour useful code snippets, tips and tricks into these pages. I have a fond interest in programming (especially with Python, TypeScript and Golang). Hopefully something within these pages will help you out in your journey.
|
||||
|
@@ -1,59 +1,82 @@
|
||||
---
|
||||
title: "Why Python Is My Goto"
|
||||
date: 2018-07-14T22:48:15-04:00
|
||||
draft: true
|
||||
keywords: []
|
||||
title: "Why Learn Python?"
|
||||
date: 2018-07-18T20:48:15-04:00
|
||||
draft: false
|
||||
keywords: ['python', 'pip', 'pypi']
|
||||
description: ""
|
||||
tags: ['python', 'pip']
|
||||
categories: ['python']
|
||||
author: "Dave Gallant"
|
||||
|
||||
# You can also close(false) or open(true) something for this content.
|
||||
# P.S. comment can only be closed
|
||||
comment: true
|
||||
toc: false
|
||||
autoCollapseToc: false
|
||||
postMetaInFooter: false
|
||||
hiddenFromHomePage: false
|
||||
# You can also define another contentCopyright. e.g. contentCopyright: "This is another copyright."
|
||||
contentCopyright: false
|
||||
reward: false
|
||||
mathjax: false
|
||||
mathjaxEnableSingleDollar: false
|
||||
mathjaxEnableAutoNumber: false
|
||||
|
||||
# You unlisted posts you might want not want the header or footer to show
|
||||
hideHeaderAndFooter: false
|
||||
|
||||
# You can enable or disable out-of-date content warning for individual post.
|
||||
# Comment this out to use the global config.
|
||||
#enableOutdatedInfoWarning: false
|
||||
|
||||
flowchartDiagrams:
|
||||
enable: false
|
||||
options: ""
|
||||
|
||||
sequenceDiagrams:
|
||||
enable: false
|
||||
options:
|
||||
---
|
||||
|
||||
Python is a high-level, general-purpose language that has a wide range of use cases.
|
||||
|
||||
Back-end web server? Sure, Django, Flask, Pyramid?
|
||||
|
||||
Test automation? Pytest
|
||||
Python is a high-level, general-purpose language that has a wide range of use cases from the mundanely simple to the increasingly complex.
|
||||
|
||||
<!--more-->
|
||||
|
||||
Do you want to download a webpage? Simple:
|
||||
- Glue script?
|
||||
- Web crawling?
|
||||
- Web server?
|
||||
- Testing?
|
||||
- Micro-service?
|
||||
- Network automation?
|
||||
- Data Science?
|
||||
- Machine Learning?
|
||||
|
||||
{{< highlight python >}}
|
||||
Python is likely a quick way to get any of these tasks done.
|
||||
|
||||
import requests
|
||||
Including the abundant number of packages that can be found on [Python Package Index](https://pypi.org/), there is likely a package that can help you.
|
||||
|
||||
print(requests.get('https://www.theregister.co.uk/').text)
|
||||
Do you want to download a webpage?
|
||||
|
||||
{{< highlight bash >}}
|
||||
pip install requests
|
||||
{{< /highlight >}}
|
||||
|
||||
After that, there is any number of things to do with it.
|
||||
and then invoke the [Python interpreter](https://docs.python.org/3/tutorial/interpreter.html):
|
||||
|
||||
{{< highlight python >}}
|
||||
Python 3.7.0 (default, Jun 29 2018, 21:56:58)
|
||||
[GCC 7.3.0] on linux
|
||||
Type "help", "copyright", "credits" or "license" for more information.
|
||||
>>> import requests
|
||||
>>> requests.get('https://www.theregister.co.uk/').text
|
||||
{{< /highlight >}}
|
||||
|
||||
After that, there is any number of things that can be done with the results.
|
||||
|
||||
As you can probably note, the syntax is simple and clean, which makes returning to your code months later less of a jarring experience.
|
||||
|
||||
## Popularity
|
||||
|
||||
According to [Stack Overflow Stats](https://insights.stackoverflow.com/survey/2018/), Python has surpassed C# and PHP in popularity and is the 3rd most loved language, after Rust and Kotlin. Interestingly, it is "the most wanted language" for the second year in a row.
|
||||
|
||||
## Drawbacks
|
||||
|
||||
Is Python the magical solution to all the world's problems? No.
|
||||
|
||||
Python is not very suitable for much of the following:
|
||||
|
||||
- Static typing
|
||||
- Performance-critical application (i.e. graphically-intense video game)
|
||||
- Mobile app development
|
||||
- Front-end web development
|
||||
|
||||
## Conclusion
|
||||
|
||||
So should you learn it? or stick with shell scripting?
|
||||
|
||||
Because of Python's simple syntax, dynamic typing and abundant Package Index, it makes the language a great asset to have in your toolchain.
|
||||
|
||||
And it hasn't hurt that giants like Google, Facebook and Microsoft have invested heavily in Python.
|
||||
|
||||
## Resources
|
||||
|
||||
This list includes some truly remarkable resources for improving your Python:
|
||||
|
||||
- https://www.realpython.com
|
||||
|
||||
- https://pythonbytes.fm/ (podcast)
|
||||
|
||||
- https://talkpython.fm/ (podcast)
|
||||
|
||||
- https://awesome-python.com/
|
||||
|
Reference in New Issue
Block a user