Re: How to read file content and send email on Debian Bullseye

2023-02-05 Thread Jim Jackson
On 2023-02-05, ^Bart wrote: >> xdg-email appears to be for interactive use (it opens the user's >> "preferred email composer"); I think sendmail would work much better >> from a script. > > Like what I said in another post I think I could use ssmtp than > xdg-email or sendmail... > >> Otherwise,

Re: How to read file content and send email on Debian Bullseye

2023-02-05 Thread Jim Jackson
On 2023-02-05, ^Bart wrote: >> For example, try to do whatever parts you know how to do and when some part >> fails or is missing, ask. > > You're right but first of all I wrote what I'd like to do and if Python > could be the best choice about it! :) I'd say you want a simple shell script

[issue46279] [docs] Minor information-ordering issue in __main__ doc

2022-01-08 Thread Jackson Brummell
Jackson Brummell added the comment: Have updated the PR to be in line with the issues leading ideas, specifically Tal's suggestion. Thanks -- ___ Python tracker <https://bugs.python.org/issue46

[issue46279] [docs] Minor information-ordering issue in __main__ doc

2022-01-08 Thread Jackson Brummell
Jackson Brummell added the comment: Updating issue, Have submitted fix -- ___ Python tracker <https://bugs.python.org/issue46279> ___ ___ Python-bugs-list mailin

[issue46279] [docs] Minor information-ordering issue in __main__ doc

2022-01-08 Thread Jackson Brummell
Change by Jackson Brummell : -- keywords: +patch pull_requests: +28683 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30480 ___ Python tracker <https://bugs.python.org/issu

[issue46279] [docs] Minor information-ordering issue in __main__ doc

2022-01-08 Thread Jackson Brummell
Jackson Brummell added the comment: It seems this is a simple miswording, where the word 'above' is used when the see below example clarifies BELOW the text. I will create a pull request within the hour -- nosy: +jacksonbrummell1 ___ Python

[issue39766] unittest's assertRaises removes locals from tracebacks

2021-05-11 Thread Jackson Riley
Jackson Riley added the comment: +1 - I was surprised not to be able to get locals from many of the frames in pdb upon an unexpected exception being raised inside an assertRaises. Thanks for raising this issue Daniel. -- nosy: +jacksonriley

Python lunch and file accessing challenges

2021-01-30 Thread jackson kwame via Python-list
 Hi I'm new to Python and currently taking part in a Data Science course. Python is the main coding/programming language for the course. We were guided to download the Python application through Anaconda which worked. I have been using Jupyther through a browser to practice Python exercises.

[issue39480] referendum reference is needlessly annoying

2020-01-28 Thread Ian Jackson
New submission from Ian Jackson : The section "Fancier Output Formatting" has the example below. This will remind many UK readers of the 2016 EU referendum. About half of those readers will be quite annoyed. This annoyance seems entirely avoidable; a different example which did

[issue38866] test_pyclbr replace asyncore

2019-11-21 Thread Jackson Riley
Change by Jackson Riley : -- pull_requests: +16803 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17316 ___ Python tracker <https://bugs.python.org/issu

[issue28533] Replace asyncore

2019-11-20 Thread Jackson Riley
Jackson Riley added the comment: Lib/test/test_pyclbr.py - subissue issue38866 A trivial one! -- nosy: +jacksonriley ___ Python tracker <https://bugs.python.org/issue28

[issue38866] test_pyclbr replace asyncore

2019-11-20 Thread Jackson Riley
New submission from Jackson Riley : sub-issue of (issue28533)[https://bugs.python.org/issue28533] -- components: Tests files: pyclbr.patch keywords: patch messages: 357087 nosy: jacksonriley priority: normal severity: normal status: open title: test_pyclbr replace asyncore Added file

[issue34716] MagicMock.__divmod__ should return a pair

2019-11-20 Thread Jackson Riley
Change by Jackson Riley : -- keywords: +patch pull_requests: +16784 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17291 ___ Python tracker <https://bugs.python.org/issu

[issue34716] MagicMock.__divmod__ should return a pair

2019-11-20 Thread Jackson Riley
Jackson Riley added the comment: Ah thank you Vedran, that makes sense. In that case, I think I'll make a start on implementing Serhiy's second suggestion - returning a pair of MagicMock instances when MagicMock.__divmod__ is called

[issue17306] Improve the way abstract base classes are shown in help()

2019-11-20 Thread Jackson Riley
Change by Jackson Riley : -- pull_requests: +16771 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17278 ___ Python tracker <https://bugs.python.org/issu

[issue34716] MagicMock.__divmod__ should return a pair

2019-11-13 Thread Jackson Riley
Jackson Riley added the comment: On second thoughts, perhaps option 2 is best (more in keeping with the usual behaviour of MagicMock). Alternatively, could I propose a fourth option: 4. Change the behaviour of MagicMock more generally such that trying to unpack a MagicMock instance into two

[issue34716] MagicMock.__divmod__ should return a pair

2019-11-12 Thread Jackson Riley
Jackson Riley added the comment: Hi Serhiy, Option 3 sounds most sensible to me. I'd be happy to pick up this issue, please do let me know. -- nosy: +jacksonriley ___ Python tracker <https://bugs.python.org/issue34

[issue17306] Improve the way abstract base classes are shown in help()

2019-11-12 Thread Jackson Riley
Jackson Riley added the comment: Hi Raymond - here's a first attempt at adding class-level docstrings, based off the format of Sequence.__doc__. Apologies if some things are not well worded etc. It looks like all of the non-magic methods have docstrings already but if you think the magic

[issue36092] unittest.mock's patch.object and patch.dict are not supported on classmethod, propery and staticmethod

2019-11-12 Thread Jackson Riley
Jackson Riley added the comment: Thanks Karthikeyan! -- ___ Python tracker <https://bugs.python.org/issue36092> ___ ___ Python-bugs-list mailing list Unsub

[issue23692] Undocumented feature prevents re module from finding certain matches

2019-11-12 Thread Jackson Riley
Jackson Riley added the comment: Hi Matthew, Serhiy, I tried to identify the right places in re to fix things but have found it a bit difficult. I wrote up my attempt (at https://enhackathon.github.io/2019/11/04/JacksonRiley.html) which includes some examples that behave differently from

[issue17306] Improve the way abstract base classes are shown in help()

2019-11-12 Thread Jackson Riley
Jackson Riley added the comment: Hi Raymond, I'm working with Ben on the EnHackathon project (https://enhackathon.github.io/) and am planning on working on this issue. Is that alright? Please do say if there's anything extra wanted or if you have any guidance (this is my first time

[issue36092] unittest.mock's patch.object and patch.dict are not supported on classmethod, propery and staticmethod

2019-11-12 Thread Jackson Riley
Jackson Riley added the comment: Hi Karthikeyan, It seems that test_patch_descriptor has been removed by Chris Withers on 1st of May 2019 under commit adbf178. I would therefore propose that this bug be marked as closed/resolved. Cheers, Jackson -- nosy: +jacksonriley

[issue23692] Undocumented feature prevents re module from finding certain matches

2019-11-04 Thread Jackson Riley
Jackson Riley added the comment: I've got a bit confused and am doubting myself - is the below output expected? >>> m = re.match('(?:()|(?(1)()|z)){1,2}(?(2)a|z)', 'a') >>> m.groups() ('', '') >>> m = re.match('(?:()|(?(1)()|z)){1,2}(?(1)a|z)', 'a') >>> m.gr

[issue23692] Undocumented feature prevents re module from finding certain matches

2019-11-04 Thread Jackson Riley
Jackson Riley added the comment: Ah thank you very much Serhiy, that's super helpful! -- ___ Python tracker <https://bugs.python.org/issue23692> ___ ___ Pytho

[issue23692] Undocumented feature prevents re module from finding certain matches

2019-11-04 Thread Jackson Riley
Jackson Riley added the comment: Hi Matthew, thank you for your suggestions of where to start. Could you possibly give a pointer to the place in the code where the 'capture changed' counter is incremented? I had a bit of a hunt and couldn't find it but may have been looking in the wrong

[issue9182] document “--” as a way to distinguish option w/ narg='+' from positional argument in argparse

2019-10-31 Thread Jackson Riley
Jackson Riley added the comment: Hi all, I'm a newcomer and wanted to try to make this change, is it still wanted/needed? -- nosy: +jacksonriley ___ Python tracker <https://bugs.python.org/issue9

[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2019-10-31 Thread Jackson Riley
Jackson Riley added the comment: I'm a newcomer and thought about trying to follow up on this and potentially update existing patches, would this be a good idea? -- nosy: +jacksonriley ___ Python tracker <https://bugs.python.org/issue9

[issue30518] Import type aliases from another module

2017-06-03 Thread John Jackson
John Jackson added the comment: Thanks for your response! Yes, the problem was a circular definition. I still have much to learn about Python... -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tra

[issue30518] Import type aliases from another module

2017-05-30 Thread John Jackson
John Jackson added the comment: I just found out that the problem is even worse. While PyCharm accepts the syntax below, I still can't compile 'Blocks'. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30518] Import type aliases from another module

2017-05-30 Thread John Jackson
New submission from John Jackson: I have a 'base' module where I define some type aliases, such as: from typing import List, Tuple Block = [int, Tuple[int]] Blocks = List[Block] Tags = List[str] I would like to import these aliases into other modules so that the 'base' module

[issue26054] Unable to run scripts: idle3 -r script.py

2016-01-08 Thread David Jackson
New submission from David Jackson: [Raspberry Jessie] Idle3(4.2] If I open a idle3 shell (from menu) and enter >>import pandas as pd it accepts the command, but if I trying and run it from the shell>> idle3 -r script.py I get the following errors: Traceback (most recent call l

[issue26054] Unable to run scripts: idle3 -r script.py

2016-01-08 Thread David Jackson
David Jackson added the comment: The problem was I had a pandas.py and a pandas.pyc in my home directory. after deleting them everything seems to be working. -- resolution: -> not a bug ___ Python tracker <rep...@bugs.python.org&

[issue25908] ProcessPoolExecutor deadlock on KeyboardInterrupt

2015-12-18 Thread Thomas Jackson
New submission from Thomas Jackson: If a KeyboardInterrupt is received while a worker process is grabbing an item off of the queue that worker process dies with an uncaught exception. This means that the ProcessPool now has lost a process, and currently has no mechanism to recover from dead

[issue25908] ProcessPoolExecutor deadlock on KeyboardInterrupt

2015-12-18 Thread Thomas Jackson
Thomas Jackson added the comment: Seems that I accidentally hit submit, so let me finish the last bit of my message here: An alternate approach is to actually change multiprocessing.Queue.get() to leave the item on the queue if it is interrupted with a keyboard interrupt. Then the worker

[issue25908] ProcessPoolExecutor deadlock on KeyboardInterrupt

2015-12-18 Thread Thomas Jackson
Thomas Jackson added the comment: Some more investigation, it seems that the alternate `Queue` fix is a non-starter. From my investigation it seems that the ProcessPoolExecutor is assuming that multiprocess.Queue is gauranteed delivery, and it isn't (because of the pickling). So the issue

[issue21691] set() returns random output with Python 3.4.1, in non-interactive mode

2014-06-08 Thread Jackson Cooper
New submission from Jackson Cooper: The set() built-in returns random output, only when Python 3 is being used, and in non-interactive mode (executing a file). Steps to reproduce: 1. Create file with only print(set(['A', 'B'])) inside it. 2. Execute file with Python 3.4.1 numerous times (10

[issue21691] set() returns random output with Python 3.4.1, in non-interactive mode

2014-06-08 Thread Jackson Cooper
Jackson Cooper added the comment: Ah, gotcha. I was assuming the output was consistent across environments, even though ordering of set() is arbitrary. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21691

Strange extra f added to bytes object

2013-10-06 Thread Robert Jackson
I am very new to python so I'll apologize up front if this is some boneheaded thing. I am using python and pyserial to talk to an embedded pic processor in a piece of scientific equipment. I sometimes find the when I construct the bytes object to write it adds an extra f to the first byte. For

Re: Strange extra f added to bytes object

2013-10-06 Thread Robert Jackson
Thank you all. It was unfortunate that it was f since I thought it was some strange mistaken hex nibble. All very clear and helpful. On Sun, Oct 6, 2013 at 9:07 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sun, 06 Oct 2013 20:39:39 -0400, Ned Batchelder wrote: When

Re: python game

2013-06-19 Thread Jackson Kemp
Thankyou this was very helpful -- http://mail.python.org/mailman/listinfo/python-list

[issue2118] smtplib.SMTP() raises socket.error rather than SMTPConnectError

2013-04-13 Thread Ned Jackson Lovely
Ned Jackson Lovely added the comment: Attaching a patch to make SMTPException an IOError, with corresponding update to docs to point out that __init__ on the SMTP object will raise IOErrors in general, and some SMTPExceptions in particular. Boston Python Sprint Apr 2013 -- nosy: +n

[issue2118] smtplib.SMTP() raises socket.error rather than SMTPConnectError

2013-04-13 Thread Ned Jackson Lovely
Ned Jackson Lovely added the comment: ...and the 3.3 doc patch. -- Added file: http://bugs.python.org/file29805/issue2118-doc-patch-3.3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2118

[issue17301] An in-place version of many bytearray methods is needed

2013-04-13 Thread Ned Jackson Lovely
Ned Jackson Lovely added the comment: An mtranslate, or mutating translate method for bytearrays. My first C code in a long time, so be gentle. The name is bad, but I don't see a better suggestion below. -- keywords: +patch nosy: +n Added file: http://bugs.python.org/file29825

[issue2118] smtplib.SMTP() raises socket.error rather than SMTPConnectError

2013-04-13 Thread Ned Jackson Lovely
Ned Jackson Lovely added the comment: s/IOError/OSError/ -- Added file: http://bugs.python.org/file29830/issue2118-OSError.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2118

[issue5051] test_update2 in test_os.py invalid due to os.environ.clear() followed by reliance on environ COMSPEC

2013-03-19 Thread Ned Jackson Lovely
Changes by Ned Jackson Lovely n...@njl.us: Added file: http://bugs.python.org/file29480/issue5051-take2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5051

[issue5051] test_update2 in test_os.py invalid due to os.environ.clear() followed by reliance on environ COMSPEC

2013-03-19 Thread Ned Jackson Lovely
Ned Jackson Lovely added the comment: Hi Luke, I've prepared two versions of this test. The first, issue5051-take2.diff, retains the environ.clear(), but saves and sets COMSPEC and PATH in the same update call as the HELLO variable. The second, and in my opinion more reasonable test, makes

[issue5024] sndhdr.whathdr returns -1 for WAV file frame count

2013-03-18 Thread Ned Jackson Lovely
Ned Jackson Lovely added the comment: Added bytes literal 'b', made it a real patch, changed test to account for WAV files actually returning number of frames from this function. -- keywords: +patch nosy: +n versions: +Python 3.4 -Python 3.2 Added file: http://bugs.python.org/file29447

[issue5051] test_update2 in test_os.py invalid due to os.environ.clear() followed by reliance on environ COMSPEC

2013-03-18 Thread Ned Jackson Lovely
Ned Jackson Lovely added the comment: Check if sys.platform == 'win32', if so, skip test. -- keywords: +patch nosy: +n versions: +Python 3.4 -Python 2.7 Added file: http://bugs.python.org/file29449/issue5051.diff ___ Python tracker rep

[issue2943] Distutils should generate a better error message when the SDK is not installed

2013-03-18 Thread Ned Jackson Lovely
Ned Jackson Lovely added the comment: Improved msg per discussion. I don't see how to test this without messing with the windows registry. I am deeply reluctant to do that. -- keywords: +patch nosy: +n Added file: http://bugs.python.org/file29450/issue2943.diff

[issue7573] Position independent include of Python.h

2013-03-18 Thread Ned Jackson Lovely
Ned Jackson Lovely added the comment: Should this be closed? -- nosy: +n ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7573 ___ ___ Python-bugs

[issue5051] test_update2 in test_os.py invalid due to os.environ.clear() followed by reliance on environ COMSPEC

2013-03-18 Thread Ned Jackson Lovely
Ned Jackson Lovely added the comment: Fair enough Luke. What is your recommended fix? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5051

groupby - summing multiple columns in a list of lists

2011-05-17 Thread Jackson
I'm currently using a function pasted in below. This allows me to sum a column (index) in a list of lists. So if mylist = [[1, 2, 3], [1, 3, 4], [2, 3, 4], [2, 4, 5]] group_results(mylist,[0],1) Returns: [(1, 5), (2, 7)] What I would like to do is allow a tuple/list of index values, rather than

Re: possible to run a python script without installing python?

2011-03-16 Thread David Jackson
i need to run a python script on any arbitrary server and don't want to do an actual installation. i figured i could do a clean install on my machine and install whatever libraries would be needed, then zip them all up for remote deployment. to avoid bloating, i am wondering which files i can

[issue8161] inconsistency behavior in ctypes.c_char_p dereferencing

2010-03-17 Thread Jackson Yang
New submission from Jackson Yang jackson.y...@augmentum.com: # Python 3.1.2rc1 (r312rc1:78742, Mar 7 2010, 07:49:40) # [MSC v.1500 32 bit (Intel)] on win32 import ctypes class T(ctypes.Structure): _fields_ = ( ('member', ctypes.c_char * 16), ) # dereference

[issue7647] Add statvfs flags to the posix module

2010-01-12 Thread Adam Jackson
Adam Jackson a...@redhat.com added the comment: None of the other symbolic constants in 'posix' have documentation. Perhaps they should, but the patch is at least doing the same as what's already done. -- ___ Python tracker rep...@bugs.python.org

[issue7647] Add statvfs flags to the posix module

2010-01-06 Thread Adam Jackson
New submission from Adam Jackson a...@redhat.com: Though the statvfs call exists in the posix module, the posix-defined values for the f_flag field are not. This makes it hard to know whether a filesystem is readonly without also knowing the value for ST_READONLY on the machine you're

[issue7647] Add statvfs flags to the posix module

2010-01-06 Thread Adam Jackson
Changes by Adam Jackson a...@redhat.com: -- type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7647 ___ ___ Python-bugs-list

Re: WMI remote call in python script to create process on remote windows computer

2009-10-07 Thread David Jackson
ok, cut and pasted, but changed the username/password to protect the innocent. this is from interactive prompt. let me know if i am still not doing the slashes correctly please. i doubt authentication is the issue.; i can get pid information using WQL queries. objCreateProc.Create expects 4

Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
Hi, I have the following code that works fine in Python 2.x, but I can't seem to get it to work in Python 3 with Popen. Can you please tell me how to get the same functionality out of Python 3? The gist of what I doing is in the setpassword function. I have tried numerous ways to get this to work,

Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
the close(): Thanks, Rusty On Tue, Sep 15, 2009 at 4:24 PM, Rhodri James rho...@wildebst.demon.co.ukwrote: On Wed, 16 Sep 2009 00:01:17 +0100, Russell Jackson ru...@rcjacksonconsulting.com wrote: Hi, I have the following code that works fine in Python 2.x, but I can't seem to get

Re: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
...@rebertia.com wrote: On Tue, Sep 15, 2009 at 5:07 PM, Chris Rebert c...@rebertia.com wrote: On Tue, Sep 15, 2009 at 4:01 PM, Russell Jackson ru...@rcjacksonconsulting.com wrote: snip Attempted code in Python 3: (Doesn't work either) snip cmd = ' passwd {0}'.format(user) pipe

Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
Jackson ru...@rcjacksonconsulting.com wrote: I just get an errorlevel from the executable when I read stdout, but I can't tell what is going on because, of course, I can't tell what Popen is actually doing. I never see the prompt from the executable that I would expect to see when I read stdout

[issue6750] threading issue in __builtins__.print

2009-08-21 Thread Jackson Yang
New submission from Jackson Yang jackson.y...@augmentum.com: # Bug Description In a multi-threaded environment, the Win32 Python3000 built-in function print may give the output several times. # How to Reproduce: import threading event = threading.Event() class Test(threading.Thread): def

[issue2622] Import errors in email.message.py

2009-06-16 Thread John Jackson
John Jackson johnjack...@pobox.com added the comment: Also occurs in 2.6... -- versions: +Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2622

Any tips on Python web development on Mac OS

2008-08-05 Thread Tim Greening-Jackson
Hi there. I've recently learned Python -- but would by no means describe myself as expert -- and have a couple of pet projects I want to do in my spare time in order to consolidate what I've learned by using it to solve real problems. I'd like to create a couple of websites on my Mac at

Re: Hobbyist - Python vs. other languages

2008-08-05 Thread Tim Greening-Jackson
Tobiah wrote: You may enjoy: http://www.pythonchallenge.com/ It's a blast and a half. To solve the puzzles you have to write python programs that do various things. Thanks for that. I can see that will keep me amused for quote some time. --

Re: Any tips on Python web development on Mac OS

2008-08-05 Thread Tim Greening-Jackson
Bruno Desthuilliers wrote: Tim Greening-Jackson a écrit : (snip) You're not going to get anywhere without learning (x)html and css IMHO. Even using a graphical html editor like Dreamweaver requires having a good enough (IOW : being able to do it all by hand) knowledge of these languages

I love shelf BUT

2008-07-27 Thread Sera Jackson
ok, I know its an over discussed topic. Althought I understand why it is there I cant constantly see it in my argument list in parenthesis. can someone give me an insight of the cons of a syntax like this: class Class: def self.method(arguments): etc, etc In other words def

Re: I love shelf BUT

2008-07-27 Thread Sera Jackson
On Jul 28, 6:25 am, alex23 [EMAIL PROTECTED] wrote: On Jul 28, 12:46 pm, Sera Jackson [EMAIL PROTECTED] wrote: ok, I know its an over discussed topic. Althought I understand why it is there I cant constantly see it in my argument list in parenthesis. can someone give me an insight

RE: Python-list Digest, Vol 57, Issue 206

2008-06-13 Thread STEVEN A JACKSON
Is there a Python programmer living near Bend Oregon that I could call via phone ask some questions on how they accomplish certain tasks? I’ve been programming using several languages for over fifty years, but am unable to get Python to due what I would like to do! Papa Jackson From: [EMAIL

Re: csv iterator question

2008-05-24 Thread David Jackson
Thanks, Ethan. that was a great solution. i just tested it. On Fri, May 23, 2008 at 7:08 PM, Ethan Furman [EMAIL PROTECTED] wrote: davidj411 wrote: When you save an open file to a variable, you can re-use that variable for membership checking. it does not seem to be that way with the

[issue2622] Import errors in email.message.py

2008-04-14 Thread John Jackson
John Jackson [EMAIL PROTECTED] added the comment: Attached is a sample code that reproduces the problem under python 2.5 on Mac OS 10.4.11. See file for instructions on how to reproduce the issue. Added file: http://bugs.python.org/file10030/test_mailbox.py

[issue2622] Import errors in email.message.py

2008-04-13 Thread John Jackson
John Jackson [EMAIL PROTECTED] added the comment: I'll put one together. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2622 __ ___ Python-bugs-list mailing list Unsubscribe

[issue2622] Import errors in email.message.py

2008-04-12 Thread John Jackson
John Jackson [EMAIL PROTECTED] added the comment: Yes. If the code is used to build a standalone application with py2app on the Mac, here's the end of the stack trace: File controller.pyo, line 17, in module File readMail.pyo, line 15, in module File mailbox.pyo, line 1294, in module

[issue2622] Import errors in email.message.py

2008-04-11 Thread John Jackson
New submission from John Jackson [EMAIL PROTECTED]: In email.message.py there are two import errors: line 128 from email.Generator import Generator should be from email.generator import Generator line 784 from email.Iterators import walk should be from email.iterators import walk

Which class's comparison function is called?

2007-06-05 Thread Bill Jackson
For example, class A: def __init__(self,a): self.a = a def __eq__(self, other): return self.a == other.a class B: def __init__(self,b): self.b = b def __eq__(self, other): return self.b == other.b A(1) == B(1) --- AttributeError: B instance has no attribute a

Re: matplotlib, usetex

2007-05-26 Thread Bill Jackson
Alexander Schmolck wrote the following on 05/25/2007 02:33 PM: I have no idea whether this will resolve your problem, but you could try updating to 0.90 (BTW what happens if you do axis([0,128,0,128])). The problem appears to be with a matplotlibrc file. If I delete the matplotlibrc file,

matplotlib, usetex

2007-05-25 Thread Bill Jackson
Hi, I'm having some trouble plotting with the following matplotlibrc: text.usetex : True I tried clearing the cache files under ~/.matplotlib, but this did not help the problem. I'd post on the matplotlib mailing list, but I have a hard enough time browsing sourceforge's achives

Re: matplotlib, usetex

2007-05-25 Thread Bill Jackson
Alexander Schmolck wrote the following on 05/25/2007 02:33 PM: (BTW what happens if you do axis([0,128,0,128])). In [1]: import pylab In [2]: pylab.axis([0,128,0,128]) In [3]: pylab.show() --- type

Import Problems

2007-04-27 Thread Bill Jackson
Once again, I am having issues with imports... Until now, I thought the general guidelines were to rarely use 'from x import y' syntax, except when you really want to copy names over. However, I have run into issues by following this guideline. So... 1) What is going wrong in the example

Re: Import Problems

2007-04-27 Thread Bill Jackson
Bill Jackson wrote the following on 04/27/2007 12:49 PM: # importtest/test2/__init__.py from someclass import * from test2 import * Sorry typo here: # importtest/test2/__init__.py from someclass import * from mytest import * -- http://mail.python.org/mailman/listinfo/python-list

Preferred Random Library

2007-04-25 Thread Bill Jackson
Is there a preferred random library? scipy.random random Besides scipy's library returning ndarrays, is there any other advantage/disadvantage? -- http://mail.python.org/mailman/listinfo/python-list

random.py

2007-04-25 Thread Bill Jackson
In random.py (Python 2.5.1), line 86 says: VERSION = 2# used by getstate/setstate Then, in the definition of Random.setstate, we have: if version == 2: Why is it not: if version == self.VERSION: -- http://mail.python.org/mailman/listinfo/python-list

Re: Preferred Random Library

2007-04-25 Thread Bill Jackson
Paul Rubin wrote the following on 04/25/2007 10:17 PM: Bill Jackson [EMAIL PROTECTED] writes: Is there a preferred random library? Preferred for what? Maybe you want os.urandom(). How about for general usage...I am just asking for a very broad description of the advantages/disadvantages

When to clear a dictionary...

2007-04-20 Thread Bill Jackson
What is the benefit of clearing a dictionary, when you can just reassign it as empty? Similarly, suppose I generate a new dictionary b, and need to have it accessible from a. What is the best method, under which circumstances? import some_function a = {1:2,3:4} b = {1:2:4:3}

Re: When to clear a dictionary...

2007-04-20 Thread Bill Jackson
Bill Jackson wrote the following on 04/20/2007 09:48 AM: import some_function a = {1:2,3:4} b = {1:2:4:3} a.clear() a.update(b) a = {1:2,3:4} b = {1:2,4:3} for key in b: a[key] = b[key] Clearly, this won't have the same result as the other two examples

Better dict of dicts

2007-04-19 Thread Bill Jackson
I have a dictionary of dictionaries where the keys are typically very long tuples and repeated in each inner dictionary. The dictionary representation is nice because it handles sparseness well...and it is nice to be able to look up values based on a string rather than a number. However,

Re: Better dict of dicts

2007-04-19 Thread Bill Jackson
Martin v. Löwis wrote the following on 04/19/2007 02:43 PM: Bill Jackson schrieb: I have a dictionary of dictionaries where the keys are typically very long tuples and repeated in each inner dictionary. What I don't understand here: you say the keys are tuples, yet later, you show

Re: Indentation for code readability

2007-03-30 Thread Mark Jackson
but increase the readability significantly. You are e. e. cummings, and I claim my £5. -- Mark Jackson - http://www.alumni.caltech.edu/~mjackson Every 10 years we say to ourselves, If only we had done the right thing 10 years ago. - Thomas Friedman

Re: Pyserial example program error: win32file.SetupComm reports 'Incorrect function.'

2007-02-08 Thread Ron Jackson
Dennis Lee Bieber wrote: On Wed, 07 Feb 2007 11:14:39 -0800, Ron Jackson [EMAIL PROTECTED] declaimed the following in comp.lang.python: I am using Python 2.5 on Windows XP. I have installed Pyserial and win32all extensions. 2.4 on XP Pro SP2... When I try to run the example

Pyserial example program error: win32file.SetupComm reports 'Incorrect function.'

2007-02-07 Thread Ron Jackson
I am using Python 2.5 on Windows XP. I have installed Pyserial and win32all extensions. When I try to run the example program scan.py (included below), or any other program using pyserial, as soon as it hits the statement: s = serial.Serial(i) I get the error: Traceback (most recent call

Re: Why does wx.Window.CaptureMouse() send EVT_PAINT

2006-12-12 Thread Bill Jackson
Tim Roberts wrote the following on 12/09/2006 08:27 PM: The source code could answer that question for sure, but I doubt that it is CaptureMouse doing it, and I know the SetCapture API (which it eventually calls) does not. Is it possible that your clicking caused some part of the app to

Why does wx.Window.CaptureMouse() send EVT_PAINT

2006-12-07 Thread Bill Jackson
It seems that the CaptureMouse method sends an EVT_PAINT handler. The documentation does not mention this...is it somewhere else? Could someone explain why this handler is sent out? Also, I've seen: def OnMouseDown(self, evt): self.CaptureMouse() self.x, self.y =

Inheritance Question

2006-11-10 Thread Jackson
I've got an inheritance question and was hoping brighter minds could guide me. I am in the strange situation where some of the methods in a subclass are actually more general than methods in a superclass. What is the preferred way to handle such situations. My original thought was to do

Vector Space Membership

2006-11-07 Thread Jackson
Is there a package which provides a VectorSpace object defined over the Reals, Rationals, Complex, etc? It'd be nice to test membership. -- http://mail.python.org/mailman/listinfo/python-list

Difference between unindexable and unsubscriptable

2006-10-10 Thread Jackson
What is the difference between object is unindexable and object is unsubscriptable? I would like to test if an object can accept: obj[0] from sets import Set Set([1,2])[0] TypeError: unindexable object 3[0] TypeError: unsubscriptable object It seems like each of these errors can be

Re: selecting base class from user input

2006-08-14 Thread Jackson
Thanks for the reply. danielx wrote the following on 2006-08-13 19:49: Is your declaration of ABC supposed to have some_super as one of the base classes? Your constructor has some_super as a parameter. What is this supposed to mean in light of the declaration for ABC? Indeed, my goal is to

Re: selecting base class from user input

2006-08-14 Thread Jackson
Maric Michaud wrote the following on 2006-08-14 01:26: In [28]: class Animal(object) : : _types = {} : : In [29]: class Worker(object) : : def work(self) : print 'hard' : : [snip] What you are trying to achieve is more commonly done by

Re: selecting base class from user input

2006-08-14 Thread Jackson
John Machin wrote the following on 2006-08-14 01:45: Here are a couple of thoughts that *might* help: (1) mix-in i.e. a class can have multiple base classes: class AntWorker(Animal, Worker): (2) you can create classes on the fly using the 3-argument form of the built-in type() function:

selecting base class from user input

2006-08-13 Thread Jackson
I want a class that will determine its base class by the argument passed in. What I am about to write _does_not_work_, but it shows what I am trying to do. class ABC(some_super): def __init__(self,some_super): some_super.__init__(self) if some_super == list:

  1   2   >