gijstimmers / cursor Goto Github PK
View Code? Open in Web Editor NEWA small Python package to hide or show the terminal cursor.
License: GNU General Public License v3.0
A small Python package to hide or show the terminal cursor.
License: GNU General Public License v3.0
As in the subject, just wondering if this code is strictly GPL-3.0-only or GPL-3.0-or-later.
Hi,
I would like to ask you if there would be possibility of relicensing this repo to MIT if would author of the answer on stackoverflow agree?
README states:
Note that the cursor will stay hidden until you call cursor.show() โ even after exiting your python script!
An alternative is using the HiddenCursor() class in conjunction with Python's with statement. This will make sure that the cursor is shown again after running your code, even if exceptions are raised.
As another easy alternative, you might consider using the Python atexit module (or just mentioning the possibility in the README for that matter). Could work as follows:
>>> import cursor
>>> import atexit
>>> atexit.register(cursor.show)
<function show at 0x7f6ebbf7b668>
>>> cursor.hide()
>>> print("hello world!")
hello world!
>>> exit()
Currently, escape sequences are outputted to stdout
which is not customizable. A feature request would be to allow users to select the stream themselves.
Using Python 3.7 on Windows 10
cursor.hide() works first time but if I resize the console window it comes back. After this any attempt to re-run cursor.hide() is ignored and the cursor will not go away.
I am maintaining a AUR package (https://aur.archlinux.org/packages/python-cursor/) for cursor
since August 2018. If you think that this is done right (the package build instructions can be seen in the PKGBUILD https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=python-cursor), we could mention this as the preferred way to install cursor
for Arch Linux users. Maybe we could write somehing like this in the README:
Arch Linux:
The package is available in the AUR. You can either use a AUR helper or manually install it:
git clone https://aur.archlinux.org/python-cursor.git
cd python-cursor
makepkg -si
sudo pacman -U python-cursor-x.y.z-r-any.pkg.xz
In addition, many people do not consider it as good practice to use sudo pip
to install python packages. It installs the python files on your system path, which is usually already maintained by the system's package manager (pacman
for Arch users, apt-get
for Debian/Ubuntu users). Maybe you should encourage users to set up virtual environments or at least use pip install ---user
to install the package.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.