LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

File conversion script

Posted 12-29-2012 at 10:04 AM by Snark1994
Updated 12-29-2012 at 10:10 AM by Snark1994

A handy script I put together to automatically convert between file formats based on file extension, in an easily extensible manner:

Code:
#!/usr/bin/env bash

#Conversion rules:
# commands["extension_from extension_to"]="convert_command"
# INFILE and OUTFILE in the conversion command are replaced
# with the appropriate filenames

declare -A commands
commands["wav mp3"]="ffmpeg -i INFILE OUTFILE"
...
Senior Member
Posted in Uncategorized
Views 1488 Comments 0 Snark1994 is offline
Old

Python - check if in IDLE

Posted 10-01-2011 at 05:28 AM by Snark1994

Another useful thing which I didn't realise before:

How do you get your python programme to check if it's running in IDLE or in the terminal? I tend to use the IDLE in Windows for debugging, and run programmes by double clicking so they open in the terminal.

There's not much difference between the two, but 'print'ing is slower in IDLE, and you can't use '\r' to overwrite things already printed.

Luckily, there's an easy way to check.

Code:
from
...
Senior Member
Posted in Uncategorized
Views 1283 Comments 0 Snark1994 is offline
Old

Opera Middle-Click Functionality

Posted 09-20-2011 at 03:56 PM by Snark1994
Updated 12-29-2012 at 10:07 AM by Snark1994

Just a handy hint to fix something which has bugged me for ages - if you middle click in Opera under Arch linux (and probably other distros), rather than scrolling, it tries to paste text and seems to end up searching for whatever's in your clipboard.

Luckily, this can be changed. Strangely, it's completely non-obvious.

Shift+Middle Click brings up a dialog which allows you to change your middle-click settings.
Senior Member
Posted in Uncategorized
Views 1936 Comments 1 Snark1994 is offline

  



All times are GMT -5. The time now is 04:13 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration