I use Geany for my IDE. It’s pretty good for what I do. I’m no hardcore coder. I just use Python for experimenting and learning.
It had been a little while since I did anything with Python. In fact, the last time I used it was before I installed Arch. I got a little bit of coding fever and wanted to refresh my memory. I was thinking about rewriting my Sudoku solver program, using functions instead of the hot mess that I left it in a few months ago.
But I was running into a little problem. When I would press F5 to run my program, the terminal that popped up gave me this error message:
./geany_run_script.sh: line 5: python: command not found ------------------ (program exited with code: 127) Press return to continue
“Well that’s no good,” I thought. It turns out that Geany was trying to run Python with the command “python,” which would be fine if “python” were the command it needed to run. But since I am using Arch, “python” is for the bleeding edge Python 3, whereas the more commonly used Python 2.7 is called with “python2.” Since I didn’t want to use Python 3 and didn’t have it installed, I needed to change the command to “python2″ so Geany wouldn’t give me these error messages anymore. Sure, I could just save the program and then open a terminal and type “python2 filename.py,” but that wouldn’t be a good solution because it would be a hassle.
I checked every preference menu I could find in Geany, but I couldn’t find a setting to change what it pointed to for running Python (or any other) programs. Then I looked all over the place for geany_run_script.sh, but I couldn’t find it anywhere, either. I did, however find some configuration files in /usr/share/geany. Particularly, I found /usr/share/geany/filetypes.python. That directory also had filetypes for all the languages that Geany supports. At the very end of filetypes.python were these lines:
[build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension # (use only one of it at one time) compiler=python -m py_compile "%f" run_cmd=python "%f"
Changing that last line took care of the problem:
run_cmd=python2 "%f"
So Geany stopped giving me error messages when I tried to run my Python programs and I was happy.
I still have a long way to go on rewriting my Sudoku solver, but I will post it here when it is updated. Keep an eye out.






Integrating Facebook comments with your WordPress site
2012 Leave a Comment
Now I’m going to show you how to add this feature to your WordPress site.
First go to developers.facebook.com/apps and click the Create New App button. Give this app a name, and ignore the App Namespace field. I named mine “danielveazey.com comments.” Click the checkbox saying that you agree with their platform policies, then click Continue. Type in the Captcha words to prove you’re not a spambot. Then you’re presented with a bunch of mumbo jumbo about App ID and API keys and whatnot.
Now go to developers.facebook.com/docs/reference/plugins/comments/. You should see this:
Now you’re going to get your hands a little dirty. Leave that code there and open a new tab on your browser. You need to get into two files in your WordPress theme, header.php and comments.php. Make a backup copy of these files before you go mucking about in them. From your WordPress dashboard, go to Appearance → Editor. Over on the right, click on header.php. Copy all the code in the editor window and save it to a file on your computer so you can change it back if you mess up. Do the same for comments.php.
In header.php, look for the <body> tag. Right below that line, paste all the code from the first part of the pop-up code that Facebook gave you. Make sure it’s the HTML5 version (it should be by default). It’s at the top of the pop-up window. Now click Update File at the bottom of the editor. Here is an example of what that part of the file might look like:
<body <?php body_class(); ?>> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=221223671306596"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script>Now open up comments.php and find the line that reads “You can start editing here.” Paste the second piece of code from Facebook right below that line. You should see your website’s URL where it says data-href=”http://blahblahblah.” Where your URL is, you need to replace that with ”<?php the_permalink(); ?>” so the comments will appear correctly.
So the whole line looks like this:
Click Update File at the bottom of the editor and you’re done. Now the Facebook comments should show up just above where your WordPress comments appear.
If you found this post helpful, please leave a Facebook comment below, or a WordPress comment below that. Or both.