Python

itunes2ppp

前の日記で使ったスクリプトを利用して、PyPodcastPlayer用podcast_list.txtを作成するスクリプト。 PyPodcastPlayerソースファイルに同梱。

Pythonでmp3ファイルを再生するには

pygame: import pygame.mixer pygame.mixer.init() pygame.mixer.music.load('test.mp3') pygame.mixer.music.play() # pygame.mixer.music.stop() Win32 extensions:http://starship.python.net/crew/mhammond/win32/ from win32com.client import Dispat…

PyPodcastPlayer

Podcastを読み込み、再生するPythonスクリプト。 ファイル再生にpygame使用。 ソースファイル

解決だっちゃ

参考:解決策模索中 - DiaryException 「Downloads」の「Other」-「win32-dependencies.zip」をダウンロード、解凍。 「win32-dependencies\prebuilt\lib」の中のファイルを全て「Python\Lib\site-packages\pygame」にコピー。オリジナルのファイルは拡張子…

解決策模索中

Windows XP python-2.4.2 pygame-1.7.1release.win32-py2.4 import pygame.mixer pygame.mixer.init() pygame.mixer.music.load('test.mp3') pygame.mixer.music.play()応答。 pygame.mixer.music.load('test.mp3') pygame.error: Module format not recogni…

リストに基づきファイルコピィ

import os import sys import shutil import string separator = "," def copy_file(src, dst) : if os.path.exists(src) : if os.path.isdir(src) : if os.path.exists(dst) : os.removedirs(dst) shutil.copytree(src, dst) elif os.path.isfile(src) : if…

PythonとiTunes

参考:iTunesのDRM技術を破る新アプリ「PyMusique」公開 - ITmedia NEWS 「Py」って書いてあるから、まさか・・・と思ったら案の定。Python万歳。はは。 ITmediaでソフトへのリンクが張られてないのは利用規約*1違反だからなんだろうなあ。 ってわけで、ここ…

簡易Webブラウザ

Pythonで。 import sys import webbrowser import wx import wx.lib.iewin as iewin url="about:blank" class BrowsPanel(wx.Panel) : def __init__(self,parent,id) : wx.Panel.__init__(self,parent,-1) sizer=wx.BoxSizer(wx.VERTICAL) urlsizer=wx.BoxSi…

セキュリティホール

http://www.python.jp/Zope/PyLog//1107483069/index_html(Python Japan User's Group) 僕が作ったXML-RPCサーバはregister_instance()を使用しています。 セキュリティってのは、安全を構築するような環境も大切ですけれど、普段からの個人の心掛けが大切…

XML-RPCでデータベース利用

1月6日の日記の郵便番号検索プログラムを参考にする。昨日の西暦-元号対応リスト(gengo.txt)をサーバスクリプトと同じディレクトリに保存しておく。 Pythonで。 元号取得サーバ(gengoServer.py) import sys import string import SimpleXMLRPCServer year=…

XML-RPC勉強中

http://www.donews.net/limodou/archive/2004/09/22/106517.aspxを見つけた。Pythonをかなりマスターしている中国の方の例です。他のページもすごく勉強になる。 XML-RPCとJavaのRMIとの決定的な違いは、XML-RPCはHTTPプロトコルを使用していて、RMIはJRMP(J…

今更XML-RPC

XML-RPCはHTTPプロトコルを使用しXMLをメッセージ媒体として利用して、リモート手続きを呼び出す(Remote Procedure Call)ための非常に簡単な方法である。 詳しいことは、はてなキーワードの[XML-RPC]を見る他、用語辞典を参照。 仕様書はhttp://lowlife.jp…

シリアルポートからデータを読む

計測制御系研究室なので、こういったことを扱う機会が多い。 研究室のパソコンにはPerlとCと、後Javaランタイムしか入って無いのだが、あえてPythonで書いてみる。今年はPythonもインストールしよう。 pySerial*1使用。 01: import wx 02: import serial 03:…