Python mapscript
Sean Gillies
sgillies at FRII.COM
Mon Aug 22 08:23:17 PDT 2005
Robert,
Howard is packaging the Python modules differently, and I approve of
his choice. Try the following:
from mapscript import mapscript
mapfile = "Bob.map"
map_bob = mapscript.mapObj(mapfile)
Sean
On Aug 22, 2005, at 8:57 AM, Brundage, Robert G wrote:
> Sean:
> I installed the HoBu Python.
>
> I still get the same error.
>
> The whole error is:
>
> Traceback (most recent call last):
> File
> "C:\Python24\Lib\site-packages\pythonwin\framework\scriptutils.py",
> line 310, in RunScript
> exec codeObject in__main__.__dict__
> File "C:\ms4w\Apache\htdocs\map1.py", line 11 in ?
> Mapobject - mapscript.mapObj(mapfile)
> AttributeError: 'module' object has no attribute 'mapObj'
>
> Below is mapfile
>
>> Import mapscript
>> mapfile = "Bob.map"
>> mapobect = mapscript.mapObj(mapfile)
>>
>
>
> Robert Brundage
> GIS Coordinator
> Department Public Works
> Fort Campbell, KY
> PH: 270-798-9571
> FAX: 270-798-2232
>
>
>
> -----Original Message-----
> From: Sean Gillies [mailto:sgillies at frii.com]
> Sent: Saturday, August 20, 2005 9:04 AM
> To: Brundage, Robert G
> Cc: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: Python mapscript
>
>
> On Aug 19, 2005, at 2:07 PM, Brundage, Robert G wrote:
>
>> This message is in MIME format. Since your mail reader does not
>> understand
>> this format, some or all of this message may not be legible.
>>
>> ------_=_NextPart_001_01C5A4F9.A6F92066
>> Content-Type: text/plain
>>
>> Hello:
>> I am new Mapserver and following along in the 'Web Mapping
>> Illustrated' book
>> by Tyler Mitchell.
>>
>> I cannot get the basic python script to run.
>>
>> Import mapscript
>> mapfile = "Bob.map"
>> mapobect = mapscript.mapObj(mapfile)
>>
>> The above code gives an error: AttributeError: 'module' object has
>> not
>> attribute 'mapObj'.
>>
>> I am using Python Active build 245
>>
>
> mapscript is not a standard Python module, and is not included with
> ActivePython. You will need to build it, or download a binary. Frank
> Warmerdam's FWTools contains mapscript for Python 2.3
>
> http://fwtools.maptools.org
>
> and Howard Butler is doing something similar for Python 2.4
>
> http://hobu.biz/software/hobutools
>
> cheers,
> Sean
>
> --
> Sean Gillies
> sgillies at frii dot com
> http://zcologia.com
>
More information about the MapServer-users
mailing list