ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Python
Study Of Landvibe
made by ???
??? ??
Module
Exception
Outline
1. Module & Package
2. Exception
Module
?? : ?? ??? ?? ??? ?? ??
??? : ?? ??? ??? ?? ? ?? ??? ???? ?? ???
?? : ??, ??? ?? ???? ???? ??(.py)? ???? ???? ?
??? ??? ? ?? ?? ?? ???? ??
Don¡¯t Repeat Yourself!
>>> ¡°?? ??? ???? ???? ??¡±
?? ???
?? : ?? ??? ?? ??? ?? ??
??? : ?? ??? ??? ?? ? ?? ??? ???? ?? ???
?? : ??, ??? ?? ???? ???? ??(.py)? ???? ???? ?
??? ??? ? ?? ?? ?? ???? ??
Don¡¯t Repeat Yourself!
>>> ¡°?? ??? ???? ???? ??¡±
?? ???
Module
Module
?? ??? ??? ?? ? ?? ??? ???
? ?? ???? ?? .py ??
1. ??? ??
Module
?? ??? ??? ?? ? ?? ??? ???
? ?? ???? ?? .py ??
1. ??? ??
?? ?? : Method
Module
?? ?? : Attribute
?? ??? ??? ?? ? ?? ??? ???
? ?? ???? ?? .py ??
1. ??? ??
?? ?? : Method
Module
?? ?? : Attribute
?? ??? ??? ?? ? ?? ??? ???
? ?? ???? ?? .py ??
1. ??? ??
?? ?? : Method
??? : Class Name
Module
?? ??? ??? ?? ? ?? ??? ???
? ?? ???? ?? .py ??
1. ??? ??
?? ?? : Method1
?? ?? : Attribute1
??? : Class1
?? ?? : Method2
?? ?? : Attribute2
??? : Class2
?? ?? : Method3
?? ?? : Attribute3
??? : Class3
.py ??
Module
???? ?? ??? ?? ?? ?? ??
2. package
??
???
Module
import <???>
from <???.???> import <???, ???, ??>
from <???.???> import <???, ???, ??> as <alias name>
2. ?? ????
BasicPracitce/fibo.py
BasicPracitce/ModuleEx.py
Module
__name__ : ?? ?? ??? ??? ??? ?? ??, ?? ??? ???
?? ¡°__main__¡±? ????
2. ?? ????
BasicPracitce/ModuleEx.py
Module
sys ?? ????
python <??.py> <argv¡­> : ??.py = argv[0], argv? array
2. ?? ????
Exception
?? ??, ??? ?? ?? ?? ????? ???? ? ???? ?
1. ?? (Errors)
Exception
?? ?? ?? ??? ???? ??
2. ?? (Exception)
??? ??
https://docs.python.org/3.2/library/exceptions.html
??? ??? ??? ??? ??? ??? ????.
> ??? ??? ?? ?? ???? ???? ?????.
Exception
try:
<?? ?? ???? ?? ??>
except <?? ??> :
<?? ?? ??>
except (??1, ??2) :
<?? ?? ??>
except <??> as <??> :
<?? ?? ??>
else:
<??? ???? ?? ??, ??? ??>
finally:
<?? ?? ??? ???? try ?? ??? ??? ??>
3. ?? ??
Exception
3. ?? ??
??
Exception
3. ?? ??
??
Exception
3. ?? ??
??
Exception
3. ?? ??
?? ??!
Exception
4. raise ??
raise [Exception] : ?? ??? ??????.
raise [Exception(data)] : ?? ?? ? ?? ???? ?????.
raise : ??? ??? ??? ?????.
5. ??? ?? ??
Exception ??? ???? ??
class ExceptionName(Exception):
pass
Exception
4, 5. raise, ??? ?? ??
??
??? ??
?????!

More Related Content

Viewers also liked (9)

Python 01
Python 01Python 01
Python 01
Dasom Im
?
??? ??? ??? intro
??? ??? ??? intro??? ??? ??? intro
??? ??? ??? intro
?? ?
?
Python if loop-function
Python if loop-functionPython if loop-function
Python if loop-function
?? ?
?
Python codelab3
Python codelab3Python codelab3
Python codelab3
?? ?
?
Python(basic)
Python(basic)Python(basic)
Python(basic)
POSTECH
?
Python datatype
Python datatypePython datatype
Python datatype
?? ?
?
Effective response to adverse weather conditions using SolarPulse
Effective response to adverse weather conditions using SolarPulseEffective response to adverse weather conditions using SolarPulse
Effective response to adverse weather conditions using SolarPulse
MachinePulse
?
????? ??? ?? ??? ???? (Introduction to big data and use cases)
????? ??? ?? ??? ???? (Introduction to big data and use cases)????? ??? ?? ??? ???? (Introduction to big data and use cases)
????? ??? ?? ??? ???? (Introduction to big data and use cases)
Wonjin Lee
?
??? ??? ??? intro
??? ??? ??? intro??? ??? ??? intro
??? ??? ??? intro
?? ?
?
Python if loop-function
Python if loop-functionPython if loop-function
Python if loop-function
?? ?
?
Python codelab3
Python codelab3Python codelab3
Python codelab3
?? ?
?
Python(basic)
Python(basic)Python(basic)
Python(basic)
POSTECH
?
Python datatype
Python datatypePython datatype
Python datatype
?? ?
?
Effective response to adverse weather conditions using SolarPulse
Effective response to adverse weather conditions using SolarPulseEffective response to adverse weather conditions using SolarPulse
Effective response to adverse weather conditions using SolarPulse
MachinePulse
?
????? ??? ?? ??? ???? (Introduction to big data and use cases)
????? ??? ?? ??? ???? (Introduction to big data and use cases)????? ??? ?? ??? ???? (Introduction to big data and use cases)
????? ??? ?? ??? ???? (Introduction to big data and use cases)
Wonjin Lee
?

Similar to Python module (20)

Python class
Python classPython class
Python class
?? ?
?
Common cartridge ???
Common cartridge ???Common cartridge ???
Common cartridge ???
Se Joung Kim
?
Java, android ???2
Java, android ???2Java, android ???2
Java, android ???2
Heejun Kim
?
Python class
Python classPython class
Python class
Herren
?
Custom Xcode Template (with VIPER)
Custom Xcode Template (with VIPER)Custom Xcode Template (with VIPER)
Custom Xcode Template (with VIPER)
Bongwon Lee
?
Java class
Java classJava class
Java class
Hyosang Hong
?
Java_05 class
Java_05 classJava_05 class
Java_05 class
Hong Hyo Sang
?
Api design for c++ ch3 pattern
Api design for c++ ch3 patternApi design for c++ ch3 pattern
Api design for c++ ch3 pattern
jinho park
?
Api design for c++ pattern
Api design for c++ patternApi design for c++ pattern
Api design for c++ pattern
jinho park
?
? XE ?? ???? ?? ??? - XECon + PHPFest 2014
? XE ?? ???? ?? ??? - XECon + PHPFest 2014? XE ?? ???? ?? ??? - XECon + PHPFest 2014
? XE ?? ???? ?? ??? - XECon + PHPFest 2014
?? ?
?
Spring di chapter2
Spring di chapter2Spring di chapter2
Spring di chapter2
?? ?
?
Effective java 1 and 2
Effective java 1 and 2Effective java 1 and 2
Effective java 1 and 2
?? ?
?
??????? ?? ??? ????????
???????  ?? ??? ???????????????  ?? ??? ????????
??????? ?? ??? ????????
Yong Joon Moon
?
????? 1~13
????? 1~13????? 1~13
????? 1~13
Shin heemin
?
Head first????? 1~13_??_??
Head first????? 1~13_??_??Head first????? 1~13_??_??
Head first????? 1~13_??_??
HoJun Sung
?
Java ???? ed11
Java ???? ed11Java ???? ed11
Java ???? ed11
hungrok
?
Java, android ???1
Java, android ???1Java, android ???1
Java, android ???1
Heejun Kim
?
12books
12books12books
12books
cheongwonseo
?
Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web Components
EunYoung Kim
?
Python class
Python classPython class
Python class
?? ?
?
Java, android ???2
Java, android ???2Java, android ???2
Java, android ???2
Heejun Kim
?
Python class
Python classPython class
Python class
Herren
?
Custom Xcode Template (with VIPER)
Custom Xcode Template (with VIPER)Custom Xcode Template (with VIPER)
Custom Xcode Template (with VIPER)
Bongwon Lee
?
Api design for c++ ch3 pattern
Api design for c++ ch3 patternApi design for c++ ch3 pattern
Api design for c++ ch3 pattern
jinho park
?
Api design for c++ pattern
Api design for c++ patternApi design for c++ pattern
Api design for c++ pattern
jinho park
?
? XE ?? ???? ?? ??? - XECon + PHPFest 2014
? XE ?? ???? ?? ??? - XECon + PHPFest 2014? XE ?? ???? ?? ??? - XECon + PHPFest 2014
? XE ?? ???? ?? ??? - XECon + PHPFest 2014
?? ?
?
Spring di chapter2
Spring di chapter2Spring di chapter2
Spring di chapter2
?? ?
?
Effective java 1 and 2
Effective java 1 and 2Effective java 1 and 2
Effective java 1 and 2
?? ?
?
Head first????? 1~13_??_??
Head first????? 1~13_??_??Head first????? 1~13_??_??
Head first????? 1~13_??_??
HoJun Sung
?
Java ???? ed11
Java ???? ed11Java ???? ed11
Java ???? ed11
hungrok
?
Java, android ???1
Java, android ???1Java, android ???1
Java, android ???1
Heejun Kim
?
Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web Components
EunYoung Kim
?

Python module

  • 1. Python Study Of Landvibe made by ??? ??? ?? Module Exception
  • 2. Outline 1. Module & Package 2. Exception
  • 3. Module ?? : ?? ??? ?? ??? ?? ?? ??? : ?? ??? ??? ?? ? ?? ??? ???? ?? ??? ?? : ??, ??? ?? ???? ???? ??(.py)? ???? ???? ? ??? ??? ? ?? ?? ?? ???? ?? Don¡¯t Repeat Yourself! >>> ¡°?? ??? ???? ???? ??¡± ?? ???
  • 4. ?? : ?? ??? ?? ??? ?? ?? ??? : ?? ??? ??? ?? ? ?? ??? ???? ?? ??? ?? : ??, ??? ?? ???? ???? ??(.py)? ???? ???? ? ??? ??? ? ?? ?? ?? ???? ?? Don¡¯t Repeat Yourself! >>> ¡°?? ??? ???? ???? ??¡± ?? ??? Module
  • 5. Module ?? ??? ??? ?? ? ?? ??? ??? ? ?? ???? ?? .py ?? 1. ??? ??
  • 6. Module ?? ??? ??? ?? ? ?? ??? ??? ? ?? ???? ?? .py ?? 1. ??? ?? ?? ?? : Method
  • 7. Module ?? ?? : Attribute ?? ??? ??? ?? ? ?? ??? ??? ? ?? ???? ?? .py ?? 1. ??? ?? ?? ?? : Method
  • 8. Module ?? ?? : Attribute ?? ??? ??? ?? ? ?? ??? ??? ? ?? ???? ?? .py ?? 1. ??? ?? ?? ?? : Method ??? : Class Name
  • 9. Module ?? ??? ??? ?? ? ?? ??? ??? ? ?? ???? ?? .py ?? 1. ??? ?? ?? ?? : Method1 ?? ?? : Attribute1 ??? : Class1 ?? ?? : Method2 ?? ?? : Attribute2 ??? : Class2 ?? ?? : Method3 ?? ?? : Attribute3 ??? : Class3 .py ??
  • 10. Module ???? ?? ??? ?? ?? ?? ?? 2. package ?? ???
  • 11. Module import <???> from <???.???> import <???, ???, ??> from <???.???> import <???, ???, ??> as <alias name> 2. ?? ???? BasicPracitce/fibo.py BasicPracitce/ModuleEx.py
  • 12. Module __name__ : ?? ?? ??? ??? ??? ?? ??, ?? ??? ??? ?? ¡°__main__¡±? ???? 2. ?? ???? BasicPracitce/ModuleEx.py
  • 13. Module sys ?? ???? python <??.py> <argv¡­> : ??.py = argv[0], argv? array 2. ?? ????
  • 14. Exception ?? ??, ??? ?? ?? ?? ????? ???? ? ???? ? 1. ?? (Errors)
  • 15. Exception ?? ?? ?? ??? ???? ?? 2. ?? (Exception) ??? ?? https://docs.python.org/3.2/library/exceptions.html ??? ??? ??? ??? ??? ??? ????. > ??? ??? ?? ?? ???? ???? ?????.
  • 16. Exception try: <?? ?? ???? ?? ??> except <?? ??> : <?? ?? ??> except (??1, ??2) : <?? ?? ??> except <??> as <??> : <?? ?? ??> else: <??? ???? ?? ??, ??? ??> finally: <?? ?? ??? ???? try ?? ??? ??? ??> 3. ?? ??
  • 21. Exception 4. raise ?? raise [Exception] : ?? ??? ??????. raise [Exception(data)] : ?? ?? ? ?? ???? ?????. raise : ??? ??? ??? ?????. 5. ??? ?? ?? Exception ??? ???? ?? class ExceptionName(Exception): pass
  • 22. Exception 4, 5. raise, ??? ?? ?? ??