Brian van den Broek | 1 Jan 2005 02:30
Picon

Re: O.T.

Jacob S. said unto the world upon 2004-12-27 16:31:
> I hate to sound weird...
> 
> But who are you all, what are you're ages, what do you do, marriage
> status, etc? You obviously don't have to answer, I'm just curious who
> I'm boldly sending emails to.
> 
> Jacob Schmidt
> 
> P.S. I'm a student. 14 years. Play the piano better than I write
> scripts. Single. etc.
> 

Hi all,

thanks for posting that, Jacob. Many things about the 'net are 
wonderful, but the relative anonymity isn't (always) among them!

I'm closing out 31, and as married as a consistent philosophical 
anarchist without present need of EU working papers can be ;-)

I'm Canadian, living in Montreal, and finishing up a PhD in the 
philosophy of logic. (So, I can clear a dinner-party in pretty good 
time.) The PhD thing leaves me with only Python and photography as 
hobbies. Came to Python via an ESR essay; its my sole programming 
language past some BASIC back in high-school.

While I've yet to explore python's logic related tools, it has been 
quite illuminating for my research interests to see recursion theory 'in 
action' rather than in the more purely abstract context that prevails in 
(Continue reading)

Kent Johnson | 1 Jan 2005 04:00
Gravatar

Re: Fwd: ASCII encoding for a £ sign

David Holland wrote:
> Apologies,
> I did not see that Kent had already answered this !
> Thanks Kent I put that encoding and it works fine.
> Although surprisingly the other idea :-
> write the string with '\xc2'  did not work.

Well I was guessing so I am happy that one of the guesses was correct. What happened when you tried 
'\xc2'?

Kent

> 
>  --- David Holland <davholla2002 <at> yahoo.co.uk> wrote: 
> 
>>Date: Fri, 31 Dec 2004 16:28:59 +0000 (GMT)
>>From: David Holland <davholla2002 <at> yahoo.co.uk>
>>Subject: ASCII encoding for a £ sign
>>To: tutor <at> python.org
>>
>>I ran a program with a "£" sign, and I got this
>>message :-
>>
>>"sys:1: DeprecationWarning: Non-ASCII character
>>'\xc2'
>>in file birdgame32a.py on line 93, but no encoding
>>declared; see
>>http://www.python.org/peps/pep-0263.html
>>for details'
>>I looked at the message but I am not sure what
(Continue reading)

Danny Yoo | 1 Jan 2005 06:44
Picon

Re: Parsing a block of XML text


On Fri, 31 Dec 2004, kumar s wrote:

> I am trying to parse BLAST output (Basic Local Alignment Search Tool,
> size around more than 250 KB ).

[xml text cut]

Hi Kumar,

Just as a side note: have you looked at Biopython yet?

    http://biopython.org/

I mention this because Biopython comes with parsers for BLAST; it's
possible that you may not even need to touch XML parsing if the BLAST
parsers in Biopython are sufficiently good.  Other people have already
solved the parsing problem for BLAST: you may be able to take advantage of
that work.

> I wanted to parse out :
>
> <Hsp_query-from> <Hsp_query-out)
>  <Hsp_hit-from></Hsp_hit-from>
>   <Hsp_hit-to></Hsp_hit-to>

Ok, I see that you are trying to get the content of the High Scoring Pair
(HSP) query and hit coordinates.

> I wrote a ver small 4 line code to obtain it.
(Continue reading)

kumar s | 1 Jan 2005 07:57
Picon
Favicon

Re: Parsing a block of XML text

Hi Danny, 
  Thanks for your reply. I have been using BioPython
for long time. I found their BLAST parser buggy
(IMPO), otherwise BioPython has more cool modules. 

In my case Parser did not iterate over hits and it
turned out difficult for me to look into it in detail.
Also, I wanted to work more on my own so that I get
more understanding over parsing XML documents. 

I was about to post to the list seeking some
systematic explanation to the example on PLR. 
http://www.python.org/doc/lib/dom-example.html

Frankly it looked more complex. could I request you to
explain your pseudocode. It is confusing when you say
call a function within another function.  

### pseudocode ###
> def parse_Hsp(node):
>     ## get at the Hit_hsps element, and call
> parse_Hit_hsps() on it.
> 
> 
> def parse_Hit_hsps(node):
>     ## get all of the Hsp elements, and call
> parse_Hsp() on each one of
>     ## them.
> 
> 
(Continue reading)

David Holland | 1 Jan 2005 12:05
Picon
Favicon

Using £ in python

Kent,

When I tried '\xc2' nothing happened.
I should have said that is a game using pygame.

Kent
 --- tutor-request <at> python.org wrote: 
> Send Tutor mailing list submissions to
> 	tutor <at> python.org
> 
> To subscribe or unsubscribe via the World Wide Web,
> visit
> 	http://mail.python.org/mailman/listinfo/tutor
> or, via email, send a message with subject or body
> 'help' to
> 	tutor-request <at> python.org
> 
> You can reach the person managing the list at
> 	tutor-owner <at> python.org
> 
> When replying, please edit your Subject line so it
> is more specific
> than "Re: Contents of Tutor digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: O.T. (Michael Lange)
>    2. OT (David Holland)
>    3. ASCII encoding for a ? sign (David Holland)
(Continue reading)

Jacob S. | 1 Jan 2005 19:29

Re: O.T.

> In love with computers and programming since forever (well, maybe only
since 1968 or so...)
> Working as a professional programmer mostly since 1977. Languages I have
actually been paid to
> program in include
It seems like forever to someone who hasn't seen before 1990. : )

> Python is a lot of fun. The downside of that is that it makes Java and C++
(both of which I used to
> like a lot) look like a lot of work for little result.
I seem to hear that a lot on the list...

> I taught an Introduction to Programming with Python course for a local
adult ed program last fall
> and I will be teaching Python for Programmers in the spring.
I might need that...

> I like answering questions on the Tutor list because
> - They are like little puzzles to solve, and I like puzzles
> - I learn a lot - many times a question will be about a part of Python
that I don't know, so I learn
> enough to answer the questions
> - OK I admit it, it makes me feel smart :-)
That describes my experience on the tutor list exactly!

> If you really want to know more about me see my web site
> http://www.kentsjohnson.com
>
> Kent
>
(Continue reading)

Jacob S. | 1 Jan 2005 21:57

Help with testing.

Hi,

    A little while back somebody suggested doctesting, I think it was. Well,
anyway, it was the testing that took testing material from the doc strings
of functions in the format of an interpreter and the desired result (example
below). Could anyone help by pointing me to structured documentation on how
to use this, or even the name of the testing module(s)?
Even nicer, a way to put the testing code in a seperate module so all I have
to do is something like...

pseudocode

def test(obj):
    ## Testing particulars -- parameter is a module.function that has a
docstring with testing material

m = raw_input('What is the module? ')
n = raw_input('What is the function? ')
obj = eval(m+'.'+n)  ## Given that I'm the only one who will be using it and
I will not try to crack my computer...
test(obj)

Ohhhhh..
and the doc string example...

def function(a,b):
    """A function to do what you want it to.

    >>> function('3','a')
    '3a'
(Continue reading)

Jacob S. | 1 Jan 2005 22:10

Re: How to put my functions in an array

Hello.

    I believe it was Danny Yoo who told me about mapping functions a while
back on the list...
It goes along these lines...

funct = {'Add Virt':addvirt,'Remove Virt':remvirt,'More
Stuff':more,"Extras":extra}
def addvirt():
    pass
def remvirt():
    pass
def more():
    pass
def extra():
    pass
def dispatch(name):
    if name:
        funct['name']()
    else:
        pass

print """\
Actions include:
Add Virt
Remove Virt
More Stuff
Extras
quit
"""
(Continue reading)

Jacob S. | 1 Jan 2005 22:16

Re: How to substitute an element of a list as a pattern forre.compile()

Nobody explicitly mentioned that you're trying to make a pattern from an
integer and not a string, which, I believe is required. Also, Rich needs to
make the % formatting "%d"%x   instead of  "%s"%x  because he showed that x
is an integer not a string.

There's my two bits.
Jacob Schmidt

> Hi Group:
>
> I have Question:
> How can I substitute an object as a pattern in making
> a pattern.
>
> >>> x = 30
> >>> pattern = re.compile(x)
>
>
>
>
> My situation:
>
> I have a list of numbers that I have to match in
> another list and write them to a new file:
>
> List 1: range_cors
> >>> range_cors[1:5]
> ['161:378', '334:3', '334:4', '65:436']
>
> List 2: seq
(Continue reading)

Luis N | 1 Jan 2005 22:19
Picon

*args, **kwargs

Hi,

I gave this a quick read: http://aspn.activestate.com/ASPN/Mail/Message/573292

I'm wondering how I can turn a variable number of keyword arguments
passed to a class into variables for use in said class:

#This so doesn't work

class SomethingLikeThis:
    def __init__(self, **kwargs):
        self.kwargs = kwargs

    def show(self):
        for k in self.kwargs.keys():
            v = selfkwargs.get(k)
            print v

I'm probably misunderstanding the purpose of *args and **kwargs totally.
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor


Gmane