On Mon, 19 Dec 2005, linda.s wrote:
> what does 2 mean in %2.4f ?
Hello,
It's a "minimal field width" modifier, according to:
http://docs.python.org/lib/typesseq-strings.html
Let's try experimenting with it.
##
>>> '%20f' % 3.14
'3.14'
>>> '%20.2f' % 3.14
'
On 12/20/05, Danny Yoo <[EMAIL PROTECTED]> wrote:
>
>
> On Mon, 19 Dec 2005, linda.s wrote:
>
> > what does 2 mean in %2.4f ?
>
> Hello,
>
> It's a "minimal field width" modifier, according to:
>
>http://docs.python.org/lib/typesseq-strings.html
>
>
> Let's try experimenting with it.
>
> ##
Th format %x1.x2fwhere x1 is the total space and x2 is decimal digit place.If your data is longer than the specified x1 and x2.the data rules.Look at 3.14 takes 4 places total# 4 places rules
>>> '%3.2f' % 3.14'3.14'# perfect>>> '%4.2f' % 3.14'3.14'# try this >>> '%5.2f' % 3.14' 3.14'Cheers,pujo
O
> what does 2 mean in %2.4f ?
In this case nothing because it will always be over-ridden by the 4.
Basically the first number specifies the *minimum* number of
characters output, ie 2 in this case.
The second number specifies the number of decimal placess
output, 4 in this case.
Since 4 decimal
Dear Drs. Johnson and Yoo ,
for the last 1 week I have been working on parsing
the elements from a bunch of XML files following your
suggestions.
until now I have been unsuccessul. I have no clue why
i am failing.
I have ~16K XML files. this data obtained from johns
hopkins university (of co
ps python wrote:
> Dear Drs. Johnson and Yoo ,
> for the last 1 week I have been working on parsing
> the elements from a bunch of XML files following your
> suggestions.
>
> from elementtree.ElementTree import ElementTree
>
mydata = ElementTree(file='4.xml')
for process in
>
> my
Thank you for your email Dr. Johnson.
I need to print :
gene_symbol (from line
ALDH3A1)
entry_cdna (from line
NM_000691.3)
molecular_class
(from line
Enzyme:Dehydrogenase)
title (from tags Catalytic
activity)
title (from tags section
Metabolism)
title (from tags section
cytoplasm)
Thi
> >>> for m in mydata.findall('//functions'):
> print m.get('molecular_class').text
>
> >>> for m in mydata.findall('//functions'):
> print m.find('molecular_class').text.strip()
>
> >>> for process in
> mydata.findall('//biological_process'):
> print process.get('title').text
Afternoon all, My son asked me what books I would like for Christmas
this year. So what would you recommend?
I am a beginner here.
Thanks
Richard
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Mon, 19 Dec 2005, Krava Magare wrote:
> How can I remove and add record ( dictionary type) to a file.
Hi Krava,
H... I have to admit that I don't understand the question yet.
*grin*
It looks like you're already pickling lists into your file. Picking
dictionaries should be similar; a
Learning Python by O'Reilly,
got me started after realizing that Programming Python by O'Reilly was a
tad over me head.
i am new here too.
On Tue, 2005-12-20 at 14:46 -0600, Richard wrote:
> Afternoon all, My son asked me what books I would like for Christmas
> this year. So what would you recom
On Tue, 20 Dec 2005, Richard wrote:
> Afternoon all, My son asked me what books I would like for Christmas
> this year. So what would you recommend?
Merry Chrismas!
I'm partial to George Polya's "How to Solve It":
http://www.math.utah.edu/~alfeld/math/polya.html
It's not Python nor progr
1. Learn to Program Using Python by Alan Gauld (Stage
1)
2. Learning Python by Mark Lutz and David Ascher
(Stage 2)
3. If u are serious in learning python - my sincere
advise : STICK TO THIS LIST.
You can never find good teachers with lots of patience
and with real appetite to teach elesewhere. T
Krava Magare said unto the world upon 2005-12-19 17:31:
> How can I remove and add record ( dictionary type) to a file. This is the
> program that I'm working on: the program should create a text file, print
> the contents of the text file, read the file after it's been created, add a
> reco
Here is the
error:
The Currency Exchange
ProgramBy Nathan Pinno
Traceback (most recent
call last): File "D:\Python24\exchange.py", line 28, in
-toplevel- exch = pickle.load(store) File
"D:\Python24\lib\pickle.py", line 1390, in load return
Unpickler(file).load() File "D:\Python2
> Afternoon all, My son asked me what books I would like for Christmas this
> year. So what would you recommend?
I love these questions! :-)
> I am a beginner here.
The question you need to answer is what do you want to get out of the book?
For example you could get a book that teaches you the
Hi Nathan,
> Traceback (most recent call last):
> File "D:\Python24\exchange.py", line 28, in -toplevel-
> exch = pickle.load(store)
> File "D:\Python24\lib\pickle.py", line 1390, in load
> return Unpickler(file).load()
> File "D:\Python24\lib\pickle.py", line 872, in load
> disp
Nathan,
I haven't read your code in detail but from the error message:
> Traceback (most recent call last):
> File "D:\Python24\exchange.py", line 28, in -toplevel-
>exch = pickle.load(store)
> File "D:\Python24\lib\pickle.py", line 1390, in load
>return Unpickler(file).load()
> File "
Simon and all,
What would you recommend? I don't know what I should code, because I haven't
coded anything that loads a file.
Thanks,
Nathan Pinno
MSN Messenger: [EMAIL PROTECTED]
Yahoo! Messenger: spam_swatter31
AIM: f3mighty
ICQ: 199020705
-Original Message-
From: Simon Gerber [mail
Hi Nathan,
I've attached a crude hack that fixes the problem. It should give you
an idea of how to proceed. I've put comments next to the things I've
changed. Bear in mind I'm hardly more than a beginner myself, so there
are definitely better ways to do this. But it's somewhere to start,
anyway.
Thanks Simon!
It worked like a charm! All I have to do now is change it into GUI format,
and then use py2exe to create an executable file.
Thanks for all the help!
Nathan Pinno
MSN Messenger: [EMAIL PROTECTED]
Yahoo! Messenger: spam_swatter31
AIM: f3mighty
ICQ: 199020705
-Original Message
Richard wrote:
> Afternoon all, My son asked me what books I would like for Christmas
> this year. So what would you recommend?
I have started a book list on my web site.
http://personalpages.tds.net/~kent37/BookList.html
Kent
___
Tutor maillist - T
Dear drs. Yoo and johnson,
Thank you very much for your help. I successully
parsed my GO annotation from all 16,000 files.
thanks again for your kind help
--- Danny Yoo <[EMAIL PROTECTED]> wrote:
>
> > >>> for m in mydata.findall('//functions'):
> > print m.get('molecular_class').text
>
23 matches
Mail list logo