Skip to main content
-----------

PyConio is a module that provides useful functions to work with console
I/O.

All the **PyConio** functions have the same behaviour of conio.h. And
best of all, is **Cross-Platform!**

This module is under the GNU GPLv2 license. See LICENSE to more details.

**Installing**
--------------

Execute this at your command prompt:

.. code-block:: bash

pip3 install https://gitlab.com/konniskatt/pyconio/raw/master/dist/pyconio-1.0.1.tar.gz

in administrator or sudo mode depending of your os.

*From source:*

Go to dist folder and there is a tarball file (pyconio_x.x.tar.gz):
Extract the folder that is inside in the tarball (.tar.gz), and then
execute:

.. code-block:: bash

python3 setup.py install

in **administrator** or **sudo** mode depending of your OS.

Instalación (spanish)
=====================

Ejecuta esto en la consola:

.. code-block:: bash

pip3 install https://gitlab.com/konniskatt/pyconio/raw/master/dist/pyconio-1.0.1.tar.gz

en modo **administrador** o **sudo**, dependiendo de tu SO.

*Desde fuente:*

Ve a la carpeta dist y ahi hay un archivo tarball (pyconio_x.x.tar.gz):
Extrae la carpeta que esta dentro del tarball (.tar.gz), y después
ejecuta:

.. code-block:: python

python3 setup.py install

en modo administrador o sudo, dependiendo de tu sistema operativo.

**Contributing**
-----------------

You can find PyConio in `GitLab`_, with contributing information.

.. _GitLab: https://gitlab.com/konniskatt/pyconio/

**Documentation**
-----------------

|colors|

Coloring text
=============

.. code-block:: python

from pyconio import *
textcolor(Red)
print("This text is in red!")
textbackground(Green) # Fore color maintains
print("This is a red text with green background!")


from pyconio import *
textcolor(Red)
textbackground(Green)
print("spam")
reversevideo()
# Now fore is green and background is Red
normvideo()
# Resets console to defaults

Note: When the program finishes, it reset colors.
Controlling cursor
position

.. code-block:: python

from pyconio import *
gotoxy(5, 5)
print("The cursor is now on x:5 and y:5")

Read keyboard
=============

.. code-block:: python

from pyconio import *
c = getch()
print("You pressed: %s" % c)

**getch():** Reads a key from keyboard and returns the pressed key.

**getche():** Reads a key from keyboard, returns the pressed key and
echoes it.

**getchar():** Reads one character from keyboard and returns the pressed
key, but waits until user press enter.

**kbhit():** Detects if a key was pressed, and returns True if was a key
pressed.

Micellaneous functions
======================

**Setting a title to console:**


.. code-block:: python

from pyconio import *
title("eggs")

**Pause program execution:**


.. code-block:: python

from pyconio import *
pause()
# Output: Press any key to continue . . .
# You can print your own message
pause("The program is paused")
# Output: This program is paused

**Hiding cursor and showing cursor:**


.. code-block:: python

from pyconio import *
hidecur() # The cursor is now hidden
showcur() # Now the cursor is not hidden

**Cleaning screen:**


.. code-block:: python

from pyconio import *
clrscr()

Examples
========

A *(very)* simple game using PyConio
|game|

.. |colors| image:: https://raw.githubusercontent.com/konniskatt/konniskatt.github.io/master/pyconio_colors.png

.. |game| image:: https://raw.githubusercontent.com/konniskatt/konniskatt.github.io/master/pyconio_demo.png

Keywords: pyconio colorama colors termcolor conio console cross-platform gotoxy
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Utilities
Classifier: Topic :: Terminals
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Classifier: Programming Language :: Python :: 3
Classifier: Environment :: Console :: Win32 (MS Windows)Environment :: Console

Release files for pyconio 0.01

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyconio 0.01
File Size Uploaded
pyconio-0.01.tar.gz 142.3 kB Details

Release files / pyconio-0.01.tar.gz

Download URL pyconio-0.01.tar.gz
Size 142.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b88a79aa59d393dd95ff42ff3fb5ce8631754935e12c84928713d5ea22980868
BLAKE2b-256 checksum
How to use checksums
1aad997ab99069c832038f5b197163fe9a4ce7a96d1f8b8ee730da7dc4bc52b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

Release history Release notifications | RSS feed

0.020

1 release file

This release

0.01 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page