Saturday, October 13, 2007

Pysol

Back when we were using Fedora Core 4 or so I played a card game called Pysol. Liked it a lot, but as time passed and Fedora was updated, so was Python. As of Python 2.5 Pysol would no longer work. Or so it seemed. A user at http://www.fedoraforum.org posted to a thread that I was following stating that he had the game working. I followed his lead and got Pysol working for me too. Here's what to do.

Assuming the link is still good, download Pysol from www.fedoraforum.orgpysol-4.82.1-5.1.noarch.rpm The file should save to your desktop. To install, open a terminal and type
sudo rpm -Uh /home/yourusername/Desktop/pysol-4.82.1-5.1.noarch
This installs Pysol in ''/usr/share/games/pysol''. Now you need to make an alias in your '''.bashrc''' file in your home directory. To do that, in a termial, as your regular user, type
gedit .bashrc
Add this line,
pysol='python /usr/share/games/pysol/pysol.py'
to the bottom of the file, save and exit. Run the game as root the first time. Quoting the member who posted the fix, "run as root first time to ensure the .pyc modules are created correctly." For me, the game still wouldn't work. I tried everything that my particular level of Linux experience would allow me to think of. I remember from the Fedora Core 4 / "Pysol was working" days that the game seemed to depend on '''TCL''' and '''tk''', so I installed both of them,
yum install tcl tk
but that didn't help. They both installed OK but nothing changed. The game still would not work. No matter what I tried Pysol refused to run. After several attempts I got some error output that hinted that Pysol needed tkinter to function. Off to the terminal again
yum install tkinter
This time I met with success. The installation of tkinter was exactly what I needed to get the game working. From a terminal, launch Pysol with this command
python /usr/share/games/pysol/pysol.py &
The game finally worked, so it was time to make a desktop launcher so I don't have to open a terminal and remember what the command was. To do that, right click the desktop and select '''create launcher'''. In the ensuing dialog box enter the name of the game, '''Pysol''', and the command to launch the game, '''python /usr/share/games/pysol/pysol.py &'''.

[[Image:screenshot-create launcher.png]]

I also went to the trouble of getting the correct icon to display, but that isn't so straight forward. You can click the icon button in the launcher dialog but you probably won't be able to select the pysol icon. What I did was to just save the launcher without an icon, then right click the launcher and select '''properties'''. There you can click the icon button and make your way to '''/usr/share/games/pysol'''. There you can select the pysol icon and close the properties dialog. You will now have the lovely '''club''' icon for the game. Good luck.

No comments: