Login Register






Steam game picker filter_list
Author
Message
Steam game picker #1
Whenever I get really bored, I end up just staring at my Steam library not knowing what the hell to do. I fixed that problem with this little program.
What it does is go through your local Steam files for your installed games and chooses 3 at random.

Source:
Code:
from random import randint as r from os import walk as f games = next(f('C:\Program Files (x86)\Steam\steamapps\common'))[1] disp = [games[r(0,len(games))]] def find_game(): for i in range(0,3): c = games[r(0,len(games))] disp.append(c) games.pop(games.index(c)) print "\t" + str(i+1) + ".",c.replace("_", " ") print "Selected games: " find_game()

Only bug: I occasionally get an IndexError, not totally sure why.

Anyway, enjoy your steam games Biggrin
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply

RE: Steam game picker #2
Hehe, thanks! I get bored a lot. Probably won't do much work because I have 7 or so games but anyway lmao.
Sent from hell straight to you. I killed the devil and now I'll kill you.

Reply

RE: Steam game picker #3
(08-30-2015, 06:45 AM)Chitoge Wrote: Whenever I get really bored, I end up just staring at my Steam library not knowing what the hell to do. I fixed that problem with this little program.
What it does is go through your local Steam files for your installed games and chooses 3 at random.

Source:
Code:
from random import randint as r from os import walk as f games = next(f('C:\Program Files (x86)\Steam\steamapps\common'))[1] disp = [games[r(0,len(games))]] def find_game(): for i in range(0,3): c = games[r(0,len(games))] disp.append(c) games.pop(games.index(c)) print "\t" + str(i+1) + ".",c.replace("_", " ") print "Selected games: " find_game()

Only bug: I occasionally get an IndexError, not totally sure why.

Anyway, enjoy your steam games Biggrin

On what line do you get an IndexError?
#MakeSinisterlySexyAgain

Reply

RE: Steam game picker #4
(09-01-2015, 05:11 PM)Adorapuff Wrote: On what line do you get an IndexError?

Code:
Traceback (most recent call last): File "steamPick.py", line 15 in <module> find_game() File "steamPick.py", line 9 in find_game c = games[r(0,len(games))] IndexError: list index out of range

I guess it's on 9, when it's picking a game. I've tried using try/except to catch it, but it doesn't seem to work.
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply

RE: Steam game picker #5
(09-01-2015, 05:26 PM)Chitoge Wrote:
Code:
Traceback (most recent call last): File "steamPick.py", line 15 in <module> find_game() File "steamPick.py", line 9 in find_game c = games[r(0,len(games))] IndexError: list index out of range

I guess it's on 9, when it's picking a game. I've tried using try/except to catch it, but it doesn't seem to work.

That's because randint uses the specified values inclusively Smile So len(games) should be len(games)-1.
[Image: CDUAq9d.png]

Reply

RE: Steam game picker #6
(09-03-2015, 02:39 PM)Shebang Wrote: That's because randint uses the specified values inclusively Smile So len(games) should be len(games)-1.

ooooh. That makes more sense. Thanks Biggrin
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply