Category:Python

  • New year’s benefits: Python easy to gather five blessings (Demo)

    Time:2020-5-28

    The new year is coming again, and every big company has sent a new year’s blessing to everyone at the end of this year. Alipay has continued the tradition of the past few years. At the end of the year, it has brought five activities to everyone. In order that everyone can get rid of […]

  • Python Programming: Nine Python skills for novices

    Time:2020-5-28

    There are many articles about various cool functions in python (such as variable unpacking, partial functions, enumeration of iteratable objects), but when it comes to python, there are many things to talk about. Here I will try to show some features I know and use, which I haven’t seen in other places. Let’s start. Clean […]

  • Using tensorflow to build and train CNN to do simple verification code recognition

    Time:2020-5-27

    Tensorflow is the most popular deep learning framework. We can use it to build our own convolutional neural network and train our own classifier. This paper introduces how to use tensorflow to build our own CNN and how to train the classifier for simple verification code recognition. This article assumes that you have installed tensorflow, […]

  • Pat (basic) 1004 score ranking (implemented in Python)

    Time:2020-5-27

    Ideas: This problem is relatively simple. My idea is to store the scores in a list, and then store other information in a dictionary with the scores as the key. After finding out the maximum and minimum scores, I will access the dictionary values with scores and print them out. code N = int (input()) […]

  • Printing training variable examples from the trained tensorflow model

    Time:2020-5-26

    Printing training variables from a model saved after tensorflow training: Usingtf.train.NewCheckpointReader() import tensorflow as tf reader = tf.train.NewCheckpointReader(‘path/alexnet/model-330000’) dic = reader.get_variable_to_shape_map() print dic Print variables w = reader.get_tensor(“fc1/W”) print type(w) print w.shape print w[0] The above example of printing training variables from the trained tensorflow model is all the content shared by Xiaobian. I hope […]

  • Python tips: the right way to write decorators with classes is unknown to novices

    Time:2020-5-26

        A decorator is a function that returns a function. Write a decorator. In addition to the most common functions defined in a function, python allows classes to be used to define a decorator.PS note: no matter you are for Python employment or hobbies, remember: project development experience is always the core. If you […]

  • Detailed explanation of Python JSON encoding and decoding method

    Time:2020-5-25

    This article mainly introduces the principle of Python JSON encoding and decoding method. The example code is introduced in detail in this article, which has certain reference value for your study or work. You can refer to the following for your friends concept JSON (JavaScript object notation) is a lightweight data exchange format, which is […]

  • Teach you to use Python to regularly push bedtime stories to you every day__ People of

    Time:2020-5-25

    This paper uses a simple Python crawler, mail sending and timing tasks to achieve dailySend bedtime stories regularlyIs a step-by-step article. After testing, the program can still run normally. Recently, some cute asked me to tell her a little story every night before going to bed after I finished my work. I thought that there […]

  • Use tensorflow to divide your data into batch training instances

    Time:2020-5-23

    When learning neural network, the data set on the network has been divided into batch, which is used directly during training batch.next () you can get batch, but sometimes you need to use your own data set. However, if your own data set is not in batch form, you need to convert it to batch […]

  • Detailed explanation of Python module future usage principle

    Time:2020-5-22

    This article mainly introduces the detailed explanation of the future usage principle of Python module. In this article, the example code is introduced in great detail, which has certain reference learning value for your study or work. You can refer to the following for friends who need it Computer knowledge is too much, many things […]

  • Django batch add many to many fields

    Time:2020-5-22

    class OrderGoodsInfo(models.Model): … …. class OrderShipping(models.Model): order = models.ManyToManyField (OrderGoodsInfo, blank=True, verbose_ Name = “logistics ID”) …. views.py container_orders_id = [] for order in container_obj.orders.all(): container_orders_id.append(order.id) order_goods = OrderGoodsInfo.objects.filter(id__in=container_orders_id) order_shipping = OrderShipping(user=request.user) form = OrdershippingForm(request.POST, instance=order_shipping) if form.is_valid(): osp = form.save(commit=False) osp.order.add(*order_goods) osp.save() See the figure below for deletion and update operations  

  • Analysis of Python list operation code instance

    Time:2020-5-21

    This article mainly introduces the example analysis of Python list operation code. The example code is introduced in detail in this article, which has certain reference value for your study or work. You can refer to the following for your friends When operating the list, we often use the operation operations on the list, such […]