write(path,content), open.write replacement. python2 and python3 compatible
Project description
Install
github.com: pip install git+git://github.com/russianidiot/write.py.git
pypi.python.org: pip install write
download: [ -e requirements.txt ] && pip install -r requirements.txt; python setup.py install
Usage
from write import *
>>> write(path,'string')
>>> open(path).read()
'string'
>>> write(path,None) # touch
>>> open(path).read()
''
>>> write(path,42) # write integer
>>> open(path).read()
'42'
>>> write(path,dict()) # converted to str
>>> open(path).read()
'{}'
Feedback
- Chat with me (english/russian)
russianidiot.github.io/python/ - my Python packages
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
write-0.0.5.tar.gz
(7.5 kB
view hashes)