Learning Python for Ansys and Beyond

Figure 1: Colab by Google

Ansys has ACT extension where users can do some customization using a popular programming language called Python. The barriers to learning Python is now much lower but I'm still stumped by Object Oriented Programming. Hopefully this post would be useful to those who fit the following demographics:
  1. Knows simple programming concepts like loops and functions
  2. Understand some Calculus

Side Notes on Ansys ACT Before You Begin
Ansys uses IronPython 2.7 which is an implementation in the .NET framework. Unfortunately, as I understand it, some libraries such as NumPy are difficult to install.

Colaboratory Research by Google (Fig 1) is a neat tool. All you need is a free Google account and you can execute Python scripts in the browser. No installation required! It has Jupyter notebook running in the background and allows both Python 2 or Python 3. While NumPy and Matplotlib is already installed by default, you could install other libraries using !pip install. All notebooks are saved into Google Drive.

Basic Introduction
This very well written Very Basic Introduction to Scientific Python Programming is a great 30 page read to get up to speed. It bridges concepts of programming from math quickly.

Python.org Tutorial
The official tutorial is a bit dry but worth going through quickly especially for Data Structures, Modules and Exceptions.

Automate the Boring Stuff with Python
This free book is a gem for putting Python to use in our every day work-life. Although it is a little sparse as an introduction to Python, it has many valuable step-by-step tricks on specific tasks.

Classes and Object Oriented Programming (OOP)
After trying to learn the concept from different sources, I found Chapter 7 and 10 of Primer on Scientific Computing with Python by Hans Petter Langtangen to be very refreshing. He provided a good numerical problem and attacked it conventionally, pointing out the difficulties and offered OOP as a better solution. It finally clicked for me.

Best of luck!


  1. David Beazley's Youtube videos on python are one of my favorites.


Post a Comment

Popular posts from this blog

ANSYS User Defined Results

Export Stiffness Matrix from Ansys

ANSYS APDL Syntax Highlighting editor