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

2011-05-18 Thread spawgi
What is the version of python you are using? >From the documentation of python 2.71. http://docs.python.org/library/functions.html#xrange CPython implementation detail: xrange() is intended to be simple and fast. Implementations may impose restrictions to achieve this. The C implementation of Pyt

Re: [Tutor] Data conversion

2011-05-18 Thread Peter Otten
Joe Aquilina 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 (SQLite3). It has one table, call > it literature

Re: [Tutor] Data conversion

2011-05-18 Thread Joe Aquilina
On 19/05/11 13:53, Andre Engels wrote: On Thu, May 19, 2011 at 6:36 AM, Joe Aquilina 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 tabl

Re: [Tutor] Data conversion

2011-05-18 Thread Andre Engels
On Thu, May 19, 2011 at 6:36 AM, Joe Aquilina 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 (SQLite3). It ha

[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, a

[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 Email:

[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 last

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 wrote: > On Wed, May 18, 2011 at 11:04 AM, Prasad, Ramit > 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 an example of >> what _not_to do.) >> >>

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 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 an example of > what _not_to do.) > > I would be interested even if the OP is not ;) > > OK then, but bea

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 Hugo Arts
On Wed, May 18, 2011 at 7:32 PM, Albert-Jan Roskam 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 > 'http://www.landelijkregisterkinderopvang.nl

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 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 statistics/graphs f

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

2011-05-18 Thread Albert-Jan Roskam
From: Alan Gauld 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" wrote >> "Albert-Jan Roskam" wrote >>> How can I walk (as in os.walk) or glob a website? >> >> I don't think there is

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

2011-05-18 Thread Albert-Jan Roskam
Hi Steven, From: Steven D'Aprano 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 Linux, use wget or

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 | J

Re: [Tutor] Sequencing

2011-05-18 Thread Alan Gauld
"Cindy Lee" 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 it should receive t

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 Fro

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] 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: htt

Re: [Tutor] Program

2011-05-18 Thread Alan Gauld
"Johnson Tran" 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 that's not it...

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 > > "Susana Iraiis Delgado Rodriguez" wrote > > > message which tells me the file I want to work with >> doesn't exist, but it does. >> > > I don't believe you! :-) > > Trac

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

2011-05-18 Thread Alan Gauld
"Dave Angel" wrote "Albert-Jan Roskam" 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 following links. If thats

Re: [Tutor] Program

2011-05-18 Thread Wayne Werner
On Wed, May 18, 2011 at 7:26 AM, Johnson Tran 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 what

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 ca

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 CollectNames() File "/Users/JT/Desktop/pyt

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: ") > > word=

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 forg

[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(

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

2011-05-18 Thread Albert-Jan Roskam
From: Dave Angel To: Alan Gauld 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" wrote >> How can I walk (as in os.walk) or glob a website? > > I don't think 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 downl

Re: [Tutor] Sequencing

2011-05-18 Thread Noah Hall
On Wed, May 18, 2011 at 11:27 AM, Cindy Lee wrote: > Thanks for the advice. I seem to keep getting the same errror: > 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 No, not really.

Re: [Tutor] Sequencing

2011-05-18 Thread Cindy Lee
Thanks for the advice. I seem to keep getting the same errror: >> help(str.__add__) Help on wrapper_descriptor: __add__(...)     x.__add__(y) <==> x+y From: Dave Angel To: Cindy Lee Cc: "tutor@python.org" Sent: Wednesday, 18 May 2011, 3:02 Subject: Re: [Tutor

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, b

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" 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, b

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 wrot

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 Ga

[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 have

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

2011-05-18 Thread Alan Gauld
"Albert-Jan Roskam" 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 generally possible ov

[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] how to read two files and substitute

2011-05-18 Thread Alan Gauld
"lina" 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, terse and powerful ma

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

2011-05-18 Thread Alan Gauld
"Adam Westrum" 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 different picture appear

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 wro