Given the following:
user_ = socket.gethostname()
runtime_ = time.ctime()
game_days = 'season open'
variable = 'speed'
start_time = datetime.time(15, 0)
weekdays = 'all days'
period = ['1/1/2013', '1/1/2020']
How can I use .format() see this. In order to get this output
print(tag)
User-WS, Mon Mar 27 07:30:08 2017 US/Central - season open
Variable: speed At: 15:00. all days 1/1/2013:1/1/2020
--------------------------------------------------------
Right now I'm doing:
tag = user_ + ', ' + runtime_ + ' US/Central - ' + game_days + '\n' + 'Variable: ' + \
variable + ' At: ' + str(start_time)[:-3] + '. ' + weekdays + ' ' + period[0] + ':' + period[1] + '\n' + \
'--------------------------------------------------------'
' + name + 'with a placeholder, so you have a single string, then passing all the names to.format. Did that not work?