"hello"]
_replaces_ the reference in "a" with a reference to a new, different, list.
Sometimes you want a "deep" copy, where "b" would have got a copy of the
iriginal x-y list. See the "copy" module's "deepcopy" function, which supplies
thi
On 18Apr2015 23:26, boB Stepp wrote:
On Sat, Apr 18, 2015 at 11:08 PM, Cameron Simpson wrote:
Sometimes you want a "deep" copy, where "b" would have got a copy of the
iriginal x-y list. See the "copy" module's "deepcopy" function, which
On 19Apr2015 15:09, Cameron Simpson wrote:
On 18Apr2015 23:26, boB Stepp wrote:
On Sat, Apr 18, 2015 at 11:08 PM, Cameron Simpson wrote:
Sometimes you want a "deep" copy, where "b" would have got a copy of the
iriginal x-y list. See the "copy" module's
ocal_map, value)" function that
reports. That will (a) get you a partial answer and (b) cement in your mind
what is possible and why. Easy and useful!
Cheers,
Cameron Simpson
Technique will get you through times of no strength a lot better than
strength will get you through times of no
d,
you nearly always use the instance technique.
Indeed. Not least because (a) you don't always know or even care what class an
object is and (b) objects themselves can have callable attributes.
Cheers,
Cameron Simpson
Applications Programming is for dullards who can't do Syst
etime
module is probably backward compatible - it has presents features but does not
depend on 3.3 aspects of the language, and therefore may well run on 3.2.
Cheers,
Cameron Simpson
The most annoying thing about being without my files after our disc crash was
discovering once again how widespread
h may have merely made it look like it worked well.
Cheers,
Cameron Simpson
I swear to god, officer, I'm fixing this bridge. Just go divert traffic.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://ma
il programs.
It doesn't cut it for multipoint quote1-reply1 quote2-reply2 messages, but it
is a great jumping off point for people new to the method.
_If_ the OP has abandoned digest mode, Jim's pointer is very useful.
Before then I agree that it is far less so, but that is because di
break
[...]
At a first glance numbers is a global. It is reset to [] at program start, but
never again. So you're appending to it forever. I have not investigated further
as to how that affects your program's flow.
Cheers,
Cameron Simpson
There are two ways of dealing with thi
On 28Apr2015 22:27, Jim Mooney Py3winXP wrote:
On 28 April 2015 at 21:27, Cameron Simpson wrote:
At a first glance numbers is a global. It is reset to [] at program start,
but never again. So you're appending to it forever. I have not investigated
further as to how that affects your prog
ing git in the main areas (/usr, /usr/local, whatever), you may be
free to install it in your own home directory. It is just an executable...
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription opti
On 29Apr2015 08:34, Jim Mooney Py3.4.3winXP wrote:
On 28 April 2015 at 22:40, Cameron Simpson wrote:
We can pick over your code as well if you like. Should we?
Sure, but let me include the full working program after fixup. Although I
still have to write another program to feed it random
On 29Apr2015 22:10, boB Stepp wrote:
On Wed, Apr 29, 2015 at 9:40 PM, Cameron Simpson wrote:
On 29Apr2015 12:12, boB Stepp wrote:
... (3) install git if needed ...
It seems Git is needed, but I am not allowed to install it on the
Solaris workstation. So is there a way around this?
What
blished till later in the year so not much help to
you just now.
Personally I wouldn't worry about them until you think you've
found a real use for them. There are plenty other things to
be doing first!
I'm in agreement here.
Become comfortable with methods and using them. Until t
On 21May2015 17:52, Laura Creighton wrote:
If you keep appending the results of ls to your .hidden file
it will grow to enormous size. [...]
sort -u .hidden >newhidden #or whatever you want to call it
mv newhidden .hidden
Or:
sort -u -o .hidden .hidden
Cheers,
Cameron Simpson
[...] p
th open("blah", "w") as blahfp:
print("header", file=blahfp)
print_details(blahfp, ...)
print("footer", file=blahfp)
def print_details(fp, blah_info):
... loop using blah_info to write data to "fp"
Cheers,
Cameron Simpson
__
invalid/incorrect final result. So while
technically the risk you describe exists, in practice it will almost never
occur unless the larger program outcome also results in failure of some kind.
Cheers,
Cameron Simpson
I object to doing things that computers can do. - Olin Shivers
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
xistence of a running
process based on this stored pid, what is the likelihood that the pid
will be reassigned to something other than one of my program's windows
left open?
As discussed above. Possible but unlikely. And if you are the creator of the
original process you can control the situa
converting it
back to a number.
That's crazy!
Indeed! Numbers throughout if at all possible.
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
it specific tests up the top, and then the random
consistency test down the bottom as "test30random_set_equivalence".
Cheers,
Cameron Simpson
MS-Word is Not a document exchange format - Jeff Goldberg
http://www.goldmark.org/netrants/no-word/attach.html
_
[ I've taken this discussion back to the tutor list. - Cameron ]
On 01Jun2015 18:14, Sydney Shall wrote:
On 31/05/2015 03:00, Cameron Simpson wrote:
You say that your results are "all rather close, consistent with the sigma
value I have chosen for the spread of my population
ed functions, hence the
prefix.
See "man 3 strptime" and "man 3 strftime".
Cheers,
Cameron Simpson
A program in conformance will not tend to stay in conformance, because even if
it doesn't change, the standard will. - Norman Diamond
___
27;)
while pos >= 0:
print("pos =", pos)
pos = s.find(']', pos + 1)
Obviously you could recast that as a generator funciton yielding positions for
general purpose use.
Cheers,
Cameron Simpson
Serious error.
All shortcuts have disappeared.
Scree
ut what is going wrong. If what you display
above is accurate then t and q are set for every line read.
Another remark, what is the use of your "else: pass" code? Normally one would
put some action here, such as raising an exception for the unhandled value or
issuing a warning.
Chee
before completing your application.
Ah, the S-word :-)
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
en the
same method every time, and thus the same id.
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
tart here:
http://www.crummy.com/software/BeautifulSoup/bs4/doc/
You can install bs4 using pip, or in other ways:
http://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-beautiful-soup
Cheers,
Cameron Simpson
30 years ago, I made some outrageous promises about AI. I didn't
what I am doing wrong. The
top500domains.csv list is attached.
Plenty of mailing list software strips attachments. In future, unless the file
is large, just append the contents below your message (with some explaination).
Cheers,
Cameron Simpson
Life is uncertain. Eat dessert first. -
, but I cannot (yet) bring it to mind.
(4) is never required, but is often convenient.
And for (5), surely I should never violate this one? It seems that in
some future edition of Python they might add any particular __name__
that I might try to use presently in their future version of Python
(howeve
lways be 1.
Also, what is the purpose of this line:
line = line.split()
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On 31Jul2015 17:21, Ltc Hotspot wrote:
Mark:
Is this any better, message sent from GMail?
Regards,
Hal
Looks better to me.
Cheers,
Cameron Simpson
On Fri, Jul 31, 2015 at 5:02 PM, Mark Lawrence
wrote:
On 31/07/2015 19:57, ltc.hots...@gmail.com wrote:
I believe that this is the third
and "filenames" instead of
"file" and "files": in python 2 "file" is a builtin function (though long
deprecated by "open()") and in any case I'd (personally) expect such a name to
be an _open_ file. As opposed to "filename", which is
On 02Aug2015 16:15, Clayton Kirkwood wrote:
Behalf Of Cameron Simpson
Sent: Sunday, August 02, 2015 3:35 PM
[...]
Personally I'd be reaching for os.path.splitext. Untested example below:
from os.path import splitext
for dir_path, directories, files in os.walk(main_dir):
ibrary, pointing him directly at fnmatch (which I'd entirely
forgotten) is the "give a man a fish" approach to help; a magic black box to do
the job for him.
Besides, I'm not sure fnmatch is much better for his task than the more direct
methods be
test here ...:
all_filenames.remove(filename)
print(all_filenames)
You could use a list instead of a set and for small numbers of files be fine.
With large numbers of files a set is far faster to remove things from.
Cheers,
Cameron Simpson
In the desert, you can remember your name,
'cause there ain'
:
fail_count += 1
... more checks ...
print(fail_count, "failures")
and so forth.
This also gets you test code so that you can test your own program for
correctness before submitting your assignment.
Feel free to return to this list with updated code and new questions.
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
eq__(F1, F2))
print("Is F1 different than F2?:", Fraction.__ne__(F1, F2))
print ("Is F1 same as F2?:", Fraction.__is__(F1, F2))
Here you want to avoid this. Firstly, Python has an "is" operator, and it does
not have a dunder method. Secondly, in what way does your __is__ differe from
__eq__?
print("Is:", Fraction.__iadd__(F1, F2))
if __name__ == '__main__':
main()
Otherwise this is all looking promising. Does it run correctly for you?
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ld about it. By putting docstrings on your Fraction class and also on
each of its methods you make that information available via help() later.
Otherwise, good luck.
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
bedded TAB
characters into my text, because they are subject to arbitrary interpreation by
others.
Cheers,
Cameron Simpson
I had a *bad* day. I had to subvert my principles and kowtow to an idiot.
Television makes these daily sacrifices possible. It deadens the inner core
of my being
On 07Aug2015 12:19, Alex Kleider wrote:
On Aug 7, 2015 1:18 AM, Cameron Simpson wrote:
However, when _editing_ I tell vi that when I press TAB it is to insert enough
SPACE characters to get to the next 4 column position.
How do you do that?
I've got vim set up so a CTRL-T while in i
On 07Aug2015 21:50, Alex Kleider wrote:
On 2015-08-07 20:56, Cameron Simpson wrote:
autoindent: start the next line's text on the same indent as this one
expandtab: write spaces instead of a TAB character
shiftwidth: how far the < and > shift-text operations move
tabstop: the multi
.py" containing:
print("Hello world!")
and run it:
python foo.py
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On 10Aug2015 18:07, ALAN GAULD wrote:
PS.
What is SDSU?
Google told me San Diego State University.
Cheers,
Cameron Simpson
To be positive: To be mistaken at the top of one's voice.
Ambrose Bierce (1842-1914), U.S. author. The Devil's Dictionary
as a domain name, while San Diego
State University actually uses sdsu. Maybe the race _is_ always to the swift.
Cheers,
Cameron Simpson
Airplanes are interesting toys but of no military value.
--Marechal Ferdinand Foch, Professor of Strategy, Ecole
Superieure de G
#x27;218.JPG', 'honda accident 001.jpg', 'honda accident
002.jpg', 'honda accident 003.jpg', 'honda accident 004.jpg', 'honda
accident 005.jpg', 'honda accident 006.jpg', 'honda accident 007.jpg',
est example rather than an anecdote.
We want to be sure that what we're inspecting is what you're inspecting.
The other thing we often want is the original problem (which you've described);
often people come with their specific solution to a larger problem. Which is
fine as long
on must be made every time the loop commences. It is not telling
you to use Pythons "if" statement. So just putting the correct condition at the
top of the "while" loop is what you want.
Cheers,
Cameron Simpson
If you lie to th
y I would have just
called it "filename", the singular of your "filenames".
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
). And if the value cannot be
transcribed the API should raise an exception.
IN this way you know that the structure of the query has been preserved
correctly. _And_ you do not need to worry about quoting values (or otherwise
transcribing them) correctly; that is a solved and debugged problem.
d with empty preferences, not an error
prefs = {}
This bit of code catches _only_ FileNotFoundError on the (presumed) policy that
a missing preferences file is ok - your program will proceed with default
behaviours - but any _other_ kind of exception is not expected - let your
program abor
ing you can to achieve an effect: stat is smaller
than open.
Cheers,
Cameron Simpson
Q: How many user support people does it take to change a light bulb?
A: We have an exact copy of the light bulb here and it seems to be
working fine. Can you tell me what kind of s
it aligns with your own habits.
Ideally, anyway.
If you're not invested in another style, and not working in someone else's
codebase with its own conventions, try PEP 8.
Cheers,
Cameron Simpson
Oh, what tangled webs we weave,
when first we practice to deceive.
And when
inner lambda:
>>> g(12)
14
So yes, you can do it. But as you can see it doesn't make for very readable
code. Lambdas are ok for small expressions. When things get more complex it is
worth breaking them up.
Cheers,
Cameron Simpson
_
a
number: ")
else:
print ("MyNumber is ", str(myNumber),": Computer number is: ",
str(computerNumber))
print ("We have a match.")
Looks like you assign the new number to "prompt" instead of to "myNumber".
Chee
it
easily available. If you need to parse email addresses import the
"getaddresses" function from the "email.utils" module.
Constuct a graph connecting messages with the replies. You're done!
Cheers,
Cameron Simpson
___
Tut
augument Alan's code
like this:
except (socket.herror, socket.gaierror) as e:
newFile.write("No resolution available for %s: %s" % (name, e) + "\n")
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
;seen", then visit any children which
are not in "seen". You pass "seen" to the traverse() of each child, so all the
function calls share the same "seen" object.
So in this case we're using a set. There's any number of different things you
might use
tc ...
sys.stdout = ostdout
sys.stdin = ostdin
Note that this is not thread safe because sys.stdin is a global, but it should
work for testing.
Anyway, perhap that gives you some way forward.
Cheers,
Cameron Simpson
___
Tutor maillis
On 11Oct2015 09:29, Alex Kleider wrote:
On 2015-10-10 18:10, Cameron Simpson wrote:
However, you'r eusing input(), which unconditionally uses stdin and
stdout. In that circumstance I'd consider this:
[... temporarily replace stdin and stdout with test data ...]
Yes indeed, and
y defines a socket.timeout error that will be
raised on a timeout. Just re-use that.
That seems reasonable, if he's using the recv timeout facility.
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ading at UP', item.select('.up2')[0].text)
Everywhere you have [0] you may get an IndexError if the select returns an
empty list, because there will be no element 0.
elif item.select('.down2') == item.select('.down2'):
I'm c
re descriptive names for local use. If course, if these
exceptions are widely used in many contexts (many other code pieces) then you
might want to stick with the original names for consistency.
Cheers,
Cameron Simpson
Go not to the elves for counsel, for they will say both no and yes.
- Fro
alue", 'surname': "po", 'age': poi}
records['key1'] = complex
complex = {'name': "value2", 'surname': "xy", 'age': poi2}
records['key2'] = complex
Nothing wrong with that if it fi
rect.
So please post the code, and the complete error message your computer gives
you.
Also not that getattr takes a string, per the error message. So to fetch the
.foo attribute from some object "o" you would write:
attribute = getattr(o, 'foo')
Note the qu
items:
fp.write(sep)
fp.write(... column definition for item ...)
sep = ',\n '
fp.write('\n);\n')
i.e. instead of printing the separator _after_ each item, print it _before_.
That way you can special case the first occasion and use a comma for each
successive occasion
l contain a reference to the stock code; since
your regexp matches the stock code then stock_code_match.group(0) will return
the actual matched text, the stock code.
Fix that stuff and see where you are.
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
w significant events (user logged in, did this,
was refused that, files opened/closed or stuff like that).
You'll need to elaborate a bit more on what you're trying to achieve here.
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@pytho
On 01Dec2015 11:31, Laura Creighton wrote:
He may be looking for something like the logging facility of Gnu screen.
Or the venerable "script" command. But I suspect he wants something else.
Cheers,
Cameron Simpson
The worst tyrannies were the ones where a governance required its
call. Then you could inspect the received data and probably
have seen the '\r' characters.
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
er does stuff with the XML (accept chunk, parse, etc).
If you need to know where the chunk came from, .put a tuple with the chunk and
some context information.
Does that help you move forward?
Cheers,
Cameron Simpson
___
Tutor maillist - T
On 29Dec2015 03:12, Steven D'Aprano wrote:
On Mon, Dec 28, 2015 at 04:50:05PM +0530, sutanu bhattacharya wrote:
suppose 61746245 is my searching string. so o/p will be
[...]
I don't understand the question.
What is "o/p"?
"output&
to subclass JournalLineItem later. Therefore I
would recommend the @classmethod approach. And stylisticly, I would put that up
the top, just under __init__.
Hoping this helps rather than confuses,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
rom_blah is defined in the superclass, the leading "cls" parameter is
the subclass because you invoked it through the subclass, just as you get the
leading "self" instance parameter when you invoke an instance method through
the instance. Tha
On 07Jan2016 00:06, ALAN GAULD wrote:
On 06/01/16 23:00, Cameron Simpson wrote:
... ensures that if you subclass the class, you automatically
get a valid constructor as well.
Wouldn't it return an instance of the superclass rather than
the sub class? You'd need to override it wo
ce, so
that it behaves like a UNIX read() call and may return a "short" read - less
than the maximum supplied. This is what you need to return data as soon as it
is received. By contrast, the traditional Python .read() call will try to
gather bytes until it has the amount as
On 08Jan2016 08:52, Cameron Simpson wrote:
[...]
Instead, gather the data progressively and emit XML chunks. You've got a TCP
stream - the TCPServer class will do an accept and handle you an _unbuffered_
binary stream file from which you can just .read(), ignoring any arbitrary
"pac
On 07Jan2016 17:22, richard kappler wrote:
On Thu, Jan 7, 2016 at 5:07 PM, Cameron Simpson wrote:
Just a few followup remarks:
This is all Python 3, where bytes and strings are cleanly separated.
You've got a binary stream with binary delimiters, so we're reading binary
data and
is no need to kill the Thread here.
You can wait for the Thread with T.wait() and probe it with T.is_alive(); see
the threading module documentation.
BTW, I still recommend you drop use of .recv() and use .read1() to assemble
packets. See your main di
rtly because it keeps the constructor
inside the class definition, which I find conceptually tidier.
Steven DAprano calls it a Python3 regular function/ a Python2
broken method and mentions the Descriptor protocol and how
'methods' are initially simply functions that are then c
sloppiness, my apologies,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ll the lines).
Thanks,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ok in your python_modules
directory for modules ahead of other places and you will not need the symlinks
(which are fragile anyway).
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.
#x27; should
become the last item in the list. Again, the interpreter help gave
what I was expecting.
To me it means "insert 'x' so that its index is 'i'".
Am I just being dense or are the docs in this instance confusing?
They may be a bit confusing, though I
On 15Jan2016 23:05, boB Stepp wrote:
On Fri, Jan 15, 2016 at 10:53 PM, Cameron Simpson wrote:
things.insert(-1, 'What the heck?!?')
things
[0, 'Hmm...', 3, 'WhackABunny', 6, 'What the heck?!?', '?']
"...at the index..." to me wo
nor in the normal domain for that value.
Cheers,
Cameron Simpson
Q: How does a hacker fix a function which doesn't work for all of the elements
in its domain?
A: He changes the domain.
- Rich Wareham
___
Tutor maillist - Tutor@python.o
On 16Jan2016 22:42, Alex Kleider wrote:
On 2016-01-16 18:02, Cameron Simpson wrote:
much like writing a function "def f(x, y=None)"; None is a sentinel
value - specially recognised as nor in the normal domain for that
value.
Can you please clarify the last bit:
"specially re
and likely so in other Python implementations.
Don't forget that because both "self.things" and "things" refer to the same
list object (in the example earlier) there's no need to have any final
"self.things = things" because both are acting on the same list.
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ndirection (using "things" instead of "self.things", etc), because that
indirection has a cost that _in this case_ will be large compared to the core
operations.
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
read local global called "request"; simplifies writing handlers as the
request information is readily available without having to pass it through
function calls.
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To u
g. Whether it is a sensible approach depends very much on what he is doing
with his files.
He _may_ be safer opening the file twice - once for "rb" and once for "ab" -
because he does not have to juggle the modes, but it isn't necessarily what he
wants.
Cheers,
Cameron
On 18Jan2016 21:07, ALAN GAULD wrote:
On 18/01/16 20:43, Cameron Simpson wrote:
The + modes are deceptively appealing but they are full of dangers
for precisely the reasons you have discovered(*). You very rarely
need them and you are better opening/closing the file and
using explicit modes to
x27;w+' truncates the file.
"""
That's why you lose the file's current content, and, yes, "r+b" would avoid
that.
And I stand corrected; I should have paid more attention. Thanks!
Cheers,
Cameron Simpson
__
near homophones, when
typing in a hurry. You'll see this in a bunch of my messages. More annoyingly,
some are only visible when I reread a posted message instead of when I was
proofreading prior to send.
[Homonyms mess me up when I'm typing, all sew.]
_ is doing is what you find unexpected later; defining
new attribute values not there before. The only thing special about __init__ is
that it is called automatically after an object is created. But that is all.
This is not a static language, and __init__ is not defining what
fields/attributes the object possesses. It is merely setting some of them. It
is executable code, not a static type definition.
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ssible to read gibberish in any language; most people don't try
to. So to repeat my question: why make it mandatory?
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
a special
operation.
To take an anecdote from elsewhere:
UNIX was not designed to stop you from doing stupid things, because that
would also stop you from doing clever things. - Doug Gwyn
There's no need to prevent you setting "sigh_strenght".
On 23Jan2016 01:52, boB Stepp wrote:
On Fri, Jan 22, 2016 at 11:04 PM, Cameron Simpson wrote:
On 22Jan2016 22:14, boB Stepp wrote:
All you're missing is realising that setting an attribute is not a special
operation.
I guess no matter how new one is to OOP, one nevertheless brings
On 23Jan2016 12:55, boB Stepp wrote:
On Sat, Jan 23, 2016 at 3:30 AM, Cameron Simpson wrote:
On 23Jan2016 01:52, boB Stepp wrote:
I guess no matter how new one is to OOP, one nevertheless brings one's
preconceptions, however malformed, into the learning process. In my
case, one of min
the better .name
syntax:
v = dog.__dict__['unique_feature']
v = getattr(dog, 'unique_feature')
v = dog.unique_feature
from least desired to most desired. BTW, when the attribute exists these all
return the same thing, but when the attribute does no exist they a
p_addrs.add(word7)
After you have read the whole file you will have the desired addresses in the
ip_addrs set.
Try to put all that together and come back with working code, or come back with
completed but not working code and specific questions.
Cheers,
Cameron Simpson
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
1 - 100 of 360 matches
Mail list logo