Re: Windows Services

2005-12-14 Thread alf
Also think through which Windows account will run the service, and what permissions it will need. A little up front work here will be appreciated by the people who have to install your service. -- http://mail.python.org/mailman/listinfo/python-list

attaching debugger to runinng python program

2006-07-13 Thread alf
Hi, I have a two fold question: -how to attach the debugger to running multi threaded program -the objective is to find an infinite loop in one of threads which makes the whole thingy going craze (100%CPU) The program itself is not easy, in fact quite hude and sometimes it takes

Re: attaching debugger to runinng python program

2006-07-14 Thread alf
Bill Pursell wrote: > Now, in another shell, > % gdb > (gdb) attach 54321 > Thx for the reply. But I wish to debug the python program, not python interpreter itself. -- http://mail.python.org/mailman/listinfo/python-list

SocketServer and timers

2006-07-27 Thread alf
thx, alf -- http://mail.python.org/mailman/listinfo/python-list

Re: SocketServer and timers

2006-08-08 Thread alf
[EMAIL PROTECTED] wrote: > alf wrote: > >>I have one thread app using SocketServer and use server_forever() as a >>main loop. All works fine, but now I need certain timer checking let's >>say every 1 second something and stopping the main loop. So questions are: >&

iterator wrapper

2006-08-11 Thread alf
Hi, I have a following task: let's say I do have an iterator returning the some objects: >>i= >>i.next() 1 >>i.next() 'abgfdgdfg' >>i.next() For some reason I need to wrap thos objects with a list. I thought I could have a smart lamda or simple function class yielding following result:

Re: iterator wrapper

2006-08-11 Thread alf
Simon Forman wrote: >class LW(object): # ListWrapper >>... def __init__(self, i): >>... self.theiter = i >>... def next(self): >>... return [self.theiter.next()] I hoped one lamda would take care of it but looks like it is a simplest choice. > |>> I = ([n] for n in

Re: iterator wrapper

2006-08-12 Thread alf
Simon Forman wrote: >> >>>|>> I = ([n] for n in i) >> >>This is nice but I am iterating thru hude objects (like MBs) so you know ... >> > > No, I don't know... :-) potentially my source lists are huge - so wanted to avoid unnecessary memory allocation > My friend, I think you've misunderstood

Re: iterator wrapper

2006-08-12 Thread alf
Paul Rubin wrote: > alf <[EMAIL PROTECTED]> writes: > >>>|>> I = ([n] for n in i) >> >>This is nice but I am iterating thru hude objects (like MBs) so you know ... > > > I don't understand the objection-- the above is entirely correct and >

[OT] why cd ripping on Linux is so slow

2006-08-12 Thread alf
to get pure wavs... Hope I find someone here helping me with that -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] why cd ripping on Linux is so slow

2006-08-12 Thread alf
know where to find the answer. -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator wrapper

2006-08-12 Thread alf
choose while the priority is the stable app. -- alf -- http://mail.python.org/mailman/listinfo/python-list

MIMEMultipart() and CRLF vs RFC 2046

2006-10-05 Thread alf
Hi, according to rfc2046, line breaks in MIME are CRLF. However python just uses LF like in the following example: from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText msg = MIMEMultipart() msg['Subject'] = 'Our family reunion' msg['From'] = '[EMAIL PROTECTED]' msg

Re: MIMEMultipart() and CRLF vs RFC 2046

2006-10-06 Thread alf
Gabriel Genellina wrote: > At Thursday 5/10/2006 18:52, alf wrote: > >> according to rfc2046, line breaks in MIME are CRLF. However python just >> uses LF like in the following example: > > > The comments inside generator.py say CRLF everywhere, but the code > si

subprocess-how to suppress the stdout

2006-10-26 Thread alf
Hi, I use subprocess to execute another program but need to suppress its stdout. I can achieve it by using Popen(...,stdout=subprocess.PIPE,...) but wonder where the all stdout actually goes. Is it buffered (to eventually fill up)or just discarded? Or there is a better solution ... Thx, alf

displaying \n-less prompts in a pythonic way

2006-10-26 Thread alf
following lines and the indentation gets messed up. I can use sys.stdout.write('enter command:') instead but kind of do not like sys.stdout.write mixed up with print's statements used to display other informations. Is there a pythonic solution for the problem? Thx, alf -- http:

http://tipc.sourceforge.net support

2006-10-26 Thread alf
Hi, I did my homework and researched the net - can not find the python support for TIPC. Does anybody know if there are plans to implement it? -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess-how to suppress the stdout

2006-10-26 Thread alf
Fredrik Lundh wrote: > "alf" <[EMAIL PROTECTED]> wrote: > > >>I can achieve it by using Popen(...,stdout=subprocess.PIPE,...) but >>wonder where the all stdout actually goes. Is it buffered (to eventually >>fill up) > > > it ends up in a pip

PythonMagic - has any body played with it recently

2006-10-26 Thread alf
Hi, I downloaded the latest found version and untared it - but can not find any information how to install it. I guess it is boost based ... Has any body played with it recently? -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: displaying \n-less prompts in a pythonic way

2006-10-26 Thread alf
Steve Holden wrote: > Or use raw_input(), which was designed for such situations: > thx, did not know about that ... -- http://mail.python.org/mailman/listinfo/python-list

Python images processing -recap

2006-11-01 Thread alf
Hi, I try to summarize what is available in python for graphical images processing. So far I found: -PythonMagic -PIL -SDL_image Are all supported, which is most mature, in which I could perform for instance 'Ken Burns effect' or light filling operations. Is there anything else?

can I import the module twice (under differnet names)

2006-11-01 Thread alf
Hi, wonder if in the python I could treat modules imorts like classes instances. It means I could import it twice or more times under different names. -- alfz1 -- http://mail.python.org/mailman/listinfo/python-list

need to find out all modules from site-packages

2006-11-01 Thread alf
Hi, I need to find all modules/lib from the site-packages along with the versions. Is there a way to determine physical path to the module? And is there is a way to identify all potential "importable" modules? -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Python images processing -recap

2006-11-02 Thread alf
Fredrik Lundh wrote: > alf wrote: > >> Are all supported, which is most mature, in which I could perform for >> instance 'Ken Burns effect' > > > that's a display effect, not an image effect. you need a display (or > animation) library for that.

Re: sound process moduls in python ?

2006-11-06 Thread alf
[EMAIL PROTECTED] wrote: > Hi, > > When I was talking with my friend, I wanted to share the music I'm > listening with > my friend. I mean, I wanted my friend to hear my music and my own sound . > > I order to achieve this, I think I need to append the output of my sound > card to > the input o

the most efficient method of adding elements to the list

2006-06-05 Thread alf
Hi, Would it be .append()? Does it reallocate te list with each apend? l=[] for i in xrange(n): l.append(i) Thx, A. -- http://mail.python.org/mailman/listinfo/python-list

dynamic inheritance

2006-06-08 Thread alf
is there any way to tell the class the base class during runtime? a. -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamic inheritance

2006-06-20 Thread alf
bruno at modulix wrote: > > *But* you'd probably better tell us about the problem you're trying to > solve. Since in Python, inheritance is mostly about implementation (ie: > not needed for subtyping), your problem would probably be best solved > with composition/delegation, for which Python offe

Re: dynamic inheritance

2006-06-21 Thread alf
Michele Simionato wrote: > alf wrote: > Python is ways cooler than C++. I switched to Python from C++ over year ago and do not see a way back. C++ just sucks at each corner. > This is a sensible use case where you may > want to change the base class at runtime: Thx for the

smtpd and custom MAIL_FROM/RCPT_TO validation

2006-08-25 Thread alf
SMTPChannel. What bothers me that some code duplication from SMTPServer.__init__ and SMTPChannel.smtp_MAIL/RCPT will have to take place. Is there any way to avoid it. Probably not :-( ... -- alf -- http://mail.python.org/mailman/listinfo/python-list

M$ windows python libs installed in arbitrary directories for customized python distributions

2006-08-25 Thread alf
any way to force the actual python site-lib for M$ installers thx in advance, -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-27 Thread alf
Fredrik Lundh wrote: > "alf" <[EMAIL PROTECTED]> wrote: > > >>It turned out it is quite simple - I just install the python from >>python.org and all the libs needed. Then I take python2n.dll from >>c:\win*\system32 and move directly to PYTHONDIR. T

__str__ for large objects, would not c++ iostream be more efficient

2006-08-28 Thread alf
Hi, is there any way in Python to have iostream like __str__ operator? -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-28 Thread alf
n's installer" :-). ok, let me clarify, by M$ I meant Micro$oft. -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-29 Thread alf
Fredrik Lundh wrote: > > http://www.catb.org/~esr/faqs/smart-questions.html#writewell > > and means? -- http://mail.python.org/mailman/listinfo/python-list

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-30 Thread alf
Robert Kern wrote: > alf wrote: > >> Fredrik Lundh wrote: >> >>> http://www.catb.org/~esr/faqs/smart-questions.html#writewell >>> >>> >> >> >> and means? > > > It's his signature. > The sig is delimited by '-- \n' -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-31 Thread alf
Georg Brandl wrote: >>> >>> It's his signature. >>> >> >> The sig is delimited by '-- \n' > > > Yes, and Earth is a disk. > how deep -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: FYI: getting data from an OpenOffice.org spreadsheet

2006-09-03 Thread alf
out! > > Sybren thx for sharing the experience. Do you know how to save a OO doc into M$ Excel format - I have a Python based server running on Linux box and need to produce Excel files. -- alf -- http://mail.python.org/mailman/listinfo/python-list

inaccuracy in the time module

2006-09-04 Thread alf
Hi, can someone explane this: >>> from time import * >>> timezone 18000 >>> t=time() >>> mktime(gmtime(t))-t 17999.680048942566 why there is a difference? -- alf -- http://mail.python.org/mailman/listinfo/python-list

testing for valid reference: obj vs. None!=obs vs. obj is not None

2006-09-04 Thread alf
Hi, I have a reference to certain objects. What is the most pythonic way to test for valid reference: if obj: if None!=obs: if obj is not None: -- alfz1 -- http://mail.python.org/mailman/listinfo/python-list

Re: inaccuracy in the time module

2006-09-04 Thread alf
Paul Rubin wrote: > alf <[EMAIL PROTECTED]> writes: > >> >>> t=time() >> >>> mktime(gmtime(t))-t >>17999.680048942566 >>why there is a difference? > > > time() is a floating point number with fractional seconds. > gmtime()

re.compile().split(): why it produces empty string as a first element of the list

2006-09-26 Thread alf
Hi, Let's run following: >>> re.compile('(\[.*?\])').split('[aa]bb[11]22') ['', '[aa]', 'bb', '[11]', '22'] Why does it return '' as a first element of the list? Any insight? -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: re.compile().split(): why it produces empty string as a first element of the list

2006-09-26 Thread alf
Fredrik Lundh wrote: > alf wrote: > >> Let's run following: >> >> >>> re.compile('(\[.*?\])').split('[aa]bb[11]22') >> ['', '[aa]', 'bb', '[11]', '22'] >> >> Why does

where the extra space comes from on the stdout

2006-09-30 Thread alf
Hi, I can not find out where the extra space comes from. Run following: import os,sys while 1: print 'Question [Y/[N]]?', if sys.stdin.readline().strip() in ('Y','y'): #do something pass $ python q.py Question [Y/[N]]?y Question [Y/[N]]?y Question [Y/[N]]?y Ques

More elegant to get a name: o.__class__.__name__

2006-11-30 Thread alf
Hi, is there a more elegant way to get o.__class__.__name__. For instance I would imagine name(o). -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-08 Thread alf
Mark Tarver wrote: > How do you compare Python to Lisp? A little bit OT but I can not resist it. What always impressed me with Lisp is that LOGO (any one remembers) is Lisp based yet designed to teach kids programming. I do not know Lisp but used to program a bit in LOGO - everything was so na

Re: testing for valid reference: obj vs. None!=obs vs. obj is not None

2006-12-08 Thread alf
alf wrote: > Hi, > > I have a reference to certain objects. What is the most pythonic way to > test for valid reference: > > if obj: > > if None!=obs: > > if obj is not None: > thx for all answers - now "if obj is not None:" in an ob

Re: where the extra space comes from on the stdout

2006-12-08 Thread alf
Simon Percivall wrote: > > You already got the answer, but as for the rest: It's really easier for > you if you use raw_input() for your question/input pair instead. > thx, this is what I was looking for, alf -- http://mail.python.org/mailman/listinfo/python-list

Re: More elegant to get a name: o.__class__.__name__

2006-12-08 Thread alf
alf wrote: > Hi, > is there a more elegant way to get o.__class__.__name__. For instance I > would imagine name(o). > decided to stick to o.__class__.__name__ for readibility. -- alfz1 -- http://mail.python.org/mailman/listinfo/python-list

HTTP & tcl

2006-02-15 Thread alf
able to figure it out - with a little help ;-) Currently I am stuck in not being able to identify the Tcl equivalent of Python's "putrequest", as in: h = httplib.HTTP("wctp.skytel.com",80) h.putrequest("POST","/wctp") Thanks alf -- http://mail.python.org/mailman/listinfo/python-list

Re: HTTP & tcl

2006-02-17 Thread alf
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Fuzzyman <[EMAIL PROTECTED]> wrote: > > > >alf wrote: > >> Hi > >> > >> I would like to convert the wctpXml-1.3.py program to Tcl (line by > >> line). > >> See ht

launching default browser

2007-06-08 Thread alf
Hi, I wonder how to launch from python default Windows browser? In fact I have the same question for Linux. thx in advancve, -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: launching default browser

2007-06-09 Thread alf
Laurent Pointal wrote: > > Via webbrowser module > > http://docs.python.org/lib/module-webbrowser.html > thx a lot. Just again Python positively surprises me. > (note: its in top five in google search for Python + launch + browser...) so now it will be in top four :-). -- http://mail.pytho

overriding base class

2007-06-29 Thread alf
Hi, I want to develop a following lib: lib space user space A -> B -> | -> user_class however A and B are abstrac enough to have following: user_super_base_class -> | -> A -> B -> | -> user_class user space lib space user spaca Any idea how to do that? -- al

what is wrong with that r"\"

2007-07-03 Thread alf
question without words: >>> r"\" File "", line 1 r"\" ^ SyntaxError: EOL while scanning single-quoted string >>> r"\ " '\\ ' -- http://mail.python.org/mailman/listinfo/python-list

determining the source code and module based on the class

2007-07-15 Thread alf
n the class name can point to the module as well as the line number where the given class is defined. Is it doable in Python? -- alf -- http://mail.python.org/mailman/listinfo/python-list

subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-07-19 Thread alf
p0 0 0.0.0.0:12345 0.0.0.0:* 3248/python [1] + Terminatedpython ss.py Why it is happening? I know that os.system uses fork, but still this is something unexpected. Thx, Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-07-20 Thread alf
he child process once parent gets killed. what it the parent got multiple subprocesses. Plus it is kind of unintuitive os.system does not protect from such behavoir which is for me more an equivalent of like issuing a ne wcommand/ starting a process from the shell. Thx, -- alf -- http://ma

which is more pythonic/faster append or +=[]

2007-05-08 Thread alf
two ways of achieving the same effect l+=[n] or l.append(n) so which is more pythonic/faster? -- alfz1 -- http://mail.python.org/mailman/listinfo/python-list

distributing python software in jar like fashion

2007-03-14 Thread alf
Hi, I have a small app which consist of a few .py files. Is there any way to distribute it in jar like fashion as a single file I can just run python on. I obviously look for platform independent solution. Thx in advance, A. -- http://mail.python.org/mailman/listinfo/python-list

Re: SNMP agent

2007-04-04 Thread alf
alain wrote: > Hi, > > I have a Python app and i would like to add some SNMP agent > functionality to it. > I know it's possible to write a sub-agent with netsnmp but it is in C > and quite complicated. > I know of YAPSNMP (a wrapper around NETSNMP) but it doesn't seem to > support agent writing.

compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003

2007-04-04 Thread alf
Hi, I want to add some library but it can not be comipled? Here is an output: D:\>cl Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. usage: cl [ option... ] filename... [ /link linkoption... ] D:\> pyth

wx and SOAPpy interaction

2007-04-12 Thread alf
Hi, there is problem when I import (python 2.4) wx and SOAPpy at the same time. I narrowed the problem to following (on Linux): >>import wx >>import pyexpat Traceback (most recent call last): File "", line 1, in ? ImportError: /apps/public/python_2.4.4/lib/python2.4/lib-dynload/pyexpat.so:

Re: compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003

2007-04-12 Thread alf
le bit, get around registry paths and was able to produce .pyo file. Then I hit some runtime lib issues. In meantime I found precompiled probstat lib so gave up on making msvccompiler.py compatible with VS 2008. Bottomline - it would be nice to have such support. -- alf -- http://mail.python.org/mailm

where to report bug/get help for wxpython

2007-04-12 Thread alf
Hi, I have another problem with wxpython - that is the best place to report bug - evident memory leak on Linux and win32. -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003

2007-04-14 Thread alf
Martin v. Löwis wrote: >>well, instructions were clear enough for me. What is hard to get why it >>could not use free M$ compiler which is presumably produces compatible >>objects and libraries. > > > This presumption is incorrect. The compiler does *not* create compatible > objects and libraries

Re: compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003

2007-04-14 Thread alf
Martin v. Löwis wrote: > You either would have to create a import library for mscvr71.dll > by hand, or you have to copy one from VS 2003 (breaking its license). I wonder if copying the probstat.pyd from internet where I it finnaly found is not breaking the license:-). it was my final solution

Re: wx and SOAPpy interaction

2007-04-17 Thread alf
Amaury Forgeot d'Arc wrote: > alf a écrit : > >> Hi, >> >> there is problem when I import (python 2.4) wx and SOAPpy at the same >> time. I narrowed the problem to following (on Linux): >> >> >>import wx >> >>import pyexpat

trapping DLL import issues without blocking pop up window

2007-11-01 Thread alf
Hi, there is following issue: "import cx_Oracle" on windows pops up a nice 'DLL missing' window in case there indeed is no CLI.DLL (or something like that). Then the exception is raised. Catching the exception is obviously not a problem, but the popup practically blocks the application and

globals accros modules

2007-01-10 Thread alf
Hi, executing main.py reulsts in following: [EMAIL PROTECTED] andy]$ python main.py Traceback (most recent call last): File "main.py", line 4, in ? amodule.f() File "/raid/home/andy/amodule.py", line 3, in f print a NameError: global name 'a' is not defined How can I have global

Re: globals accros modules

2007-01-11 Thread alf
Gabriel Genellina wrote: > Change a=1 to amodule.a=1 I have multiple command line programs creating 'a' and amodule using it. Plus some import sequence dependency. So it would not work. Currently the solution in amodule is: import __main__ print __main__.a > If you find yourself doing tricks

Re: Dlaczego ten destruktor nie dziala

2007-02-05 Thread alf
Sulsa wrote: > sorry, wrong group. the group is correct but language wrong, did you find out why the exception pops up -- http://mail.python.org/mailman/listinfo/python-list

converting u'11\xa022' to '11\xa022'

2007-02-20 Thread alf
Hi, is there a more elegant way to do that: ''.join([chr(ord(i)) for i in u'11\xa022' ]) -- thx, alf -- http://mail.python.org/mailman/listinfo/python-list

Re: converting u'11\xa022' to '11\xa022'

2007-02-20 Thread alf
Jean-Paul Calderone wrote: > u'11\xa022'.encode('charmap') thx a lot. one more question, once a unicode object is created e.g. u=unicode('hello', 'iso-8859-1') is there any way to find: 1-original encoding of u 2-list of supported encodings? A. -- http://mail.python.org/mailma

templatetaizing exceptions

2007-11-12 Thread alf
Hi, I have a few places in the code where I use: try: code_block except A: exception_handling the code block is different each time while exception_handling the same. What would be the best technique to abstract that out? -- A. -- http://mail

Re: templatetaizing exceptions

2007-11-13 Thread alf
david wrote: > On Tue, 13 Nov 2007 06:17:26 -0300, Gabriel Genellina wrote: > >> A function? >> >> try: >> code_block >> except A: >> handle_exception() > > maybe > def handle(f, *args, **kw): > ... try: > ... return f(*args, **kw) > ...

why it is invalid syntax?

2007-11-21 Thread alf
Hi, I wonder why it is an invalid syntax: >>> if 1: if 1: if 1: print 1 File "", line 1 if 1: if 1: if 1: print 1 or >>> if 1: for i in range(10): print i File "", line 1 if 1: for i in range(10): print i I would expect one could nest

Re: how django discovers changed sources

2008-01-17 Thread alf
Jeff wrote: > That is the behavior of the development server. When you are writing > your application, you don't want to have to manually restart the > server every time you change a file. On apache it obviously doesn't > do that. thx for clarification, but still I am curious how it is done unde

how django discovers changed sources

2008-01-17 Thread alf
hi, I started playing with django and accidentally discovered that it restarts the server once a source file is touched. does it use some python's feature or just scans for changs on its one? sources? any idea? A. -- http://mail.python.org/mailman/listinfo/python-list

Re: how django discovers changed sources

2008-01-17 Thread alf
Jeff wrote: > On Jan 17, 2:51 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: >> 2008/1/17, alf <[EMAIL PROTECTED]>:> Jeff wrote: >>>> That is the behavior of the development server. When you are writing >>>> your application, you don

auto import

2008-01-20 Thread alf
Hi, is there any way to tweak __import__ so it imports module with another arbitrary selected module included? For instance I have my mylibs.py module. Then when I import a oneofhundredssmallmodules.py module from other place the mylibs.py is automatically imported without a explicit import. T

reloading the module imported as 'from ... import ...'

2009-08-09 Thread AlF
Hi, what is the best way to reload the module imported using 'from ... import ...' Is following a way to do so? >>> from email.charset import Charset >>> reload(email.charset) Traceback (most recent call last): File "", line 1, in NameError: name 'email' is not defined >>> >>> >>> import

Re: reloading the module imported as 'from ... import ...'

2009-08-09 Thread AlF
Steven D'Aprano wrote: On Sun, 09 Aug 2009 20:43:41 -0700, AlF wrote: Hi, what is the best way to reload the module imported using 'from ... import ...' Have you tried "from ... import ..." again? I have not because of an assumption that "import" imp

Req. for comments section "Basic Data" in intro book

2009-11-28 Thread Alf P. Steinbach
.6.5 Doc strings.44 2.6.6 Interlude IV: attribute names as strings, listing str attributes. 45 2.6.7 References. 46 EOT 49 The section on "References", 2.6.7, is about references in Python, it's not a list of references. :-) Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a local variable scope.

2009-11-29 Thread Alf P. Steinbach
thers me... I think if one could somehow declare names as const (final, readonly, whatever) then that would cover the above plus much more. Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: semantics of ** (unexpected/inconsistent?)

2009-11-29 Thread Alf P. Steinbach
ystem, so it's evaluated as "(-3)**2". If x contained text and was evaluated as such, pure text replacement, then you should be able to write 2 x and have that evaluated as "2 -x"... Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a local variable scope.

2009-11-30 Thread Alf P. Steinbach
* Jean-Michel Pichavant: Steven D'Aprano wrote: On Mon, 30 Nov 2009 02:11:12 +0100, Alf P. Steinbach wrote: I think if one could somehow declare names as const (final, readonly, whatever) then that would cover the above plus much more. Having real constants is one feature that I

Re: Req. for comments section "Basic Data" in intro book

2009-11-30 Thread Alf P. Steinbach
* Alf P. Steinbach: I added a section on "basic data" to ch 2 of my writings, an introduction to programming (with Python as main language). The intended reader is someone who is intelligent and wants to learn programming but knows little or nothing about it. As before it would be

Re: [Edu-sig] teaching python using turtle module

2009-11-30 Thread Alf P. Steinbach
o "procedures" like: def square(length): forward(length) right(90) forward(length) right(90) forward(length) right(90) forward(length) right(90) Plotting a graph. Some examples of that in ch 2 of aforementioned URL. Cheers & hth., - Alf -- http://mail.

Formatting logically nested actions -- Pythonic way?

2009-12-03 Thread Alf P. Steinbach
area ) ) as toggle_button: toggle_button.config( text = " Toggle it " ) toggle_button.pack( anchor = "w" ) interaction_area.pack( side = "left" ) display_area.place( relx = 0.5, rely = 0.5, anchor = "center" ) # Centered window.mainloop()

Are routine objects guaranteed mutable & with dictionary?

2009-12-04 Thread Alf P. Steinbach
Is this guaranteed to work in Python 3.x? >>> def foo(): pass ... >>> foo.blah = 222 >>> foo.blah 222 >>> _ Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-04 Thread Alf P. Steinbach
* Marco Mariani: Alf P. Steinbach wrote: Is this guaranteed to work in Python 3.x? >>> def foo(): pass >>> foo.blah = 222 >>> foo.blah 222 >>> _ I don't see why it shouldn't work. For example, (42).blah = 666 The question is w

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-05 Thread Alf P. Steinbach
* Raymond Hettinger: On Dec 4, 2:03 am, "Alf P. Steinbach" wrote: Is this guaranteed to work in Python 3.x? >>> def foo(): pass ... >>> foo.blah = 222 >>> foo.blah 222 Yes, function attributes are guaranteed to be writable: http://www.python.o

Re: Can't print Chinese to HTTP

2009-12-05 Thread Alf P. Steinbach
ctive console i/o one solution could be some Python module for interactive console i/o, on Windows internally using the Windows console function API, which is fully Unicode (based on UCS-2, i.e. the BMP). Cheers, - Alf Another workaround is to use a real file: import sys f = open('afile.h

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-05 Thread Alf P. Steinbach
* Steven D'Aprano: On Sat, 05 Dec 2009 11:26:34 +0100, Alf P. Steinbach wrote: Regarding my terminology, "routine" instead "function" that everybody except you remarked on, it is of course intentional. [...] I think you failed to realise that your use of the term

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-06 Thread Alf P. Steinbach
* Dennis Lee Bieber: On Sat, 05 Dec 2009 11:26:34 +0100, "Alf P. Steinbach" declaimed the following in gmane.comp.python.general: The devolution of terminology has been so severe that now even the Wikipedia article on this subject confounds the general concept of "routine"

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-06 Thread Alf P. Steinbach
* MRAB: Alf P. Steinbach wrote: > * Dennis Lee Bieber: >> On Sat, 05 Dec 2009 11:26:34 +0100, "Alf P. Steinbach" >> declaimed the following in >> gmane.comp.python.general: >> >>> The devolution of terminology has been so severe that now e

More stuff added to ch 2 of my programming intro

2009-12-09 Thread Alf P. Steinbach
ore subsections of 2.7, but I'm not quite sure about how to approach that or exactly how much to cover, since the intent of ch 2 is to introduce mostly general concepts and enable the reader to try out (more or less) interesting things. Cheers, - Alf PS: comments welcome!

Re: Python for Newbies

2009-12-09 Thread Alf P. Steinbach
om/ProgrammingBookP3> which is in Google Docs; a table of contents available as text file (it's not complete wrt. to latest stuff I added) and also in the PDF files themselves. Comments very welcome! :-) Cheers, - Alf PS: The last three or four paragraphs in ch 2 were sort of negativ

Re: Python for Newbies

2009-12-09 Thread Alf P. Steinbach
* rm: On Dec 9, 9:46 pm, "Alf P. Steinbach" wrote: * rm: Here is a new tutorial that may be a good starting point for learning Python. http://www.themaemo.com/python-for-newbies/ Looks nice. I have two comments: (1) what is "the N900"?, and (2) the naming conventio

  1   2   3   4   5   6   7   >