Re: [Tutor] Closing triple quotation marks.

2011-06-19 Thread Alan Gauld


"Lisi"  wrote

It does indeed.  Thank you, both of you.  I have clearly not got the 
terms
command, method, function (and feature?) clearly sorted out in my 
mind, so
that is obviously where I need to go.  I am supposed to be 
researching
import, but I have not yet succeeded in seeing why it is a problem. 
So I'll

switch to looking up method, function etc.


Add "callable" to your list of search terms.
Python has the concept of "callable objects" and
you can call a callable by using parentheses.
You can also test whether an object is callable
or not:

for obj in list_of_objects:
if callable(obj):
print obj()  # call obj first
else:
print obj# just use the obj value

HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Closing triple quotation marks.

2011-06-19 Thread Lisi
On Sunday 19 June 2011 08:39:43 Alan Gauld wrote:
> "Lisi"  wrote
>
> > It does indeed.  Thank you, both of you.  I have clearly not got the
> > terms
> > command, method, function (and feature?) clearly sorted out in my
> > mind, so
> > that is obviously where I need to go.  I am supposed to be
> > researching
> > import, but I have not yet succeeded in seeing why it is a problem.
> > So I'll
> > switch to looking up method, function etc.
>
> Add "callable" to your list of search terms.
> Python has the concept of "callable objects" and
> you can call a callable by using parentheses.
> You can also test whether an object is callable
> or not:
>
> for obj in list_of_objects:
>  if callable(obj):
>  print obj()  # call obj first
>  else:
>  print obj# just use the obj value
>
> HTH,

Thank you!

Lisi

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] using configobj package to output quoted strings

2011-06-19 Thread Alan Gauld


"Steven D'Aprano"  wrote
...The only good reason to escape a quotation mark is if you need 
*both* quote marks in a single string:


"John Cleese said, \"'e's not dead, 'e's just pining for the 
fjords!\""


And even here you can use outer triple quotes if you prefer:

'''John Cleese said, "'e's not dead, 'e's just pining for the 
fjords!"'''


HTH,

Alan G. 



___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] regex woes in finding an ip and GET string

2011-06-19 Thread Gerhardus Geldenhuis
Hi
I am trying to write a small program that will scan my access.conf file and
update iptables to block anyone looking for stuff that they are not supposed
to.

The code:
#!/usr/bin/python
import sys
import re

def extractoffendingip(filename):
  f = open(filename,'r')
  filecontents = f.read()
#193.6.135.21 - - [11/Jun/2011:13:58:01 +] "GET
/admin/pma/scripts/setup.php HTTP/1.1" 404 304 "-" "Mozilla/4.0 (compatible;
MSIE 6.0; Windows 98)"
  tuples = re.findall(r'^(\d+\.\d+\.\d+\.\d+).*\"GET(.*)HTTP', filecontents)
  iplist = []
  for items in tuples:
(ip, getstring) = items
print ip,getstring
#print item
if ip not in iplist:
  iplist.append(ip)
  for item in iplist:
print item
  #ipmatch = re.search(r'', filecontents)

def main():
  extractoffendingip('access_log.1')

if __name__ == '__main__':
  main()

logfile=http://pastebin.com/F3RXDYBW


I could probably have used ranges to be more correct about finding ip's but
I thought that apache should take care of that. I am assuming a level or
integrity in the log file with regards to data...

The first problem I ran into was that I added a ^ to my search string:
re.findall(r'^(\d+\.\d+\.\d+\.\d+).*\"GET(.*)HTTP', filecontents)

but that finds only two results a lot less than I am expecting. I am a
little bit confused, first I thought that it might be because the string I
am searching is now only one line because of the method of loading and the ^
should only find one instance but instead it finds two?

So removing the ^ works much better but now I get mostly correct results but
I also get a number of ip's with an empty get string, only thought there
should be only one in the log file. I would really appreciate any pointers
as to what is going on here.

Regards

-- 
Gerhardus Geldenhuis
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] using configobj package to output quoted strings

2011-06-19 Thread Dave Angel

On 01/-10/-28163 02:59 PM, Alex Hall wrote:

On 6/18/11, Steven D'Aprano  wrote:

Alex Hall wrote:

Hello all,
I am using the configobj package to handle a ridiculously simple ini


What's configobj?

  >>>  import configobj
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named configobj

It's not in the 3.1 standard library. Is it a third-part package, or one
you have written yourself, or something else?

Right, sorry. http://www.voidspace.org.uk/python/configobj.html




file, which takes the form:
[favorites]
"search name" = "search terms", "search type"

for any number of searches stored in the favorites section. I need the
search type, term, and name to be read in as strings, but they will
usually contain spaces, which is why I put them in quotes.


You shouldn't need quotes. The standard library configparser module
doesn't need them:

I'll have a look at it, but I liked configobj's dictionary approach to
everything.


  >>>  import configparser
  >>>  ini = configparser.ConfigParser(
...   {"key with spaces": "value with spaces, and a comma"})
  >>>  ini.defaults()
OrderedDict([('key with spaces', 'value with spaces, and a comma')])
  >>>
  >>>  ini.get("DEFAULT", "key with spaces")
'value with spaces, and a comma'

The value is supposed to be a list; in python, you might write a
search like this:
searches={
  "my first search":["the search terms", "the search type"]
}



You can use quotes if you like, but why bother?


  >>>  ini.set('DEFAULT', '"search name"', "some value")
  >>>  ini.defaults()
OrderedDict([('key with spaces', 'value with spaces, and a comma'),
('"search name"', 'some value')])




Here is the
question: when I try to add a search to the ini file, I cannot get the
quotes to show up correctly. I just want my three strings enclosed in
single or double quotes, but I cannot manage to do it. I either get no


What do you mean by "show up"? What are you using to do the showing?

Remember, that when Python displays strings, the outer-most set of
quotes are not part of the string. They're just the syntax to tell
Python you are typing a string, and not part of the string, in the same
way that the [ ] surrounding a list are not actually part of the list.

I know, that is why I was using backslashes to escape quotes, trying
to force the quotes to be outputted to the file when I call
configobj's write() method, which takes the entire configuration and
puts it in a .ini file.


So if I do this:

  >>>  s = "hello world"
  >>>  s
'hello world'

The string is made up of characters h e l l o etc. and *not* the quotes.
You can see the string without the delimiters by using print:

  >>>  print(s)
hello world

but if you print an object containing a string, you still get the quotes
(for obvious reasons):

  >>>  print([1, 2, s])
[1, 2, 'hello world']


So, the question is, are you mistaking the string syntax for the
contents of the string? If so, you will hardly be the first one!

No, the configobj will not see the multiple words of the string as a
single value unless there are quotes in the config file.





quotes, or, when I manually add them (such as "\""+searchTerms+"\""
and so on), I get strings surrounded by both double and single quotes.


Sounds like you are mistaking them.

If you do this:

  >>>  searchTerms = "hello world"
  >>>  "\"" + searchTerms + "\""
'"hello world"'

The single quotes are just delimiters. The double quotes are part of the
string, exactly as you wanted.

Also, there is never any need to write something as ugly as "\"". This
is why Python gives you a choice of two different string delimiters,
single and double quotes. That is better written as:

'"'

with no need to escape the inner quote. The only good reason to escape a
quotation mark is if you need *both* quote marks in a single string:

"John Cleese said, \"'e's not dead, 'e's just pining for the fjords!\""

Good point. Still, it is odd (well, to me at least) that when I write
the string to the file with no quotes, I get no quotes, but using
double quotes in the string's value gives me both single and double
quotes.






When a string is interpreted with repr(), if it has any embedded quotes 
in it, it will be displayed with the others around the outside.  But if 
it has no funny characters, it will still put quotes around it.  str(), 
on the other hand, doesn't add either one.


Without any context, we've been guessing wildly.  it's good that you now 
include a link to the package. But you still aren't showing what calls 
you use to write to the file, nor what calls you're using to read the 
file.  By now, you should be able to write a trivial program to 
demonstrate the problem.  Show the code, and show the console output 
when you run that code.  Plus show the content of the .ini file.


I figure there are two ways you could be writing the file, one from 
within this configobj package, and the other with a text editor.  And 
there's two ways you could be reading the file

Re: [Tutor] regex woes in finding an ip and GET string

2011-06-19 Thread Peter Lavelle
Looking at the regex you have to match an IP address, I think you would 
need to put a range limit on each of the four octets you are searching 
for (as each one would be between 1 and 3 digits long.)


For example: r = 
re.match(r"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b",line) has worked for me.


I am no expert on regex (it scares me!) I got the example above from:
http://www.regular-expressions.info/examples.html


Hope my semi-coherent ramblings have been of some help

Regards

Peter

On 19/06/11 12:25, Gerhardus Geldenhuis wrote:

Hi
I am trying to write a small program that will scan my access.conf 
file and update iptables to block anyone looking for stuff that they 
are not supposed to.


The code:
#!/usr/bin/python
import sys
import re

def extractoffendingip(filename):
  f = open(filename,'r')
  filecontents = f.read()
#193.6.135.21 - - [11/Jun/2011:13:58:01 +] "GET 
/admin/pma/scripts/setup.php HTTP/1.1" 404 304 "-" "Mozilla/4.0 
(compatible; MSIE 6.0; Windows 98)"
  tuples = re.findall(r'^(\d+\.\d+\.\d+\.\d+).*\"GET(.*)HTTP', 
filecontents)

  iplist = []
  for items in tuples:
(ip, getstring) = items
print ip,getstring
#print item
if ip not in iplist:
  iplist.append(ip)
  for item in iplist:
print item
  #ipmatch = re.search(r'', filecontents)

def main():
  extractoffendingip('access_log.1')

if __name__ == '__main__':
  main()

logfile=http://pastebin.com/F3RXDYBW


I could probably have used ranges to be more correct about finding 
ip's but I thought that apache should take care of that. I am assuming 
a level or integrity in the log file with regards to data...


The first problem I ran into was that I added a ^ to my search string:
re.findall(r'^(\d+\.\d+\.\d+\.\d+).*\"GET(.*)HTTP', filecontents)

but that finds only two results a lot less than I am expecting. I am a 
little bit confused, first I thought that it might be because the 
string I am searching is now only one line because of the method of 
loading and the ^ should only find one instance but instead it finds two?


So removing the ^ works much better but now I get mostly correct 
results but I also get a number of ip's with an empty get string, only 
thought there should be only one in the log file. I would really 
appreciate any pointers as to what is going on here.


Regards

--
Gerhardus Geldenhuis


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor



--
LinkedIn Profile: http://linkedin.com/in/pmjlavelle
Twitter: http://twitter.com/pmjlavelle

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] BF Program hangs

2011-06-19 Thread Dave Angel

On 01/-10/-28163 02:59 PM, Kaustubh Pratap chand wrote:
> Hello i made this program which interprets brainf***
>
>   But i don't understand why it doesn't endsand also it doesn't 
print anything

>
>   import sys
>
>   cell=[0] * 3
>   code_pointer=0
>   cell_pointer=0
>   close_brace_pos=0
>   open_brace_pos=0
>
>   bf=raw_input("Input bf program:")
>
>   while (code_pointer
>   c=bf[code_pointer]

Indentation error.  Presumably a flaw in your email program.  Try using 
text mode.



>
>   if c=='.':
>   sys.stdout.write(cell[cell_pointer])
>   code_pointer+=1

write() doesn't take an integer parameter, but only character strings. 
If you want to be true to the original language, you'll need a chr() 
function there.


But if I were you, I'd be debugging this by making it print something 
more verbose, in case the problem is invisible characters.



>
>   elif c==',':
>   cell[cell_pointer]=sys.stdin.read(1);
>   code_pointer+=1

This one's a bit tougher, since I don't know any portable way to get a 
single character of input from a user.  In any case, you'll be wanting 
to use ord() to convert (one of) user's character to an integer.

>
>   elif c=='>':
>   cell_pointer+=1
>   code_pointer+=1
>

In any case, I'd make two other changes till you get it working:

1) make the input explicit, so people can know what you're testing this 
with.  After all, if someone were to run it and just press enter, then 
of course it would print nothing.


2) add a print statement of some sort to the loop, so you can see how 
the pointers are doing.


DaveA
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Closing triple quotation marks.

2011-06-19 Thread col speed
On 19 June 2011 14:46, Lisi  wrote:

> On Sunday 19 June 2011 08:39:43 Alan Gauld wrote:
> > "Lisi"  wrote
> >
> > > It does indeed.  Thank you, both of you.  I have clearly not got the
> > > terms
> > > command, method, function (and feature?) clearly sorted out in my
> > > mind, so
> > > that is obviously where I need to go.  I am supposed to be
> > > researching
> > > import, but I have not yet succeeded in seeing why it is a problem.
> > > So I'll
> > > switch to looking up method, function etc.
> >
> > Add "callable" to your list of search terms.
> > Python has the concept of "callable objects" and
> > you can call a callable by using parentheses.
> > You can also test whether an object is callable
> > or not:
> >
> > for obj in list_of_objects:
> >  if callable(obj):
> >  print obj()  # call obj first
> >  else:
> >  print obj# just use the obj value
> >
> > HTH,
>
> Thank you!
>
> Lisi
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>


A good way to learn is making mistakes(in language it's the *only* way). I
don't think I will mistake variable_name with "variable_name" in the near
future!
I downloaded a text file of prime numbers - lots of them. Being clever(!), I
knew they were strs and I had to convert them to ints, so:
1. I put them all in memory - first mistake, but not fatal
2. I, very cleverly(I thought) used a list comprehension to convert them to
ints - OK
3. I did something like:
for prime in tooManyPrimes:
f.write("prime")

I did this with about 6 files!


--
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Closing triple quotation marks.

2011-06-19 Thread Lisi
On Sunday 19 June 2011 14:23:25 col speed wrote:
> On 19 June 2011 14:46, Lisi  wrote:
> > On Sunday 19 June 2011 08:39:43 Alan Gauld wrote:
> > > "Lisi"  wrote
> > >
> > > > It does indeed.  Thank you, both of you.  I have clearly not got the
> > > > terms
> > > > command, method, function (and feature?) clearly sorted out in my
> > > > mind, so
> > > > that is obviously where I need to go.  I am supposed to be
> > > > researching
> > > > import, but I have not yet succeeded in seeing why it is a problem.
> > > > So I'll
> > > > switch to looking up method, function etc.
> > >
> > > Add "callable" to your list of search terms.
> > > Python has the concept of "callable objects" and
> > > you can call a callable by using parentheses.
> > > You can also test whether an object is callable
> > > or not:
> > >
> > > for obj in list_of_objects:
> > >  if callable(obj):
> > >  print obj()  # call obj first
> > >  else:
> > >  print obj# just use the obj value
> > >
> > > HTH,
> >
> > Thank you!
> >
> > Lisi
> >
> > ___
> > Tutor maillist  -  Tutor@python.org
> > To unsubscribe or change subscription options:
> > http://mail.python.org/mailman/listinfo/tutor
>
> A good way to learn is making mistakes(in language it's the *only* way). I
> don't think I will mistake variable_name with "variable_name" in the near
> future!
> I downloaded a text file of prime numbers - lots of them. Being clever(!),
> I knew they were strs and I had to convert them to ints, so:
> 1. I put them all in memory - first mistake, but not fatal
> 2. I, very cleverly(I thought) used a list comprehension to convert them to
> ints - OK
> 3. I did something like:
> for prime in tooManyPrimes:
> f.write("prime")
>
> I did this with about 6 files!

!! ;-)

Thank you for the marvellous mental image!  Prime numbers will never be the 
same again.

Lisi
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] regex woes in finding an ip and GET string

2011-06-19 Thread Válas Péter
2011/6/19 Gerhardus Geldenhuis 

>   f = open(filename,'r')
>   filecontents = f.read()
>
Try f.read().splitlines() instead.



>   tuples = re.findall(r'^(\d+\.\d+\.\d+\.\d+).*\"GET(.*)HTTP',
> filecontents)
>
This searches the beginning of the lines, but you downloaded the whole page
as one string.

Another hint is to open it in an editor and investigate it by your eyes,
where are the strings you look for. :-)
Péter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] nitinchandra rubbish on list

2011-06-19 Thread Alan Gauld


"Válas Péter"  wrote

Each time I send a message to this list, I get an autoreply like 
this.
No, I won't add myself to any stupid guestlists to use a public 
list.

Could a list moderator please show this user the exit?


The exit instructions are on the end of every email.

But this is not coming frrom the Python tutor list
but from boxbe.com - whoever they are?
You need to address your concerns to them.

Alan G.

-- Továbbított levél --
Feladó: 
Dátum: 2011. június 19. 15:45
Tárgy: Re: Re: [Tutor] regex woes in finding an ip and GET string 
(Action

Required)Hello =?ISO-8859-1?Q?V=E1las_P=E9ter?=,

Your message about "Re: [Tutor] regex woes in finding an ip and GET 
string"

was waitlisted.

Please add yourself to my Guest List so your messages will be 
delivered to

my Inbox. Use the link below.

Click here to deliver your message


Thank you,
nitinchand...@gmail.com










___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor




___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] nitinchandra rubbish on list

2011-06-19 Thread Alexandre Conrad
2011/6/19 Steven D'Aprano :
> I've been sending many lists to this list, and haven't received any such
> autoreplies. I suspect that you are getting them because you are replying
> directly to the sender, and CC'ing the list.
>
> Stop replying to the sender, and the problem will probably go away.

I always "reply to all", which replies to the sender and CC the list
(just like this email) and I can't recall of such behavior. All works
fine with me.

-- 
Alex | twitter.com/alexconrad
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] nitinchandra rubbish on list

2011-06-19 Thread Lisi
On Sunday 19 June 2011 15:10:51 Válas Péter wrote:
> Each time I send a message to this list, I get an autoreply like this. No,
> I won't add myself to any stupid guestlists to use a public list. Could a
> list moderator please show this user the exit?

The solution is simple.  Never reply to emails from this particular person.  
(I can quite understand your not wanting to add yourself to any list.)

Lisi
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] nitinchandra rubbish on list

2011-06-19 Thread Válas Péter
Each time I send a message to this list, I get an autoreply like this. No, I
won't add myself to any stupid guestlists to use a public list. Could a list
moderator please show this user the exit?

-- Továbbított levél --
Feladó: 
Dátum: 2011. június 19. 15:45
Tárgy: Re: Re: [Tutor] regex woes in finding an ip and GET string (Action
Required)Hello =?ISO-8859-1?Q?V=E1las_P=E9ter?=,

Your message about "Re: [Tutor] regex woes in finding an ip and GET string"
was waitlisted.

Please add yourself to my Guest List so your messages will be delivered to
my Inbox. Use the link below.

 Click here to deliver your message


Thank you,
nitinchand...@gmail.com



___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] nitinchandra rubbish on list

2011-06-19 Thread Brett Ritter
On Sun, Jun 19, 2011 at 11:33 AM, Alexandre Conrad
 wrote:
> 2011/6/19 Steven D'Aprano :
>> Stop replying to the sender, and the problem will probably go away.

> I always "reply to all", which replies to the sender and CC the list
> (just like this email) and I can't recall of such behavior. All works
> fine with me.

I've had this as well, and as Steven says, it only occurs with a
partiuclar recipient.  If you send to the list only (or in fact anyone
other than that person), you'll not receive this.

-- 
Brett Ritter / SwiftOne
swift...@swiftone.org
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] nitinchandra rubbish on list

2011-06-19 Thread Válas Péter
No, this does not happen if I write to a particular person; this very mail
in the beginning of the thread was sent to the tutor list only, and I got
the same answer. I am going to get it now again.

2011/6/19 Alan Gauld 

>
> But this is not coming frrom the Python tutor list
> but from boxbe.com - whoever they are?
> You need to address your concerns to them.
>

This comes from a subscriber of this list, who may redirect their letters
from gmail to boxbe or whatever. I got these letters in connection with
using this list. However, I marked them as spam, and if this will not be
enough, and you don't concern forcing some basic and widely accepted rules
on the list, I will set the list to nomail instead of making further dull
complaints, and set it back only if I have questions myself (which would
unfortunately prevent me of helping others, what I would be sorry for,
because questions are sometimes interesting).
P.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] nitinchandra rubbish on list

2011-06-19 Thread Steven D'Aprano

Válas Péter wrote:

Each time I send a message to this list, I get an autoreply like this. No, I
won't add myself to any stupid guestlists to use a public list. Could a list
moderator please show this user the exit?


I've been sending many lists to this list, and haven't received any such 
autoreplies. I suspect that you are getting them because you are 
replying directly to the sender, and CC'ing the list.


Stop replying to the sender, and the problem will probably go away.


--
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] nitinchandra rubbish on list

2011-06-19 Thread col speed
2011/6/19 Válas Péter 

> Each time I send a message to this list, I get an autoreply like this. No,
> I won't add myself to any stupid guestlists to use a public list. Could a
> list moderator please show this user the exit?
>
> -- Továbbított levél --
> Feladó: 
> Dátum: 2011. június 19. 15:45
> Tárgy: Re: Re: [Tutor] regex woes in finding an ip and GET string (Action
> Required)Hello =?ISO-8859-1?Q?V=E1las_P=E9ter?=,
>
> Your message about "Re: [Tutor] regex woes in finding an ip and GET string"
> was waitlisted.
>
> Please add yourself to my Guest List so your messages will be delivered to
> my Inbox. Use the link below.
>
>  Click here to deliver your message
> 
>
> Thank you,
> nitinchand...@gmail.com
>
>
> 
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
> Some people have "waitlists", some don't. The same thing happened to me,
> and I decided to click. Click and your message gets sent, don't click and it
> doesn't. I've heard of repetetetetetetive something syndrome, but I don't
> think 1 click will disable you for life.

--
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] nitinchandra rubbish on list

2011-06-19 Thread Alexandre Conrad
2011/6/19 Alexandre Conrad :
> 2011/6/19 Steven D'Aprano :
>> I've been sending many lists to this list, and haven't received any such
>> autoreplies. I suspect that you are getting them because you are replying
>> directly to the sender, and CC'ing the list.
>>
>> Stop replying to the sender, and the problem will probably go away.
>
> I always "reply to all", which replies to the sender and CC the list
> (just like this email) and I can't recall of such behavior. All works
> fine with me.

Ok, I just received the email after sending this one, haha. I guess I
haven't posted on this list for about 2 or 3 weeks, I am surprised
this is happening now. (setting the tutor list as the main recipient
now)

-- 
Alex | twitter.com/alexconrad
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] nitinchandra rubbish on list

2011-06-19 Thread delegbede
The problem with boxbe is a nightmare for everybody. It is a mail application 
by a company that gets into the ways of people ones the receiver of your mail 
has boxbe running on his system. Sadly my yahoomail has boxbe but that's not my 
mail on this list. 
The most annoying part is that you can't even unsubscribe. 
While I understand how annoying that is, may I appeal you don't withdraw your 
contributions to this list as a result of that. 

Thank you. 
Sent from my BlackBerry wireless device from MTN

-Original Message-
From: Válas Péter 
Sender: tutor-bounces+delegbede=dudupay@python.org
Date: Sun, 19 Jun 2011 18:55:46 
To: Python Tutors
Subject: Re: [Tutor] nitinchandra rubbish on list

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] nitinchandra rubbish on list

2011-06-19 Thread nitin chandra
Hello All,

MY Sincerest APOLOGIES i had joined a a mail box management services...
But unfortunately It started interfering with my Gmail mail box.

But i was completely unaware that It was also effecting the others on the list.

Most embarrassing moment when I found out how it was effecting others
on the list.

I have now ... as of this moment / mail ...rectified the issue.

Please do let me know if it still persists. IT Should not  ...though.

Sorry once again the list.

Reg

Nitin Chandra
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] SORRY - nitinchandra rubbish on list

2011-06-19 Thread nitin chandra
On Sun, Jun 19, 2011 at 11:52 PM, nitin chandra  wrote:
> Hello All,
>
> MY Sincerest APOLOGIES i had joined a a mail box management services...
> But unfortunately It started interfering with my Gmail mail box.
>
> But i was completely unaware that It was also effecting the others on the 
> list.
>
> Most embarrassing moment when I found out how it was effecting others
> on the list.
>
> I have now ... as of this moment / mail ...rectified the issue.
>
> Please do let me know if it still persists. IT Should not  ...though.
>
> Sorry once again the list.
>
> Reg
>
> Nitin Chandra
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Seattle PyCamp 2011

2011-06-19 Thread Chris Calloway

On 6/17/2011 11:03 PM, Noah Hall wrote:

On Sat, Jun 18, 2011 at 2:15 AM, Steven D'Aprano  wrote:

Noah Hall wrote:


Just a note, but are these questions jokes?


Know how to use a text editor (not a word processor, but a text editor)?
Know how to use a browser to download a file?
Know how to run a program installer?


If not, then I'd consider removing them. This isn't 1984.


I think the questions are fine. It indicates the level of technical
knowledge required -- not much, but more than just the ability to sign in to
AOL.

In 1984 the newbies didn't know anything about computers *and knew they
didn't know*, but now you have people who think that because they can write
a letter in Microsoft Office and save as HTML, they're expert at
programming.

I wish I were joking but I've had to work for some of them.


That's true, I suppose, but in that case the rest of the questions are
out of place.

I believe that someone who knows what environmental variables are and
how to change them is a huge step up from someone who knows how to
*download things*.



Mr. Hall,

I've taught Python to over a thousand students. And these questions, 
which are on the PyCamp site and not in the previous email to this list, 
are not only not the slightest bit out of place or jokes, but rather 
necessary. We didn't start out asking these questions of prospective 
students. They were developed from experience.


As far as 1984, plenty of people in 1984 knew what environment variables 
were and how to change them without knowing how to use a browser to 
download anything. :) What is a "step up" is a matter of perspective. We 
get not a lot but plenty enough people coming to PyCamp whose last 
experience with using a computer was 1984. It's simple courtesy to warn 
those people of what to expect.


Thank you for your concern.

--
Sincerely,

Chris Calloway http://nccoos.org/Members/cbc
office: 3313 Venable Hall   phone: (919) 599-3530
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Seattle PyCamp 2011

2011-06-19 Thread Noah Hall
On Sun, Jun 19, 2011 at 6:47 PM, Chris Calloway  wrote:
> On 6/17/2011 11:03 PM, Noah Hall wrote:
>>
>> On Sat, Jun 18, 2011 at 2:15 AM, Steven D'Aprano
>>  wrote:
>>>
>>> Noah Hall wrote:
>>>
 Just a note, but are these questions jokes?

> Know how to use a text editor (not a word processor, but a text
> editor)?
> Know how to use a browser to download a file?
> Know how to run a program installer?

 If not, then I'd consider removing them. This isn't 1984.
>>>
>>> I think the questions are fine. It indicates the level of technical
>>> knowledge required -- not much, but more than just the ability to sign in
>>> to
>>> AOL.
>>>
>>> In 1984 the newbies didn't know anything about computers *and knew they
>>> didn't know*, but now you have people who think that because they can
>>> write
>>> a letter in Microsoft Office and save as HTML, they're expert at
>>> programming.
>>>
>>> I wish I were joking but I've had to work for some of them.
>>
>> That's true, I suppose, but in that case the rest of the questions are
>> out of place.
>>
>> I believe that someone who knows what environmental variables are and
>> how to change them is a huge step up from someone who knows how to
>> *download things*.
>>
>
> Mr. Hall,
>
> I've taught Python to over a thousand students. And these questions, which
> are on the PyCamp site and not in the previous email to this list, are not
> only not the slightest bit out of place or jokes, but rather necessary. We
> didn't start out asking these questions of prospective students. They were
> developed from experience.
>
> As far as 1984, plenty of people in 1984 knew what environment variables
> were and how to change them without knowing how to use a browser to download
> anything. :) What is a "step up" is a matter of perspective. We get not a
> lot but plenty enough people coming to PyCamp whose last experience with
> using a computer was 1984. It's simple courtesy to warn those people of what
> to expect.
>
> Thank you for your concern.

1984 was not to be taken literally, of course. ;)


Well, if you decide that in this day and age that asking whether
someone knows how to use a browser to download files, or if someone
knows how to install a program, then that's entirely up to you. I am
merely in disbelief that you could find someone these days interested
enough in computers to learn Python, and yet not know how to download
a file. Had they been in jest, I would have understood, you know,
something along the lines of "Want to learn Python? Well, there's only
one thing you need to know - how to read!". But when taking it in
seriousness, I must congratulate you on somehow finding these people;
I had no idea they still existed. ;)

Regards,
Noah.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] nitinchandra rubbish on list

2011-06-19 Thread Válas Péter
2011/6/19 nitin chandra 

>
> MY Sincerest APOLOGIES



All right, I accept, and let's see what happens now. :-)
P.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Seattle PyCamp 2011

2011-06-19 Thread Noah Hall
> 1984 was not to be taken literally, of course. ;)
>
>
> Well, if you decide that in this day and age that asking whether
> someone knows how to use a browser to download files, or if someone
> knows how to install a program, then that's entirely up to you. I am
> merely in disbelief that you could find someone these days interested
> enough in computers to learn Python, and yet not know how to download
> a file. Had they been in jest, I would have understood, you know,
> something along the lines of "Want to learn Python? Well, there's only
> one thing you need to know - how to read!". But when taking it in
> seriousness, I must congratulate you on somehow finding these people;
> I had no idea they still existed. ;)
>
> Regards,
> Noah.

I also realised how aggressive my first reply was, for which I'm
sorry, I was merely trying to point out that perhaps they were out of
date questions.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] line continuation characters

2011-06-19 Thread Lisi
I am having problems with line continuation characters.  Error message:

SyntaxError: unexpected character after line continuation character

I have succeeded in moving the position of the complaint, but am currently 
well and truly stuck.

I have read up about it and now (I hope!) know what to do about it in general, 
but at one particular point everywhere seems to be wrong.  Is there any way I 
can make these wretched continuation characters visible, so that I know where 
and what I am up against?

Lisi
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] line continuation characters

2011-06-19 Thread Válas Péter
2011/6/19 Lisi 

> I am having problems with line continuation characters.  Error message:
>
> SyntaxError: unexpected character after line continuation character
>

You should write here the line where the problem is.
Likely that you have written something after \. If you place a \ at the end
of line to continue it on the next line, there must not be anything after
it, neither a comment.
Péter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Seattle PyCamp 2011

2011-06-19 Thread Chris Calloway

On 6/19/2011 3:53 PM, Noah Hall wrote:

1984 was not to be taken literally, of course. ;)


Well, if you decide that in this day and age that asking whether
someone knows how to use a browser to download files, or if someone
knows how to install a program, then that's entirely up to you. I am
merely in disbelief that you could find someone these days interested
enough in computers to learn Python, and yet not know how to download
a file. Had they been in jest, I would have understood, you know,
something along the lines of "Want to learn Python? Well, there's only
one thing you need to know - how to read!". But when taking it in
seriousness, I must congratulate you on somehow finding these people;
I had no idea they still existed. ;)

Regards,
Noah.


I also realised how aggressive my first reply was, for which I'm
sorry, I was merely trying to point out that perhaps they were out of
date questions.


Mr. Hall,

It's not really entirely up to me, no. There are many people in several 
user groups behind these questions. And the questions have evolved over 
time to be perfectly up to date, yes. The first few PyCamps attempted to 
qualify participants by simply stating the syllabus. The casual observer 
might think that would be enough. But no, that is not the case in 
reality when you get experience from teaching many classes of any kind.


From those first few camps there were outlier participants who either 
thought PyCamp was too easy or too hard and who demanded more 
information be placed on the PyCamp page about what qualifications are 
required. With each successive PyCamp, those qualifications were 
adjusted according to participant feedback until the suggested 
prerequisites are what they are now. I'm sure they will continue to 
evolve even more in the future.


No, it isn't enough to only need to know how to read to come to PyCamp. 
There are many ways to learn Python which might entail only knowing how 
to read or learning to use a computer at the same time. But PyCamp is 
one week and we don't teach people how to use a computer during that 
week. Whatever your disbelief, I can assure you in this day and age if 
it is not explicitly stated up front that you need to know how to 
download a file and run a program installer before coming to PyCamp, 
then there will be people who will be upset when lack of those skills 
hinders them in class and when class doesn't pause to teach them those 
skills.


And I can assure you those people are common enough to find, no 
congratulations necessary, especially when offering a week long training 
at the low PyCamp price point. You may not mean 1984. But PyCamp and any 
computer-based open training for that matter has to account for people 
from 1984. Python doesn't appeal only to computer nerds. Python has many 
domain-specific uses from geography to biology. When you have large 
numbers of people coming from such disparate backgrounds, you find that 
computer illiteracy is quite high in the general population, even among 
the educated, even among people who Facebook, or even among people from 
2011. :)


I accept your apology and yes, I was taken aback by the hostility of 
your replies in a public forum. However, in the interest of providing 
information about PyCamp and in the interest of what it takes to tutor 
Python, I hope this explains some things.


--
Sincerely,

Chris Calloway http://nccoos.org/Members/cbc
office: 3313 Venable Hall   phone: (919) 599-3530
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Seattle PyCamp 2011

2011-06-19 Thread Alan Gauld

"Noah Hall"  wrote


Well, if you decide that in this day and age that asking whether
someone knows how to use a browser to download files, 
or if someone knows how to install a program, 


This is not out of place. I have experienced it myself with 
users of my web tutorial.


I have had several - not a lot, maybe a dozen out of the 
half million visitors - but a few, who could not follow the 
instructions to download python and install it. I have had 
to walk them through the process step by step by email.
In at least one case it was the first time they had ever 
installed anything from tyhe web, they had always used 
install CDs up till then.


 in disbelief that you could find someone these days 
interested enough in computers to learn Python, and 
yet not know how to download a file. 


Nope, it happens, I can promise you. The last such case 
I had was late last year. I have also had users who didn't 
know how to use the File->SaveAs menu in Notepad 
to change a filename from foo.txt (the default) to foo.py...


As my old boss used to say: 
"Its impossible to underestimate your users abilities"


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/



___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] line continuation characters

2011-06-19 Thread Steven D'Aprano

Lisi wrote:

I am having problems with line continuation characters.  Error message:

SyntaxError: unexpected character after line continuation character


Then delete it ;)

Seriously. You have your editor open, right? Go to the line where the 
error is reported. It will look something like this:


blah blah blah \

Press the End key. Your editor's blinking insertion point or cursor will 
go to the end of the line:


blah blah blah \  |

Backspace until the cursor is *immediately* next to the backslash, with 
no other characters INCLUDING SPACES after it.


Which editor are you using? If it is kwrite or kate, it has a setting to 
control whether spaces are left at the end of lines, e.g. in kwrite:


Settings > Configure Editor > Editing > Remove trailing spaces


I have succeeded in moving the position of the complaint, but am currently 
well and truly stuck.


I have read up about it and now (I hope!) know what to do about it in general, 
but at one particular point everywhere seems to be wrong.  Is there any way I 
can make these wretched continuation characters visible, so that I know where 
and what I am up against?


Continuation characters are visible. It is a backslash at the very end 
of the line. It must not be followed by *anything* -- no comments, no 
spaces, nothing.


>>> x = 23 + \
  File "", line 1
x = 23 + \
  ^
SyntaxError: unexpected character after line continuation character


If this error message is not clear, would you like to suggest an 
improvement?




--
Steven

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] nitinchandra rubbish on list

2011-06-19 Thread Steven D'Aprano

nitin chandra wrote:

Hello All,

MY Sincerest APOLOGIES i had joined a a mail box management services...
But unfortunately It started interfering with my Gmail mail box.


Thanks for fixing this!



--
Steven

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] nitinchandra rubbish on list

2011-06-19 Thread nitin chandra
Thank you.

Nitin

On Mon, Jun 20, 2011 at 5:17 AM, Steven D'Aprano  wrote:
> nitin chandra wrote:
>>
>> Hello All,
>>
>> MY Sincerest APOLOGIES i had joined a a mail box management
>> services...
>> But unfortunately It started interfering with my Gmail mail box.
>
> Thanks for fixing this!
>
>
>
> --
> Steven
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor