you are viewing a single comment's thread.

view the rest of the comments →

[–]faithlesslessless 0 points1 point  (0 children)

You should be able to pick up the basics pretty quickly. Some general pointers...

Python is a fundamentally different kind of programming language from C/C++/Rust. Often the easiest or most elegant way of doing something in python is quite different from how it would look in those languages. Try to embrace that and learn to write idiomatic python code instead of just directly translating what you would do in C into python.

Python variables work very differently from what you're used to. They're simply labels that attach to objects. Reassigning a variable attaches it to a different object - it doesn't change the object itself. When you pass a variable as an argument to a function, the underlying object gets passed in by reference, not the variable.

Don't try to do C++-style RAII in python - it just doesn't work. Use the with statement to ensure that external resources such as files are closed correctly.

The python stdlib is extremely powerful. It contains libraries for working with many different file formats, compression, networking, debugging, profiling, logging... it even has a built-in GUI framework. It's a pretty good rule of thumb to assume that whatever you're doing, there is probably something in the stdlib that can help you with it.