Re: [Tutor] Why difference between printing string & typing its object reference at the prompt?

2012-10-02 Thread Steven D'Aprano
On Tue, Oct 02, 2012 at 10:15:02PM -0500, boB Stepp wrote: > I am puzzled by the results of the following: > > >>> x = "Test" > >>> x > 'Test' > >>> print(x) > Test > > I understand that 'Test' is the stored value in memory where the > single quotes designate the value as being a string data typ

Re: [Tutor] Filename match on file extensions

2012-10-02 Thread Dave Wilder
Awesome! Thank you for the great info gentlemen. It should be an easy fix from here. -Original Message- From: Tutor [mailto:tutor-bounces+d.wilder=f5@python.org] On Behalf Of Steven D'Aprano Sent: Wednesday, October 03, 2012 1:49 AM To: tutor@python.org Subject: Re: [Tutor] Filen

Re: [Tutor] Filename match on file extensions

2012-10-02 Thread Steven D'Aprano
On Wed, Oct 03, 2012 at 03:14:16AM +, Dave Wilder wrote: > > Hello, > > Below is a snippet of a search I want to do for any file that contains the > string "quarantine" in the filename. > It works for picking up any file name containing "quarantine" except when > "quarantine" is used as an

Re: [Tutor] Filename match on file extensions

2012-10-02 Thread Dave Angel
On 10/02/2012 11:45 PM, Dave Wilder wrote: > >>> Hello, >>> Below is a snippet of a search I want to do for any file that contains the >>> string "quarantine" in the filename. >>> It works for picking up any file name containing "quarantine" except when >>> "quarantine" is used as an extension. >

Re: [Tutor] Why difference between printing string & typing its object reference at the prompt?

2012-10-02 Thread Brian van den Broek
On 2 Oct 2012 23:17, "boB Stepp" wrote: > I am puzzled by the results of the following: > > >>> x = "Test" > >>> x > 'Test' > >>> print(x) > Test > > I understand that 'Test' is the stored value in memory where the > single quotes designate the value as being a string data type. So it > makes s

Re: [Tutor] Why difference between printing string & typing its object reference at the prompt?

2012-10-02 Thread Dave Angel
On 10/02/2012 11:15 PM, boB Stepp wrote: > After much diddling around I have finally settled on a text to study > (Programming in Python 3, 2nd edition, by Mark Summerfield) and have > defaulted to using IDLE, deferring worrying about editors/IDEs until I > feel comfortable in Python. > > I am puzz

Re: [Tutor] Filename match on file extensions

2012-10-02 Thread Dave Wilder
>> Hello, >> Below is a snippet of a search I want to do for any file that contains the >> string "quarantine" in the filename. >> It works for picking up any file name containing "quarantine" except when >> "quarantine" is used as an extension. >> For example, the search would find quarantine

Re: [Tutor] Filename match on file extensions

2012-10-02 Thread c smith
Would this be a time when regex is necessary? Maybe: \b[^.]*quarantine[^.]*\.[a-zA-Z]*\b ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Filename match on file extensions

2012-10-02 Thread Dave Wilder
Hello, Below is a snippet of a search I want to do for any file that contains the string "quarantine" in the filename. It works for picking up any file name containing "quarantine" except when "quarantine" is used as an extension. For example, the search would find quarantine.txt but fails to f

[Tutor] Why difference between printing string & typing its object reference at the prompt?

2012-10-02 Thread boB Stepp
After much diddling around I have finally settled on a text to study (Programming in Python 3, 2nd edition, by Mark Summerfield) and have defaulted to using IDLE, deferring worrying about editors/IDEs until I feel comfortable in Python. I am puzzled by the results of the following: >>> x = "Test"

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-02 Thread Steven D'Aprano
On 02/10/12 22:25, Francois Dion wrote: Even worse would be the case of a young aficionado. It is very hard to infer the age of a person from a post. Obligatory bash.org quote: http://bash.org/?14207 For those who don't know bash.org, it contains extracts of IRC and other chat logs. Many o

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-02 Thread boB Stepp
On Tue, Oct 2, 2012 at 6:25 PM, boB Stepp wrote: > This is the beginning of exactly the same message I received when I > first joined this mailing list. Honestly, newbie or not, I do not > understand why many of the posts from newcomers so routinely violate > the contents of this welcome message

Re: [Tutor] getattr works sometimes

2012-10-02 Thread Steven D'Aprano
On 03/10/12 04:20, Tino Dai wrote: and the get_class class works sometime for finding modules within a certain directory. If the get_class doesn't work, it throws an AttributeError. I don't really understand what you mean by this. Can you copy and paste the actual error message (all of it)?

Re: [Tutor] getattr works sometimes

2012-10-02 Thread Steven D'Aprano
On 03/10/12 03:44, Tino Dai wrote: Hi All, I'm using the get_class from: http://stackoverflow.com/questions/452969/does-python-have-an-equivalent-to-java-class-forname Do you mean this function? def get_class( kls ): parts = kls.split('.') module = ".".join(parts[:-1]) m

Re: [Tutor] "ImportError: _strptime not supported"

2012-10-02 Thread eryksun
On Tue, Oct 2, 2012 at 6:19 PM, wrote: > > from datetime import datetime > start_date = datetime(year=2012, month=11, day=3) > print(start_date) > > datestring = '10/11/2012' > experiment_date = datetime.strftime(datestring, '%d/%m/%Y') > print(experiment_date) > > if experiment_date > start_date

Re: [Tutor] "ImportError: _strptime not supported"

2012-10-02 Thread Oscar Benjamin
On 2 October 2012 23:19, wrote: > The following code was recently suggested as an example of how the > datetime module could be used to solve a problem. Not having access to > Python at work, I found > http://pythontutor.com/visualize.html > thinking it would allow me to "play with Python" when

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-02 Thread boB Stepp
Leam, On Tue, Oct 2, 2012 at 4:04 AM, leam hall wrote: > > Does the welcome e-mail cover any of the recommended behavior? Are there > easier ways to request participation within guidelines? > Not only does the welcome message cover this, apparently when I posted my message that started this thre

[Tutor] Fwd: "ImportError: _strptime not supported"

2012-10-02 Thread Marc Tompkins
Forgot to send to the list. Grrr. -- Forwarded message -- From: Marc Tompkins Date: Tue, Oct 2, 2012 at 3:32 PM Subject: Re: [Tutor] "ImportError: _strptime not supported" To: aklei...@sonic.net On Tue, Oct 2, 2012 at 3:19 PM, wrote: > > The following code was recently sugges

[Tutor] "ImportError: _strptime not supported"

2012-10-02 Thread akleider
The following code was recently suggested as an example of how the datetime module could be used to solve a problem. Not having access to Python at work, I found http://pythontutor.com/visualize.html thinking it would allow me to "play with Python" when I have a free moment. from datetime import

Re: [Tutor] posting with urllib2

2012-10-02 Thread Joel Goldstick
On Tue, Oct 2, 2012 at 5:27 PM, Benjamin Fishbein wrote: > Hi. I'm really confused about which data I need to put in for posting > something with urllib2. > > I added the action on to the website. I know that I use that for the URL > parameter. But what do I need to put in dicts to pass along data

[Tutor] posting with urllib2

2012-10-02 Thread Benjamin Fishbein
Hi. I'm really confused about which data I need to put in for posting something with urllib2. I added the action on to the website. I know that I use that for the URL parameter. But what do I need to put in dicts to pass along data? And what is the purpose of the third parameter...the delay?? Th

Re: [Tutor] Help for Python Beginner with extracting and manipulating data from thousands of ASCII files

2012-10-02 Thread Oscar Benjamin
Hi Cecilia, I'm sending this again as the first message was sent only to you (I hadn't realised that your own message was sent only to me as well). If you want to reply please reply-all to this message. On 1 October 2012 17:42, Cecilia Chavana-Bryant wrote: > On Mon, Oct 1, 2012 at 11:02 AM, Osca

Re: [Tutor] getattr works sometimes

2012-10-02 Thread Oscar Benjamin
On 2 October 2012 19:27, Tino Dai wrote: > On Tue, Oct 2, 2012 at 2:20 PM, Tino Dai wrote: and the get_class class works sometime for finding modules within a certain directory. If the get_class doesn't work, it throws an AttributeError. >>> >>> I don't really understand what you m

Re: [Tutor] getattr works sometimes

2012-10-02 Thread Tino Dai
On Tue, Oct 2, 2012 at 2:20 PM, Tino Dai wrote: >>> and the get_class class works sometime for finding modules within a >>> certain directory. If the get_class >>> doesn't work, it throws an AttributeError. >> >> I don't really understand what you mean by this. Can you copy and >> paste the actual

Re: [Tutor] getattr works sometimes

2012-10-02 Thread Tino Dai
>> and the get_class class works sometime for finding modules within a >> certain directory. If the get_class >> doesn't work, it throws an AttributeError. > > I don't really understand what you mean by this. Can you copy and > paste the actual error message (all of it)? > >> >> The module exists i

Re: [Tutor] getattr works sometimes

2012-10-02 Thread Oscar Benjamin
On 2 October 2012 18:44, Tino Dai wrote: > Hi All, Hi Tino > > I'm using the get_class from: > > http://stackoverflow.com/questions/452969/does-python-have-an-equivalent-to-java-class-forname Can you show the relevant portion of your code please? > > and the get_class class works sometim

Re: [Tutor] a question about maxint

2012-10-02 Thread eryksun
On Tue, Oct 2, 2012 at 12:55 PM, Katya Stolpovskaya wrote: > > I have this error: > from sys import * maxint > Traceback (most recent call last): > File "", line 1, in > maxint > NameError: name 'maxint' is not defined > > > What does it mean and how to deal with it? The "int" type in

[Tutor] getattr works sometimes

2012-10-02 Thread Tino Dai
Hi All, I'm using the get_class from: http://stackoverflow.com/questions/452969/does-python-have-an-equivalent-to-java-class-forname and the get_class class works sometime for finding modules within a certain directory. If the get_class doesn't work, it throws an AttributeError. The modul

Re: [Tutor] a question about maxint

2012-10-02 Thread Mark Lawrence
On 02/10/2012 17:55, Katya Stolpovskaya wrote: Hi all, I have this error: from sys import * maxint Traceback (most recent call last): File "", line 1, in maxint NameError: name 'maxint' is not defined What does it mean and how to deal with it? Thank you in advance, Katya _

Re: [Tutor] a question about maxint

2012-10-02 Thread Peter Otten
Katya Stolpovskaya wrote: > I have this error: > from sys import * maxint > Traceback (most recent call last): > File "", line 1, in > maxint > NameError: name 'maxint' is not defined > > > What does it mean and how to deal with it? You are probably using Python 3 which doesn't have

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-02 Thread Alan Gauld
On 02/10/12 13:17, Mark Lawrence wrote: I do not intend helping anyone who insists on top posting despite requests not to do so. That is of course your prerogative, we can reply to, or ignore, whichever posts we choose. But we need to be realistic about top posting. It is the norm, and gener

[Tutor] a question about maxint

2012-10-02 Thread Katya Stolpovskaya
Hi all, I have this error: >>> from sys import * >>> maxint Traceback (most recent call last): File "", line 1, in maxint NameError: name 'maxint' is not defined What does it mean and how to deal with it? Thank you in advance, Katya -- AKA XIAOJIA __

[Tutor] How can we help?

2012-10-02 Thread bob gailer
On 10/2/2012 10:38 AM, zouzhberk wrote: tutor-requ...@python.org编写: Send Tutor mailing list submissions to tutor@python.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/tutor or, via email, send a message with subject or bod

[Tutor] Thanks for all your comments regarding how we communicate.

2012-10-02 Thread bob gailer
Thanks for all your comments regarding how we communicate. I appreciate your support when someone responds negatively to my offerings of help. It is true that I can be "brusque" (which is an embarrassment for me as a teacher of Nonviolent Communication). Your encouragement to be welcoming a

Re: [Tutor] Tutor Digest, Vol 104, Issue 8

2012-10-02 Thread zouzhberk
tutor-requ...@python.org编写: >Send Tutor mailing list submissions to > tutor@python.org > >To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/tutor >or, via email, send a message with subject or body 'help' to > tutor-requ...@pyth

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-02 Thread boB Stepp
On Tue, Oct 2, 2012 at 7:25 AM, Francois Dion wrote: > Even worse would be the case of a young aficionado. It is very hard > to infer the age of a person from a post. As Python is making inroads > in the K-12 sector and through inexpensive computing platforms such as > OLPC, the Raspberry Pi and

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-02 Thread Mark Lawrence
On 02/10/2012 09:08, Alan Gauld wrote: I am glad you brought the subject up. I had been thinking of posting something similar. There have been a few outbursts of late, and we have seen some posts where the content was entirely aimed at improving the format of the message rather than trying to a

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-02 Thread Francois Dion
On Mon, Oct 1, 2012 at 9:34 PM, boB Stepp wrote: > However, I > think that extra care may be needed in dealing with newbies who may > only be taking a programming course using Python because of curriculum > requirements. A lot of questions seem to come from college students trying to get the best

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-02 Thread Mark Lawrence
On 02/10/2012 12:44, Oscar Benjamin wrote: On 2 October 2012 11:16, Cecilia Chavana-Bryant wrote: In my case, I am a complete beginner not only to python but programming in general, a complete beginner to internet forums (this is my third post ever) and I am also not a native English speaker

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-02 Thread Oscar Benjamin
On 2 October 2012 11:16, Cecilia Chavana-Bryant wrote: > > In my case, I am a complete beginner not only to python but programming in > general, a complete beginner to internet forums (this is my third post ever) > and I am also not a native English speaker. So, I feel triply ignorant when I >

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-02 Thread Steven D'Aprano
On Tue, Oct 02, 2012 at 05:04:35AM -0400, leam hall wrote: > My own struggles to better communicate, and to have my message heard, > supports the concerns raised here. The Python community is a very good one > and we are only made better by treating people well. it is easy to go to > other lists wh

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-02 Thread Cecilia Chavana-Bryant
First of all, a HUGE thanks to the volunteers that share their knowledge in this forum for free! When I first became aware of this and other volunteer forums I was amazed that there are people out there willing to spend their valuable time freely helping those of us in need. Thanks also to everyone

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-02 Thread leam hall
My own struggles to better communicate, and to have my message heard, supports the concerns raised here. The Python community is a very good one and we are only made better by treating people well. it is easy to go to other lists where I am a newbie and find top posting preferred and other behavior

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-02 Thread Alan Gauld
On 02/10/12 02:34, boB Stepp wrote: I have been following the discussions here since middle-May of this year. I have gathered that the volunteers strongly value precision of speech and proper formatting of posts and especially making a strong effort to solve one's problem(s) before bringing it(th