write(path,content), open.write replacement. python2 and python3 compatible
Project description
Install
[sudo] pip install write
Usage
>>> from write import write
>>> write(path,text)
Example
>>> 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()
'{}'
Sources:
russianidiot.github.io/python/ - Python packages
russianidiot.github.io/cli/ - command line scripts
README.rst - generated with readmemako.py (python+ mako templates) and .README dotfiles
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.7.tar.gz
(6.6 kB
view hashes)