python script to add a field and edit it for several shapefiles in arcgis

2011-10-11 Thread yo
dear All
i m trying to write a python script supposed to create a new field in
a shapefile, and then fill it with a value extracted from the name of
the file...
I have to do that for several hundreds of files...I am almost there it
is kind of working for one file but once i put a loop in the story,
then everything crashes...
could anybody here offer some help ???
regards
Yoann
-- 
http://mail.python.org/mailman/listinfo/python-list


Python gp.ListFeatureClasses return only one file

2011-10-13 Thread yo
Hi All,
I m using the gp.ListFeatureClasses to make a list of file in my
directory (containing several hundreds of file)
however when I print the variable in which the List is supposed to be
stored, the print just return one file name
does any one have an idea

# Import system modules
import sys, string, os, arcgisscripting, glob, arcpy

# Create the Geoprocessor object
gp = arcgisscripting.create()
# define the workspace
gp.Workspace = r"F:\front\shp_Files\calving_front"
# list the file in the workspace

try:
shpList = gp.ListFeatureClasses("*.shp")
shp = shpList.Next()
print shp

except:
print arcpy.GetMessages() # allows to get error message when they
happen
-- 
http://mail.python.org/mailman/listinfo/python-list


run a script getting 4 arguments from another script

2011-07-22 Thread souleymane yo
my initial file name is SpO2Sweep.loops.py
In the new file I write this code to run the first one.

[code:]
import SpO2Sweep.loops.py
SpO2Sweep.loops.py.run("com1","0","30","0.0001")


and It looks like the arguments are not passed to the first file. can
someone help me?
-- 
http://mail.python.org/mailman/listinfo/python-list


debugger on system with Python 2 and 3

2009-11-27 Thread Yo Sato
Hi,

I am a relative newcomer to the Python language, and only write Python
3. Now I would very much like to a more-than-basic debugger. However
it seems as if the fact that I have both Python 2 and 3 on the system
complicates the matter...

First I tried to use something called pydb, but it seems to invoke
python 2, and I don't know quite how to (or whether I can) configure
it for Python 3.

Secondly I installed something called IDLE3, which complains that TK
is not configured for Python 3.

I don't want to remove or default to Python 2, as there seem to be a
number of programs that rely on it.

I wonder how best to avoid my problems. Would perhaps somebody in the
same sort of situation share their wisdom??

Yo
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: debugger on system with Python 2 and 3

2009-11-29 Thread Yo Sato
Thanx Alan,

I am using Fedora Core 11. I wanted to use emacs, rather than the
full-blown IDE or entirely gui-based debugger, and that's why I was
drawn to pydb in the first instance.

If there's no other choice I don't mind using winpdb, but it is
installed (through Yum) under Python2 library and invokes Py2 at
default... Don't quite know how to adapt it to Py3 or install the
right version under the right directory, yet. It seems as if some
environmental variable change is necessary. On the whole it doesn't
seem that there's much support in the third-party debuggers in general
as yet...

In the meantime I might ask if it is possible to adapt pydb (or
perhaps, IDLE) for Py3. Might be just a change in a env variable or
two...

Yo

On Fri, 27 Nov 2009 19:03:10 +, Alan Franzoni wrote:

> On 11/27/09 6:17 PM, Yo Sato wrote:
>> Hi,
>>
>> I am a relative newcomer to the Python language, and only write Python
>> 3. Now I would very much like to a more-than-basic debugger. However it
>> seems as if the fact that I have both Python 2 and 3 on the system
>> complicates the matter...
>
> You haven't told OS which OS you're using, and what are your exact
> problems, BTW I think two good debuggers for Python are winpdb/rpdb2
> (work on any platform, despite the name) and the one you get in
> Eclipse+Pydev.
>
> You should be able to pick your platform, even though I've never tested
> them in Python 3.
-- 
http://mail.python.org/mailman/listinfo/python-list