How to make command history persistent?

2005-10-18 Thread vbfoobar
Hello,

My question is:
  Is there an easy mean to make Python "command history"
  persistent across interpreter invokations?

PS:
  In the case the question above is not clear, I rephrase
  it below verbosely...
  When I work from the Python prompt, I enjoy features
  like command line editing and searching/recalling
  previous lines of code from the history.
  (This is similar to working from a Unix shell prompt.)
But I would like, in addition, be able to keep the history
  from one session to another (when I quit Python, the history
  is lost, but I would like to retrieve it each time In
  invoke again Python interactively).

Thanks

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to make command history persistent?

2005-10-18 Thread vbfoobar
Great! The indicated "history save" works!
Thanks

-- 
http://mail.python.org/mailman/listinfo/python-list


Looking for CGI program to browse/manage/process files thru the web

2006-09-05 Thread vbfoobar
Hello,

I am looking for Python code no other language wanted) that I couls
use/reuse/adapt to implement (via CGI, no specific app server wanted)
a web-based app that would offer the following functionality:

- browse a file hierarchy perhaps dealing with access rights check

- classical file management operations like viewing downloading
  and perhaps renaming or deleting or copying...

- but above all I want to esaily add custom operations that can be
  applied to browsable files
  for example, easily add a button that would apply a filter (perhaps
  user-parametrable) against  the file and would display the output,
  adding another button to run such or such other file processing
  treatment...

- security/coherency checks, as e.g. asserting that a processed file
has
  such or such characteristics before even attempting to process it

It would be nice for me to start with existing code that would
constitute a clean and simple base that I could customize.
I'd like to avoid coding another HTML+forms+etc generator...

+ this should be open source.

Any advice?

-- 
http://mail.python.org/mailman/listinfo/python-list


Looking for a regexp generator based on a set of known string representative of a string set

2006-09-08 Thread vbfoobar
Hello

I am looking for python code that takes as input a list of strings
(most similar,
but not necessarily, and rather short: say not longer than 50 chars)
and that computes and outputs the python regular expression that
matches
these string values (not necessarily strictly, perhaps the code is able
to determine
patterns, i.e. families of strings...).

Thanks for any idea

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a regexp generator based on a set of known string representative of a string set

2006-09-09 Thread vbfoobar

James Stroud a écrit :

> [EMAIL PROTECTED] wrote:
> > Hello
> >
> > I am looking for python code that takes as input a list of strings
> > (most similar,
> > but not necessarily, and rather short: say not longer than 50 chars)
> > and that computes and outputs the python regular expression that
> > matches
> > these string values (not necessarily strictly, perhaps the code is able
> > to determine
> > patterns, i.e. families of strings...).
> >
> > Thanks for any idea
> >
>
> I'm not sure your application, but Genomicists and Proteomicists have
> found that Hidden Markov Models can be very powerful for developing
> pattern models. Perhaps have a look at "Biological Sequence Analysis" by
> Durbin et al.
>
> Also, a very cool regex based algorithm was developed at IBM:
>
> http://cbcsrv.watson.ibm.com/Tspd.html

Indeed, this seems cool! Thanks for the suggestion

I have tried their online Text-symbol Pattern Discovery
with these input values:

cpkg-3
cpkg-31008
cpkg-3000A
cpkg-30006
nsug-300AB
nsug-300A2
cpdg-30001
nsug-300A3

>
> But I think HMMs are the way to go. Check out HMMER at WUSTL by Sean
> Eddy and colleagues:
>
>  http://hmmer.janelia.org/
>
>  http://selab.janelia.org/people/eddys/

I will look at that more precisely, but at my first look
it seems this is more specialized and less accessible
for the common mortal...
>
> James

Thanks. This may help me.

In addition I continue to look for other ideas, notably
because I want code that I can change myself,
and exclusively python code


>
> --
> James Stroud
> UCLA-DOE Institute for Genomics and Proteomics
> Box 951570
> Los Angeles, CA 90095
> 
> http://www.jamesstroud.com/

-- 
http://mail.python.org/mailman/listinfo/python-list


table (ascii text) lin ayout recognition

2006-09-12 Thread vbfoobar
Hello,

I am looking for python code useful to process
tables that are in ASCII text. The code must
determine where are the columns (fields).
Concerned tables for my application are various,
but their columns are not very complicated
to locate for a human, because even
when ignoring the semantic of  words,
our eyes see vertical alignments

Here is a sample table (must be viewed
with fixed-width font to see alignments):
=

44544  ipod  apple black 102
GFGFHHF-12 unknown thing bizar brick mortar  tbc
45fjk  do not know   + is less   biac
   disk  seagate   250GB 130
5G_gff   tbd   tbd
gjgh88hgg  media record  a and b 12
hjjfoo   bar   hop   zip
hg uy oi   hj uuu ii a   qqq ccc v ZZZ Ughj
qdsd   zertnope  nope

=

I want the python code that builds a representation
of this table (for exemple a list of lists, where each list
represents a table line, each element of the list
being a field value).

Any hints?
thanks

-- 
http://mail.python.org/mailman/listinfo/python-list


How to apply text changes to HTML, keeping it intact if inside "a" tags

2006-09-26 Thread vbfoobar
Hello,

I have HTML input to which I apply some changes.

Feature 1:
===
I want to tranform all the text, but if the text is inside
an "a href" tag, I want to leave the text as it is.

The HTML is not necessarily well-formed, so
I would like to do that using BeautifulSoup (or
maybe another tolerant parser).

As a test case, suppose I want to uppercase all the text
except the text that is within "a href" tags:

ExampleString = """
Lorem Ipsum is simply
dummy text of the printing and
typesetting industry.
Thanks."""

When applying the text transform, I want to obtain:

LOREM IPSUM IS SIMPLY
DUMMY TEXT OF the printing AND
typesetting industry.
THANKS."""


Feature 2:

Another thing I may want to do: If the text I would normally
transform is inside an "a href" tag, then do not transform it,
but insert the result of text transformation just after the "".

Using the same example as input, application of
this feature2 would give something like that:

LOREM IPSUM IS SIMPLY
DUMMY TEXT OF the printingTHE
PRINTING AND
typesetting
industry.TYPESETTING INDUSTRY.
THANKS."""


Thanks for your help

-- 
http://mail.python.org/mailman/listinfo/python-list