python - Issue creating .txt file with long name -
i trying create series of text files reasonably long names (but near 260 characters). example file name is:
premier_league-tottenham v manchester city-saturday, aug 14 2010-12:45-0-0-410996-home-team-2010-2011-30-2015-06-14.txt
the code using generate looks like:
mylogprint = "premier_league" + '-' + str(the_home_name) + ' v ' + str(the_away_name) + '-' + str(the_match_date) + '-' + str(the_match_time) \ + '-' + str(the_ft_score) + '-' + str(matchid) + '-' + num_list2 + '-' + myseasonstart + '-' + myseasonend + '-' + str(slot_list2) + '.txt'
however, file being created as:
premier_league-tottenham v manchester city-saturday, aug 14 2010-12
here half file name missing, including '.txt' on end. can tell me issue here?
thanks
if working files in windows, colon (:) invalid character in filename.
Comments
Post a Comment