python self study journal 11 -- classes and objects

1. Write a function move? Rectangle to accept a rectangle object and two values, dx,dy. It should change the position of rectangle by adding the x coordinate of dx to corner and the y coordinate of Dy to corner Because this exercise involves many previous examples and exercises, if you don't write them out, you may not understand them, so write ...

Posted on Tue, 12 Nov 2019 10:20:31 -0500 by acke1976

School transfer to our class, so I used Python to climb her space!

Development environment: win7 python3.5,MySQL5.7 Editor: pycharm2017.1,ipython,Navicat for mysql Required python third-party libraries: selenium,PIL,Requests,MySQLdb,csv,pandas,numpy,matplotlib,jieba,wordcloud In addition, the headless browser PhantomJS is also used. Main ideas: I. use selenium+phantomjs to log in qq space to get cookies and G ...

Posted on Sat, 02 Nov 2019 16:35:58 -0400 by nileshn

Python 3 basic exchange values of two variables

       Python : 3.7.3          OS : Ubuntu 18.04.2 LTS         IDE : pycharm-community-2019.1.3       Conda : 4.7.5    typesetting : Markdown   code coder@ubuntu:~$ source activate py37 (py37) coder@ubuntu:~$ ipython Python 3.7.3 (default, Mar 27 2019, 22:11:17) Type 'copyright', 'credits' or 'license' for more information IPython 7.5 ...

Posted on Sat, 02 Nov 2019 02:26:49 -0400 by terfle

Summary of python -- time datetime

[TOC] Summary of python -- time datetime time basic import time time.time() Out[3]: 1561107970.0175698 # time stamp time.localtime() Out[4]: time.struct_time(tm_year=2019, tm_mon=6, tm_mday=21, tm_hour=17, tm_min=6, tm_sec=20, tm_wday=4, tm_yday=172, tm_isdst=0) # Local time with format time.struct_time time.gmtime() Out[5]: time.struct_time( ...

Posted on Fri, 01 Nov 2019 06:28:37 -0400 by phpcoder24july

python self study journal 8 -- tuple

When encountering a problem, it is the way to solve the unknown problem to grab the key information and transform it into the function method you have mastered. 1. Write a function sumall to receive any number of parameters and return their sum If sum(1,2,3) is written, an error will be reported: sum expected at most 2 arguments,got 3 To accept ...

Posted on Wed, 30 Oct 2019 06:16:57 -0400 by neverett

python self study diary 6 - List

It's better to record yourself or observe others' thinking from mistakes to right when learning python than only seeing the right answers 1. Write a function to receive a list of numbers and return their cumulative sum. For example, the cumulative sum of [1,2,3] is [1,3,6] See sum and think of the built-in function sum(t) used earlier, but sum ...

Posted on Thu, 24 Oct 2019 10:24:20 -0400 by abbe-rocks

python self study Journal 4-string

1.for cycle Loop through characters with for Since I haven't used the for loop for a long time, I'm a bit rusty, so I wrote the following code. fruit='banana' len(fruit) index=0 for index<len(fruit): print(fruit[index]) index+=1 File "<ipython-input-2-f904b63b5686>", line 3 for index<len(fruit): ^ SyntaxError: inval ...

Posted on Tue, 22 Oct 2019 06:07:22 -0400 by jetskirich

An article to configure Neovim

If you don't speak much, first picture above This is our vim configuration. Because of my technical comparison, if it's a big God, please give me more advice. If it's a small white, I'll take you to my level of neovim. 1. First, we complete the configuration Foundation I'm a manjaro user. We can I ...

Posted on Sun, 20 Oct 2019 13:01:51 -0400 by psytae

Python Data Analysis Lesson 03: Introduction to NumPy Notes

Article directory NumPy's Processing of Vectors Efficiency comparison numpy array Create multidimensional arrays Select array elements numpy data type Data Type Conversion Data type object Character encoding Attributes of type class Create custom data types Array and scalar operations Index and Slic ...

Posted on Fri, 04 Oct 2019 14:44:22 -0400 by dizel247

Python basic data structure & operator & input and output

Python Basic Data Type - Numeric Type 233 # int 233 2.33 # float 2.33 '233' #str '233' type(233)#View Variable Types int type(233.0) float type('2.33') str isinstance(233,int)#See if the variable is the guess type insinstance (variable, guess type) True isinstance(233,float) False isin ...

Posted on Mon, 30 Sep 2019 13:58:13 -0400 by qo2o