Python File I/O Now Easier

Are you tired of doing this:

with open(‘main.txt’, ‘w’) as f:
data = f.read()
print(data)

Output:

File Content

Well EasyFileHandling solves the problem. Questions rising up in your mind.

How is this useful
Ok so first of al…

Are you tired of doing this:

with open('main.txt', 'w') as f:
    data = f.read()
    print(data)

Output:

File Content

Well EasyFileHandling solves the problem. Questions rising up in your mind.

  • How is this useful
    Ok so first of all its Open Source, here is the Github repo link. Its useful because its object oriented, it has good documentation, lets you do soo much with file. You manipulate images with ImageHandler, you can edit, write, and much more with the FileHandler, you also use JsonHandler for JSON files and AsyncFileHandler for async File I/O tasks. All these handlers are classes. Too much talks lets see some examples.
    Run:
pip install EasyFileHandling

Package Link

FileHandler
We have file named main.txt which has this in it:

Hello World! I like Files LOL

Magic Time

from EasyFileHandling.main import FileHandler 
x = FileHandler("main.txt")
print(x.what_type_of_file())
x.change_file_extension('.txt', '.js')

Let me explain what it did, firstly it told told you what type of file .txt == Text. Get it I hope so then we told it to change the extension from .txt to .js.
You saw how great it is?

One more thing to show rest you find by yourself 🙂
Sometimes you want to do simple tasks but reading documentation is frustrating. You wanna add filter to an image or add text to it. We have simplified PILLOW library for you.
Need some Blur?

from EasyFileHandling.imagehandler import ImageHandler
x = ImageHandler('robot.png')
x.filter_image('blur')

No need to save the image like you did in PILLOW library. Just press run and it will create a folder automatically and save this file to it.

Well this was the magic of EasyFileHandling, Open Source and Easy

One last thing do you know that EasyFileHandling developers are making easyfilehandling.js for npm. Its out NPM.

Important Link


Print Share Comment Cite Upload Translate
APA
Haider Ali | Sciencx (2024-03-28T13:48:01+00:00) » Python File I/O Now Easier. Retrieved from https://www.scien.cx/2021/09/20/python-file-i-o-now-easier/.
MLA
" » Python File I/O Now Easier." Haider Ali | Sciencx - Monday September 20, 2021, https://www.scien.cx/2021/09/20/python-file-i-o-now-easier/
HARVARD
Haider Ali | Sciencx Monday September 20, 2021 » Python File I/O Now Easier., viewed 2024-03-28T13:48:01+00:00,<https://www.scien.cx/2021/09/20/python-file-i-o-now-easier/>
VANCOUVER
Haider Ali | Sciencx - » Python File I/O Now Easier. [Internet]. [Accessed 2024-03-28T13:48:01+00:00]. Available from: https://www.scien.cx/2021/09/20/python-file-i-o-now-easier/
CHICAGO
" » Python File I/O Now Easier." Haider Ali | Sciencx - Accessed 2024-03-28T13:48:01+00:00. https://www.scien.cx/2021/09/20/python-file-i-o-now-easier/
IEEE
" » Python File I/O Now Easier." Haider Ali | Sciencx [Online]. Available: https://www.scien.cx/2021/09/20/python-file-i-o-now-easier/. [Accessed: 2024-03-28T13:48:01+00:00]
rf:citation
» Python File I/O Now Easier | Haider Ali | Sciencx | https://www.scien.cx/2021/09/20/python-file-i-o-now-easier/ | 2024-03-28T13:48:01+00:00
https://github.com/addpipe/simple-recorderjs-demo