Re: [Tutor] Error in executing: cmd.

2008-05-30 Thread Alan Gauld
"Teresa Von Hazmburg" <[EMAIL PROTECTED]> wrote Here are the files I was referring to in my last email I don't really know the cause of your specific error but here are some comments that will tidy the code somewhat and might change the behaviour too. # #Open/read tex

Re: [Tutor] Error in executing: cmd.

2008-05-30 Thread Teresa Von Hazmburg
Here are the files I was referring to in my last email Thank you all for your patience. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kent Johnson Sent: Friday, May 30, 2008 12:24 PM To: Teresa Von Hazmburg Cc: Python Tutor List Subject: Re: [Tutor] Erro

Re: [Tutor] Error in executing: cmd.

2008-05-30 Thread Kent Johnson
On Fri, May 30, 2008 at 2:34 PM, Teresa Von Hazmburg <[EMAIL PROTECTED]> wrote: > Hello and thank you for replying. > > As I mentioned I am new to python but I am also new this website/service. Welcome! > I guess I am not following protocol/etiquette with regards to requesting > service. Well, t

Re: [Tutor] Error in executing: cmd.

2008-05-30 Thread Kent Johnson
On Fri, May 30, 2008 at 12:54 PM, Teresa Von Hazmburg <[EMAIL PROTECTED]> wrote: > Can anyone tell me what is wrong? You haven't given us much to work with. Can you show us the script? Is RNZ9ET~K.PY the script you are running, or do you call it from your script? If it is something you are callli

Re: [Tutor] Fwd: Running shell command

2008-05-30 Thread Ricardo Dueñas Parada
I´m running Fedora 8, in this case the command is su -c 'command'. I also think it's better to allow a specific user to use smartctl. I will do that. Thank´s, it was really helpfull. _Ricardo 2008/5/30 W W <[EMAIL PROTECTED]>: > Curse my forgetting to reply to all! > > -- Forwarded m

Re: [Tutor] Error in executing: cmd.

2008-05-30 Thread W W
I'm not certain, but it appears the file RNZ9ET~K.PY may not exist, or access is in some other way restricted. It's obviously running for a long time, about 3.75 hours. Is the RNZ*.PY file in some way generated by your original script? -Wayne On Fri, May 30, 2008 at 11:54 AM, Teresa Von Hazmbur

[Tutor] Fwd: Running shell command

2008-05-30 Thread W W
Curse my forgetting to reply to all! -- Forwarded message -- From: W W <[EMAIL PROTECTED]> Date: Fri, May 30, 2008 at 1:05 PM Subject: Re: [Tutor] Running shell command To: Ricardo Dueñas Parada <[EMAIL PROTECTED]> On Fri, May 30, 2008 at 12:52 PM, Ricardo Dueñas Parada <[EMAIL P

[Tutor] Error in executing: cmd.

2008-05-30 Thread Teresa Von Hazmburg
Hello, I am new to programming. I have a shapefile of county parcel data containing over 600,000 polygons. Using python, I am trying to query the shapefile and write the results out to separate shapefiles. I put a print command so I can watch the procedure. I execute the script and watch w

Re: [Tutor] Running shell command

2008-05-30 Thread Ricardo Dueñas Parada
Thanks for your answers. How can I make that action more secure? Is there any way for running the program from a regular user (non su) without having the password within the code? _Ricardo 2008/5/30 Alan Gauld <[EMAIL PROTECTED]>: > > "Brett Wilkins" <[EMAIL PROTECTED]> wrote > >> Just as a sid

Re: [Tutor] Running shell command

2008-05-30 Thread Alan Gauld
"Brett Wilkins" <[EMAIL PROTECTED]> wrote Just as a side point, wouldn't the easiest way be to run the script under sudo? It's safer imho than putting the sudo password in programmatically... Yes, but he is (presumably) already using sudo within os.system. He wants to avoid putting in the pas

Re: [Tutor] Running shell command

2008-05-30 Thread Brett Wilkins
Just as a side point, wouldn't the easiest way be to run the script under sudo? It's safer imho than putting the sudo password in programmatically... Cheers --Brett On 30/05/2008, at 7:21 PM, Alan Gauld wrote: "Ricardo Dueñas Parada" <[EMAIL PROTECTED]> wrote When I run the command os.syste

Re: [Tutor] Modifying files in a directory.

2008-05-30 Thread [EMAIL PROTECTED]
OK I see, >>> for x in otp: ... print x ... From$23.60 $79.99 $39.99 1 Blister Pack - $65.95 So I will need to use the Remove elements in my code. Thanks for all your help. David Guard your email - http://www.tiscali.co.uk/products/securemail/ _

Re: [Tutor] Modifying files in a directory.

2008-05-30 Thread Kent Johnson
On Fri, May 30, 2008 at 7:52 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Yes I do need to learn the basics of programming ;) > > This was the first I did, was to put the modification code into the > loop, but had this error: > for x in otp: > ... price = float(x.contents[1].lstrip('

Re: [Tutor] Modifying files in a directory.

2008-05-30 Thread [EMAIL PROTECTED]
Yes I do need to learn the basics of programming ;) This was the first I did, was to put the modification code into the loop, but had this error: >>> for x in otp: ... price = float(x.contents[1].lstrip(' $')) ... x.contents[1].replaceWith('$%0.2f' % (price * 0.85)) ... Traceback (most

Re: [Tutor] Modifying files in a directory.

2008-05-30 Thread Kent Johnson
On Fri, May 30, 2008 at 4:28 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > then, i thought I would loop through this list: > for x in otp: > ... print x > ... > >From$23.60 > $79.99 > $39.99 > class="order_table_price_small">1 Blister Pack - $65.95 > > > And h

Re: [Tutor] Modifying files in a directory.

2008-05-30 Thread [EMAIL PROTECTED]
Hello, Thanks for the replies, I have now installed ipython and will take the time to explore each object further. But I have one more question. On each page I have several From $32.66 each with different price. so, changing the code to use the findAll, returns a list: >>> otp = soup.findAl

Re: [Tutor] Running shell command

2008-05-30 Thread Alan Gauld
"Ricardo Dueñas Parada" <[EMAIL PROTECTED]> wrote When I run the command os.system in python, obviously he asks me for the password, and the program stops until I wirte it. . Is there any way to write the password from the python script?, or what do you recommend me? os.system is a very basi