Want to know coursera full stack web development review? we have a huge selection of coursera full stack web development review information on alibabacloud.com
form4. Various methods4.1 f.encoding ()What encoding to open when the file is opened4.2 F.flush ()Changes to the file in memory, written to the hard disk4.3 F.tell ()Displays the location where the cursor is currently located. #除了read是显示光标所在字符的位置, the rest is the display character position4.4f.seek ()There are three different modes4.4.1 0F.seek (4.0) The first way, from the beginning of the file, to move four bytes4.4.2 1F.seek (3.1), moving three bytes from the relative position of the cursor4
cursor is showing. When you write to or manipulate the file, it is done at the end. So if you want to do the truncation operation. Remember it. To nudge the cursor first. Move to the position you want to truncate. Then truncate about truncate (n), if given N. Is truncated from the beginning, and if n is not given, it is truncated from the current position. Subsequent content will be deleted.Another way to open a file: with open ("Doll", mode= "R", encoding= "Utf-8") as F1:This does not need t
Study_recordCREATE TABLE' Study_record ' (' ID ')int( One) not NULL,` Day`int( One) not NULL, ' status 'Char( +) not NULL, ' stu_id 'int( One) not NULL,PRIMARY KEY(' id '),KEY' fk_class_key ' (' stu_id '),CONSTRAINT' Fk_student_key 'FOREIGN KEY(' stu_id ')REFERENCES' Student1 ' (' id '))Show create table Study_record; View table creation RecordCreate a tableCreate B TableSELECT * FROM A inner join B on a.a=b.b; or select a.*,b.* from A, where a.a=b.b;SELECT * from A LEFT join B on a.a=b.b; diff
, there is no such restriction when used, the left side of the point can be a package, a module, a function, a class (they can all call their own properties in the way of a point).3. Compare the application scenarios for import item and from item import name:If we want to use name directly then we must use the latter.4.importImport glance.db.modelsglance.db.models.register_models (' MySQL ')5.__init__.py file:Either way, the first time the package is imported or any other part of the package, th
Variable:Variables are stored in order to store some intermediate results in the process of program operation, in order to facilitate later invocation.Cases:Print ("Hello world!")Print ("Alon")Print ("alon_x")Name = ("alon_x")X=3Y=4Z=x*yPrint ("X*y", Z)Print ("z=", Z)The code format must be aligned, or it will be an error. indentationerror:unexpected indent ("Hi, man, your file is not in the right format, it may be the tab and space is not aligned, you need to check the tab and the Space ")Defin
word, and the Kerning method is as follows:word-spacing:30px;And this word-spacing to Chinese is not effective oh. To set the Chinese spacing, use letter-spacing to set it up OHtext-shadow:2px 2px #ff0000;This can be used to set the shadow of the text, note that the parameters are separated by a space, not separated by semicolons.{line-height:200%}Line-height can be used to set the row height.Of course there are many other properties that set text formatting that can be viewed in the manual.In
In CSS, all HTML elements can be viewed as a box.So in the design and layout, the most commonly used, that is, to define the margin of the box is marginDefining the inner margin of the box is padding.The width of the element's content is set by the wide property, so what is the total width of the element in the HTML page?is width + padding-left + padding-right + border-left-width + border-right-width This is the total width of the entire HTML page that the element occupies.For borders, we can us
Lists are divided into ordered and unordered listsWe know that the label of the sequence list is The label of the unordered list is The labels for each item in the list are wrapped in You can use a list style in CSS to not only change the list item markers for a list, but also to use a picture as a list item marker.can be usedList-style-image: url('sqpurple. GIF'); To set the list item to be marked as a picturecan also be usedList-style-type: none; To set the flag type of the list item,
CSS statement.Without selectors, there is no CSSSelectors are used to select things in an HTML page, and then we'll specify the colors and styles after selecting them.The first thing we want to introduce isID SelectorAs we all know, the HTML tag has an id attribute, the id attribute is unique, then we can select a specific tag by the CSS ID selector, and then specify the style of the tag.So how does our ID selector be declared in CSS?Use the # number.That's it, #号, remember.For example, if the
end and back end.HTML is the front-end, as the customer's browsing interface, PHP is executed on the server side of the program, is the backend, this through the case to deepen our understanding of the front-end and back-end, browser-side and server-side.And then after this interaction, the next thing we do is the interaction between PHP and MySQL, that is, to save the PHP value to the server-side database based on this case.You know, if we do not save, then each time we get the data will disap
databases; +--------------------+| Database |+--------------------+| information_schema | | mydb | | mysql | | performance_schema | | SYS |+ --------------------+5inset (0.00 sec)You can see the database we created MyDBmysql> use mydb;database changedmysql> show tables; +----------------+| Tables_in_mydb |+----------------+| User |+----------------+1inset (0.00 sec)You can see that the database mydb has our data sheet userThen we'll
First, the Python Foundation
About Python
Python data type (numeric \ string \ list)
Python data type (tuple \ Dictionary)
Ii. python file Operations functions Three, Python common module Four, object-oriented development five, network programming--socket Development VI, concurrent Programming VII, MySQL database eight, the front-end development
interrupted by a break. Will execute the statements after else exercise 2-4 The idea is very clear, self-made out, stating that the basic knowledge has mastered the exercises 1 and exercises 5 ideas are not clear practice 1 card in7 to get away from this ring, I then forgot 7 or to participate in the cycle, and print out the 7. Exercise 5 cards on I self-increment. Keep in mind that the code runs from top to bottom exercise 6 refer to the teacher's ideas, made out of their own today's questio
. Delete a table#按道理来说, a department in the department table was deleted, and the associated records for the employee table were deleted successively.However, after you delete the records for the employee table, delete the current department without any problemsThe above Delete table record operation is more cumbersome, according to the truth, cut off a department, the staff of the department will be cut off. In fact, there is a very important element in the construction of the table,Call sync D
formal parameter one by one in Init . The object's property 1 #查看对象的属性, directly with the object name. Method Name () #调用类中的方法, directly with Object name. Method Name () to Ix. Interaction between objects#人狗大战小程序class Person: def __init__ (self,name,aggr,life_value): self.name=name self.aggr=aggr Self.life_value=life_value def attack (Self,dog): #人可以攻击狗 dog.life_value=dog.life_value-self.aggrclass Dog : def __init__ (self,name,aggr,li
without right7The8>>li[2:]#If you want to go to the last data, you don't write any data .94,'a' TenGT;GT;LI[-2:-1]#You can also have negative slices One4,'a' A List add element:1>>li = [1,3,4]2>>li.append ('a')#add an element at the end3>>Li4[1,3,4,'a']5>>li.insert (2,'b')#add an element at a specified location6>>Li7[1, 3,'b', 4,'a']8>>li.extend ([2,'C'])#add multiple elements, which is the extended list9>>LiTen[1, 3,'b', 4,'a', 2,'C']List search:1 >>li = [1,3,'b', 4,'a', 2,'C
('\033[1;32m The green light \033[0m') E.set ()defcar (E, i):if notE.is_set ():Print('car%s waiting for a red light'%i) e.wait ()Print('car%s through'%i)if __name__=='__main__': E=Event () traffic_light1= Process (Target=traffic_light, args=(E,)) Traffic_light1.daemon=True traffic_light1.start () Li= [] forIinchRange (10): P= Process (Target=car, args=(E, i)) P.start () Li.append (p) time.sleep (random.randint (0,3)) forPinchLi:p.join ()Print('The main program is over! ')example of even
the configuration file2.1.1 View Import configparserconfig=configparser. Configparser () config.read('example.ini')print(' bitbucket.org' in config)print(config[' bitbucket.org'['user'])2.1.2 to traverse the key of a file2.1.3 Increase ImportConfigparserconfig=Configparser. Configparser () Config.read ('Example.ini')Print('bitbucket.org' inchconfig)Print(config['bitbucket.org']['User']) config.add_section ('Haibin') Config.set ('Haibin','K1','value') with open ('Example.ini','W') as
These days studied the use of pycharm.
Template: New: File---"Settings---" File and code Templates---"Pythonscript add header
#!/user/bin/env python #-*-coding:utf-8-*----------------------"OK
Text Size
File---"Settings---" Editor---"Font---" size 18
Run
A. Click on the file that you want to run right-click Run B.view---Toolbar Select the file you want to execute tap---. Right button in the current file blank
Toggle version of Python
File--
codeelse: otherwise (i.e. "the above conditions are not valid")Y + = I executes this codePrint S-yB. Complex processesName = raw_input (' Please input your name: ')If name = = ' Shaw ': condition 1 establishedprint "Hello Handsome!" "The implementation of this paragraphelif name = = ' Stiven ': Condition 2 establishedprint ' You're OK ' to perform this sectionelif name = = ' Sam ': Condition 3 establishedPrint ' Why are you so sad ... ' To perform this sectionElse: The above conditions are not
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.