Client and Server for Simple File Transfer

Before doing this program, we should first understand the pack and unpack functions in struct module, which can be translated for reference.Strct. pack and struct.unpack Simply put, struct.pack ('i', int) packages integer data into bytes Strct. unpack ('i', bytes) can decompose bytes'packets into tuples ...

Posted on Wed, 02 Oct 2019 03:23:19 -0700 by Mikemcs

Python Road [Article 27]: web Server django

Django I. web Framework Framework, real-time framework, refers to the binding support structure designed to solve an open problem. Using framework can help you develop specific systems quickly. In short, it is to use the stage built by others to perform your talents. For all web applications, it is essentially a socket server, and the user's ...

Posted on Wed, 02 Oct 2019 02:23:20 -0700 by nmcglennon

Django choices Options and the Use of Rich Text Editors

Project preparation 1. Create a database create database choices_test default charset utf8; 2. Create a Django project named choices_test; 3. Create app01; The project structure is as follows 4. Configure the database; DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'choices_test', ...

Posted on Wed, 02 Oct 2019 00:04:58 -0700 by RDKL PerFecT

Related operations in Vue-CLI project

0830 summary Related operations in Vue-CLI project I. Basic Workflow of Front-end Routing directory structure |vue-proj | |src | | |components | | | |Nav.vue | | |views | | | |PageFirst.vue | | | |PageSecond.vue | | |App.vue | | |router.js App.vue: root component <template> <div id="app"> ...

Posted on Tue, 01 Oct 2019 18:55:24 -0700 by JackSevelle

Solving cannot find-lmysqlclient

Good memory, not bad pen This is not the first time I met this problem, but I went to the website to find the answer every time. I found that most of them could not solve the problem. It took me a little time to solve this problem, so I recorded it. Installing mysqlclient under python is the following error. Install the command pip install mysq ...

Posted on Tue, 01 Oct 2019 18:02:04 -0700 by scrtagt69

K-Nearest Neighbor Algorithms

K-Nearest Neighbor python Implementation 1. Calculate the distance between each sample in the training set and the newly added sample and save it. 2. Sort distance s and find the first k elements 3. Using Counter in collections module, the values of the first k elements and corresponding occurrenc ...

Posted on Tue, 01 Oct 2019 15:13:12 -0700 by phlow

Django exports data as Excel and calls browser to download

1. environment   Django (2.1.10) + Python3.6 + xlwt (1.3.0)  The operating system used is: Windows 7 2. Interface Code def now_export(request): data_list = CIP.objects.all() # Query Set for Getting Data if not data_list: return HttpResponse(json.dumps({"state": "1", "msg": "Check no data,Export failure"}), content_t ...

Posted on Tue, 01 Oct 2019 11:33:13 -0700 by mj99

AES Encryption and Decryption Example (walker)

AES introduction Advanced Encryption Standard (AES), also known as Rijndael Encryption, is a block encryption standard adopted by the United States federal government.This standard is used to replace the original DES (Data Encryption Standard), which has been analyzed by many parties and widely used all over the world. After a five-year selecti ...

Posted on Tue, 01 Oct 2019 10:20:53 -0700 by d-woo

Deep and shallow copies of python sequence

Immutable types in python Enumeration: numeric values, strings, tuples, byte strings The illusion of "variable" values and strings num = 123 mystr = 'abc' print(id(num), num) print(id(mystr), mystr) num = 456 mystr = 'def' print('After modification...') print(id(num), num) print(id(mystr), mystr) # Result: 1 ...

Posted on Tue, 01 Oct 2019 01:15:35 -0700 by rfighter

Game Development of Pygame01

I. Pygame Library Pygame is a game library written using SDL library. The full name of SDL library is Simple Direct Media Layer, which is said to be written by Sam Lantinga. It was written by Daniel in order to make Loki transplant Windows games to linux better, and then it went bankrupt. SDL is written in C and Pygame is a common library in ...

Posted on Mon, 30 Sep 2019 16:51:48 -0700 by bluesoul