ActualBudget. It solves my problem of not budgeting.
- 0 Posts
- 127 Comments
6nk06@sh.itjust.worksto
Programming@programming.dev•Kinda proud of this python script I wrote
1·3 days agoYes. You can say
"Session\\Port (lots of space here) = 12345"(formatting sucks, sorry) to align your values properly. Also are you sure that there is a double backslash here because you are using a raw string here?
6nk06@sh.itjust.worksto
Programming@programming.dev•Kinda proud of this python script I wrote
1·3 days agoYes (and I’m sorry for not having more time to study this but):
logDateTime
That thing should be automatically printed by the logger somehow (most of the time, timestamps and log levels are inside the logger itself). If it’s not, check the configuration of the logger. Anyway. logDateTime has got to go. IMHO a logger is a magical object that you don’t control. It’s the user of the application who should set the rules one way or the other, like:
logger.info("qbittorrent listen port set to...IIRC the logger can be set from the command-line, which you don’t control anyway. It’s the same thing in C++ and with any library on the planet (trust me), someone sets up the logging system for you outside of the application (in the main function or on the command-line or with environment variables or in a library/DLL) and all you can do is call “log.debug()” or “log.warning()” and hope for the best. Some libraries have huge systems to handle logs (rotating logs, serial ports, files, network…) and you shouldn’t give yourself headaches while using those things. Think of a logger as a pre-configured system that does way more that you should and want to know.
logger = logging.getLogger(…
Put that outside of main, after the imports. You can prepend it with an underscore to show that it’s a “private or protected” object belonging to your module. If it’s in main, you can’t use it in the other functions. You should do something like:
from qbittorrent import Client _logger = logging.getLogger(...)This way your logger is independent on whether you’re using it from the command line (with main) or not (with an import).
QB_PASSWORD
Same thing with all the
QB_variables IF they don’t change, you can put them globally for such a module, like_QB_PASSWORD = ...and use it everywhere if your module were to change in the future. But only if the variables are constants across the usage of the script.a40124291102d
Last but not least, use argparse if you can, it’s a simple module to handle command-line arguments. I guess that the container ID can change, you can either detect it with the subprocess module, or write
def get_current_forwarded_port(container_id = "a40124291102d"):or use argparse. Feel free to ask if argparse if too weird, but it’s the best module out there and it’s built-in.TL;DR:
- change logFilePath, what if I don’t have a filesystem or a hard drive?
- change logDateTime and “message”, what if I (the user of your script) want another format?
- change qbConfigUrl to be configurable, what if I use your script on a weird custom Linux or a BSD, or macOS or Windows?
Anyway, great job, writing weird stuff for my own needs is how I started coding. Have fun.
6nk06@sh.itjust.worksto
Programming@programming.dev•Kinda proud of this python script I wrote
7·3 days agoMake the logger a global variable. This may be the only case where its acceptable to be global. And remove the log function. You can call the logger directly.
Also wrap the main code (after BEGIN SCRIPT) in a main function.
Last but not least log everything to the standard output (logging should do that by default), or configure the path in main(), it’s cleaner. If you log to stdout, the shell can redirect the logs to any path like
python script.py > mylogs.txt
What is the value of x in the Good example before the loop?
6nk06@sh.itjust.worksto
Programming@programming.dev•Fresh CKS (and CKA) tips and takeaways
1·6 days agoThat’s annoying. Don’t do that.
6nk06@sh.itjust.worksto
Technology@piefed.social•Really Simple Licensing (RSL) for AI spec 1.0 Now an Official Industry Standard with New Capabilities as Momentum Accelerates
2·6 days agothe AI-first Internet
What about human first? How do I disconnect from their shitty internet?
6nk06@sh.itjust.worksto
Programming@programming.dev•Ruby Is Not a Serious Programming Language
141·10 days agoYep, it’s trash.
6nk06@sh.itjust.worksto
Programming@programming.dev•Ruby Is Not a Serious Programming Language
252·10 days agoPaywalled clickbaity trash of an article.
6nk06@sh.itjust.worksto
Linux@programming.dev•Linux Kernel 6.19 Will Introduce the Terminus 10x18 Console Bitmap Font
16·10 days agoHe wants pixels instead of fonts I guess. Not the sharpest drawer in the toolbox.
6nk06@sh.itjust.worksto
Saturday Morning Breakfast Cereal [Moved to discuss.online]@midwest.social•Community Move
7·16 days agoNo opinion. Thanks for your work!
Same, except I prefer the raptors in Jurrasic Park.
6nk06@sh.itjust.worksto
Programmer Humor@programming.dev•JPEG XL is Dead. Long Live JPEG XL
133·21 days agoGiven these positive signals
Those idiots waited for 4 years because they followed the hype of the moment. I’m glad I removed Google from my life.
I wouldn’t use this and most people will forget that it exists. Most of the time you have do use the language and avoid hacks like that.
Don’t you have alternatives in Dart?
6nk06@sh.itjust.worksto
Fediverse@lemmy.world•Will lemmy add live stream feature so that i can stream football cup for free for everyone? And thus this platform will grow more?English
2·23 days agoLearn Rust and fork this, it’s easy https://github.com/LemmyNet/lemmy
6nk06@sh.itjust.worksto
Not The Onion@lemmy.world•Fact check: Is Mamdani introducing Arabic numerals to New York schools?English
50·26 days agoIn universities for computer science they must learn the teachings of the muslim https://en.wikipedia.org/wiki/Al-Khwarizmi, that’s disgusting.
6nk06@sh.itjust.worksto
Patient Gamers@sh.itjust.works•A community dedicated to 30+ gamers.
151·26 days agoA nonprofit with a vetting process and weekly meetings is way too complex and/or serious for me. But good luck anyway.
6nk06@sh.itjust.worksto
Linux@programming.dev•I just wanted to compare FOSS Linux budgeting software
5·30 days agoAbout what?
6nk06@sh.itjust.worksto
Linux@programming.dev•I just wanted to compare FOSS Linux budgeting software
33·30 days agoI’m a lazy bastard and I don’t self host for a lot of reasons. I use Actual because it’s close to the old YNAB and has a desktop version (AppImage, I know it sucks, I don’t care).
It has a list of transactions, and a budget with envelopes. That’s all I need and it’s fine.
As for the others:
- Firefly wants me to use Docker, I don’t have time for that and I don’t have a server
- Homebank has a weird dev process on launchpad, no releases, and wants me to disable uBlock Origin, fuck it
And the slop is the reason I don’t use YouTube anymore. People seem to enjoy that dead internet because it looks like TV.

Some people say that HFT is about small optimizations and avoiding copies. You can do that if you have a deep knowledge of C++.
Or try something like QuantLib, it is a tradings’ library that I used aeons ago in some stock market company. https://www.quantlib.org/
They have a book too https://www.quantlibguide.com/A taste of QuantLib.html and Python bindings.