Re: slightly OT -- LaTeX

2011-09-02 Thread Alan
http://www.pytex.org/ hth, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

multiprocessing: child process share changes to global variable

2013-12-02 Thread Alan
fy for me? Expected result from pool.map: [[0],[1],[2]] Usual result: [[0],[0,1],[0,1,2]] Occasional result: [[0],[1],[0,2]] Thanks, Alan Isaac #--- temp.py - #run at Python 2.7 command prompt import time import multiprocessing as mp lst = [] lstlst = [] def alis

Re: multiprocessing: child process share changes to global variable

2013-12-09 Thread Alan
I received a suggestion off list that my results indicated that the jobs were not being distributed across the pool workers. I used mp.current_process().name to confirm this suggestion. Alan Isaac -- https://mail.python.org/mailman/listinfo/python-list

Re: Distributing python applications as a zip file

2014-07-24 Thread Alan
fixed for 3.2. Was the fix ever backported to 2.7? -- Thanks, Alan Isaac -- https://mail.python.org/mailman/listinfo/python-list

Re: What is the simplest method to get a vector result?

2014-07-24 Thread Alan
You can use `list(math.sin(x * math.pi / 2) for x in index)` or use `numpy`, which supports array math. -- https://mail.python.org/mailman/listinfo/python-list

building static python with Numeric

2007-07-17 Thread Alan
n that would include (statically if possible) the package Numeric-24.2. Is it possible? How? Summarising, I would like to build a python binary independent of others libraries where I could 'import Numeric'. I would appreciate very much any help here. Many thanks in advance. Cheers, A

Tix.Tk() on Mac Intel

2007-07-26 Thread Alan
ersions/2.5/lib/python2.5/lib-tk/Tix.py", line 210, in __init__ self.tk.eval('package require Tix') _tkinter.TclError: can't find package Tix The only way I got Tix.Tk() working so far was using Fink but I want the nice aqua visual for python. Is there any way of getting it workin

python static with Numeric

2007-07-26 Thread Alan
Hi List! Does anyone here knows how to compile python with Numeric in a static way? Many thanks in advance. Cheers, Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Resolving declaring class of a method at runtime

2007-11-16 Thread Alan
ions", which sit at the root of all evil -- Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Namespace troubles

2007-11-16 Thread Alan
.Frame.__init__(self, parent, id, title, size=(600,500)) self.nb = wx.Notebook(self) self.page1 = Form1(nb, -1) self.nb.AddPage(self.page1, "Choose Patient") self.page1.SetFocus() def patient_lookup(self, first_ltrs): self.page2 = Selectable.Repository(nb, -1, first_ltrs) self.nb.AddPage(self.page2, "Patient Lookup") self.page2.SetFocus() -- Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting Countries by Region

2007-11-16 Thread Alan
elif self.name > other.name: > return 1 > else: > return 0 > over def __cmp__(self,other): return cmp(self.name,other.name) ? -- Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: What is python?????

2007-11-16 Thread Alan
On Nov 16, 8:29 pm, [EMAIL PROTECTED] wrote: > I still don't get it and I've been haunting this group for months... > > Mike Go on then ... What ? The punchline, do the punchline -- Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: John Bokma harassment

2006-05-24 Thread Alan
With apologies to Voltaire: If Xah Lee did not exist, it would be necessary for John Bokma to invent him. Xah and Bokma are both idiots, they truly deserve each other. The sooner you killfile these two clowns, the happier you'll be. -- http://mail.python.org/mailman/listinfo/python-list

waiting on an event blocks all signals

2008-05-17 Thread alan
This ignores CTRL-C on every platform I've tested: python -c "import threading; threading.Event().wait()" ^C^C^C^C It looks to me like all signals are masked before entering wait(). Can someone familiar with the internals explain and/or justify this behavior? Thanks,

Re: waiting on an event blocks all signals

2008-05-17 Thread alan
On May 17, 3:06 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Sat, 17 May 2008 12:49:54 -0700, John Schroeder <[EMAIL PROTECTED]> wrote: > >On Sat, May 17, 2008 at 12:32 PM, alan <[EMAIL PROTECTED]> wrote: > > >> This ignores CTRL-C on every platfor

why are functions greater than numbers?

2011-01-24 Thread Alan
Why do function objects compare in this way to numbers? Thanks, Alan Isaac >>> def f(): return ... >>> f>5 True -- http://mail.python.org/mailman/listinfo/python-list

use class factory to set required class variables?

2011-01-26 Thread Alan
my problem? If so is this a standard pattern? If not, can you mention a better approach? My solution is working for me, but the class ``A`` is bugging me, because of the odd (to me) way in which it is incomplete. Obviously, I'm not a computer science type ... Thanks, Alan Isaac -- http://

Re: use class factory to set required class variables?

2011-01-26 Thread Alan
On Jan 26, 4:37 pm, Alan wrote: > I have a class factory ``f``` that subclasses ``A`` *only* in > order to define the class variables. I suppose it would be clearer to say that `f` *returns* subclasses of `A`. Hopefully that was clear ... Alan Isaac -- http://mail.python.org/mailman/li

can't use multiprocessing with class factory?

2011-01-28 Thread Alan
Can the below example be fixed to work? Thanks, Alan Isaac import multiprocessing as mp class Test(object): pass def class_factory(x): class ConcreteTest(Test): _x = x return ConcreteTest def f(cls): print cls._x if __name__ == '__main__': pool =

Re: can't use multiprocessing with class factory?

2011-01-28 Thread Alan
in__': >pool = mp.Pool(2) >pool.map(g, zip([class_factory] * 4, range(4))) If I change that to g((factory,i)) it does work. Thanks! Alan -- http://mail.python.org/mailman/listinfo/python-list

python2.6 atexit not working with programme using threads, but python 2.5 works

2010-06-03 Thread Alan
explicitly do cleanup(...) it works. If I have no threads on, atexit works too. Any idea of how to debug this would very appreciated. Thanks, Alan Python 2.6.5 (r265:79063, May 13 2010, 15:11:52) [GCC 4.2.1 (Apple Inc. build 5659)] on darwin -- Alan Wilter S. da Silva, D.Sc. - CCPN Research

threading and atexit: different behaviour in python2.6 from 2.5

2010-06-04 Thread Alan
the same behaviour I see with python2.5 for this example code? Any hint would be very much appreciated indeed. Many thanks in advance. Alan -- Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate Department of Biochemistry, University of Cambridge. 80 Tennis Court Road, Cambridge CB2 1GA, UK. >>http://www.bio.cam.ac.uk/~awd28<< -- http://mail.python.org/mailman/listinfo/python-list

Re: threading and atexit: different behaviour in python2.6 from 2.5

2010-06-07 Thread Alan
Thanks MRAB. setDaemon gave some hope. Alan On Fri, Jun 4, 2010 at 16:46, wrote: > Alan wrote: > >> Hi there, >> >> That's another try to get help about this issue I am facing. To help you >> to help me here goes a simple example. This is a very simpl

python2.5 x python2.6 in interactive mode

2010-06-07 Thread Alan
eractive python terminal. Is there a way of having the very behaviour I have with python 2.5 for my code in python 2.6? Many thanks in advance, Alan -- Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate Department of Biochemistry, University of Cambridge. 80 Tennis Court Road, Cambridge CB2

drag & drop in a python GUI application

2010-07-02 Thread Alan
Hello there, I know drag & drop is not possible with TK. Which widget could I use for my python application to be able to work with drag & drop? Thanks, Alan -- Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate Department of Biochemistry, University of Cambridge. 80 Tennis Co

python3: help with subprocess

2010-07-14 Thread Alan
where I can now about it and how to make this better? I wanted a plain string in out. Many thanks in advance, Alan -- Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate Department of Biochemistry, University of Cambridge. 80 Tennis Court Road, Cambridge CB2 1GA, UK. >>http://www.bio.cam.ac.uk/~awd28<< -- http://mail.python.org/mailman/listinfo/python-list

python3: help with pickle

2010-07-15 Thread Alan
pickle.py", line 858, in load dispatch[key](self) File "/sw/lib/python2.7/pickle.py", line 1083, in load_newobj obj = cls.__new__(cls, *args) AttributeError: class ACTopol has no attribute '__new__' Apart that, everything else seems to work. Just one note more:

python3: signal.signal/singal.alarm

2010-07-15 Thread Alan
behaviour and how to solve this? Many thanks in advance, Alan -- Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate Department of Biochemistry, University of Cambridge. 80 Tennis Court Road, Cambridge CB2 1GA, UK. >>http://www.bio.cam.ac.uk/~awd28<< -- http://mail.python.org/mailman/listinfo/python-list

python3: signal.signal/singal.alarm not working as expected

2010-08-02 Thread Alan
_main__': timeTol = 5 cmd = 'find /' signal.signal(signal.SIGALRM, signal_handler) signal.alarm(timeTol) p = subprocess.Popen(cmd, shell=True, stderr = subprocess.STDOUT, stdout = subprocess.PIPE) pid = p.pid out = str( p.communicate()[0].decode() ) prin

please, help with python 3.1

2010-08-02 Thread Alan
#x27;: timeTol = 5 cmd = 'find /' signal.signal(signal.SIGALRM, signal_handler) signal.alarm(timeTol) p = subprocess.Popen(cmd, shell=True, stderr = subprocess.STDOUT, stdout = subprocess.PIPE) pid = p.pid out = str( p.communicate()[0].decode() ) print(out) Alan

errors and exception

2010-08-16 Thread Alan
etc) that could give a solution to keep my code in python 2.6 syntax as above but compatible with python 2.5, that would be appreciated. Many thanks in advance, Alan -- Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate Department of Biochemistry, University of Cambridge. 80 Tennis Court Road

Re: Any speech to text conversation python library for Linux and mac box

2013-06-13 Thread Alan Gauld
u are looking for exotic libraries you should have more success posting on the general Python mailing list or newsgroup (comp.lang.python) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ -- http://mail.python.org/mailman/listinfo/python-list

Help me with the script? How to find items in csv file A and not in file B and vice versa

2013-06-18 Thread Alan Newbie
Hello, Let's say I want to compare two csv files: file A and file B. They are both similarly built - the first column has product IDs (one product per row) and the columns provide some stats about the products such as sales in # and $. I want to compare these files - see which product IDs appear

Re: Help me with the script? How to find items in csv file A and not in file B and vice versa

2013-06-18 Thread Alan Newbie
thanks a lot :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Pymongo Error

2012-06-19 Thread Alan Gauld
an tables? HTH -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Sudden doubling of nearly all messages

2012-07-22 Thread Alan Ristow
ty sure it is Thunderbird-related -- I have had this issue before as well. Unfortunately, I cannot remember how I solved it. It seems like there was a particular box that needed to be checked or unchecked in the IMAP settings for the mail server, but I can't be sure anymore.

codecs.register_error for "strict", unicode.encode() and str.decode()

2012-07-26 Thread Alan Franzoni
ng a proof of concept of how to let Python work in a more forgiving way). What I discovered is that register_error() for "strict" seems to work in the way I expect for string decoding, not for unicode encoding. That's what happens on Mac, Python 2.7.1 from Apple:

Re: 10 sec poll - please reply!

2012-11-20 Thread Alan Meyer
sed. "type" fails that test. "generate_keystrokes" passes with flying colors, but may be overkill. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: 10 sec poll - please reply!

2012-11-20 Thread Alan Bawden
Since the event being generated is commonly called a "keystroke", and since my dictionary defines the noun "stroke" as being: "the act of striking", a good verb to choose for the action itself would seem to be "strike": strike('a') -- http://mail.python.org/mailman/listinfo/python-list

Inserting Unicode chars in Entry widget

2012-12-29 Thread Alan Graham
Hello Python experts, I want to insert Unicode chars in an Entry widget by pushing on buttons; one for each Unicode character I need. I have made the Unicode buttons. I just need a simple function that will send the Unicode character to the Entry widget. Is there a better approach? Alan -- http

Re: [Offtopic] Line fitting [was Re: Numpy outlier removal]

2013-01-11 Thread Alan Spence
doing the analysis for. It's also good to try more than one set of excluded outliers to see just how stable the results are depending on how many outliers you remove. If the results change much, be very careful how you use the results. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Alan Spence
t;> >> If you would simply run the python interpreter and try these things out >> >> you could see how and why they work or not work. What is stopping you >> >> from doing this? > > > May i sent you my code by mail so for you see whats wrong and > http://superhost.gr produces error? > > 1. this is not a script that iam being paid for. > 2, this is not a class assignemnt > > I just want to use that method of gettign this to work. > -- > http://mail.python.org/mailman/listinfo/python-list All pages, strings and objects map to: http://redwing.hutman.net/~mreed/warriorshtm/ferouscranus.htm Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Common LISP-style closures with Python

2012-02-05 Thread Alan Ristow
is not a closure? Alan -- http://mail.python.org/mailman/listinfo/python-list

Is this the right list?

2012-02-15 Thread Alan McKay
. I am having a problem moving an application from RHEL 5.7 to Ubuntu 11.11, and the problem is around .py program. It is a web based program, and seems to use a strange combination of mod_python and python CGI as best I can tell. Would this be the right list to ask? thanks, -Alan -- http

Re: Is this the right list?

2012-02-16 Thread Alan McKay
> > Welcome to the list. There are lots of friendly folks here who will try > to help. > > I noticed that already - thanks! -- http://mail.python.org/mailman/listinfo/python-list

Python / Apache config issue

2012-02-16 Thread Alan McKay
OK, since you all said to send it, here it is :-) Though I think it may be an apache issue, I'll send it anyway. I'm using the software called "Open Freezer" which is used to track reagents and other chemicals in research labs. I also posted this here on their discussion forums but have not hear

Re: Is Programing Art or Science?

2012-04-03 Thread Alan Mackenzie
ary. When people talk about, for example, the art of painting water colours, they mean the techniques of mixing paints, depicting objects on paper, etc. They are not referring to the artistic value of the painting painted. > yours humbly, > > Xah -- Alan Mackenzie (Nuremberg, Ger

Making helper methods more concise

2012-04-16 Thread Alan Ristow
s particular piece of code -- the code only inspired the question. I'm trying to wrap my head around decorators (aside from the simplest ones) and metaclasses at the moment, so feel free to throw those sorts of solutions into the mix if something like that would be appropriate. Thanks, Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-29 Thread Alan Mackenzie
me of what? If you click on the "help", you get taken to a search box, not proper docs. Typing "name" into the search box isn't useful. And so it goes on. CUPS is an Apple product. > more records of careless dead link: [ ] -- Alan Mackenzie (Nuremberg, Germany). -- http://mail.python.org/mailman/listinfo/python-list

Re: Pydev configuration

2012-05-09 Thread Alan Ristow
can block comment/uncomment it would be really handy to be able to do the same with indentation. I cannot believe the function isn't there, but I cannot find it. Select the code block you want to indent and hit Tab. To do the reverse, hit Shift-Tab. Alan -- http://mail.python.org/mailman/listinfo/python-list

ucs2 and ucs4 python

2012-05-15 Thread Alan Kesselmann
Hello I tried using one compiled library and got this error: ImportError: /home/alan/Downloads/pdftron/PDFNetC64/Lib/ _PDFNetPython2.so: undefined symbol: PyUnicodeUCS2_AsUTF8String I googled around and found some info about the meaning of the error. The creators of PDFNet suggested i install

Re: Fall in love with bpython

2011-07-27 Thread Alan Gauld
source as you type. That would be worth investigating too... HTH, Alan G. -- http://mail.python.org/mailman/listinfo/python-list

Re: list comprehension to do os.path.split_all ?

2011-07-28 Thread Alan Meyer
ion of my problem. I can't quite work it out. Any brilliant ideas? (or other elegant solutions to the problem?) -- George This is not properly portable to all OS, but you could simply split on the slash character, e.g., pathname.split('/') Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Only Bytecode, No .py Files

2011-07-29 Thread Alan Meyer
ere is at least one open source program that will monitor named files and truncate them from the beginning to a fixed maximum size. I don't like this method as much as the first because it might result in something important being truncated. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Another win for profiling.

2011-07-29 Thread Alan Meyer
change one line in a thousand line program and cut the run time by 50%. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Composition instead of inheritance

2011-05-02 Thread Alan Meyer
welcome! ~Ethan~ That looks pretty clever. I tried adding this method to Spam: def test_eggs_02(self): print('testing eggs_02 from spam') and it did just what we wanted. I'm going to have to study this one. Thanks. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python/New/Learn

2022-05-05 Thread Alan Gauld
of the discussions there will be closer to your level than the more advanced topics that get addressed here. Finally, I have a tutorial aimed at complete beginners, see the link below... -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_

Re: tail

2022-05-09 Thread Alan Bawden
Marco Sulla writes: On Mon, 9 May 2022 at 19:53, Chris Angelico wrote: ... Nevertheless, tail is a fundamental tool in *nix. It's fast and reliable. Also the tail command can't handle different encodings? It definitely can't. It works for UTF-8, and all the ASCII compatible single

Re: min, max with position

2022-06-04 Thread Alan Bawden
ng for is usually called "argmax" and "argmin" (see ). These don't exist in the standard Python library as far as I can tell, but numpy does have "argmax" and "argmin" routines. -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list

Re: on a statement followed by an expression

2022-06-04 Thread Alan Bawden
e _same_ dictionary every time. Your original code that used a `for' loop is actually much clearer. -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list

Re: random.SystemRandom().randint() inefficient

2022-07-27 Thread Alan Bawden
g to have it destroyed by this process: seq = list(seq) n = len(seq) while n: i = randrange(n) yield seq[i] n -= 1 if i < n: seq[i] = seq[n] -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list

Re: random.SystemRandom().randint() inefficient

2022-07-27 Thread Alan Bawden
Cecil Westerhof writes: Alan Bawden writes: > Cecil Westerhof writes: > >Yes, I try to select a random element, but it has also to be removed, >because an element should not be used more as once. > > Instead of using pop to do that why

Re: an oop question

2022-10-31 Thread Alan Gauld
f __str__(self): > return "Empty()" > def __repr__(self): > return self.__str__() > def __new__(clss): > if not hasattr(clss, "saved"): > clss.saved = super().__new__(clss) > return clss.saved > > class Stack(Pair): > def pop(self): > return self.first > def push(self, x): > return Stack(x, self) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: an oop question

2022-11-02 Thread Alan Gauld
xactly as in cellular automata theory. .. Unfortunately, there is a huge gap between pure OOP theory and practical OOP languages! And just as big a gap between OOP language potential and real-world OOP usage. Very few purely OOP programs exist (maybe excepting in Smalltalk - see Stefan's posts

Re: [correction]an oop question

2022-11-02 Thread Alan Gauld
I'd implement the example hierarchy as > >>>> class Language: > ... def f(self): > ... print(self.greeting) And that would be perfectly valid too. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/aut

Re: an oop question

2022-11-03 Thread Alan Gauld
ut you really have to fight the system to do so. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: an oop question

2022-11-03 Thread Alan Gauld
On 03/11/2022 18:29, Chris Angelico wrote: > On Fri, 4 Nov 2022 at 05:21, Julieta Shem wrote: >> >> Chris Angelico writes: >> >>> On Thu, 3 Nov 2022 at 21:44, Alan Gauld wrote: >>>> Also Python is not a purely OOP language, in that you can write >&g

Re: Does one have to use curses to read single characters from keyboard?

2022-12-12 Thread Alan Gauld
rd-python > > Disclaimer: have had it on my 'radar', but never actually employed. > (if you have considered, will be interested to hear conclusions...) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: Does one have to use curses to read single characters from keyboard?

2022-12-13 Thread Alan Gauld
On 12/12/2022 17:45, Alan Gauld wrote: Absolutely nothing apparently! But in practce I did pen some esponses to Davids post. However this list seems to strip out what I've written, its happened a few times now. Not every time but enough that I rarely post here. But I'll try once mor

Re: String to Float, without introducing errors

2022-12-17 Thread Alan Gauld
ecimal accuracy is your primary goal, it might suit you better. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: NoneType List

2022-12-31 Thread Alan Gauld
uld chain them. But sadly it doesn't. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: RE: NoneType List

2023-01-02 Thread Alan Gauld
axed the ludicrously strict typing slightly. Turbo Pascal made Pascal a joy and I still use Delphi for Windows programming today. TP also introduced classes to Pascal (although Apple had already done so for the Mac and Borland basically ported the syntax to the PC). -- Alan G Author of the Lea

Re: Usenet vs. Mailing-list (was: evaluation question)

2023-01-31 Thread Alan Gauld
) is a now more complicated than before. So I have to be very highly motivated to jump through the hoops. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauld

Re: TypeError: can only concatenate str (not "int") to str

2023-02-26 Thread Alan Gauld
e (and standard library) as it exists. (We also cover beginner questions about programming in general.) So this thread is most definitely in the right place IMHO. -- Alan G Tutor list moderator -- https://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression bug?

2023-03-02 Thread Alan Bawden
compile(m0) s0 = r0.match(s) >>> print(s0) None Assuming that you were expecting to match "pn=2017", then you probably don't want the 'match' method. Read its documentation. Then read the documentation for the _other_ methods that a Pattern supports. T

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread Alan Gauld
ing for static types should rarely be necessary since Python uses duck typing and limiting things to a hard type seriously restricts your code. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: h

Re: Python list insert iterators

2023-03-03 Thread Alan Bawden
Guenther Sohler writes: Hi Python community, I have a got an example list like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 T T and i eventually want to insert items in the given locations (A shall go between 2 and 3, B shall go between 6 and 7) Right now i just use ind

Re: RE: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread Alan Gauld
onic is still a much more loose term and the community less stressed about it than their C++ cousins where it has almost reached a religious fervour! -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr a

Re: Lambda returning tuple question, multi-expression

2023-03-09 Thread Alan Gauld
e3.config(state="normal") ) ) It's not a radical change from using a lamba as a callback but it does extend the use case to cover a common GUI scenario. I like it. I wish I'd thought of it years ago. Thanks for sharing. -- Alan G A

Fwd: Friday finking: IDE 'macro expansions'

2023-03-17 Thread Alan Gauld
auto tricks but I don't always use them. In vim I use auto-indent and that's about it. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -

Re: Fwd: Friday finking: IDE 'macro expansions'

2023-03-18 Thread Alan Gauld
ers of magnitude more difficult. The Lazarus open source project is based on Delphi's IDE. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos

Re: Fwd: Friday finking: IDE 'macro expansions'

2023-03-18 Thread Alan Gauld
g strong, albeit at extortionately high prices: $1000~3000 for the pro versions! (But there is still a free community version with just the basics.) See http://www.embarcadero.com And it's targeted at multi-platforms now: Windows, MacOS, Android, iOS although it only runs on Window

Re: Windows installer from python source code without access to source code

2023-03-31 Thread Alan Gauld
ements were before Python3 so ive no idea what it does today! But a quick check suggests it still exists and works with python3 code - last major release was in Nov 2022. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my pho

Re: Windows Gui Frontend

2023-04-01 Thread Alan Gauld
;ve seen no real evidence of that. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: Weak Type Ability for Python

2023-04-13 Thread Alan Gauld
ght be a rival to M$ OS/2 running NeXTstep now that would have been a platform for the 90s... both so near yet so far. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.fli

Re: RE: Weak Type Ability for Python

2023-04-13 Thread Alan Gauld
ine all the operators (commands in Tcl-speak) in the language so redefining plus is easy. Doing it based on type is more tricky but doable. > Unfortunately, if they BOTH are flexible, how do you decide whether to add > them as numbers or concatenate them as strings? Yes, that's where it b

Re: tksheet - Copy and Paste with headers

2023-04-16 Thread Alan Gauld
o a text editor in the first instance? And Excel in the second? If all else fails you can probably write handlers and bind to Ctrl-C and Ctrl-V to do something yourself that mimics cut/paste. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan

Re: PyCharm's strict PEP and not so strict?

2023-04-19 Thread Alan Gauld
ow to configure it (and how to plumb it into your IDE). Personally I've never felt the need for any stricter error checking than the interpreter provides so I can't offer anything beyond the generic suggestion to use a linter. -- Alan G Author of the Learn to Program web site http://www.

Re: Python curses missing form library?

2023-04-24 Thread Alan Gauld
If you are building terminal based form-type apps the best bet seems to be urwid. I haven't used it in anger but the beginner docs I saw looked promising. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo

Re: [pygettext] --package-name and --package-version unknown

2023-05-04 Thread Alan Gauld
text does create in each > po-file. Sorry, I've never used pygettext so can't help there. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphot

Re: What to use instead of nntplib?

2023-05-16 Thread Alan Gauld
why nntplib is deprecated? Surely there are still a lot of nntp servers around, both inside and outside corporate firewalls? Is there a problem with the module or is it just perceived as no longer required? -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazo

Re: What to use instead of nntplib?

2023-05-16 Thread Alan Gauld
t; required? > > See PEP 594: https://peps.python.org/pep-0594/ Thanks Cameron. A scary list; I must have a dozen projects from the late 90s still live that are using many of these! I'm glad I'm retired and won't be the one who has to fix 'em :-) -- Alan G Author o

Re: Silly (maybe) question re imported module(s)

2023-05-19 Thread Alan Gauld
" the modules. are you typing >>> import mymodule at the interactive prompt or are you using the File->Open menu to load them into the editor? (It sounds like the latter) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_

Re: Silly (maybe) question re imported module(s)

2023-05-19 Thread Alan Gauld
es\Tools\Python\Temp\cube.py >>>> cubes > [0, 1, 8, 27, 64, 125, 216, 343, 512, 729] cubes looks like it should be a function but in that case there should be parens after it. So I'm not sure how that is working! I'd expect that you need to do: import cube cu

Re: Silly (maybe) question re imported module(s)

2023-05-19 Thread Alan Gauld
bject is not callable Ah, now I understand. cubes is a literal list defined in the module. > But that was spot on, thanks > >>>> import cube >>>> cube.cubes > [0, 1, 8, 27, 64, 125, 216, 343, 512, 729] Glad to help. -- Alan G Author of the Learn to Program

Re: Question about generators

2021-03-05 Thread Alan Bawden
tween append and extend. I suspect that the heart of your confusion actually has nothing to do with generators. -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list

Re: .title() - annoying mistake

2021-03-20 Thread Alan Bawden
t;> '\u01f1'.lower() '\u01f3' This is the "dz" character. >>> '\u01f1'.title() '\u01f2' This is the "Dz" character. When you write that code to capitalize your book titles, you should be calling .title() rather than .upper() if you are doing it right. -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list

Re: .title() - annoying mistake

2021-03-20 Thread Alan Bawden
Sibylle Koczian writes: Am 20.03.2021 um 09:34 schrieb Alan Bawden: > > When you write that code to capitalize your book titles, you should be > calling .title() rather than .upper() if you are doing it right. > But that's exactly what he's doing,

Re: Strange disassembly

2021-06-19 Thread Alan Bawden
Chris Angelico writes: >>> sys.version '3.10.0b2+ (heads/3.10:33a7a24288, Jun 9 2021, 20:47:39) [GCC 8.3.0]' >>> def chk(x): ... if not(0 < x < 10): raise Exception ... >>> dis.dis(chk) 2 0 LOAD_CONST 1 (0) 2 LOAD_FAST

Fwd: Re: sum() vs. loop

2021-10-12 Thread Alan Gauld
in transit. Presumably, especially for large numbers, a single python loop is faster than 2 C loops? But that's purely my speculation. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr

  1   2   3   4   5   6   7   8   9   10   >