download_mp3.py
>>
###################################################
# Download mp3 file from the url using Python 3.6
###################################################
import datetime
from urllib.request import urlretrieve
today = datetime.datetime.now().strftime("%Y%m%d")
url = 'http://www.changelife.org.tw/data/files/morning_bible_study/%s.mp3' %today
filename="%s.mp3" %today
response = urlretrieve(url,filename)
download_mp3.bat
>>
python download_mp3.py
DanBrother 發表在 痞客邦 留言(0) 人氣(328)

If you have Python 2 >=2.7.9 or Python 3 >=3.4 installed from python.org, you will already have pip and setuptools, but will need to upgrade to the latest version:
C:\Users\danbrother>pip install -U pip setuptools
Requirement already up-to-date: pip in f:\python\python36-32\lib\site-packages
Collecting setuptools
Downloading setuptools-36.5.0-py2.py3-none-any.whl (478kB)
100% |████████████████████████████████| 481kB 1.2MB/s
Installing collected packages: setuptools
Found existing installation: setuptools 28.8.0
Uninstalling setuptools-28.8.0:
Successfully uninstalled setuptools-28.8.0
Successfully installed setuptools-36.5.0
DanBrother 發表在 痞客邦 留言(0) 人氣(50)
NumPy is the fundamental general-purpose array_processing package for
scientific computing with
Pythondesigned to
efficiently manipulate large multi-dimensional arrays of arbitrary records without sacrificing too much speed for small multi-dimensional arrays.
NumPy is built on the Numeric code base and adds features introduced by numarray
as well as an extended C-API and the ability to create arrays of arbitrary type
which also makes NumPy suitable for interfacing with general-purpose data-base applications.
To download NumPy wheels, go to the URL:https://pypi.python.org/pypi/numpy DanBrother 發表在 痞客邦 留言(0) 人氣(10)
Pyinstaller works fine in Python 3.5 (e.g. pyinstall report.py)
whereas in Python 3.6.2 it ran into problem with the error message: IndexError: tuple index out of range
To solve the problem, cx_Freeze module needs to be installed and setup as follows:
DanBrother 發表在 痞客邦 留言(0) 人氣(867)
Python 3.6.2 Script for Generating Directories and Files Used by Oracle SQL*Loader
E:\pytest>type GEN_FILES.py
###############################################################################
# Python 3.6.2 Script for Generating Directories and Files Used by Oracle SQL*Loader
# Syntax: GEN_FILES.py {LOTTERY_TYPE} {DATE}
# e.g. python GEN_FILES.py BIG_Lottery 20170908
# Programmed by DanBrother
###############################################################################
DanBrother 發表在 痞客邦 留言(0) 人氣(21)
Python - Connect to SQL Server DB Examplepyodbc is an open source Python extension module that makes access to ODBC databases easier.
It implements the DB API 2.0 specification but is packed with even more Pythonic convenience.DanBrother 發表在 痞客邦 留言(0) 人氣(55)
Python - Connect to Oracle DB Examplescx_Oracle is a Python extension module that enables access to Oracle Database and conforms to the Python database API specification. This module is currently built against version for Oracle Client 11.2 onwards and Python 2.7, 3.4, 3.5 and 3.6.
DanBrother 發表在 痞客邦 留言(0) 人氣(2,648)
Introducing to Python Text Sequence Type — strStrings are mutable sequences of Unicode code points. DanBrother 發表在 痞客邦 留言(0) 人氣(9)
Introducing to Python Sequence Types — List, Tuple & Range DanBrother 發表在 痞客邦 留言(0) 人氣(48)
Python >>> a, b = b, a + b
>>> a , b = 0 , 1
>>> a
0
>>> b
1
DanBrother 發表在 痞客邦 留言(1) 人氣(14)