Re: [Tutor] Str method

2012-11-05 Thread Alan Gauld
On 05/11/12 01:52, Oscar Benjamin wrote: On 5 November 2012 01:45, Ashley Fowler wrote: I'm trying to initialize a list to several elements using the string method. I have some idea that you use a for loop I suppose... It will help if you work on getting your terminology clearer. Computing i

Re: [Tutor] serial to parallel

2012-11-05 Thread Bala subramanian
Friends, In the previous mail there was an "mistake" i was not aware of. So pls dnt get upset. For frame in trajectory-A: > cunt= str(frame.time) It is count =str(frame.time). A counter to find frame number. Thanks joel for letting me to know it. Bala On Mon, Nov 5, 2012 at 11:46 AM, B

Re: [Tutor] please give me feedback - linux & virtual machine python script

2012-11-05 Thread eryksun
On Sun, Nov 4, 2012 at 1:43 AM, wrote: > > There are more features I like to implement but It would be nice to get > constructive feedback from the community. > Here is the code http://pastebin.com/R8b8M5PR On line 104 you print an error message to stdout instead of stderr and then call sys.exit

Re: [Tutor] serial to parallel

2012-11-05 Thread Dave Angel
On 11/05/2012 06:53 AM, Bala subramanian wrote: > Friends, > In the previous mail there was an "mistake" i was not aware of. So pls > dnt get upset. > > For frame in trajectory-A: >> cunt= str(frame.time) > It is count =str(frame.time). A counter to find frame number. > > Thanks joel for le

Re: [Tutor] serial to parallel

2012-11-05 Thread wrw
On Nov 5, 2012, at 8:44 AM, Dave Angel wrote: > On 11/05/2012 06:53 AM, Bala subramanian wrote: >>> [Huge byte] >>> Thanks in advance, >>> Bala >> >> > > Before you spend too much energy on this, I'd suggest that you'll > probably see a substantial slowdown trying to write the two files in

[Tutor] why different result from two similar ways

2012-11-05 Thread Frank Pontius
Hello, I have code that works. Then tried to move some of it into function IncrementAndRebuildInput, then result changes, I no longer have same result as when code in function was inline - why? (Function version way below) Inline version: (this correctly adds 1 to all numbers in text string,

[Tutor] help on dic creation

2012-11-05 Thread Brayden Zhao
hello! I am doing my homework now and I am kinda stuck. Could any of you help me out? Here is the homework problem: fieldict(filename) reads a file in DOT format and returns a dictionary with the DOT CMPLID, converted to an integer, as the key, and a tuple as the corresponding v

Re: [Tutor] Help with class example

2012-11-05 Thread Prasad, Ramit
Frank Pontius wrote: > Sent: Saturday, October 27, 2012 12:27 PM > To: d...@davea.name; bgai...@gmail.com > Cc: tutor@python.org > Subject: Re: [Tutor] Help with class example > > Here ya go! > Can't do what you want as this is a programmatic error from interrupter.  > Only a screen shot will tel

Re: [Tutor] help on dic creation

2012-11-05 Thread Brett Ritter
> Here is my code and I dont know why my code is only reading the 500th line of > the file. Thanks for your help! Let me offer you some hints: This sounds like only the last line is getting saved into the dict. Yet your loop is clearly going over each line. Ergo, the problem is probably in the

Re: [Tutor] help on dic creation

2012-11-05 Thread Brett Ritter
FYI - Gmail's new "compose" feature makes it WAY too easy to miss trimming the quotes. :( On Mon, Nov 5, 2012 at 3:37 PM, Brett Ritter wrote: (way too much) -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To uns

Re: [Tutor] why different result from two similar ways

2012-11-05 Thread Oscar Benjamin
On 30 October 2012 01:36, Frank Pontius wrote: > Hello, Hi, It would be good if you could remove unnecessary debug code before posting since it makes it harder for others to read your actual code. Also why is there an empty line between each two lines of code? I think this makes it much harder t

Re: [Tutor] using python to read csv clean record and write out csv

2012-11-05 Thread Oscar Benjamin
On 2 November 2012 10:40, Sacha Rook wrote: > > I have a problem with a csv file from a supplier, so they export data to csv > however the last column in the record is a description which is marked up > with html. > > trying to automate the processing of this csv to upload elsewhere in a > useable

Re: [Tutor] Help with OOP!

2012-11-05 Thread Oscar Benjamin
On 30 October 2012 06:56, Pete wrote: > I’m taking this class on python at UCSC. They said this list could help. I > don’t’ understand OOP and I’m having a hard time understanding the “scope” > and why the def inside class are not like function –plus I can’t get my > c-brain around the implicit ty

Re: [Tutor] why different result from two similar ways

2012-11-05 Thread Steven D'Aprano
On 30/10/12 12:36, Frank Pontius wrote: Hello, I have code that works. Then tried to move some of it into function IncrementAndRebuildInput, then result changes, I no longer have same result as when code in function was inline - why? Have you tried running it in isolation to see what it does?

Re: [Tutor] Help with OOP!

2012-11-05 Thread Steven D'Aprano
On 30/10/12 17:56, Pete wrote: I'm taking this class on python at UCSC. They said this list could help. I don't' understand OOP and I'm having a hard time understanding the "scope" and why the def inside class are not like function But they are like functions. Can you explain in more detail wha

Re: [Tutor] matplotlib question - Dates not showing up on X axis

2012-11-05 Thread Steven D'Aprano
On 06/11/12 04:42, jim schmidt wrote: import website as website What's website? When I try it, I get an error. py> import website as website Traceback (most recent call last): File "", line 1, in ImportError: No module named website By the way, there's no need to say "import X as X". Just

Re: [Tutor] matplotlib question - Dates not showing up on X axis

2012-11-05 Thread eryksun
On Mon, Nov 5, 2012 at 12:42 PM, jim schmidt wrote: > > fig = figure() > > ax = fig.add_subplot(1,1,1) > ax.plot_date(dates, kbSec, '-') > > ax.xaxis.set_major_locator(WeekdayLocator(byweekday=MO)) > ax.xaxis.set_major_formatter(DateFormatter('%m-%d')) > fig.autofmt_xdate()

Re: [Tutor] Help with class example

2012-11-05 Thread Dave Angel
On 11/05/2012 06:07 PM, Prasad, Ramit wrote: > Frank Pontius wrote: >> Sent: Saturday, October 27, 2012 12:27 PM >> To: d...@davea.name; bgai...@gmail.com >> Cc: tutor@python.org >> Subject: Re: [Tutor] Help with class example >> >> Here ya go! >> Can't do what you want as this is a programmatic er

Re: [Tutor] help on dic creation

2012-11-05 Thread Alan Gauld
On 31/10/12 01:01, Brayden Zhao wrote: Here is my code and I dont know why my code is only reading the 500th line of the file. Thanks for your help! def fieldict(filename): D={} with open(filename) as FileObject: for lines in FileObject: linelist=lines.split('\t') Key=l