Flask sqlalchemy One-to-many relationship data

... has talked about the creation of flask sqlalchemy a few days ago, and the most basic usage, today, a one-to-many relationship for the convenience of testing, using The last modified code, this demonstration is the relationship between course and student, a course can correspond to...


Python 4 kinds of read and write file methods

... #encoding:utf-8 """ @project_name = pytest @file = demo_readAndWrite_File.py @author = angel @create_time = 2018/9/22 20:55 """ Import os # import os module Print('current working directory', os.getcwd()) # os.getcwd() method to get the current working directory Os.chdir(r'F:\Data') #...


Using pip encountered error ImportError: No module named packaging.version solution

... Recently in Ubuntu system, both installed python2.7 and python3.5, has set the default to python3.5, modify pip default Use python3, but there is such a pip version problem: [email protected]:~$ pip --version Traceback (most recent call last): File "/usr/local/bin/pip", line 7, in <...


How to become a data analyst for seven weeks

... Write this series, I hope to improve the tutorials for Internet products and operators on the basis of knowing one answer. Regardless of data analysis or data operations, I hope it is a good enough textbook. I admit that I have the title of the party, more accurately, this is a seven...


Rounding off with round()? Python rounds the correct way to open!

... round() function introduction 菜鸟教程 ​​Introduced, the function of round() function is to return the rounding value of floating point number x. The > round( x [, n] ) parameter x, n are numeric expressions, and the return value is the rounded value of x. n is the reserved number of...


pythonDay02

... list, dictionary, collection 1.List: one of the important data types Definition: name=[‘you’,'me','her'] 访:Access name[0],name[1] 片by numbers: Take multiple elements >>> names = ["Alex","Tenglan","Eric","Rain","Tom ","Amy"] >>> names[1:4] #Remove the number between the...


Python data processing skills

... string assignment (passing parameters) skills Python general string assignment is as follows: 1 variable = " Test " 2 print " I just [%s] unit " % variable 3 print " I just [{}] unit " .format(variable) The most basic two ways of writing above, but there are many A kind of skill usage...


Python sort and sorted

... we need to sort the List, Python provides two methods Sorting a given List L, 方法 1. Sorting with List member function sort Method 2. Sorting with built-in function sorted (starting with 2.4) --------------------------------sorted--------------------------------------- >>> help...


"Stupid Methodology Python 3" 31. Make a decision

... 知识点: The focus of this lesson is that you can put an if statement inside the if statement. and Zed's junk game, the machine turned over, unknown, so completely can not get his point. 基础练习: print("""You enter a dark room with two doors. Do you go throgh door #1 or door #2? ///You walk...


Python programming md5 encryption and sha1 encryption

... Python programming message encryption encrypting messages in python, the following is the md5 encryption method and sha1 encryption method: import hashlib def my_md5(value): m = hashlib.md5() m.update(value.encode('utf-8')) return m.hexdigest() def my_sha1(value): m = hashlib.sha1() m...