This paper is the experimental report of Experimental building course, course address:https://www.shiyanlou.com/courses/647
no specific code involved
Before learning the Linux system programming time to learn to write a simple shell in C language,
Yesterday with ReadLines read a file, run a good will automatically hang off, looking for a half-day also find no reason, and then asked the number of the list elements whether there is a limit. Why do I ask, because my file has 13g,775,149,707 line.
A description of the topic
Second, the solution
def minnumberinrotatearray (Rotatearray):
# write code here
p1 = 0
p2 = len (rotatearray)-1
mid = P1
While ROTATEARRAY[P1]>=ROTATEARRAY[P2]:
if P2-P1 ==1:
The operator module is a built-in operator function interface in Python that defines some arithmetic and functions that compare built-in operations. The operator module is implemented in C, so it executes faster than Python code.
Logical operation?
The creazy.txt file has 4G, reads its contents line by row, and writes to the Monday.txt file.
Def creazyread ():
'
with open (' E:creazy.txt ', ' R ') as CR: For line in
CR: Print line
'
ms = Open ("E:creazy.txt")
for
About the Python callable object A good article, can't help copy come over, respect the author original, quote as follows:
Http://www.jianshu.com/p/a96e71ff7f07
There is an interesting syntax in Python, as long as the type is defined , the call
Python is an object-oriented, interpretive computer programming language. In addition to the language itself, Python's standard library is well worth praising, and Python also has its own servers. In other ways, Python has plenty of free data
Given a sorted linked list, delete all duplicates such which each element is appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.The sorted list deletes duplicate elements, ensuring that each element appears
1, Pyhton resources
Learn Python's very good website
Learn Python very good website 2
Learn Python's very good blog
Learn Python's book recommendations:
2. Python Environment Deployment
Python module Paramiko and SSH installation configuration
One, when you want a method to be executed after a few seconds or even longer, you can do this:
Import time
from threading import Timer
def print_time (enter_time):
print ' Now ', Time.time (), enter_the _box_time is ", Enter_time
print
Using the Windows system, Python 2.7.
Import OS
Command = ' ping www.baidu.com ' #可以直接在命令行中执行的命令 r = Os.popen (command) #执行该命令 info = r.readlines () #读取命令行的输出到一个list for Li NE in info: #按行遍历 line = Line.strip (' \ r \ n ') Print line
--------------
2018-02-25, the first day of work today, in order to develop, should be planned for the next year's personal development plan, go to the recruitment site to see the relevant Python jobs need skills, find breakthroughs, to market demand to promote
Scripting uses
Using the Del function arrows in DOS does not support the function of regular expressions.
Script implementation
Import shutil
import os,sys,re
def remove_file (fname):
mode = sys.argv[1]
mode = Mode.replace (".", "\ ."
I. The role of Meshgrid
First, the function of Meshgrid is to extend the two vectors horizontally and vertically.
>>> import NumPy as NP
>>> x=np.arange ( -1,3)
>>> x
Array ([-1, 0, 1, 2])
>>> Y=np.array ([7,8,9])
>>> y
Array ([7, 8, 9])
>>>
Prime numbers (prime number) are also called prime numbers, with an infinite number. There are no more factors than 1 and it itself, otherwise known as composite numbers.
Def _odd_iter ():
n = 1 while
True: n
= n + 2
yield n
def _not_divisible (n):
From random import *
#mktime (tuple) The time tuple is converted to local time
#日期元组说明: Year, month, day, time, minute, second, week, Julian calendar day, daylight
Date1 = (2016,1,1,0,0,0,-1,-1,-1)
time1 = Mktime (date1)
date2 = (2017,1,1,0,0,0,-1,-
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