PowerShell/demos/python/class1.py
2016-08-04 16:56:43 -07:00

19 lines
492 B
Python
Executable file

#!/usr/bin/python3
import json
# Define a class with a method that returns JSON
class returnsjson:
def method1(this):
return json.dumps(['foo',
{
'bar': ('baz', None, 1.0, 2),
'buz': ('foo1', 'foo2', 'foo3')
},
'alpha',
1,2,3])
c = returnsjson()
print (c.method1())