File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 10
10
try :
11
11
pprint (flat_api .AccountApi (flat_api_client ).get_authenticated_user ())
12
12
except ApiException as e :
13
- print e
13
+ print ( e )
Original file line number Diff line number Diff line change 1
1
from pprint import pprint
2
- import os , urllib2
2
+ import os
3
+ from urllib .request import urlopen
4
+ from urllib .error import HTTPError
3
5
4
6
import flat_api
5
7
from flat_api .rest import ApiException
12
14
13
15
try :
14
16
# 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' )
16
18
17
19
# The new score meta, including the MusicXML file as `data`
18
20
new_score = flat_api .ScoreCreation (
23
25
24
26
# Create the document and print the meta returned by the API
25
27
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