Skip to main content

Programming contest input/output module

Project description

PCIO

Input from stdin by format. Values can distrubuted on different lines.

import pcio

# Input two integer numbers as tuple
a,b=pcio.input('ii')

# Input a list of integer numbers
arr=pcio.input(100,'i')

# Input a list of pair float numbers
arr=pcio.input(100,'ff')

# Input one symbol
pcio.input(1)

# Input one line by default
s=pcio.input()

Function returns None on end of file and NaN if value is not a number.

Input Format Description
i Integer number, skip spaces before number
f Float number, skip spaces before number
w Word, skip spaces before word
c One character as string
l One line as a string
L One line with new line as a string
a All input as one string

Also specialized variants

import pcio

a=pcio.input_int()
b=pcio.input_float()
c=pcio.input_char()
d=pcio.input_word()
e=pcio.input_line()

Print by format (format not implemented yet)

# Print by format
pcio.print("Hello, {}!\n", "world")

# Print a list separated by space and new line
pcio.println(arr) 

Select input/output encoding (utf-8, cp1251 or cp866). Implemented for input only yet.

# Select encoding 
pcio.encoding('cp1251')

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

pcio-1.0.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

pcio-1.0.0-cp312-cp312-win_amd64.whl (12.2 kB view details)

Uploaded CPython 3.12 Windows x86-64

File details

Details for the file pcio-1.0.0.tar.gz.

File metadata

  • Download URL: pcio-1.0.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for pcio-1.0.0.tar.gz
Algorithm Hash digest
SHA256 747988e95bdc58494e1f3a7fefdf0be529e8c4c189c613bda96a67c6c829136a
MD5 18bdf15b6285f6d5c982b9e4c30ba599
BLAKE2b-256 dc1d2af440e00d14b5051a6c677c0432607a228d9fba004dac68a275b6fd4857

See more details on using hashes here.

File details

Details for the file pcio-1.0.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pcio-1.0.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for pcio-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 930eb55dda66c74c7bf13d6170b2ce720ff694195b35ac78a5696daff40ed535
MD5 a7283e673cb0e2fab5b2bbf56156b2d9
BLAKE2b-256 e5f551adcfc048f1f6c8596ff43927bd81d903f147754b1a43ae17cd6510d24d

See more details on using hashes here.

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