samedi 4 avril 2015

Creating a directory with strings of arrays as the name

I simply need to create a directory in python using



os.system('mkdir ' + sub_dir)


with



sub_dir = ('x_y_prior=' + str(not use_est_centroid) +
'_randomized_x_y=' + str(randomize) +
'_sep=' + str(separation) +
'_num_trial_arr=' + str(num_trial_arr) +
'_seed_arr=' + str(seed_arr) +
'_image_params=' + str(image_params) +
'_obj_a_info=' + str(obj_a) +
'_obj_b_info=' + str(obj_a))


The variables consist of arrays. Now the problem is that when I attempt this, the command creates many directories with the individual elements of the each array as a name.


For example, if



separation = [1.2,1.4]


then I will get two directories named



1.2/


and



1.4/


I simply want one directory with the name of the entire string above.


Aucun commentaire:

Enregistrer un commentaire