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 wrapp

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. Ho

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: > > >

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 e

Re: python game

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

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 safel

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 strings

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

2009-09-15 Thread Russell Jackson
log("ERROR", "Password reset failed.\n{0}{1} generated the following error: {2}".format(p4, cmd, stderr)) except OSError as err: log("ERROR", "Execution failed: {0}".format(err)) Thanks, Rusty On Tue, Sep 15, 2009 at 6:37 PM, Chris Rebert

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

2009-09-15 Thread Russell Jackson
hris Rebert wrote: > On Tue, Sep 15, 2009 at 5:07 PM, Chris Rebert wrote: > > On Tue, Sep 15, 2009 at 4:01 PM, Russell Jackson > > wrote: > > > >> Attempted code in Python 3: (Doesn't work either) > > > >> cmd = ' passwd {0}'

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

2009-09-15 Thread Russell Jackson
saw in the docs, and the fact that it didn't complain about that part, but I'll try the close(): Thanks, Rusty On Tue, Sep 15, 2009 at 4:24 PM, Rhodri James wrote: > On Wed, 16 Sep 2009 00:01:17 +0100, Russell Jackson < > ru...@rcjacksonconsulting.com> wrote: > > H

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: 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 t

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. -- http://mail.python.org/mailman/listinfo/python-li

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: 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

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 method(se

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

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

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 B

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, th

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() --- Traceback (most recent cal

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 (frequen

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

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 below

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 descript

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

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

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

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: 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 tup

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, sinc

Re: Indentation for code readability

2007-03-30 Thread Mark Jackson
x(); > } > popMatrix(); > > The curly brackets have no functional meaning 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 t

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. >> > >

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 last)

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 be

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 = self.l

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 somethin

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 erro

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() fu

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 common

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

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:

Re: import

2006-07-07 Thread David Jackson
underscores]. > and you might want to import sys and check sys.path [the list of > directories searched by the import mechanism]. > > > David Jackson wrote: >> Hi all, >> >> I'm a real beginner with python but have what I think is a simple >> question. &

import

2006-07-05 Thread David Jackson
Hi all, I'm a real beginner with python but have what I think is a simple question. I am writing some simple modules and would like to place them into a subdirectory. But then I cannot seem to import them. I have tried the following. I wrote a module called fibo.py with some definitions in i

Re: Characters contain themselves?

2006-04-07 Thread Mark Jackson
f/types.html > > (One item of what type, one might ask) Good point. ". . .represented by a string of length one" would be better. -- Mark Jackson - http://www.alumni.caltech.edu/~mjackson An information system based on theory isolated from reality is bound to fail. - Mitch Kabay -- http://mail.python.org/mailman/listinfo/python-list

automatic from module import * expansion

2006-03-13 Thread Keith Jackson
Does anybody know of a tool that will take a module as input, look for any wildcard imports, and then identify what symbols in the module come from which wildcard import? It could then expand out the from module import * to from module import foo, bar. It might need to ask the user on this, sin

Re: Filename case-insensitivity on OS X

2006-01-06 Thread Mark Jackson
e search box in Google, your AOL or Jabber buddy > list: all case-insensitive. Not all URLs. Compare, for example: http://www.python.org/doc/Summary.html http://www.python.org/doc/summary.html -- Mark Jackson - http://www.alumni.caltech.edu/~mjackson Those who can make you believe a

Re: Documentation suggestions

2005-12-07 Thread Mark Jackson
only > user. But are those 10 modules the same 10 modules that other folks > need? I don't know... > > Of course, the only way to find out is to try... Or you can just look up the module you need to write a 'bot to constantly look up the

Re: Adding through recursion

2005-11-18 Thread Mark Jackson
y > else: > x -= 1 > y += 1 > add(x, y) > > print add(2, 4) > > result: > 6 > None Perhaps this hint will help: >>> print add(0,6) 6 6 -- Mark Jackson - http://www.alumni.caltech.edu/~mjackson Of course a weed-puller isn&

Re: Interleave merge pdf files

2005-07-22 Thread Mark Jackson
I would be interested in an alternative approach which does not generate a ton of intermediate pdfs. -- Mark Jackson - http://www.alumni.caltech.edu/~mjackson It is difficult for men in high office to avoid the malady of self-delusion.- Calvin Coolidge -- http://mail.python.org/mailman/listinfo/python-list

Re: Tricky Dictionary Question from newbie

2005-07-11 Thread Mark Jackson
turn a new dict with string keys and lists containing the > previous keys for repeated values. > > NewDict = {'This is repeated':['rt','sr'],'This is not':['gf']} NewDict = {} for x in Dict.keys(): try: NewDict[Dic

Re: Web framework

2005-03-09 Thread Phil Jackson
"Gianluca Sartori" <[EMAIL PROTECTED]> writes: > What web framework do you suggest to develop with? I tend to use mod_python. Phil -- http://mail.python.org/mailman/listinfo/python-list

Re: Dealing with config files what's the options

2005-02-23 Thread Phil Jackson
Tom Willis <[EMAIL PROTECTED]> writes: > How are the expert pythoneers dealing with config files? You could use the cPickle module if you don't mind your config files being unreadable by humans. There is also the shlex module for more powerful config file needs: http://docs.python.org/lib/module

Re: Can I get message filename from a Maildir mailbox stream?

2005-02-19 Thread Phil Jackson
[EMAIL PROTECTED] writes: > Is there a way to figure out what filename an email object points to > in a qmail style Maildir directory? What do you mean bu "email object"? Surely if you are iterating a Maildir then you should have the filename. Or am I misunderstanding what you mean? Phil -- htt

Re: negative integer division

2005-02-10 Thread Mark Jackson
[EMAIL PROTECTED] (John Machin) writes: > [EMAIL PROTECTED] (Mark Jackson) wrote in message news:<[EMAIL PROTECTED]>... > > > > A: 42 > > > > Q: What multiple of 7 did I add to the critical expression in the Zeller > > algorithm so it would remain

Re: negative integer division

2005-02-07 Thread Mark Jackson
Q: What multiple of 7 did I add to the critical expression in the Zeller algorithm so it would remain nonnegative for the next few centuries? -- Mark Jackson - http://www.alumni.caltech.edu/~mjackson People who write obscurely are either unskilled in writing or up to mischie

Re: global variables

2005-02-03 Thread Mark Jackson
7;ll just have to put > up with the ambiguities. Or perhaps, given my (lack of) typing skill, I > should just start signing myself "Stvev"? What's this doing *here*? I thought the discussion of the pitfalls of name rebinding was taking place in the "variable declaration&q

Re: How did you learn Python?

2004-12-03 Thread Mark Jackson
> the re class for example. > > Somebody called O'Reilly taught you that Python has "standard > classes", one of which is "re"??? Hmmm, can't have been O'Reilly the > publisher; must have been O'Reilly the builder. Or possibly O'Reilly