Benx Blog

六月 28, 2008

Diigo Diary 06/28/2008

Filed under: Diigo Diary — benxshen @ 8:30 上午
  • tags: no_tag

    • The str() function is meant to return representations of
      values which are fairly human-readable, while repr() is
      meant to generate representations which can be read by the interpreter
      (or will force a SyntaxError if there is not equivalent
      syntax).
    • print repr(x).rjust(2), repr(x*x).rjust(3),
      … # Note trailing comma on previous line
      … print repr(x*x*x).rjust(4)
    • >>> for x in range(1,11):
      … print ‘%2d %3d %4d’ % (x, x*x, x*x*x)
    • open() returns a file
      object, and is most commonly used with two arguments:
      open(filename, mode)“.
    • mode can be 'r' when
      the file will only be read, 'w' for only writing (an existing
      file with the same name will be erased), and 'a' opens the file
      for appending; any data written to the file is automatically added to
      the end. 'r+' opens the file for both reading and writing.
      The mode argument is optional; 'r' will be assumed if
      it’s omitted.
    • Python provides a standard module called
      pickle. This is an
      amazing module that can take almost
      any Python object (even some forms of Python code!), and convert it to
      a string representation; this process is called pickling.
  • tags: browser, webdesign, tools, screenshots, testing, web, browsers

  • tags: java, opensource, resources, list

發表迴響 »

仍無迴響。

RSS feed for comments on this post. TrackBack URI

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

在WordPress.com寫網誌.

%d 位部落客按了讚: