Re: "/a" is not "/a" ?

2009-03-08 Thread Mark Dickinson
ration exception. I don't think Python really supports signaling NaNs in any meaningful way. I wonder what happens if you create an sNaN using struct.unpack(suitable_byte_string) and then try to do arithmetic on it in Python... Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: RichCompare and RichCompareBool

2009-03-09 Thread Mark Dickinson
On Mar 2, 10:33 am, Aaron Brady wrote: > The code for PyObject_RichCompare does not contain this, it doesn't > seem.  Is it a bug? It's not a bug. See revision 67204: http://svn.python.org/view?view=rev&revision=67204 Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: RichCompare and RichCompareBool

2009-03-09 Thread Mark Dickinson
d behavior of "x in [x]", btw.  There's no clear > case IMO.) I agree the docs are misleading. A doc patch would very likely be accepted. Changing the behaviour or name of PyObject_RichCompareBool would be trickier, since that would risk breaking 3rd party extensions that depend

Re: Eject a Removable USB drive

2009-03-09 Thread Mark Hammond
NE_DRIVEREMOVED, shellcon.SHCNF_PATH, "F:\\") seems to work for me (well - I actually did the above interactively after your code ran, and the disk magically vanished from explorer...) Cheers, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Mapping 64 bit int from C to Python-2.2

2009-03-10 Thread Mark Hammond
ywin32 had this requirement, and although support was recently removed, if you look at: http://pywin32.cvs.sourceforge.net/viewvc/pywin32/pywin32/win32/src/PyLARGE_INTEGER.cpp?revision=1.11&view=markup you should find routines that work without 'longlong' support in Python itself.

Re: Eject a Removable USB drive

2009-03-10 Thread Mark Hammond
ss is complete before sending the shell notification. Cheers, Mark while drive_exists: shell.SHChangeNotify(shellcon.SHCNE_DRIVEREMOVED, shellcon.SHCNF_PATH, "F:\\") Right now I've got: time.sleep(1) shell.SHChangeNotify(shellcon.SHCNE_DRIVEREMOVED, shellcon.SHCNF_PATH,

Re: Stopping SocketServer on Python 2.5

2009-03-10 Thread Mark Tolonen
libtorrent python bindings we need to use as part of the project. So, my question is, is there any way to stop a SocketServer that's been told to server forever in python 2.5? Sure, derive a class from one of the classes in SocketServer, and override the methods that implement the shu

Re: Stopping SocketServer on Python 2.5

2009-03-12 Thread Mark Tolonen
interval) if r: self._handle_request_noblock() self.__is_shut_down.set() -Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: PyWin32 for Python 3.x

2009-03-15 Thread Mark Hammond
This would be exactly the same for any version of Python; while the distutils create UI does suck, the problem has nothing to do with Python 3.0. I'm guessing you built it from source? If so, and as with every version of Python, you really just need the 'InstallPath' set ap

Re: PyWin32 for Python 3.x

2009-03-16 Thread Mark Tolonen
"cgoldberg" wrote in message news:[email protected]... Release 213 is out already: Tim, Mark, this is great news.. thanks for tracking 3.x so closely. I big barrier for me to eventually adopt 3.x is the ability to use pywin32. thank

equivalent of source command in tcl for python

2009-03-18 Thread mark . collier
Many times I am developing a code in a file and I want to, for example, exit at a specific line so that I can test something. In tcl you can just put an exit command in and source the file. Is there an equivalent for python? Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: parser module and doc

2009-03-20 Thread Mark Dickinson
nctionInfo and > ModuleInfo, but they don't exist: I think they're defined in the Demo/parser/example.py file. Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: meta question - how to read comp.lang.python w/o usenet feed/google interface?

2009-03-20 Thread Mark Tolonen
to comp.lang.python with something other than the regular web interface provided by google and you are happy with it, would you share it? I use the news.gmane.org usenet feeds. -Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Safe to call Py_Initialize() frequently?

2009-03-20 Thread Mark Hammond
e() call with a Py_Finalize() call? If it is not a safe approach, is there another way to get what I want? Start a new process each time? Cheers, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: how to convert from Decimal('1.23456789') to Decimal('1.234')

2009-03-23 Thread Mark Dickinson
ecimal('0.001')) Traceback (most recent call last): File "", line 1, in File "/Users/dickinsm/python_source/trunk/Lib/decimal.py", line 2364, in quantize 'quantize result has too many digits for current context') File "/Users/dickinsm/python_s

Re: how to convert from Decimal('1.23456789') to Decimal('1.234')

2009-03-23 Thread Mark Dickinson
;), 3) Decimal('1.235') This uses the rounding specified by the context, so if you want a rounding mode other than the default ROUND_HALF_EVEN, just set the context rounding appropriately: >>> from decimal import getcontext, ROUND_DOWN >>> getcontext().rounding = RO

Re: How can I do bit operation on python float value

2009-03-23 Thread Mark Dickinson
On Mar 23, 8:44 am, valpa wrote: > Yes, I want to do a & operation. Right, but what & operation, and why? Are you trying to do something that's mathematically meaningful? If so, there may be a better (more portable/faster/clearer) way than bit-twiddling. Mark -- http://mail.py

Re: Safe to call Py_Initialize() frequently?

2009-03-23 Thread Mark Hammond
On 23/03/2009 12:14 PM, Graham Dumpleton wrote: On Mar 21, 10:27 am, Mark Hammond wrote: Calling Py_Initialize and Py_Finalize multiple times does leak (Python 3 has mechanisms so this need to always be true in the future, but it is true now for non-trivial apps. Mark, can you please clarify

Re: Problem Python 2.6.1 vs 2.6 & pyWin32

2009-03-25 Thread Mark Hammond
, you should be able to use this version of distutils to build binaries for much earlier versions of Python and to allow the installer itself for that version to avoid depending on any msvcrt... Cheers, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem Python 2.6.1 vs 2.6 & pyWin32

2009-03-25 Thread Mark Hammond
would seem unusual that 249 out of 250 people would have that... Cheers, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe - win32com - GetGeneratePath Error

2009-03-25 Thread Mark Hammond
te .py files from COM typelibs, but they are capable of generating them at build time and distributing them with the app. You should ask whoever put the application together to read the py2exe docs to learn how to embed the generated files for ITunes directly inside the app. Cheers, Mark -- http://mail.python.org/mailman/listinfo/python-list

Python print and types selection

2009-03-27 Thread mark . seagoe
Python 2.5, PC. I have a question about getting Python print to be able to recognize a long type. class bignumber(object): def __init__(self, initval=0): self.val = initval # def __int__(self): print 'bignumber.__int__ returning a %s' % type(self.val) return self

Re: Python print and types selection

2009-03-27 Thread mark . seagoe
What I mean is, is there a way to change the class so that print will see it as a long, without having to cast it as one in the main program. -- http://mail.python.org/mailman/listinfo/python-list

Re: please include python26_d.lib in the installer

2009-03-27 Thread Mark Hammond
d a debug version of Python refuses to load the release versions without the _d. I'd recommend leaving DEBUG etc disbled, but enable debug information and disable optimizations while debugging. Cheers, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Python print and types selection

2009-03-27 Thread mark . seagoe
On Mar 27, 4:00 pm, Miles wrote: > On Fri, Mar 27, 2009 at 6:56 PM, Gabriel Genellina wrote: > > En Fri, 27 Mar 2009 18:43:16 -0300, escribió: > >> Python print recognizes the local constant "dog", but it goes and > >> fetches the __int__ type from my object-based class, even though it's > >> val

Re: Python print and types selection

2009-03-27 Thread mark . seagoe
On Mar 27, 7:48 pm, [email protected] wrote: > On Mar 27, 4:00 pm, Miles wrote: > > > > > > > On Fri, Mar 27, 2009 at 6:56 PM, Gabriel Genellina wrote: > > > En Fri, 27 Mar 2009 18:43:16 -0300, escribió: > > >> Python print recognizes the local constant "dog", but it goes and > > >> fetches t

Re: Python print and types selection

2009-03-28 Thread mark . seagoe
On Mar 27, 4:00 pm, Miles wrote: > On Fri, Mar 27, 2009 at 6:56 PM, Gabriel Genellina wrote: > > En Fri, 27 Mar 2009 18:43:16 -0300, escribió: > >> Python print recognizes the local constant "dog", but it goes and > >> fetches the __int__ type from my object-based class, even though it's > >> val

Re: Unladen-Swallow: A faster python

2009-03-28 Thread Mark Hammond
just temporarily broken due to the lack of windows developers/contributors... Saying-no-to-fud ly, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Python print and types selection

2009-03-29 Thread mark . seagoe
On Mar 28, 1:47 pm, Scott David Daniels wrote: > [email protected] wrote: > > ... > > It appears that if I make the class a subclass of long... > > class bignumber(long): > >     def __init__(self, initval): > >         self.val = initval > > > Then if I make a new class of subclass of bignumb

global name 'self' is not defined - noob trying to learn

2009-03-29 Thread mark . seagoe
= 'hello world' print 'TEST 1' dog = 0x123456789ABCDEF0 print 'type(dog) = %s' % type(dog) print 'dog val = 0x%016X' % dog print 'TEST 2' cat = myclass(0x55, my_reg) print 'cat val = 0x%016X' % cat print 'type(cat) = %s' % type(cat) Thanks! Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: global name 'self' is not defined - noob trying to learn

2009-03-29 Thread mark . seagoe
On Mar 29, 9:52 pm, Chris Rebert wrote: > On Sun, Mar 29, 2009 at 9:18 PM,   wrote: > > Hi.  So now I have this class that works to allow me to pass in my > > reg_info struct.  However when I try to make it part of my class it > > gets an error "global name 'self' is not defined.  I've never seen

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 29, 11:16 pm, Chris Rebert wrote: > 2009/3/29 Scott David Daniels : > > > [email protected] wrote: > > >> On Mar 29, 9:52 pm, Chris Rebert wrote: > > >>> On Sun, Mar 29, 2009 at 9:18 PM,   wrote: > > ... > > >>> ... Also, you shouldn't use `class_ ` as the name of the first argume

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 2:30 am, Jan Decaluwe wrote: > [email protected] wrote: > > Python 2.5.3 for business reasons. > > > So I want a class ShadowRegister, which just has a value that I can do > > get/set bit sel and slice ops.  I got that working with __init__.  It > > was subclass from "object".  Then

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
It needs to read HW reg and adjust ChipRegister value, or ShadowRegister and change the HW value (order was reversed). I will look at MyHDL again though to see if there is some reason it can print class subclassed from intbv, or if it even has a class subclassed from intbv, without casting as a l

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
print 'cat val = 0x%016X' % cat TypeError: int argument required Thanks, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 9:40 am, Scott David Daniels wrote: > [email protected] wrote: > > ... > > It seems like there's no way to do what I'm trying.  I am confined to > > Python 2.5.3 for business reasons. > > > So I want a class ShadowRegister, which just has a value that I can do > > get/set bit sel an

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 10:53 am, David Bolen wrote: > [email protected] writes: > > class myclass(object): > > # > >     # def __new__(class_, init_val, size, reg_info): > >     def __init__(self, init_val, size, reg_info): > > >         # self = object.__new__(class_) > >         self.reg_info = reg_info

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
If I cast it long then it prints fine, but I was hoping there would be a slicker way (to accomplish this in the class itself). print 'bird val = 0x%016X' % long(bird) -- http://mail.python.org/mailman/listinfo/python-list

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 11:53 am, Dave Angel wrote: > After taking out the class  myclass stuff, the code worked for me in > Python 2.6.1, through the cat line.  Could you please tell us what > version of Python you're running this on? > > import sys > print "Python version: ", sys.version > > yielded (on my m

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 12:01 pm, [email protected] wrote: > On Mar 30, 11:53 am, Dave Angel wrote: > > > After taking out the class  myclass stuff, the code worked for me in > > Python 2.6.1, through the cat line.  Could you please tell us what > > version of Python you're running this on? > > > import sy

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
s 2.5.3, sorry). > > This part is probably important > Python version:  2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 > 32 bit (Intel)] > > Not sure what you mean that you removed the class myclass.  Not sure > how it could work. > > Thanks- Hide quoted text - > > - Show quoted text - I can see now that this is futile. Upgrading to 2.6. I know when I've been whooped. Thanks. Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
Just as feedback, I went back to the __init__ style routine, weeded out a few things, installed python 2.6.1, and it works great. Thanks for all your help. Now I've got to convince 1000 people at my company to switch. That's going to be the tough part. -- http://mail.python.org/mailman/listinfo

Re: win32com python AttributeError!

2009-03-31 Thread Mark Hammond
My guess is that you have a hidden instance of excel running (ie, without a window). Check the task manager for instances of excel.exe and kill them. Cheers, Mark On 31/03/2009 3:17 PM, Michael wrote: Hi Python-list - Has anyone figured this out from Rebecca: Hi, I am having trouble

Re: Generators/iterators, Pythonicity, and primes

2009-04-04 Thread Mark Tolonen
ime numbers """ primes = [] for n in count(2): if all(n%p for p in primes if p < sqrt(n)): primes.append(n) yield n p <= sqrt(n) works a little better :^) -Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Definition of Pythonic?

2009-04-11 Thread Mark Wooding
John Yeung writes: > A couple of others have already mentioned the Zen of Python, available > at the Python command prompt. I would agree with that, but also add > the caveat that none of the principles expressed there are hard-and- > fast rules. Indeed, I'd suggest that the very lack of hard-a

Re: Regex similar to "^(?u)\w$", but without digits?

2009-04-11 Thread Mark Tolonen
t; Is there a possibility to restrict an expression like "\w" to "\w > without [0-9_]"? '(?u)[^\W0-9_]' removes 0-9_ from \w. -Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: regex for multiple whitespace-only lines

2009-04-12 Thread Mark Tolonen
le "C:\Python25\lib\re.py", line 180, in compile return _compile(pattern, flags) File "C:\Python25\lib\re.py", line 233, in _compile raise error, v # invalid expression error: nothing to repeat Does anyone know a work-round? PythonWin 2.6.1 (r261:67517, Dec 4

Re: Regex similar to "^(?u)\w$", but without digits?

2009-04-12 Thread Mark Tolonen
"Andreas Pfrengle" wrote in message news:[email protected]... On 12 Apr., 02:31, "Mark Tolonen" wrote: "Andreas" wrote in message news:[email protected]... > Hel

Re: any(), all() and empty iterable

2009-04-14 Thread Mark Dickinson
meets both the practicality *and* the purity criteria. Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: How to access C structures

2009-04-16 Thread Mark Tolonen
truct to Python? Check out the ctypes library. -Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: iterate to make multiple variables?

2009-04-19 Thread Mark Tolonen
te them? This will generate a list of nine unique, empty sets, box[0] through box[8]: box = [set() for i in range(9)] -Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and GMP.

2009-04-20 Thread Mark Dickinson
lar attempt in this direction (by Victor Stinner); I don't know whether more work would have fixed this. The other major issue is licensing: as far as I recall, the various discussions never came to a conclusion about the legal implications of using GMP. Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and GMP.

2009-04-20 Thread Mark Dickinson
On Apr 20, 10:36 pm, Mark Dickinson wrote: > The other major issue is licensing:  as far as I recall, the > various discussions never came to a conclusion about the legal > implications of using GMP. It took me a while to find it... See the thread starting at http://mail.python.org/

Re: Python and GMP.

2009-04-21 Thread Mark Dickinson
that there's no way to tell C to do a 64-bit by 32-bit division, in cases where you know (from understanding of the algorithm) that the quotient fits into 32 bits. On x86, replacing just two of the divisions in Objects/longsobject.c by the appropriate 'divl' inline assembler got me

Re: Python and GMP.

2009-04-21 Thread Mark Dickinson
n platforms, and that's really a no-go area for Python. There's at least one more optimization (to multiplication, as it happens) that I plan to get in before 3.1. See http://bugs.python.org/issue3944 Apart from that, I'm not sure there's much snot left to be optimized out,

python in Emacs (windows)

2009-04-22 Thread Mark Zweers
/Program Files/Python")) This is the path where my 'python.exe' is located. But then this message occurs: Using the CPython shell let: Wrong type argument: integerp, "C:/Program Files/Python" Could anyone tell me how to solve this? Thanks a lot in advance! Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Would you support adding UNC support to os.path on Windows?

2009-04-22 Thread Mark Hammond
oise from the people with the most experience actually using these functions - ie, those people here. My hope was that some vague consensus here would offer more ammunition when finally taking it to python-dev for consideration (or kill it without taking it there - but it's looking good :

python list handling and Lisp list handling

2009-04-24 Thread Mark Tarver
Are they equivalent to Lisp lists. Can CAR and CDR in Lisp be thought of as def car (x): return x[0] def cdr (x): return x[1:] The idea of a list in which elements can be accessed in constant time is novel to me. Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: python list handling and Lisp list handling

2009-04-24 Thread Mark Tarver
On 24 Apr, 17:19, Paul Rubin <http://[email protected]> wrote: > Mark Tarver writes: > > But are Python lists also indistinguishable from conventional > > Lisplists for list processing.   > > Forgot to add: you might look athttp://norvig.com/python-lisp.html >

Re: python list handling and Lisp list handling

2009-04-24 Thread Mark Tarver
On 24 Apr, 19:54, Arnaud Delobelle wrote: > Mark Tarver writes: > > Ah;  so this > > > def cons (x,y): > >   return [x] + y > > > is not accurate? > > Depends what you mean by accurate! > > in lisp, if you do: > >     (setq a '(1 2)) >

Re: Windows Shell Extensions - Out of Proc

2009-04-24 Thread Mark Hammond
a "proxy" COM object as InProc, which then forwards the requests to my COM object in the separate process? Not that I know of - anyone else? That's my understanding too (and probably for good reason - shell extensions can be called lots!) Mark -- http://mail.python.org/m

Re: pythoncom -- ImportError: DLL load failed - Solved, sort of.

2009-04-24 Thread Mark Hammond
Richard Whidden wrote: I installed a clean copy of Python 2.5, pywin32 and PyGreSQL and it works. I'll have to figure out what broke with my 2.6 install. Make sure you have 2.6.2 Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: python list handling and Lisp list handling

2009-04-25 Thread Mark Tarver
On 25 Apr, 05:01, Carl Banks wrote: > On Apr 24, 8:19 am, Mark Tarver wrote: > > > > > > > This page says that Python lists are often flexible arrays > > >http://www.brpreiss.com/books/opus7/html/page82.html > > > but also says that their representation

Re: python list handling and Lisp list handling

2009-04-25 Thread Mark Tarver
What is different is the concept of "all globals that > reference G".  For example: > > >>> a = [1, 2, 3] > >>> b = a > >>> a[0] = 0 > >>> print b > > [0, 2, 3] I see that Python had an id too ;). Mark -- http://mail.python.org/mailman/listinfo/python-list

ANN: Shed Skin 0.1.1

2009-04-25 Thread Mark Dufour
y blog for some ideas on how to help out. More test cases and bug reports would also be very welcome. Thanks, Mark Dufour. -- "One of my most productive days was throwing away 1000 lines of code" - Ken Thompson -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp mentality vs. Python mentality

2009-04-25 Thread Mark Wooding
Carl Banks writes: > Graham, for his part, doesn't seem to appreciate that what he does is > beyond hope for average people, and that sometimes reality requires > average people to write programs. I think he understands that perfectly well. But I think he believes that the sorts of tools which

Re: python list handling and Lisp list handling

2009-04-25 Thread Mark Wooding
Mark Tarver writes: > But are Python lists also indistinguishable from conventional > Lisplists for list processing. > > For example, can I modify a Python list non-destructively? No. > Are they equivalent to Lisp lists. Can CAR and CDR in Lisp be thought > of as > >

Re: Into itertools

2009-04-27 Thread Mark Dickinson
(itertools.combinations(range(5), 2)) [(0, 1), (0, 2), (0, 3), (0, 4), (1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)] Mark -- http://mail.python.org/mailman/listinfo/python-list

how to coerce to a string in Python?

2009-04-28 Thread Mark Tarver
How do you coerce an object to a string in Python? 123 --> "1 2 3" [1,2,3] -> "[1,2,3]" etc Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: how to coerce to a string in Python?

2009-04-28 Thread Mark Tarver
On 28 Apr, 19:58, Mark Tarver wrote: > How do you coerce an object to a string in Python? > > 123 --> "1 2 3" > [1,2,3] -> "[1,2,3]" etc > > Mark Ah , 'str' a pure guess but it worked. Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Python 2.5.4 from Source under Windows

2009-04-29 Thread Mark Hammond
the addition of an 'InstallPath' registry entry pointing at your directory, other .exe installer packages created by distutils will also install correctly. Hope this helps, Mark -- http://mail.python.org/mailman/listinfo/python-list

unbinding a global variable in Python

2009-04-30 Thread Mark Tarver
In Lisp this is done so > (setq *g* 0) 0 > *g* 0 > (makunbound '*g*) *g* > *g* error: unbound variable How is this done in Python? Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: unbinding a global variable in Python

2009-04-30 Thread Mark Tarver
On 30 Apr, 12:36, "Diez B. Roggisch" wrote: > Mark Tarver wrote: > > In Lisp this is done so > > >> (setq *g* 0) > > 0 > > >> *g* > > 0 > > >> (makunbound '*g*) > > *g* > > >> *g* > > error: unbound

Re: Installing Python 2.5.4 from Source under Windows

2009-04-30 Thread Mark Hammond
Paul Franz wrote: Mark, The problem is that the steps are not in the readme.txt for the building Python for Windows. The python.exe might work from the Win32Release directory where it is compiled. You should find the executables and DLLs directly in the PCBuild directory (for an x86

web access through vpn client

2009-05-01 Thread mark . seagoe
is turned on. I've looked around for a solution but can't find... perhaps I'm not entering the right search words. I don't even know where to start. Can anyone suggest some good reading, or basic idea how to approach? Thanks, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: web access through vpn client

2009-05-01 Thread mark . seagoe
search words.  I don't even know where to start. > > Can anyone suggest some good reading, or basic idea how to approach? > > > Thanks, > > Mark > > When the VPN client is on, can you actually still browse the 'classical' > way to the website in question? >

Re: for with decimal values?

2009-05-02 Thread Mark Dickinson
. As a result, it's not clear whether the value of i for the last loop is going to be 10.4+small_error or 10.5-small_error. Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: web access through vpn client

2009-05-02 Thread mark . seagoe
> except if my VPN client is turned on. > >>> I've looked around for a solution but can't find... perhaps I'm not > >>> entering the right search words.  I don't even know where to start. > >>> Can anyone suggest some good reading, or basic idea

Re: Question of UTF16BE encoding / decoding

2009-05-04 Thread Mark Tolonen
re, but I am getting the error: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0- 11: ordinal not in range(128) And my debugger seems to show a load of unicode when it breaks. import binascii s = '004e006100700061006c006d' h = binascii.unhexlif

Public attributes with really private data

2009-05-07 Thread Mark Summerfield
ner=None): if instance is None: return self return self.__getter(instance) def __set__(self, instance, value): if self.__setter is None: raise AttributeError("'{0}' is read-only".format( self.__name__))

Re: Public attributes with really private data

2009-05-08 Thread Mark Summerfield
= Attribute("a", 5, lambda *a: True) b = Attribute("b", 5, lambda *a: True) >>> a = A() >>> b = B() >>> a.a,a.b,b.a,b.b (5, 5, 5, 5) >>> a.a=1;a.b=2;b.a=3;b.b=4 >>> a.a,a.b,b.a,b.b (1, 2, 3, 4) -- Mark Summerfield, Qtrac Ltd, www.qtrac.eu C++, Python, Qt, PyQt - training and consultancy "Programming in Python 3" - ISBN 0137129297 -- http://mail.python.org/mailman/listinfo/python-list

Re: Public attributes with really private data

2009-05-08 Thread Mark Summerfield
it.) > I am not opposed to adding a little well-considered protection to some > attributes where mistakes are prone to happen and/or dangerous, but it > is futile to try to stop access entirely.  There's just too many back > doors. Sure, but I like the fact that there is no "

Re: Public attributes with really private data

2009-05-08 Thread Mark Summerfield
[snip] > By the way, your Attribute descriptor stores the value for all instances of > A in the same variable... > > Peter You're right. -- http://mail.python.org/mailman/listinfo/python-list

Re: Public attributes with really private data

2009-05-08 Thread Mark Summerfield
values are shared between all instances of the same class: > > >>> class A: > > ...     x = Attribute("x", 42, lambda *a: True) > ...>>> a = A() > >>> b = A() > >>> a.x, b.x > (42, 42) > >>> a.x = "yadda" > >>> a.x, b.x > > ('yadda', 'yadda') > > Peter Yes. I did think of trying to create the closures dynamically the first time the getter or setter was called---but that _is_ getting ugly, so I'll give it up:-) Thanks! -- Mark Summerfield, Qtrac Ltd, www.qtrac.eu C++, Python, Qt, PyQt - training and consultancy "Programming in Python 3" - ISBN 0137129297 -- http://mail.python.org/mailman/listinfo/python-list

Re: Public attributes with really private data

2009-05-08 Thread Mark Summerfield
On 8 May, 13:56, Peter Otten <[email protected]> wrote: > Mark Summerfield wrote: > > On 8 May, 08:19, Peter Otten <[email protected]> wrote: > >> MarkSummerfieldwrote: > >> > I had a quick search & didn't find anything _nice_ that produced >

Re: unicode bit me

2009-05-09 Thread Mark Tolonen
recent call last): File "", line 1, in File "C:\dev\python\lib\encodings\cp437.py", line 12, in encode return codecs.charmap_encode(input,errors,encoding_map) UnicodeEncodeError: 'charmap' codec can't encode character u'\xa9' in position 0: character maps to Hope that helps your understanding, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode bit me

2009-05-09 Thread Mark Tolonen
"Piet van Oostrum" wrote in message news:[email protected]... "Mark Tolonen" (MT) wrote: MT> wrote in message MT> news:[email protected]... Sorry being unclear again, hmm I am becoming an expert in

Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-11 Thread Mark Hammond
Probably some import statement is finding a .pyd module built against Python 2.5 instead of Python 2.6; it might be that PYTHONPATH points somewhere wrong, or the registry for Python 2.6 is setup wrong, or something else entirely... Cheers, Mark On 12/05/2009 3:13 PM, David Lyon wrote: Hi

Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-13 Thread Mark Hammond
installed, it would still fail. The installer didn't set PYTHONPATH, a human did. Cheers, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: 4 hundred quadrillonth?

2009-05-22 Thread Mark Dickinson
On May 22, 3:28 pm, Steven D'Aprano wrote: > On Thu, 21 May 2009 18:30:17 -0700, Gary Herron wrote: > >> In py3k Eric Smith and Mark Dickinson have implemented Gay's floating > >> point algorithm for Python so that the shortest repr that will round > >&g

scripting and uploading in Python

2009-05-26 Thread Mark Tarver
pace using passwords. thanks Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: 4 hundred quadrillonth?

2009-05-27 Thread Mark Dickinson
Luis Zarrabeitia wrote: > On Thursday 21 May 2009 08:50:48 pm R. David Murray wrote: > >> In py3k Eric Smith and Mark Dickinson have implemented Gay's floating >> point algorithm for Python so that the shortest repr that will round >> trip correctly is what is us

Re: Generating all combinations

2009-05-31 Thread Mark Dickinson
[ (1), (2), (3) ] Presumably you mean [(1,), (2,), (3,)] here? Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: import sqlite3

2009-06-04 Thread Mark Tolonen
"willgun" wrote in message news:[email protected]... By the way ,what does 'best regards' means at the end of a mail? I think 恭祝 may be a good translation. -Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Mathematics in Python are not correct

2008-05-11 Thread Mark Dickinson
ecimal(0) raises an exception, but Decimal('Inf')**Decimal(0) returns Decimal(1). Which doesn't make a lot of sense, since every reason for making 0**0 undefined seems to apply equally well to infinity**0... Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Mathematics in Python are not correct

2008-05-12 Thread Mark Dickinson
ightly schizophrenic about this: > > That module follows the IBM-led standard, no matter how crazy. Yeah---I know. :-). The current decimal __pow__ code is mostly my fault, at least in 2.5.2/2.6/3.0 onwards. For what it's worth, the author of the Decimal standard has indicated that the

Re: Mathematics in Python are not correct

2008-05-12 Thread Mark Dickinson
lf into a hole here. I'm personally firmly in the "0**0 should be 1" camp, and always have been--- there are just too many practical benefits to defining 0**0==1 to ignore, and in the case where you're interested in integer exponents anything else is just plain wrong. The lack of

Re: anonymous assignment

2008-05-13 Thread Mark Wooding
Ben Finney <[EMAIL PROTECTED]> wrote: > Paul Rubin writes: >> You can just use a variable name than you ignore. It's traditional >> to use _ but it's not a special keyword, it's just a another >> variable name: >> >>y, _, d, _, _, _, _, _, _ = time.localtime() > > It

Re: python: lexical or dynamic scope?

2008-05-14 Thread Mark Wooding
Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > AFAIK, Python has lexical scoping, with the restriction that > non-global non-local names cannot be rebound. I believe so. It's possible to implement (shallow) dynamic binding as a Python context manager, though it involves a little unpleasantness wi

Re: Using the indent method

2008-05-14 Thread Mark Tolonen
ons. Using the version of indent() found on http://effbot.org/zone/element-lib.htm: from xml.etree import ElementTree as ET x='stuff' e=ET.fromstring(x) ET.dump(e) stuff indent(e) ET.dump(e) stuff -Mark -- http://mail.python.org/mailman/listinfo/python-list

<    41   42   43   44   45   46   47   48   49   50   >