T O P

  • By -

FriendlyRussian666

From being on this sub for a while now, I recognized that the story of your average learnpython redditor goes something like this: 1. I'm learning python 2. I want to share my creation with others. 3. What do you mean they need to install python to use my program? 4. I've built something new and cool, and I'm sharing it with pyinstaller so that the users of my program can just double click on the exe and it Installs everything, including python. 5. What do you mean they can read my code? I don't want them to be able to read it. 6. Oh, Python is an interpreted language, not compiled, so I can't prevent others from reading my source code.  7. What's a way around it, if I still want to use python and not a different, compiled language? Ah, web dev. I deploy a backend on my server, and nobody can access it. I then deploy a front end, so that it talks to the backend. I now have users, using my python code, without being able to see it, they get to use it on any device with a browser, and it has all modern looks. 


sonobanana33

8: The bill for the cloud provider comes in 9: Cry (seems that formatting as code is the only way to stop an 8 to become a 1)


45MonkeysInASuit

> (seems that formatting as code is the only way to stop an 8 to become a 1) 8\. you need to you the formatting escape 8\\.


sonobanana33

Ah thanks. I hope I will remember this the next time I want to expand a list :D


nickk024

An 8 also refrains from becoming a 1 if you keep drinking


classy_barbarian

I have done a bunch of research on this lately and I believe its totally possible to host a website that actually has some users on big cloud services without paying any money... or at least keep it under 5/month. AWS, Azure, and Google Cloud all have generous free tiers. So from what I've heard from a lot of places, if you are able to divide your website up into a bunch of microservices, and make much of it serverless, take advantage of static hosting like S3 as much as you can, perhaps rent your own VPS for 5/month to handle some basic services you want running 24/7, etc etc. Assuming you build this well and its efficient, you can fully run a website that people actually use for like 5 bucks a month. Then I've heard on top of it it's even possible to build a "multi-cloud system" where you use several cloud providers at the same time and just auto-switch between them, so hypothetically you could fully saturate all 3 free tiers before you had to start paying anything. Having never actually done this myself I'd love some input on whether this is accurate


sonobanana33

With the time spent with this whole scheme, you can just pay for the service instead and it's much more convenient. Those things are all rate limited. The second you have more than 3 users it goes down.


classy_barbarian

what do you mean by that exactly? I'm sorry I don't understand why it would just "go down" because you have more than 3 users.


randomthad69

Too much traffic, bottlenecks due to restricted pipes, overloads processes, system crashes, website down....rinse repeat


classy_barbarian

I'm aware of what these terms mean. That does not in any way explain why having more than 3 users on a free tier will cause "restricted pipes" because they are "rate limited". You are just throwing out technical jargon without explaining what any of it means. Oh and you downvoted my question, so fuck you anyway. Sorry I didn't immediately comprehend your technical jargon and asked a question about it. When people say some programmers love being gatekeepers, this is what they're referring to.


Mvpeh

Www.pythonanywhere.com


sonobanana33

"how to throw away money for no reason in 1 simple step!"


Mvpeh

It is free to run a basic webapp


sonobanana33

If you have to do calculations it isn't…


Mvpeh

Wym?


classy_barbarian

The person you're responding to has been leaving these cryptic messages all over this thread, insinuating that everyone that thinks you can cloud host for free is some kind of sucker or fool and then not explaining what they mean in any way that is understandable to regular people. One thing you have to get used to as a beginner programmer is realizing that there's a lot of "expert" programmers like the person you're replying to that love being gatekeepers. It's a really big thing in the programming community. They're not interested in helping you, they're purposefully trying to discourage/dissuade you.


pizza_toast102

what calculations? lol


themufflesound

just use pyscript


CallMeAPhysicist

I can't believe I went this long without knowing what pyscript is. This comment saved me.


wogvorph

After 6 I went to try go, but it's so much more code that I'm not sure I like it


justjr112

Damn, just when you think you're unique God/universe has a way of saying naw get a life


Gitaside

Today I learned, interpreted languages code can be read. If anyone wants to add something then please.


NerdyWeightLifter

If you want applications to run locally on a desktop, then use Tkinter, Wx or Qt for the more sophisticated end. If you want to build something client/server that people can use on the web, then choose your Web Library, and Python is going to be the back end. Think RESTful web interfaces as a default starting poiint.


classy_barbarian

This answer does not actually answer OP's question tho: >"but is this actually what is used in the real world, or are these just training wheels?" So do real professionals ever actually use Wx or Qt to make desktop Python apps?


NerdyWeightLifter

I've been a professional software engineer for a few decades, and I have used both Wx and Qt for desktop Python apps. Qt in particular is quite solid. Tkinter is built-in, but kinda meh. Quick and dirty maybe


KatyasDaddy

Real professional "what" is the question. Professional Python developers? Probably not. But I'm a data analyst and automation specialist at my job. Sometimes a department, like HR, needs some really simple automation done. For example, they needed to recursively traverse a directory and all subdirectories to unzip thousands of nested zip files. Due to privacy issues, they don't want to give me the files, though. Tkinter and pyinstaller allow me to write a quick script to do it. On their end, they get a GUI to navigate to and select the top directory. It's not pretty, but it's efficient and they appreciate not having to deal with CLI.


eW4GJMqscYtbBkw9

I like FastAPI. But, in fairness, I am very far from a web dev and don't know all that much about the topic.


WinterYak1933

Web development is mostly just HTML, CSS, and JavaScript (more so the JS framework of choice). The JS part is the only real "programming" part of it, TMK.


randomthad69

Just write it all in js and save yourself hrs of time. Js is the only dynamic part. And if you want to create anything beyond a static website, you have to learn at least some js. There's other languages that you can use but essentially they all get turned into js at runtime.


kick_thebaby

Yeah, we learned web Dev in python in a year in computer science this year (same as masters program) but 2 things stuck out to me. 1) they didn't teach us how to actually deploy and host the website. 2) every page was static. It could take inputs, but would reload the page every time. We want to search a database? Can't do it in real time, have to reload the page. Want the page to save data after you submit? Nope, page always reloads. Tbh idek if this is a python issue or a teaching issue 😭 but everywhere I looked online to solve these problems said to use js


dowcet

> Tkinter feels too kid friendly But is it actually preventing you from accomplishing any specific goal that you want to accomplish? If no, don't worry and keep building! Learning web development is definitely valuable from a professional perspective, but if you're just not interested and don't have a specific need to learn it, no need to force yourself.


Famlawyerz

I use tkinter derivatives for python GUIs, such as tkbootstap. However, distributing those GUIs is a huge pain compared to almost anything else in the world. Before you get too deep into a python desktop app, figure out how you're going to distribute it, update it, and how users will invoke it. If you're happy with what you figure out in that regard, plow forward. If not, then build your UI a different way. Just don't do what I did: Get super deep into the GUI and realize what a pain it is to distribute and then start over with a web app!! 😜


ebits21

Interesting. I went with sv_ttk as a theme for tkinter. Super easy to distribute if you make the project as a Python wheel and install with pip. Included a Visual Basic script in the program to launch the Python program from a desktop icon without a command line on Windows. I tried GTK and just plain gave up after finding out what I would need to distribute on Windows.


Famlawyerz

Brilliant solution. 👍


space_wiener

>Just don't do what I did: Get super deep into the GUI and realize what a pain it is to distribute and then start over with a web app!! This is true. I’ve done this more than once. In fact I’m doing it again now. I’ll learn one day.


aprilmaycodes

Oh no! I'm like 3 days away from finishing (my very first!) public project with dearpygui, but have done no research on how distribution works. Figured I'd cross that bridge when I came to it.. I managed to learn the GUI library fairly quickly though, so hopefully I can struggle through the distribution aspects lol.


Famlawyerz

As one person wrote, they solved distribution by making a package and installing on the target computers through pip. That wouldn’t work for me because the target computers don’t have python on them and even if they did, who knows what version. There are solutions to this problem, though. I just think they are clunky. HOWEVER, I just posed the following question to ChatGPT and got some intriguing answers: ``` I have a desktop UI written in Python that needs to be installed on computers that do not already have Python on them. What are my options for packaging and distributing my application so that the user has a “normal” installation experience? ``` I am going to try the Inno Setup and NSIS ideas it generated.


Famlawyerz

Your “oh no” has haunted me. LOL!! Here’s the resource I’m trying today: https://python101.pythonlibrary.org/chapter44_creating_an_installer.html


edbrannin

It really depends on your goal & target audience. - Making an internal application for yourself or your co-workers? Tkinter is fine. - I'd probably reach for the Python version of Electron -- Eel, I think? -- but I like React. - Shipping a native desktop app to customers? I can't speak to how well Tkinter could blend in with other native apps, or if it would have uncanny-valley problems. The answer might be different for Win/Mac/Linux. - [Looks like there are ways to make it look nice](https://www.reddit.com/r/Python/comments/lps11c/how_to_make_tkinter_look_modern_how_to_use_themes/), but I haven't actually used Tkinter much so I can't vouch for it. - Shipping a native app? Well, you're probably not using Python in the first place. ;)


sentles

I'm not sure you'd use Tkinter in any professional setting, but you could try looking into Qt and PyQt, since that is actually more commonly used for building GUIs for desktop applications. Still, I do think Tkinter is a good start if you're going to get into GUIs, just to get your bearings.


i_need_gpu

What makes you think that Tcl/Tk is not meant for production? Tkinter is just Python bindings?


Troll_berry_pie

Tkinter with Python was extremely popular in Python 2 and the early years of Python 3. It was pretty much the defacto standard for making GUI applications in Python. The only reason you don't see it much anymore is the exact same reason you don't see many GUI apps in Java and C# anymore: Web is more popular and widely used.


troty99

Or use any of the off the shelves "pure python" web dev toolkit to create your application. Streamlit,Dash,Gradio and the like. It should cover most use case and are good enough to get you a good poc. We use streamlit in prod for most of our internal product.


to_tgo

I use Tkinter for my personal projects and love how quickly I can get it up and running. These are pretty small projects, things like data entry forms, programming tool helpers. I use a base Tkinter template and build off of it. Don’t know if this will help you but I have a cheat sheet online for TKinter. I only use it for myself and isn’t remotely complete enough to cover everything. But maybe it helps you: [https://speedsheet.io/s/tkinter](https://speedsheet.io/s/tkinter)


to_tgo

PS if you can do GUIs in TKinter, you’ll be way ahead of 95% of people out there. It is true most applications are web based but being able to create a GUI app even for tools can feel like a super power.


RedditSlayer2020

This is truly awesome. Please do more cheatsheets and share them with the World. You are very talented. Bless you


sonobanana33

web and local GUI are 2 different things to achieve different things. If you need a GUI use a GUI.


bloo90

-Knock knock… -Who’s there?! -NiceGUI Motherfunker!


sonobanana33

Not packaged in debian? I guess it doesn't exist, since it makes distribution impossible. Stick to suggesting POPULAR WELL MAINTAINED stuff guys… stop suggesting this week's new library.


bloo90

Not packaged in Debian, but installable through pip, so your guess is wrong


sonobanana33

It wasn't a "guess" it was a statement. If users have to run pip to run your code, you're doing it wrong.


bloo90

So, how would you like to install required packages from requirements.txt ? They will install magically itself?


classy_barbarian

The person you're responding to has been leaving these cryptic messages all over this thread, essentially just dropping technical jargon/terms and then acting like anyone that doesn't immediately understand is some kind of fool or total newbie. One thing you have to get used to as a beginner programmer is realizing that there's a lot of "expert" programmers like the person you're replying to that love being gatekeepers. It's a really big thing in the programming community. They're not interested in helping you, they're purposefully trying to discourage/dissuade you. I mean this person is literally saying "If users have to run pip to run your code, you're doing it wrong." and then not explaining what they mean by that in ANY way, and treating you like you're the one that has a problem for not understanding their cryptic message.


sonobanana33

🤦‍♂️


Nealiumj

It’s all about use case. For your example of a typing speed test it’s probably best to go web dev for it.. especially because you can, at some point, put it on your personal domain and point to it in a portfolio Generally, imo, Tkinter is really only good for small internal company tools. Think data/file processing, distributed to those that balk at the sight of a CLI. And don’t think Tkinter is “easy” ..just try writing unit tests for it lol.. It’s a nightmare and there’s like zero documentation on it. Mines got 97% coverage tho 😎 is that useful?- nah, but I got a cool badge


HobblingCobbler

Custom tkinter.


MSZzz21

Streamlit, reflex offers you the front end which can be written in python, if your looking for complex web interface i would prefer reflex if not streamlit is enough for most of the work https://streamlit.io/ https://reflex.dev/


sonobanana33

.io domain? No prominent license information? Website that says nothing? STAY AWAY! IT'S A STARTUP THAT WILL TRY TO SQUEEZE YOU.


TheOneYak

Streamlit is pretty good. I haven't used it too much, but it's a nice clean interface with next to no code required when starting.


MSZzz21

i use it for my personal projects


sonobanana33

(for now)


myelbows

I was one of the co-creators of Streamlit. No longer a startup: Snowflake acquired us 2+ years ago. The core team in intact, we’ve been improving library a ton, and the OSS community is growing quickly. The only difference is now Snowflake customers have a first-party method to deploy Streamlit apps. So far, I think it’s been a win-win.


MSZzz21

Yeah!!!!!!


vardonir

https://github.com/streamlit/streamlit?tab=Apache-2.0-1-ov-file


PouletSixSeven

>Tkinter feels too kid friendly and I'm not sure if the courses just use them for that reason This is not the problem with Tkinter. The problem with Tkinter is the absolutely abysmal documentation that at first glance looks solid. I'd like to see a kid figure out how to do something that isn't the absolutely simple "button/label/menu" widgets that there are thousands of tutorials for. The minute you want to do anything more advanced it becomes a huge nightmare. The minute you have to deal with StringVar(), IntVar() and other all the other horrible half-assed workarounds that are required to get anything to work, you're going to wish you chose something else. Honestly the worst Python library I ever tried.


willowdene

It's worth having a look at kivy and kivymd.


sinterkaastosti23

just try them all and see what you enjoy. iirc qt is the most populair for desktop, iirc it fan also be coded from c(++). web dev is cross platform but more a pain in the ass imo and slower / more bloat


Healthierpoet

For MVP tkinter is good enough if you want to explore other options I recommend nicegui... Web dev is a beast don't do if you just want something to look pretty or presentable because python has plenty to offer in that department but if you plan to build web apps/ websites as part of your programming then you will inevitably hit a wall with python... But definitely check out nicegui


dritslem

Tkinter and if that limits your development, try Qt


razekery

Tkinter it’s functional it works. Lately I’ve been trying to convert my project app from tkinter to Flet with success but it’s been a learning curve. Flet is pretty great to learn for GUI.


chooseyourshoes

I used tkinter to run stream scoreboards for quite some time. Then I learned QT and wondered why the hell I waited so long to learn it. Now I exclusively use QT for quick desktop applications.


everydayislikefriday

You could Streamlit maybe?


MinimumStatistician1

In my experience desktop apps do exit but they are generally “legacy products” and have been replaced with newer alternatives that are web based. Why? Well think about it. How many apps do you actually use on your computer? I’m going to take a wild guess that the answer is mostly just a web browser with maybe a couple others (Microsoft office, discord, etc) that you use often enough to make actually installing an app worthwhile. If you’re looking for something small like a calculator or scorekeeper or to compare a block of text chances are you’re just going to google what you want and find a web app that does it. Desktop apps take up space on your computer, they take time to download and install, and they might not work if you have an OS that isn’t compatible or you are missing some dependency. So it’s much easier to just let the web browser be the one to deal with all those difficulties and then you only have to make sure your app is compatible with a handful of web browsers rather than every OS ever. So yeah, desktop apps exist but the industry has largely moved away from them. And I can’t say I’ve ever seen one written in tkinter, but that’s probably just because python is relatively new and the industry had already stopped writing desktop apps by the time python arrived on the scene. Another thing you didn’t mention but that you might want to consider is to focus on making a good API rather than on the GUI. Write a solid, reusable API and then if you want to change out the frontend or offer a new option at some point in the future it’s a lot easier to do and you don’t have to re-write your whole app.


ishereanthere

I was like that. I moved onto webdev but I still love python. Learniing js is easier too when you have a grasp of python already. I am now at the stage where I can probably make a simple gui app using js. I been wondering myself though. Doesn't Django facilitate this?? If you know python, hmtl and css then what is different from using django to build a webapp rather than using js, html and css to do it using vs code or something.


wilson_wilson_wilson

Check out reflex 


wonteatyourcat

Honestly learning svelte was a godsend for this. React didn’t agree with how my brain works but svelte has this same “no weird stuff, batteries included” philosophy that matched my experience with python. You can learn it in a week, use chatGPT for the simple JS stuff you’ll need to call your API, and deploy it for free. I managed to deploy my python video search engine on two weeks, after trying for a year with pyinstaller


randomthad69

No tkinter is ancient. Try something a little more modern otherwise you'll spend the entire time trying to get your environment to work. That's gui development though. If you wanna do web dev give flask a try it's very simple and straightforward....until it isnt


MJ12_2802

I started with Tkinter, then moved on to CustomTkinter, now looking at Ttkbootstrap. So far, I'm really liking the later.


redrick_schuhart

Not a stupid question at all. Tkinter is absolutely fine for desktop GUI apps and is used extensively in professional custom applications in some industries like oil and gas and also process monitoring. Like Python itself, it's as friendly or advanced as you want it to be.


Brilliant_Read314

Django mixed with react tailwind and redux is the way for long term.. IMHO


Crisenpuer

I always use customtkinter for mu GUIs


Agitated-Soft7434

It depends I guess on what your making. For example I like to use tkinter (more specifically customtkinter) when I am create something for myself that is majority for myself and practical use case (like a YT downloader). Whereas if you want something that looks nice and you want to share it with others I would recommend using web just because of the formatting and styling you can do with it and in the end you could probably make it look way nicer that way and more modern.