File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -89,11 +89,8 @@ Executing the else clause.
89
89
## Writting a simple CIL script
90
90
* We write scripts in order to reuse it multiple times.
91
91
* In python you see '__ ' double underscore aka dunder.
92
- * Create a script greetings.py
92
+ * Create a script greetings.py and fun.py
93
93
```
94
- [raukadah@ironman python-workshop]$ python3 fun.py
95
- Welcome FOSS MEET
96
- the value of __name__ is greetings
97
94
[raukadah@ironman python-workshop]$ cat greetings.py
98
95
#!/usr/bin/python3
99
96
import sys
@@ -105,14 +102,21 @@ def greeting(name):
105
102
if __name__ == "__main__":
106
103
name = "Chandan Kumar"
107
104
greeting(name)
105
+
106
+ [raukadah@ironman python-workshop]$ python3 greeting.py
107
+ Welcome Chandan Kumar
108
+ the value of __name__ is __main__
109
+ ```
110
+ ```
108
111
[raukadah@ironman python-workshop]$ cat fun.py
109
112
#!/usr/bin/python3
110
113
111
114
import greetings
112
115
113
116
greetings.greeting('FOSS MEET')
117
+
114
118
[raukadah@ironman python-workshop]$ python3 fun.py
115
119
Welcome FOSS MEET
116
120
the value of __name__ is greetings
117
- [raukadah@ironman python-workshop]$
118
- ```
121
+ ```
122
+ * Observe meaning of ` __name__ ` and ` __main__ ` .
You can’t perform that action at this time.
0 commit comments