The Python standard library module datetime seems to be what you want.
It has objects representing date/times, and deltatimes (i.e.,
durations). These can be timezone aware or not as you wish.
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
On 3/27/23 6:00 AM
instead of -=.
Isn't it unpythonic to be able to make a mistake like that?
Regards,
Morten
These all mean the same thing, but I don't see a good way to designate
the second or third as an error.
x = -5
x=-5
x =- 5
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of
requirement of
needing to change '.' to '@'.
Alternatively is there an RE 'match' function that would test if
linux-r...@vger.kernel.org matches linux-raid.vger.kernel.org? I don't
really care if the '.' are all regarded as wild cards, the match will
uot; % eachPay)
I am aiming for the result of 43.6, but somehow get the result of 44.44.
(meal cost: 200) (Tip: 9) (people: 5)
I seem to do the calculation below, but get different results each time.
Total * Percentage Amount / 100
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Ins
2156 Koyukuk Drive
Fairbanks AK 99775-7320
Work: 907-474-5172
cell: 907-328-9145
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
it's still
available for download.
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
ou destroy the it so
carefully stored in Grade.ID.
So now the real question is: What were you trying to accomplish with
the assignment? Tell us, and let's see if we can find a way to
accomplish yor goal without wrecking the internals of the Grade class.
Gary Herron
it has impact on
suits?
Sent from Mail for Windows 10
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
t((UL1)/(10**(count-1:
B12
B1=(B11,"-",B12,"M")
B1
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
We're not here to do your
homework for you, and you won't learn anything if we do. You make an
attempt at solving this, asking any specific Python related questions
you need help with, and you'll find this to be prompt, friendly, and
helpful group.
Gary Herron
--
Dr. Gary
You appear to have a local file named keyword.py which is hiding a
python installation file of the same name.
Gary Herron
On 09/17/2018 01:06 AM, jupiter@gmail.com wrote:
I have following errors running on Ubuntu 18, any insight how to fix it? Thank
you.
Python 2.7.15rc1 (default
lendshape, what's an input target weight, what does it mean
to connect them? Either none of that is important (as is the case in
this simple indentation error), so don't include such distractions, or
it does matter, so take the time to define those terms.
Gary Herron
On
make a table. But its giving me zeros or
333. And to get 5digits after the zero i wanted to use "%.5f " %First.
Could you help me to finish this, and tell me what am I doing wrong?
Thank you
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895
table. But its giving me zeros or
333. And to get 5digits after the zero i wanted to use "%.5f " %First.
Could you help me to finish this, and tell me what am I doing wrong?
Thank you
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895
_fit(test_func, x_data, y_data,
p0=[2, 2])
print(params)
plt.figure(figsize=(6, 4))
plt.scatter(x_data, y_data, label='Data')
plt.plot(x_data, test_func(x_data, params[0], params[1]),
label='Fitted function')
plt.legend(loc='best
the "any + context" at line
18. The "any" was passed as an integer from line 43 and the "context"
was defined as a tuple at line 35. This concatenation works! how?
Best Regards,
Jach Fong
---
This email has been checked for viruses by Avast antivirus softwa
second columns alone for x
and y respectively.
I am confused as to how data[:10] gives the first 10 rows while data[:,0] gives
all rows
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
This is a well known feature of Python. It's a very common "gotcha" to
new Python programmers.
Google "Mutable default parameters in Python" for long list of
explanations and fixes.
In short, don't use a mutable object as a default parameter.
Gary Herron
e:
>>>
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--foo', action='append')
>>> parser.parse_args('--foo 1 --foo 2'.split())
Namespace(foo=['1', '2'])
I hope that helps.
--
Dr. Gary Herr
know what that means? The answer you might
have expected (i.e. 260) does not fit in the 0 ... 255 range of 8 bits,
and so the result has overflowed and "wrapped around" to produce 4.
Try this for a simpler example of the same:
>>> np.uint8(260)
4
Gary Herron
--
Dr. Gary
if data is None: ...
and I get output of
None
None
{'MeetingDate': '2017-01- ... and so on.
How can I actually get this to check?
If i use type(data) I also get None.
Cheers
Sayth
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
I have searched for a solution to this but have not found a suitable
example.
The attached code generates this error: Traceback (most recent call last):
File "calcsignal.py", line 7, in
siglevfromexist = 34.8 + existattn
TypeError: unsupported operand type(s) for +: 'float' and 'list'
Ho
iate to ask here for help
in translating it into a Python program.
Gary Herron
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
.
Welcome to python-list. If you ask a Python question, it will probably
get answered. If you want someone to do your homework, it will probably
not happen.
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman
installed
packages, and my own work. I would strongly resist anything that needs
that much re-installation and personal attention.
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
manual for opencv, we see that cv2.rectangle does indeed
return None:
Python: cv.Rectangle(img, pt1, pt2, color, thickness=1,
lineType=8, shift=0) → None
So the first pass through your loop does indeed set im to None with the line
im = cv2.rectangle(im.copy(), (x,y), (x+w,
e guesswork: if cv2.rectangle draws a rectangle, what does it
return? If it doesn't return anything, the line
im = cv2.rectangle(...)
is how im gets the value of None.
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
libraries
Just for what its worth.
Do you really need anything more complex than this?
>>> toRadians = math.pi/180.0
>>> math.sin(90*toRadians)
1.0
Perhaps I'm not understanding what you mean by "clunky", but this seems
pretty clean and simple to me.
Gary H
I have to go out for a while, so for DED processing two options from
my end:
1. Process as you all have been in the past for now. If you all do
this, the records that have not been mailed prior to the latest list
are contained in a MailManage Job name DED_master. If you chose to
process as in th
, 6]
In this next example, there are two separate lists:
>>> list1 = [1,2,3]
>>> list2 = [1,2,3]
>>> list1 += [4,5,6]
>>> print(list1, list2)
[1, 2, 3, 4, 5, 6] [1, 2, 3]
Does that help?
Gary Herron
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
", "credits" or "license" for more information.
>>> 2 ** 3 ** 2
512
>>> 2 ** (3 ** 2)
512
>>> (2 ** 3) ** 2
64
>>>
Here's the relevant documentation page:
https://docs.python.org/3/reference/expressions.html
Look for "... except
esult will be essentially the same as if all three methods were
defined in MainCLass.
Gary Herron
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
My primary use case is when I create a "Model" class to reflect an entire SQL
database.
Label(win, image=img).pack()
return img
saved_img = load_img(win)
...
Gary Herron
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
my original
answer (that it's the constructor), and suggest ignoring the overly
pedantic (and confusing) response to the contrary.
--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
_ method is the constructor for instances of a class. It
is not required, but the situations in which a constructor is not
needed are few and unusual.
If you don't know object-oriented-programming, then I'd suggest you put
that high on your list of things to learn. It's a valuab
cond time, the iterator is exhausted and returns no objects.
A simpler example: "b" is a map object (iterator), then list(b) is run
twice.
>>> a = [1,2,3]
>>> b = map(lambda e: e+1, a)
>>> b
>>> list(b)
[2, 3, 4]
>>> list(b)
[]
I h
8, 10, 11, 13, 14, 16, 17, 19]
Gary Herron
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
whoever
wrote it into converting it to Python3.
Or my guess is completely wrong and the code is buggy and won't run
until fixed. (Which brings up the questions: What is cppdep.py? Who
wrote it? How do you know that it runs?)
Gary H
format(self.a, self.b) # Modify to suit
your needs.
...
>>> print(C(1,2))
C(a=1, b=2)
>>>
Gary Herron
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
reverse order:
for datum in reversed(data):
... whatever with datum ...
which wastes no time actually reversing the list, but simply loops
through them back to front.
Gary Herron
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
On 02/13/2016 12:27 PM, Tom P wrote:
On 02/13/2016 07:13 PM, Gary Herron wrote:
On 02/13/2016 09:58 AM, Tom P wrote:
I am writing a program that has to deal with various date/time formats
and convert these into timestamps. It looks as if
dateutil.parser.parse should be able to handle about any
ons are used to
separate :MM:DD. Is there a way to include this as a valid format?
Yes, there is a way to specify your own format. Search the datetime
documentation for
datetime.strptime(date_string, format)
Gary Herron
--
Dr. Gary Herron
Department of Computer Science
DigiPen Ins
xpression. Also, it's a bad idea to use eval like
this, and it's a *really* bad idea to use eval with user supplied
input. The user could inject *any* malicious code.
Instead, use the importlib module to programmatically import a module.
Gary Herron
--
Dr. Gary Herron
Department o
g or how do I remove the duplicate list.
Gary R.
--
https://mail.python.org/mailman/listinfo/python-list
't see string should be replaced by something else.
Could you tell me why I have such an error?
You are trying to use the *string* module without importing it, I'd guess.
Try:
import string
first then you should be able to access string.join without error.
Gary Herron
Thanks,
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
print(words)
...
['a', 'b', 'c']
['aa', 'bb', 'cc']
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
) lines to print(...) (without the colon) and
try again. If there is further trouble, ask another question, but
please cut and paste the actual and *exact* results into the email.
Gary Herron
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
n.py loads the bin, include and lib directories into the
project instead of the normal django setup.
django 1.8
Debian 8 (jessie) OS
python 3.4
Any help will be sincerely appreciated.
Gary R.
--
https://mail.python.org/mailman/listinfo/python-list
Laura,
Thanks for the pointer to PyXB, I think this will work for my purposes and it
appears to be Python 3.4 / Windows compatible.
Thank you to all who helped.
On Friday, October 9, 2015 at 1:14:32 PM UTC-5, Laura Creighton wrote:
> In a message of Fri, 09 Oct 2015 10:24:34 -0700, G
s the trick? if not any pointers on what I can do to get it to go. Are
there any other xmi parsers or tools?
Thanks
Gary
Error output below --
>python setup.py install
running install
running bdist_egg
running egg_info
writing entry points to xmiparser.egg-info\entry_points.txt
On 09/09/2015 01:45 PM, John Gordon wrote:
In Gary Roach
writes:
Traceback (most recent call last):
File "/root/mystuff/mystuff/ex39_test.py", line 6, in
hashmap.set(states, 'Oregon', 'OR')
File "/root/mystuff/mystuff/hashmap.py", line
On 09/09/2015 01:45 PM, John Gordon wrote:
In Gary Roach
writes:
Traceback (most recent call last):
File "/root/mystuff/mystuff/ex39_test.py", line 6, in
hashmap.set(states, 'Oregon', 'OR')
File "/root/mystuff/mystuff/hashmap.py", line
On 09/09/2015 01:45 PM, John Gordon wrote:
In Gary Roach
writes:
Traceback (most recent call last):
File "/root/mystuff/mystuff/ex39_test.py", line 6, in
hashmap.set(states, 'Oregon', 'OR')
File "/root/mystuff/mystuff/hashmap.py", line
):
"""Deletes the given key from the Map."""
bucket = get_bucket(aMap, key)
for i in xrange(len(bucket)):
k, v = bucket[i]
if key == k:
del bucket[i]
break
def list(aMap):
"""Prints out what's in the Map."""
for bucket in aMap:
if bucket:
for k, v in bucket:
print k, v
Very frustrating and probably a stupid error. Any help will be sincerely
appreciated.
Gary R.
--
https://mail.python.org/mailman/listinfo/python-list
use to be a whiz at
fortran, C and Xbase but haven't done anything since I retired.
Good luck
Gary R
--
https://mail.python.org/mailman/listinfo/python-list
On 07/30/2015 11:15 PM, dieter wrote:
Gary Roach writes:
Being new to Django and Python, I have two projects setup side by
side, each in it's own virtualenv wrapper.
The twr_project is running Django 1.7, python 2.7 and is set up to
duplicate the 'Tango With Rango' tutorial
On 07/30/2015 11:15 PM, dieter wrote:
Gary Roach writes:
Being new to Django and Python, I have two projects setup side by
side, each in it's own virtualenv wrapper.
The twr_project is running Django 1.7, python 2.7 and is set up to
duplicate the 'Tango With Rango' tutorial
ex.html (Django
1.7) and home.html (Django 1.8) is the name changes.
I have inserted print statements in the url tree to try debugging this
but all the path information returned seems reasonable.
Is this a bug in Ninja-IDE, Django 1.8 or is it something else.
If you need more information, pl
On 07/22/2015 04:44 PM, Chris Angelico wrote:
On Thu, Jul 23, 2015 at 9:35 AM, Gary Roach wrote:
At this point, I'm confused about a few things. Does the postgresql server
and my archivedb reside globally or are they inside my archivedb virtual
environment. I think globally.
Your vi
On 07/16/2015 04:53 PM, Chris Angelico wrote:
On Fri, Jul 17, 2015 at 9:34 AM, Gary Roach wrote:
On 07/15/2015 11:25 AM, Chris Angelico wrote:
You should then be able to create a regular user, and grant
appropriate permissions:
postgres=# create user archives password
'traded-
On 07/16/2015 04:53 PM, Chris Angelico wrote:
On Fri, Jul 17, 2015 at 9:34 AM, Gary Roach wrote:
On 07/15/2015 11:25 AM, Chris Angelico wrote:
You should then be able to create a regular user, and grant
appropriate permissions:
postgres=# create user archives password
'traded-
On 07/18/2015 04:36 PM, Terry Reedy wrote:
I would like more viewpoints from 2.7 users.
I read that (incorrectly of course) and just had to ask:
How do you intend to extract a viewpoint from that last 7/10 of a user?
With apologies,
Gary Herron
--
Dr. Gary Herron
Department of
On 07/15/2015 11:25 AM, Chris Angelico wrote:
On Thu, Jul 16, 2015 at 3:13 AM, Gary Roach wrote:
Every time I try to do a python manage.py migrate I get:
django.db.utils.OperationalError: FATAL: password
authentication failed for user "postgres"
FATAL: password authentication faile
a postgres account in postgres
or is Django supposed to do this with the migrate command. I feel like
I am at a critical point where I can really screw things up and need
some expert advise. This is my first time working with python / Django
and am really shaky. I do have another learning project (rango) using
SQLite that works fine.
Gary R
--
https://mail.python.org/mailman/listinfo/python-list
t same name:
>>> _ = 123
>>> print(_)
123
>>>
Gary Herron
--
https://mail.python.org/mailman/listinfo/python-list
person['name'] = 'jose'
person['age'] = 12
people.append(person)
Here's where you need to create the second one.
person['name'] = 'kacey'
person['age'] = 18
people.append(person)
for person in people:
print( person[
On 06/05/2015 06:39 AM, Todd wrote:
On Fri, Jun 5, 2015 at 3:23 PM, Gary Herron
<mailto:gary.her...@islandtraining.com>> wrote:
On 06/05/2015 06:11 AM, Paul Appleby wrote:
On Fri, 05 Jun 2015 14:55:11 +0200, Todd wrote:
Numpy arrays are not lists, they
ort numpy
>>> a = numpy.array([1,2,3])
>>> id(a[1])
28392768
>>> id(a[1])
28409872
This produces two different view of the same underlying object.
Gary Herron
--
https://mail.python.org/mailman/listinfo/python-list
I have no idea
what "inverse" has to do with anything), but I won't waste my time doing
so. If you take the time to carefully explain what you want, then I'm
sure you will find plenty of people here who will take the time to
answer you.
Gary Herron
--
https://mail.python.org/mailman/listinfo/python-list
-
Traceback (most recent call last):
File "./readfile1.py", line 19, in
t=thread.start_new_thread(proc(f),())
TypeError: first arg must be callable
You should probably also consider using the higher-level threading
module rather than the lower level thread module.
(Also consider us
se (Tkinter and the curses module) are distributed with
Python, so you should already have them installed.
Gary Herron
Other suggestions seemed to be overkill and confused me to due to my
beginner level knowledge and the fact these suggestions have other, more
complicated elements to them.
se (Tkinter and the curses module) are distributed with
Python, so you should already have them installed.
Gary Herron
Other suggestions seemed to be overkill and confused me to due to my
beginner level knowledge and the fact these suggestions have other, more
complicated elements to them.
>>> sorted(d.values())
[123, 456]
or the key/value tuples (called items)
>>> sorted(d.items())
[('a', 123), ('b', 456)]
but each of those attempts to sort could fail on a general dictionary if
the individual keys or values are not sortable.
Ther
o line you have above). Then it will be defined, and calling
parlindrome('...')
will produce a result rather than an error.
Gary Herron
a
'1234_'
parlindrome(a)
Traceback (most recent call last):
File "", line 1, in
parlindrome(a)
NameError: nam
gt;>> __builtins__.open = "whatever"
>>>
Python3:
>>> import builtins
>>> builtins.open = "whatever"
>>>
Of course doing so is like shooting yourself in the foot: Any
subsequent pain is your own fault and probably well deserved.
G
On 05/26/2015 05:43 PM, richard_riehle wrote:
I realized that I mentioned earlier that I found a solution to my original
question, but that I never posted an example of the solution. So, here is a
simplified example for anyone who is interested.
def fArray(fselect, fparm = 1):
def A
ll, but gives an exact
zero instead.
0.0
The squaring of the two values in x*x+y*y just makes the addition even
more error prone since the squares make large values even larger and
small values even smaller.
Gary Herron.
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Tec
on?
This is a statement about floating point numeric calculations on a
computer,. As such, it does apply to Python which uses the underlying
hardware for floating point calculations.
Validity is another matter. Where did you find the quote?
Gary Herron
Any other thoughts? :D
My imagini
re likely that that file is correct, and you are
somehow misinterpreting its contents, but we can't even begin to guess
until you show us its current content.
Gary
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
m the dot operators from left to right or according
to a rule of order (i.e., multiplication/division before add/subtract)?
Yes, that's correct.
Gary Herron
Thank you,
Chris Reimer
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
ith your workaround, since the assignment to stdout is
preserved when done outside the function.
I hope that helps.
Gary Herron
if opath is None:
for line in stdout.splitlines():
yield line.strip()
else:
with open(opath) as f:
for line in f:
quot;
argument should drive *all* decisions is foolish. And disingenuous.
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
ing to define a concept called "keywords", I don't
think you should allow them to be shadowed by a class definition.
Mark
Huh? Python has plenty of keywords, and indeed, none of them can be
redefined or shadowed.But you would gain nothing (and lose a bit or
dynamic-language
t's still available as __builtins__.int (unless you've also
overridden that).
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
text = webpage.read().decode("utf8")
except URLError as err:
print("URLError: " + str(err))
How do I wrap urllib.request with try/except?
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
9))
>>> l
range(0, 100000)
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
On 04/26/2015 11:07 AM, Cecil Westerhof wrote:
Op Sunday 26 Apr 2015 19:12 CEST schreef Gary Herron:
On 04/26/2015 09:32 AM, Cecil Westerhof wrote:
Op Sunday 26 Apr 2015 17:09 CEST schreef Steven D'Aprano:
On Sun, 26 Apr 2015 11:02 pm, Cecil Westerhof wrote:
I want to use a GUI for P
rthy GUI programming libraries, and each of them is cross
platform (as I required to develop on Linux, but deploy occasionally on
Windows).
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
On 04/15/2015 02:51 PM, Chris Withers wrote:
Hi All,
I'm pleased to announce the release of xlwt 1.0.0.
What a curiously incomplete announcement. Could you tell us what xlwt
is? I see no hint here.
Gary Herron
This release contains the following:
- Python 3 support.
- An in
img = Image.new('1', (1024, 1280), 1)
>>> imagedata = list(img.getdata())
>>> print len(imagedata)
1310720
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
dition:
def cond1(i,j,a,b):
return i+j>4
and do
test1(..., cond1)
and
if condition(i,j,a,b):
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
...but I want numerically 5 hours later, because of
Daylight Savings Time')
main()
Thanks!
The pyzt module (which you've imported) has lots to say about this. Look
at its procedures "localize' and 'normalize' and all the rest of the
pyzt documentation.
--
Dr.
ntax for prints.
Python2: print line # This is a statement
Python3 print(line) # This is a procedure call
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
tegers. You can experiment with the cutoff on your
particular flavor of Python. On mine (Python 3.4.2 (default, Oct 8
2014, 13:08:17) ;[GCC 4.9.1] on linux)
it's somewhere between 200 and 300:
>>> 201 is 1+200
True
>>> 301 is 1+300
False
Gary Herron
--
Dr. Gary
r[0] = 123
>>> b
array([[123, 1],
[ 2, 2],
[ 3, 3]])
but the Python/numpy objects that wrap portions of that underlying array
of ints are all distinct.
Gary Herron
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
is achieved by doing nothing!
Brian
That's *not* "doing nothing". And it's not even really "delegation".
It's just sub-classing Fraction to add one new method and inherit all
other methods.
Gary Herron
--
Dr. Gary Herron
Department of Computer Scie
ch Fraction
>>>
>>> Fraction(1,2).is_integer()
False
>>> Fraction(2,1).is_integer()
True
Gary Herron
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
ograms in Idle -- A reasonable GUI
environment to experiment with Python. It came with your
installation of Python.
* In the future, questions should be accompanied with information
about your version of Python (Python2 or Python3) and the platform
you are running it on. (Apparently Windo
's way of returning a 1-byte string when indexing a string
(instead of returning an element of type character) allows this
surprising result.
>>> 'abc'[0]
'a'
>>> 'abc'[0][0]
'a'
>>> 'abc'[0][0][0]
'a'
&
m getting this (and so on) :
Traceback (most recent call last):
File "", line 1, in
abs._doc_()
AttributeError: 'builtin_function_or_method' object has no attribute
'_doc_'
What did I do wrong ? Thanks for help, Marcus Luetolf, M.D., 90
Bondastreet, CH-7000 Chur, Switzerland.
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
1 - 100 of 1014 matches
Mail list logo