import os, re, shutil, sys, platform
pyversion = platform.python_version()
+islinux = platform.system().lower() == 'linux' or False
+
if pyversion[:3] in ['2.5', '2.6', '2.7']:
import urllib as urllib_request
import codecs
if os.path.isfile(dest):
print( 'File %s up to date.' % dest )
return
- print( 'Downloading from [%s] ...' % url )
- urllib_request.urlretrieve( url, dest )
- print( 'Download complete.\n' )
+ global islinux
+ if islinux:
+ # we use wget instead urlretrieve under Linux,
+ # because wget will display details like download progress
+ os.system('wget %s' % url)
+ else:
+ print( 'Downloading from [%s] ...' % url )
+ urllib_request.urlretrieve( url, dest )
+ print( 'Download complete.\n' )
return
def GetFileFromUnihan( path ):