本文整理匯總了Python中Path.Path.dir_working方法的典型用法代碼示例。如果您正苦於以下問題:Python Path.dir_working方法的具體用法?Python Path.dir_working怎麽用?Python Path.dir_working使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Path.Path
的用法示例。
在下文中一共展示了Path.dir_working方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: make_control
# 需要導入模塊: from Path import Path [as 別名]
# 或者: from Path.Path import dir_working [as 別名]
def make_control(argv):
# return a Bunch
print argv
if len(argv) not in (3, 4):
usage('invalid number of arguments')
pcl = ParseCommandLine(argv)
arg = Bunch(
base_name=argv[0].split('.')[0],
geo=pcl.get_arg('--geo'),
test=pcl.has_arg('--test'),
)
if arg.geo is None:
usage('missing --arg')
if arg.geo not in ('census_tract', 'zip5'):
usage('invalid GEO value: ', + arg.geo)
random_seed = 123456
random.seed(random_seed)
path = Path() # use the default dir_input
debug = False
return Bunch(
arg=arg,
debug=debug,
max_sale_price=85e6, # according to Wall Street Journal
path=path,
path_out_csv=path.dir_working() + arg.base_name + '-' + arg.geo + '.csv',
path_out_occurs=path.dir_working() + arg.base_name + '-' + arg.geo + '-occurs.pickle',
random_seed=random_seed,
test=arg.test,
)
示例2: make_control
# 需要導入模塊: from Path import Path [as 別名]
# 或者: from Path.Path import dir_working [as 別名]
def make_control(argv):
# return a Bunch
print argv
if len(argv) not in (1, 2):
usage('invalid number of arguments')
pcl = ParseCommandLine(argv)
arg = Bunch(
base_name=argv[0].split('.')[0],
test=pcl.has_arg('--test'),
)
random_seed = 123456
random.seed(random_seed)
path = Path() # use the default dir_input
debug = False
return Bunch(
arg=arg,
debug=debug,
path=path,
path_out=path.dir_working() + arg.base_name + '-' + 'derived.csv',
random_seed=random_seed,
test=arg.test,
)
示例3: make_control
# 需要導入模塊: from Path import Path [as 別名]
# 或者: from Path.Path import dir_working [as 別名]
def make_control(argv):
# return a Bunch
print argv
if len(argv) not in (1, 2):
usage('invalid number of arguments')
pcl = ParseCommandLine(argv)
if pcl.has_arg('--help'):
usage()
arg = Bunch(
base_name=argv[0].split('.')[0],
test=pcl.has_arg('--test'),
)
random_seed = 123456
random.seed(random_seed)
path = Path() # use the default dir_input
debug = False
file_out_transactions = (
('testing-' if arg.test else '') +
arg.base_name + '-al-g-sfr' + '.csv'
)
return Bunch(
arg=arg,
debug=debug,
max_sale_price=85e6, # according to Wall Street Journal
path=path,
path_in_census_features=path.dir_working() + 'census-features-derived.csv',
path_in_parcels_features_census_tract=path.dir_working() + 'parcels-features-census_tract.csv',
path_in_parcels_features_zip5=path.dir_working() + 'parcels-features-zip5.csv',
path_out_transactions=path.dir_working() + file_out_transactions,
random_seed=random_seed,
test=arg.test,
)