Re: [Tutor] Set Reply-To field to Tutor@python.org

2013-01-29 Thread Oscar Benjamin
On 29 January 2013 03:35, DoanVietTrungAtGmail doanviettr...@gmail.com wrote:
 As a student user of this list, I prefer leaving the Reply-To field
 unchanged. I like the fact that this means a deliberate  decision is
 required to send public emails.

If you don't mind my asking, do you send many off-list messages as
replies to on-list ones?

I see the mailing list as being fundamentally a public message forum
and only very occasionally send an off-list message. Usually the
reason that I do this is because someone else has sent me a message
off-list and even though I'm fairly sure they meant it to be on-list I
don't want to assume that they did by replying back to the list.

Often this means that the archives are incomplete, so that there is a
thread but the part of the thread where the OP says Thanks, this is
the solution that worked or Sorry, that's not what I meant. My
actual problem is... is missing. Not having this information on the
list is unhelpful. It is unhelpful for people reading the archives in
the future, for people who keep replying to a thread that is
essentially solved, and for people who offer suggestions and don't get
feedback on whether their suggestions were useful.

Of course if the message is deliberately sent off-list then that is
fine but I find that I send/receive many more accidentally off-list
messages than deliberate ones. It's hard to predict how often the
alternative, accidentally sending a private message to the list, would
occur. Although judging from other lists where reply-to-list is the
default I would say not very often.

I don't find that replying to the list is a deliberate decision to
engage in public conversation since the fact that I read and respond
to the list at all is because I have already made that decision. For
me at least, it is replying off-list that requires explicit
consideration.


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


Re: [Tutor] Set Reply-To field to Tutor@python.org

2013-01-29 Thread DoanVietTrungAtGmail
On Tue, Jan 29, 2013 at 9:12 PM, Oscar Benjamin
oscar.j.benja...@gmail.comwrote:

 If you don't mind my asking, do you send many off-list messages as
 replies to on-list ones?
 Oscar


For this list, I have sent 1 public reply and 2 private replies (to thank
individual tutors). Both numbers are too small to have any significance.

Reading the Chip Rosenthal article that Steven referred to, I thought that
in the case of this Tutor list, his arguments are neither here nor there.
It probably comes down to personal preference, and that's why I stated mine.

The reason for my personal preference is that for other lists, I am
frequently annoyed by private-reply emails landing in my inbox, and
sometimes I absent-mindedly do the same thing, thus annoying others.

For most lists, group-reply ought to be deliberate. For a few lists it
doesn't matter either way. What if, as Oscar seems to say, this Tutor list
is in a category where private-reply ought to be deliberate? Most people
would only form 1 habit for all lists, rather than 1 for each of the
several lists they participate in. If so, I think the habit of deliberate
public-reply would serve us better in terms of etiquette.

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


Re: [Tutor] Set Reply-To field to Tutor@python.org

2013-01-29 Thread Jonatán Guadamuz
El 29/01/2013, a las 04:14 a.m., Oscar Benjamin
oscar.j.benja...@gmail.com escribió:

 I see the mailing list as being fundamentally a public message forum
 and only very occasionally send an off-list message.

 Often this means that the archives are incomplete, so that there is a
 thread but the part of the thread where the OP says Thanks, this is
 the solution that worked or Sorry, that's not what I meant. My
 actual problem is... is missing. Not having this information on the
 list is unhelpful. It is unhelpful for people reading the archives in
 the future, for people who keep replying to a thread that is
 essentially solved, and for people who offer suggestions and don't get
 feedback on whether their suggestions were useful.

 For me at least, it is replying off-list that requires explicit
 consideration.

The fact of giving and receiving help by a public mean, and having
this help available to others as well, complete in the archives, it's
for me enough reason to give +1 to set reply-to field to tutor
address.
If I am reading something which comes from a mailing list then I think
the most proper way to reply would be to send an answer to all the
people which originally received the same message. That way, I can
avoid duplicate answers, even better this conduct can lead to
additional complementary answers because someone can construct on
previous partial solutions/suggestions. But this needs all answers are
available to everyone.

This is my opinion. I hope my writing is understandable.

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


Re: [Tutor] Set Reply-To field to Tutor@python.org

2013-01-29 Thread Kushal Kumaran
Oscar Benjamin oscar.j.benja...@gmail.com writes:

 I have both sent and received messages on this list that went off-list
 by mistake. It's an easy mistake to make that you use reply instead of
 reply-all and then the message goes just to one person instead of the
 whole list.

 This problem is not unique to the python-tutor. I see it happening
 often on other mailing lists (often it's noticeable by the fact that
 someone forwards an off-list message back to the list which can
 sometimes break the threading of email software).

 One particular list that I receive has recently made an administrative
 change so that, from now on, all emails have the Reply-To header set
 to the list address. This means that the default behaviour when
 replying to a message is that the reply goes to the list. I think that
 this is the right thing to do by default since replying off-list is
 much less common and more likely to be something that you are
 consciously aware of when you do it.

 The change seems to have gone down well on the other list so I
 wondered: could it be done for this list as well?


To summarize existing opinions on this matter:

http://marc.merlins.org/netrants/listreplyto.html

You might want to familiarize yourself with existing literature on the
matter before starting a new flame war.

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


Re: [Tutor] Help!

2013-01-29 Thread Kwpolska
On Mon, Jan 28, 2013 at 10:22 PM, Ghadir Ghasemi
ghasemm...@leedslearning.net wrote:
 Hi guys I wanted to make a program called Binary/decimal converter.

That’s easy, int('11', 2) and bin(3) should be enough.

 But I want to do it the hard way e.g. not using built in python functions. 
 Can you give me an idea about how I can do that?

Are you crazy or is it an assignment?  Write code according to this:
http://en.wikipedia.org/wiki/Binary_number#Conversion_to_and_from_other_numeral_systems
(or other methods you can find on the Internet or in math textbooks).
Alternatively, you can find out how it is done in other programming
languages or even Python itself.  And use that.

PS. actually, it is impossible to do it in plain Python without using
built-in functions.  Because multiplication, division and
exponentiation and whatnot are built-ins.

OP, please tell your mail provider that it shouldn’t filter
swearwords, and even if it does, that it shouldn’t inform me of that.

-- 
Kwpolska http://kwpolska.tk | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Set Reply-To field to Tutor@python.org

2013-01-29 Thread Albert-Jan Roskam


 
 To summarize existing opinions on this matter:
 
 http://marc.merlins.org/netrants/listreplyto.html
 
 You might want to familiarize yourself with existing literature on the
 matter before starting a new flame war.

Hmmm... False alarm? 
 
Page blocked 

The page you've been trying to access was blocked.
Reason: Access Denied! The requested URL is a Spyware site.
Transaction ID is 5107F01CFF920603D57F.  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] automate add-to-cart with python

2013-01-29 Thread Benjamin Fishbein
 
 
 A direct approach would probably use the webdriver API to automate the
 browser.  Selenium has one:
 
I decided to use Selenium. It may be overkill for this particular problem, but 
I'll want to use it for other things.
This is my first time trying to install a new module to Python. I've been 
working on it all morning with no success.
I'm on Mac OSX and I downloaded :
selenium-2.29.0.tar.gz
and then opened it to get:
selenium-2.29.0

In the README file,  it said for installing to Python, to type:
pip install -U selenium

So in terminal, I went to:

cd /Users/bfishbein/Downloads/selenium-2.29.0

and typed:
pip install -U selenium

I got:
-bash: pip: command not found
so I tried downloading pip

After downloading pip, I tried to install it:
cd /Applications/pip-1.2.1
install pip

I got this strange message:
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
   [-o owner] file1 file2
   install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
   [-o owner] file1 ... fileN directory
   install -d [-v] [-g group] [-m mode] [-o owner] directory ...
Benjamins-MacBook-Air:pip-1.2.1 bfishbein$ 

Apparently it didn't install.
Do you know what I'm doing wrong?
Any help would be appreciated.
I didn't expect it to be so tough to install a python module.
Ben



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


Re: [Tutor] automate add-to-cart with python

2013-01-29 Thread Danny Yoo
 After downloading pip, I tried to install it:
 cd /Applications/pip-1.2.1
 install pip

 I got this strange message:
 usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 file2
install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 ... fileN directory
install -d [-v] [-g group] [-m mode] [-o owner] directory ...
 Benjamins-MacBook-Air:pip-1.2.1 bfishbein$

 Apparently it didn't install.
 Do you know what I'm doing wrong?
 Any help would be appreciated.
 I didn't expect it to be so tough to install a python module.


Technically, this is not pure Python code; expect some friction here
due to the different levels of technologies being interconnected.

I've been out of the Python development community for a very long
time, so hopefully someone else will help correct me.  I believe pip,
a Python package installer, should be installed by following the
instructions in:

http://www.pip-installer.org/en/latest/installing.html

Have you looked at this yet?


The error message you're seeing is conceptually due to the assumption
that install is a universal thing.  It's not.  install in the
context of the command line is something else entirely separate from
Python: it's a command to install BSD binary utilities.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Set Reply-To field to Tutor@python.org

2013-01-29 Thread Nick W
My personal opinion (with whatever limited weight that has on this list
since I've only answered a few questions - and probably half of them I've
accidentally only sent to the op)/how I read it is that RFC 2822 actually
allows lists to set reply-to header; by my view the list software is
forwarding to everyone else and therefor counts as the most recent
sender/author. I admit that that is a somewhat different conclusion to
others that I've read as to the meaning of 2822, but that seems logical to
me and also my personal preference is for having the reply-to header be set
to the list address.
Nick


On Tue, Jan 29, 2013 at 7:44 AM, Albert-Jan Roskam fo...@yahoo.com wrote:



 
  To summarize existing opinions on this matter:
 
  http://marc.merlins.org/netrants/listreplyto.html
 
  You might want to familiarize yourself with existing literature on the
  matter before starting a new flame war.

 Hmmm... False alarm?

 Page blocked

 The page you've been trying to access was blocked.
 Reason: Access Denied! The requested URL is a Spyware site.
 Transaction ID is 5107F01CFF920603D57F.
 ___
 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] automate add-to-cart with python

2013-01-29 Thread Prasad, Ramit
Benjamin Fishbein wrote:
 
 
  A direct approach would probably use the webdriver API to automate the
  browser.  Selenium has one:
 
 I decided to use Selenium. It may be overkill for this particular problem, 
 but I'll want to use it for other
 things.
 This is my first time trying to install a new module to Python. I've been 
 working on it all morning with no
 success.
 I'm on Mac OSX and I downloaded :
 selenium-2.29.0.tar.gz
 and then opened it to get:
 selenium-2.29.0
 
 In the README file,  it said for installing to Python, to type:
 pip install -U selenium
 
 So in terminal, I went to:
 
 cd /Users/bfishbein/Downloads/selenium-2.29.0

Looks like you are on OS X. You can (probably) install pip from 
MacPorts or HomeBrew (which can also properly install alternative 
versions of Python without messing up the system installed version). 
Not that these are necessary, but they are helpful. Keep them
in mind for the future, especially if you test with multiple
versions of Python on the same machine.

 
 and typed:
 pip install -U selenium
 
 I got:
 -bash: pip: command not found
 so I tried downloading pip
 
 After downloading pip, I tried to install it:
 cd /Applications/pip-1.2.1
 install pip
 
 I got this strange message:
 usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 file2
install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 ... fileN directory
install -d [-v] [-g group] [-m mode] [-o owner] directory ...
 Benjamins-MacBook-Air:pip-1.2.1 bfishbein$
 
 Apparently it didn't install.
 Do you know what I'm doing wrong?
 Any help would be appreciated.
 I didn't expect it to be so tough to install a python module.

Normally you want to do `python setup.py install`
when manually installing (or similar). I think you 
should follow the pip install directions 
here: http://www.pip-installer.org/en/latest/installing.html
You need to install distribute or setuptools 
(use the source installation directions for manually
installing), but I believe the install script for pip
(not get-pip.py) will install the dependencies for you.

All of this will install to the global python install which is not
always desireable or even recommended. I would highly recommend
installing virtual env ( http://www.virtualenv.org/en/latest/ ).
This will let you install and try modules without contaminating
your global install.


~Ramit


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] automate add-to-cart with python

2013-01-29 Thread Francois Dion
On Mon, Jan 28, 2013 at 6:32 PM, Alan Gauld alan.ga...@btinternet.com wrote:
 On 28/01/13 22:51, Benjamin Fishbein wrote:
 In general, despite scouring the Internet, I haven't been able to figure
 out how to get Python to cause javascripts I find in the html to be run.


 That's because Javascript is run in the browser which has a Javascript
 interpreter built in. Python doesn't have a Javascript interpreter so can't
 run Javascript.

 But that's usually the wrong thing to do anyway so it doesn't matter. What
 you need to do is figure out what the Javascript is doing - usually sending
 some data to a server - and replicate that.

 Alternatively fire up a real browser and drive that with automation. How you
 do that will largely depend on the browser and the OS.

 Or maybe, just maybe, somebody has written a javascript interpreter in
 Python as a module that you can import. It sounds just about crazy enough
 that it might even exist! But as I said, that's probably the wrong thing to
 do...

The other way around does exists, python in your web browser:
http://brython.info

Did a quick iPhone web app that way and demoed it to our local Python
group last night:
http://raspberry-python.blogspot.com/2013/01/iphone-app-with-python.html

You could easily extend this concept where your python script server
side controls your python script client side through reverse Ajax. And
of course it's also possible to do the whole thing client side,
without a server. Works on all modern browsers too.

François

--
www.pyptug.org  -  raspberry-python.blogspot.com  -  @f_dion
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] HELP- Regarding working with python

2013-01-29 Thread Gayathri S
Hi all...!
I don't know how to import our own data sets in python. its
always importing the in built data sets. could you just tell me how to do
that...!


Thanks...!

On Mon, Jan 28, 2013 at 1:50 PM, Steven D'Aprano st...@pearwood.infowrote:

 On 28/01/13 18:26, Gayathri S wrote:

 Hi all..!
 wanna know how to compile python script in python command
 line,
 and is there any need for setting path for python like JAVA? whats the
 difference between .py file and .pyc file?



 Python is a byte-code compiled language, like Java many years ago.
 Normally to compile a python module, you just import it from within Python.

 That is not very convenient for scripts, so from the shell (bash,
 command.com, cmd.exe, or similar) you can run

 python -m compileall NAME NAME ...

 to compile scripts.


 You do not necessarily need to set the PYTHONPATH, but you can if you need
 to.

 .py files are source code. .pyc are compiled byte code. .pyo are compiled
 byte code with optimization turned on. Don't get too excited, the standard
 Python optimization doesn't do very much.



 --
 Steven

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




-- 




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


Re: [Tutor] automate add-to-cart with python

2013-01-29 Thread Benjamin Fishbein
 
 
http://www.pip-installer.org/en/latest/installing.html
 
I went to this pip site. It told me to install virtualenv.
http://www.virtualenv.org/en/latest/#installation
The virtualenv site told me:
You can install virtualenv with pip install virtualenv, or the latest 
development version with pip install 
https://github.com/pypa/virtualenv/tarball/develop.


But since I didn't yet have pip, I couldn't use it to install virtualenv.
Then it said:
You can also use easy_install, or if you have no Python package manager 
available at all, you can just grab the single file virtualenv.py and run it 
with pythonvirtualenv.py.

I don't have easy_install. When I tried to download easy_install, it came in an 
EGG format that I couldn't open despite downloading several opener apps.
I tried this page:
https://raw.github.com/pypa/virtualenv/master/virtualenv.py
I think this is what I'll have to use for installing virtualenv, but I have not 
idea what to do with it. I cut and pasted into a python file, then ran it in 
IDLE. When I ran main(), it returned the error:
Traceback (most recent call last):
  File pyshell#8, line 1, in module
virtual_1.main()
  File /Users/bfishbein/Documents/virtual_1.py, line 935, in main
sys.exit(2)
SystemExit: 2

I don't have much experience with command prompt interfaces which I think is 
causing most of my trouble. There's probably something simple I'm missing, like 
a semicolon or quotes.
Please help if you can.
Thank you,
Ben

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


[Tutor] how to import our own data sets

2013-01-29 Thread bob gailer
This seems to be a new subject. Please start a new email and give it a 
new and relevant subject. Otherwise your post gets mixed up with older 
and not relevant posts.


On 1/30/2013 12:18 AM, Gayathri S wrote:

Hi all...!
I don't know how to import our own data sets in 
python. its always importing the in built data sets. could you just 
tell me how to do that...!
Perhaps someone else understands your question. I have no idea what you 
want.


What are data sets?

What do you mean by built data sets?

What do you mean by import? Python uses import to load modules.

What are you trying to do?

--
Bob Gailer
919-636-4239
Chapel Hill NC

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


Re: [Tutor] automate add-to-cart with python

2013-01-29 Thread Marc Tompkins
On Tue, Jan 29, 2013 at 9:19 PM, Benjamin Fishbein
bfishbei...@gmail.comwrote:Then it said:

 You can also use easy_install, or if you have no Python package manager
 available at all, you can just grab the single file 
 virtualenv.pyhttps://raw.github.com/pypa/virtualenv/master/virtualenv.py and
 run it with pythonvirtualenv.py.


I'm pretty sure that's a typo.  It should say:
python virtualenv.py

In general, to run a Python script, the simplest (and most
usually-expected) way is to start a command prompt (a.k.a. terminal
session) and simply type the word python, followed by the name of the
script.  IDLE is meant for convenient editing and running - and it's very
far from the best tool even for that - but it is definitely NOT recommended
as a way to run production code; it introduces too much extraneous junk
into the Python environment.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] HELP-Regarding python

2013-01-29 Thread Gayathri S
Hi All!
 I don't know how to read text file in python. If the data
values are stored in a text file format, for example(1,30,60,90,120...200)
means what i would do for reading it in python. could you just explain it.



Thanks!




Keep Smiling.[?]
Regards
Gayu[?]
335.png___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] HELP-Regarding python

2013-01-29 Thread Dave Angel

On 01/30/2013 01:51 AM, Gayathri S wrote:

Hi All!
  I don't know how to read text file in python. If the data
values are stored in a text file format, for example(1,30,60,90,120...200)
means what i would do for reading it in python. could you just explain it.




infile = open(filename, rt)will open a text file

line = infile.readline()will read one line from it, as a str

After that, you can parse it anyway you like.




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


Re: [Tutor] HELP-Regarding python

2013-01-29 Thread spawgi
A safer approach would be -
with open(filepath, mode as filehandle:
indent//operation with the file.

This way, you do not have to remember to close the file explicitly.


On Wed, Jan 30, 2013 at 12:27 PM, Dave Angel da...@davea.name wrote:

 On 01/30/2013 01:51 AM, Gayathri S wrote:

 Hi All!
   I don't know how to read text file in python. If the
 data
 values are stored in a text file format, for example(1,30,60,90,120...200)
 means what i would do for reading it in python. could you just explain it.



 infile = open(filename, rt)will open a text file

 line = infile.readline()will read one line from it, as a str

 After that, you can parse it anyway you like.




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




-- 
http://spawgi.wordpress.com
We can do it and do it better.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] HELP-Regarding python

2013-01-29 Thread spawgi
missed a parenthesis, it should look like -
with open(filepath, mode) as filehandle:
indent//operation with the file.


On Wed, Jan 30, 2013 at 12:31 PM, spa...@gmail.com wrote:

 A safer approach would be -
 with open(filepath, mode as filehandle:
 indent//operation with the file.

 This way, you do not have to remember to close the file explicitly.


 On Wed, Jan 30, 2013 at 12:27 PM, Dave Angel da...@davea.name wrote:

 On 01/30/2013 01:51 AM, Gayathri S wrote:

 Hi All!
   I don't know how to read text file in python. If the
 data
 values are stored in a text file format, for
 example(1,30,60,90,120...200)
 means what i would do for reading it in python. could you just explain
 it.



 infile = open(filename, rt)will open a text file

 line = infile.readline()will read one line from it, as a str

 After that, you can parse it anyway you like.




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




 --
 http://spawgi.wordpress.com
 We can do it and do it better.




-- 
http://spawgi.wordpress.com
We can do it and do it better.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor