Using Beautiful Soup

2006-08-18 Thread Tempo
Heya. I have never used a module/script before, and the first problem I have run into is that I do not know how to install a module/script. I have downloaded Beautiful Soup, but how do I use it in one of my own programs? I know that I use an "include" statement, but do I first need to make a copy o

Extracting text from a string

2006-09-07 Thread Tempo
Hello. I am having a little trouble extracting text from a string. The string that I am dealing with is pasted below, and I want to extract the prices that are contained in the string below. Thanks in advanced for any and all help. Thank you. $14.99

Re: Extracting text from a string

2006-09-07 Thread Tempo
Okay, so it sounds like I am in the right direction. However, I am not sure that the text is in a string or some other format becasue the string is enclosed in "[" and "]", not in ' '. -- http://mail.python.org/mailman/listinfo/python-list

Re: Extracting text from a string

2006-09-07 Thread Tempo
This is the output I get: >>> prices [ $14.99 , $27.99 , $66.99 ,

split string problems

2006-09-07 Thread Tempo
Hey. I am trying to grab the prices from the string below but I get a few errors when I try to do it: Take a look at the code and error messages below for me and thanks you in advanced to all that help. Thank you. Here's the code & error messages: >>> p [ $1

urlopen() error

2006-09-08 Thread Tempo
Hello. I am getting an error and it has gotten me stuck. I think the best thing I can do is post my code and the error message and thank everybody in advanced for any help that you give this issue. Thank you. # Here's the code: # import urllib2 import re import xlrd from B

Pre-defining an action to take when an expected error occurs

2006-09-14 Thread Tempo
Hello. I am getting the error that is displayed below, and I know exactly why it occurs. I posted some of my program's code below, and if you look at it you will see that the error terminates the program pre-maturely. Becasue of this pre-mature termination, the program is not able to execute it's f

Re: Pre-defining an action to take when an expected error occurs

2006-09-14 Thread Tempo
Thanks for all of the help. It all has been very useful to an new python programmer. I agree that I should fix the error/bug instead of handeling it with a try/etc. However, I do not know why "range(sh.nrows)" never gets the right amount of rows right. For example, if the Excel sheet has 10 rows wi

Re: Pre-defining an action to take when an expected error occurs

2006-09-15 Thread Tempo
John Machin thanks for all of your help, and I take responsibility for the way I worded my sentences in my last reply to this topic. So in an effort to say sorry, I want to make it clear to everybody that it seems as though errors in my code and use of external programs (Excel in particular) are m

Re: xlrd number of rows in worksheet (was: Re: Pre-defining an action to take when an expected error occurs)

2006-09-19 Thread Tempo
It worked. Those two functions (usefulness_of_cells & number_of_good_rows) seem to work flawlessly...knock on wood. I have run a number of different Excel spreadsheets through the functions, and so far the functions have a 100% acuracy rating. The acuracy rating is based on the functions' returned

Concerning Regular Expressions

2006-01-29 Thread Tempo
lines', for 'R0 -'. Thanks in advanced for any and all info that I recieve. -Tempo- -- http://mail.python.org/mailman/listinfo/python-list

Re: Concerning Regular Expressions

2006-01-29 Thread Tempo
Whoops. I've got another tid-bit to tack onto this post. What kind of value does this expression return: re.sub(r'^R0 -', line) Does it return a '1' if successful and a '0' if not successful? -- http://mail.python.org/mailman/listinfo/python-list

Re: Concerning Regular Expressions

2006-01-29 Thread Tempo
You are right that my move towards regular expressions was way premature, but also this post may too turn out to be a little premature. I guessed and checked myself a way to accomplish what I needed and I will include it in this post. But first Alex (doesn't have to be Alex) could you tell me if yo

Is Python good for web crawlers?

2006-02-07 Thread Tempo
I was wondering if python is a good language to build a web crawler with? For example, to construct a program that will routinely search x amount of sites to check the availability of a product. Or to search for news articles containing the word 'XYZ'. These are just random ideas to try to explain

Re: Is Python good for web crawlers?

2006-02-07 Thread Tempo
Why do you say that the bottleneck of the crawler will always be downloading the page? Is it becasue there isn't already a modual to do this and I will have to start from scratch? Or a bandwidth issue? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python good for web crawlers?

2006-02-07 Thread Tempo
Does a web crawler have to download an entire page if it only needs to check if the product is in stock on a page? Or if it just needs to search for one match of a certain word on a page? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python good for web crawlers?

2006-02-07 Thread Tempo
I took your advice and got a copy of BeautifulSoup, but I am having trouble installing the module. Any advice? I noticed that I just can't put it into the 'lib' directory of python to install it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python good for web crawlers?

2006-02-07 Thread Tempo
I agree. I think the way that I will learn to use most of it is by going through the source code. -- http://mail.python.org/mailman/listinfo/python-list

HTML page into a string

2006-02-07 Thread Tempo
In my last post I received some advice to use urllib.read() to get a whole html page as a string, which will then allow me to use BeautifulSoup to do what I want with the string. But when I was researching the 'urllib' module I couldn't find anything about its sub-section '.read()' ? Is that the ri

Re: HTML page into a string

2006-02-07 Thread Tempo
Perfect. Thanks a bunch for clearing that all up for me. You have delayed some long lost hours for me. -- http://mail.python.org/mailman/listinfo/python-list

Python and ASP

2006-02-14 Thread Tempo
I recently uploaded a sample ASP-Python page to my web server and it didn't show up correctly. Before I explain what it did, I should mention that I got the same result when I tried to view the page from my desktop (winxp user). So when I tried to view the sample ASP with Python page from my deskto

Re: Python and ASP

2006-02-14 Thread Tempo
It still doesn't work. I fixed that one error that you pointed out Roger Upole, but it still isn't working. All I did was copy and past the code above, plus Roger's fix, into Notepad2 and saved it as a '.asp'. When I opened it in Firefox, all that showed up was the source code of the file. It seems

Re: Python and ASP

2006-02-14 Thread Tempo
What do you mean? I can't just upload the file to the server that is going to host my site? -- http://mail.python.org/mailman/listinfo/python-list

Python, Forms, Databases

2006-02-15 Thread Tempo
I have been looking around for a few days for ways to use Python with HTML forms. What I am interested in doing is placing the data that is submited through an HTML form and collected by Python into a MySQL database. I initially thought that I was going to be able to do this with ASP, but I found o

Re: Python, Forms, Databases

2006-02-15 Thread Tempo
Larry I do see your point. There does seem to be a lot more support for PHP and MySQL together than there is Python and ASP. But I want to first try to accomplish my goal by using Python first before I give up and revert back to PHP. So if I was going to parse HTML forms and place the data into a M

What are COM-enabled applications?

2006-02-21 Thread Tempo
As the subject of this post suggests, I have one question; what are COM-enabled applications? I believe Microsoft Word is one of these apps, but what else? Is a web browser, Paint, Solitare, games, etc? I'm not sure if it varies from operating system to operating system, but I am talking about COM

Copy a file from PDA

2007-06-06 Thread Tempo
Are there libraries out there that will assist me in copying a file from my Dell Axim PDA (Windows Mobile) and putting the copy onto my desktop (Windows XP)? Thanks so much. -- http://mail.python.org/mailman/listinfo/python-list

Build EXE on Mac OsX 10.4

2007-06-13 Thread Tempo
Has anyone sucesfully built a *.exe file on a mac operating system before from a *.py file? I have been trying to do this with pyinstaller, but I keep getting errors and I don't know how to install UPX properly. I tried putting the linux UPX folder in my python 2.4 directory, but that didn't work.