13.07.2015 Views

Analysis of Structures - Baustatik-Info-Server

Analysis of Structures - Baustatik-Info-Server

Analysis of Structures - Baustatik-Info-Server

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2Basics in Python2.1 Reserved WordsWe have seen in section 1.3, starting with a Python calculation within the Python shell is very easy. Wecan use simple formulas with numbers or we can use symbolic names to make it more readable. InPython like in other programming languages there are some reserved word, which are used to build upthe language. This words can not be used as variable names.The reserved words <strong>of</strong> the Python language are the following.and del from not whileas elif global or withassert else if pass yieldbreak except import printclass exec in raisecontinue finally is returndef for lambda tryIf you want to use such a word it’s recommended to extent the name with an underscore, like vor examplebreak_ instead <strong>of</strong> break.2.2 Packages and ModulesA package within Python is a container <strong>of</strong> s<strong>of</strong>tware objects, global variables, functions and objects. In Cor Fortran, a package could be termed as library.Packages should be imported into the Python session or into the Python source file, if external featureshould be used. A typical package import is the import <strong>of</strong> the mathematical package. This is necessaryif you want to call some basic mathematical functions like trigonometric functions or the square root. Ifsuch a package is not imported, it’s objects, especially it’s functions, are unknown and can not be used.Packages are like header includes within the C language. In C as well, external functions, whose headersare not included, are unknown and can not be called.13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!