LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Project - UK & EU Lottery killas / Open Source donation builders
#11
removed not on topic, not to be aiding the hijacking of my thread.

Reply
#12
Hello Mart,
I have done a new UK Lotto python script Smile .
Its actions are like a combination of the initial idea, and the first posted version above.

It is still 4 lines long, but is less typing, it doesn't need all the numbers to be typed out.
I also added to the output text that it is the lotto numbers.
I have also added more comment lines in the code to explain better what each part is doing.

[Image: next.png]

Screenshot of new UK Lotto number picker running in terminal on Linux Lite, and also showing code in Gedit.

Here is the code, I saved it to a Leafpad document in Home folder and name it next.py

Code:
# imports random function
import random

# labelling for lotto number output
print ("Your UK lotto numbers are - ")

# Picks 6 random numbers between 1 and 59
# range goes to 60 so that 59 is inclusive, 60 is not inclusive
# .sample does not duplicate numbers picked
# Outputs these 6 results in a list
print(random.sample(range(1, 60),6))

# interactivity - prints options
print ("You have Options - " "\nDonate a percentage of any wins to your favorite project" "\nDonate the stake instead to your favorite project")

To run this open your terminal by holding down Ctrl and Alt keys and pressing t (Ctrl+Alt+t) .
Then copy/paste or type into terminal -
Code:
python next.py
then press Enter key.


Side note - removed other linux topic not on topic in this thread.
Reply
#13
Hello,
using the second version of the UK Lotto above I have redone the EuroMillions Python script.

[Image: eunext.png]

EuroMillions new version with less typing, and improved comment lines, running on Linux Lite in Terminal and showing code in Gedit.
I save this to a Leafpad document in Home folder and named this eunext.py


Here is the code


Code:
# imports random function
import random

# labelling for lotto number output
print ("Your EuroMillions numbers are - ")

# Picks 5 random numbers between 1 and 50
# range goes to 51 so that 50 is inclusive, 51 is not inclusive
# .sample does not duplicate numbers picked
# Outputs these 5 results in a list
print(random.sample(range(1, 51),5))

print ("Your Lucky Stars are - ")

print(random.sample(range(1, 13),2))

# interactivity - prints options
print ("You have Options - " "\nDonate a percentage of any wins to your favorite project" "\nDonate the stake instead to your favorite project")

To run this open terminal by holding down Ctrl and Alt keys and pressing t (Ctrl+Alt+t)
Then copy/paste or type

Code:
python eunext.py

I hope you enjoyed reading this.
Reply
#14
Removed socially friendly infos above here to comply with, not on topic

Result at this stage is -

1/ producing the lotto numbers randomly as it is intended for.

2/ button click output is printing to terminal, not to my output box above button.Unsure what I am doing wrong in the code, I have tried pretty much every trial and error I can think of at this time, as just learning Python.
I will have another try at getting the numbers to appear in the output box, at a future time.

3/ the Donate button does nothing yet, I am unsure of the code to add for it to open the browser, I doubt this will be difficult so I leave it for last after fixing output.

Reply
#15
Demo of Fully functioning

https://www.youtube.com/watch?v=NpLAq6XS_wA




Reply
#16
Well done [member=411]bitsnpcs[/member] Smile
Reply
#17
Thank You [member=2]Jerry[/member]  Smile

Reply
#18
Demo v1.01

https://www.youtube.com/watch?v=bcAzTAHqCWk
Reply
#19
Demo of Final.

https://www.youtube.com/watch?v=yLAAlE5FKoo
Reply
#20

[member=411]bitsnpcs[/member]
That's very clever, great job!
Smile
[Image: q7j1yAl.png]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)