ANN: vb2py online code conversion

Paul Paterson paulpaterson at users.sourceforge.net
Tue Oct 14 20:26:09 EDT 2003


Will Stuyvesant wrote:

>>[Paul Paterson]
>>The Online Version of vb2py has been released.
>>... 
>>vb2py :: A Visual Basic to Python Conversion Toolkit
>>http://vb2py.sourceforge.net
> 
> 
> Nice work!

Thanks!

> I am not a VB person, but I always like to see people using python
> CGI.  But on sourceforge they only have Python 1.5.2 last time I
> checked!  Did you install your own python on sourceforge (if so, how
> did you do that, I failed in an earlier attempt), or do they finally
> have a new python version installed?

The Shell is now at 2.2 but cgi is still using 1.5.2, which was rather 
puzzling for a while as things appeared to be working but weren't.

I had to install my own copy of Python. I'm not very literate on 
Unix/Linux so this was a interesting and I'm sure there are better ways 
to do it. Anyway, here is how I managed to hack it to get it to work ...

1. Make a little work area on your web space to put Python

2. Copy the python 2.2 executable across to the work area

3. Verify that you can run this from the Shell (you'll get warnings 
about not being able to find lots of libraries but it should run).

4. Copy all the basic Python libraries (../lib) into the same place you 
put the python executable

5. Copy the "../lib/lib-dynload" contents to your new python directory

6. Change the #! line in your .py files to point to the new python 
executable

Now there has to be a better way than this but ...

7. Add the following lines to your script:

import sys
sys.path.append("path to your python folder")
sys.path.append("path to your lib-dynload")
sys.path.append("path to where your other 'site-packages' will live")

8. For me, "socket.py" was failing when importing "_socket" so I 
modified it not to import "_socket" and it worked fine (I don't think 
you will be able to use sockets anyway).


Anyway, this worked for my application which uses library and 
non-library packages.

Good luck!

Paul







More information about the Python-list mailing list