[Tutor] Fwd: Executing a command from a specific directory

2009-09-15 Thread Ansuman Dash
Hello Everybody, In Python scripting, how can I execute a command (which can be run from spcific directory) and then retrieve the result (after executing the command it give the command is executed successfull or not), so that I can validate it. Thanks, AD

[Tutor] Parsing html tables and using numpy for subsequent processing

2009-09-15 Thread David Kim
Hello all, I've finally gotten around to my 'learn how to parse html' project. For those of you looking for examples (like me!), hopefully it will show you one potentially thickheaded way to do it. For those of you with powerful python-fu, I would appreciate any feedback regarding the direction I

Re: [Tutor] Wordscramble.py

2009-09-15 Thread David
kreglet wrote: This is my first Python project. I am doing this to help me learn the language. I was wondering if someone could give me some advice as I have a lot of questions. 1. I would like to have someone look over the code and tell me how to improve it. I am sure that a lot of it can

Re: [Tutor] breaking out of a function that takes too long

2009-09-15 Thread Serdar Tumgoren
Thanks to all for the responses. I've never used threading, but from some initial googling it appears that it can indeed by tricky and there seem to be numerous recommendations against killing threads or processes. I'll explore the socket request libraries mentioned by several to see if that does

Re: [Tutor] breaking out of a function that takes too long

2009-09-15 Thread Luke Paireepinart
Most socket request libraries have timeouts on connection attempts, have you looked into that already? On Tue, Sep 15, 2009 at 4:02 PM, Serdar Tumgoren wrote: > Hey everyone, > Is there a way to break out of a function if it exceeds a certain time > limit for execution? > > There's a Website I'm

Re: [Tutor] breaking out of a function that takes too long

2009-09-15 Thread Kent Johnson
On Tue, Sep 15, 2009 at 5:02 PM, Serdar Tumgoren wrote: > Hey everyone, > Is there a way to break out of a function if it exceeds a certain time > limit for execution? In general this is tricky. It usually involves setting up another thread to run or monitor the function, then somehow terminating

Re: [Tutor] breaking out of a function that takes too long

2009-09-15 Thread Alan Gauld
"Serdar Tumgoren" wrote Is there a way to break out of a function if it exceeds a certain time limit for execution? Yes, you can put the call in a thread then in the main thread start a timer. If the timer expuires before the thread returns kill the thread.thread There's a Website I'm

[Tutor] breaking out of a function that takes too long

2009-09-15 Thread Serdar Tumgoren
Hey everyone, Is there a way to break out of a function if it exceeds a certain time limit for execution? There's a Website I'm scraping on a regular basis, and for some reason that I can't divine the site has radically varying response times. In some cases, I get a result vary quickly; at other t

Re: [Tutor] New guy question...

2009-09-15 Thread Rich Lovely
2009/9/15 Warren : >> >> Does TextMate support input into a running Python program? I'm not >> sure if it supports standard input. You might have to run the program >> from Terminal to get this to work. > > > Good question, Kent.  That might be the root of all of this pain.  I'll > experiment when

[Tutor] Wordscramble.py

2009-09-15 Thread kreglet
This is my first Python project. I am doing this to help me learn the language. I was wondering if someone could give me some advice as I have a lot of questions. 1. I would like to have someone look over the code and tell me how to improve it. I am sure that a lot of it can be done better t

Re: [Tutor] Image manipluation (On-the-fly thumbnail creation)

2009-09-15 Thread Patrick Sabin
dan06 wrote: I've recently delved into python, about a week or so ago; I'm trying to figure out how to create on-the-fly thumbnails. Are there python standard library modules I could/should use or should I use external libraries like: GD, Gimp, or ImageMagick? When I needed thumbnails of my i

Re: [Tutor] Image manipluation (On-the-fly thumbnail creation)

2009-09-15 Thread Ajith Gopinath
import glob import Image for infile in glob.glob("*.jpg"): im = Image.open(infile) # converting to thumbnail image im.thumbnail((128, 128), Image.ANTIALIAS) im.save("thumb" + infile, "JPEG") Will this be of ur help Vince? On 15/09/2009, vince spicer wrote: > On Tue, Sep 15, 2009 at 10:0

Re: [Tutor] Image manipluation (On-the-fly thumbnail creation)

2009-09-15 Thread vince spicer
On Tue, Sep 15, 2009 at 10:03 AM, dan06 wrote: > > I've recently delved into python, about a week or so ago; I'm trying to > figure out how to create on-the-fly thumbnails. Are there python standard > library modules I could/should use or should I use external libraries like: > GD, Gimp, or Image

[Tutor] Image manipluation (On-the-fly thumbnail creation)

2009-09-15 Thread dan06
I've recently delved into python, about a week or so ago; I'm trying to figure out how to create on-the-fly thumbnails. Are there python standard library modules I could/should use or should I use external libraries like: GD, Gimp, or ImageMagick? -- View this message in context: http://www.na

Re: [Tutor] collecting certain data from a textfile

2009-09-15 Thread bob gailer
Olli Virta wrote: Hi! I got this simple but effective piece of code. It picks certain wanted pieces of data from a textfile based on database records and puts all of them them in a new textfile in certain order. I was wondering, could it be possible to make it otherwise in case that there's

Re: [Tutor] New guy question...

2009-09-15 Thread Warren
Does TextMate support input into a running Python program? I'm not sure if it supports standard input. You might have to run the program from Terminal to get this to work. Good question, Kent. That might be the root of all of this pain. I'll experiment when I get a chance... - Warren (wa

Re: [Tutor] New guy question...

2009-09-15 Thread Kent Johnson
On Tue, Sep 15, 2009 at 9:07 AM, Warren wrote: > Second, I think my machine is probably set up a little weird.  I have Python > 2.6.2 installed alongside 3.1.1 so maybe that makes a difference. That should be fine. >  I'm > writing programs in TextMate and running them from there.  Which seemed

Re: [Tutor] New guy question...

2009-09-15 Thread Warren
First, let me say thanks for all the responses! This definitely looks like a useful mailing list for complete noobs like me. Second, I think my machine is probably set up a little weird. I have Python 2.6.2 installed alongside 3.1.1 so maybe that makes a difference. I'm writing program

[Tutor] PyInit__tkinter fails with UnicodeEncodeError

2009-09-15 Thread lakshman.sah
Hi, I have a standalone python executable created using PyInstaller (modified to support Python 3) on Linux. This executable was running well with Python 3.0.1. But on Python 3.1.1 it is breaking with UnicodeEncodeError. Executable created with same code on Windows it is running without any err

Re: [Tutor] Invitation to connect on LinkedIn

2009-09-15 Thread Tim Golden
Kent Johnson wrote: I'm going to be charitable and assume this is a mistake. This is completely inappropriate to post to the tutor list. I assume -- having seen a few of these go past -- that such services say on joining: do you want me to email every one in your address book to ask them to li

Re: [Tutor] Invitation to connect on LinkedIn

2009-09-15 Thread Michael Connors
Gmail adds everyone you mail to your address book, and sites like LinkedIn ask for your email account credentials to search for contacts from your address book. I think this could happen to anyone who is unfamiliar with either service. Michael 2009/9/15 Kent Johnson > I'm going to be charitable

Re: [Tutor] Invitation to connect on LinkedIn

2009-09-15 Thread Kent Johnson
I'm going to be charitable and assume this is a mistake. This is completely inappropriate to post to the tutor list. Kent On Tue, Sep 15, 2009 at 6:50 AM, Govind Agrawal wrote: > LinkedIn > > I'd like to add you to my professional network on LinkedIn. > > - Govind > > Accept Govind Agrawal's in

Re: [Tutor] Still Trying to Understand GAE

2009-09-15 Thread ad...@gg-lab.net
Hi Wesley! Thankyou very much for your mail (and i'd like to thankyou in a special way for your corrections :) ). > it imports all sub*packages*. don't think directories because the > import mechanism doesn't work this way. this is likely because there > are __init__.py files in those subdirector

[Tutor] collecting certain data from a textfile

2009-09-15 Thread Olli Virta
Hi! I got this simple but effective piece of code. It picks certain wanted pieces of data from a textfile based on database records and puts all of them them in a new textfile in certain order. I was wondering, could it be possible to make it otherwise in case that there's much more rows in that t

[Tutor] Invitation to connect on LinkedIn

2009-09-15 Thread Govind Agrawal
LinkedIn I'd like to add you to my professional network on LinkedIn. - Govind Accept Govind Agrawal's invite: https://www.linkedin.com/e/isd/738276939/KwugpKmr/ -- (c) 2009, LinkedIn Corporation ___ Tutor maillist - Tutor