Re: Standard class for time *period*?

2023-03-27 Thread Gary Herron
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

Re: =- and -= snag

2023-03-13 Thread Gary Herron
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 Technology -- https

[issue44429] Tkinter Flow Geometry Manager

2021-07-23 Thread Gary Davenport
Gary Davenport added the comment: Just an update on this issue. I did make 2 packages available on pypi.org: https://pypi.org/project/flowframe/ and https://pypi.org/project/tkinterflow/ Thank you very much for your help. -- resolution: -> works for me stage: -> re

[issue44429] Tkinter Flow Geometry Manager

2021-06-16 Thread Gary Davenport
Gary Davenport added the comment: Thank you so much for the kind words and help in giving me some direction with these projects. I am relatively new to Python, object oriented programming and open source collaboration. I think the 3rd party module probably makes the most sense, because

[issue44429] Tkinter Flow Geometry Manager

2021-06-15 Thread Gary Davenport
New submission from Gary Davenport : Hi there. I love Python and Tkinter. I know that there are geometry managers pack, place, and grid. I think there should be a flow type management available, like what is done in Java or html/css. This is more important as responsive GUI design

Re: Change first occurrence of character x in a string - how?

2021-02-14 Thread Gary Herron
ively 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 be accurate enough. -- Dr. Gary Herron Professor of Computer Science DigiPen Institute of Technolo

[issue43151] is with literals in 3.8 release

2021-02-07 Thread Gary Litvin
Gary Litvin added the comment: I noticed it in IDLE 3.8. I installed 3.8 because it is a fairly recent release described as "stable." Thanks to everyone for considering this. At 03:41 AM 2/7/2021, you wrote: >Dennis Sweeney added the comment: > >I think the strangeness i

[issue43151] is with literals in 3.8 release

2021-02-06 Thread Gary Litvin
Gary Litvin added the comment: Thank you for your responses. I understand the difference between == and "is" and the intentional change in 3.8. My question is about what seems to be inconsistent treatment in x is 'a' and if a is 'a': ... At 12:49 AM 2/7/2021, Raymond Hetti

[issue43151] is with literals in 3.8 release

2021-02-06 Thread Gary Litvin
New submission from Gary Litvin : >>> x = 'a' >>> x is 'a' True >>> if x is 'a': print(x) SyntaxError: "is" with a literal. Did you mean "=="? How come? -- messages: 386575 nosy: garylitvin priority: normal severity: normal stat

Re: Calculations and Variables

2019-10-31 Thread Gary Herron
% 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 Institut

[issue37651] Change of inheritance of asyncio.CancelledError needs documentation

2019-07-22 Thread Gary van der Merwe
New submission from Gary van der Merwe : asyncio.CancelledError inheritance was changed in 3.8. https://bugs.python.org/issue32528 https://github.com/python/cpython/commit/431b540bf79f0982559b1b0e420b1b085f667bb7 The documentation still instructs the user to perform a pattern needed before

Re: Multiprocessing and memory management

2019-07-03 Thread Gary Herron
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

[issue37118] Why is GIL on 2.7 so much faster than 3.7

2019-05-31 Thread gary*atlanta
gary*atlanta added the comment: tested this loop: for (i=0; i performance ___ Python tracker <https://bugs.python.org/issue37118> ___ ___ Python-bugs-list mailin

[issue37118] Why is GIL on 2.7 so much faster than 3.7

2019-05-31 Thread gary*atlanta
Change by gary*atlanta : -- components: Interpreter Core nosy: gary*atlanta priority: normal severity: normal status: open title: Why is GIL on 2.7 so much faster than 3.7 versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue37

Re: CAD Application

2019-05-06 Thread Gary Herron
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

[issue33935] shutil.copyfile throws incorrect SameFileError on Google Drive File Stream

2019-02-17 Thread gary ruben
gary ruben added the comment: I wanted to add a datapoint to this. I also experience this problem in Windows but not with Google Drive File Stream. In my case it is also being triggered by Jupyter, which was where Deniz first noticed it, but I was saving the notebook to my Z: drive, which

[ANN] - Skyline v1.2.8-stable-luminosity

2018-10-18 Thread Gary Wilson
earthgecko-skyline.readthedocs.io/en/latest/index.html With the hope Skyline can make the universe a bit less anomalous. Regards Gary -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/

Re: namedtuples anamoly

2018-10-18 Thread Gary Herron
arefully 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 all variables. Is this behavio

Re: Advice on law firm

2018-10-18 Thread Gary Herron
? 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

Re: My python code has suddenly started to give me error. Please see code below**

2018-10-09 Thread Gary Herron
1)/(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

Re: Program to find Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.

2018-10-02 Thread Gary Herron
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 Herron Professor

Re: import inspect error

2018-09-17 Thread Gary Herron
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

Re: trying to connect the setarrange and blendshape input target weight while running the script am getting error in the 8th line. (for each in lip_val_list: )

2018-09-13 Thread Gary Herron
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 09/13/2018 12:11 AM, christyso

Re: Python Probability

2018-09-11 Thread Gary Herron
d 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

Re: Python Probability

2018-09-11 Thread Gary Herron
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

[issue34593] Missing inttypes.h

2018-09-05 Thread Gary Simpson
New submission from Gary Simpson : I started with Anaconda3 (python3.64). When I add #include "python.h" to my C++ code, I get the visual studio 2012 compile error: anaconda3\include\pyport.h(6): fatal error C1083: Cannot open include file: 'inttypes.h': No such file or di

[ANN] - Skyline v1.2.5-stable-luminosity

2018-08-28 Thread Gary Wilson
ion -> https://earthgecko-skyline.readthedocs.io/en/latest/index.html With the hope Skyline can make the universe a bit less anomalous. Regards Gary -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.o

[ANN] - Skyline v1.2.4-stable-luminosity

2018-07-25 Thread Gary Wilson
ion -> https://earthgecko-skyline.readthedocs.io/en/latest/index.html With the hope Skyline can make the universe a bit less anomalous. Regards Gary -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.o

[ANN] - Skyline v1.2.2-stable-luminosity

2018-07-18 Thread Gary Wilson
cs.io/en/latest/index.html With the hope Skyline can make the universe a bit less anomalous. Regards Gary -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/

Re: curve_fit in scipy

2018-06-19 Thread Gary Herron
ta, 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') plt.show() -- Dr. Gary Herron Professor o

Re: How can an int be '+' with a tuple?

2018-06-02 Thread Gary Herron
"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 software

Re: Numpy array

2018-05-20 Thread Gary Herron
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

Re: Weird side effect of default parameter

2018-05-03 Thread Gary Herron
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 On 05/03/2

Re: specifying the same argument multiple times with argparse

2018-04-16 Thread Gary Herron
rse.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 Herron Professor of Computer Science DigiPen Institute of Technology (425) 895-4418 -- https://mai

Re: Please Help

2018-01-26 Thread Gary Herron
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. Ga

Re: None is None but not working

2017-09-27 Thread Gary Herron
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

How to change variable from list to float

2017-06-05 Thread Gary Barker
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'

Re: getting the center of mass of each part of a molecule

2017-05-15 Thread Gary Herron
e 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

Re: Write a function group(L).

2017-04-21 Thread Gary Herron
. 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

[issue22962] ipaddress: Add optional prefixlen argument to ip_interface and ip_network

2017-03-26 Thread Gary van der Merwe
Gary van der Merwe added the comment: Indeed. Thanks to whoever fixed this. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

Re: Who are the "spacists"?

2017-03-18 Thread Gary Herron
ter of fact, and despite the snark, that is true. A quick count finds 46,209 .py files on my computer, spread across the OS, 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 Scien

[issue29161] random.SystemRandom(seed) documentation issue

2017-01-04 Thread Gary E. Miller
Gary E. Miller added the comment: > The docs are clear that System Random uses os.urandom() for creating random > numbers, that there is not state, that sequences aren't reproducible, and > that seed method has no effect and is ignored. Agreed, but not relevant. I have anecdo

[issue29161] random.SystemRandom(seed) documentation issue

2017-01-04 Thread Gary E. Miller
Gary E. Miller added the comment: Is there a better place to submit documentation problems to? After my programming team spends a lot of valuable time figuring what the Python doc failed to mention I would like this knowledge to be put to good use by others. Paying it forward if you

[issue29161] random.SystemRandom(seed) documentation issue

2017-01-04 Thread Gary E. Miller
Gary E. Miller added the comment: > > why have an ignored parameter that is not plainly documented as ignored. > Because it improves the substitutability of one RNG for another (i.e. the > same reason that we even have a seed() method). I understand why it the parameter it the

[issue29161] random.SystemRandom(seed) documentation issue

2017-01-04 Thread Gary E. Miller
Gary E. Miller added the comment: I would change: "Accordingly, the seed() method has no effect and is ignored." To: "Accordingly, the optional seed parameter and the seed() method have no effect and are ignored." It was not obvious to me that the seed paramrter go

[issue29161] random.SystemRandom(seed) documentation issue

2017-01-04 Thread Gary E. Miller
New submission from Gary E. Miller: The man page for random.SystemRandom([seed]]) fails to mention that the parameter 'seed' is never used. This should be prominent in the documentation. I have found several cases where a seed was provided to SystemRandom(). https://docs.python.org/2.7

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread Gary Herron
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, y+h), (0,255,0), 2) and the

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread Gary Herron
.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

Re: degrees and radians.

2016-08-23 Thread Gary Herron
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 Herron -- Dr. Gary

DED processing

2016-08-22 Thread Gary Sublett
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

Re: A strange list concatenation result

2016-08-11 Thread Gary Herron
, 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

Re: Operator precedence problem

2016-06-06 Thread Gary Herron
ight", "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 for

Re: Spreading a class over multiple files

2016-06-05 Thread Gary Herron
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. I wa

Re: Image loading problem

2016-05-21 Thread Gary Herron
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

Re: def __init__(self):

2016-04-26 Thread Gary Herron
l 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

Re: def __init__(self):

2016-04-26 Thread Gary Herron
t__ 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 valuable tool. Gary Herr

Re: what is the difference between one-line-operation and 2-line-operation

2016-04-25 Thread Gary Herron
: "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 hope that helps. Gary Herron -- Dr. Gary Herron Professor of Computer Science D

Re: Exclude every nth element from list?

2016-03-26 Thread Gary Herron
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

Re: PLEASE HELP -- TOTALLY NEW TO PYTHON

2016-03-26 Thread Gary Herron
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 Herron

Re: Struggeling with collections

2016-03-07 Thread Gary Herron
ds. ... >>> 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

Re: list reversal error

2016-03-03 Thread Gary Herron
rder: 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 -- https://ma

Re: problem with dateutil

2016-02-13 Thread Gary Herron
: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 Institute of Technology (425

Re: problem with dateutil

2016-02-13 Thread Gary Herron
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

Re: import cannot be used inside eval

2016-02-04 Thread Gary Herron
dea 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 of Computer Science DigiPen Institute of

Duplicate Output

2016-01-27 Thread Gary Roach
o I remove the duplicate list. Gary R. -- https://mail.python.org/mailman/listinfo/python-list

[issue26175] Fully implement IOBase abstract on SpooledTemporaryFile

2016-01-21 Thread Gary Fernie
New submission from Gary Fernie: SpooledTemporaryFile does not fully satisfy the abstract for IOBase. Namely, `seekable`, `readable`, and `writable` are missing. This was discovered when seeking a SpooledTemporaryFile-backed lzma file. You may quickly repro this: `lzma.open(SpooledTemporaryFile

Re: 'string.join' is wrong in my Python console

2015-12-03 Thread Gary Herron
t, 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

Re: reading from a txt file

2015-11-26 Thread Gary Herron
', '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

Re: Why won't this run?

2015-11-16 Thread Gary Herron
) (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

Pyvenv use

2015-10-15 Thread Gary Roach
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

Re: Errors installing xmiparser with Python 3.4 and windows - any help?

2015-10-10 Thread Gary Hanyzewski
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

Errors installing xmiparser with Python 3.4 and windows - any help?

2015-10-09 Thread Gary Hanyzewski
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 writ

Re: Lesson 39 of Learning Python the Hard Way hangs (Fixed?)

2015-09-09 Thread Gary Roach
On 09/09/2015 01:45 PM, John Gordon wrote: In <mailman.280.1441823265.8327.python-l...@python.org> Gary Roach <gary719_li...@verizon.net> writes: Traceback (most recent call last): File "/root/mystuff/mystuff/ex39_test.py", line 6, in hashmap.set(states, 'O

Re: Lesson 39 of Learning Python the Hard Way hangs (Fixed?)

2015-09-09 Thread Gary Roach
On 09/09/2015 01:45 PM, John Gordon wrote: In <mailman.280.1441823265.8327.python-l...@python.org> Gary Roach <gary719_li...@verizon.net> writes: Traceback (most recent call last): File "/root/mystuff/mystuff/ex39_test.py", line 6, in hashmap.set(states, 'O

Re: Lesson 39 of Learning Python the Hard Way hangs

2015-09-09 Thread Gary Roach
On 09/09/2015 01:45 PM, John Gordon wrote: In <mailman.280.1441823265.8327.python-l...@python.org> Gary Roach <gary719_li...@verizon.net> writes: Traceback (most recent call last): File "/root/mystuff/mystuff/ex39_test.py", line 6, in hashmap.set(states, 'O

Lesson 39 of Learning Python the Hard Way hangs

2015-09-09 Thread Gary Roach
cket = 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

Re: Is Django the way to go for a newbie?

2015-08-09 Thread Gary Roach
and Xbase but haven't done anything since I retired. Good luck Gary R -- https://mail.python.org/mailman/listinfo/python-list

Re: Improper Django Project error (solved)

2015-08-01 Thread Gary Roach
On 07/30/2015 11:15 PM, dieter wrote: Gary Roach gary719_li...@verizon.net 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

Re: Improper Django Project error (solved)

2015-07-31 Thread Gary Roach
On 07/30/2015 11:15 PM, dieter wrote: Gary Roach gary719_li...@verizon.net 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

Improper Django Project error

2015-07-30 Thread Gary Roach
) 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, please let me know Gary R

[issue24739] allow argparse.FileType to accept newline argument

2015-07-27 Thread Gary Peck
New submission from Gary Peck: argparse.FileType should support a newline argument that corresponds to the newline parameter to open(). In addition to more closely mirroring the open() API, this is also needed to properly use argparse.FileType with csv.reader() or csv.writer() (which require

Re: password authentication failed (SOLVED)

2015-07-24 Thread Gary Roach
On 07/22/2015 04:44 PM, Chris Angelico wrote: On Thu, Jul 23, 2015 at 9:35 AM, Gary Roach gary719_li...@verizon.net 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

Re: password authentication failed

2015-07-23 Thread Gary Roach
On 07/16/2015 04:53 PM, Chris Angelico wrote: On Fri, Jul 17, 2015 at 9:34 AM, Gary Roach gary719_li...@verizon.net 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

Re: password authentication failed

2015-07-22 Thread Gary Roach
On 07/16/2015 04:53 PM, Chris Angelico wrote: On Fri, Jul 17, 2015 at 9:34 AM, Gary Roach gary719_li...@verizon.net 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

Re: Should non-security 2.7 bugs be fixed?

2015-07-19 Thread Gary Herron
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

Re: password authentication failed

2015-07-16 Thread Gary Roach
On 07/15/2015 11:25 AM, Chris Angelico wrote: On Thu, Jul 16, 2015 at 3:13 AM, Gary Roach gary719_li...@verizon.net 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

password authentication failed

2015-07-15 Thread Gary Roach
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

Re: Can anybody explain the '-' in a 2-D creation code?

2015-06-26 Thread Gary Herron
print(_) 123 Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Why this list of dictionaries doesn't work?

2015-06-18 Thread Gary Herron
. person['name'] = 'kacey' person['age'] = 18 people.append(person) for person in people: print( person['nome'] ) Typo here: 'name', not 'nome'. -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418 -- https://mail.python.org/mailman

Re: So what's happening here?

2015-06-05 Thread Gary Herron
(a[1]) 28409872 This produces two different view of the same underlying object. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: So what's happening here?

2015-06-05 Thread Gary Herron
On 06/05/2015 06:39 AM, Todd wrote: On Fri, Jun 5, 2015 at 3:23 PM, Gary Herron gary.her...@islandtraining.com 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

Re: How to inverse a particle emitter

2015-06-04 Thread Gary Herron
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

Re: Multiple thread program problem

2015-06-04 Thread Gary Herron
(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 using Python3 instead of Python2.) Gary Herron -- Dr. Gary Herron Department of Computer Science DigiPen

Re: Keypress Input

2015-06-03 Thread Gary Herron
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. I just want

Re: Keypress Input

2015-06-03 Thread Gary Herron
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. I just want

Re: Please help on this sorted function

2015-06-03 Thread Gary Herron
if the individual keys or values are not sortable. There is also an implementation of a type of dictionary that remembers the order in which the items are *inserted*. It's in the collections module and called OrderedDict. Gary Herron -- Dr. Gary Herron Department of Computer Science

Re: Where is 'palindrome' defined?

2015-06-01 Thread Gary Herron
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 pyshell#126, line 1, in module parlindrome(a) NameError: name 'parlindrome' is not defined

Re: Returning a custom file object (Python 3)

2015-05-28 Thread Gary Herron
. Python2: __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. Gary Herron Within a module, you can simply do: open = MyFile Also

Re: Array of Functions

2015-05-26 Thread Gary Herron
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

Re: a more precise distance algorithm

2015-05-25 Thread Gary Herron
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 imagining: def distance(A, B): A B

  1   2   3   4   5   6   7   8   9   10   >