Re: [Tutor] Indexing a List of Strings

2011-05-18 Thread spawgi
Agreed that your original sequences are 1000 char long. But it helps to understand the problem better if you can give examples with smaller strings. Please can you post smaller examples? This will also help you test your code on your own inputs. On Wed, May 18, 2011 at 5:40 AM, Spyros Charonis

Re: [Tutor] Beginner needs help with tkinter and images

2011-05-18 Thread Alan Gauld
Adam Westrum jadesat...@gmail.com wrote I've got a basic program going right now, with 4 buttons. Forward backward right and left. Each button goes to an image of a colored circle. Problem i'm having is that when you click a button, the picture appears. When you click another button, a

Re: [Tutor] how to read two files and substitute

2011-05-18 Thread Alan Gauld
lina lina.lastn...@gmail.com wrote where I can get some advanced, terse and powerful python tutorials. short but powerful and a bit hard to understand at first. The Python web site has many tutorials listed: http://wiki.python.org/moin/BeginnersGuide/Programmers Your definition of advanced,

[Tutor] can I walk or glob a website?

2011-05-18 Thread Albert-Jan Roskam
Hello, How can I walk (as in os.walk) or glob a website? I want to download all the pdfs from a website (using urllib.urlretrieve), extract certain figures (using pypdf- is this flexible enough?) and make some statistics/graphs from those figures (using rpy and R). I forgot what the process of

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Alan Gauld
Albert-Jan Roskam fo...@yahoo.com wrote How can I walk (as in os.walk) or glob a website? I don't think there is a way to do that via the web. Of course if you have access to the web servers filesystem you can use os.walk to do it as for any other filesystem, but I don't think its

[Tutor] Sequencing

2011-05-18 Thread Cindy Lee
Hi Pyton Tutors thanks for adding me, I am new to Python and missed one of my classes and am not sure of my homework. We are currently on sequencing and are being asked to make a function that receives text as an argument and returns the same text, but with 1 added to each number. So far I

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Flynn, Stephen (L P - IT)
Pardon the crappy quoting - forced to use Exchange. Top posted too... the shame. What about curl and libcurl? http://curl.haxx.se/ S. -Original Message- From: tutor-bounces+steve.flynn=capita.co...@python.org [mailto:tutor-bounces+steve.flynn=capita.co...@python.org] On Behalf Of Alan

Re: [Tutor] Sequencing

2011-05-18 Thread spawgi
I don't think we can solve your homework :). But regarding hint, try to think in terms of each number as part of list and then process the list. Also, consider the option if the numbers will be given as a string or as integers or float etc. Thanks. On Wed, May 18, 2011 at 2:49 PM, Cindy Lee

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Alan Gauld wrote: Albert-Jan Roskam fo...@yahoo.com wrote How can I walk (as in os.walk) or glob a website? I don't think there is a way to do that via the web. Of course if you have access to the web servers filesystem you can use os.walk to do it as for any other

Re: [Tutor] Sequencing

2011-05-18 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Cindy Lee wrote: Hi Pyton Tutors thanks for adding me, I am new to Python and missed one of my classes and am not sure of my homework. We are currently on sequencing and are being asked to make a function that receives text as an argument and returns the same text,

Re: [Tutor] Sequencing

2011-05-18 Thread Cindy Lee
Thanks for the advice. I seem to keep getting the same errror: function ReceiveAndReturn at 0x16b43b0 Any advise? Also, is the _add_ string something I should be using? help(str.__add__) Help on wrapper_descriptor: __add__(...)     x.__add__(y) == x+y From:

Re: [Tutor] Sequencing

2011-05-18 Thread Noah Hall
On Wed, May 18, 2011 at 11:27 AM, Cindy Lee cindylee2...@yahoo.com wrote: Thanks for the advice. I seem to keep getting the same errror: function ReceiveAndReturn at 0x16b43b0 This error is fully expected. print is displaying what it's given - the function ReceiveAndReturn. In order to use the

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Steven D'Aprano
On Wed, 18 May 2011 07:06:07 pm Albert-Jan Roskam wrote: Hello, How can I walk (as in os.walk) or glob a website? If you're on Linux, use wget or curl. If you're on Mac, you can probably install them using MacPorts. If you're on Windows, you have my sympathies. *wink* I want to download

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Albert-Jan Roskam
From: Dave Angel da...@ieee.org To: Alan Gauld alan.ga...@btinternet.com Cc: tutor@python.org Sent: Wed, May 18, 2011 11:51:35 AM Subject: Re: [Tutor] can I walk or glob a website? On 01/-10/-28163 02:59 PM, Alan Gauld wrote: Albert-Jan Roskam fo...@yahoo.com wrote How can I walk (as in

[Tutor] Program

2011-05-18 Thread Johnson Tran
Hi Again All, I had a couple questions about my program: def CollectNames(): answer_set=set([]) sorted_list = sorted(answer_set) word=raw_input(Name #1: ) word=raw_input(Name #2: ) word=raw_input(Name #3: ) word=raw_input(Name #4: ) word=raw_input(Name

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Peter Otten
Albert-Jan Roskam wrote: How can I walk (as in os.walk) or glob a website? I want to download all the pdfs from a website (using urllib.urlretrieve), extract certain figures (using pypdf- is this flexible enough?) and make some statistics/graphs from those figures (using rpy and R). I forgot

Re: [Tutor] Program

2011-05-18 Thread Corey Richardson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/18/2011 08:26 AM, Johnson Tran wrote: Hi Again All, I had a couple questions about my program: def CollectNames(): answer_set=set([]) sorted_list = sorted(answer_set) word=raw_input(Name #1: )

Re: [Tutor] Program

2011-05-18 Thread Johnson Tran
Thanks for the reply. So to append a word is it suppose to look kind of like: word=raw_input(Name #1: ) word.append(words) I keep getting error message: Traceback (most recent call last): File /Users/JT/Desktop/pythonfinal, line 23, in module CollectNames() File

Re: [Tutor] Program

2011-05-18 Thread Corey Richardson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/18/2011 09:05 AM, Johnson Tran wrote: Thanks for the reply. So to append a word is it suppose to look kind of like: word=raw_input(Name #1: ) word.append(words) I keep getting error message: Traceback (most recent call last):

Re: [Tutor] Program

2011-05-18 Thread Wayne Werner
On Wed, May 18, 2011 at 7:26 AM, Johnson Tran aznj...@me.com wrote: Hi Again All, I had a couple questions about my program: Corey gave you some good pointers already, but let me add a few... def CollectNames(): answer_set=set([]) sorted_list = sorted(answer_set) This won't do

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Alan Gauld
Dave Angel da...@ieee.org wrote Albert-Jan Roskam fo...@yahoo.com wrote How can I walk (as in os.walk) or glob a website? I don't think there is a way to do that via the web. It has to be (more or less) possible. That's what google does for their search engine. Google trawls the site

Re: [Tutor] RuntimeError: file does not exist

2011-05-18 Thread Susana Iraiis Delgado Rodriguez
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 alan.ga...@btinternet.com Susana Iraiis Delgado Rodriguez susana.delgad...@utzmg.edu.mx wrote message which tells me the file I want to work with doesn't exist, but it

Re: [Tutor] Program

2011-05-18 Thread Alan Gauld
Johnson Tran aznj...@me.com wrote I had a couple questions about my program: def CollectNames(): answer_set=set([]) sorted_list = sorted(answer_set) This creates an empty set then sorts it and stores the result as an empty list. I'm not sure what you think it does but I'm guessing

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Prasad, Ramit
Are you going to be doing this seldom enough that the bandwidth used won't be a DOS attack? It will not solve the problem completely, but I know that wget (and probably curl) have speed limiters you can set to help reduce the chances of DOS. If you are using urllib you could look at:

Re: [Tutor] RuntimeError: file does not exist

2011-05-18 Thread Walter Prins
On 18 May 2011 15:45, Susana Iraiis Delgado Rodriguez susana.delgad...@utzmg.edu.mx wrote: Hello Alan!! Can you please tell me, how to rebuild my path? I've tried it, but I didn't succed =( Always post the code you tried, and the full error message you received, otherwise you make it

Re: [Tutor] RuntimeError: file does not exist

2011-05-18 Thread Prasad, Ramit
Try hard coding it to test, but it probably wants base as the directory and file as the filename: mapnik.Shapefile(base=C:\\, file=' Ýndice.shp') Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423

Re: [Tutor] Sequencing

2011-05-18 Thread Alan Gauld
Cindy Lee cindylee2...@yahoo.com wrote ...asked to make a function that receives text as an argument and returns the same text, but with 1 added to each number. So far I have: def ReceiveAndReturn(): sentence=raw_input(Give me a sentence with variables in it: ) The assignment says

Re: [Tutor] Looking for feedback on improving my code.

2011-05-18 Thread Prasad, Ramit
The big thing I've noticed is, and I'm a total newbie btw, mind cap conventions. Reading and implementing PEP 8 (http://python.org/dev/peps/pep-0008/) will help make your code more readable and quickly understandable to other Python developers. I highly encourage it. Ramit Ramit Prasad |

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Albert-Jan Roskam
Hi Steven, From: Steven D'Aprano st...@pearwood.info To: tutor@python.org Sent: Wed, May 18, 2011 1:13:17 PM Subject: Re: [Tutor] can I walk or glob a website? On Wed, 18 May 2011 07:06:07 pm Albert-Jan Roskam wrote: Hello, How can I walk (as in os.walk) or glob a website? If you're on

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Albert-Jan Roskam
From: Alan Gauld alan.ga...@btinternet.com To: tutor@python.org Sent: Wed, May 18, 2011 4:40:19 PM Subject: Re: [Tutor] can I walk or glob a website? Dave Angel da...@ieee.org wrote Albert-Jan Roskam fo...@yahoo.com wrote How can I walk (as in os.walk) or

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Marc Tompkins
On Wed, May 18, 2011 at 2:06 AM, Albert-Jan Roskam fo...@yahoo.com wrote: Hello, How can I walk (as in os.walk) or glob a website? I want to download all the pdfs from a website (using urllib.urlretrieve), extract certain figures (using pypdf- is this flexible enough?) and make some

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Hugo Arts
On Wed, May 18, 2011 at 7:32 PM, Albert-Jan Roskam fo...@yahoo.com wrote: === Thanks for your reply. I tried wget, which seems to be a very handy tool. However, it doesn't work on this particular site. I tried wget -e robots=off -r -nc --no-parent -l6 -A.pdf

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Prasad, Ramit
It's horribly crude, in retrospect, and I'm embarrassed re-reading my code - but if you're interested I can forward it (if only as an example of what _not_to do.) I would be interested even if the OP is not ;) Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Marc Tompkins
On Wed, May 18, 2011 at 11:04 AM, Prasad, Ramit ramit.pra...@jpmchase.comwrote: It's horribly crude, in retrospect, and I'm embarrassed re-reading my code - but if you're interested I can forward it (if only as an example of what _not_to do.) I would be interested even if the OP is not ;)

Re: [Tutor] can I walk or glob a website?

2011-05-18 Thread Marc Tompkins
On Wed, May 18, 2011 at 11:21 AM, Marc Tompkins marc.tompk...@gmail.comwrote: On Wed, May 18, 2011 at 11:04 AM, Prasad, Ramit ramit.pra...@jpmchase.com wrote: It's horribly crude, in retrospect, and I'm embarrassed re-reading my code - but if you're interested I can forward it (if only as

[Tutor] xrange() with start or stop sys.maxint?

2011-05-18 Thread Terry Carroll
Is there any way to use xrange with a start or stop value that exceeds sys.maxint? import sys print sys.maxint 2147483647 start = sys.maxint-1 for i in xrange(start, start+1): ... pass ... start = sys.maxint for i in xrange(start, start+1): ... pass ... Traceback (most recent call

[Tutor] Crystal reports in Python

2011-05-18 Thread Mark Cowley - FlexSystems
Hi Can anybody help me with some info on how to display Crystal reports in Python or suggest any good alternatives. Thanks Mark flex FlexSystems LLC 425 South Bowen Street, Suite 2 Longmont, CO 80501 Office: 303.684.8303 x6102 Cell: 720.938.5842 Fax: 303.926.4494

[Tutor] Data conversion

2011-05-18 Thread Joe Aquilina
Hello. I am new to this list and very much a beginner to Python. Please excuse me if this is a silly question, but in all my searches this morning I have not been able to find an answer. I have a (single table) database file (SQLite3). It has one table, call it literature, with an integer,

Re: [Tutor] Data conversion

2011-05-18 Thread Andre Engels
On Thu, May 19, 2011 at 6:36 AM, Joe Aquilina j...@chem.com.au wrote: I am new to this list and very much a beginner to Python. Please excuse me if this is a silly question, but in all my searches this morning I have not been able to find an answer. I have a (single table) database file