Which Version?

Discussion about scripting with Python
rusty149
Posts: 8
Joined: Fri Nov 18, 2011 3:57 pm

Which Version?

Postby rusty149 » Wed Feb 29, 2012 5:17 pm

Hey Everyone,

I want to start looking into Python Scripting as this is an area that I have not yet explored much in Realflow.

I have been looking at the manual and will go through this, But I have also been looking at Python.org and there is two versions of Python, Which one of these does Realflow use/is best to look at? & Is looking at other python tutorials (I.E not Realflow Specific) a good plan even though it might not be entirely relevent but to get a good basis in Python.

Thanks!
Rusty


User avatar
Otuama
Posts: 1155
Joined: Fri Apr 02, 2010 12:56 am
Location: Swansea
Contact:

Which Version?

Postby Otuama » Wed Feb 29, 2012 10:50 pm

Hi.

If you want to start scripting in Realflow there is no point installing Python 3. I have 2.7.2 installed. *EDIT* Having said that, Python comes built into Rf so you don't have to install python..... but I would because Pythons IDLE is very handy.

Definitely look at other python resources because most, if not all commands can be used within Realflow.

When Python has been installed, in the Python directory > Doc folder there is the Python documentation. This is a great resource. I always use the 'Library Reference' section.

HERE are some great Python tutorials from Bucky Roberts.

-Sean
iCreate Ltd
'Strength does not come from physical capacity. It comes from an indomitable will.' - Gandhi
'What Does Success Look Like?' - iCreate Ltd

rusty149
Posts: 8
Joined: Fri Nov 18, 2011 3:57 pm

Which Version?

Postby rusty149 » Thu Mar 01, 2012 10:09 am

Thanks for getting back to me Otuama! Been thinking about learning this for a while now and it really looks like the way to push Realflow even further!

User avatar
Otuama
Posts: 1155
Joined: Fri Apr 02, 2010 12:56 am
Location: Swansea
Contact:

Which Version?

Postby Otuama » Thu Mar 01, 2012 10:53 am

In the words of Kirk (2009 Star Trek)

'Do it, do it, do it !!! '
iCreate Ltd
'Strength does not come from physical capacity. It comes from an indomitable will.' - Gandhi
'What Does Success Look Like?' - iCreate Ltd

lukeiamyourfather
Posts: 2880
Joined: Mon Oct 15, 2007 4:09 pm
Contact:

Which Version?

Postby lukeiamyourfather » Thu Mar 01, 2012 4:21 pm

RealFlow and many other applications still use Python 2.X though all development has officially ceased on the 2.X code. It wouldn't hurt to familiarize yourself with both Python 2.X and Python 3.X because there are many useful features of Python 3.X outside of RealFlow and eventually everything will transition to Python 3.X (or fade into history).

They are 99.9% the same but there are a few gotchas. For example the print command is now a function like it should have always been. An example is below.

Code: Select all

foo = 'Hello world!'

# Print command in Python 2.X which was always weird
print foo

# Print function in Python 3.X like a normal function
print(foo)

There are other differences but most of them you don't need to worry about yet. Here's a more complete list of the changes (but doesn't show all the new features).

http://docs.python.org/release/3.0.1/whatsnew/3.0.html

User avatar
Otuama
Posts: 1155
Joined: Fri Apr 02, 2010 12:56 am
Location: Swansea
Contact:

Which Version?

Postby Otuama » Thu Mar 01, 2012 11:20 pm

Luke is right about looking at Python3 too. However, as someone learning Python myself, I prefer to only stick with the version which is suitable for my needs. As my need is Python for Realflow, I don't need Python3.

Maybe look into Python3 when you become more confident with Python as it'll be easier to adapt.

It'd be interesting to see whether Python3 will be brought into Realflow.
iCreate Ltd
'Strength does not come from physical capacity. It comes from an indomitable will.' - Gandhi
'What Does Success Look Like?' - iCreate Ltd


Return to “Python-Scripting”

Who is online

Users browsing this forum: No registered users and 1 guest