Skip to main content

write(path,content), open.write replacement. python2 and python3 compatible

Project description

https://img.shields.io/pypi/v/write.svg https://img.shields.io/pypi/pyversions/write.svg https://img.shields.io/pypi/dm/write.svg

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

github_issues - Github Issues

gitter - Chat with me (english/russian)

russianidiot.github.io/python/ - my Python packages

Project details


Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page