= S[0]
I tested this out with concrete examples in the interpreter, such as
with a list, L:
L = [item for item in range(1, 0, -1)]
and trying different test values. It was blazingly fast, too!
All I can say is: WOW!!!
--
boB
___
Tutor maillist - Tu
mimic the natural order, in so far as
it is possible, in which the functions get called. Are there better
ways to organize them?
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/ma
irectly use those functions on a list which is
> reverse-sorted, but the source is available. On my install, it's located
> at:
>
> /usr/lib/python3.4/bisect.py
And I see this is available on my oldest Python installlation, 2.4.4, too.
--
boB
___
oops, best of 3: 221 usec per loop
>
> So reverse/bisect is 50 times faster than the listcomp, and
> bisect/virt is 3500 times faster than the listcomp.
You present a compelling case!
> I expect that a prepackaged linear interpolation function from numpy/scipy
> can still do better, and also handle the corner cases correctly. To use such
> a function you may have to reverse order of the values.
This is not an option for me as I would not be allowed to install numpy/scipy.
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
))
None
>>> print(a_list)
[0, 1, 2, 4, 5]
>>>
I expected the first print statement to return what the second one
did. Apparently the first print printed a_list, then did the sort. Why
is this so?
--
boB
___
Tutor maillist - Tut
t method returns None. And that is
> printed.
Ah! I did not realize this. That makes sense now. Many thanks, Cameron!
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
at sorted()
was an available option. I had focused on available list methods.
While it does not matter if my actual lists do or do not get sorted,
my intent was to just have a sorted view of the list, so your
suggestion works better here and uses one less line of code. Thanks!
--
boB
__
d the indentation that was present in the interpreter. I added
spaces manually to get it appear as it did in the interpreter. Anyone
know why Gmail does that to my copy and paste?
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Tue, Mar 31, 2015 at 3:28 PM, Zachary Ware
wrote:
> On Tue, Mar 31, 2015 at 3:23 PM, boB Stepp wrote:
>> The following behavior has me stumped:
>>
>> Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit
>> (Intel)] on win32
>> Type "copyrig
On Tue, Mar 31, 2015 at 3:32 PM, Dave Angel wrote:
> On 03/31/2015 04:23 PM, boB Stepp wrote:
>>
>> The following behavior has me stumped:
>>
>> Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit
>> (Intel)] on win32
>> Type "copyright&quo
code that I assume this was cut out of, keep enumerate; it's the right
> tool for the job.
Yeah, I simplified my actual code into the smallest snippet that I
could reproduce my problem in. My actual code need the index.
--
boB
___
Tutor maillis
pecting the 'or' to result only in the print running without
executing sys.exit(). But that is not what happens--of course. I tried
substituting 'and' for 'or', but this results in only the print being
run! Obviously I have a significant misunderstanding of what is
On Sat, Apr 4, 2015 at 12:34 PM, Steven D'Aprano wrote:
> On Sat, Apr 04, 2015 at 11:49:08AM -0500, boB Stepp wrote:
>> Windows 7, Python 3.4.3
>>
>> This code snippet is "Example 7-13" on page 383 from "Programming
>> Python, 4th ed." by
On Sat, Apr 4, 2015 at 12:34 PM, Steven D'Aprano wrote:
> On Sat, Apr 04, 2015 at 11:49:08AM -0500, boB Stepp wrote:
>> Windows 7, Python 3.4.3
>>
>> This code snippet is "Example 7-13" on page 383 from "Programming
>> Python, 4th ed." by
nterfaces. Most
programmers should be familiar users of such technologies. At the
center of each of those areas, though, is a hard core of programming
problems. Those programs remain the theme of this book. This edition
of the book is a slightly larger fish in a much larger pond.
..."
HTH
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
nt('Hello lambda world!'), sys.exit())
> But the OR style is established as a kind of idiom,
> not just in Python but several other languages too.
So this is not unusual for Python. BTW, what are some of the other
languages where this type of expres
On Sat, Apr 4, 2015 at 6:55 PM, Alan Gauld wrote:
> On 04/04/15 22:57, boB Stepp wrote:
>>
>> On Sat, Apr 4, 2015 at 3:35 PM, Alan Gauld
>> wrote:
>>>
>>> He could have done it in various other ways too:
>>>
>>> eg.
>>> lambda
On Sun, Apr 5, 2015 at 3:06 AM, Alan Gauld wrote:
> On 05/04/15 04:45, boB Stepp wrote:
>
>>>>> He could have done it in various other ways too:
>>>>>
>>>>> eg.
>>>>> lambda : all(print('Hello lambda world!'), sys.ex
>>> d['n']
'Print me!'
>>> def func(d['n']):
SyntaxError: invalid syntax
>>> def func(d):
print d['n']
>>> func(d)
Print me!
The plain text does not show it, but in the invalid syntax the &q
icular value, not the whole
dictionary, so that is how I got into the issue I asked about. Once
you and Joel responded it was *obvious*. A bunch of years ago, it
would have been *obvious* and I never would have asked the question in
the first place. This is easy enough to correct now that I realize
On Mon, Apr 6, 2015 at 12:54 PM, Dave Angel wrote:
> On 04/06/2015 12:43 PM, boB Stepp wrote:
>
>>
>> I was breaking down longer functions into smaller ones. Along the way
>> I noticed I was passing an entire dictionary from one function to
>> another. I only neede
On Mon, Apr 6, 2015 at 2:42 PM, Dave Angel wrote:
> On 04/06/2015 03:20 PM, Emile van Sebille wrote:
>>
>> On 4/6/2015 7:54 AM, boB Stepp wrote:
>>>
[...]
>>
>> Maybe this form helps:
>>
>> Python 2.7.6 (default, Mar 22 2014, 22:59:56)
>
chance of *immediately* understanding
my intent, then when I have to decipher my thoughts from a "one-liner"
that might occupy less space, but where its complexity has me pausing
in thought to be sure I understand what I actually was trying to do.
--
boB
__
ething*, but how do I get it to print the
specific window containing the to-be-designed print button? Also, I
need it to print a postscript file, not print to paper. I suspect this
is another configuration setting that I need to research.
As always, many th
On Wed, Apr 15, 2015 at 8:29 AM, Steven D'Aprano wrote:
> On Wed, Apr 15, 2015 at 07:55:28AM -0500, boB Stepp wrote:
>> Solaris 10, Python 2.4.4
>>
>> I have very little experience with issuing print commands using a Unix
>> environment. Despite this, I wish t
On Wed, Apr 15, 2015 at 8:50 AM, Zachary Ware
wrote:
>
> On Apr 15, 2015 9:38 AM, "boB Stepp" wrote:
>> Perhaps I am being foolish! But I do have my reasons, which, in this
>> case, is I wanted to take advantage of the pack and grid geometry
>> managers
On Wed, Apr 15, 2015 at 10:39 AM, Peter Otten <__pete...@web.de> wrote:
> boB Stepp wrote:
>
>> Solaris 10, Python 2.4.4
[...]
>
> I'm on linux and surprisingly
>
> subprocess.call(["import", "-window", window_title, postscript_file])
>
jects it might be very useful. However, I should work
on mastering Tkinter first, as I am sure that all of the principles I
learn here will be generically useful for any GUI programming.
Thanks, Alan!
--
boB
___
Tutor maillist - Tutor@python.org
To unsub
en on one's monitor. Of course, some
people have HUGE monitors! And I assume that any guidance applies
equally well to methods.
Am I on-track or am I getting carried away?
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or
thon Code\PPC_28.py ==
> Traceback (most recent call last):
> File "C:\Users\Rafael\Documents\01 - BIZ\PYTHON\Python
> Code\PPC_28.py", line 136, in
> Tesco.CreateShoppingList()
> TypeError: CreateShoppingList() missing 3 required positional
> argume
On Wed, Mar 22, 2017 at 7:30 AM, Rafael Knuth wrote:
> thanks for your feedback! @boB
> ...(it does what it's
> supposed to do, but not sure if a pro would write it same way I did).
I'll leave it to others to evaluate your function which I snipped as I
am not a pro! ~(:>)
now has the following items:\n')
>> for item_number, item in enumerate(self.shopping_list):
>> print('%s. %s' % (item_number, item))
>>
>> if __name__ == '__main__':
>> my_shopping_list = GroceryListMaker()
>> my_shopping_list.make_shopping_list()
>> my_shopping_list.display_shopping_list()
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
t now has the following items:\n")
> for item_number, item in enumerate(self.shopping_list):
> print("%s. %s" % (item_number, item))
>
> if __name__ == "__main__":
> my_shopping_list = GroceryListMaker()
> my_shopping_list.make_shopping_li
On Fri, Mar 24, 2017 at 6:51 AM, Rafael Knuth wrote:
> Thank you so much for your help.
> I have a question: When creating an instance of GroceryListMaker, you are
> using:
>
> if __name__ == "__main__":
>
> What is that specifically for?
> I tested your code and both worked, with and without
> i
;. This makes things easier for people
to understand my code, breaks apart unnecessary interdependencies that
would otherwise exist in "big" methods/functions, makes it easier for
me to write tests for each function without having to worry about
unnecessary dependencies that I will have simulate
ion and the answers.
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ng an even harder time imagining what I would want to use
Enum for if I don't care about the values assigned to the names and
use auto to automatically assign values. I am having a real crisis of
imagination here! Anyone with some commonplace and practical
applications of the enum module?
TIA
On Sat, Apr 8, 2017 at 11:13 PM, Steven D'Aprano wrote:
> On Sat, Apr 08, 2017 at 10:00:21PM -0500, boB Stepp wrote:
>> After reading some discussion on the Python main list about the enum
>> module and some suggested changes, I thought I would read the docs on
>> it at
:
py3: new_pi = '3' + '.' + str(14159265358979323846264338327950288419716939)
py3: len(new_pi)
46
py3: new_pi
'3.14159265358979323846264338327950288419716939'
since in Python 3 integers are unlimited in precision (within RAM constraints).
I guess this has to be this way o
tring(), but I
see no substitute for str() listed. Surely there is some way to use
the decimal module to get the desired conversion to a string? I have
to retire for the evening and will try to figure this out tomorrow.
Cheers!
boB
___
Tutor maillist
that both an object instance and self.arg is getting passed
to mySuperWhammyFunction(), but I am not seeing how the object
instance is getting passed -- if my suspicion is indeed correct.
I also am not truly understanding how this code is working within the
unittest framework.
Help!
TIA!
boB
_
On Sat, Apr 15, 2017 at 6:31 PM, Alan Gauld via Tutor wrote:
> On 16/04/17 00:17, boB Stepp wrote:
>
>> --
>> #!/usr/bin/env python3
>>
>> def mySuperWhammyFunction(any_input):
>&
web stuff, then you might like "Test-Driven Development
with Python -- Obey the Testing Goat: Using Django, Selenium, and
JavaScript" by Harry J. W. Percival, c. 2014.
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change s
ethods
that might exist in those superclasses. Is this correct or do I have
a conceptual misunderstanding?
> - collect the success / failure and any outputs
>
> - report on the success / failure
>
> - produce some final summary output and set the exit code
> ac
OK, between Alan and Martin I think that I see how to make the code
snippet actually test a *function* as the snippet seems to suggest.
Recollect that my original question(s) started:
On Sat, Apr 15, 2017 at 6:17 PM, boB Stepp wrote:
> In the section
>
> https://docs.python.org/
omething
similar in unittest, so put off pytest for another day. I cannot
remember now what I did. I need to go back and find that code (If I
still have it.) and compare it with this Mixin approach that I started
this whole thread with. Nonetheless pytest is definitely on my radar
and I wil
thon3 discovery6.py
> found with foo_... methods
> Y one
> Y two
> found with foo_... methods
> X x
>
> That was easy. We have replicated something similar to the unit test
> framework with very little code.
>
> Now you can go and find the equivalent parts in the unittest source code :)
But not tonight ~(:>))
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
20,20,text="5")
>
>
> def main():
> root = Tk()
> app = Sudoku(root)
> app.mainloop()
>
> if __name__ == '__main__':
> main()
>
>
> --
> Regards,
> Phil
> ___
> Tutor maillis
.create_text(20,20,text="5")
>
>
> def main():
> root = Tk()
> app = Sudoku(root)
> app.mainloop()
>
> if __name__ == '__main__':
> main()
>
>
> --
> Regards,
> Phil
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
for you in
your use case, but perhaps it is something to think about. In the
Grayson book he has lots of examples of achieving very precise spacing
and placement of widgets, etc.
Just some thoughts. Perhaps they might inspire a creative thought or
two. Of course one of the
=
And this also works well. Seeing as this approach has fewer lines of
code and reads clearly, what advantages would the class wrapper
approach have? The only thing that is occurring to me in my current
sleepy state is that the class wrapper is m
riable=checked_radiobutton,
value=language).pack(anchor='w')
checked_radiobutton.set('')
tk.Button(root, text='Status', command=status).pack(fill='x')
root.mainloop()
I wish
On Tue, Apr 25, 2017 at 2:01 AM, Peter Otten <__pete...@web.de> wrote:
> boB Stepp wrote:
>
>> Win7-64bit, Python 3.6.1
>>
>> When I run the following code, the radiobutton window initially
>> displays with *all* buttons apparently selected. However, when the
&
ve not
> discovered how to remove the '' marks. How do I achieve that?
I probably don't understand what you are really trying to do, but
{1, 2, 3} - {int('1')}
does the obvious. But I am guessing that this is not what you want.
Perhaps you can provide more context, or pe
ox, which looks like {1} (no
> '' marks). If I then turn this number into a set then the result is {'1'}.
>
> num = self.entry_grid[row][col].get()
I would think that it is here that you would want to do the
string-to-int
g suggests these
are inherited from differences in handling input in the C language,
though I could not locate a Python example where there is a need for
one or the other. Are there any relevant Python examples?
--
boB
___
Tutor maillist - Tutor@python.o
On Wed, Apr 26, 2017 at 9:19 PM, Tim Peters wrote:
> [boB Stepp ]
>> My Google-fu must be weak tonight.
>
> Look here:
>
> https://en.wikipedia.org/wiki/Printf_format_string
Thanks. From the %d versus %i links I found, I should have pursued
the C history more diligently
Python you are using and your operating system. Hopefully
someone here might be able to assist you with your issues.
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
to go.
Finally, when you need to actually use the extracted string resembling
a float, you will have to convert that string using the float()
function.
Hope that something above is helpful!
Cheers!
--
boB
___
Tutor maillist - Tutor@python.org
To unsu
gt;
> What i was thinking of doing is having a place holder of {} in place of
> where i want the domain to be inserted into but i dont know how to
> structure the syntax of a zone file in a function within
Have you looked into string formatting? See:
https://docs.python.org/3/tutorial/inp
; 'calibre-ebook-viewer': 'libprs500'}
> self.open_and_move()
>
> def open_it(self):
> subprocess.call([self.program])
I'm not very familiar with using the subprocess module yet, but when
the above call to "subprocess.call([self.program])" occurs, isn't
subprocess.call() expecting a list like
['ebook-viewer', '/home/jfb ...']
?
Hope I am not off-track here.
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Would this be a case for a global
function dictionary (Which I could also use to check for valid
functions.) or perhaps a class which only exists to have this function
dictionary?
TIA!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Wed, May 17, 2017 at 1:42 AM, Peter Otten <__pete...@web.de> wrote:
> boB Stepp wrote:
>> Oh, and I suppose I should ask for a critique of the code as written
>> for appropriate Python style, proper targeted function use, etc. I am
>> always eager to learn!
>
&g
t be written as:
if Month == "January" or Month == "1":
PlaceHolder = 0
The way you wrote it is interpreted as:
if (Month == "January") or ("1"):
PlaceHolder = 0
Hopefully you will see why you got the result you obtained.
--
boB
__
obot("Jenkins")
Jenkins has been created!
py3: z = x
py3: z
<__main__.Robot object at 0x02002160>
py3: x
<__main__.Robot object at 0x02002160>
py3: del x
py3: del z
py3: del y
Jenkins has been destroyed!
py3: x
Traceback (most recent call last):
File "", line 1, in
NameError: name 'x' is not defined
py3: z
Traceback (most recent call last):
File "", line 1, in
NameError: name 'z' is not defined
py3: _
<__main__.Robot object at 0x02002160>
py3: x = 1
py3: _
<__main__.Robot object at 0x02002160>
py3: x
Tik-Tok has been destroyed!
1
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
but you can't count on it.
>
I am assuming that when the OP ran his code from a file, that upon the
script's completion, both object instances were garbage collected.
Surely upon program completion, everything _is_ garbage collected?
> I confess I don't fully understand the re
ions, then I would be DRY-er by taking this approach -- I would
need only one decorator function and could then use it decorate as
many other functions as it made sense to do so.
So some guidance, please, on what types of problems this approach is useful for?
TIA!
--
boB
_
at brings up an answer (Yet.).
TIA!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
>^
> SyntaxError: invalid syntax
I gather from this example that "/" is *not* a syntactical element,
but is instead meant to augment natural English explanation.
Anyway, thanks very much Steve and Ben!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Wed, Aug 2, 2017 at 1:59 AM, eryk sun wrote:
> On Wed, Aug 2, 2017 at 1:06 AM, boB Stepp wrote:
>> A quick scan of some of my Python books does not turn up the use of
>> "/" as a function argument. I have a nagging feeling I've read about
>> this somewhe
t looking.
If this does not help then you need to resend your message with your
full code and full traceback unless someone else has better oracle
abilities... ~(:>))
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
lt;' not supported between instances of 'str' and 'int'
I am running Python 3.6.1 on Windows 7 64-bit. Off-list Howard told
me that he is running Python 3.5 on Windo
ion will handle that for us. Also, with the print function
if items to be printed are listed as separate arguments, that is,
separated by commas, the default behavior of print is to insert a
single space in the place of each comma.
Inside your while loop you could use &quo
ge as such a person
probably does not need a lot of repetitive examples. I might do a
more detailed review later once I finish the book to see if my initial
impression holds up. But so far I wish it were the first Python book
I ever picked up!
--
boB
___
Curses! I screwed up my later insertion. I should have written in my footnote:
On Sun, Aug 6, 2017 at 3:20 PM, boB Stepp wrote:
> [1] An exception is "Beginning Python -- From Novice to Professional,
> 3rd ed." by Magnus Lie Hetland, c. 2017. I recently acquired this
> b
instance
objects)." So what I am understanding is that I only need use the
@staticmethod decorator if I am using Python versions 2.4 through 2.7
(new-style classes). Is my understanding correct?
TIA!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
I feel like I have gazed into a crystal clear pool, apparently
shallow, with many interesting objects (Pun intended!) on the pool
floor. Interested in these beautiful things, I jump in to grab one
for close-up study only to find that the pool is much, ... , much
deeper (> 1 boB-height) than
py3: s = 'Hello!'
py3: len(s.encode("UTF-8"))
6
py3: len(s.encode("UTF-16"))
14
py3: len(s.encode("UTF-32"))
28
How is len() getting these values? And I am sure it will turn out not
to be a coincidence that 2 * (6 + 1) = 14
On Mon, Aug 7, 2017 at 10:01 PM, Ben Finney wrote:
> boB Stepp writes:
>
>> How is len() getting these values?
>
> By asking the objects themselves to report their length. You are
> creating different objects with different content::
>
> >>> s = 'H
look up the appropriate code points to type it here!) filled in
technical points that Ned alluded to, but did not explicitly cover.
The two together complemented each other nicely.
I was only vaguely aware of the Python 2 surprises until these two
videos
On Mon, Aug 7, 2017 at 10:20 PM, Cameron Simpson wrote:
> On 07Aug2017 21:44, boB Stepp wrote:
>>
>> py3: s = 'Hello!'
>> py3: len(s.encode("UTF-8"))
>> 6
>> py3: len(s.encode("UTF-16"))
>> 14
>> py3: len(s.encode("
hich makes using a
> BOM redundant. For example, strings in the Windows registry use
> UTF-16LE, without a BOM.
Are there Windows bobby-traps that I need to watch out for because of
this? I already know that the code pages that cmd.exe uses have
caused me some grief in displaying (or not
at I have not had to consciously think in bits,
octal or hex in quite a few years. Oh, well. You were quite nice in
pointing out my grave mental lapses!
Red-faced!
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription optio
On Tue, Aug 8, 2017 at 10:17 PM, boB Stepp wrote:
> On Mon, Aug 7, 2017 at 10:01 PM, Ben Finney
> wrote:
>> boB Stepp writes:
>>
>>> How is len() getting these values?
>>
>
> It is translating the Unicode code points into bits patterned by the
>
On Tue, Aug 8, 2017 at 2:39 AM, Alan Gauld via Tutor wrote:
> On 08/08/17 02:22, boB Stepp wrote:
[snip lots of good stuff]
I am coming to the conclusion I need to code a substantial,
challenging project using OOP techniques, instead of just the toy
programs I have been playing around with
both RAM and files? No funny business anywhere? Except
perhaps in my Windows 7 cmd.exe and PowerShell, but that's not
Python's fault. Which makes me wonder, what is my editor's default
encoding/decoding? I will have to investigate!
Cheers!
--
boB
On Thu, Aug 10, 2017 at 8:40 PM, boB Stepp wrote:
> On Thu, Aug 10, 2017 at 8:01 AM, Steven D'Aprano wrote:
>> Python 3 makes Unicode about as easy as it can get. To include a unicode
>> string in your source code, you just need to ensure your editor saves
>> the file
===
Instead of doc strings in the test code, I have used comments based on
something I read online. The point of doing this was so the doc
strings would _not_ show up in the test run output. Is this
worthwhile advice to follow?
I'm looking forwar
It is rather late here, so I won't get to the links until much later
today, but ...
On Sun, Aug 13, 2017 at 1:42 AM, Steven D'Aprano wrote:
> I haven't had a chance to read the entire post in detail, but one thing
> which stands out:
>
> On Sun, Aug 13, 2017 at 12:22:
Based upon the feedback thus far (Many thanks!) I think that perhaps I
should expand on my design thoughts as I have already stubbed my big
toe at the very start!
On Sun, Aug 13, 2017 at 12:22 AM, boB Stepp wrote:
> The intent of this project is more than just calculate chess rati
On Sun, Aug 13, 2017 at 3:52 AM, Peter Otten <__pete...@web.de> wrote:
> boB Stepp wrote:
>> I am only at the very beginning of coding this class. I have not
>> added any methods yet. Currently I am adding class constants that
>> will be used in this class' m
On Sun, Aug 13, 2017 at 5:49 PM, Alan Gauld via Tutor wrote:
> On 13/08/17 21:15, boB Stepp wrote:
>
> I return to the point I made about focusing on the
> objects not the functionality.
>
>> It is not very well-written in my opinion. But anyway ... The basic formula
&g
e trickiest,
> but most common, bits of OOP - object persistence...
Would you expand on this in SQLite terms?
> You might even find yourself writing some class methods! ;-)
Nah. I might expand my array of constants, and test a few more ... ~(:>))
--
boB
___
in the terminal window. The other is are
you sure that your program is running with the version of Python you
think it is? If you installed a later version of Python 2 yourself
you may in fact be running an older version of Python 2 with your
program, the one sup
On Fri, Aug 18, 2017 at 9:56 PM, Steven D'Aprano wrote:
> Mostly for Bob, but also for anyone else interested:
I guess I'm the "Bob" being referred to.
> When To Use Classes
>
> http://kentsjohnson.com/stories/00014.html
>
>
> He says:
>
> Y
On Sat, Aug 19, 2017 at 3:07 AM, Alan Gauld via Tutor wrote:
> On 19/08/17 08:52, Alan Gauld via Tutor wrote:
>
> Following up my own post - a sure sign of failure to communicate :-(
>
>> On 19/08/17 05:26, boB Stepp wrote:
>>
>>> related methods needs to share
On Sat, Aug 19, 2017 at 4:04 AM, Peter Otten <__pete...@web.de> wrote:
> Steven D'Aprano wrote:
>
>> Mostly for Bob, but also for anyone else interested:
>>
>> When To Use Classes
>>
>> http://kentsjohnson.com/stories/00014.html
>
> Just a min
e which maximizes code reuse instead of thinking in terms
of classic specialization. And the children are in charge, not the
parents! Interesting stuff!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
et the '-m' to be used? And is
there an easier way to accomplish my objective?
If I cannot work this out, then I will be forced to do:
py2> import os
py2> current_usr = os.popen('who -m')
This should not be a security issue for me as no user input is
involved. But I woul
On Fri, Aug 25, 2017 at 8:33 PM, Steven D'Aprano wrote:
> On Fri, Aug 25, 2017 at 07:13:12PM -0500, boB Stepp wrote:
>
>> My objective: Determine who the currently logged in user is
>
> py> import os
> py> os.getlogin()
> 'steve'
Sweet! Much b
1801 - 1900 of 2074 matches
Mail list logo