Sunday

Online Python Script Interpreter(s)

Read-Evaluate-Print Loop IT
url: http://repl.it/languages/Python
notes: file editor by clicking on the play icon, console interpreter by hitting the enter key
try:
Python 2.7.2 (default, Jul 20 2011, 02:32:18)
[GCC 4.2.1 (LLVM, Emscripten 1.5, Empythoned)] on linux2
   [n for n in range(0,10,1) if n%2==1] #odd numbers
=> [1, 3, 5, 7, 9]

Codecademy Labs
url: http://labs.codecademy.com/#
notes: file editor and console interpreter
try:
You're running Python version 2.7.2. To get started, type in the console below or the text editor to the left. Want to learn more about Python? Take Codecademy lessons!
>  print time.localtime()
time.struct_time(tm_year=2010, tm_mon=11, tm_mday=12, tm_hour=1, tm_min=22, tm_sec=33, tm_wday=4, tm_yday=333, tm_isdst=0)
# dst is the daylight savings time 
> import os
> os.getcwd()
=> '/sandbox'

Python Tutor, Line-by-line Code Visualization
url: http://pythontutor.com/visualize.html#mode=edit
notes: only file editor, you can change the drop down box value to "show only outputs" if there is any output, has Python versions 2 and 3
LEARN programming by visualizing code execution
Helps students overcome a fundamental barrier to learning programming: understanding what happens as the computer executes each line of a program's source code. Using this tool, a teacher or student can write a Python program in the Web browser and visualize what the computer is doing step-by-step as it executes the program.
try:
Write: Python 2.7 code here or load an example:
    name = raw_input('What is your name?\n')
    print 'Hi, %s.' % name
Program Output:
    What is your name?
    Name1
    Hi, Name1.

codepad is an online compiler/interpreter and a simple collaboration tool
url: http://codepad.org/
notes: file editor only, select radio button Python
try:
Paste your code below, and codepad will run it and give you a short URL you can use to share it in chat or email.
text area:
print """
What is duck typing?
  It is a term used in dynamic languages
that do not have strong typing.
  The idea is that you don't need a type
in order to invoke an existing method on an object -
if a method is defined on it, you can invoke it.
  The name comes from the phrase
"If it looks like a duck and
quacks like a duck,
it's a duck".
"""
Click on the Submit button
Output:
01
02  What is duck typing?
03    It is a term used in dynamic languages
04  that do not have strong typing.
05    The idea is that you don't need a type
06  in order to invoke an existing method on an object -
07  if a method is defined on it, you can invoke it.
08  The name comes from the phrase
09  "If it looks like a duck and
10  quacks like a duck,
11  it's a duck".
12

Wandbox, [Python] python 2.7.3
url: http://melpon.org/wandbox/
notes: file editor only, choose compiler: [Python] python 2.7.3
try:
input code:
import calendar
print calendar.month(2013, 2)
print "Display multiplication table of 13"
for i in range(1,11):
   print 13,'x',i,'=',13*i
click the button "Run (or Ctrl+Enter)"
#1
Start
   February 2013
Mo Tu We Th Fr Sa Su
             1  2  3
 4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28


Display multiplication table of 13
13 x 1 = 13
13 x 2 = 26
13 x 3 = 39
13 x 4 = 52
13 x 5 = 65
13 x 6 = 78
13 x 7 = 91
13 x 8 = 104
13 x 9 = 117
13 x 10 = 130

0

Finish
input stdin: empty text area box
Tick two checkboxes: No Wrap, Expand

Ideone is an online compiler, IDE, and debugging tool which allows you to compile source code and execute it online in more than 60 programming languages.
url: http://ideone.com/
notes: only file editor, click run button to get the script output
Choose a programming language, enter the source code with optional input data... and you are ready to go!
try:
</> enter your source code or insert template or sample or your template:
# your code goes here
def factorial(n):
  if n == 0:
    return 1
  else:
    return n * factorial(n - 1)
print factorial(5)
Choose Python programming language from the drop-up list box
Click the "spectacles" icon for secret
Click on the link "few options" if there is any
Success
stdin:
Standard input is empty
stdout:
120

Execute Python Script Online (Python 2.7.4)
url: http://www.compileonline.com/execute_python_online.php
try:
notes: file editor only
try:
#!/usr/local/bin/python2.7
print 'a' "b" """c"""
Executing the program....
$python2.7 main.py
abc


References:
- http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html

No comments:

Measure execution time with Julia, example using sorting algorithms

# random integers between 1 and 100 inclusive, generate thousands of them x = rand ( 1 : 100 , 100000 ) @time sort (x; alg=InsertionSort, r...