↓を参考にSyntaxHighlighterを導入してみた。
http://gogotorotan.blogspot.com/2011/03/syntaxhighlighter.html
適当なソースファイルを貼り付けてみる。。。
http://gogotorotan.blogspot.com/2011/03/syntaxhighlighter.html
適当なソースファイルを貼り付けてみる。。。
class _calcDownloadSize(threading.Thread):
def __init__(self, urls, gauge):
threading.Thread.__init__(self)
self._urls = urls
self._gauge = gauge
self._maxBytes = 0
self._isStoped = False
def _getContentLength(self,url):
try:
return long(urllib.urlopen(url).info().getheaders("Content-Length")[0])
except IOError:
return 0
def run(self):
for url in self._urls:
if self._isStoped:
break
self._maxBytes = self._maxBytes + self._getContentLength(url)
self._gauge.SetRange( self._maxBytes )
def stop(self):
self._isStoped = True
# ここにはPythonのコードが入ります
返信削除# 例えば、以下のようなファイルを貼り付けることができます
def greet(name):
"""
与えられた名前に挨拶をする関数
"""
print(f"Hello, {name}!")
if __name__ == "__main__":
# メインの処理
username = input("Enter your name: ")
greet(username)
royal front hand mehndi design