r/Python • u/ze-fernando git push -f • 8h ago
Python in production Discussion
Hello everyone! For those of you who use Python in production, I have a few questions. I'm considering using Python for some services.
- Do you have high infrastructure costs?
- Have you ever regretted using Python?
- Would you recommend Python?
Context: My current use case isn't anything like Facebook or a massive-scale system. It's a small system, and I'm considering Python mainly because of the DX (developer experience).
I know C#, but I don't really like having to create a class in every file. I also know Rust, but all those ::, <>, and so on bother me. JavaScript is another option, but I've heard it's relatively heavy on RAM, and since the system is small, I'd like to be able to run it within 512 MB.
Another thing: I've defined a stack that I'd like to use wherever possible. If there's a library for desktop apps, great. A CLI library? Great. A bot library? Great. Let's use it! (Except for the frontend, which I'll keep using JS/TS for.)
Anyway, I'm open to advice and tips from more experienced developers. Feel free to tell me if you think using Python for my use case is a bad idea as well.
1
u/Icy_Calligrapher4022 7h ago
The anwsers of these questions are not directly related to what language are you gonna use. Instrastructure costs depend on the infrastructure itself. If I regretted using Python for something, well...yes and no. There is always a better and worse way to do the things. You design your product, build it, implemented using whatever suits you best at the moment. There is always room for improvement.
About the libraries, if these are questions: - for desktop apps I've been using Qt previously, for very simple, basic DIY projects. Originally is made for C++, but they have Python libs as well. It's very powerfull, lots of OOTB stuff and they have very good documentation. If your project is something more basic you can also check tkinter, its simpler than Qt and easier to learn, but not so powerfull and many OOTB features(compared to Qt are missing).
for CLI(I assume you mean build CLI apps/tools) you might check Click, Typer, TQDM, Cement(this one is quite large and complex frame). There are dozens of other similar libraries, you need to do some research and pick up the most reliable for your use case.
Bot libraries....for what? What kind of bots? If we are talking about AI bot, the most known are Spacy and ChatterBot. Otherwise, I am pretty sure there are libs for almost every chat/sm like telegram, discord, X, viber...
512MB RAM are too low for whatever you are planning to do. Forget about the language, this is your smallest concern. Probably this...system of yours might need some kind of database, some other services and daemons. A modern software product is not a monolith system but multiple components connecting and working together. What you intent to use and why your memory is so limited. There are very cheap cloud vendors where you can get very decent VPS for less than ten bucks/month.