Python

How To Convert Timestamp To Specified Format Date String In Python3

When writing Python code, we often encounter the problem of time format. The first thing is the conversion between timestamp and date time fromat string. The timestamp is the number of seconds from 00:00:00 on January 1, 1970 to the present day. In Python, timestamp can be obtained by the time() method in the time …

How To Convert Timestamp To Specified Format Date String In Python3 Read More »

How To Use String Truncation Function strip(), lstrip(), And rstrip() In Python3

There are three functions in Python to remove one string’s head and tail characters and the blank characters, they are strip, lstrip and rstrip. strip : Used to remove both head and tail characters and blank characters (includes \n, \r, \t,’   ‘). lstrip : Used to remove head characters and blank characters (includes \n, …

How To Use String Truncation Function strip(), lstrip(), And rstrip() In Python3 Read More »

Can Not Find Django Tutorial Django-polls Templates Error

1. Question. According to the official document tutorial of Django project, i meet below problems in the chapter “Advanced tutorial: How to write reusable apps”. Install django-polls to MySite as directed. pip –user install /Users/john/django-polls/dist/django-polls-0.1.tar.gz Run Django server after install successfully. python manage.py runserver Browse url http://127.0.0.1:8000/polls/ in a web browser and returns an error. …

Can Not Find Django Tutorial Django-polls Templates Error Read More »

Python Built-in Functions Example

Python built-in functions are functions provided by python for you to use directly, such as print and input, etc. As of python version 3.6.2, a total of 68 built-in functions are provided. Today, let’s take a look at python’s built-in functions as shown in the figure below.

Clicky