Jump to content
Developer Wiki and Function Reference Links Read more... ×
Sign in to follow this  
P Retondo

Relationship between Marionette, Python, and standard programming languages

Recommended Posts

I've just taken a quick glance of some Python code shown at the webinar on Monday, and following the presentation with a knowledge of C++ I can see the clear parallels. As a shortcut for me, could someone spell out whether Python uses C++ syntax and structure, or some other language?

Share this post


Link to post

Some parts are similar to C and Java, but some are unique to Python. I do not believe the syntax or structure is directly comparable to either however.

Share this post


Link to post

Thanks for the clarification, Jim. It's too bad Python doesn't follow one of the established models. And, out of curiosity, what is the relationship between Python and Vector Script, and why two macro languages?

Share this post


Link to post

Vectorscript was originally based on Pascal, a language thats pretty much gone. Python was selected as a replacement mostly because of its massive support base from what I understand.

Share this post


Link to post

Makes sense. Guess I should look into Python a bit more. I'm pretty excited about Marionette, seems like a great way to become familiar with the language and to block out a procedure.

Share this post


Link to post

Jim, after looking into it I can see that Python, though not directly compilable, is a programming language, not a macro language. This helps me adjust my approach to following the online demos - I need to stop thinking in C++.

Speaking of which, I asked the question, "how do we know the type of an argument" based on my knowledge of C, where variables are declared with a type, such as "Int". Now I understand that variables in Python are not declared with a type - or at least that appears to be the case from a very cursory look at things. I guess I'll figure out along the way how that works. In C, if you reference the wrong variable type when calling a function, that results in a compiler error that is explicitly called out. Not sure what happens when you plug in a real number in a Python / Marionette function that needs an integer.

Edited by P Retondo

Share this post


Link to post

Python is a "Dynamically Typed" language. Values are typed, not variables. So, you can assign a value of any type to a variable x for example and then later assign a value of a completely different type to x. What this implies is that there is no static type checking during compilation, it is done at run-time. This allows you a lot of freedom in your code. The drawback is that you will not catch these type errors until the program is run.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×