-- Forwarded message --
Date: Wed, 23 Nov 2005 21:43:27 -0400
From: mike donato <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [Tutor] TRULY NEWBIE - MENTOR NEEDED
Thank You Danny
I changed - and didnt get an executable, not sure what is supposed to be the
output.
Mike
Dear Gurus of python one liner innovator
I have about 150 lines of python extracting text from large file, the
problem I need a few lines to clean first to avoid the problem the
script is facing
Overview
There is large text and I am trying to organize it for the python script
to process, it is ba
[Slightly busy at the moment; can someone else help?
Alan, in the future, don't send replies directly to me: send them to the
Tutor list. It's an ad-hoc way to load-balance your questions across all
the tutors.]
-- Forwarded message --
Date: Thu, 24 Nov 2005 03:55:00 -0600
From:
Hi all! I'm here again with a question about introspection.
My module stores a set of functions. I need to know, from another
script, if a particular function of this module "is enabled" (it
means, if it shall be executed by the caller script). I looked for
some introspective builtin/function, but
What do you mean enabled?
If it's imported into the namespace you can call it...
Err, can you clarify on the enabling, what context are you using it
in, and what are you trying to achieve?
On 11/25/05, Negroup - <[EMAIL PROTECTED]> wrote:
> Hi all! I'm here again with a question about introspec
2005/11/24, Liam Clarke <[EMAIL PROTECTED]>:
> What do you mean enabled?
>
> If it's imported into the namespace you can call it...
>
> Err, can you clarify on the enabling, what context are you using it
> in, and what are you trying to achieve?
Hi, sorry. I'll try to present the actors omitting t
Is it feasible to change a program's source code whilst it is running
without having to restart the program? Is it feasible to get a
program to change it's own source code while it is running?
For example, if you have a web server such as CherryPy that will
(hopefully) be running for months at a
Negroup - wrote:
> Hi all! I'm here again with a question about introspection.
>
> My module stores a set of functions. I need to know, from another
> script, if a particular function of this module "is enabled" (it
> means, if it shall be executed by the caller script). I looked for
> some intros
Ed Singleton wrote:
> Is it feasible to change a program's source code whilst it is running
> without having to restart the program? Is it feasible to get a
> program to change it's own source code while it is running?
>
> For example, if you have a web server such as CherryPy that will
> (hopefu
On 24/11/05, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Ed Singleton wrote:
> > Is it feasible to change a program's source code whilst it is running
> > without having to restart the program? Is it feasible to get a
> > program to change it's own source code while it is running?
> >
> > For exampl
Ok. That's the point. I think i meant case-sensitive. There are
some ways described here that will me help out.
Yes, the list is sorted when i print it out.
It was my fault, sorry guys.
Thank you a lot.
mac
___
Tutor maillist - Tutor@python.org
http:/
2005/11/23, Greg Lindstrom <[EMAIL PROTECTED]>:
> something that would read in my XML file and format it in a similar manner
> to "pretty print" so I can verify the correct information is being pulled.
> My immediate concern is to read in an XML stream from a file and format it
> with indentatio
Ed Singleton wrote:
> Hmmm, that's discouraging. Do you know if it's feasible to just keep
> changes to code in memory synchronised with changes nto the source
> code? So rather than reload source code, make sure that the source
> code reflects what is running in memory?
>
> For example if your
Ed Singleton wrote:
> Is it feasible to change a program's source code whilst it is running
> without having to restart the program? Is it feasible to get a
> program to change it's own source code while it is running?
You can change a class while it is running.
>
> For example, if you have a we
| I have about 150 lines of python extracting text from large file, the
| problem I need a few lines to clean first to avoid the problem the
| script is facing
Hello,
This seems like a well laid out task. If you post what you are trying and the
problems you are encountering, that would be helpfu
> I changed - and didnt get an executable, not sure what is supposed to be
> the output.
Hi Mike,
The main way to run a Python program is to run it through its interpreter.
That is, there's no need to build a separate executable: the source is the
distributable.
If you really need to make an .E
Hey all
I want to know how can I convert an integer number to a binary number.
Like this example:
+10 (decimal representationinteger) = 1010 (binary representation)
Thanks in advanced
Alberto
___
Tutor maillist - Tutor@python.org
http://mai
Hi John,
> Everything is possible with list comprehensions!
>>> [x for z in a for y in z for x in y]
> [1, 2, 3, 31, 32, 4, 5, 6, 7, 71, 72, 8, 9]
impressive!
But in the general case can you do the same job as
reduce in a list comprehension? ie apply an operation
to the first two elements of
> I changed - and didnt get an executable, not sure what is supposed to be
> the
> output.
I'm not sure what you expect to get, but an executable file is definitely
not going to be it...
>> > class String(str, Object):
If you inherit from str you don't need to inherit from object
since str alre
There are many ways of doing this, few of them very nice IMHO.
> without having to restart the program? Is it feasible to get a
> program to change it's own source code while it is running?
Yes, you can overwrite an existing module then call reload
from within the program.
> For example, if yo
> For example if your program is running, and you make a change to a
> class, is it possible to create the necessary class definition and
> save it to a file?
You can do that but even if you do follow the LSP closely, you still
can have problems, especially when you subtract functions or data
ra
On 22/11/05, Alan Gauld <[EMAIL PROTECTED]> wrote:
> But in the general case can you do the same job as
> reduce in a list comprehension? ie apply an operation
> to the first two elements of a sequence and replace
> them with the result, then repeat until the list becomes
> a single value?
Well ..
OK, I made some progress I think.
I added a few lines to Kent's script to get closer what I really am after:
==
lines = open('liga050926.sbk')
# to get the data from a real file
#lines = iter(data) # getting
data from a string, you don't need this whe
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> >>> def f(x, y):
> ... return x + y
> ...
> >>> arr = range(10)
> >>> sum(arr) # Our target
> 45
> >>> tmp = [0]
> >>> [f(x, y) for x in arr for y in [tmp[-1]] if tmp.append(f(x,
> y)) or True][-1]
>
On 25/11/05, Nick Lunt <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > >>> def f(x, y):
> > ... return x*y
> > ...
> > >>> arr = range(1, 10)# Don't want to include 0!
> > >>> reduce(f, arr) # Our target
> > 362880
> > >>> tmp = [1]
> > >>> [f(x, y) for x in arr for y i
> But in the general case can you do the same job as
> reduce in a list comprehension?
>>> def f(x, y):
... return x + y
...
>>> tmp = [0]
>>> [f(x, y) for x in arr for y in [tmp[-1]] if tmp.append(f(x, y)) or
>>> True][-1]
45
Let's try some more...
>>> def f(x, y):
... return x*y
...
>>> tmp
On 25/11/05, Alberto Troiano <[EMAIL PROTECTED]> wrote:
> I want to know how can I convert an integer number to a binary number.
> Like this example:
Hi Alberto,
There's no builtin function to do this (like there is for hex or oct).
There are a few recipes in the Cookbook on ActiveState that wil
> From: Alan <[EMAIL PROTECTED]>
>
> I have about 150 lines of python extracting text from large file, the
> problem I need a few lines to clean first to avoid the problem the
> script is facing
>
> Overview
> There is large text and I am trying to organize it for the python script
> to process,
Smiles
Thanks a thousands
Let us do one task at a time= task 1
relocate/move any words in |H between (...) to the end of |R rating and
before the next line of |H
sorry the master python script wants one | before H and F and R in any
place however some |H |F |R do not come in the beginning in
29 matches
Mail list logo