Python Learning note 011--built-in functions __module__, __name__

1 __module__ Description__MODULE__:Prints __main__ If the current module is executed for the top-level moduleIf the current module is the calling module, the name of the current module is printed2 __module__ Exampledef Fun (): Pass Print (fun.) _

Brother Lian Learning python----simple lottery

Import tkinterimport randomimport tkinter.messageboxclass choujiang:def __init__ (self): Self.root=tkinter. Tk () self.root.minsize (400,400) self.root.resizable (width=false,height=false) self.root.title ("Simple Lottery" ) SELF.RESULT1 = Tkinter.

Several ways to implement string inversion in Python

Interview with a very boring problem ~ ~ ~Requirement: Reverse the string in as many ways as possible in a python environment, e.g. invert s = "abcdef" to "FEDCBA"First: Use string slices= s[::-1]The second type: The reverse method of using the list=

Python basic knowledge of file reading and writing and modification

Basic operationsf = open("file1", "r")  # 打开文件first_line = f.readline() # 读一行data = f.read() # 读取剩下所有内容,文件大时候不要用f.close()  #关闭文件If we want to loop the file and output the split on line nineth:for index, line in

The old Ziko Python Django combat note

InstallationDjango is a Python-language environment, so make sure you have Python installed on your computer first.LinuxUbuntu:sudo pip install django==1.11.7A version is specified in the installation, you can modify the version number, or you do

Beginner Python's next day's accompanying notes

Formatted outputTo understand formatted output, you first understand the placeholder% placeholder S string D-digitReplace the placeholder placeholder with the first one in order name = input ( " Enter your name: " ) Age = input ( "" Span style= "

Python exception modulenotfounderror:no module named ' Test01inner02 '

When we use the Sys.path.append (args) directive to import a module into a program, the append operation is only done in memory, and if you want to permanently add it, you need to modify the environment variable.We found that when we used print (Sys.

Python Learning Three

Advanced Featuresslices : list,tuple,str interception.1Items = Range (20)2 #results: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ten, one, one,, (+),.3 4 #take the top 105Top10 = Items[0:10]6 #0 can be omitted7Top10 = Items[:10]8 #results: [0, 1, 2, 3, 4, 5, 6, 7

Little white python path day1 variable

Python road, Day1-python base 1 variablesVariables are used to store information that is referenced and manipulated in a computer program. They also provide a way to tag data with descriptive names so that our programs can be more clearly understood

The ZipFile of the Python module

1) Simple application of ZipFileIf you are simply using Python for compression and decompression, the method is as followsImportZipfilef= ZipFile. ZipFile ('Filename.zip','W', ZipFile. zip_deflated) F.write ('1.txt') F.write ('2.doc') F.write

Python list Build expression

The list generation, which is the comprehensions, is a very simple and powerful build of Python built-in that can be used to create lists. Using a list-generated formula, you can write very concise code.1 >>> list (range (0))2 [0, 1, 2, 3, 4, 5, 6, 7

python-Crawling Web pages

Import GeventFrom urllib.request import Urlopen# crawlerdef f (URL): Print (' GET:%s '% URL) resp = urlopen (URL) data = Resp.read () With open (' baidu.html ', ' WB ') as F: F.write (data) Print ('%d bytes%s '% (len (data),

Python a command to turn on the HTTP server

1. Python opens the HTTP serverPython-m simplehttpserver 8080If you are prompted with an error:Python.exe:No module named SimplehttpserverThen try the command:Python-m Http.server2. Execute the PY script file to open the CGI mapPython-m Http.server--

Python the next day

---restore content starts---One, ASCII code  There are times when you cannot enter Chinese in Python2, because the Python2 interpreter uses the ACII code when loading the. py file, and has been more utf-8 in Python3.The ASSCII code is a 8-bit byte,

One of the Python base data types

Python is interpreted (with good platform compatibility, can be run in any environment, modified code can be modified directly, can be quickly deployed, without downtime maintenance), dynamic (Python does not need to set a variety of variables prior

Python Day78 Django-ajax

First, Ajax introduction  Ajax(asynchronous JavaScript and XML) is translated into Chinese as " asynchronous JavaScript and xml." Even if you interact asynchronously with the server in Javascript, the data transferred is XML(of course, the data

Python Automatic Identification Code _ Enhanced

Reference URL:http://blog.csdn.net/mach_learn/article/details/41744487Beginner's TutorialThank you ~Automatically identify the verification code, will be some of the interference factors are also identified, there are some special symbols, so the

Installing a third-party library appears Python version 2.7 required, which is not found in the registry

Import SYS from _winreg import * # tweak as Necessaryversion = Sys.version[:3]installpath = Sys.prefix Regpath = "Softw Are\\python\\pythoncore\\%s\\ "% (version) Installkey =" InstallPath "Pythonkey =" PythonPath "PythonPath ="%s;%s\\lib\\

Python---basic data structure

List listsInitialize [Vaule ...] List () an empty listData Conversion list (value ...)Data read subscript operation [offset]Data manipulation modify List[offset]=value slice List[start:end:step] Insert List.insert (offset, value) Delete del

Python regular-expression learning

ObjectiveRecently in a function with Django, mainly for the realization of machine monitoring, the process, involving the URL to identify IP routing problems, the beginning with a variety of expressions can not be properly routed to the IP,

Total Pages: 4013 1 .... 2804 2805 2806 2807 2808 .... 4013 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.