Skip to main content

A python package to change from Interaction console based code to file based code

Project description

fread

Python package to convert the interactive based console to file input based, with a single statement.


Version - 1.0
Github - https://github.com/saisrinivaspaila/fread-pypi

Why to use?

There are people like me, who use python for competitive programming or for building console based applications. When I use my local editors, I need to enter the code from the console everytime. There are ways I can change it to file input based, for which I need to refactor a lot of code during submissions. So this package helps us to take inputs directly from files with the same code that we write for interactive console. With one line command, we can change the code from interactive console to file based input.

I hope you people will find it is useful.

How to use?

installing
pip install fread
how to use in code
from fread import get_input
get_input.fileInput(mainPythonFile, yourInputTextFile)
Example

main.py:

from fread import get_input
get_input.fileInput("main.py","input.txt")
n1 = int(input())
n2 = int(input())
print("sum:",n1+n2)
str1 = input()
print("string:",str1)
list1 = map(int,input().split())
print("list:",list1)

input.txt:

1
2
python is love, Happy Coding
1 2 3 4

output:

sum: 3
string: python is love, Happy coding
list: [1,2,3,4]

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fread-1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fread-1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file fread-1.0.tar.gz.

File metadata

  • Download URL: fread-1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for fread-1.0.tar.gz
Algorithm Hash digest
SHA256 4b8492cf0fc664e0c90d4d30e7bd500ebfec0dea1b611a9d157c5c82f25ee7f3
MD5 7c19ed013006d6948fb923d539b64970
BLAKE2b-256 b866290329f3481bf75e35241359011399ea62548f92aff4d22f2f23d4b7b8c4

See more details on using hashes here.

File details

Details for the file fread-1.0-py3-none-any.whl.

File metadata

  • Download URL: fread-1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for fread-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59670cca539fb50917a996335f33e579e820af2acb84b2d0ae5543d22b9b4a87
MD5 ffe295c35f55ce840b4ccdd6b8eaed7b
BLAKE2b-256 f0a706fdc7a01ba9fb6cc366a89952c1f3197787d7f22cd9b157224eaf5bbd59

See more details on using hashes here.

Supported by

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