File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1010try :
1111 pprint (flat_api .AccountApi (flat_api_client ).get_authenticated_user ())
1212except ApiException as e :
13- print e
13+ print ( e )
Original file line number Diff line number Diff line change 11from pprint import pprint
2- import os , urllib2
2+ import os
3+ from urllib .request import urlopen
4+ from urllib .error import HTTPError
35
46import flat_api
57from flat_api .rest import ApiException
1214
1315try :
1416 # Download a MusicXML "Hello World"
15- hello_world = urllib2 . urlopen (SCORE_TO_IMPORT ).read ()
17+ hello_world = urlopen (SCORE_TO_IMPORT ).read (). decode ( 'utf-8' )
1618
1719 # The new score meta, including the MusicXML file as `data`
1820 new_score = flat_api .ScoreCreation (
2325
2426 # Create the document and print the meta returned by the API
2527 pprint (flat_api .ScoreApi (flat_api_client ).create_score (new_score ))
26- except (ApiException , urllib2 . HTTPError ) as e :
27- print e
28+ except (ApiException , HTTPError ) as e :
29+ print ( e )
You can’t perform that action at this time.
0 commit comments