Raspberry pi

From wikiwad
Jump to: navigation, search

Contents

Kids use these commands to set it up

To run the original install menu:

sudo raspi-config

To change your password:

passwd

To install XChat, so you can chat with other Raspberry PI users:

sudo apt-get install xchat

To install the Focuswriter word processor

sudo apt-get install focuswriter

To install an email client

sudo apt-get install icedove
incoming IMAP wadhome.org, port 993, SSL/TLS, normal password
outgoing SMTP wadhome.org, port 25, STARTTLS, normal password

Just some more commands

To play a video omxplayer <filename>

More advanced stuff for setting it up

To turn on syntax highlighting in vim

echo "syntax on" >> ~/.vimrc

python

links

generate a random number between 1 and MAX_VALUE

import random
MAX_VALUE = 6
x = int(random.random() * MAX_VALUE) + 1
print x

conditionals

name = raw_input('Enter your name: ')
if name == 'Eric':
        print "It's da Boss!"
else:
        if name == 'Tressa':
                print "It's da REAL Boss!!"
        else:
                print "Hello, " + name + "."

Dice Program code

Import random
numSides = int(raw_input('How many sides on your die? '))
numDice = int(raw_input('How many times do you want to roll your die? '))
total = 0
for numTimes in range (0,numDice):
	roll = int(random.random() * numSides) + 1
	print roll
	total = total + roll
print “total”
print total
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox