Re: [Tutor] PYFTDI Library for FT232H

2012-08-03 Thread Mark Lawrence

On 03/08/2012 02:02, Steven D'Aprano wrote:

On 03/08/12 09:38, John Battle wrote:

I am relatively new to Pyton and am trying to use a library called pyftdi
which is used to establish communication with USB chips made by FTDI.
I have
been able to install the library and write a simple piece of code to
discover
my interfaces (I have two FT232H devices connected). The following
code seems
to work to accomplish that:

#!/usr/bin/python
from pyftdi.pyftdi.ftdi import *
vps=[(0x0403,0x6014)]
devs=Ftdi.find_all(vps)
print devs

However I cannot figure out what to do next.



If you are talking about this library:

http://pypi.python.org/pypi/pyftdi

have you tried reading the documentation, such as it is? I've had a
quick look, and it appears to be extremely light on documentation, but I
didn't dig too deeply, maybe you will have better luck. The GitHub page
claims to have some examples, but I couldn't get it to work in my browser.

You can also try this at the Python interactive interpreter:

import pyftdi
help(pyftdi)


and see if the library has any useful embedded documentation. It may not.


Do you know how to start the interactive interpreter? You need to open a
terminal window, then at the prompt, you need to launch Python. Under
Linux, I just type

python

and hit the ENTER key. If you are using Windows, it may be more
complicated.





Just the same for Windows, although I tend to use PythonWin myself.

--
Cheers.

Mark Lawrence.

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


[Tutor] adding a windows registry value

2012-08-03 Thread Albert-Jan Roskam
Hi,
 
I am trying to change a registry value (Windows 7, Python 2.7) but it won't 
work when I try to do this using Python:
 
import os 
# 1 using this from Python won't work, but double-clicking the file works.
os.system(r"regedit /s C:\Users\Desktop\set_temp.reg")
# 2: using this from Python won't work, but from the commandline or with a 
batch file works
os.system("reg add HKEY_CURRENT_USER\Software .(etc)")

Why is this not working using Python? Is there a built-in way to do this (I 
don't have win32api)?

Regards,
Albert-Jan


~~
All right, but apart from the sanitation, the medicine, education, wine, public 
order, irrigation, roads, a 
fresh water system, and public health, what have the Romans ever done for us?
~~ ___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] adding a windows registry value

2012-08-03 Thread Steven D'Aprano

On 04/08/12 00:39, Albert-Jan Roskam wrote:

Hi,

I am trying to change a registry value (Windows 7, Python 2.7) but it won't
work when I try to do this using Python:


Define "won't work".

Does it:

- change the registry entry, but no effect is apparent?
- raise an exception?
- crash?
- silently fail to change the registry entry?
- something else?



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


Re: [Tutor] adding a windows registry value

2012-08-03 Thread Alan Gauld

On 03/08/12 15:39, Albert-Jan Roskam wrote:


...Is there a built-in way to do this
(I don't have win32api)?


Yes you do, because ctypes is part of the standard Python library.
And ctypes lets you access Win32api. See:

http://docs.python.org/library/ctypes.html#module-ctypes

for examples.

As to your problem, it sounds like a permissions thing, are you sure you 
are running it as the same user in Python and from the DOS box?



--
Alan G
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


[Tutor] Creating a basic CGI script

2012-08-03 Thread Smaran Harihar
Hi,

I wish to create a basic cgi script which will interact with the ajax call
from my Ext-JS, modify it and then return it back to the ext-js.

I just completed this tutorial which tells me how I should create a
cgi-script but it was interacting with the py script. How do I make a
simple cgi for receiving the ajax call?

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


Re: [Tutor] adding a windows registry value

2012-08-03 Thread Kwpolska
Anyone has an idea why this list wants me to send mail to the OP
rather than the ML itself?  Anyways,

On Fri, Aug 3, 2012 at 4:39 PM, Albert-Jan Roskam  wrote:
> Hi,
>
> I am trying to change a registry value (Windows 7, Python 2.7) but it won't
> work when I try to do this using Python:
>
> import os
> # 1 using this from Python won't work, but double-clicking the file works.
> os.system(r"regedit /s C:\Users\Desktop\set_temp.reg")
> # 2: using this from Python won't work, but from the commandline or with a
> batch file works
> os.system("reg add HKEY_CURRENT_USER\Software .(etc)")
>
> Why is this not working using Python? Is there a built-in way to do this (I
> don't have win32api)?
>
> Regards,
> Albert-Jan
>
>
> ~~
> All right, but apart from the sanitation, the medicine, education, wine,
> public order, irrigation, roads, a
> fresh water system, and public health, what have the Romans ever done for
> us?
> ~~
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>

Please, do not do stuff like that.  There is a library for that:
http://docs.python.org/library/_winreg.html

Also, using registry keys is not a great idea if you would want
someone to use your code on a different platform.


(originally sent to the OP @ 2012-08-03T15:14:00Z)
-- 
Kwpolska 
stop html mail  | always bottom-post
www.asciiribbon.org | www.netmeister.org/news/learn2quote.html
GPG KEY: 5EAAEA16   | Arch Linux x86_64, zsh, mutt, vim.
# vim:set textwidth=70:
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Creating a basic CGI script

2012-08-03 Thread Alan Gauld

On 03/08/12 17:58, Smaran Harihar wrote:


I wish to create a basic cgi script which will interact with the ajax
call from my Ext-JS, modify it and then return it back to the ext-js.


This forum is for people learning the Python language and the standard 
library. CGI is a standard module but not often used these days for web 
programming  since much better frameworks exist that make things much 
easier. jax is not really a beginners topic nor directly related to the 
Python language.


Since most Python web development frameworks include standard ways of 
writing Ajax calls so the answer will depend on which framework you 
choose, and then support for that will be best given via the framework 
forum.


Having said all that, if are using the standard cgi module and you can 
show us a very simple example of what you have tried and explain what 
happened we might be able to help out.



I just completed this tutorial


Which tutorial, there are many. Don't make us guess!


...which tells me how I should create a cgi-script but it

> was interacting with the py script.

That's the usual way to program in CGI its all done at the server end.
Do you understand how the http/CGI mechanism works? Can you write a 
traditional CGI web application?


If you have not already done so I recommend that you read this:

http://docs.python.org/py3k/howto/webservers.html

and consider using one of the web frameworks mentioned there.

--
Alan G
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] adding a windows registry value

2012-08-03 Thread Alan Gauld

On 03/08/12 18:42, Kwpolska wrote:

Anyone has an idea why this list wants me to send mail to the OP
rather than the ML itself?  Anyways,


The list doesn't care, you probably did it by hitting Reply
instead of Reply All.

Reply replies to the person who posted. Reply All replies to all
on the list. Just like regular email.

That's just how its set up, to mimic normal email.

It's not the only list set up that way, most of the ones I use do it 
like that. You get used to it :-)


--
Alan G
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


[Tutor] Newline question

2012-08-03 Thread Alexander Q.
I'm following the tutorial from python.org (
http://docs.python.org/tutorial/introduction.html) and am having a
few indiscrepancies regarding the new line command.

The tutorial says that this code

hello = "This is a rather long string containing\n\
several lines of text just as you would do in C.\n\
**Note that whitespace at the beginning of the line is\
 significant."

should yield this output:

This is a rather long string containing
several lines of text just as you would do in C.
Note that whitespace at the beginning of the line is significant.

When I run it in the interpreter however, I get the following output:

'This is a rather long string containing\nseveral lines of text just
as you would do in C.\nNote that whitespace at the beginning of
the line is significant.'


The interpreter is not reading the "\n" as new lines but is instead
printing them. If I just type something like

hello = "This is a rather long string containing \
several lines of text."


the output is all on one line, like this: "This is a rather long string
containing several lines of text." So I know how to combine code that spans
multiple lines to be outputted on one line, but I do not know how to make a
newline appear in the output upon command (on account of the interpreter
not reading the \n).

Any suggestions as to why my output varies from the output in the tutorial?
I am running a 2.7 version of Python, btw, and the tutorial is running a
higher version I believe (3. something). Thank you.

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


Re: [Tutor] adding a windows registry value

2012-08-03 Thread Walter Prins
On 3 August 2012 19:35, Alan Gauld  wrote:
> The list doesn't care, you probably did it by hitting Reply
> instead of Reply All.
>
> Reply replies to the person who posted. Reply All replies to all
> on the list. Just like regular email.

> That's just how its set up, to mimic normal email.

Well normally I expect emails from a list (being the direct sender),
to go back to the sender, e.g. the list, and emails directly from a
person to go back to that person.  (Differently put, I expect *any*
email to by default go back to the sender, in general, unless I
specify otherwise.  So if a mailing list sends me an email, my default
expectation is that the mail goes back to the list, unless I specify
otherwise.  This seems perfectly intuitive to me, but hey ho what the
hey.  :)  )


> It's not the only list set up that way, most of the ones I use do it like
> that. You get used to it :-)

Yes... most of the ones *I* use don't.  Snap.  Darn.  :)   (More
seriously,  I must admit this "feature" remains an nuisance in my book
as well.  I might add that regardless of current setup, historical
precedents or whatever other rationalization one might cite, it
nevertheless seems a less than ideal setup choice for this list given
that the default behaviour caters for the minority use-case;  The
majority of the time most people will want their replies to posts on
the list to go back to the list, and not back to the individual who
posted to the list, since the whole point of the list is to encourage
collective discussion.  Taking tutor problems off list is generally
counter productive both for the people being helped and others who may
benefit from the conversation.  Therefore the default setup should
IMHO be that replies go back to the list, not to the OP.)

Anyway, I'll go back to leaving this issue alone again now.  Have a
good weekend everyone :)

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


Re: [Tutor] Newline question

2012-08-03 Thread Jerry Hill
On Fri, Aug 3, 2012 at 4:18 PM, Alexander Q.  wrote:
> I'm following the tutorial from python.org
> (http://docs.python.org/tutorial/introduction.html) and am having a few
> indiscrepancies regarding the new line command.
>
> The tutorial says that this code
>
> hello = "This is a rather long string containing\n\
> several lines of text just as you would do in C.\n\
> Note that whitespace at the beginning of the line is\
>  significant."
>
> should yield this output:
>
> This is a rather long string containing
> several lines of text just as you would do in C.
> Note that whitespace at the beginning of the line is significant.

You left out the other line of code in the tutorial, which says you
need to do print(hello) to the the output that is described. Did you
do that?  If so, it should work fine.  If not, what did you do
instead?  If you just typed:

>>>hello

at the interpreter prompt, then you are actually seeing the equivalent
of print(repr(hello)), instead of print(hello).

Can you copy and paste your session for us?

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


Re: [Tutor] adding a windows registry value

2012-08-03 Thread eryksun
On Fri, Aug 3, 2012 at 10:39 AM, Albert-Jan Roskam  wrote:
> Hi,
>
> I am trying to change a registry value (Windows 7, Python 2.7) but it won't
> work when I try to do this using Python:
>
> import os
> # 1 using this from Python won't work, but double-clicking the file works.
> os.system(r"regedit /s C:\Users\Desktop\set_temp.reg")
> # 2: using this from Python won't work, but from the commandline or with a
> batch file works
> os.system("reg add HKEY_CURRENT_USER\Software .(etc)")
>
> Why is this not working using Python? Is there a built-in way to do this (I
> don't have win32api)?

Wouldn't it be simpler to use the  _winreg module?

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


Re: [Tutor] Newline question

2012-08-03 Thread Alexander Q.
On Fri, Aug 3, 2012 at 1:40 PM, Jerry Hill  wrote:

> On Fri, Aug 3, 2012 at 4:18 PM, Alexander Q.  wrote:
> > I'm following the tutorial from python.org
> > (http://docs.python.org/tutorial/introduction.html) and am having a few
> > indiscrepancies regarding the new line command.
> >
> > The tutorial says that this code
> >
> > hello = "This is a rather long string containing\n\
> > several lines of text just as you would do in C.\n\
> > Note that whitespace at the beginning of the line is\
> >  significant."
> >
> > should yield this output:
> >
> > This is a rather long string containing
> > several lines of text just as you would do in C.
> > Note that whitespace at the beginning of the line is significant.
>
> You left out the other line of code in the tutorial, which says you
> need to do print(hello) to the the output that is described. Did you
> do that?  If so, it should work fine.  If not, what did you do
> instead?  If you just typed:
>
> >>>hello
>
> at the interpreter prompt, then you are actually seeing the equivalent
> of print(repr(hello)), instead of print(hello).
>
> Can you copy and paste your session for us?
>
> Jerry
>

That was it Jerry- when I typed in "print hello" instead of just "hello",
the output was exactly like the one in the tutorial. Alternatively, I could
accomplish the same type of output by using triple quotes around the same
text, except that I would have to format it manually if I want it to come
out looking the same way as it did when using "\n" in the previous example?
Thanks again for your help. The way I understand it from your explanation
is that "hello" does a literal output of everything typed without
processing the escape backslashes, while "print hello" does process them.

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


Re: [Tutor] Newline question

2012-08-03 Thread Alan Gauld

On 03/08/12 22:09, Alexander Q. wrote:


That was it Jerry- when I typed in "print hello" instead of just
"hello", the output was exactly like the one in the tutorial.


Yes, the interactive interpreter shows the representation
(repr()) of the data while print shows the normal output. There are 
several places where this difference is significant.



Alternatively, I could accomplish the same type of output by using
triple quotes around the same text, except that I would have to format
it manually if I want it to come out looking the same


Nope, that won;t work either, try it:

>>> s = """Here is
... a string
... with
... line
... breaks"""
>>> s
'Here is \na string\nwith\nline\nbreaks'
>>> print s
Here is
a string
with
line
breaks
>>>

Again repr() just prints the newline characters.


I understand it from your explanation is that "hello" does a literal
output of everything typed without processing the escape backslashes,
while "print hello" does process them.



Yes, and realise that

>>> hello

only works at the interactive >>> prompt. If you write a program in a 
file and run it typing hello on a line by itself with have no result. 
Python will quietly evaluate the string but not display it. The ability 
to display a value is a debugging aid only available in the interpreter 
prompt. In a program you need to explicitly call repr(hello)

This is why in my tutorial I never actually tell the users about the
hello form but always ask them to type the print... More typing but more 
consistent output, so ultimately less confusion for beginners.



--
Alan G
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] adding a windows registry value

2012-08-03 Thread Alan Gauld

On 03/08/12 21:32, Walter Prins wrote:


Well normally I expect emails from a list (being the direct sender),


But there is no concept of 'direct sender' in email. All emails bounce 
around the internet via innumerable mail relays before arriving. The 
only thing email protocols care about is the original sender. Reply 
sends it back to the originator. Reply All sends it to all recipients 
plus the original sender.



So if a mailing list sends me an email,


The list never sends you mail.
The list only forwards mail it receives.
It's only a slightly specialised form of mail relay or proxy.


Yes... most of the ones *I* use don't.


:-)


nevertheless seems a less than ideal setup choice for this list given
that the default behaviour caters for the minority use-case;


But my default behaviour is to always use ReplyAll unless I specifically 
want to talk to the sender only. It's how I reply to all of the emails I 
receive both at home and at work. And that's how all the people I work 
with operate too. So the list works exactly like the mails I receive 
from my friends, my colleagues and lots of spam too! :-(



collective discussion.  Taking tutor problems off list is generally
counter productive both for the people being helped and others who may


True but I often want to personally thank somebody who has answered a 
question well or maybe solved one of my issues by explaining something 
in a new way. It's not relevant to the OP or discussion and would simply 
clutter up the list. In those cases I use reply. In every other case I 
use ReplyAll, because that's what I always do for all email unless 
there's a reason not to.


The problem with the  reply goes to list approach is that replying to a 
poster individually becomes very tedious - you have to manually remove 
the unwanted addresses.


Of course the best solution is to have a client that recognises lists 
and automatically responds appropriately, mutt and Thunderbird both seem 
to do that well.



Anyway, I'll go back to leaving this issue alone again now.  Have a
good weekend everyone :)


Its a debate that's been raging for as long as I've been on the list - 
nearly 15 years :-)


--
Alan G
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] adding a windows registry value

2012-08-03 Thread eryksun
On Fri, Aug 3, 2012 at 6:28 PM, Alan Gauld  wrote:
>
> The problem with the  reply goes to list approach is that replying to a
> poster individually becomes very tedious - you have to manually remove the
> unwanted addresses.
>
> Of course the best solution is to have a client that recognises lists and
> automatically responds appropriately, mutt and Thunderbird both seem to do
> that well.

I have the Gmail lab enabled that defaults to "reply all", but the
default [reasonable] behavior in that case is to reply to the sender
and CC everyone else (i.e. the list). I generally don't want that on a
list, but I often forget to manually fix it. The list server adds a
"List-Post" field. I wish Gmail could use that as the default for
reply all, or make it an available option.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] I-Phone App in Python?

2012-08-03 Thread Fred G
I just googled whether it is possible to write an i-phone app in Python and
got very confusing, and not super good results.

Is it possible? And if so, what module(s) do I need to install?

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


Re: [Tutor] adding a windows registry value

2012-08-03 Thread eryksun
On Fri, Aug 3, 2012 at 10:39 AM, Albert-Jan Roskam  wrote:
>
> import os
> # 1 using this from Python won't work, but double-clicking the file works.
> os.system(r"regedit /s C:\Users\Desktop\set_temp.reg")

Do you have a user named Desktop, or was this supposed to be
"C:\Users\USER_NAME\Desktop\set_temp.reg"?
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] adding a windows registry value

2012-08-03 Thread Steven D'Aprano

On 04/08/12 06:32, Walter Prins wrote:

On 3 August 2012 19:35, Alan Gauld  wrote:

The list doesn't care, you probably did it by hitting Reply
instead of Reply All.

Reply replies to the person who posted. Reply All replies to all
on the list. Just like regular email.



That's just how its set up, to mimic normal email.


Well normally I expect emails from a list (being the direct sender),
to go back to the sender, e.g. the list, and emails directly from a
person to go back to that person.  (Differently put, I expect *any*
email to by default go back to the sender, in general, unless I
specify otherwise.  So if a mailing list sends me an email, my default
expectation is that the mail goes back to the list, unless I specify
otherwise.  This seems perfectly intuitive to me, but hey ho what the
hey.  :)  )



The problem with that reasoning is that the list is *not* the sender. It's 
just a rely that handles list management and delivery. If you reply to a paper 
letter from Aunt Tilly, would you expect it to be delivered to the postman who 
delivered it to you?


There is a long, acrimonious debate about the behaviour of mailing lists. Some 
people, like you, want the mailing list to hack the "Reply To" address so that 
replies go back to the list instead of the sender. The biggest argument in 
favour of that is simplicity: you just hit "Reply" on any email and the reply 
goes to the appropriate place: the list for list mail, and the actual sender 
for private mail.


The biggest argument against is that it encourages a particular failure mode, 
where the recipient goes to make a private reply, says something personal or 
embarrassing, but forgets to change the address away from the public list.


(My personal answer to that is, carelessness is not the mailing list's fault. 
If you are writing something private and can't be bothered checking who you 
are sending too, that's your problem.)


Others consider that mangling the Reply To address is an abomination, and 
insist that it is a horrible abuse of Internet standards, and that it's no big 
deal to just hit Reply All. Which is wrong because it's a pain in the arse to 
get two copies of every nearly every email. (Some mailing list software is 
smart enough to not send you a second copy, but most isn't. Some mail clients 
are smart enough to detect duplicate emails and throw one away, but most 
don't, and even those that do only do so *after* the email has been downloaded 
from the server.


Also, the problem with the "purity" behaviour is that it encourages n00bs and 
the careless to take conversations off-list.


It's an imperfect world, and neither solution is right all the time. I have 
gradually moved away from the "lists should change the Reply To address" camp 
to a third camp, which is to insist on better tools. If your mail client 
doesn't give you a simple "Reply To List" command, then your mail client is 
crap. Some non-crap mail programs include Thunderbird, mutt, and Kmail. One 
crap one is apparently Gmail.



See:

http://woozle.org/~neale/papers/reply-to-still-harmful.html

which I don't entirely agree with -- the author makes claims about what people 
want, apparently without realising that the reason for the debate is that not 
all people want the same thing. In my opinion, he panders too much to the 
careless and stupid -- I have negative sympathy for anyone who sends private 
mail to a public address because they didn't bother to glance at where it was 
going before hitting Send. And he fails to consider the obvious answer that if 
the Reply To address is for the sender to set to whatever they like, all a 
mailing list need do is make "you agree that replies will go to the list" a 
condition of joining a list, and then the mailing list software, acting as 
your agent, is entitled to mangled the Reply To address.


And of course, we still have the problem of human laziness and stupidity. It 
is *astonishing* how many people apparently have problems with the concept:


"Before you reply to an email, decide whether you want to reply to the sender 
alone, the group, or the mailing list."


They'll insist on having a choice between 45 different coffees at Starbucks, 
but can't cope with the choice between 3 different types of reply.




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


Re: [Tutor] adding a windows registry value

2012-08-03 Thread Ramchandra Apte
You can use the _winreg 
 module.
I posted this message earlier but I replied to OP, not replied to all.

On 4 August 2012 08:00, Steven D'Aprano  wrote:

> On 04/08/12 06:32, Walter Prins wrote:
>
>> On 3 August 2012 19:35, Alan 
>> Gauld>
>>  wrote:
>>
>>> The list doesn't care, you probably did it by hitting Reply
>>> instead of Reply All.
>>>
>>> Reply replies to the person who posted. Reply All replies to all
>>> on the list. Just like regular email.
>>>
>>
>>  That's just how its set up, to mimic normal email.
>>>
>>
>> Well normally I expect emails from a list (being the direct sender),
>> to go back to the sender, e.g. the list, and emails directly from a
>> person to go back to that person.  (Differently put, I expect *any*
>> email to by default go back to the sender, in general, unless I
>> specify otherwise.  So if a mailing list sends me an email, my default
>> expectation is that the mail goes back to the list, unless I specify
>> otherwise.  This seems perfectly intuitive to me, but hey ho what the
>> hey.  :)  )
>>
>
>
> The problem with that reasoning is that the list is *not* the sender. It's
> just a rely that handles list management and delivery. If you reply to a
> paper letter from Aunt Tilly, would you expect it to be delivered to the
> postman who delivered it to you?
>
> There is a long, acrimonious debate about the behaviour of mailing lists.
> Some people, like you, want the mailing list to hack the "Reply To" address
> so that replies go back to the list instead of the sender. The biggest
> argument in favour of that is simplicity: you just hit "Reply" on any email
> and the reply goes to the appropriate place: the list for list mail, and
> the actual sender for private mail.
>
> The biggest argument against is that it encourages a particular failure
> mode, where the recipient goes to make a private reply, says something
> personal or embarrassing, but forgets to change the address away from the
> public list.
>
> (My personal answer to that is, carelessness is not the mailing list's
> fault. If you are writing something private and can't be bothered checking
> who you are sending too, that's your problem.)
>
> Others consider that mangling the Reply To address is an abomination, and
> insist that it is a horrible abuse of Internet standards, and that it's no
> big deal to just hit Reply All. Which is wrong because it's a pain in the
> arse to get two copies of every nearly every email. (Some mailing list
> software is smart enough to not send you a second copy, but most isn't.
> Some mail clients are smart enough to detect duplicate emails and throw one
> away, but most don't, and even those that do only do so *after* the email
> has been downloaded from the server.
>
> Also, the problem with the "purity" behaviour is that it encourages n00bs
> and the careless to take conversations off-list.
>
> It's an imperfect world, and neither solution is right all the time. I
> have gradually moved away from the "lists should change the Reply To
> address" camp to a third camp, which is to insist on better tools. If your
> mail client doesn't give you a simple "Reply To List" command, then your
> mail client is crap. Some non-crap mail programs include Thunderbird, mutt,
> and Kmail. One crap one is apparently Gmail.
>
>
> See:
>
> http://woozle.org/~neale/**papers/reply-to-still-harmful.**html
>
> which I don't entirely agree with -- the author makes claims about what
> people want, apparently without realising that the reason for the debate is
> that not all people want the same thing. In my opinion, he panders too much
> to the careless and stupid -- I have negative sympathy for anyone who sends
> private mail to a public address because they didn't bother to glance at
> where it was going before hitting Send. And he fails to consider the
> obvious answer that if the Reply To address is for the sender to set to
> whatever they like, all a mailing list need do is make "you agree that
> replies will go to the list" a condition of joining a list, and then the
> mailing list software, acting as your agent, is entitled to mangled the
> Reply To address.
>
> And of course, we still have the problem of human laziness and stupidity.
> It is *astonishing* how many people apparently have problems with the
> concept:
>
> "Before you reply to an email, decide whether you want to reply to the
> sender alone, the group, or the mailing list."
>
> They'll insist on having a choice between 45 different coffees at
> Starbucks, but can't cope with the choice between 3 different types of
> reply.
>
>
>
> --
> Steven
>
> __**_
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/**mailman/listinfo/tutor
>
___

Re: [Tutor] adding a windows registry value

2012-08-03 Thread Ramchandra Apte
I was the first person to respond actually.

On 4 August 2012 08:50, Ramchandra Apte  wrote:

> You can use the _winreg 
>  module.
> I posted this message earlier but I replied to OP, not replied to all.
>
>
> On 4 August 2012 08:00, Steven D'Aprano  wrote:
>
>> On 04/08/12 06:32, Walter Prins wrote:
>>
>>> On 3 August 2012 19:35, Alan 
>>> Gauld>
>>>  wrote:
>>>
 The list doesn't care, you probably did it by hitting Reply
 instead of Reply All.

 Reply replies to the person who posted. Reply All replies to all
 on the list. Just like regular email.

>>>
>>>  That's just how its set up, to mimic normal email.

>>>
>>> Well normally I expect emails from a list (being the direct sender),
>>> to go back to the sender, e.g. the list, and emails directly from a
>>> person to go back to that person.  (Differently put, I expect *any*
>>> email to by default go back to the sender, in general, unless I
>>> specify otherwise.  So if a mailing list sends me an email, my default
>>> expectation is that the mail goes back to the list, unless I specify
>>> otherwise.  This seems perfectly intuitive to me, but hey ho what the
>>> hey.  :)  )
>>>
>>
>>
>> The problem with that reasoning is that the list is *not* the sender.
>> It's just a rely that handles list management and delivery. If you reply to
>> a paper letter from Aunt Tilly, would you expect it to be delivered to the
>> postman who delivered it to you?
>>
>> There is a long, acrimonious debate about the behaviour of mailing lists.
>> Some people, like you, want the mailing list to hack the "Reply To" address
>> so that replies go back to the list instead of the sender. The biggest
>> argument in favour of that is simplicity: you just hit "Reply" on any email
>> and the reply goes to the appropriate place: the list for list mail, and
>> the actual sender for private mail.
>>
>> The biggest argument against is that it encourages a particular failure
>> mode, where the recipient goes to make a private reply, says something
>> personal or embarrassing, but forgets to change the address away from the
>> public list.
>>
>> (My personal answer to that is, carelessness is not the mailing list's
>> fault. If you are writing something private and can't be bothered checking
>> who you are sending too, that's your problem.)
>>
>> Others consider that mangling the Reply To address is an abomination, and
>> insist that it is a horrible abuse of Internet standards, and that it's no
>> big deal to just hit Reply All. Which is wrong because it's a pain in the
>> arse to get two copies of every nearly every email. (Some mailing list
>> software is smart enough to not send you a second copy, but most isn't.
>> Some mail clients are smart enough to detect duplicate emails and throw one
>> away, but most don't, and even those that do only do so *after* the email
>> has been downloaded from the server.
>>
>> Also, the problem with the "purity" behaviour is that it encourages n00bs
>> and the careless to take conversations off-list.
>>
>> It's an imperfect world, and neither solution is right all the time. I
>> have gradually moved away from the "lists should change the Reply To
>> address" camp to a third camp, which is to insist on better tools. If your
>> mail client doesn't give you a simple "Reply To List" command, then your
>> mail client is crap. Some non-crap mail programs include Thunderbird, mutt,
>> and Kmail. One crap one is apparently Gmail.
>>
>>
>> See:
>>
>> http://woozle.org/~neale/**papers/reply-to-still-harmful.**html
>>
>> which I don't entirely agree with -- the author makes claims about what
>> people want, apparently without realising that the reason for the debate is
>> that not all people want the same thing. In my opinion, he panders too much
>> to the careless and stupid -- I have negative sympathy for anyone who sends
>> private mail to a public address because they didn't bother to glance at
>> where it was going before hitting Send. And he fails to consider the
>> obvious answer that if the Reply To address is for the sender to set to
>> whatever they like, all a mailing list need do is make "you agree that
>> replies will go to the list" a condition of joining a list, and then the
>> mailing list software, acting as your agent, is entitled to mangled the
>> Reply To address.
>>
>> And of course, we still have the problem of human laziness and stupidity.
>> It is *astonishing* how many people apparently have problems with the
>> concept:
>>
>> "Before you reply to an email, decide whether you want to reply to the
>> sender alone, the group, or the mailing list."
>>
>> They'll insist on having a choice between 45 different coffees at
>> Starbucks, but can't cope with the choice between 3 different types of
>> reply.
>>
>>
>>
>> --
>> Steven
>>
>> __**_
>> Tutor maillist  -  Tutor

Re: [Tutor] Newline question

2012-08-03 Thread Alexander Q.
On Fri, Aug 3, 2012 at 2:09 PM, Alexander Q.  wrote:

>
>
> On Fri, Aug 3, 2012 at 1:40 PM, Jerry Hill  wrote:
>
>> On Fri, Aug 3, 2012 at 4:18 PM, Alexander Q. 
>> wrote:
>> > I'm following the tutorial from python.org
>> > (http://docs.python.org/tutorial/introduction.html) and am having a few
>> > indiscrepancies regarding the new line command.
>> >
>> > The tutorial says that this code
>> >
>> > hello = "This is a rather long string containing\n\
>> > several lines of text just as you would do in C.\n\
>> > Note that whitespace at the beginning of the line is\
>> >  significant."
>> >
>> > should yield this output:
>> >
>> > This is a rather long string containing
>> > several lines of text just as you would do in C.
>> > Note that whitespace at the beginning of the line is significant.
>>
>> You left out the other line of code in the tutorial, which says you
>> need to do print(hello) to the the output that is described. Did you
>> do that?  If so, it should work fine.  If not, what did you do
>> instead?  If you just typed:
>>
>> >>>hello
>>
>> at the interpreter prompt, then you are actually seeing the equivalent
>> of print(repr(hello)), instead of print(hello).
>>
>> Can you copy and paste your session for us?
>>
>> Jerry
>>
>
> That was it Jerry- when I typed in "print hello" instead of just "hello",
> the output was exactly like the one in the tutorial. Alternatively, I could
> accomplish the same type of output by using triple quotes around the same
> text, except that I would have to format it manually if I want it to come
> out looking the same way as it did when using "\n" in the previous example?
> Thanks again for your help. The way I understand it from your explanation
> is that "hello" does a literal output of everything typed without
> processing the escape backslashes, while "print hello" does process them.
>
> -Alex
>
> Yes, thanks Matt- I realized my mistake soon after sending the email.

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