-
Website
http://blog.garethj.com/ -
Original page
http://blog.garethj.com/2008/05/07/replacing-python-on-a-battlefield-2-server/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Popular Threads
-
Wireless on a Dell Mini 10v in Ubuntu 9.10
1 week ago · 3 comments
-
Indicator applet API changes in Ubuntu 9.10
2 weeks ago · 5 comments
-
Wireless on a Dell Mini 10v in Ubuntu 9.10
import urllib
webPageHandle = urllib.urlopen('http://blog.garethj.com/')
webPageContents = webpage.read()
Then obviously you'll have to parse webPageContents for the information you need and use the BF2 API to send that into the game. This page looks like a good tutorial if you need more help: http://www.voidspace.org.uk/python/articles/url...
Hope that's useful :)
Originally I wanted to use post methods, but I now think a simple get is more efficent for my level of coding. It also means that I can use the standard python lib that comes with bf2.
I appreciate the help.
2. Replace the Python library path at runtime to use the new libraries, e.g. edit ‘bf2/python/bf2/__init__.py’ and putting the equivalent of ’sys.path = ['/usr/lib/python2.5/', '/usr/lib/python2.5/lib-dynload/', 'python', 'mods/bf2/python', 'admin']‘ after the ‘import sys’ line.
Is what I did, but I did substitute my version for 2.5. I used locate to find the directories for python. I run the 64 bit version of bf2.exe so I figured 64bit libs would be a proper replacement.