defgetTitleArtist(user,playlist_id):
playlist=sp.user_playlist(user,playlist_id)
for item in playlist['tracks']['items']:
list_title_artist.append(item)
return list_title_artist
for i inrange(len(title_artist)):
title=title_artist[i]['track']['name']
artist=title_artist[i]['track']['album']['artists'][0]['name']
print(str(i+1)+".",title,"/",artist)
import bpy
import random
for m in bpy.data.meshes:
bpy.data.meshes.remove(m)
defmake_sphere(x, y, z):
loc = (x, y, z)
sphere = bpy.ops.mesh.primitive_uv_sphere_add(location=loc)
defmake_cube(x, y, z):
loc = (x, y, z)
cube = bpy.ops.mesh.primitive_cube_add(location=loc)
defmain():
for i inrange(30):
make_sphere(
random.uniform(-1, 1)*10,
random.uniform(-1, 1)*10,
random.uniform(-1, 1)*10)
make_cube(
random.random()*10,
random.random()*10,
random.random()*10)
if __name__ == '__main__':
main()