Killer Web Development Part 4 – Windows version

Haha i’m such an idiot! Who says i must use Raspberry Pi to develop my web application???

Now, moving on to use Window XP to continue my Killer Web Development!
Ref: http://killer-web-development.com/section/4/3

I downloaded the window version of web2py and run web2py.exe. Then i start the server. Awesome, everything works fine.
The codes below are a close reference to the link above. Just that all my codes are in windows format and for my future reference. Remember to download gedit first!

Writing first test:
C:\Document and Settings\Administrator>cd Desktop\my name\web2py_win\web2py
> .\web2py.exe -S zapp //there is a space before “.”
> CTRL+Z Enter //to exit from python shell

open up gedit from program files and type in the following, then save into the zapp folder under the file name “.hgignore”

syntax: glob
cache/**
databases/**
errors/**
sessions/**

*.pyc

Then back in the command prompt,
>hg init
>hg add .
>hg commit -m”initial commit”

Install Selenium

First, create the necessary directory:

>cd applications\zapp
>md fts
>cd fts
>md lib
>cd lib

Go to Python package selenium page https://pypi.python.org/pypi/selenium/2.15.0 to download the tar.gz file
extract using winrar or something else and move the selenium-2.15.0 folder to zapp\fts\lib and rename it to “selenium”

Then create another 2 .py files using gedit.
1. The blank __init__.py in zapp/fts directory
2. functional_tests.py in zapp directory (copy and paste the code from the tutorial http://killer-web-development.com/section/4/3)

Time to Test Selenium
>cd .. (to go up one level)

okay, just open gedit and copy the codes and save into /zapp/fts directory.
Then go up one level again (to zapp dir)

>cd ..
>python functional_tests.py

If you see this: ” ‘python’ is not recognized as an internal or external command, operable program or batch file.”, refer here

>python functional_tests.py

If you get “ImportError: No module named selenium”, edit the functional_tests.py file and change

sys.path.append(‘./fts/lib’) to
sys.path.append(‘./fts/lib/selenium/selenium/py’)
(check your selenium folder, see screenshot)

python: can’t open file ‘../../web2py.py”: [Errno 2] No such file or directory

change ../../web2py.py into ../../web2py.exe
get “SyntaxError: Non-ASCII character ‘\x90’ in file ../../web2py.exe on line 1, but no encoding declared;”

– can’t find solutions, let’s change strategy!

Download the source version from web2py website. extract and move to the same directory. copy the zapp folder to web2py_src/web2py/applications.

Then run from there. Get the error: no handler – download pywin316 will solve the problem.

selenium still causing some problems which i still cant figure them out. argh.

hg commit and blah blah.
From here onwards, i decided to leave out the selenium test.

And learn HTML. Going to recall my task so that i won’t drift too far off. Laugh.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s