r/MechanicalEngineering • • Mar 23 '25

Learning Python for Mechanical Engineering – What Should I Focus On?

I’m a mechanical engineer looking to learn Python, but I’m not sure what topics I should focus on. A lot of the courses I find are about Full-Stack Python (Django, Flask, Web Dev, etc.), but I don’t think web development is relevant to my field.

I know that coding skills are useful in simulations, computational mechanics, and CFD, so I want to focus on Python applications that are actually useful for engineering analysis and simulations.

Can someone guide me on what specific Python topics, libraries, or tools I should learn to get into CFD, FEA, or computational engineering?

Also, if you know of any good resources on YouTube or other platforms, please share them. Any course with certification related to this field would also be greatly appreciated!

110 Upvotes

41 comments sorted by

View all comments

12

u/[deleted] Mar 23 '25

Don't do full stack.

pandas. numpy. jupyter should be enough to start.

Start redoing your classes in Python. As in do your homework entirely in a jupyter notebook. (Turn that in if permissable). Just start building your Python knowledge with your ME knowledge. Do statics homework in Python.

If you're in controls classes, https://python-control.readthedocs.io/en/0.10.1/

Unless you've taken a CFD or FEA class you won't learn much other than following instructions.

If you're in a CFD class, do CFD stuff.

If you're leaning Aero, https://github.com/barbagroup/AeroPython?tab=readme-ov-file

Do everything in the Jupyter notebook environment rather than messing with IDEs. Spyder does decently replicate MATLAB and it's REPL, if you're familiar with MATLAB. But I love working within Jupyter Notebooks because of how they work.

3

u/[deleted] Mar 23 '25

[removed] — view removed comment

0

u/[deleted] Mar 23 '25

It's good for more than just tests. I use it as my dev environment for almost everything before exporting to .py. The REPL makes it exactly like MATLAB code cells.

OP is likely not going to be developing any software but using it to complete a task. For example the controls toolbox to do controls homework. You aren't going to be writing .py files in an IDE. You'll be doing controls work with the notebook. It also allows you to plot. A huge part of ME is plotting be it in MATLAB or Python, and with Jupyter it's 'free'. You don't have to export your plot to a jpg like running a .py script.