Re: [Tutor] method, type?

2016-01-05 Thread Alex Kleider
Hoping this helps rather than confuses, Cameron Simpson It is no more confusing than what I had already read about static and class methods. I guess I was hoping for an easy explanation but such a thing probably doesn't exist. I'll have to slog through the explanation. Thank you for takin

Re: [Tutor] Python 3.5.1 64 bit?

2016-01-05 Thread eryk sun
On Tue, Jan 5, 2016 at 5:50 PM, Alan Gauld wrote: > On 05/01/16 19:47, yehudak . wrote: >> I'm using version 3.5 of Python and want to upgrade. > > 3.5 is the latest stream. If you are already using it why > do you want to upgrade? Its easy to get caught up in a frenzy > of chasing the latest dot

Re: [Tutor] method, type?

2016-01-05 Thread Cameron Simpson
On 05Jan2016 20:58, Alex Kleider wrote: #!/usr/bin/env python3 # OS: Ubuntu 10.4LTS # My code: class JournalLineItem(object): """ """ def __init__(self, account, debit_or_credit, amount): self.account = account self.debit_or_credit = debit_or_credit self.amount =

[Tutor] method, type?

2016-01-05 Thread Alex Kleider
#!/usr/bin/env python3 # OS: Ubuntu 10.4LTS # My code: class JournalLineItem(object): """ """ def __init__(self, account, debit_or_credit, amount): self.account = account self.debit_or_credit = debit_or_credit self.amount = float(amount) def show(self):

Re: [Tutor] Python 3.5.1 64 bit?

2016-01-05 Thread Alan Gauld
On 05/01/16 19:47, yehudak . wrote: > I'm using version 3.5 of Python and want to upgrade. 3.5 is the latest stream. If you are already using it why do you want to upgrade? Its easy to get caught up in a frenzy of chasing the latest dot release but unless there is a specific bug fix or feature yo

[Tutor] Python 3.5.1 64 bit?

2016-01-05 Thread yehudak .
I'm using version 3.5 of Python and want to upgrade. The download site doesn't mention whether it's 32 or 64 bytes. Any info if 64 bytes is available? Also, when I upgrade, does the newer version over-ride the old one or I have first to remove the older version? Thanks, Yehuda ___

Re: [Tutor] Help with loops

2016-01-05 Thread Joel Goldstick
On Tue, Jan 5, 2016 at 12:27 PM, Chelsea G wrote: > I need to create a loop to print out the most common phrases with the > counts 5 or greater and the rest to be bucketed into other category. How do > I write the loop to print out the common phrases that have counts of 5 or > more? This is my co

[Tutor] Help with loops

2016-01-05 Thread Chelsea G
I need to create a loop to print out the most common phrases with the counts 5 or greater and the rest to be bucketed into other category. How do I write the loop to print out the common phrases that have counts of 5 or more? This is my code so far: import csv#from sys import argvfrom collections

Re: [Tutor] how to grep a word and make a dictionary from multiple lines.

2016-01-05 Thread David Rock
* Fosiul Alam [2016-01-05 09:46]: > Hi > so the logic will be like bellow :- > > a)Start to read the file, > b)start a line which start with "3600601" > c) Iterate through the line till i see another line which starts with > "3600601" > d) read the last line before 3600601 > e)cut all the path a

[Tutor] multipart socket streaming problem: threading??

2016-01-05 Thread richard kappler
This is a continuation of the thread 'reading an input stream' I had to walk away from for a few days due to the holidays and then other work considerations, and I figured it best to break my confusion into separate chunks, I hope that's appropriate. In short, my script needs to read a stream of xm

[Tutor] multipart socket streaming problem: the delimiters

2016-01-05 Thread richard kappler
This is a continuation of the thread 'reading an input stream' I had to walk away from for a few days due to the holidays and then other work considerations, and I figured it best to break my confusion into separate chunks, I hope that's appropriate. In short, my script needs to read a stream of xm

[Tutor] multipart socket streaming problem: reading the stream

2016-01-05 Thread richard kappler
This is a continuation of the thread 'reading an input stream' I had to walk away from for a few days due to the holidays and then other work considerations, and I figured it best to break my confusion into separate chunks, I hope that's appropriate. In short, my script needs to read a stream of xm

[Tutor] multipart socket streaming problem: the socket

2016-01-05 Thread richard kappler
This is a continuation of the thread 'reading an input stream' I had to walk away from for a few days due to the holidays and then other work considerations, and I figured it best to break my confusion into separate chunks, I hope that's appropriate. In short, my script needs to read a stream of xm

Re: [Tutor] Thank you Steve.

2016-01-05 Thread Alan Gauld
On 05/01/16 12:02, yehudak . wrote: > Does this 'trick' work also in other programming languages? Not generally, but I'm sure there are a few specific cases. It really depends on whether they support unpacking of data structures. -- Alan G Author of the Learn to Program web site http://www.alan-

Re: [Tutor] Swapping values

2016-01-05 Thread Alan Gauld
On 05/01/16 00:37, yehudak . wrote: > In Python we can swap values between two variable a and b this way: > > a = 3; b = 7 > print(a, b) # => 3 7 > > a, b = b, a # swapping! > print(a, b) # => 7 3 > > How does this work? Steven has given you a detailed answer showing how Python d

[Tutor] Thank you Steve.

2016-01-05 Thread yehudak .
Does this 'trick' work also in other programming languages? Yehuda ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to grep a word and make a dictionary from multiple lines.

2016-01-05 Thread Fosiul Alam
Hi so the logic will be like bellow :- a)Start to read the file, b)start a line which start with "3600601" c) Iterate through the line till i see another line which starts with "3600601" d) read the last line before 3600601 e)cut all the path and create a dictionary which will have one key (LUN I

Re: [Tutor] lists+sort

2016-01-05 Thread Peter Otten
Pooja Bhalode wrote: > Hi, I wanted to check if this program can be used to merge the lists > together and sort them. This seems to work, but i wanted to check if there > are drawbacks in writing it in this manner. When you start out lists are the natural datatype to use, but as you get more exp

Re: [Tutor] lists+sort

2016-01-05 Thread Steven D'Aprano
On Mon, Jan 04, 2016 at 12:34:57PM -0500, Pooja Bhalode wrote: > Hi, I wanted to check if this program can be used to merge the lists > together and sort them. This seems to work, but i wanted to check if there > are drawbacks in writing it in this manner. > > My solution: > > def linear_merge(li