Python stopped installing packages

2019-01-29 Thread Hamish Allen
from here: https://github.com/Rapptz/discord.py I’ve tried the 3 commands in the Installing section and I’ve tried pip install discord.py. Thanks, Hamish -- https://mail.python.org/mailman/listinfo/python-list

Express thanks

2017-08-21 Thread Hamish MacDonald
for such a message but what the hey. Hamish -- -- https://mail.python.org/mailman/listinfo/python-list

how to read stdout without blocking

2009-12-22 Thread Hamish McKenzie
I need to run a cmd line app from python whose run time can vary from a fraction of a second to minutes. I need to be able to tell whether the process is still waiting, or whether it has stalled - and this is farily easily done by keeping an eye on whether its writing to stdout or not. The pro

getting caller

2009-02-12 Thread Hamish McKenzie
so I'm trying to wrap some functionality around execfile but don't want to modify the way it works. specifically when you call execfile, it automatically grabs globals and locals from the frame the execfile exists in. so if I wrap execfile in a function, I need a way to reliably get at the cal

RE: type conversion

2009-01-02 Thread Hamish McKenzie
I actually have no idea what ur talking about... aren't conversations threaded by subject? -Original Message- From: python-list-bounces+hamish=valvesoftware@python.org [mailto:python-list-bounces+hamish=valvesoftware@python.org] On Behalf Of r Sent: Friday, January 02,

RE: type conversion

2009-01-01 Thread Hamish McKenzie
>> You could also use a dict with type:method key/value pairings. This is >> closer to a switch/case than an if...elif chain is. of course, that's a great idea... thanks. -- http://mail.python.org/mailman/listinfo/python-list

type conversion

2008-12-31 Thread Hamish McKenzie
sometimes I want to be able to initialize an instance with a variety of different data types. as an obvious example I might want to initialize a 4x4 matrix with either 16 floats, a list/tuple or 16 floats, another matrix or a quaternion. is there any other way to do it other than putting case s

python bug when subclassing list?

2008-11-06 Thread Hamish McKenzie
I want to write a Vector class and it makes the most sense to just subclass list. I also want to be able to instantiate a vector using either: Vector( 1, 2, 3 ) OR Vector( [1, 2, 3] ) so I have this: class Vector(list): def __new__( cls, *a ): try: print a

python bug when subclassing list?

2008-11-06 Thread Hamish McKenzie
I want to write a Vector class and it makes the most sense to just subclass list. I also want to be able to instantiate a vector using either: Vector( 1, 2, 3 ) OR Vector( [1, 2, 3] ) so I have this: class Vector(list): def __new__( cls, *a ): try:

inheritance question...

2008-06-20 Thread Hamish McKenzie
I have this class: class Vector(object): TOL = 1e-5 def __eq__( self, other, tolerance=TOL ): print tolerance shortened for clarity obviously. so I want to subclass this class like so: class BigVector(Vector) TOL = 100 for example if I was working with large vector

str class inheritance prob?

2008-04-16 Thread Hamish McKenzie
so I'm trying to create a class that inherits from str, but I want to run some code on the value on object init. this is what I have: class Path(str): def __init__( self, path ): clean = str(path).replace('\\','/') while clean.f

Re: Unbuffered mode

2008-02-13 Thread Hamish Allan
fatal, but otherwise nothing is executed until EOF. So the answer to my question is to run: $ ssh localhost python -ui Best wishes, Hamish On Feb 13, 2008 4:20 PM, Hamish Allan <[EMAIL PROTECTED]> wrote: > Further to my query about trying to make Python run unbuffered, I have > discove

Re: Unbuffered mode

2008-02-13 Thread Hamish Allan
rror) does not: $ ssh localhost python -u pront [^D] Traceback (most recent call last): File "", line 1, in NameError: name 'pront' is not defined $ Can anyone tell me why?! Thanks, Hamish On Feb 13, 2008 1:12 AM, Hamish Allan <[EMAIL PROTECTED]> wrote: > Hi, &g

Unbuffered mode

2008-02-12 Thread Hamish Allan
27;) sys.stdout.flush() [^D] hello, world $ Again, nothing happens until I send the EOF. How can I get Python to run over SSH unbuffered? Thanks, Hamish -- http://mail.python.org/mailman/listinfo/python-list

Re: A way of checking if a string contains a number

2007-12-12 Thread Hamish
Thanks worked Perfectly On Dec 13, 9:32 am, [EMAIL PROTECTED] wrote: > On Dec 12, 3:10 pm, Hamish <[EMAIL PROTECTED]> wrote: > > > > > > > Hey > > > I'm new to python, but I have used a fair bit of C and Perl > > > I found Perls regex'

A way of checking if a string contains a number

2007-12-12 Thread Hamish
Hey I'm new to python, but I have used a fair bit of C and Perl I found Perls regex's to be very easy to use however I don't find Pythons regexes as good. All I am trying to do is detect if there is a number in a string. I am reading the string from an excel spread sheet using the xlrd module

Re: libgmail failure

2007-08-22 Thread Hamish Macpherson
On Aug 21, 5:07 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hey all, > > I've been usinglibgmailto send out automated notification emails for > my company's nightly regression testing. Last night these emails > started failing, though the python code has not changed. I updated to > the l

Re: Syslog

2007-08-20 Thread Hamish Moffatt
tc/syslog.conf or equivalent on your system. Hamish -- http://mail.python.org/mailman/listinfo/python-list

Re: SafeConfigParser can set unsafe values

2007-07-11 Thread Hamish Moffatt
27;t necessarily want to disable substitution, I just want transparent handling of lone %s. Since SafeConfigParser.get() is fussy about the format of interpolation instructions, SafeConfigParser.set() can safely know when you're not trying to use them and escape lone percents. To summarise: set(

Re: SafeConfigParser can set unsafe values

2007-07-10 Thread Hamish Moffatt
), causing a get() to fail just the same later. > While I think you have technically pointed out a potential bug, I'm > not sure why it matters. Such a bug only comes about for (IMHO) flawed > use cases. Sorry, that's incorrect. Hamish -- http://mail.python.org/mailman/listinfo/python-list

SafeConfigParser can set unsafe values

2007-07-10 Thread Hamish Moffatt
.py", line 634, in _interpolate_some "'%%' must be followed by '%%' or '(', found: %r" % (rest,)) ConfigParser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%there' ConfigParser does not do this: >>> y=ConfigParser.ConfigParser() >>> y.add_section('test') >>> y.set('test', 'a', 'hi%there') >>> y.get('test', 'a') 'hi%there' Should SafeConfigParser.set() be escaping automatically? Hamish -- http://mail.python.org/mailman/listinfo/python-list

Re: Integer division

2007-06-07 Thread Hamish Moffatt
[EMAIL PROTECTED] wrote: > On Jun 7, 2:15 pm, Hamish Moffatt <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> Hello all, >>> I have two integers and I want to divide one by another, and want to >>> get an integer result which is the higher

Re: Integer division

2007-06-07 Thread Hamish Moffatt
easier solution other than int(math.ceil(float(3)/2)) The normal solution is to add (divisor-1) to the dividend before division. Ie ceil(3/2) = floor((3+(2-1))/2) = 2. Correct. But ceil(4/2) = floor((4+(2-1))/2) = 2 also. Correct. Hamish -- http://mail.python.org/mailman/listinfo/python-list

Verify server certificate in HTTPS transaction

2007-06-07 Thread Hamish Moffatt
; perhaps it allows it. TLS Lite on to of M2Crypto? Something else again? Thanks Hamish -- http://mail.python.org/mailman/listinfo/python-list

Re: Oreilly CodeZoo

2005-08-05 Thread Hamish Macpherson
A sexy design? But yes, there are quite a few out there. -- http://mail.python.org/mailman/listinfo/python-list