Using Python, How can I create a bot/script that let’s me re-post a subreddit’s post to Lemmy?
Just wanted to do a simple little project to practice my programming skills.
I just need to know the outline/backbone of things I should know to do this project.
Why does everybody wants to use python 😔
It’s easy to learn, has many packages, one of the most well known languages
easy to learn yeah ig. But for anything more than a simple 1 file organized script is not (easily) doable. I dont even want to start with the indentations. Yeah many packages :) But why? Because like half of vanilla stuff from other languages cant be done without it. Most known? Most started to learn language. Those “script” kiddies count in there too. I have to work with it everyday and i dont know how such bs could ever been created from a sane person.
Most of it is personal opinion and will spark like html is not a programming language some heated discussions here.
A project that is seperated in different files is as difficult as in C(++), Java or Rust. Regarding the itendation I agree, but that’s personal preference. What ‘vanilla’ stuff can’t you do without libs?
I can’t speak for everybody, but I found python easier to understand than the other language I tried (C++).
Also, python has Pandas which was really good because my initial track was related to data scientist.
Really? You hate python but recommend typescript? All the problems you cited about python are there, too!
Garbage stack traces that go through a hundred lines of node modules.
Dependency hell. Peer deps. Npm or yarn? An ecosystem where packages have a half life of weeks. A new major version of node comes out literally every six months. SIX MONTHS. MAJOR VERSION CHANGE. And you complained about python2 vs 3!
Typescript also has a garbage debugger compared to python.
There’s also just too many ways of doing things because the standard lib is thin. How many ways to loop over an object are there? For in, for each, object keys, lodash, underscore, object.entries, what am I forgetting?
Newer versions have stuff in the standard lib like Array.at, but if you’re targeting an older browser that won’t work unless you enter the wonderful world of transpiling and polyfills. And you thought virtualenv was bad??
And let’s not forget the language’s obsession with being async, even when you don’t expect or want it. How many hours have been lost because someone forgot to await response.json()?
Oh right and remember how there’s like six ways of declaring a function. The function keyword, when it’s in a class, and like four variations on arrow function syntax. And arrow functions are different than ones with the function keyword.
And lots of other little weird gotchas like
const foo = "hello";
const bar = { foo: "world"};
Go on. What do you think that object key is? The syntax is insane . You need to do { [foo]: “world”} to reference a variable as a key. Which looks like a list. Because typescript/javascript is kind of bad.
Typescript is used in the browser because that’s the only thing really supported there for front ends. It’s a horrible tool for anything else.
It’s a widely supported language with comparably fewer gotchas and foot guns.
Ohh you got python3 installed but this script is only for python2. Oh no you want a specific version of a package you gotta create a fucking venv for it! And hope that you dont forget next time you start :) Oh you renamed a variable of a class. You gotta catch them all! With the (sorry) worst error messages i have ever seen. You can still delete system32 with it.
Almost every language has versions. Python’s is fairly stable. Python2 has been end of life for a few years now, and I don’t think there’s a python 4 even on the horizon.
Almost every language has dependency management. Use an IDE.
Use an IDE with refactor->rename. I’ve never had a problem with renaming. Right now when I went to see what it would do, it suggested correctly “did you mean [correct variable name]?”. But even without that it just says my class has no attribute with the incorrect name, which is about what I would expect. If you think these are bad error messages you should stay away from JavaScript.
Most languages running as admin can delete files. I don’t see how that’s a relevant critique of python.
I have such mixed emotions about Python. I have to concede its uses. Especially when working with data and data scientists. A lot of people use it. There is a good amount of existing code floating around that can be re-used, etc. Its never the first language I reach for, but I have to accept that a lot of people use it.
But OMG, I have had to re-install my OS more than once due to python versioning issues. Not recently sure, I think I have it figured out now with virtualenv and pyenv, but it literally has caused me to reformat twice after getting too deep into dependency version mismatch hell.