發表文章

目前顯示的是 3月 5, 2019的文章

Adding several data on a specific column on a table

圖片
0 I am trying to create a table that can store a "Training Information" data. The code below is working (see sample result below) however, it can only add one data at a time. What I would like to happen is to be able to add several data on my "Attendees" column only, while the other columns will contain the same data since it is the same training. Any ideas? Dim ws As Worksheet Dim lo As ListObject Dim lr As ListRow Set ws = Sheets("Trainings") ws.Unprotect "321321" Set lo = ws.ListObjects(1) Set lr = lo.ListRows.Add lr.Range(1, 1).Value = UCase(title.Value) lr.Range(1, 2).Value = UCase(Date.Value) lr.Range(1, 3).Value = UCase(Venue.Value) lr.Range(1, 4).Value = UCase(VenueAdd.Value) lr.Range(1, 5).Value = UCase(Attendees.Value)

Python retry package - tenacity : How to log the root cause of exception?

圖片
1 As discussed in this question I am using tenacity to do retries. A toy code looks like below import logging from tenacity import retry import tenacity @retry(wait=tenacity.wait_incrementing(start=10, increment=10, max=100), stop=tenacity.stop_after_attempt(3)) def print_msg(): logging.info('Hello') logging.info("World") raise Exception('Test error') if __name__ == '__main__': logging.basicConfig( format='%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s', datefmt='%d-%m-%Y:%H:%M:%S', level=logging.INFO) logging.info('Starting') print_msg() The output looks like below 21-11-2018:12:40:48,586 INFO [retrier.py:18] Starting 21-11-2018:12:40:48,586 INFO