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
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
Close
Hashes for pcio-1.0.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 930eb55dda66c74c7bf13d6170b2ce720ff694195b35ac78a5696daff40ed535 |
|
MD5 | a7283e673cb0e2fab5b2bbf56156b2d9 |
|
BLAKE2b-256 | e5f551adcfc048f1f6c8596ff43927bd81d903f147754b1a43ae17cd6510d24d |