Python file modes detail

后端 未结 3 1027
轻奢々
轻奢々 2021-02-03 10:28

In Python, the following statements do not work:

f = open(\"ftmp\", \"rw\")
print >> f, \"python\"

I get the error:

Trace         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-03 10:58

    In fact, this is okay, but I found an "rw" mode on the socket in following code (for Python on S60) at lines 42 and 45:

    http://www.mobilenin.com/mobilepythonbook/examples/057-btchat.html

提交回复
热议问题