>>> import sys
>>> import time
>>> myList=range(10)
>>> for x in myList:
... sys.stdout.write(str(x) + "\r")
... sys.stdout.flush()
... time.sleep(1)
The "\r" causes a return without a newline feed.
Flush forces the text to be output (instead of getting buffered)
Enjoy!
Todd Maynard
Maynard
On Tuesday 06 December 2005 12:16, Nelson, Scott wrote:
> The Zen of Python (http://www.python.org/doc/Humor.html#zen) states:
>
> "There should be one-- and preferably only one --obvious way to do it."
>
>
>
> I'm searching for the obvious Pytho
hi,
I am a new python learner. i am trying to parse a
file using regular expressions.
LOCUS NM_005417 4145 bpmRNA
linear PRI 04-DEC-2005
DEFINITION Homo sapiens v-src sarcoma (Schmidt-Ruppin
A-2) viral oncogene
homolog (avian) (SRC), transcript
sorry for repost. awaiting to hear from some members.
a scientist suggested me to try biopython. This point
is not just with genbank sequences. what will i do if
i have to parse a paragraph for some expression.
thanks again.
hi,
I am a new python learner. i am trying to parse a
file using
Hi,
using ElementTree, how can I extract text of a
particular element, or a child node.
For example:
Signal transduction
__
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.sha
Hi,
using ElementTree, how can I extract text of a
particular element, or a child node.
For example:
Signal transduction
Energy process
I looked at some tutorials (eg. Ogbuji). Those
examples described to extract all text of nodes and
child nodes.
In
x27;)
iter = root.getiterator()
Here the whole XML document is loaded as element tree
and how should this iter into a format where I can
apply findall() method.
thanks
mdan
--- Kent Johnson <[EMAIL PROTECTED]> wrote:
> ps python wrote:
> > Hi,
> >
> > using Ele
hi,
can any one pls. help me on this simple issue. I keep
forgetting some simple things and they turn out to be
very important later.
i have a list 'a', and now i want to write all the
elements back in to a string. 'apple is a good fruit'
- getting this back into a string has drained my
brain.
-Repost. considering that my previous email lost -
hi,
can any one pls. help me on this simple issue. I
keep
forgetting some simple things and they turn out to
be
very important later.
i have a list 'a', and now i want to write all the
elements back in to a string. 'apple is a good
fruit'
it us unparsable.
Would you please help me /guide me what the problem
is. Apologies if i am completely ignoring somethings.
PS: Attached is the XML file that I am using.
--- Kent Johnson <[EMAIL PROTECTED]> wrote:
> ps python wrote:
> > Kent and Dany,
> > Thanks for y
olute path on
element")
SyntaxError: cannot use absolute path on element
>>> for m in tree.findall('functions'):
print m.find('molecular_class').text
>>> for m in tree.findall('functions'):
print m.find('molecular_c
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
>
Try this:
>>>a=myClass()
>>>b=myClass()
>>>a.howmany()
>>>a.count=0
>>>del a
Does this help clear things up?
Todd Maynard
On Friday 23 December 2005 06:18, shivayogi kumbar wrote:
> class myClass:
> count = 0
> def __init__(self):
>
Shivayogi,
Sorry my last e-mail wasn't very helpful.
Better would have been:
>>> a=myClass()
>>> b=myClass()
>>> a.howmany()
>>> myClass.count=0
>>> del a
which will (hopefully) give you something like:
Exception exceptions.AssertionError: in > ignored
Assert is commonly used as a sanity
Dear group,
In my XML file some attributes have text within an
element. I want to get that text. How can I do that.
I looked into ElementTree -bits and pieces: and there
is a small function.
>>> def gettext(elem):
... text = elem.text or ""
... for e in elem:
... text += get
Sean Perry wrote:
> Ok, this may be slightly above tutor's level, but hey, never hurts to
> ask (-:
__import__ is dark magic; generally those who venture into that realm
would do well to read the C source for Python..
I'm guessing that '.' is not in your sys.path, s
Hi,
This may be too elementary for most of you, but could you please help me
with the following question? I would like to use comprehensive lists and
lists of lists. Where do I start?
Question:
Consider a digraph with 10 vertices, labeled 1 through 10. You are given the
following adjacency list
Hi,
This may be too elementary for most of you, but could you please help me
with the following question? I would like to use comprehensive lists and
lists of lists. Where do I start?
Question:
Consider a digraph with 10 vertices, labeled 1 through 10. You are given the
following adjacency list
ng or wanting to make a web spider.
Check out
a) urllib
b) urllib2
c) beautifulsoup
a + b are built-ins. c you have to download and install from
http://www.crummy.com/software/BeautifulSoup/
Cheers,
Python Nutter
___
Tutor maillist - Tutor@python.
ave always wanted to learn a language like
> php, asp, .net but I never took the time to learn them. I have recently
> found Python and believe this is the language that I will "hang-my-hat-on"
> and learn.
I was web designer a while back, moved into security, then found
pytho
Hi Morgan,
Have you installed Python on your computer? If you are using Microsoft
Windows, you can download and install Python from here:
http://python.org/download/releases/2.5.2/
and select "python-2.5.2.msi".
Once it's installed, you should have a directory on your ma
Hi Everyone,
I am trying to read a comma-delimitted list ("aaa","bbb","ccc") from a text
file and assign those values to a list, x, such that:
x = ["aaa", "bbb", "ccc"]
The code that I have come up with looks like this:
>>> x = []
>>> f = open(r'c:\test.txt', 'r')
>>> x.extend(f.readlines())
>>
Hi Everyone,
Thanks for the variety of responses in such a short amount of time.
This distribution list is incredible.
Sorry for the delayed reply as I wanted to test what everyone
suggested, so here goes:
---
@Amin: I tried your suggestion, but perhaps I don't unde
On Thu, Jul 31, 2008 at 2:20 PM, Monika Jisswel
<[EMAIL PROTECTED]> wrote:
> oops it is reader not Reader (all lower case), so this line : data =
> csv.Reader(myfile, delimeter = ',')
> should be data = csv.reader(myfile, delimeter = ',')
>
>
> 2008/7
t;
> -- Forwarded message --
> From: Emile van Sebille <[EMAIL PROTECTED]>
> To: tutor@python.org
> Date: Thu, 31 Jul 2008 11:34:56 -0700
> Subject: Re: [Tutor] Reading List from File
> S Python wrote:
>>>>>
>>>>> f = open(r'C:\
Hi Everyone,
I would like to create a two-dimensional array but am confused as to
how to go about it.
I've read about Numeric Python and Numpy. Are they one and the same?
Also, how do I install them? I am working on a Windows machine.
I've been getting the following erro
> No, they are not the same. Numeric is older; NumArray is another older
> package. You should use Numpy if you can.
> http://numpy.scipy.org/#older_array
>
>
> Now you should be able to import numpy.
>
> Kent
>
Thanks, Kent. I ended up using:
>>> from numpy import *
I wasn't sure what the diff
> In general "from import *" is a very bad idea.
>
> import imports a module into its own namespace (e.g., to
> access its functionality you would have to do ".foo() and
> .bar()" The form that you chose to use imports all of a
> module's contents into the current namespace. This means you can ca
> A useful tip is that if you have a long module name you can also use
>
> import module as shortname
>
> eg
>
> import numpy as n
>
> and then access numpy.foo() as
>
> n.foo()
>
> Sacves a lot of typing for a slight loss of clarity in
> maintenance - you have to remember which module the
> short
> Another reason not to use "from xx import *" is that it can make it
> very difficult to discover where a name is defined. If you have
> several "from xx import *" lines and then later you use a function
> "foo()" there is no easy way to tell which module foo came from.
>
> An alternative is to li
Hi Pythonistas,
I have a large dictionary of dictionary (50,000+ keys) which has a structure
as follows:
DoD = {
'flintstones' : {
'husband' : "fred",
'pal' : "barney",
'income': 500,
},
'jetsons' : {
'husband' : "george",
'wif
I use Notepad++ on my Windows box for Python, but my feeling about it
is a bit "Blah..." but thats my feeling with Windows in general ;-)
I think I'm one of the rare ones who do not like its choice of Syntax
Highlighting colours. But too lazy to change them since I don't do
mu
It only runs on Intel 386-compatible processors. Once we know what CPU
you are using then we can figure it out better.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
that pdftables 0.0.4 is an
excellent way to scrape tabular data from PDF'S (see
https://blog.scraperwiki.com/2013/07/pdftables-a-python-library-for-getting-tables-out-of-pdf-files/
).
I downloaded pdftables 0.0.4 (see https://pypi.python.org/pypi/pdftables).
I am new to Python and havi
Oh, I forgot to mention that I am using Python 3.4. Thanks again for your
help pointing me in the right direction.
~Chris
On Tue, Nov 24, 2015 at 1:36 PM, Python Beginner <
pythonbeginner...@gmail.com> wrote:
> Hi,
>
> I am looking for the best way to scrape the following PDF
Hi everyone,
I have a file with this content:
"1
1
1
1
1
1
1
2
1
1"
I wanted a little script that would print the line containing "2" and every
line containing "1" after it. I've tried this:
>>> def p():
f = file("prueba.txt",'r')
for startline in f.read():
if startline.find("2")
Dive into Python: http://diveintopython.org/ is what you're looking for.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Adam Gold wrote:
>I'm trying to write a 'simple' script that will set up a socks proxy
>over ssh and maintain the connection until manually terminated. It's
>not possible to use key-based authentication so a password will need to
>be supplied. Also, note, the user is presented with a list of s
kushal.kumaran+pyt...@gmail.com wrote:
>Adam Gold wrote:
>
>>I'm trying to write a 'simple' script that will set up a socks proxy
>>over ssh and maintain the connection until manually terminated. It's
>>not possible to use key-based authentication so a password will need
>to
>>be supplied. Als
201 - 239 of 239 matches
Mail list logo