Continue to my Python journey
Python really makes me love and hate. Although I still think Scala is better than it today, but currently Scala is slow and Python is a leap. (Even the Scala link on the previous 51CTO Development page is canceled ...) It is also a coincidence that Python has encapsulated a set of Selenium frameworks in Java. A month ago, I suddenly received a phone call from a training company and asked if I was interested in Selenium. Now I have a free course. Adhering to the "Traditional Ideology" of Chinese people, we always need to take a look at it for free, and the content the teacher talks about is exactly Python. At first, I was in conflict, but I had to write Python to learn it. There are still some basic skills, and learning is still fast. Of course, occasionally, you don't have to worry about indentation to distinguish the useless self in code blocks, elif, and class method parameters. Gradually, I also discovered its advantages: script, that is, direct use of classes without sealing, which is very convenient for testing. Before you think about it, use java to test an interface temporarily. You must first stick the previously written class and then write a main class call. eclipse is also essential... Now a urllib2 task is completed in minutes, and IDE does not need to be opened. (Although java can also use command lines, the trouble is self-evident.) In addition, the [:-1] Method of Python for string segmentation is as magic! Supports the win32 message mechanism to better implement the functions I want. Basically, the three lines of Python solve the problem of more than a dozen lines of Java content. At this time, Python gives me the feeling that it is much, fast, good, and easy to learn, and the installation module begins to make me hate it. Install a module in Java and copy the Jar package to the project directory. In most Python, pip or easy_tools is required. What's more, some modules have to install VS2008 (not even vs2010! It's abnormal !) I encountered this kind of situation one day. It was really 10 thousand tons of grass mud horse in my heart! In addition, there are new classes and old classes in the chaos governance of Python. Because after Python 2.2, classes inherit the object base class as new classes, otherwise they are old classes, the difference lies in Multi-inheritance (introduced later in this article). In version 3.3, all of them implicitly inherit the object base class. I just want to say, "I rely on it, what have you done before!" Python3.3 is basically an independent version, which is very different from 2.x. Even print 3.3 must be enclosed in brackets and has poor compatibility with modules! So much of the current version is still 2.X my Python path. It is so painful and happy that at least it will not hurt to learn more, the only downside is that you always forget to define the variable type when writing Java code.