5/14/2008

SIP here

Yesterday I've reinstalled my OS with help of my friends and now - it is Ubuntu 8.04..
Now I wish to install some packages, like
1) Kile or LyX;
2) Octave;
3) some kodeks for music
some help in work
some link for me to learn deutch(yes) - and the fairytales; and the song
how I will sync my shuffle now
smth about SIP
the next link (mixed cipherS)
new application to test sometime
SIP questions
and the next easy way to find info


else german
and germ

5/12/2008

where is this (..censored) "... " ???

This is easy peace of code, that doesn't executes
ANd I don't know why:

>>> the_world_is_flat=1
>>> #if the land is flat, prevent the falling
... if the_world_is_flat:
... print "Warning! Possibile falling"
File "", line 3
print "Warning! Possibile falling"
^
IndentationError: expected an indented block
>>>



http://www.python.org/doc/lib/module-BaseHTTPServer.html

5/07/2008

O !!
I've found another nice link http://www.python.org/doc/current/lib/
and http://www.citforum.ru/security/cryptography/yaschenko/1.html - for future)))
and http://forum.vingrad.ru/forum/topic-193545/kw-python-gcc-mingw-winapi-debian.html

5/06/2008

the next interesting thing about types in Python::

>>> type(string)

>>> type(string.punctuation)

>>> type(string.join)

>>> callable(string.punctuation)
False
>>> callable(str)
True
>>> type(str)

>>> type(dir)

>>> type(type)
-- note! - type for "type" - is type))
>>> type(string.punctuation.isdigit)

>>> type(builtin_function_or_method)

Traceback (most recent call last):
File "", line 1, in
type(builtin_function_or_method)
NameError: name 'builtin_function_or_method' is not defined
-
- and type for "builtin function" is not defined))

>>>
Today I've start reading the "How to Think Like a Computer Scientist" and I've noted this conversation:

"1.2 What is a program?
A program is a sequence of instructions that specifies how to perform a computation.
The computation might be something mathematical, such as solving
a system of equations or finding the roots of a polynomial, but it can also be a
symbolic computation, such as searching and replacing text in a document or
(strangely enough) compiling a program."


Chapter 3:

As you can see earlier, I've tried to start typing in shell and there were some errors. Today I've start the perl program and !! OH !! I've found : chmod +x for file !!


(jj)examplesPY% chmod +x test1.py
(jj)examplesPY% ./test1.py
./test1.py: line 1: syntax error near unexpected token `('
./test1.py: line 1: `def fib(n):'
(jj)examplesPY% ./test1.py
./test1.py: line 1: syntax error near unexpected token `('
./test1.py: line 1: `def fib(n):'
(jj)examplesPY%

-- not successful!!


5/05/2008

Python in Linux (Red Hat)
Chapter 1
Looking through the book "Diveintopython.pdf" I've found example and as I work in Linux Centos - I've decided to try some examples in shell:
after this warning "Whoops! Just typing python gives you the older version of Python −− the one that was installed by default." I've found the python2.4 that was installed on my PC by default and:

~: python2.4

Python 2.4.3 (#1, Mar 14 2007, 18:51:08)
[GCC 4.1.1 20070105 (Red Hat 4.1.1-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+1
2
>>> x=2
>>> r=4
>>> x+r
6

-- first tries were successfull)))

Chapter 2

Next my try was to run from examples my favorite odbchelper.py :

python odbchelper.py
/opt/openoffice.org2.0/program/python.bin: can't open file 'odbchelper.py'
(jj)bin% python2.4
Python 2.4.3 (#1, Mar 14 2007, 18:51:08)
[GCC 4.1.1 20070105 (Red Hat 4.1.1-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/Numeric', '/usr/lib/python2.4/site-packages/PIL', '/usr/lib/python2.4/site-packages/gtk-2.0']
>>> sys.path.append ('/users/jj/home/diveintopython-5.4/diveintopython-5.4/py')
>>> sys.path
['', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/Numeric', '/usr/lib/python2.4/site-packages/PIL', '/usr/lib/python2.4/site-packages/gtk-2.0', '/users/yr0476/home/diveintopython-5.4/diveintopython-5.4/py']
>>> import odbchelper
>>> type (odbchelper)

>>> run odbchelper.py
File "", line 1
run odbchelper.py
^
SyntaxError: invalid syntax
>>> python obdchelper.py
File "", line 1
python obdchelper.py
^
SyntaxError: invalid syntax
>>>
(jj)bin% python odbchelper.py
/opt/openoffice.org2.0/program/python.bin: can't open file 'odbchelper.py'

(jj)bin% cd /users/yr0476/home/diveintopython-5.4/diveintopython-5.4/py
(jj)py% python odbchelper.py
pwd=secret;database=master;uid=sa;server=mpilgrim
(jj)py% print odbchelper.buildConnectionString(params)

CORRECT>printf odbchelper.buildConnectionString(params) (y|n|e|a)? no
Badly placed ()'s.
(jj)py% print odbchelper.buildConnectionString ( params )

CORRECT>printf odbchelper.buildConnectionString ( params ) (y|n|e|a)? yes
Badly placed ()'s.
(jj)py% import odbchelper

(jj)
py% python2.4
Python 2.4.3 (#1, Mar 14 2007, 18:51:08)
[GCC 4.1.1 20070105 (Red Hat 4.1.1-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import odbchelper
>>> import odbchelper
>>> params = {"server":"mpilgrim", "database":"master", "uid":"sa", "pwd":"secret"}
>>> print odbchelper.buildConnectionString(params)
pwd=secret;database=master;uid=sa;server=mpilgrim
>>> print odbchelper.buildConnectionString.__doc__
Build a connection string from a dictionary

Returns string.

-- so this was successful too _)))