0
def delete_events(self):
self.ucn = self.user_channel_number
print 'The channel number in the process: ', self.ucn
self.bids = self.channel_events_book_ids
print 'Events book ids', self.bids
print '', len(self.bids), 'events on the planner will be deleted'
are_you_sure = raw_input('Channel number is correct. Are you sure to delete channel number? (y/n): ')
if are_you_sure == 'y' and len(self.bids) !=0 :
print 'The selected program will be deleted'
action = 'DeleteEvent'
menu_action = 'all'
book = self.bids[0]
arg_list = [('C:\\Users\\yke01\\Documents\\StormTest\\Scripts\\Completed'
'\\Utils\\UPNP_Client_Cmd_Line.py')]
arg_list.append(' --action=')
arg_list.append(action)
arg_list.append(' --ip=')
arg_list.append('10.10.8.89')
arg_list.append(' --objectId=')
arg_list.append(book)
subprocess.call(["python", arg_list])
print 'The program deleted successfully'
else:
print 'The program is NOT deleted!'
我已经获得了书目ID的列表。我想通过这些数字来预订变量来删除事件。如何将列表中的元素传递给变量
output of bookids samples : ['BOOK:688045640', 'BOOK:688045641', 'BOOK:688045642', 'BOOK:688045643', 'BOOK:688045644', 'BOOK:688045645', 'BOOK:688045646', 'BOOK:688045647']
我可以删除与下列动作单一事件:
book = self.bids[0]
如何我可以通过bookids列表元素预定变量?
你试过用“for”循环吗? 您是否还想将“BOOK:688045640”或“688045640”传递给“--objectId =”参数 – SunilT