Welcome to pyLottoSimu’s documentation!¶
Lotto Generator and Simulator
a simulation of Lotto Germany (pick 6 out of 49), Lotto Austria (pick 6 out of 45), EuroMillionen, Powerball Lottery US, Mega Millions lottery and Hot Lotto Sizzler system.
The pyLottoSimu program generates random lottery numbers and can simulate a draw. In the simulation view a Lotto Ball is visible on the numbers rotate faster and faster, and is finally available, this is the text, the first number of today’s draw was the … Maybe it was indeed actually the numbers of the next draw, of course are here, all the figures provided without guarantee.
pyLottoSimu can be started in these languages:
English, German, French, Spanish, Italian, Danish, Dutch, Polish and Russian
Start¶
The program requires Python 2.7 or 3.x and Qt5 for Python.
Start with:
python lotto.pyw [de|dk|fr|es|it|nl|pl|ru]
Documentation¶
Make the documentation as .html file:
cd docs
make html
Add new modules with:
cd docs
sphinx-apidoc -f -o . ../pylottosimu

Contents:
Installation¶
Installing pyLottoSimu should usually be quite easy, as you can simply unpack and run pyLottoSimu in place if you wish to do so.
dependencies¶
You’ll need these dependencies to run the program:
build the help
- Sphinx - Documentation
code test
- pep8 - Python style guide checker
- pycodestyle - Python style guide checker
- isort - import sorting and checking tool
- nose - start nosetests to run the tests
version control system Git
- Git - Git - distributed version control system
Installing Debian or Ubuntu¶
First you need to your computer these programs: Python, pyQt5 and version control system git:
# sudo apt-get install python python-pyqt5 python-pyqt5.qtsvg git
# sudo apt-get install python3 python3-pyqt5 python3-pyqt5.qtsvg git
Then you copied the source code of the program on your computer, either download the zip file of the project or download with the version control system:
# git clone https://github.com/MarkusHackspacher/pyLottoSimu.git
change the directory and run:
cd pyLottoSimu
./lotto.pyw
alternative:
python lotto.pyw [de|dk|fr|es|it|nl|pl|ru]
python3 lotto.pyw [de|dk|fr|es|it|nl|pl|ru]
Contribute¶
Feel free and send a pull request to https://github.com/MarkusHackspacher/pyLottoSimu . If you have an idea, tell it at https://gitter.im/MarkusHackspacher/pyLottoSimu . Thank you in advance.
Translate¶
GUI Translate¶
To translate the program or make a translation in your language, insert in the complete.pro your language code.
cd pylottosimu
pylupdate5 complete.pro
translate your language file: lotto1_xx.ts, and produce the .ts translation files with:
lrelease complete.pro
At Linux should you install the pyqt5-dev-tools to use the pylupdate5 command and qttools5-dev-tools for the lrelease:
apt-get install pyqt5-dev-tools qttools5-dev-tools
Documentation Translate¶
this documentation is in English and translated in German, generated by Sphinx.
Extract document’s translatable messages into pot files. As a result, many pot files are generated under _build/locale. With sphinx-intl command update the docs/locale/de directory:
cd docs
make gettext
sphinx-intl update -p _build/locale -l de
translate the .po files in ./locale/de/LC_MESSAGES/ and build mo files:
sphinx-intl build
To build local the docu in German:
make -e SPHINXOPTS="-D language='de'" html
History¶
Version¶
The current version is 1.7 from June 3, 2017.
Version 1.6.1¶
Version 1.6.1 from September 2, 2015.
Version 1.6¶
The version 1.6 from June 3, 2015 could be choose between four lottery systems, the German 6 out of 49 is default, the Austrian 6 out of 45 with a bonus number, the Euro 5 million from 50 with two Super numbers 1-11 and as well as the American Powerball Lottery 5 of 59 and a Bonus number in the range 1 to 35th Under the hood, the program logic of the surface is no longer dependent and it will in the next version also use the program without a graphical Enter surface. So the program structure is clearly arranged and it may be better to reuse parts of the program in other programs. Furthermore can be with Python tools create an .exe file:
python setup.py py2exe
If anyone would like to offer this program as a gimmick on his website, thereby adjusts the link to the homepage it can do like to feel free.
Version 1.5¶
The Version 1.5 from February 20, 2014, can be start with Qt4 or QT5.
Version 1.4¶
The renewals in Version 1.4 of October 3, 2013 from pyLottoSimu is multilingualism there are now nine languages. And in Program window there is a major change, it can now Select whether the number overview window to appear automatically after the draw.
pylottosimu¶
pylottosimu package¶
Subpackages¶
pylottosimu.dialog package¶
Manage the GUI of setting dialog. Use lottosystem.ui.
-
class
pylottosimu.dialog.lottosettingdialog.
LottoSettingsDialog
(sysdat, parent=None, testcase=None)[source]¶ Bases:
PyQt5.QtWidgets.QDialog
The GUI of Settings.
Parameters: - sysdat (string) – Lotto setting
- parent (string) – parent window
-
static
get_values
(sysdat, parent=None)[source]¶ static method to create the dialog and return (dialog.values, accepted)
Parameters: sysdat (string) – Lotto setting Returns: dialog.values, accepted Return type: array of int, bool
show a Dialog with all the ball numbers from the draw and the bonus numbers.
-
class
pylottosimu.dialog.show_drawing.
DlgShowDrawing
(ballnumbers, highestnumber, bonusnumbers=False, highestbonus=False)[source]¶ Bases:
PyQt5.QtWidgets.QDialog
Show the numbers in a dialog box
Parameters: - ballnumbers (tuple of int) – the number of draw
- highestnumber (int) – the number of the PushButtons
- bonusnumbers (int) – the bonus numbers
- highestbonus (int) – the highest bonus number (separate numbers)
Returns: None
Array of buttons from 1 to the highest number and buttons for the additional numbers
Returns: None
additional dialogs
Submodules¶
pylottosimu.lottosystem module¶
-
class
pylottosimu.lottosystem.
LottoSystemData
[source]¶ Bases:
object
loads predefined lottery systems. And read and write a json file of the data set.
Dataset:
- name: name of the lottery system,
- max_draw: highest number of draw
- draw_numbers: number to pick
- with_addit: with additional number
- sep_addit_numbers: with separate additional number, the additional number are not in the same pot
- addit_numbers: additional number to pick
- max_addit: highest additional number in the separate pot
-
static
fixdata
()[source]¶ Data of predefined lottery system.
The following are predefined: Lotto Germany (pick 6 out of 49), Lotto Austria (pick 6 out of 45), EuroMillionen, Powerball Lottery US, Mega Millions, Hot Lotto Sizzler
If you miss your favorite lottery system than could you add here.
Returns: data
pylottosimu.pylotto module¶
class LottoSimuDialog¶
Load the GUI and manage the signals for the program of the pyLottoSimu. Use the lottosimu_gui.ui
class drawlotto¶
simulate a lotto draw. draw the lotto numbers and give the draw text back
-
class
pylottosimu.pylotto.
DrawLotto
(name='Lotto DE', max_draw=49, draw_numbers=6, with_addit=True, addit_numbers=1, sep_addit_numbers=True, max_addit=9, name_addition='Superzahl')[source]¶ Bases:
PyQt5.QtCore.QObject
simulate a lotto draw
Parameters: - name (string) – name of game
- max_draw (int) – maximal draw numbers
- draw_numbers (int) – the draw numbers
- with_addit (bool) – with additional number
- addit_numbers (int) – the additional numbers
- sep_addit_numbers (bool) – separates additional numbers
- max_addit (int) – maximal additional numbers
-
class
pylottosimu.pylotto.
LottoSimuDialog
[source]¶ Bases:
PyQt5.QtWidgets.QMainWindow
The GUI and program of the pyLottoSimu.
-
action_lottosim
()[source]¶ Changing the layout for simulation or generation and change the visible of the buttons.
Returns: none
-
onbtn_start
()[source]¶ Start simulation with the first drawing init timer with the valve from the Scrollbar the next drawing starts with the timer event.
Returns: none
-
Module contents¶
Manage a Lotto simulation draw.
tests package¶
Submodules¶
tests.test_drawlotto module¶
tests.test_lottosettingdialog module¶
Test the dialog module
lottosettingdialog
Setup for testing, create the UI_lottosystem.py file:
cd dialog/ pyuic4 –output UI_lottosystem.py lottosystem.ui
tests.test_lottosystemdata module¶
Testcase for module pylottosimu.lottosystemdata
tests.test_show_drawing module¶
Test the dialog module show_drawing
-
class
tests.test_show_drawing.
ShowDrawingTestCase
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Test of drawing
-
test_highernumbers
()[source]¶ test with higher draw numbers as the highest number in the draw in the ball numbers and in the bonus numbers
Returns: none
test the same ball numbers and bonus numbers in a maximal draw of 5 numbers
Returns: none
-
Module contents¶
test case