“This is the sixth day of my participation in the Gwen Challenge in November. Check out the details: The Last Gwen Challenge in 2021.”
This is the third open source library released by Lei Academy
The Committee previously released the PPC tool and renxianqi universal counting tool, showing the development process of open source projects.
Just on Friday, the school committee released an article about the lottery, so today I spent some time thinking and writing a small lottery tool: Prize (very straightforward name).
Make sure you have Python and the PIP tool installed on your computer, use PIP to install and use the RXQ tool.
The first step is to install and use prize
Open any terminal or CMD
pip install prize
PIP install Choujiang
Copy the code
Or install this:
pip install prize
Copy the code
Or use the following command
pip install prize -i https://pypi.tuna.tsinghua.edu.cn/simple
Copy the code
After installation, you can use the following command to run the “Renxian Qi” counting tool:
Prize # or enter: choujiangCopy the code
After typing, we should see a screen pop up:
Here’s how the macbook tool looks after it’s installed, with a slight difference on Windows.
Click “Introduction to Use” menu to view the operation help.
The second step is to draw a prize
Scene one: Poets ‘poetry contest raffle
Here is a poem fight held by tang dynasty poets. But counting people is difficult.
With the renxianqi tool, the job is very easy, on the left are all the expected poets, and on the right are the poets who actually participate in the contest.
All poets expected:
Du Fu: The thatched hut is broken by the autumn wind li Bai: Silent night thinking Wang Bo: Send Du Shaofu to Shu Zhou Li He: Wild goose gate governor tripCopy the code
Then click the button: [card Generation], below generate 4 poet cards! \
Then click ‘re-draw’ and see the result:
We can see that there is temporary support for colon separation, which is preceded by the card ID to generate individual cards.
And then the lottery.
Other scenarios
This tool is not limited to one of the above scenarios, but also applies to the following:
- All comment sections (user id plus colon (:) format comment analysis intercepts, generated cards, raffles.
Similarly, we can find some event lists, copy all comments to the top text area, and click on ‘Generate cards’ and’ re-draw ‘.
Principle and data analysis
This tool will be finished today and released today (0.0.2). The committee will continue to send books to draw prizes (from station C) and keep updating and improving.
UI design process reference renxianqi tools and previous articles => nanny level guidance development UI application
Conclusion extended
This is just a small tool, but can handle any raffle scenario.
More fun, is a universal lottery tool. Another suggested command-line entry: Prize (Choujiang), which runs the human lottery gadget by opening any terminal.
Open any terminal or CMD, install and use it.
pip install prize
# or this one:
pip install choujiang
Copy the code
By the way, people who like Python, please pay attention to learn the Basic Python column or Python to master the big column
Continuous learning and continuous development, I am Lei Xuewei! Programming is fun. The key is to get the technology right. Welcome to pay attention, and feel free to like the collection!