Blog : Maya Python

Wanted to share some of the Maya Python code snippets here.. 
How to get mesh vertex position through Maya API

Sometime back, I was in need of getting the vertex position, through Maya API.
Then I have written the one, which suits my requirement. Here is the code:

How To Write If Statement In One Line In Maya Python
Suppose if we need to create a group (PyNode) when it doesn't exists else we need to get variable for that node if it already exists. How to get this in one line? Let us test this in Maya with Python.
Instead of writing in 4 lines, let us do it in one line ! Here goes the code :