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
    • 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


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

您的留言將使用 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )


您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s

在 建立免費網站或網誌.

%d 位部落客按了讚: