Steven D'Aprano
> Susana Iraiis Delgado Rodriguez wrote:
>
>> Hi!
>>
>> I just want to look the pathfile like this: C:\Python26 instead of
>> C:/\Python26, I feel the loop repeats its walking with this pathfile
>> structure. About the indention for the code
me, x1, x2, y1, y2, geo, cuenta, 0, prjtext,
crea, modificacion, acceso, total, maquina, user]
writer.writerow(aRow1)
log.close()
f.close()
print "El archivo esta listo"
root = Tk()
top = Toplevel() #Llamo una nueva ventana #Dimensiones de la ventana
root.minsize(400,200) #Barra de herrami
Hi!
I developed a python gui module to make a walk through a directory. This
time I want the user to select the parameters I need from the python gui.
The results will be written in a csv file, the problem I found is the
pathfile shows this way:
C:/\Archivos de programa\FWTools2.4.7\bin\mapnik-0.7.
a,num_elem,prj,proyeccion,creacion,fecha,ultimo,tamanio,maq,usu]
writer.writerow(campos)
for row, filepath in enumerate(file_list, start=1):
directorio = os.path.dirname(filepath)
filename = os.path.basename(filepath)
shapeData = ogr.Open(filepath.encode(filesystemencoding))
archivo,x_min,x_max,y_min,y_max,geometria,num_elem,prj,proyeccion,creacion,fecha,ultimo,tamanio,maq,usu]
writer.writerow(campos)
for row, filepath in enumerate(file_list, start=1):
directorio = os.path.dirname(filepath)
filename = os.path.basename(filepath)
shapeData = ogr.Open(filepath)
shp
I want to write a csv file, but I need the final user to give me some values
to open and update the file. My code is:
from Tkinter import * #Llamo las librerias graficas de Tk
import tkSimpleDialog #Libreria de almacenamiento de dialogos
import tkMessageBox #Libreria de mensajes
import tkFileDialog
Hello Alan!!
It is exactly what I need to complete my task :D
Than you so much
2011/8/31 Alan Gauld
> On 31/08/11 18:17, Susana Iraiis Delgado Rodriguez wrote:
>
>> Hello list !!
>> I'm developing a Python GUI application. I alreday developed a very
>> simple win
Hello list !!
I'm developing a Python GUI application. I alreday developed a very simple
window with buttons, each button will do a different task, but the most
important button will need to get information gotten in previous python's
functions. Let's say I have four functions but at the end I want
Hello Alan!!
Thank you for tha advice! I'll look at your tutorial, and test the options
you're giving to me.
Thank you
2011/8/22 Alan Gauld
> On 22/08/11 16:21, Susana Iraiis Delgado Rodriguez wrote:
>
> I want to start desingning and developing python interfaces, but I
Hello List!!
I want to start desingning and developing python interfaces, but I don't
know what library or tool can help me to accomplish my goal. I have
installed the 2.6.6 python interpreter version, my operative system is
Windows XP. The interfaces I want to create will be very simple, just to
Hello Timo!!
Thank you so much for your help! I'll do it
2011/8/17 Timo
> On 16-08-11 20:46, Susana Iraiis Delgado Rodriguez wrote:
>
>> Hello List!
>>
>> I just started to use PyGTK and Glade to create graphical interfaces, my
>> python interpreter versio
Hello List!
I just started to use PyGTK and Glade to create graphical interfaces, my
python interpreter version is 2.6.6; I also install the GTK2 Runtime
enviroment and Glade 3.6.6. I also installed in my computer
pycairo-1.8.10.win32-py2.6.exe, pygobject-2.26.0-1.win32-py2.6.exe and
pygtk-2.16.0+
Hello list!
I have a python script which works with other libraries in order to create
maps. The script looks for an extension in a specific directory and with
mapnik makes the thumbnails.
The module works fine from Python command line and Pyton IDLE, but I need
this program to run from MS-DOS, whe
Thank you to all of you!
After I read your mails I started to modify my code, I applied Ramit
suggestion and got the result I wanted:
mport os
file_list = []
folders = None
for root, folders, files in os.walk('C:\\'):
file_list.extend(os.path.join(
root,fi) for fi in files if (fi.ends
I want to get the size of 3 files. I already completed this step. Then I
need to sum the 3 results I got. In order to do it I have the next code:
import os
file_list = []
folders = None
for root, folders, files in os.walk('C:\\'):
file_list.extend(os.path.join(root,fi) for fi in files
Thank you Alan for your answer!!
Well, I'm using Windows XP to run this script!!
So I guess there's nothing I can do, about it.
Than you
2011/7/12 Alan Gauld
> Susana Iraiis Delgado Rodriguez wrote:
>
>> Hello list!!!
>>
>> I want to get the last user wh
Hello list!!!
I want to get the last user who accessed to a file, I already have the way
to know who owns the file, but I really need to get this information.
To get file user I'm using: os.environ.get("USERNAME") and to get the
machine host: socket.gethostname()
Is there a way to find out who use
(keywords)
RuntimeError: wrong file code : -1997790976
2011/6/14 James Reynolds
>
>
> On Tue, Jun 14, 2011 at 2:59 PM, Susana Iraiis Delgado Rodriguez <
> susana.delgad...@utzmg.edu.mx> wrote:
>
>> Hello members!
>>
>> I'm doing a script that needs to loop
-- Forwarded message --
From: Susana Iraiis Delgado Rodriguez
Date: 2011/6/14
Subject: Break stament issue
To: tutor@python.org
Hello members!
I'm doing a script that needs to loop to get some information, in order to
do that I'm using modules from OGR and Mapnik. Th
Hello members!
I'm doing a script that needs to loop to get some information, in order to
do that I'm using modules from OGR and Mapnik. These to get data from
shapefiles, but some of the files have 0 elements, I wrote a line to
validate it, but it hasn't worked, so I added a break to keep working
Hi Alan!!
After I read your e-mail, I remebered that I run the scripts in a different
way.
The script worked properly when I run it from Python IDLE, I don't have any
idea the reason why.
2011/5/19 Alan Gauld
>
> "Susana Iraiis Delgado Rodriguez" wrote
>
>
> We
2011/5/19 Brad Posthumus
>
>
>
> Susana Iraiis Delgado Rodriguez wrote:
> >
> > Hello Alan!!
> > Can you please tell me, how to rebuild my path? I've tried it, but I
> > didn't
> > succed =(
> >
> >
>
> The doctest for the Sha
Hello Alan!!
Can you please tell me, how to rebuild my path? I've tried it, but I didn't
succed =(
2011/5/17 Alan Gauld
>
> "Susana Iraiis Delgado Rodriguez" wrote
>
>
> message which tells me the file I want to work with
>> doesn't
ile "C:\mapnik-0.7.1\python\2.6\site-packages\mapnik\__init__.py", line
282,
in Shapefile
return CreateDatasource(keywords)
RuntimeError: Ýndice does not exist
2011/5/17 Emile van Sebille
> On 5/17/2011 10:10 AM Susana Iraiis Delgado Rodriguez said...
>
> Hello list!!
>&g
Hello list!!
I'm using a python dll to create images out from shapefiles. I import a
python module and its functions, when I want to use this library, I get a
message which tells me the file I want to work with doesn't exist, but it
does. I'm running the script from Windows. This is the code:
impo
Hello list!
I just started working with a dll fro geospatial data, it uses Python to
analyze data, this package is OSGeo4W; when I run the script and got the
next error:
>>> import mapnik
Traceback (most recent call last):
File "", line 1, in
File "C:\OSGeo4W\apps\Python25\lib\site-packages\m
Hello Marc and Jim!
First of all, thanks to both of you!
I already changed the code, I added the try statement and the script runned
without ponting to an error. But now, I have another problem, even though,
it doesn't show an error message and makes the txt files, the files don't
have any lines
I'm working on getting information that comes from a dbf file (database),
this dbf file is related to another file in the system, a shapefile. My code
is trying to get all the dbf name records, but when the systen gets an empty
file, my code fails:
Traceback (most recent call last):
File "", line
d the line:
try:
if len(sys.argv) == 4:
else:
print "Tus argumentos no son correctos"
and here:
except IndexError:
print "Tus argumentos no son correctos"
2011/3/29 Susana Iraiis Delgado Rodrig
Hello List:
I developed a script to walk through a specific directory in my PC and look
for files with the same extension (.shp). I want the user to enter from
MS-DOS and write the the directory, file extension and csv filename.
My script reads the arguments from Windows console, but when I opened
Hello everyone!
I want to run a python script which reads arguments from command line. I
searched in web and the module sys.argv came up. But I don't understand how
it works. I need to know how to pass arguments from command line and make
the python script works from MS-DOS instead of run my progr
Subject line so it is more specific
> than "Re: Contents of Tutor digest..."
>
>
> Today's Topics:
>
> 1. Re: Pygame install help (Wayne Werner)
> 2. Re: Write new line(enter) in txt (Susana Iraiis Delgado Rodriguez)
> 3. Re: Write new line(enter) in txt
; existe'
>
>
>
>
>
> You need to add a newline:
>
> print 'El archivo ' +shx +' existe' + '\n'
>
>
>
>
> ________________
> From: tutor-bounces+steve.flynn=capita.co...@python.org [mailto:
> tut
Hello list!!
This is a very simple question!! I want to write some lines in a txt file,
but my output looks like this:
No existe el archivo C:\índice.dbfNo existe el archivo C:\índice_dwg.dbfNo
existe el archivo C:\índice_raster.dbf
I need it to look like this:
No existe el archivo C:\índice.dbf
N
OK!! I see the problem now!
I also did a little change to the code, I open the .txt before the for
stamentet. The script is working properly
gdal.AllRegister()
file_list = [
folders = Non
for root, folders, files in os.walk( "C:\\" ):
file_list.extend(os.path.join(
root,fi) for fi in files if
f
Hello everyone!
I'm doing a python script that walks through files in my PC. Basically I'm
searching files that end up with .shp, but these files must have extensions
with .shx and .dbf. I want to write a .txt document which tells the user if
a file doesn't exist in the directory. But I haven't be
th.exists(p):
prj_text = open(p, 'r').read()
prjtext = ''+prj_text+''
aRow= [ filepath, filename, 1, ]
writer.writerow(aRow)
else:
no_prj = 'Sin prj, no se puede determinar la proyeccion'
aRow1= [ filepath,
Hello list!!
I'm trying to write a CSV file to work it with Excel. My python script is
working, the issue is: when I import the file from excel the data comes with
quotes at the beginnig and ending of the row. I don't want to have these
quotes. What is wrong with my code?
import os, csv
from osge
Hello members:
I need your help, I'm developing a python script to make an excel file...
I've been working in this for a long time. The module will write some data
from a .shp file. Unfortuanely that information has some characters
unrecorgnized by ascii. I tried to fix this adding an unicode sent
Thank you Jerry! The suggestion you told me make my code worked!
>
>
>
> dbf = Dbf(d,new=False, readOnly=True)
>
>
>
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
My other message was incomplete, it was a mistake: This is the correct one
2010/12/7 Susana Iraiis Delgado Rodriguez
> I make a script to redirect a txt file from an external directory, but in
> this directory I don't have permission to write, just to read data. So I
> ma
I make a script to redirect a txt file from an external directory, but in
this directory I don't have permission to write, just to read data. So I
make this module:
import os, time,fnmatch
from xlwt import Workbook
from osgeo import ogr,gdal,osr
from dbf import *
gdal.AllRegister()
file_list = []
f
I'm trying to save files into a specific directory, the file will be
generated from a python script. The script will look for some data stored in
a directory which only allows to read files, it doesn't let the user write
or modify information. But when I run the script I got the next error:
Python
Hello! After all the sugestions I received throught this list; I tried them
all and worked ok. At he end I noticed that a single variable change will
bring me the results I was looking for. In my code I replaced the line
n = os.path.splitext(filename)
for:
n = os.path.splitext(filepath)
p = n[0]
Hi Dave!
Thank you for your suggestion I haven't prevent the problems you're
describing, but I'm newbie in this stuff so, where should I repalce the
code?
Thank you again!
2010/11/24 Dave Angel
> On 01/-10/-28163 02:59 PM, Susana Iraiis Delgado Rodriguez wrote:
>
>>
Hello Peter!
I added the line you suggested me and found out that I was just searching
for the filenames without pointing to a specific directory, so Python took
its directory (Python26) as default. After that I need to add a '\' to
separate the path from the filename because it was reading them a
Hello memebers:
I'm writing a python script to validate if files with extension .prj exist,
if they exist it should write 1 or 0 into an excel cell. I've working to do
this properly, but I'm not getting the results I need. The script doesn't
find all the files, is like the files don't exist but th
Hello members:
I'm trying to validate the existence of a file by an if statement, but it
isn't working correctly. The module is a crawler that writes to excel some
attributes from the files it finds.
folders = None
# look in this (root) folder for files with specified extension
for root, folders
I'm starting to use xlwt to create excel files, my excel sheet is designed
to get information from a python module. The data came from a raster file,
the problem is that some kind of sign or character doesn't allow the file to
be written. This is my script:
import sys, os, time, socket, codecs
fro
Hello members:
I'm starting an script for geospatial information using python and gdal
binaries, but I have problems saving the data I get into an excel shee. At
the beginning I thought it was because the characters the files have for
some records, but I run the code in a way it saves the path for
0).write(11,'maquina_host')
for row, filepath in enumerate(file_list, start=1):
wksht.row(row).write(0, filepath)
wrkbk.save('shp.xls')
SEARCH_PATH = os.getcwd()
TARGET_FILE = os.path.realpath('shp.xls')
print "Searching in", SEARCH_PATH, &q
Hello members:
I'm using xlwt from python to work with excel, I'm developing some sort of
system crawler to look for all the files ending with .shp, I took a look to
csv, but I didn't understand it. Now, I have to create a .xls where people
can save information from shp files, but first I have to
quot;estructura
bd","extent","fecha_modificacion","maquina_host"]). But all tha names gather
in the same row and I want my pathfile to place under the "Archivo" column,
but I couldn't do it.
2010/10/11 Walter Prins
>
>
> On 11 October 20
Hello members!
Thank you all of you for taking the time to answer to my question. I didn´t
expect it will create the controversy we just had in this topic. I don't
mind for the comments of re-inventing the wheel, I'm new in python,
documentation is good but programmers' experience is even better.
Hello members:
I developed a Python module to make a list which contains all the files
ending with .shp and .dbf extensions, I have solved this already, but now I
want to write an excel file from it. The file should show the full path from
the found files. This is the code:
import os
a = open ("di
so I think it maybe that the line is
not together as it is a statement!!
2010/10/8 Susana Iraiis Delgado Rodriguez
> Hi Alan:
>
> The ouput is coming from a cicle and some functions that I vae to do to
> execute an ogr2ogr command, in this output I ask the user for the name of a
>
Failed to identify field:LAYER=
ERROR 1: Failed to create file .shp file.
ERROR 4: Failed to open Shapefile `0
.shp'.
I think the erros showed up because some of the layer's values are 0 and '
', and obsviously you can't create a file from nothing on it. But I don`t
know how
u, Oct 7, 2010 at 12:48 PM, taserian wrote:
>
>> I'm adding some line breaks to make your text a little more readable.
>>
>> On Thu, Oct 7, 2010 at 9:55 AM, Susana Iraiis Delgado Rodriguez <
>> susana.delgad...@utzmg.edu.mx> wrote:
>>
>> Hello membe
Hello members:
How can I write a statement to execute the following:
C:/Archivos de programa/FWTools2.4.7/bin/ogr2ogr R1G-GEODESIA.shp -where
"LAYER = 'R1G-GEODESIA'" tapalpa_05_plani_point.dbf, I want my uotput to
look like this.
Instead I'm getting this C:/Archivos de programa/FWTools2.4.7/bin/o
r has to enter 3 arguments an finally it worked. I have a
question, how can I tell the user if p execute ok? because even thouhg I
entered wrong parameters, it prints "Mapa generado". This line should only
appears if the arguments are acceptable.
2010/10/5 Susana Iraiis Delgado Rodriguez
Hello Norman:
Thank you for taking the time to answer. I already changed my os.system()
for your code. I got an error, when I executed this:
os.system(" 'C:/Archivos de programa/FWTools2.4.7/bin/ogr2ogr.exe ' "+arg1
+" -where "+arg2 +" " +arg3)
it throws me that "C:/Archivos" is not recognized as
I'm developing a module to execute an external command. The module executes
the command, but in order to make my code useful I have to enter some sql
staments. This is my code:
from dbf import *
from osgeo import ogr
import os
import sys
def call():
print "Ingresa el nombre para el nuevo mapa
Hello !
I apoligize for the format of my last message, I didn't realize that putting
my text in bold format will show those asterisks.
By the way you're Alan, for the pythom module I first had to read my
arguments and passed them to the os.system(), it worked. Now when I execute
this command, in m
Hello everyone:
I'm working in a simple python module to run a external command, this
command is named "ogr2ogr.exe" . When I execute my python script :
*import os
def call():
os.system(' "C:\\Archivos de programa\\FWTools2.4.7\\bin\\ogr2ogr.exe"
')*
* raw_input()*
*call()*
It runs, but
Thanks Steven and Alan, your recommendation worked perfectly!
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Hello Steven!
Your guess was rigth, that's what I'm looking for! I need an output as:
beta
gamma
etc...
but I'm showing betagammaetc..
What can I do to my code to get the first ouput? By the way thanks for
answering!
___
Tutor maillist - Tutor@python
Hello dear pythonists:
I'm developing an application in python, I'm new using this programming
language I used to work with Java, but in my job my superiors suggested me
to develop in this language.
I'm trying to read a dbf file, I already done it but my code shows me all
the lines without spaces,
67 matches
Mail list logo