Skip to main content

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

Project description

https://img.shields.io/badge/Language-Python-blue.svg?style=plastic https://img.shields.io/pypi/pyversions/write.svg https://img.shields.io/pypi/v/write.svg

https://api.codacy.com/project/badge/Grade/075eda6d69fa422f86a26f093ddcf26d https://codeclimate.com/github/russianidiot/write.py/badges/gpa.svg https://landscape.io/github/russianidiot/write.py/master/landscape.svg?style=flat https://scrutinizer-ci.com/g/russianidiot/write.py/badges/quality-score.png?b=master

Install

`[sudo] pip install write`

Usage

>>> from write import write

>>> write(path,text)

Examples

>>> 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_follow github_issues

Project details


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.22.tar.gz (2.5 kB view hashes)

Uploaded Source

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