User Tools

Site Tools


Sidebar



python

Python

Guide to Python function decorators

4 interessante stukjes Python

def logUser(name, age, length):
    print('name: ', name)
    print('age: ', age)
    print('length: ', length)
 
#logUser('alex', 29, 1.75)
user = ('alex', 29, 1.75)
logUser(*user)
def logUser(name, age, length):
    print('name: ', name)
    print('age: ', age)
    print('length: ', length)
 
# logUser(age=28, length=1.75, name='alex')
user = {'age':28, 'length':1.75, 'name':'alex'}
logUser(**user)
def log(*args):
    print(args)
    message = ""
    for item in args:
        message += item+' ';
    print(message)
 
log('hallo', '2134', 'fsfdsf')
def logUser(**kwargs):
    print('name: ', kwargs['name'])
    print('age: ', kwargs['age'])
    print('length: ', kwargs['length'])
 
logUser(age=28, length=1.75, name='alex')
SimpleHTTPServer
python -m SimpleHTTPServer 8000
kivy
ImportError: No module named NK.gui.app

In NinjaKittens folder:

export PYTHONPATH=.
gui
libxml / libxml2 / lxml

untested:

brew install libxml2

or

sudo port install py25-lxml
install easy_install

http://pypi.python.org/pypi/setuptools#downloads

sh setuptools-0.6c9-py2.4.egg --prefix=~
Mogelijke oplossing voor problemen met Python op OSX Lion
version
python --version
location of python
type python

or

which python
info about executable
file /usr/local/bin/python
set python path (for macports?)

see also: macports

export PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
python.txt · Last modified: 2016/01/06 10:04 by rick