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 @@ -113,11 +113,8 @@ Executing the else clause.
113
113
## Writting a simple CIL script
114
114
* We write scripts in order to reuse it multiple times.
115
115
* In python you see '__ ' double underscore aka dunder.
116
- * Create a script greetings.py
116
+ * Create a script greetings.py and fun.py
117
117
```
118
- [raukadah@ironman python-workshop]$ python3 fun.py
119
- Welcome FOSS MEET
120
- the value of __name__ is greetings
121
118
[raukadah@ironman python-workshop]$ cat greetings.py
122
119
#!/usr/bin/python3
123
120
import sys
@@ -129,14 +126,21 @@ def greeting(name):
129
126
if __name__ == "__main__":
130
127
name = "Chandan Kumar"
131
128
greeting(name)
129
+
130
+ [raukadah@ironman python-workshop]$ python3 greeting.py
131
+ Welcome Chandan Kumar
132
+ the value of __name__ is __main__
133
+ ```
134
+ ```
132
135
[raukadah@ironman python-workshop]$ cat fun.py
133
136
#!/usr/bin/python3
134
137
135
138
import greetings
136
139
137
140
greetings.greeting('FOSS MEET')
141
+
138
142
[raukadah@ironman python-workshop]$ python3 fun.py
139
143
Welcome FOSS MEET
140
144
the value of __name__ is greetings
141
- [raukadah@ironman python-workshop]$
142
- ```
145
+ ```
146
+ * Observe meaning of ` __name__ ` and ` __main__ ` .
You can’t perform that action at this time.
0 commit comments