break in a module

2011-06-14 Thread Eric Snow
ame__ == "__main__": name = util.get_module_name(sys.modules[__name__]) module = importlib.import_module(name) sys.modules[__name__] = module break # do my normal stuff at 0 indentation level So, any thoughts? Thanks. -eric p.s. I might just handle this with

Re: how to inherit docstrings?

2011-06-10 Thread Eric Snow
On Thu, Jun 9, 2011 at 12:22 AM, Eric Snow wrote: > Sometimes when using class inheritance, I want the overriding methods > of the subclass to get the docstring of the matching method in the > base class.  You can do this with decorators (after the class > definition), with class dec

Re: how to inherit docstrings?

2011-06-10 Thread Eric Snow
n the instance. You are right about a custom descriptor. -eric >>>> class DocDescriptor(object): > ...   def __get__(self, instance, owner): > ...     return getattr(owner, "_mydoc", None) > ... >>>> class Meta(type): > ...   def __init__(cls, name, b

Re: how to inherit docstrings?

2011-06-10 Thread Eric Snow
FYI, I started this topic up on python-ideas, as it seemed valid enough from the responses I've gotten here [1]. -eric [1] http://mail.python.org/pipermail/python-ideas/2011-June/010473.html -- http://mail.python.org/mailman/listinfo/python-list

Re: how to inherit docstrings?

2011-06-10 Thread Eric Snow
n-empty > docstring. > > Yeah, the idea of an empty docstring to trigger docstring inheritance really appeals to me. Nice example. Incidently, aren't metaclasses always inherited, as opposed to class decorators (which are never)? -eric > > def InheritableDocstring(name, bases

Re: how to inherit docstrings?

2011-06-10 Thread Eric Snow
On Fri, Jun 10, 2011 at 5:05 AM, Tim Chase wrote: > On 06/09/2011 01:22 AM, Eric Snow wrote: >> >> Sometimes when using class inheritance, I want the overriding methods >> of the subclass to get the docstring of the matching method in the >> base class.  You can do this

Re: how to inherit docstrings?

2011-06-09 Thread Eric Snow
to say don't do it. With your idea you easily, clearly, and explicitly indicate that you want the inheritance activated. That would work for me. -eric > -- > Terry Jan Reedy > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Re: how to inherit docstrings?

2011-06-09 Thread Eric Snow
-cased to be worth the trouble. I can just use a metaclass or class decorator that does that, and override builtin.__build__class__ to force its use everywhere; or use one base class for all my classes that uses the metaclass. But it would be nice to have implicit support. -eric > > Carl Banks > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Re: how to inherit docstrings?

2011-06-09 Thread Eric Snow
up the inheritance hierarchy >> when given a method that doesn't have a docstring of its own. > > Since the docstrings are useful in more places than just ‘help’, I'm +1 > on having docstrings be automatically inherited if not specified. > > Would the OP like to propose th

__doc__ immutable for classes (was: Re: how to inherit docstrings?)

2011-06-09 Thread Eric Snow
On Thu, Jun 9, 2011 at 10:10 AM, Ethan Furman wrote: > Eric Snow wrote: >> >> p.s. Am I missing something or can you really not change the docstring >> of a class?  I was thinking about the idea of inheriting class >

Re: how to inherit docstrings?

2011-06-09 Thread Eric Snow
ven a method that doesn't > have a docstring of its own. > Auto inheriting docstrings would be nice, in some cases. WRT help(), keep in mind that docstrings are used for a bunch of other things, like doctests and some DSLs. -eric > Unfortunately, since unbound methods were ditched, >

Re: how to inherit docstrings?

2011-06-09 Thread Eric Snow
On Thu, Jun 9, 2011 at 12:37 AM, Ben Finney wrote: > Eric Snow writes: > >> p.s. Am I missing something or can you really not change the docstring >> of a class? I was thinking about the idea of inheriting class >> docstrings too. > > The docstring of an object

how to inherit docstrings?

2011-06-08 Thread Eric Snow
, or am I "stuck" with the metaclass/class decorator route? (It's not all that bad :) Thanks! -eric p.s. Am I missing something or can you really not change the docstring of a class? I was thinking about the idea of inheriting class docstrings too. [1] http://code.activest

Validating string for FDQN

2011-06-06 Thread Eric
Hello, Is there a library or regex that can determine if a string is a fqdn (fully qualified domain name)? I'm writing a script that needs to add a defined domain to the end of a hostname if it isn't already a fqdn and doesn't contain the defined domain. Thanks. -- http://mail.python.org/mailman

Re: new string formatting with local variables

2011-06-06 Thread Eric Snow
trange. > > I'd like something like this: > print "{solo} was captured by {jabba}".format(locals())        # WRONG! > > But it doesn't work. > > Do you have any idea? > You were close: print "{solo} was captured by {jabba}".format(**locals()) This will turn l

Re: returning NotImplemented

2011-05-31 Thread Eric Snow
On Tue, May 31, 2011 at 6:30 PM, Ethan Furman wrote: > Eric Snow wrote: > >> Guido indicates earlier in the thread that NotImplemented is used so that >> you know that it came from the function that you directly called, and not >> from another call inside that function.

Re: returning NotImplemented

2011-05-31 Thread Eric Snow
On Tue, May 31, 2011 at 4:18 PM, Ethan Furman wrote: > Eric Snow wrote: > >> Looking at the ABC code [1], I noticed that Mapping's __eq__ method can >> return NotImplemented. This got me curious as to why you would return >> NotImplemented and not raise a TypeE

Re: returning NotImplemented

2011-05-31 Thread Eric Snow
On Tue, May 31, 2011 at 3:46 PM, Eric Snow wrote: > Looking at the ABC code [1], I noticed that Mapping's __eq__ method can > return NotImplemented. This got me curious as to why you would return > NotImplemented and not raise a TypeError or a NotImplementedError. > >

returning NotImplemented

2011-05-31 Thread Eric Snow
there a good way to tell the difference, or would it be good practice to always handle explicitly in a function any exception type that you may be raising there? Thanks, -eric [1] http://hg.python.org/cpython/file/29e08a98281d/Lib/collections/abc.py#l398 [2] http://bugs.python.org/issue8729 [

Re: Python's super() considered super!

2011-05-27 Thread Eric Snow
;def last_item(self): >return list.last_item(self) + 1 > > > I was thrilled to learn a new trick, popping keyword arguments before > calling super, and wondered why I hadn't thought of that myself. How on > earth did I fail to realise that a kwarg dict was mut

Re: super() in class defs?

2011-05-25 Thread Eric Snow
it has its place). Personally, I find super to make maintenance and refactoring easier, since I don't have to fiddle with the base class name, or with passing self. Cheers, -eric > http://fuhm.net/super-harmful/ > > Cheers, > Ian > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Re: validating a class against an ABC at definition time

2011-05-20 Thread Eric Snow
On Fri, May 20, 2011 at 4:55 PM, Eric Snow wrote: > > I have revised this and made a recipe for it: > > > http://code.activestate.com/recipes/577711-validating-classes-and-objects-against-an-abstract/ > > I also added this: http://code.activestate.com/recipes/577712-add

Re: validating a class against an ABC at definition time

2011-05-20 Thread Eric Snow
On Thu, May 19, 2011 at 11:33 PM, Eric Snow wrote: > Thinking about class APIs and validating a class against an API. The abc > module provides the tools to do some of this. One thing I realized, that I > hadn't noticed before, is that the abstractness of a class is measured when

ABC validation strictly on an instance

2011-05-20 Thread Eric Snow
However, they mostly seem like overkill to me. I have included them below. If anyone has ideas on how to approach the problem of using an ABC but satisfying it with instance names, I would love to hear it. Thanks! -eric [1] In this case it would be nice to know at definition time that the c

validating a class against an ABC at definition time

2011-05-19 Thread Eric Snow
that programmatically. Does anyone know a better way to do ABC validation at definition time? Thanks. -eric -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3 vs Python 2.7 dilemma

2011-05-17 Thread Eric Snow
es transition the remaining ones have less reason to stay on Python 2. The anticipation was to see everyone on Python 3 by 5 years after its release. It was released just over 2.5 years ago. Here are some references that you might find helpful: http://wiki.python.org/moin/Python2orPython3 http:

portable multiprocessing code

2011-05-17 Thread Eric Frederich
I have written some code using Python 2.7 but I'd like these scripts to be able to run on Red Hat 5's 2.4.3 version of Python which doesn't have multiprocessing. I can try to import multiprocessing and set a flag as to whether it is available. Then I can create a Queue.Queue instead of a multiproc

Re: How best to convert a string "list" to a python list

2011-05-13 Thread Eric Snow
t color_list >print x + "\n" > > color_list.append(x) # append last color left in x (no sc at end of > string) > print color_list > > print "done" > -- > http://mail.python.org/mailman/listinfo/python-list > Try the following: color_list = x.split(&

Re: list equal to subclass of list?

2011-05-12 Thread Eric Snow
ny of the builtin types have custom special methods for a variety of operators, including comparison. Looking over the documentation, it seems like it could be touched up to alleviate any confusion. Perhaps rewording to make it clear that the described behavior is the default for objects,

Re: checking if a list is empty

2011-05-11 Thread Eric Snow
at I needed to look it up. I do know that the builtin list has a __eq__ method and a __len__ method, but not a __bool__ method (which it doesn't need [3]). -eric [1] http://docs.python.org/dev/py3k/reference/compound_stmts.html#the-if-statement [2] http://docs.python.org/dev/py3k/referen

Re: checking if a list is empty

2011-05-06 Thread Eric Snow
list empty (length 0) or is the boolean version false? Again, for lists these are the same. For list-like classes they are not necessarily the same. Incidently, you can also check "if li == []:". This will let the __eq__ operator jump in. -eric [1] http://docs.python.org/dev/py3k/re

Re: Composition instead of inheritance

2011-04-28 Thread Eric Snow
But generally that would help bridge the inheritance gap for isinstance cases. -eric p.s. I would have commented on the recipe but could not log in... -- http://mail.python.org/mailman/listinfo/python-list

Re: NaN

2011-04-28 Thread Eric Snow
On Thu, Apr 28, 2011 at 11:01 AM, Chris Rebert wrote: > On Thu, Apr 28, 2011 at 9:21 AM, Eric Snow > wrote: > > There's a big discussion going on at python-dev and python-ideas about > NaN > > (not-a-number, from IEEE 754). I haven't really gotten into any > s

NaN

2011-04-28 Thread Eric Snow
not clear: 1. Why is NaN not an exception? (not "why not change it to one?" Changing it now would probably break stuff.) 2. What are the use cases for NaN? Looks like it gets used a lot as a numeric (float?) object with non-value. Any clarification would be really helpful. Tha

multiple Python 2.7 Windows installations

2011-04-19 Thread Eric Frederich
lease? Thanks, ~Eric -- http://mail.python.org/mailman/listinfo/python-list

Re: installing setuptools on Windows custom python install

2011-04-19 Thread Eric Frederich
his file would the socket library then be built into the main dll file? I'm not sure exactly how to use this config.c file. Thanks, ~Eric On Mon, Apr 18, 2011 at 2:30 PM, Wolfgang Rohdewald wrote: > On Montag 18 April 2011, Eric Frederich wrote: >>   File "F:\My_Python27\lib\s

installing setuptools on Windows custom python install

2011-04-18 Thread Eric Frederich
Hello, I have a python installation that I built myself using Visual Studio 2005. I need this version because I need to link Python bindings to a 3rd party library that uses VS 2005. I want to get setuptools installed to this Python installation but the installer won't find my version of Python e

PEP index by topic

2011-04-14 Thread Eric Snow
love to see an index like this in PEP 1, but it may not be practical, as the topics in the index can grow pretty dynamically. Maybe a snapshot of the wiki content could be added to PEP 1? Or maybe just a link there to the wiki page? Regardless, I hope everyone finds a topical PEP inde

Re: Nested inner classes and inheritance -> namespace problem

2011-04-13 Thread Eric Snow
class InnerSubclass(Inner): nonlocal Inner class Worker(Inner.Worker): pass return Outer That would pull Inner into the namespace of InnerSubclass, allowing Worker to use it in the bases declaration. If you really want to get crazy, I suppose you could do so metaclass hackery... -eric > Thanks, > > > *larry* > ** > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- http://mail.python.org/mailman/listinfo/python-list

Re: python on iPad (PyPad)

2011-04-09 Thread Eric Snow
On Fri, Apr 8, 2011 at 11:13 PM, Jon Dowdall wrote: > Hi All, > > Sorry for the blatant advertising but hope some of you may be interested > to know that I've created an iPad application containing the python > interpreter and a simple execution environment. It's available in iTunes > at http://it

Re: python on iPad (PyPad)

2011-04-08 Thread Eric Snow
On Fri, Apr 8, 2011 at 11:13 PM, Jon Dowdall wrote: > Hi All, > > Sorry for the blatant advertising but hope some of you may be interested > to know that I've created an iPad application containing the python > interpreter and a simple execution environment. It's available in iTunes > at http://it

Re: TypeError: iterable argument required

2011-04-06 Thread Eric Snow
n.org/library/stdtypes.html#truth-value-testing>-eric 2011/4/6 Νικόλαος Κούρας > >>> mail = None > >>> mail = mail or 7 > >>> mail > 7 > > >>> mail = None > >>> mail = 7 or mail > >>> mail > 7 > > Here

Re: embedding interactive python interpreter

2011-03-27 Thread Eric Frederich
: > On Friday, March 25, 2011 12:02:16 PM UTC-4, Eric Frederich wrote: >> >> Is there something else I should call besides "exit()" from within the >> interpreter? >> Is there something other than Py_Main that I should be calling? > > Does PyRun_Interactive

Re: embedding interactive python interpreter

2011-03-27 Thread Eric Frederich
ot; or "sys.exit(123)". I cannot call any of my C cleanup code because of this. On Sun, Mar 27, 2011 at 1:55 PM, Jerry Hill wrote: > On Sun, Mar 27, 2011 at 9:33 AM, Eric Frederich > wrote: >> This is behavior contradicts the documentation which says the value >>

Re: embedding interactive python interpreter

2011-03-27 Thread Eric Frederich
This is behavior contradicts the documentation which says the value passed to sys.exit will be returned from Py_Main. Py_Main doesn't return anything, it just exits. This is a bug. On Sun, Mar 27, 2011 at 3:10 AM, Mark Hammond wrote: > On 26/03/2011 4:37 AM, Eric Frederich wrote: >

Re: embedding interactive python interpreter

2011-03-25 Thread Eric Frederich
Added a fflush(stdout) after each printf and, as I expectedstill only the first 2 prints. On Fri, Mar 25, 2011 at 1:47 PM, MRAB wrote: > On 25/03/2011 17:37, Eric Frederich wrote: >> >> So I found that if I type ctrl-d then the other lines will print. >> >>

Re: embedding interactive python interpreter

2011-03-25 Thread Eric Frederich
to pass a value back from the interpreter via sys.exit. Thanks, ~Eric On Fri, Mar 25, 2011 at 12:02 PM, Eric Frederich wrote: > I am able to embed the interactive Python interpreter in my C program > except that when the interpreter exits, my entire program exits. > >    #include >

embedding interactive python interpreter

2011-03-25 Thread Eric Frederich
ed. I need to embed python in an application that needs to do some cleanup at the end so I need that code to execute. What am I doing wrong? Is there something else I should call besides "exit()" from within the interpreter? Is there something other than Py_Main that I should be calling? Thanks, ~Eric -- http://mail.python.org/mailman/listinfo/python-list

Re: Another related OO Python ?

2011-02-16 Thread Eric Brunel
In article <6849fd3f-5116-4b35-b274-dc76ae39f...@a11g2000pro.googlegroups.com>, RJB wrote: > On Feb 16, 12:48 am, Eric Brunel > wrote: > > In article , > >  Doug Epling wrote: > > > > > hey, does anyone find the UML useful during Python development of l

Re: How does IDLE do it?

2011-02-16 Thread Eric Brunel
In article , "Richard D. Moores" wrote: > I recently wrote some code that prints information about the 'jukugo' > used in Japanese newspaper articles. A jukugo is a Japanese word > written with at least 2 kanji. An example of a 2-kanji jukugo is 危機 > (kiki -- crisis). I found that I could no

Re: Another related OO Python ?

2011-02-16 Thread Eric Brunel
In article , Doug Epling wrote: > hey, does anyone find the UML useful during Python development of larger > projects? Well, UML being very Java/C++ oriented, I found out that Python idioms were really difficult to represent in the diagrams. So I'm using it to a very small extent and for doc

Re: EPD 7.0 released

2011-02-09 Thread Eric Stechmann
Hi, son. Don't know if this would be of any interest to you. Well, I suppose it does provide some interesting. I hope your physical get-together will help out. Love you, David. Dad On Feb 9, 2011, at 8:13 AM, Ilan Schnell wrote: > Hello, > > I am pleased to announce that EPD (Enthought

New article on grabbing city points from geonames, processing with Python, and rendering in MapPoint

2011-02-03 Thread Eric Frost
Add City Coverage to MapPoint using the GeoNames Database by Richard Marsden http://www.mapforums.com/add-city-coverage-mappoint-using-geonames-database-15244.html -- m: 312-399-1586 http://www.MapForums.com http://www.MP2Kmag.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating custom Python objects from C code

2011-01-05 Thread Eric Frederich
On Wed, Jan 5, 2011 at 11:39 AM, Antoine Pitrou wrote: > On Wed, 5 Jan 2011 11:27:02 -0500 > Eric Frederich wrote: >> I have read through all the documentation here: >> >>     http://docs.python.org/extending/newtypes.html >> >> I have not seen any documenta

Creating custom Python objects from C code

2011-01-05 Thread Eric Frederich
files. Question 2: How do I make C helper functions that are part of my extension available to other C projects in the same way that PyList_*, PyString_*, PyInt_* functions are available? Is it possible to have distutils make a .lib file for me? Thanks, ~Eric -- http://mail.python.org/mailman/lis

Re: [python-committers] [RELEASED] Python 3.2 beta 2

2010-12-22 Thread Eric Smith
On 12/22/2010 8:46 AM, Georg Brandl wrote: Am 22.12.2010 02:15, schrieb Nick Coghlan: On Wed, Dec 22, 2010 at 6:18 AM, Georg Brandl wrote: Since PEP 3003, the Moratorium on Language Changes, is in effect, there are no changes in Python's syntax and built-in types in Python 3.2. Minor nit - w

Re: Creating custom types from C code

2010-12-20 Thread Eric Frederich
n and instantiate that type from C? On Sat, Dec 18, 2010 at 1:18 AM, Stefan Behnel wrote: > Eric Frederich, 17.12.2010 23:58: >> >> I have an extension module for a 3rd party library in which I am >> wrapping some structures. >> My initial attempt worked okay on Windo

Creating custom types from C code

2010-12-17 Thread Eric Frederich
Hello, I have an extension module for a 3rd party library in which I am wrapping some structures. My initial attempt worked okay on Windows but failed on Linux. I was doing it in two parts. The first part on the C side of things I was turning the entire structure into a char array. The second part

Reference counting problems?

2010-12-09 Thread Eric Frederich
O", python__x); Are python__x and python__return_val the same object, a copy of the object? Would python__x ever get garbage collected? Should my code generator detect when there is only one output and not go through the extra step? Thanks, ~Eric static PyObject * wrapped_foo(PyObject *self,

Re: Using a window style in a Toplevel window

2010-12-09 Thread Eric Brunel
In article , pyt...@bdurham.com wrote: > Eric, > > Besides style support, what are the advantages of ttk.Frame vs. > Tkinter.Frame? I'd say none. They are both just containers for other widgets, support the same layout managers, and so on. For me, using a ttk.Frame is really

Re: Using a window style in a Toplevel window

2010-12-09 Thread Eric Brunel
that I have put the creation of the button and its packing in 2 lines. You should never do variable = widget.pack(…) since pack does not return the widget. It always returns None, so doing so won't put your widget in the variable). The code above should do what you're after. > Thanks in advance. HTH - Eric - -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple modules from single c extension

2010-12-02 Thread Eric Frederich
e for each module"? Are you saying that in python when I say from "Spam.ABC import *" I need a file called "Spam.ABC.[so|pyd]"? On Wed, Dec 1, 2010 at 8:39 PM, Robert Kern wrote: > On 12/1/10 4:12 PM, Eric Frederich wrote: >> >> I have an extension to

Re: Decorate un Frame with window managers title bar, etc en Tkinter 8.5

2010-12-02 Thread Eric Brunel
raised on the line frame.wm_manage()), you can also try to do it at tcl/tk level with the line: master.tk.call('wm', 'manage', frame) > I appreciate any of this item HTH - Eric - -- http://mail.python.org/mailman/listinfo/python-list

multiple modules from single c extension

2010-12-01 Thread Eric Frederich
be declared as extern? This is where I'm stuck. Thanks, ~Eric -- http://mail.python.org/mailman/listinfo/python-list

C struct to Python

2010-11-30 Thread Eric Frederich
buffer, sizeof(MyStruct)); Then on the Python side I can unpack it using struct.unpack. I'm just wondering if I need to jump through these hoops of packing it on the C side or if I can do it directly from Python. Thanks, ~Eric -- http://mail.python.org/mailman/listinfo/python-list

Round Trip: C to Python to C Module

2010-11-19 Thread Eric Frederich
g the script from a file. So, how do I return values back to C? Python functions return values but running a python script?... doesn't that just have an exit status? Is there a mechanism for doing this? Thanks in advance, ~Eric -- http://mail.python.org/mailman/listinfo/python-list

Re: Extension on Windows

2010-11-19 Thread Eric Frederich
On Fri, Nov 19, 2010 at 8:12 AM, Ulrich Eckhardt wrote: > Eric Frederich wrote: >> Do I put them [DLL dependencies] in some environment variable? >> Do I put them in site-packages along with the .pyd file, or in some >> other directory? > > Take a look at the

Re: Extension on Windows

2010-11-19 Thread Eric Frederich
On Fri, Nov 19, 2010 at 7:28 AM, Ulrich Eckhardt wrote: >> Now when I created a 2nd function to wrap a library function I get the >> following. >> >> ImportError: DLL load failed: The specified module could not be found. > > This can mean that the module itself couldn't be loaded or that one of t

Extension on Windows

2010-11-18 Thread Eric Frederich
tories and specified the correct .lib file to get it to compile fine without any errors. What is going on here? I tried running python with -vvv and got no meaningful info... it just fails. What else do I need to do? Thanks, ~Eric -- http://mail.python.org/mailman/listinfo/python-list

Re: Komodo 6, why "Workspace Restore" after every restart?

2010-11-15 Thread Eric Promislow
te.com/forums/komodo-discussion would be a better place to continue this particular discussion? Thanks for bringing up the issue though. Eric Promislow Komodo Developer -- http://mail.python.org/mailman/listinfo/python-list

Re: Unix-head needs to Windows-ize his Python script

2010-10-21 Thread Eric Brunel
ter, so they probably are even more accessible to people who never wrote a GUI before. The documentation is here: http://docs.python.org/library/ttk.html#module-ttk HTH - Eric - -- http://mail.python.org/mailman/listinfo/python-list

Re: PyRTF object model

2010-09-30 Thread Eric Brunel
so the only way to figure out what can be done is by reading the PyRTF source codeŠ HTH -Eric - -- http://mail.python.org/mailman/listinfo/python-list

Re: Static typing, Python, D, DbC

2010-09-12 Thread Eric S. Johansson
On 9/12/2010 4:28 PM, Paul Rubin wrote: Bearophile writes: I see DbC for Python as a way to avoid or fix some of the bugs of the program, and not to perform proof of correctness of the code. Even if you can't be certain, you are able reduce the probabilities of some bugs to happen. I think Db

tkinter

2010-08-19 Thread Eric J. Van der Velden
Hello, I have python2.7 .I have compiled tcl en tk and installed them in my home directory, say /home/eric/tcl and /home/eric/tk . I have edited $ vi Modules/Setup ... _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \ -L/home/eric/tcl/lib \ -L/home/eric/tk/lib \ -I/home/eric/tcl/include \ -I/home

Re: update of elements in GUI

2010-08-17 Thread Eric Brunel
(Top-post corrected; please don't do that, it makes messages very hard to read via usenetŠ) In article <26c363c8-11d7-49b9-a1c1-251ab5ff9...@p22g2000pre.googlegroups.com>, Jah_Alarm wrote: > On Aug 17, 7:19 pm, Eric Brunel > wrote: > > You have to call update_idletas

Re: message box in Tkinter

2010-08-17 Thread Eric Brunel
ssage > that this module doesn't exist. > > thanks Where did you find any reference to something called messagebox? The actual module name is tkMessageBox and it should be imported separately: import tkMessageBox tkMessageBox.showinfo(message='Have a good day') Should work that way. HTH - Eric - -- http://mail.python.org/mailman/listinfo/python-list

Re: Textvariable display in label (GUI design)

2010-08-17 Thread Eric Brunel
In article , Jah_Alarm wrote: > On Aug 17, 3:32 am, Eric Brunel > wrote: > > In article > > <993d9560-564d-47f0-b2db-6f0c6404a...@g6g2000pro.googlegroups.com>, > > > >  Jah_Alarm wrote: > > > hi, > > > > > pls help me out with t

Re: update of elements in GUI

2010-08-17 Thread Eric Brunel
In article <24dc97b3-a8b5-4638-9cf5-a397f1eae...@q16g2000prf.googlegroups.com>, Jah_Alarm wrote: > hi, I've already asked this question but so far the progress has been > small. > > I'm running Tkinter. I have some elements on the screen (Labels, most > importantly) which content has to be upd

Re: Textvariable display in label (GUI design)

2010-08-16 Thread Eric Brunel
ball: if you don't return the control to the GUI each time your variable is increased, the GUI won't get a chance to update itself. Since you seem to use Tkinter (another wild guessŠ), you probably need a call to the update_idletasks method on any Tkinter widget each time you change you

Re: how to switch image in tkinter? making it mutable? how?

2010-08-16 Thread Eric Brunel
core, which are basically only GIF so far. BTW, I don't understand why you talk about label.bindŠ If you need to do anything when the label is clicked, you have to make a binding on the label whatever it is. HTH anyway. - Eric - -- http://mail.python.org/mailman/listinfo/python-list

Re: __class__ of what

2010-08-12 Thread Eric Brunel
In article <72151646-65cb-47bb-bd55-e7eb67577...@z10g2000yqb.googlegroups.com>, "Eric J. Van der Velden" wrote: > Hello, > > I have, > > class C: > n=0 > def __init__(s): > __class__.n+=1 > > > I do >

__class__ of what

2010-08-12 Thread Eric J. Van der Velden
Hello, I have, class C: n=0 def __init__(s): __class__.n+=1 I do >>> C() This is fine. But of what thing I am taking the __class__ of? I can also do @staticmethod def p(): print(__class__.n) >>> C.p()

Re: Python Tkinter Simple Qn

2010-08-12 Thread Eric Brunel
a label as a panel > panel1 = tk.Label(root, image=image1) > panel1.pack(side='top', fill='both', expand='yes') > panel1.image = image1 > panel1.bind("", callback) > > > panel1.pack() > root.mainloop() > > > app() HTH - Eric - -- http://mail.python.org/mailman/listinfo/python-list

mi

2010-08-11 Thread Eric J. Van der Velden
mes back in B and prints "B". He goes to C. Then somehow he doesn't go again to A. He prints "C". Then back to D and prints "D". Thanks, Eric J. -- http://mail.python.org/mailman/listinfo/python-list

Re: type enforcement in _ssl.sslwrap

2010-08-11 Thread Eric Snow
On Aug 11, 5:34 am, Steven D'Aprano wrote: > On Tue, 10 Aug 2010 10:40:54 -0700, Eric Snow wrote: > > ssl.SSLSocket.__init__ makes a call to _ssl.sslwrap (in the C module). > > That in turn makes a call to PyArg_ParseTuple, which casts the first arg > &

Re: File Manager in Tkinter

2010-08-11 Thread Eric Brunel
In article <770366ta10gk98vgd5n2tapl7ag6ska...@4ax.com>, John wrote: > My python is version 2.6.5. Would you recomend I upgrade and if yes > to which version? > > > from tkinter import ttk > > Traceback (most recent call last): > File "", line 1, in > from tkinter import ttk > ImportErro

type enforcement in _ssl.sslwrap

2010-08-10 Thread Eric Snow
does not inherit from _socket.socket, like you do with file-like objects. Is there a way to make this work, or is the PyArg_ParseTuple call going to stop me. Would I need to have _ssl.sslwrap do something differently with its args? -eric -- http://mail.python.org/mailman/listinfo/python-list

Re: File Manager in Tkinter

2010-08-10 Thread Eric Brunel
In article , John wrote: > As a learning exercise in Tkinter I htought about making a very simple > and basic file manager for my own use. I tried searching google for > any sample project and could not find anything. Not exactly sure how > to start I tought I could ask here? > > I thought abou

__init__ as a lambda

2010-08-04 Thread Eric J. Van der Velden
nnot write the second argument with a dot, self.name . Or can I somehow? Thanks, Eric J. -- http://mail.python.org/mailman/listinfo/python-list

list.insert

2010-07-14 Thread Eric J. Van der Velden
Hi, I understand this: >>> l=[1,2,3] >>> l[1:2]=[8,9] >>> l [1,8,9,3] But how do you do this with list.insert? Thanks, Eric J. -- http://mail.python.org/mailman/listinfo/python-list

Re: OT Komodo Edit, line selection gutter is one pixel wide?

2010-07-05 Thread Eric Promislow
will set the margin after a file is opened. You currently can't write a post-file-open trigger in Python, (see bug http://bugs.activestate.com/show_bug.cgi?id=45265) Hope this helps, Eric Promislow Komodo Team Member -- http://mail.python.org/mailman/listinfo/python-list

Re: Python as a scripting language. Alternative to bash script?

2010-06-29 Thread eric dexter
On Jun 28, 5:48 am, Dave Pawson wrote: > I've a fairly long bash script and I'm wondering > how easy it would be to port to Python. > > Main queries are: > Ease of calling out to bash to use something like imageMagick or Java? > Ease of grabbing return parameters? E.g. convert can return both > he

Re: problems getting os.system and wxmenu to read options from a file and then execute

2010-06-27 Thread eric dexter
On Jun 27, 8:18 pm, MRAB wrote: > eric dexter wrote: > > On Jun 27, 5:56 pm, MRAB wrote: > >> eric_dex...@msn.com wrote: > >>> I managed to get the program running and the menu options are > >>> appearing on the list but the programs are not running.

Re: Why Python3

2010-06-27 Thread eric dexter
On Jun 27, 7:46 pm, MRAB wrote: > Stephen Hansen wrote: > > On 6/27/10 6:09 PM, MRAB wrote: > >> Terry Reedy wrote: > >>> Another would have been to add but never remove anthing, with the > >>> consequence that Python would become increasingly difficult to learn > >>> and the interpreter increasin

Re: problems getting os.system and wxmenu to read options from a file and then execute

2010-06-27 Thread eric dexter
On Jun 27, 5:56 pm, MRAB wrote: > eric_dex...@msn.com wrote: > > I managed to get the program running and the menu options are > > appearing on the list but the programs are not running.  I suspect it > > is my onexecutemethod > > [snip] > > >         #add execute files from the text file list > >

Help with suds: HTTP Error 401

2010-06-11 Thread Eric von Horst
Hi, I am trying to do a very simple thing with SUDS but I think I am missing the obvious (first time I use suds) I have small program that tries to open a wsdl. When I execute the program I am getting 'suds.transport.TransportError: HTTP Error 401: Unauthorized' Seems obvious but I specify userna

Re: [ANN] Leipzig Python User Group - Meeting, May 11, 2010, 08:00pm

2010-05-08 Thread Eric Stechmann
On May 7, 2010, at 11:00 AM, Stefan Schwarzer wrote: === Leipzig Python User Group === We will meet on Tuesday, May 11, 8:00 pm at the training center of Python Academy in Leipzig, Germany ( http://www.python-academy.com/center/find.html ). Julian Moritz will give a talk about CouchDB. Food

Re: Does turtle graphics have the wrong associations?

2009-11-12 Thread AK Eric
On Nov 12, 11:31 am, Terry Reedy wrote: > Alf P. Steinbach wrote: > > One reaction to >http://preview.tinyurl.com/ProgrammingBookP3> has been that turtle > > graphics may be off-putting to some readers because it is associated > > with children's learning. > > > What do you think? > > I just star

Re: How can a module know the module that imported it?

2009-11-12 Thread AK Eric
On Nov 12, 10:10 am, Ethan Furman wrote: > AK Eric wrote: > > so: > > > # moduleA.py > > import moduleB > > > # moduleB.py > > import sys > > stuff = sys._getframe(1).f_locals > > print stuff > > > Prints: > > > {'__

Re: How can a module know the module that imported it?

2009-11-12 Thread AK Eric
so: # moduleA.py import moduleB # moduleB.py import sys stuff = sys._getframe(1).f_locals print stuff Prints: {'__builtins__': , '__file__': 'C:\\Documents and SettingsMy Documents\ \python\\moduleA.py', '__name__': '__main__', '__doc__': None} Looks like you could query stuff['__file__']

<    1   2   3   4   5   6   7   8   9   10   >