P Retondo Posted January 20, 2016 Share Posted January 20, 2016 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? Quote Link to comment
Vectorworks, Inc Employee PVA - Admin Posted January 20, 2016 Vectorworks, Inc Employee Share Posted January 20, 2016 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. Quote Link to comment
P Retondo Posted January 21, 2016 Author Share Posted January 21, 2016 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? Quote Link to comment
Vectorworks, Inc Employee PVA - Admin Posted January 21, 2016 Vectorworks, Inc Employee Share Posted January 21, 2016 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. Quote Link to comment
P Retondo Posted January 21, 2016 Author Share Posted January 21, 2016 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. Quote Link to comment
P Retondo Posted January 21, 2016 Author Share Posted January 21, 2016 (edited) 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 January 21, 2016 by P Retondo Quote Link to comment
Mark Flamer Posted January 26, 2016 Share Posted January 26, 2016 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.