Last active
May 11, 2020 14:03
-
-
Save zclongpop123/8ff2796dddeaff1e99c346b721227737 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #======================================== | |
| # author: Changlong.Zang | |
| # mail: [email protected] | |
| # time: Wed Apr 29 22:27:56 2020 | |
| #======================================== | |
| import xlrd | |
| import shotgun_api3 | |
| #--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | |
| def main(): | |
| ''' | |
| ''' | |
| sg = shotgun_api3.Shotgun('https://zclongpop123.shotgunstudio.com', | |
| login='[email protected]', | |
| password='************') | |
| excel = xlrd.open_workbook('C:/Users/zangchanglong/Desktop/workbook.xlsx') | |
| table = excel.sheets()[0] | |
| for i in range(1, table.nrows): | |
| shot_name = table.cell_value(i, 0) | |
| task_percent = table.cell_value(i, 1) | |
| shot_data = sg.find_one('Shot', [['code', 'is', shot_name]], ['code', 'id']) | |
| sg.update('Shot', shot_data['id'], {'sg_task_finish_percent': int(task_percent)}) | |
| print shot_data | |
| print shot_name, task_percent | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment