Opening part-Environment hypothesis
By: HengStar (Xin Heng)
Address: http://blog.csdn.net/gongxinheng/archive/2009/07/25/4380526.aspx
(Although I am not good at writing or having a high level, it is not easy to write an article and share some small
(Reprinted must indicate the original address and the author "bihai Qing Tian Zhao Liang" and blog address http://blog.csdn.net/theforever)
In the previous section, we talked about the "sublime text hand-written method"
I. Problem Discovery and Proposal
In the method of a python class, to call a method of the parent class, before Python 2.2, the usual method is as follows:
Code Segment 1:
class A: def __init__(self): print "enter A" print "leave A" class B(A):
Some exceptions may occur during program execution, which may exist. For example, when you read a file, the file does not exist. In this case, we can handle exceptions.1. Error
Let's do a simple test. We intentionally write the print method into the
The first is the path and classpath problems.The second is about package and import.
The third is public, protected, Private, static, when to use, why to use, and how to use
The fourth is to create a jar file.
First, the path and classpath
The object concept is the same as that in other languages.
A basic class
#!/usr/bin/pythonclass person: def hi(self,name): print ‘Hello,%s‘%namep1= person()p1.hi(‘lk‘)
[[email protected] python_scripts]# python 12class.py
Here is my understanding. If there is something wrong with me. Please be sure to tell me. Thank you!
In python, __str _ is generally in this format.
Class:
Def _ STR _ (Self ):
Return "this is in Str"
In fact, __str _ is called by the print
An Introduction to Jython
By Mike
Table of contents
IntroductionJava objects and methods in JythonJython import statementsEvent handlingOverloaded Java MethodsClasses in JythonPublic vs. Private VariablesSubclassing and inheritanceSimulating
Is the statistics boring? Is data visualization boring? Is simulated programming boring? You still have to see what people do and how they do it. The following video uses the first-view roller coaster to show us house prices since 1890. There is no
This article does not introduce Ruby's basic syntax much, but only implements Ruby's OO application once. It also records my understanding of Ruby's Oo. In addition, we will not repeat the ruby coding standards here. The written code should follow
In general, a server client that only supports one chat room uses Telnet
Books: Python Data Summary
Python tutorial here is the source code in Chapter 24th. It is used for practice research.
# Coding: utf8 # python2.7 chatser2.py # a slightly more
The inheritance base class is defined as follows: class people:# Define attributeName =''Age = 0# Define private attribute_ Weight = 0Def _ init _ (self, n = "hello", a = 24, w = 45.9 ):Self. name = nSelf. age =Self. _ weight = wDef _ del _ (self
Introduction to five simple principles for building a Python package
This article mainly introduces the five simple principles for building Python packages. As Github's open-source cooperation becomes increasingly popular today, building robust
Python Object-oriented Inheritance, python object-oriented
There is nothing to say. Inheritance mainly refers to inheriting some methods of the parent class. The code is very detailed.
#! /Usr/bin/env python # coding: utf-8class Father (object): #
Detailed descriptions of hook methods in Ruby
This article mainly introduces the detailed explanation of the hook method in Ruby. This article explains what is the hook method, extended, extended, prepended, inherited, and so on in included, Devise,
In both Java and. net environments, there are tools that can extract comments from the code. python is not weak in this regard, so pydoc can do this.
Pydoc is added to its standard library from python 2.1. When we call the help () command in the
Python socket module source code implementation Points Analysis, pythonsocket
BaseServer and BaseRequestHandlerPython improves more advanced encapsulation for network programming. SocketServer. py provides many network services. They are elegantly
Python class instance method, class method, class static method,
The following class definition is used as an example:
# Coding: utf-8class A: count = 0 def _ init _ (self, inst_name): self. inst_name = inst_name self. _ class __. count + = 1 def
MySQL database is a very good open source database, which is widely used. I am no exception, database instance creation, database status detection, database backup, and so on. I am doing repetitive and boring work every day. To reduce the workload,
Python object-oriented, python object-orientedPython object-oriented
Python has been an object-oriented language since its design. As a result, it is easy to create a class and object in Python. This section describes Python Object-Oriented
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.