What does Python include? And why Python?

Ok, for websites you have things like html and css which are the languages that provide the presentation to the user, then you have things like Javascript that takes care of the autoamtion, and then you have things like node.js and express to work on the backend…

Now, why use Python?

And what other languages do you need to know in order to work with Python?

What if you want to make a webiste with Python? What else would be required for it to work?

What if you just want to make a stand alone software? What else would be required to work with Python?

What if you want to make an android or iphone app? What else would be required to work with Python?

because there are other things other than web dev, for example data analysis, or scripting

Python is a language

You need a Python Framework for the web, like Django or Flask

Python installed in your computer, and create the Python file

same as web dev, you would need a library or framework made to create mobile apps

2 Likes

Does Python include its own equivalents to html and css already in Python?

HTML is a markup language, it is a programming language on its own

I have not used a Python framework specifically, but when you use a framework instead of HTML directly, the framework will use what you have coded to create the HTML of the page

Like, with HTML, CSS and JS you can write an html file directly, and open it in the browser - and those are the only languages known by the browser. If you use somethins else, you will use a compiler to create the html-css-js that the browser can understand

Node, Python, PHP, perl, C, Go, even COBOL - these are server-side languages. They run on a machine, running particular applications or codebases on that machine. Each language has its own strengths and weaknesses, each shines at something.

In the case of browser-based development, we are far more constrained, as the primary programming language of the front end is javascript. We can use libraries in other languages, using things like WASM, but they still can only interact with the web page… through javascript.

But on non-browser-based development? We can develop in all sorts of languages. There is no limit to what we can build, but in almost every language, we will need to import some functionality.

If we want to build an app that can interact with sensors and servos, running a greenhouse by detecting temperature, air quality and humidity and triggering fans, sprinklers, ceiling vents… Python can do that. We simply need to include some libraries written in hardware-specific languages. PHP can also do that - but we need to include similar libraries.

If we want to simulate weather patterns based on historical data going back over 100 years, and try to forecast coming weather patterns based on that? Python can also do that - with some additional libraries designed to optimize our data-munging. Perl can also do that… by including some additional libraries.

Most applications of any size or complexity will usually require some sort of additional libraries or extensions, simply because the core language might not fully implement the things the extension does - or because using that extension saves us the trouble.

Heck, when we’re using javascript in the browser, and we use the fetch api or the IndexedDB api? We’re using extensions to the language, written in a lower-level language like C or Go.

I’m going to be more direct than the others who have posted answers that hopefully helped: it’s apparent from your questions that you don’t really know much about Python, given what you’ve posted (and the question above makes no sense - do you even know what you’re trying to ask there?). But to me it’s also unclear why you’re asking these questions. Is your goal to learn more about Python? Or is there another reason you’re asking these questions?

As much as Python can do, it can’t be used for everything. Yes you can create back-end web applications with it, along with desktop apps (that’s what libraries like TKinter are for). To an extent it can be used to create mobile apps apparently (which I just found out through Google), but Android and iPhone apps are best done with other languages and tools - natively, that means Kotlin for Android and Swift for iPhone, but there are cross-platform tools that do a good enough job as well, like React Native and Flutter. While mobile tools for Python might exist, React Native, Flutter, and the native programming languages are by far the most prevalent ways of doing mobile development today.

I am not familiar with Python other than I know is a popular language for many things.

I have checked some information about Python, but most of what I found is similar to what JavaScript would do for websites, but I haven’t seen or found a part on how to create for example paragraph, or colors, or style for something.

For now I am learning REACT because I am more interested in websites and android/ Iphone applications.

But does REACT covers for software developing as well? I understand that C++ and Python are more common languages for a software, but I haven’t gotten to the point on how to build a IU with Python for example.

Also… I understand Python is used for video games? I am not planning to build a video game, but for example, I have SVG drawings that can be interactively animated using JavaScript on the browser.

I am thinking Python might be more popular with interaction of physical machines that somebody is operating. Imagine building a custom made software that is connected to whatever type of sensors / feedbacks you get from your machine and interact with your mobile phone and lets you know the condition of your equipment, yes, there are companies already doing that, but wouldn’t be cool if I can develop the same thing and make it flexible with whatever I wanted? Would I need Python for that?

You don’t “need” Python for anything. Every turing complete programming language can achieve the exact same thing.
Difference is just how hard it is to write and how much resources it needs. Also maybe what libraries it offers.
Python is easy to write and has great libraries for artificial intelligence, hence it’s quite popular. But it’s VERY resource hungry for anything actually written in Python code, because the Python interpreter itself and many libraries are written in C → which is more efficient but a lot harder to write.

If you want to interact with sensors and machines, Python might not be the first choice ON the machines. There you’d want something simple and propably compiled code like C or C++.
Now for analyzing the data from the sensor, Python might be nice. Again depending on what you want to do and how much computation-power you have at your disposal.

1 Like

you need a framework, for example look at Django The web framework for perfectionists with deadlines | Django (djangoproject.com) if you are interested in web dev with Python

So it’s clear to me that for some reason you’re thinking Python can do anything. But it really can’t, and it has limitations that make it less than ideal for some applications.

Paragraphs, colors, and styles are done through HTML and CSS only. There are no alternatives there. JavaScript in the browser is also something that’s just there, and it won’t be replaced with Python anytime. It’s been JavaScript for a long time and will probably stay that way.

React is a front-end library and used for developing front-end apps only. There are however other React-based frameworks and tools that live on the server-side (Next.js) or can be used to create mobile apps (React Native).

TKinter which I previously mentioned can be used to create GUIs with Python for desktop apps. There are other libraries that add the ability to create games with Python as well (but since Python is considered a “slow” language it’s not ideal for intensive 3D games).

The most common applications for Python today are AI (Artificial Intelligence), ML (Machine Learning), CV (Computer Vision), and back-end web development (Flask or Django). While you can do other things with it, there are invariably better languages suited for those purposes (IoT and sensors, which you mentioned, along with other embedded devices, are usually done in C).

Guys, what courses here on freecodecamp should i take in order to understand python somewhat fully?

If you got a question please open a new topic.
As for the courses - the Javascript course introduces the concept of interpreter-languages and a lot of coding concepts.
Then the Python courses start with scientific computing, then data-analysis, then machine learning.

However if you are new to coding, the Python courses might go over some topics to fast. Also the second and third course are very advanced.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.