Salome HOME
Fix theme doc of Eficas.
[modules/eficas.git] / doc / python_rules.rst
1 .. _python-label:
2
3 ===============================
4 rules for python syntax
5 ===============================
6
7 Variable names and identifier are similar to those in many other languages :
8 ----------------------------------------------------------------------------
9
10 * They start with a letter (A_Z or a-z) or underscore "_"".
11 * They are followed by letters, numbers or underscores.
12 * They are case-sensitive.
13 * A string is a sequence of caracters enclosed by a matching pair of single or double quotes.
14
15 Unlike python, the name's length for concept are limited by Eficas to 8 characters.
16
17 Some identifiers are reserved words :
18 -------------------------------------
19
20 * You can't use words of the python language as identifiers.
21 * Eficas itself uses identifiers which become reserved words.  for example you can't use the following word, even if it would make some interesting names:
22         - BLOC, EXCLUS, OPER, ASSD,
23         - EVAL, FACT, FORM, JDC,
24         - REGLE, VALIDATOR, 
25         - ETAPE, ENTITE
26
27 Python's way for  assigning values to variables: 
28 -------------------------------------------------
29
30 * Keep in mind that .comm are python files. The simplest form of assignement is : variable = value
31 * The hash character (#) starts a comment
32 * Tuples are enclosed in parentheses. 
33 * Lists are enclosed in bracked.
34 * In tuples or lists, a ',' follows each item especially the last one.