Share on Facebook Tweet on Twitter Share on LinkedIn Share by email
Sho Screenshots and Examples

Sho Console showing matrix manipulation

Sho console 

"Intellisense"-like behavior

Available for class, method, and filename; activated by hitting <TAB> in the console

Command-completion example

Using doc() to Inspect Objects

>>> f = System.Windows.Forms.Form()
>>> doc(f)
 

 

Plotting a Sine Wave

>>> x = drange(0, 2*PI, 0.05)
>>> plot(x, sin(x))
 

Sine wave graph

Computing a Word Histogram

>>> txt = System.IO.File.ReadAllText("./declarationofindependence.txt")
>>> table = System.Collections.Hashtable()
>>> for word in txt.split():
if table.ContainsKey(word):
table[word] += 1
else:
table[word] = 1
>>> pairs = zip(table.Keys, table.Values)
>>> elts = sorted(pairs, lambda a, b: a[1] < b[1])[:10]
>>> words, counts = zip(*elts)
>>> bar(words, counts)
 

Creating a Simple GUI

>>> f = System.Windows.Forms.Form()
>>> b = System.Windows.Forms.Button()
>>> f.Controls.Add(b)
>>> b.Text = "Hello World"
>>> b.Location = System.Drawing.Point(250,100)
>>> f.Width = 561
>>> def printhello(sender, evtinfo):
print "Hello World!"
>>> b.Click += printhello
>>> f.ShowDialog()