File: testgetstrdata.py

package info (click to toggle)
pyferret 7.6.5-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 138,136 kB
  • sloc: fortran: 240,609; ansic: 25,235; python: 24,026; sh: 1,618; makefile: 1,123; pascal: 569; csh: 307; awk: 18
file content (23 lines) | stat: -rw-r--r-- 767 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# To be run in python after importing and starting pyferret
# such as from running "pyferret -python"

from __future__ import print_function

import sys ; sys.ps1 = '' ; sys.ps2 = ''
print()

print('>>> pyferret.run(\'let strarr = {"one", "two", "three", "four", "five", "six"}\')')
pyferret.run('let strarr = {"one", "two", "three", "four", "five", "six"}')
print(">>> pyferret.run('list strarr')")
pyferret.run('list strarr')
print(">>> strdict = pyferret.getstrdata('strarr')")
strdict = pyferret.getstrdata('strarr')
print(">>> print pyferret.metastr(strdict)")
print(pyferret.metastr(strdict))
print(">>> strdata = strdict['data']")
strdata = strdict['data']
print(">>> repr(strdata.squeeze())")
repr(strdata.squeeze())
print(">>> repr(strdict)")
repr(strdict)