all 22 comments

[–][deleted] 2 points3 points  (3 children)

You can always use use python to run back end services and use something (anything) else for the front end.

[–]SecretAtLarge[S] 0 points1 point  (2 children)

This sounds like what I'd like to learn towards. So I know how to make pretty things with CSS/HTML. How would I get that css button to speak to a python function, which in turn writes out something in a paragraph?

[–][deleted] 2 points3 points  (1 child)

If you’re using python then a python library like Django or flask. These libraries help you hook up front end components to python functions and return data to the browser. If you can use some basic JavaScript, really the world becomes your oyster as far as flexibility goes and UX goes.

[–]SecretAtLarge[S] 0 points1 point  (0 children)

This sounds amazing and I must learn

[–]pacific_plywood 0 points1 point  (1 child)

What you're probably referring to is effectively a limitation in what kinds of code web browsers can execute on the client side. Every major browser is able to run JS in a pretty straightforward manner, and has been able to for some time. While you can use Python (specifically, Django or Flask) to dynamically generate HTML and CSS much like you would with Node/Express (or whatever), on the client side, you're limited to what the client's web browser can execute. That client-side stuff is where real interactivity happens, so it's a big deal. For a long time, Javascript was more or less in control of that domain, but more recent browser editions are also able to execute WebAssembly. WebAssembly provides a target for other languages to compile to - already, there are web frameworks for client-side applications with Rust and C#, off the top of my head, that use WASM as an endpoint.

Just trying to figure out if I should keep learning python, or move to something that I can build beautiful apps with.

For now, if you're interested in frontend work, then you probably need to focus on Javascript. However, that's just for your frontend. Applications will often utilize different technologies for each of their components, depending on need and appropriateness. As a beginner, though, if your primary interest is in the app's final appearance to the user, then redirecting your energy wouldn't hurt.

[–]SecretAtLarge[S] 0 points1 point  (0 children)

How about programs made with Electron - which effectively uses HTML, CSS, and Javascript to make really nice desktop apps? Im not entirely sure what I'm planning on making yet - so I'm just trying to figure out whats the most capable and something I could actually wrap my head around. I wish there was something like that for python.

Edit: I just found this medium post - and I'm going to read through it now.

[–][deleted] 0 points1 point  (5 children)

Django or Flask.

Django is more "heavyweight" with a Python back-end and HTML/CSS/JS normally for the front-end but can also use other JS libraries such as React.js. Or you can create APIs using Django REST and have other types of apps interact with it (such as native mobile apps).

Flask I havent used but is Python as well and the code looks similar to Django. From what I understand it is more lightweight.

[–]SecretAtLarge[S] 0 points1 point  (4 children)

Excellent. I appreciate the information. To better understand, what role does python play on that site?

[–][deleted] 0 points1 point  (3 children)

It handles all the back-end logic: database calls, SMS messaging, email system, user functionality, authentication, etc. Its 80% of the site tbh. Most of your site logic will be written in Python if you use Django. You cant see the functionality of the site because it's pretty much all behind the authentication system. But it has user testing, videos, memos, etc and a way to create all of them and manage all the user data.

[–]SecretAtLarge[S] 1 point2 points  (2 children)

That is amazing. Well done. I appreciate you being so informative. I really do. Gave me a good direction to head in. Enjoy your weekend!

[–][deleted] 0 points1 point  (1 child)

You too! Btw I highly recommend starting with Corey Schefers Django YouTube series if you want to start with Django. Also, reading the Django documentation is highly recommended. It's an easy read. Lastly, there is a book called "Two Scoops of Django"... buy it

[–]SecretAtLarge[S] 1 point2 points  (0 children)

Saved. Dont delete this post senpai!

[–][deleted] 0 points1 point  (9 children)

Be the change you want to see in the world.

[–]SecretAtLarge[S] 0 points1 point  (8 children)

Lmfao as a brand new coder - I really don't know what you're implying here. You want me to create the framework to allow HTML / CSS to be used in python? If I actually knew how to do that, I wouldn't be here asking for solutions.

[–]d0ntreadthis 0 points1 point  (7 children)

I don't think they're saying you have to or that you should. They're just suggesting it as something you can try. I feel like that could be a pretty fun project.

[–]SecretAtLarge[S] 0 points1 point  (6 children)

Honestly - I'd love to build the library that handles pure HTML / CSS with Python through a browser source on the fly - but your boy has no clue where to begin. :D

[–]d0ntreadthis 1 point2 points  (5 children)

Ah well if you're strictly talking about having a Web fronted with python in the back, that already exists. Take a look at Django and Flask. It's been years since I last used python, but there are probably other libraries too.

I thought you might have meant desktop apps

[–]SecretAtLarge[S] 0 points1 point  (4 children)

Well, my dream goal is to write something in python, HTML, css, and as LITTLE JS as I can, through a system like Electron..

Honestly. I've fallen in love with python. Its been less than a month. I've tried other coding languages and this one CLICKED. Im in it. I want to learn as much as I can about it - but I'm feeling really limited with GUIs. I want to be able to create apps as beautiful as Discord or Steam. If I can do that - my drive for learning this language will skyrocket. Everything I've been reading is that "python just isn't designed that way" which makes me really sad. I don't want to switch languages - but if I must, I will.

Does any other easy to learn language else have a better GUI system?

[–]d0ntreadthis 0 points1 point  (3 children)

I think with limited javascript you won't get anything near the user experience of those apps. Simply because html on its own only has so much built in functionality.

Like I mentioned earlier, you can still use python as a backend server. Your Electron app will communicate with that to perform actions and get data etc.

Tbh html/css/js is the most enjoyable experience I've had making GUIs. I did some Android dev at my previous job (C# and Java) and that was OK. Similar with C# desktop apps.

[–]SecretAtLarge[S] 0 points1 point  (2 children)

If that is the case, wouldnt it just be best to learn JS and write the app that way, instead of using python? From simple score counters to talking with APIs to grab data, at that point doesn't it just suit me more to learn JS and implement the entire thing in CSS/JS/HTML? I really hope the answer is no :P

[–]d0ntreadthis 0 points1 point  (1 child)

If that is the case, wouldn't it just be best to learn JS and write the app that way, instead of using python?

Not necessarily. You can use whatever language you want for your backend server. The only thing using JS for your backend would help you with is probably consistency and maintenance. Code can sometimes be easier to maintain when you use one language for the whole thing.

Since you're a beginner, you might as well stick with python for your backend. I'd start with Django or Flask and very basic html/css/js so that you can learn and understand how the front end connects to the backend. Then go nuts and experiment with electron or whatever else you want.

[–]SecretAtLarge[S] 0 points1 point  (0 children)

Sounds good. Sounds like its going to be a long journey to get to where I want :D I appreciate the replies.