- A programming language that is compiled when you run it. (Explain JIT vs. Compiled languages like C)
- Sort files on your computer
- Do complex math
- Create websites
- Make games
# A simple friend game score keeper | |
# This is used to demonstrate variables, user input, and using lists to | |
# track values. It is meant as a starting point. | |
username = raw_input("Enter your name: ") | |
userage = raw_input("Enter your age: ") | |
friendsname = raw_input("Enter your friends's name: ") | |
friendsage = raw_input("Enter your friend's age: ") | |
print "Hello " + username + ", you are " + userage + " years old.\n" |
#!/bin/bash | |
# A shell script to install saltstack on Ubuntu | |
sudo apt-get install python-software-properties | |
sudo add-apt-repository ppa:saltstack/salt | |
sudo apt-get update | |
# You may want both salt-master and salt-minion, uncomment one or both depending on what you need |
apache2: | |
pkg: | |
- installed | |
php5: | |
pkg: | |
- installed | |
mariadb-server-5.5: | |
cmd.run: |
#!/usr/bin/env python | |
import os | |
backup_dir = os.getcwd() + "/backups" | |
os.chdir(backup_dir) | |
files = filter(os.path.isfile, os.listdir(backup_dir)) | |
files = [os.path.join(backup_dir, f) for f in files] # add path to each file | |
#files.sort(key=lambda x: os.path.getmtime(x)) |
#!/bin/bash | |
for dir in */ | |
do dir=`echo $dir | tr -d '/'` | |
echo $dir | |
tar czf $dir.tar.gz $dir | |
done |
from bottle import route, run | |
@route('/') | |
def index(name=['hello', 'World', 'me']): | |
return '<br>'.join(name) | |
run(host='localhost', port=9090) |
#!/usr/bin/env python | |
import ConfigParser | |
import sys | |
options = sys.argv | |
print "Sys Args: ", options[1] | |
f = open('user.yaml') | |
dataMap = yaml.load(f) | |
f.close() | |
print "" | |
print "=-----------=" | |
print "dataMap is a ", type(dataMap), dataMap | |
print "=-----------=" | |
print "main items are", type(dataMap['main']), dataMap['main'] |
mylist = ['apples', 'bananas', 'oranges', 'strawberries', 'apples'] | |
print "Not Unique List: ", mylist | |
print "Unique List Using set: ", list(set(mylist) |