Re: [Tutor] question / decision tree

2015-08-05 Thread Laura Creighton
In a message of Mon, 03 Aug 2015 10:38:40 +0100, matej taferner writes: >Or maybe should I go with the tkinter? You have to decide whether what you want is a Stand Alone GUI Application (in which case tkinter could be a fine idea) or a web app. It sounds to me as if you want your customers to nav

Re: [Tutor] scratching my head

2015-08-05 Thread Laura Creighton
In a message of Wed, 05 Aug 2015 08:43:45 +0200, Peter Otten writes: >Laura Creighton wrote: >but I don't think that's simpler. Can you enlighten me? When I got here, I landed in the middle of a discussion on how to use regexps for solving this. Plus a slew of string handling functions, none of w

Re: [Tutor] Dictionary Issue

2015-08-05 Thread Mark Lawrence
On 05/08/2015 23:58, Ltc Hotspot wrote: Hi Mark, Address identifies the email address with the maximum number of sends: c...@iupui.edu. Secondly, we are missing a count on the number of messages sent by c...@iupui.edu, i.e., 5. Thirdly, maxval 'none' is not defined on line # 24 Questions: Ho

Re: [Tutor] Pep 8, about indentation

2015-08-05 Thread Steven D'Aprano
On Thu, Aug 06, 2015 at 02:24:49AM +0100, Alan Gauld wrote: > On 06/08/15 00:31, D Wyatt wrote: > >I clearly remember that the standard for Python was to use 2 spaces > > Nope, unless it was a local convention in your place of work. > > But the standard for indentation has always(*) been 3 or 4 a

Re: [Tutor] Pep 8, about indentation

2015-08-05 Thread Alan Gauld
On 06/08/15 00:31, D Wyatt wrote: I clearly remember that the standard for Python was to use 2 spaces Nope, unless it was a local convention in your place of work. But the standard for indentation has always(*) been 3 or 4 and fro PEP 8 its 4. And thats pretty standard in any language because

Re: [Tutor] Dictionary Issue

2015-08-05 Thread Alan Gauld
On 06/08/15 02:05, Ltc Hotspot wrote: The revised output reads: In [3]: %run assignment_9_4_9.py Enter file name: mbox-short.txt c...@iupui.edu 14 The desired output: c...@iupui.edu 5 See my other post. Count the number of letters in the addres

Re: [Tutor] Pep 8, about indentation

2015-08-05 Thread Ben Finney
D Wyatt writes: > I clearly remember that the standard for Python was to use 2 spaces > for indentation of blocks. Now Pep 8 says 4. When did that change? When do you remember it being as you describe? -- \ “People's Front To Reunite Gondwanaland: Stop the Laurasian | `\

Re: [Tutor] Dictionary Issue

2015-08-05 Thread Alan Gauld
On 05/08/15 23:58, Ltc Hotspot wrote: fname = raw_input("Enter file name: ") handle = open (fname, 'r') for line in handle: if line.startswith("From: "): address = line.split()[1] So far so good. ## The program creates a Python dictionary that maps ## the sender's mail addres

Re: [Tutor] Dictionary Issue

2015-08-05 Thread Ltc Hotspot
Hi Mark, Address identifies the email address with the maximum number of sends: c...@iupui.edu. Secondly, we are missing a count on the number of messages sent by c...@iupui.edu, i.e., 5. Thirdly, maxval 'none' is not defined on line # 24 Questions: How do we define the value of none for the k

[Tutor] Pep 8, about indentation

2015-08-05 Thread D Wyatt
I clearly remember that the standard for Python was to use 2 spaces for indentation of blocks. Now Pep 8 says 4. When did that change? I hate it when things change on me like that. And what else has changed? Then again, maybe I dreamed it. Am I crazy? TIA -- Deb Wyatt in WA ___

Re: [Tutor] Dictionary Issue

2015-08-05 Thread Alan Gauld
On 05/08/15 15:15, Ltc Hotspot wrote: Raw data code reads: Being picky here but data and code are very different things (in most languages at least) and what you have below is definitely code not data. Meanwhile there are lots of issues in this code... fname = raw_input("Enter file name: ")

Re: [Tutor] Dictionary Issue

2015-08-05 Thread Alan Gauld
On 05/08/15 23:36, Clayton Kirkwood wrote: It looks like the problem is with count=dict() Should be count=dict{} I may be wrong - U'm still a neophyte. Yes, you're wrong! :-) the correct form is as shown count = dict() Its calling the type operation which looks like any other function and

Re: [Tutor] Dictionary Issue

2015-08-05 Thread Clayton Kirkwood
> -Original Message- > From: Tutor [mailto:tutor-bounces+crk=godblessthe...@python.org] On > Behalf Of Mark Lawrence > Sent: Wednesday, August 05, 2015 3:23 PM > To: tutor@python.org > Subject: Re: [Tutor] Dictionary Issue > > On 05/08/2015 15:15, Ltc Hotspot wrote: > > Hi everyone: > >

Re: [Tutor] Dictionary Issue

2015-08-05 Thread Danny Yoo
> However, there is a traceback message: > > In [40]: %run 9_4_4.py > File "C:\Users\vm\Desktop\apps\docs\Python\_9_4_4.py", line 19 > count = dict() > ^ > SyntaxError: invalid syntax Syntax error reporting is approximate: you might need to look a few lines earlier to get at the root

Re: [Tutor] Dictionary Issue

2015-08-05 Thread Mark Lawrence
On 05/08/2015 15:15, Ltc Hotspot wrote: Hi everyone: I want to write a python program that reads through the data file of mbox-short.txt.Mbox-short.txt, i.e., download is available at http://www.py4inf.com/code/mbox-short.txt. Secondly, I want for python to figure out who sent the greatest num

[Tutor] Dictionary Issue

2015-08-05 Thread Ltc Hotspot
Hi everyone: I want to write a python program that reads through the data file of mbox-short.txt.Mbox-short.txt, i.e., download is available at http://www.py4inf.com/code/mbox-short.txt. Secondly, I want for python to figure out who sent the greatest number of mail messages. The output should r

Re: [Tutor] find pickle and retrieve saved data

2015-08-05 Thread Oscar Benjamin
On 4 August 2015 at 23:09, Quiles, Stephanie wrote: > I am still struggling with this one. Hi Stephanie, Alan has already raised a few issues with your code so I'm just going to address the one that's showing in your error message. These two lines are generating the error message: > infile

[Tutor] R: Tutor Digest, Vol 138, Issue 26 Re: Problem on select esecution of object in a class (Alan Gauld)

2015-08-05 Thread jarod_v6--- via Tutor
Thanks so much fro the help. What I want to do is to obtain a selection of the function I want to run. ena = Rnaseq(options.configura, options.rst, options.outdir) cmdset = [ ena.trimmomatic, ena.star,

Re: [Tutor] Problem on select esecution of object in a class

2015-08-05 Thread Peter Otten
jarod_v6--- via Tutor wrote: > I have a class with many objects and I want to select using opt parse > some function id = options.step > ena = Rnaseq(options.configura, options.rst, options.outdir) > now = datetime.datetime.now() > ena.show() > diz = {} > f

Re: [Tutor] Problem on select esecution of object in a class

2015-08-05 Thread Alan Gauld
On 05/08/15 17:04, jarod_v6--- via Tutor wrote: for i in "ena."+"".join(diz[id])+"()": print i.command Here you are creating a string and then iterating over the string one character at a time. But the characters do not have a command attribute. > 3

[Tutor] Problem on select esecution of object in a class

2015-08-05 Thread jarod_v6--- via Tutor
I have a class with many objects and I want to select using opt parse some function id = options.step ena = Rnaseq(options.configura, options.rst, options.outdir) now = datetime.datetime.now() ena.show() diz = {} for i,t in enumerate(ena.steps()):

Re: [Tutor] who makes FOR loop quicker

2015-08-05 Thread Mark Lawrence
On 05/08/2015 08:53, John Doe wrote: To pass by reference or by copy of - that is the question from hamlet. ("hamlet" - a community of people smaller than a village python3.4-linux64) xlist = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] i = 0 for x in xlist: print(xlist) print("\txlist[%d] = %d"

Re: [Tutor] who makes FOR loop quicker

2015-08-05 Thread Steven D'Aprano
On Wed, Aug 05, 2015 at 10:53:14AM +0300, John Doe wrote: > To pass by reference or by copy of - that is the question from hamlet. > ("hamlet" - a community of people smaller than a village python3.4-linux64) Python *never* uses either pass by reference OR pass by value (copy). Please read this:

Re: [Tutor] who makes FOR loop quicker

2015-08-05 Thread Joel Goldstick
On Wed, Aug 5, 2015 at 3:53 AM, John Doe wrote: > To pass by reference or by copy of - that is the question from hamlet. > ("hamlet" - a community of people smaller than a village python3.4-linux64) > > xlist = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] > i = 0 > for x in xlist: > print(xlist) >

Re: [Tutor] Plotting asymmetric error bars for a single point in matplotlib

2015-08-05 Thread Peter Otten
Colin Ross wrote: > Hi all, > > Goal: To plot asymmetric x error bars for a single point using errorbar. I > am interested in displaying the inter quartile range (IQR) for a data set. > > Code: > > import numpy as np > import matplotlib.pyplot as plt > > y = 1.0 > data = np.random.rand(100) >

[Tutor] who makes FOR loop quicker

2015-08-05 Thread John Doe
To pass by reference or by copy of - that is the question from hamlet. ("hamlet" - a community of people smaller than a village python3.4-linux64) xlist = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] i = 0 for x in xlist: print(xlist) print("\txlist[%d] = %d" % (i, x)) if x%2 == 0

Re: [Tutor] About Python Module to Process Bytes

2015-08-05 Thread Michelle Meiduo Wu
I think this works for me! Thanks a lot,Michelle > From: d...@hashcollision.org > Date: Tue, 4 Aug 2015 12:12:20 -0700 > Subject: Re: [Tutor] About Python Module to Process Bytes > To: wum...@hotmail.com > CC: tutor@python.org > > On Tue, Aug 4, 2015 at 9:26 AM, Michelle Meiduo Wu wrote: > > Hi

Re: [Tutor] scratching my head - still

2015-08-05 Thread Peter Otten
Cameron Simpson wrote: > On 05Aug2015 12:46, Steven D'Aprano wrote: >>On Tue, Aug 04, 2015 at 05:52:15PM -0700, Clayton Kirkwood wrote: >>> As seen below (closely), some filenames are not being removed while >>> others are, such as in the first stanza, some pdfs are removed, some >>> aren't. In t