

There are no block-local variables in Python. ThisĮxample was designed to also teach you something about variable scoping: Will print out only one number - no, not 23, but rather 25. Will do what you would expect: it prints out the numbers 1, 16 andĢ5 each on a line of its own. Languages use either braces or keywords likeĭo.end for this). One thing you have to know when working with Python is that
#SIMPLE SCIDAVIS TUTORIAL HOW TO#
The language before discussing how to do this. Those not familiar with Python, we will give a short introduction to Single expressions (for instance, if:/else: decisions based on theĬurrent row number). This point if you can use more complicated column formulas than just If you are already familiar with Python, you might ask yourself at Number), sr (start row), er (end row) and self (the table to which theĬolumn being computed belongs see below for what you can do with it). Variables: i (the row currently being computed), j (the column In Note windows, with the additional advantage of some pre-defined These work just like evaluating expressions
#SIMPLE SCIDAVIS TUTORIAL CODE#
You can freely mix text and calculations within a Notes window.Īnother particularly handy place for using Python code areĬolumn formulas. The advantage of onlyĮxecuting/evaluating single lines or selections on request is that Pressing Shift+F1 while in this menu will give you a shortĭescription of the current function. Will have immediate access to a huge number of interestingįunctions, browseable via the sub-menu "Functions" of the context Stating (to general astonishment), that the result of evaluating Mathematical expression on a line of its own - say, You can also use Notes windows as a handy calculator. You can also enter more complex code fragments, such as function orĬlass definitions, in which case you have to select the whole code Congratulations, you've made contact with Python! The string "Hello World!" should appear below the Position the cursorĪnywhere on this line and press Ctrl+J, or select "Execute" from Of SciDAVis has been compiled without Python support). Selecting the menu point Scripting->Scripting Language andĭouble-clicking on "Python" in the resulting dialog (if the dialogĪppears, but does not contain the "Python" item, your installation


Make sure your current project uses Python as its interpreter by
