percent-Returns %b– return binary number %c– returns the character corresponding to the ASCII value %d– decimal number with plus sign %e– Scientific counting symbols (e.g.: 1.2e+2)%u– the unsigned decimal number.%ul Long integer without symbol %f– Floating-point data (local setting) %f– Floating-point data (non-local settings) %o– octal number %s– String %x– hexadecimal number (lowercase letters) for example: sprintf (S, "% #010x", 128);//Generate "0x00000080" %x– hexadecimal number (capital le
2004-4-1 13:30:002004-5-31 23:59:59Attribute:type; Optional. Indicates to Print:date, time, or both.2004-4-123:59:59Attribute:datestyle; Optional. varies the date format.2004-5-3104-5-312004-5-31May 31, 2004Monday, May 31, 2004Attribute:timestyle; Optional. varies the time format.23:59:5911:5923:59:5911:59 P.M. 59 sec11:59 P.M. 59 sec. CDTAttribute:pattern; Optional. Inidcates Date/time Custom Patterns.Thursday, April 1, 2004 13:30:00-0600Date formatting
!"‘Hello, world!‘ # Python打印出来的值是给python理解的,这里python理解为字符串,所以带着引号>>> 1000L # python理解为Long型的数字,所以它打印出来的时候也带着后缀L1000L>>> print "Hello, world!" # 打印一个字符串,给用户看的,所以不带引号Hello, world!>>> print 1000L # 用户看到的当然是一个数字1000,而不是字符串1000L1000STR and repr actually correspond to each of the above two display modes.
StrConverts a value into a reasonable form of a string to be seen by the user. STR is actually similar to Int,long, and is a type.>>> print str("Hello, world!")Hell
Python for LoopImportRandomrandom_num=random.randint (1,1000)Print(random_num); forIinchRange (3): Num=int (Input ('Please enter')) ifNum>Random_num:Print('it's too big.') elifnumRandom_num:Print('it's too small.') Else: Print('guess right.')While loop# loop, iterate, traverse # For Loop # while # The loop is a repetition of what you do. # Specify a loop end condition # with a while loop, you have to have a counter # continue end this cycle and proceed to the next cycle # Break
Converts the current time into a hh:mm:ss formFormatting:New Date (). totimestring (). Replace (/.* (\d{2}:\d{2}:\d{2}). */, "$")Format the current time as: Hh/dd/yy formfunction Formatday (param) {var year = param.getfullyear (); var month = Param.getmonth () + 1; var day = Param.getday (); month = month.tostring () > 1? Month: ' 0 ' + month; Day = day.tostring () > 1? ' 0 ' + day:day; Return day + "/" + month + "/" + year;} DemoJS: Time Formatting
An extension to date that converts date to a string of the specified format
The month (m), Day (d), hour (h), Minute (m), second (s), quarter (q) can be used with 1-2 placeholders,
Year (y) can use 1-4 placeholders, milliseconds (S) with only 1 placeholders (1-3 digits)
Date.prototype.Format = function (FMT) { //author:meizz
var o = {
"m+": this.getmonth () + 1, //month
"d+": this.getdate (), //day
"H +": this.gethours (), //hour
"m+": this.getminutes (), //min
"s+": t
', 1000000)' Hi, Michael, you have $1000000. 'Specifies whether to complement 0 and the number of digits of integers and decimalsPrint ('%2d-%02d '% (3, 1))Print ('%.2f '% 3.1415926)3-013.14If you're not sure what to use,%s will always work, and it will convert any data type to a string>>> ' Age:%s. Gender:%s '% (True)' Age:25. Gender:true 'Escaped, expressed as a% by percent>>> ' growth rate:%d percent '% 7' Growth Rate:7% 'Format ()>>> ' Hello, {0}, result increased {1:.1f}% '. Format (' name
formatting stringsString.prototype.format = function (args) { var result = this; if (Arguments.length How to use:Two ways to call Var template1= "I am {0}, this year {1}"; var Result1=template1.format ("Loogn"); var template2= "I am {name}, this year {age}"; var Result2=template2.format ({name: "Loogn", age:22});//Two results are "I'm Loogn, 22 this year."
Reference: http://www.cnblogs.com/yelaiju/archive/2012/03/27/2419212.html
pprint– Beautiful Print
Function: Beautiful print data structure
Pprint contains an "aesthetically pleasing printer" for generating a beautiful view of the data structure. The formatting tool generates some representations of the data structure that can be parsed correctly by the interpreter and is easy for humans to read. The output is placed on one line as much as possible, and indentation is required when decomposed into multiple rows.
The follo
In Vim there is also the operation of the automatic formatting code, like the CTRL + Shift +f in Eclipse, which, although very powerful, usually destroys the original indentation of the Code,
So it's not recommended to use in a language such as Python for indenting instead of parentheses and in code that has been indented by the source program, so let's say the following steps:
1,gg jump to the first line
2,shift+v go to Visual mode
3,shift+g Sele
Turn from: http://www.lvtao.net/tool/editplus-phpcb.html
PHPCB Download: http://download.csdn.net/detail/frt007/9533158
using EDITPLUS+PHPCB to create simple PHP code formatting toolsPHPCB Download: http://download.csdn.net/detail/frt007/9533158
Each of our developers wants to write beautiful neat code, but because in the development process will be too much of the focus on the development, ignoring the neat code, how to do it. I am here to introduc
Although the name is original, in fact is merely, in spring MVC or struts have the function of JSON automatic conversion, I think this is very good, but for the usual date but have to add comments to the field of the way, did not find anything bad, but sometimes feel very troublesome. Today in a JSON string return, I need to format the date, we are in the background JSON generated, direct return, we use the Gson, check the resolution of the other people's problem, found that Gson to this date
First, modify the page number format
1. To perform "insert" → "page number", in the page Number dialog box, click the Format button, open the Page Number Format dialog box, in the Number format Drop-down list box, you can choose the number format for inserting page numbers.
2. In "page numbering", if a document is divided into sections, to keep the page number of the entire document contiguous, select the "Continue before" radio box, and if you want the page number to start at a number, select
word2010 How to modify the incorrect quotation mark formatting
First, open the Word document you want to modify, select the "Start-style" menu bar, then randomly select a style, right click to choose "Modify";
Second, in the pop-up window, check the "New document based on this template", then click "Format--font";
Third, in the bounce out of the Font box, the Western font changed to "Song Body", click OK;
Four, another simple way is to open
Seconds (00-59)
%s
Seconds (00-59)
%T
Time, 24-hour (HH:MM:SS)
%u
Week (00-53) Sunday is the first day of the week
%u
Week (00-53) Monday is the first day of the week
%V
Week (01-53) Sunday is the first day of the week, with%x
%v
Week (01-53) Monday is the first day of the week, with%x
%W
Week name
%w
Day of the week (0= Sunday, 6 =
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.