Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F83468453
next_candidate.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Sep 17, 07:34
Size
443 B
Mime Type
text/x-python
Expires
Thu, Sep 19, 07:34 (2 d)
Engine
blob
Format
Raw Data
Handle
20843331
Attached To
R12953 next_candidate
next_candidate.py
View Options
import
random
import
sys
from
PIL
import
Image
from
utils
import
candidates
if
len
(
sys
.
argv
)
>
1
:
exceptions
=
sys
.
argv
[
1
]
.
lower
()
.
replace
(
" "
,
""
)
.
split
(
","
)
for
missing
in
exceptions
:
if
missing
in
candidates
:
del
(
candidates
[
missing
])
c
=
random
.
choice
(
list
(
candidates
.
keys
()))
# Show image of the candidate
with
Image
.
open
(
candidates
[
c
])
as
im
:
im
.
show
()
print
(
"The winner for the next week is: "
,
c
)
Event Timeline
Log In to Comment