Ian Bicking wrote:
> glomde wrote:
>
>>i I would like to extend python so that you could create hiercical
>>tree structures (XML, HTML etc) easier and that resulting code would be
>>more readable than how you write today with packages like elementtree
>>and xist.
>>I dont want to replace the packa
Edward C. Jones wrote:
> #! /usr/bin/env python
> """
> When I run the following program I get the error message:
>
> UnboundLocalError: local variable 'x' referenced before assignment
>
> Can "inner" change the value of a variable defined in "outer"?
Not this way
> Where
> is this explained i
John Salerno wrote:
> What is the best way of altering something (in my case, a file) while
> you are iterating over it? I've tried this before by accident and got an
> error, naturally.
>
> I'm trying to read the lines of a file and remove all the blank ones.
> One solution I tried is to open the
Paul McGuire wrote:
> "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in
> message news:[EMAIL PROTECTED]
>
>>bruno at modulix a écrit :
>>(snip)
>>
>>(responding to myself)
>>(but under another identity - now that's a bit schizophrenic
Ralf Muschall wrote:
> Jeffrey Barish wrote:
>
> [overriding of base class member functions by subclass]
>
(snip)
>
> In Python, a function not intended to be overriden should be either
> have a name starting with an underscore
actually with *two* underscores. The single-leading-underscore nami
Edward Elliott wrote:
> George Sakkis wrote:
>
>
>>Em Dom, 2006-05-21 às 17:11 +0200, Heiko Wundram escreveu:
>>
>>>for node in tree if node.haschildren():
>>>
>>>
>>>as syntactic sugar for:
>>>
>>>for node in tree:
>>>if not node.haschildren():
>>>continue
>>>
>
> [snip]
>
>>2) "There should b
Matteo Rattotti wrote:
> Hi all,
>
> i've noticed a strange beaviour of string.count:
>
> in my mind this code must work in this way:
>
> str = "a_a_a_a_"
dont use 'str' as an identifier, it shadows the builtin str type.
> howmuch = str.count("_a_")
> print howmuch -> 3
>
> but the count retu
[EMAIL PROTECTED] wrote:
> ello there. i am having a problem getting a module to work right.
>
> i wrote a class that is going to be used in a few different scripts in
> the same directory.
>
> it looks like this:
>
> #!/usr/bin/python
This is not needed for a module.
(snip code)
> the file is
Andrew Robert wrote:
> Hey Bruno,
>
>
> Although I have not tested it, this appears to be it exactly.
>
>
> Some confusion though.
>
>
>
>
>>import struct
>>
>>class TriggerMessage(object):
>>def __init__(self,data):
>>"""
>>Unpacks the passed binary data based on the
>
NetKev wrote:
(snip)
> def process_log(self, logfile, offset):
> if new_denied_hosts:
> info("new denied hosts: %s", str(new_denied_hosts))
> [warn_Admin(ip) for ip in new_denied_hosts]
This uselessly builds a list. List comprehension is meant to create
lists, n
Ju Hui wrote:
> is python search module by paths in sys.path?
sys.path is the list of path where the Python interpreter will search
modules, yes.
> how to change it manuallly?
"manually" ?-)
You mean "dynamically, by code" ? If yes, it's just a list. You can
modify it like you'd do for any othe
Scott David Daniels wrote:
> bruno at modulix wrote:
>
>> Ralf Muschall wrote:
>>
>>> Jeffrey Barish wrote:
>>>
>>> [overriding of base class member functions by subclass]
>>> In Python, a function not intended to be overriden should
Ben Finney wrote:
> "SamFeltus" <[EMAIL PROTECTED]> writes:
>
>
>>I keep trying to understand why people like HTML/JS, I don't think I
>>am gonna understand.
>
>
> It's fairly simple: HTML, CSS and JavaScript have all been
> standardised independent of any single corporation, and are freely
> i
George Sakkis wrote:
> Bruno Desthuilliers wrote:
>
>
>>George Sakkis a écrit :
>>
>>>Although I consider dict(**kwds) as one of the few unfortunate design
>>>choices in python since it prevents the future addition of useful
>>>keyword arguments (e.g a default value or an orderby function), I've
Carl J. Van Arsdall wrote:
(snip)
Not an answer to your question, just a few comments on your code:
> class Shared:
class Shared(object):
>def __init__(self):
>self.__userData= {}
>self.__mutex = threading.Lock() #lock object
Don't use __names unless yo
[EMAIL PROTECTED] wrote:
(snip)
> So now i'm hear to use all of your collective expertise for the ideal
> book for a beginning programming who want's to start with python.
'ideal' greatly depends on the reader !-)
But FWIW, this is a FAQ (well : 2):
http://www.python.org/doc/faq/general/#i-ve-ne
defcon8 wrote:
> 1. Does it matter?
> 2. Is it affecting your productivity.
> 3. Are you not trying to programme?
> 4. It is open source, change it and stop whining.
>
What about trying emacs +x doctor ?
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]
Sullivan WxPyQtKinter wrote:
> Guess what would be the result of these functions:
s/functions/method calls/
>
str.lower('ASFA')
=> 'ASFA'.lower() => 'asfa'
str.join(str(),['1','1','1'])
=> ''.join(['1','1','1']) => '111'
str.join('a','b')
=> 'a'.join('b') => 'b'
>
> If you gue
James Stroud wrote:
(snip)
> Since python is "weakly typed",
s/weakly/dynamically/
(snip)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailman/listinfo/python-list
sophie_newbie wrote:
> OK this might seem like a retarded question,
Better to look like an ignorant than to stay one !-)
> but what is the difference
> between a library and a module?
Python only defines 'modules' and 'packages'. A module can technically
be any python source file, but usually re
Brian Elmegaard wrote:
> Hi,
>
> I am struggling to understand how to really appreciate object
> orientation. I guess these are FAQ's but I have not been able to find
> the answers. Maybe my problem is that my style and understanding are
> influenced by matlab and fortran.
>
> I tried with the si
Brian Elmegaard wrote:
> bruno at modulix <[EMAIL PROTECTED]> writes:
>
>
>>Now how you could do it the OO way (Q&D, not really tested):
>
>
> Something goes wrong in my 2.3
So it's time to move to 2.4x !-)
What is "going wrong" exactly
Steven D'Aprano wrote:
(snip)
> I say "think you want" because I don't know what problem you are trying to
> solve with this messy, self-referential, piece of code.
This messy piece of code is mine, thanks !-)
And it's not "self-referential" - it introduces a references cycle
(class object -> in
Brian Elmegaard wrote:
> bruno at modulix <[EMAIL PROTECTED]> writes:
>
>
>>So it's time to move to 2.4x !-)
>
>
> I guess so.
>
>
>
>>What is "going wrong" exactly ?
>
>
> def _add_instance(cls, instance):
>
reinsn wrote:
> Hi,
>
> I am currently working with ZopeX3. Because python doesn't include
> concept of interfaces,
It does, but implicitly. The interface of an object is the set of
messages it understands.
> those were defined by the module zope.interface.
>
> So interfaces were defined like:
Pedro Graca wrote:
> [EMAIL PROTECTED] wrote:
>
>>My version is similar to Just one:
>>
>>from random import shuffle
>>
>>def scramble_text(text):
>>"""Return the words in input text string scrambled
>>except for the first and last letter."""
>>def scramble_word(word):
>
>
> Nice. Yo
Magnus Lycka wrote:
> I want an re that matches strings like "21MAR06 31APR06 1236",
> where the last part is day numbers (1-7), i.e it can contain
> the numbers 1-7, in order, only one of each, and at least one
> digit. I want it as three groups. I was thinking of
>
> r"(\d\d[A-Z]\d\d) (\d\d[A-Z]
rh0dium wrote:
> Hi all,
>
> I have a dict which looks like this..
>
> dict={'130nm': {'umc': ['1p6m_1.2-3.3_fsg_ms']},
> '180nm': {'chartered': ['2p6m_1.8-3.3_sal_ms'], 'tsmc':
> ['1p6m_1.8-3.3_sal_log', '1p6m_1.8-3.3_sal_ms']},
> '250nm': {'umc': ['2p6m_1.8-3.3_sal_ms'], 'tsmc':
> ['1p6m_2.2-3.
Steven D'Aprano wrote:
> On Thu, 09 Mar 2006 13:44:25 +0100, bruno at modulix wrote:
>
>
(snip)
>>And it's not "self-referential" - it introduces a references cycle
>>(class object -> instances -> class object), which may or may not be a
>>
Gregor Horvath wrote:
> Felipe Almeida Lessa schrieb:
>
>del B
># We'll to tell him to collect the garbage here, but
>>
>> ... # usually it should not be necessary.
>
> Thanks. If I do
>
> del B
>
> then the __del__ of A gets called.
> That surprises me.
Why ?
> I thought that B gets
Martin P. Hellwig wrote:
> While I was reading PEP 8 I came across this part:
>
> """
> Function and method arguments
>Always use 'self' for the first argument to instance methods.
>Always use 'cls' for the first argument to class methods.
> """
>
> Now I'm rather new to programming and u
ahart wrote:
> Diez, Scott, and Bruno,
>
> I thank you all for your help and suggestions. I wasn't aware that
> default values were considered class (static) values.
These are *not* 'default values'. Defining a name in the body of a class
statement bind that name to the *class*. To bind a name to
[EMAIL PROTECTED] wrote:
> I'm having a scoping problem. I have a module called SpecialFile,
The convention is to use all_lowercase names for modules, and CamelCase
for classes.
> which defines:
>
> def open(fname, mode):
> return SpecialFile(fname, mode)
This shadows the builtin open() func
Steven D'Aprano wrote:
> On Mon, 13 Mar 2006 21:28:06 -0800, garyjefferson123 wrote:
>
>
>>I'm having a scoping problem. I have a module called SpecialFile,
>>which defines:
>>
(snip code)
>>The problem, if it isn't obvioius, is that the open() call in __init__
>>no longer refers to the builtin
Scott David Daniels wrote:
> [EMAIL PROTECTED] wrote:
>
>> ... Is the Python debugger fairly stable?
>
> Yes, but it is not massively featured. The "Pythonic" way is to
> rarely use a debugger (test first and straightforward code should
> lead to "shallow" bugs). Often for most of us judiciousl
[EMAIL PROTECTED] wrote:
> Is there any editor or IDE in Python (either Windows or Linux) which
> has very good debugging facilites like MS VisualStudio has or something
> like that.
>
> I like SPE but couldn't easily use winPDP. I need tips to debug my code
> easily.
pythonic "debugging" in thre
[EMAIL PROTECTED] wrote:
> I have used Perl for a long time, but I am something of an experimental
> person and mean to try something new. Most of my 'work' with Vector
> Linux entails the use of Perl (a bit of a misnomer as it is not now a
> paid position -- I am not yet even out of K-12), and the
rodmc wrote:
> I have written a small server application (for Windows) which handles
> sending and receiving information from an instant messaging client and
> a database. This server needs to run 24/7, however it stops when the
> computer screen is locked.
>
> I assume there is a way to make it r
meeper34 wrote:
> Hi,
>
> I'm just starting out with Python, and so far I am thoroughly impressed
> with what you can do very easily with the language.
>
> I'm coming from a
> C++ background here. A couple of questions came up as I was thinking
> about dynamically typed languages:
>
> 1. If so
Tim Chase wrote:
> I've set up an object and would like to make certain attributes
> read-only (or at least enforce it without doing extra work, as per
> name-mangling or the like). Ideally, the property would be set in the
> __init__, and then not be allowed to change.
>
> The best solution I've
Eduardo Biano wrote:
> I am a python newbie and I have a problem with writing
> each record read to a file. The expected output is 10
> rows of records, but the actual output of the code
> below is only one row with a very long record (10
> records are lump into one record). Thank you in
> advance
Lonnie Princehouse wrote:
> Can anyone think of a way to substitute a user-supplied dictionary as
> the local dict for a function call?
>
> e.g.
>
> def f():
>x = 5
>
> d = {}
>
> exec_function_in_dictionary( f, d ) # ???
>
> print d["x"] # 5
>
def f(**kw):
kw['x'] = 5
d = {}
f
John Salerno wrote:
> From my brief experience with C#, I learned that it was pretty standard
> practice to put each class in a separate file. I assume this is a
> benefit of a compiled language that the files can then be grouped together.
>
> What I'm wondering is how is this normally handled in
Lonnie Princehouse wrote:
>>What's your use case exactly ?
>
>
> I'm trying to use a function to implicitly update a dictionary.
I think this was pretty obvious. What I wonder is *why* you want/think
you need to do such a thing -I don't mean there can't be no good reason
to do so, but this has
Chason Hayes wrote:
> How can I get a script to pipe data to another program, wait for a
> response, then send more data etc.
>
> For example, from a script, I want to run smbclient then send it the
> username, password, and then some commands. (I know there are better ways
> to achieve this funct
Lonnie Princehouse wrote:
>>Beautiful is better than ugly.
>>Explicit is better than implicit.
>>
>>>Err... I see no contradiction nor conflict here.
>
>
> What to do when explicit is ugly and implicit is beautiful?
Depends on your understanding of explicit/implicit.
Side effects on globals o
Ilias Lazaridis wrote:
> Where can I find practical coding examples for real life coding problems?
Probably in real life code ?-)
> Something like a categorized solution guide?
Look for the Python cookbook (google is your friend).
> -
>
> My current problem:
>
> * create a folder
> * seems
Ministeyr wrote:
> Hello,
>
> os.walk doc: http://www.python.org/doc/2.4/lib/os-file-dir.html#l2h-1625
>
> When walking top to bottom, it allows you to choose the directories you
> want to visit dynamically by changing the second parameter of the tuple
> (a list of directories). However, since it
Rc wrote:
> "DaveM" <[EMAIL PROTECTED]> schreef in bericht
> news:[EMAIL PROTECTED]
>
>>On Thu, 16 Mar 2006 13:34:14 +0100, "Méta-MCI"
>><[EMAIL PROTECTED]> wrote:
>>
>>
>>>Après, vous pourrez aussi fréquenter le newsgroup :
>>> fr.comp.lang.python
>>>qui a l'avantage d'être en français.
>>
Hi
I'm currently playing with some (possibly weird...) code, and I'd have a
use for per-instance descriptors, ie (dummy code):
class DummyDescriptor(object):
def __get__(self, obj, objtype=None):
if obj is None:
return self
return getattr(obj, 'bar', 'no bar')
class MyClass1(obje
[EMAIL PROTECTED] wrote:
> Hi folks,
>
> Of TurboGers & Django WAF candidates, which one would be easier to use
> in an environment where the data/content doesn't come an RDBMS, but
> from other server-side apps...
IMHO, both.
> If these are not good candidates, could
> you suggest appropriate
Ziga Seilnacht wrote:
> bruno at modulix wrote:
>
>>Hi
>>
>>I'm currently playing with some (possibly weird...) code, and I'd have a
>>use for per-instance descriptors, ie (dummy code):
>
>
>
>
>>Now the question: is there
Michael Spencer wrote:
> Bruno Desthuilliers wrote:
>
(snip)
>
>> BTW, there may be other use case for per-instance descriptors...
>
>
> Agreed. Per-instance descriptors could be interesting (that's why the
> subject line caught my attention).
> But your solution involves a custom __getattrib
Steven Bethard wrote:
> bruno at modulix wrote:
>
>> Hi
>>
>> I'm currently playing with some (possibly weird...) code, and I'd have a
>> use for per-instance descriptors,
(snip)
>>
>> class MyClass2(MyClass1):
>> def __getattrib
Steven Bethard wrote:
(some smart questions)
Steven , I owe you a *big* thank.
I knew they must have been something wrong, but couldn't point what. Now
I see, and it's of course totally obvious. Using a class as a
decorator, I have of course only one instance of it per function - and
for some at
Steven Bethard wrote:
(snip code)
>
> But that looks pretty nasty to me.
> It sounds like your architecture
> could use some redesigning
Done - in much more sane way. Got rid of some more boilerplate and of
the whole problem of per-instance descriptors BTW !-)
I should probably sleep more
Ronny Mandal wrote:
> Is there a way of checking whether the call to a set-function is
> called from within the class, e.g. the __init__() contra
> .set()?
import inspect
help(inspect.stack)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[E
Dennis Lee Bieber wrote:
> On Mon, 27 Mar 2006 01:34:14 +0200, Bruno Desthuilliers
> <[EMAIL PROTECTED]> declaimed the following in
> comp.lang.python:
>
>
>>Ok, so even if Python itself declares b and b2 (read: objects that names
>>b and b2 are bound to) to be of the same type, you cannot appl
Steven D'Aprano wrote:
> On Sat, 25 Mar 2006 21:33:24 -0800, DrConti wrote:
>
>
>>Dear Python developer community,
>>I'm quite new to Python, so perhaps my question is well known and the
>>answer too.
>>
>>I need a variable alias ( what in other languages you would call "a
>>pointer" (c) or "a r
Sullivan WxPyQtKinter wrote:
> Python disappointly failed to provide a convinient cgi session
> management module.
Probably because there are much better options for web programming in
Python ?
> Not willing to use external modules, I would like to
> implement a simplest Session object on my own
John wrote:
> Hi, is it possible to instantiate a class with a variable.
>
> example
>
> class foo:
> def method(self):
> pass
>
> x='foo'
>
> Can I use variable x value to create an instance of my class?
You got examples using string 'foo', now if all you need is to store or
pass
DrConti wrote:
> Hi Bruno, hi folks!
> thank you very much for your advices.
> I didn't know about the property function.
> I learned also quite a lot now about "references".
> Ok everything is a reference but you can't get a reference of a
> reference...
>
> I saw a lot of variations on how to s
Anand wrote:
>>>Wouldn't it be nice to say
>>>id, *tokens = line.split(',')
>>
>>
>>id, tokens_str = line.split(',', 1)
>
>
> But then you have to split tokens_str again.
>
> id, tokens_str = line.split(',', 1)
> tokens = tokens_str.split(',')
>
> this is too verbose.
>
head_tail = lambda seq
walterbyrd wrote:
> Way back when, I got a lot of training and experience in highly
> structued software development. These days, I dabble with
> web-development, but I may become more serious.
>
> I consider php to be an abombination, the backward compatibility issues
> alone are reason enough t
Sullivan WxPyQtKinter wrote:
> bruno at modulix 写道:
>
>
>>Sullivan WxPyQtKinter wrote:
>>
>>>Python disappointly failed to provide a convinient cgi session
>>>management module.
>>
>>Probably because there are much better options for web progra
walterbyrd wrote:
>>You can bet it'll be plain old cgi - possibly with an outdated Pyton version.
>
> I think you are right. In practical terms, what does that mean? Will I
> not be able to use modules? Will I not be able to use frameworks?
It means that you will be limited to what can run with
Sullivan WxPyQtKinter wrote:
> I do not want to use Cookies in my site since not all web browser
> support it well and sometimes people close cookie functioning for
> security reasons.
Too bad for them. The only other way to support session is by encoding
the session id in the request, and it's m
John Salerno wrote:
> I'm working on another exercise now about generating random numbers for
> the lottery. What I want to do is write a function that picks 5 random
> numbers from 1-53 and returns them. Here's what I have so far:
>
> numbers = range(1, 54)
>
> def genNumbers():
> for x in ra
Paul Rubin wrote:
(snip)
> Why is everyone using shuffle?
>
> >>> import random
> >>> random.sample(xrange(1,41), 5)
> [24, 15, 9, 39, 19]
Great. Didn't know that one.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTEC
toto wrote:
> Hi,
>
> I'm trying to find some howto, tutorial in order to create a python program
> that will allow plug-in programming. I've found various tutos on how to
> write a plug-in for soft A or soft B but none telling me how to do it in my
> own programs. Do you have any bookmarks ??
Tr
Ernesto wrote:
> I'm looking for a tool that I can use to "step through" python software
> (debugging environment).
This is not an 'IDE', it's a debugger.
> Is there a good FREE one
http://www.python.org/doc/2.4.2/lib/module-pdb.html
Strange enough, I almost never had a use for a debugger in
Michael Tobis wrote:
> We had some discussion of this in the edu-sig meeting at PyCon.
>
> I alleged that I had read that there is no such thing as a Python
> sandbox.
And yet Zope 2 has some restricted environment for TTW scripts...
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([
yawgmoth7 wrote:
> Hello, I have a piece of code:
>
>command = raw_input("command> ")
>words = string.split(command, ' ')
>temparg = words
>if len(words)<= 3:
>temparg = words[4:]
>else:
>
Steven D'Aprano wrote:
> Sakcee wrote:
>
>> python provides a great way of dynamically creating fuctions calls and
>> class names from string
>>
(snip)
> Personally, I think the best way is: find another way to solve your
> problem.
>
See Duncan's post for a pretty clean and pythonic solution.
momobear wrote:
> hi, is there a way to let python operate on sequence of int or short?
> In C, we just need declare a point,
I assume you mean a 'pointer'.
> then I could get the point value,
> just like:
> short* k = buffer, //k is a point to a sequence point of short.
> short i = *k++,
> but
Johhny wrote:
> Hello,
>
> I have recently written a small function that will verify that an IP
> address is valid.
(snip re.match() based solution - just one remark: compiling the regexp
on each function call is more than useless)
> I was having issues trying to get my code working so that I c
momobear wrote:
> but what about buffer is not be declared in python program, it comes
> from a C function. and what about I want to treat a string as a short
> list?
There are no "short" in Python. An integer is an integer is an integer...
> buffer = foobur() // a invoke from C function, it is
Stefan Schwarzer wrote:
> Hello,
>
> from time to time I want to inspect the source code of projects
> on remote computers.(*) I've googled for one or two hours but
> didn't find anything helpful. :-/ I'm looking for something like
> IDLE's path browser - i. e. a tree view and file view
> side-by-
Larry Bates wrote:
> abcd wrote:
>
>>I recently came across a problem where I saw this error:
>>"TypeError: unsubscriptable object"
>>
>>How can I determine if an object is "scriptable" or "unscriptable"?
>>
>
> Simplest answer is to use isinstance to see if it is a string, list,
> or tuple:
>
>
abcd wrote:
> Richard Brodie wrote:
>
>>subscriptable: supports an indexing operator, like a list does.
>
> doesn't seem to be a builtin function or module...
It's not. Look no further.
> or is that just your
> definition of subscriptable?
It's a correct definition of 'subscriptable' in the c
abcd wrote:
> I recently came across a problem where I saw this error:
> "TypeError: unsubscriptable object"
>
> How can I determine if an object is "scriptable" or "unscriptable"?
By trying to apply the subscript operator ('[]'). If it raises a
TypeError, then it's not subscriptable.
But, as La
[EMAIL PROTECTED] wrote:
> hi,
>I am new to Python programming.I am not getting exactly pdb.Can
> anyone tell me effective way to debug python code?
(automated) unit tests + print statements + the interactive shell are
usually enough. I almost never used pdb in 5+ years of Python programm
Fredrik Lundh wrote:
> Dennis Lee Bieber wrote:
>
>
>>> I want to know which is the best IDE for python.Please if
>>>possible mention the features of the IDE.
>>
>>The best IDE is the one that YOU can be most productive in. What /I/
>>find useful may not be of interest to /you/.
>
>
> nons
Duncan Booth wrote:
> Fredrik Lundh wrote:
>
>
>>as you can see, Microsoft's usability team has made some massive
>>improvements (note how well it deals with the "eat flaming death"
>>command):
>
>
> I especially like the way running it messes up the prompt:
>
> C:\Documents and Settings\Dunca
Sullivan WxPyQtKinter wrote:
> a relation database has admiring search efficiency when the database is
> very big (several thousands or tens of thousands of records). But my
> current project is based on XML, for its tree-like data structure has
> much more flexibility; and DOM, which could be mani
PyPK wrote:
> ok I reason I was going with globals is that i use this variable in
> another class something like this along with above
>
> testflag = 0
>
> class AA:
>def __init__(...):
>
> def methos(self,...):
>global testflag
>testflag = xx
>
> class BB:
> def __ini
Gabriel de Dietrich wrote:
> Maybe you're looking for something like this?
> http://jamesthornton.com/eckel/TIPython/html/Index.htm
>
> Haven't read it yet, but seems to be about design patterns. Not the
> "definitive" stuff, though...
While TIP is an interesting book, it is more about implementa
Ravi Teja wrote:
(snip)
>>>More theoretical question is if I create classes on the fly, how UML can
>
> reflect that?
>
> "On the fly" usually means "at runtime". I guess you mean if you
> "change code" will my diagram stay in sync?.
Nope, the OP really meant "on the fly", as in "at runtime". In
Philippe Martin wrote:
> Roman Susi wrote:
>
(snip)
>>More theoretical question is if I create classes on the fly, how UML can
>>reflect that?
>
>
> You mean objects I think:
Yes : class objects !-)
Python's classes *are* objects. And you can create new classes at runtime.
(snip)
--
bruno d
Ravi Teja wrote:
(snip)
>
>> And probably Python is too dynamic for UML. That is another reason
> rountrip tools aren't there.
>
>
> As you probably already know, UML diagrams are structural and
> behavioural (plus interactional with 2.0). Round trip tools only model
> structural diagrams. Pytho
Philippe Martin wrote:
please don't top-post - corrected
> bruno at modulix wrote:
>
>
>>Philippe Martin wrote:
>>
>>>Roman Susi wrote:
>>>
>>
>>(snip)
>>
>>
>>>>More theoretical question is if I create class
[EMAIL PROTECTED] wrote:
(snip part about filters)
> Any good "generators" written in Python? I'd like to roll me one of
> these as well; e.g. execute the program and it will create a few
> paragraphs of text in the jargon of a discipline, subdiscipline,
> subculture, etc. Anyone know what I'm ta
Steven Bethard wrote:
> The PEP below should be mostly self explanatory. I'll try to keep the
> most updated versions available at:
>
> http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt
> http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html
>
>
>
> PEP: XXX
> Title
Serge Orlov wrote:
> bruno at modulix wrote:
>
>>Steven Bethard wrote:
>>
>>>The PEP below should be mostly self explanatory. I'll try to keep the
>>>most updated versions available at:
>
>
> [snip]
>
>
>>Seems mostly clean. +1.
&g
[EMAIL PROTECTED] wrote:
> I have a list y
>
y
>
> ['20001201', 'ARRO', '04276410', '18.500', '19.500', '18.500',
> '19.500', '224']
>
> from which I want to extract only the 2nd and 4th item
>
> by partially
> unpacking the list. So I tried
>
a,b = y[2,4]
Mmm, so lovely and meaningful
Joachim Worringen wrote:
> I need to process large lists (in my real application, this is to parse
> the content of a file).
Then you probably want to use generators instead of lists. The problem
with large lists is that they eat a lot of memory - which can result in
swapping .
> I noticed that
[EMAIL PROTECTED] wrote:
> I can handle making the connections and running queries, but what's the
> best way to process table rows returned in Python?
depends on what you want to do with them.
> What about turning a
> table definition into an object? Just looking for ways to be efficient,
> sinc
John Salerno wrote:
> So last night I had a dream that me and two other guys needed to get a
> simple task done in Java.
Then s/dream/nightmare/
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.
Peter Hansen wrote:
> Mirco Wahab wrote:
>
>> Hi Ralf
>>
>>> So we should rename Python into Cottonmouth to get more attention.
>>
>>
>> No, always take some word that relates to
>> something more or less 'feminine', its about
>> 96% of young males who sit hours on programming
>> over their belove
Ernesto García García wrote:
> Hi experts,
>
> I've built a class for parsing a user-defined list of files and matching
> lines with a user-defined list of regular expressions. It looks like this:
>
(snip code)
>
> But then, when I try to use my class using actions with "memory" it will
> fail:
401 - 500 of 526 matches
Mail list logo