Re: [Tutor] trouble with function-- trying to check

2007-03-14 Thread Isaac
Hola, Pardon me if I am repeating others, I think I have read the whole thread now. In 5.9 of the Language Reference it says: "Comparisons can be chained arbitrarily, e.g., x < y <= z is equivalent to x < y and y <= z" So this would mean that item == item in word2 means: item == item and it

Re: [Tutor] Working with files with python (gtk)

2007-03-14 Thread Edward A Robinson
I guess what Im looking for is a python command that dose what the file command in the shell would do On 3/14/07, Edward A Robinson <[EMAIL PROTECTED]> wrote: > This is my first time posting to the python tutor so be nice, I have > read the mailing list and cant seem to find and answer there or on

Re: [Tutor] HTTP file download

2007-03-14 Thread Ronaldo
Hi Kent, You were right. The code worked fine. I was doing some thing wrong with some characters in my URL (for example: I had to change "&" to "&"). I'd like to thank you guys for your help. Kent Johnson wrote: > Ronaldo wrote: >> Hi, Jean >> >> I've alredy tried this, but it seems

Re: [Tutor] trouble with function-- trying to check

2007-03-14 Thread Terry Carroll
On Wed, 14 Mar 2007, Kent Johnson wrote: > This has already been discussed on this thread. == and 'in' are comparisons. Aha. I did not see this discussion in the thread; the closest thing I noticed was Alan's note that I was riffing from, which concluded with "It definitely seems to work as I ex

Re: [Tutor] trouble with function-- trying to check

2007-03-14 Thread Isaac
Howdy, This has already been discussed on this thread. == and 'in' are comparisons. I did not get that thread somehow. I thought I looked for the original thread but maybe I did not go back far enough. This thread is great for me - I am learning much. http://docs.python.org/ref/comparisons.ht

[Tutor] Working with files with python (gtk)

2007-03-14 Thread Edward A Robinson
This is my first time posting to the python tutor so be nice, I have read the mailing list and cant seem to find and answer there or on google so I turn to you guys for help. I'm working on a gtk application and I want to list all the image files in a directory. Now I know that if I have an image l

Re: [Tutor] HTTP file download

2007-03-14 Thread Jean-Philippe Durand
Hi Ronaldo, Yes the first solution works with html files. This is how to download a file found on the web : import urllib urllib.urlretrieve('http://www.somesite.com/file', 'c:/mylocalfile') Regards. Jean-Philippe DURAND 2007/3/14, Ronaldo <[EMAIL PROTECTED]>: > Hi, Jean > > I've alredy tri

Re: [Tutor] HTTP file download

2007-03-14 Thread Sönmez Kartal
Hi, Socket downloads the output of given URL. You can get the file's extension by URL and save it as a file with it's extension. Sönmez Ronaldo wrote: > Hi, Jean > > I've alredy tried this, but it seems that this kind of code just works > when "file" in the url (http://www.somesite.com/fil

Re: [Tutor] HTTP file download

2007-03-14 Thread Jason Massey
I've tested this on my Apache server setup, it succesfully downloads the gif file and the text file and saves them. Even though I used the 'wb' flag (write binary) for the text file it turned out okay (the difference in 'w' and 'wb' seemed to be that 'wb' stripped off some of my blank lines). On

Re: [Tutor] HTTP file download

2007-03-14 Thread Kent Johnson
Ronaldo wrote: > Hi, Jean > > I've alredy tried this, but it seems that this kind of code just works > when "file" in the url (http://www.somesite.com/file) is an html file. > The thing is that "file" in this case is a text file. For example: if I > try to download the file using a web browser

Re: [Tutor] declaring decaration on ul list

2007-03-14 Thread Jason Massey
You'll need a style sheet. See: http://alistapart.com/articles/taminglists/ On 3/14/07, Kirk Bailey <[EMAIL PROTECTED]> wrote: It just occurred to me that when my wiki does a backsearch it is useful to list the results with a * for decorating the unordered list results, so I can mousecopy it t

Re: [Tutor] Numpy

2007-03-14 Thread Eike Welk
Hello Miguel! You should go to the NumPy mailing list: http://projects.scipy.org/mailman/listinfo/numpy-discussion There are also people with Mac knowledge. (I use Linux.) Regards Eike. ___ Tutor maillist - Tutor@python.org http://mail.python.org/m

Re: [Tutor] HTTP file download

2007-03-14 Thread Ronaldo
Hi, Jean I've alredy tried this, but it seems that this kind of code just works when "file" in the url (http://www.somesite.com/file) is an html file. The thing is that "file" in this case is a text file. For example: if I try to download the file using a web browser, it asks me for a director

Re: [Tutor] trouble with function-- trying to check

2007-03-14 Thread Kent Johnson
Terry Carroll wrote: > On Wed, 14 Mar 2007, Isaac wrote: > >> a, b, c, or d is a type('str') not boolean which is what (c in "crab") is. >> The [in] operator takes presedence, the first 3 times (c in "crab") returns >> true and the last returns false; but the strings a, b, c, or d do not == >> tru

Re: [Tutor] Roman to digital (pseudocode)

2007-03-14 Thread János Juhász
Hi All, > - A dictionary will help you look up values, but not rules. It does > not retain its order and order is essential. Instead, create a tuple > of the roman numerals in ascending order (roman). Create a paired > tuple with the base 10 value (baseten). > Now get an element from the string

Re: [Tutor] trouble with function-- trying to check

2007-03-14 Thread Terry Carroll
On Wed, 14 Mar 2007, Isaac wrote: > a, b, c, or d is a type('str') not boolean which is what (c in "crab") is. > The [in] operator takes presedence, the first 3 times (c in "crab") returns > true and the last returns false; but the strings a, b, c, or d do not == > true or false - therefore the te

Re: [Tutor] trouble with function-- trying to check

2007-03-14 Thread Isaac
As far as I can tell: because (c in "crab") membership is in parentheses it is more binding than the [==] comparison. That is why it returns true/false first. I incorrectly wrote before: " The [in] operator takes precedence" http://docs.python.org/ref/summary.html -Isaac On 3/14/07, Isaac <[