"karma" wrote
thinking that a recursive solution would work here, but so far I can't
quite get it working. This is what I have so far:
Can someone suggest whether this is suited to a recursive solution and
Yes certainly
if so, what am I doing wrong.
L = ['a',
['b',
karma wrote:
> Hi all ,
>
> I have a nested list in the structure
> [root,[leftSubtree],[RightSubtree]] that I want to print out. I was
> thinking that a recursive solution would work here, but so far I can't
> quite get it working. This is what I have so far:
>
> Can someone suggest whether this
Hi all ,
I have a nested list in the structure
[root,[leftSubtree],[RightSubtree]] that I want to print out. I was
thinking that a recursive solution would work here, but so far I can't
quite get it working. This is what I have so far:
Can someone suggest whether this is suited to a recursive sol
"Essah Mitges" wrote
What I am trying to do is print a high score text file
to a pygame window it kinda works...
How do you define kinda?
It doesn't look like it works to me.
The function main defined as
def main():
high_file = open_file("high_score.txt", "r")
score = next_block(high_
On Tue, Jun 16, 2009 at 4:27 PM, Essah Mitges wrote:
>
> What I am trying to do is print a high score text file to a pygame window
> it kinda works...I don't know how to go about doing this...
>
Do you know how to print text to a window?
to read a file, just in a terminal window:
f = open('som
Dave Crouse wrote:
I got the same thing with idle, but when running as a script, it's not
the same, it errors. I tried it on Windows and Linux.
---
[da...@arch64 Python]$ less test.py
#/usr/bin/python3
print ('The \"This is a test \" {')
[da...@arch64 Py
I got the same thing with idle, but when running as a script, it's not
the same, it errors. I tried it on Windows and Linux.
---
[da...@arch64 Python]$ less test.py
#/usr/bin/python3
print ('The \"This is a test \" {')
[da...@arch64 Python]$ sh test.py
tes
On 30-Apr-09, at 12:12 AM, Dave Crouse wrote:
Trying to print something with a { in it.
Probably extremely simple, but it's frustrating me. :(
print ('The \"This is a test \" {')
i get this error
ValueError: Single '{' encountered in format string
Worked perfectly for me.
===
$ python3.0
The double {{ }} worked perfectly, THANK YOU ! :)
This was driving me crazy.
On Wed, Apr 29, 2009 at 2:03 PM, Kent Johnson wrote:
> print ('The \"This is a test \" {')
>
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/
On Wed, Apr 29, 2009 at 2:42 PM, Dave Crouse wrote:
> Trying to print something with a { in it.
> Probably extremely simple, but it's frustrating me. :(
>
> print ('The \"This is a test \" {')
>
> i get this error
>
> ValueError: Single '{' encountered in format string
It works for me:
Python 3.
Trying to print something with a { in it.
Probably extremely simple, but it's frustrating me. :(
print ('The \"This is a test \" {')
i get this error
ValueError: Single '{' encountered in format string
___
Tutor maillist - Tutor@python.org
http://ma
"Kent Johnson" wrote
On Thu, Mar 26, 2009 at 2:58 PM, ALAN GAULD
wrote:
Use '\n'.join(handle[1:])
It will create a string from your list with newline as separator.
The lines from readlines() include the newlines already.
Ah, OK, I couldn't remember if readlines stripped them off or not.
On Thu, Mar 26, 2009 at 2:58 PM, ALAN GAULD wrote:
> Use '\n'.join(handle[1:])
> It will create a string from your list with newline as separator.
The lines from readlines() include the newlines already.
> When i use the following
>
> print>>out, handle[1:]
>
> In the out file, it saves the line
PM
Subject: Re: [Tutor] printing files
yes you are right,
When i use the following
print>>out, handle[1:]
In the out file, it saves the lines as a list rather than as a string. How to
avoid this.
Bala
On Thu, Mar 26, 2009 at 7:05 PM, Alan Gauld wrote:
"Bala subramanian"
"Bala subramanian" wrote
for files in flist:
handle=open(flist).readlines()
print>>out, handle
print>>out, handle[1:]
Should do it? You might need to handle line endings though...
Alan G.
___
Tutor maillist - Tutor@python.org
http:/
On Thu, Mar 26, 2009 at 10:56 AM, Marc Tompkins wrote:
> Without changing anything else, you could do it with a slice:
>
You should probably also close your input files when you're done with them.
--
www.fsrtechnologies.com
___
Tutor maillist - Tuto
On Thu, Mar 26, 2009 at 10:42 AM, Bala subramanian <
bala.biophys...@gmail.com> wrote:
>print>>out, handle <-- Here i want to write only from second line. I
> dnt want to loop over handle here and putting all lines except the first one
> in
> anothe
Friends,
My files are like below
file1 file2
RemarkRemark
---
---
I have huge number of such files. I want to concatenate all files in one
huge file. I could do it with a script. But i want to omit the first l
On Sun, Dec 28, 2008 at 8:49 PM, wormwood_3 wrote:
> Hello all,
>
> This might be trivially easy, but I was having a hard time searching on it
> since all the component terms are overloaded:-) I am wondering if there is a
> way to print out the code of a defined function.
If the source code is av
On Mon, 29 Dec 2008 09:18:43 -
"Alan Gauld" wrote:
>
> "wormwood_3" wrote
>
> > I am wondering if there is a way to print out the code of a defined
> > function.
>
> Its not reliable but I think you can use
>
> func.func_code.filename
> func.func_code.firstlineno
>
> To find the first
"wormwood_3" wrote
I am wondering if there is a way to print out the code of a defined
function.
Its not reliable but I think you can use
func.func_code.filename
func.func_code.firstlineno
To find the first line of code in the original source file.
Its up to you to figure out the last line
kype - shuckins
From: bob gailer
To: wormwood_3
Cc: tutor@python.org
Sent: Sunday, December 28, 2008 9:07:12 PM
Subject: Re: [Tutor] Printing the code of a function
wormwood_3 wrote:
Hello
all,
This might be trivially easy, but I was having a hard time searching on
it since al
wormwood_3 wrote:
Hello
all,
This might be trivially easy, but I was having a hard time searching on
it since all the component terms are overloaded:-) I am wondering if
there is a way to print out the code of a defined function.
Python does not store the source when compiling thing
wormwood_3 wrote:
> I am wondering if there is a way to
> print out the code of a defined function.
When Python compiles source code, it doesn't store the source code
itself; only the compiled intermediate code. With the 'dis' package you
can disassemble that:
def foo():
print "Show me
Hello all,
This might be trivially easy, but I was having a hard time searching on it
since all the component terms are overloaded:-) I am wondering if there is a
way to print out the code of a defined function. So if I have:
def foo():
print "Show me the money."
then I would like to do so
Siim Märtmaa wrote:
i would like to do this
print u'\u30fa'
ヺ
with a method like this
b = "30fa"
uni = u'\u' + b + '\''
but it prints this
UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in
position 0-1: end of string in escape sequence
so how to concatenate properly to print
Hello
i would like to do this
>>> print u'\u30fa'
ヺ
with a method like this
b = "30fa"
uni = u'\u' + b + '\''
but it prints this
UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in
position 0-1: end of string in escape sequence
so how to concatenate properly to print the characte
I went through a similar process:
I got used to PyWin on XP, then when switching to Vista pywin did not
install with Python.
So I simply downloaded and installed it.
(link: http://sourceforge.net/projects/pywin32/
)
Hth,
Omer.
On Sat, Sep 13, 2008 at 5:41 AM, Mike Meisner <[EMAIL PROTECTED]> wrote
"Mike Meisner" <[EMAIL PROTECTED]> wrote
In the XP version, the Python 32-bit editor
I'm not sure which editor you mean? Is it Pythonwin?
Is there an open-source editor I could use with
Vista to get the more attractive, color coded
script printout that I get with the 32--bit system?
Doe
I've been working with Python on two different machines: under Windows XP and
under 64-bit Vista.
In the XP version, the Python 32-bit editor prints my scripts using the color
coding in the editor and a comfortable to read font. Under Vista 64-bit, only
the IDLE environment is available which
Andy Cheesman wrote:
> Hi people
>
> Is there a way to use a list with printf formating without having to
> explicitly expanding the list after the %
>
> e.g
>
> a = [1, 2, 3]
>
> print """ Testing
> %i, %i, %i """ %(a[0], a[1], a[2])
The argument after % must be a tuple (or a
Andy Cheesman wrote:
> Hi people
>
> Is there a way to use a list with printf formating without having to
> explicitly expanding the list after the %
>
> e.g
>
> a = [1, 2, 3]
>
> print """ Testing
> %i, %i, %i """ %(a[0], a[1], a[2])
>
It looks as though string formatting on
Hi people
Is there a way to use a list with printf formating without having to
explicitly expanding the list after the %
e.g
a = [1, 2, 3]
print """ Testing
%i, %i, %i """ %(a[0], a[1], a[2])
Cheers
Andy
___
Tutor maillist - Tut
Hi Alan,
Thanks for the response. Its not a home work problem its actually a task i
need to complete as i am tryin to make some tool which will be helpful to
use as a script in arcgis. i kinda got some clue will surely ask help if i
get stuck somewhere coz i know its difficult to put down in wor
"Varsha Purohit" <[EMAIL PROTECTED]> wrote
> I want to create a wxpython program where i am reading a list
> having
> integer values like [1,2,3,4]. and i need to display the output
> value as
> bitmap image which shd be coloured after reading the values. Like
> 1=red,
> 2=yellow, 3=orange
Hello All,
I want to create a wxpython program where i am reading a list having
integer values like [1,2,3,4]. and i need to display the output value as
bitmap image which shd be coloured after reading the values. Like 1=red,
2=yellow, 3=orange etc and it displays the output in colours at pro
Hello!
On 9/13/07, Varsha Purohit <[EMAIL PROTECTED]> wrote:
> Hello friends,,
> I have a problem in displaying data which i have invoked from
> class. City is the name of the class which i havent displayed here. There is
> another script using that class. It has a function name setCiti
Hello friends,,
I have a problem in displaying data which i have invoked from
class. City is the name of the class which i havent displayed here. There is
another script using that class. It has a function name setCities which
takes a text file as argument. Text file contains name of the
Hi
I am currently trying to print out a html file that is essentially a
summary table and I am running into problems. From the link below it
seems that the method I am using to print the table doesn't handle
column width and wrapping but confusingly we use a similar method
elsewhere in the code a
Steve Maguire wrote:
> I am a Python beginner. For my first task I wanted to fix a program that I
> originally wrote in Excel with VBA. I want to create a mySQL database
> holding my DVD collection, edit it in Python, and print labels for the
> cases
> with an index for filing and a catalog of a
I am a Python beginner. For my first task I wanted to fix a program that I
originally wrote in Excel with VBA. I want to create a mySQL database
holding my DVD collection, edit it in Python, and print labels for the cases
with an index for filing and a catalog of all the titles their indices.
T
On Thu, 1 Feb 2007, [ISO-8859-1] J?nos Juh?sz wrote:
> do you have any idea, how I can send a txt file to the default printer in
> landscape view with python on windows.
> I wanted to set up just the char size and the orientation of the printout.
I've gotten a crush on wxPython, now that it's ni
> Hi All,
>
> do you have any idea, how I can send a txt file to the default printer in
> landscape view with python on windows.
> I wanted to set up just the char size and the orientation of the printout.
>
> thinking about
> os.system('notepad.exe /pt "%%%s"' % filename)
Doesn't complete
János Juhász schrieb:
> do you have any idea, how I can send a txt file to the default printer in
> landscape view with python on windows.
I assume that by "txt file", you mean a file containing ASCII text?
> I wanted to set up just the char size and the orientation of the printout.
Printers no
Hi All,
do you have any idea, how I can send a txt file to the default printer in
landscape view with python on windows.
I wanted to set up just the char size and the orientation of the printout.
thinking about
os.system('notepad.exe /pt "%%%s"' % filename)
Yours sincerely,
___
+++ Christopher Spears [10-07-06 21:34 -0700]:
| I'm working on a problem from "How To Think Like A
| Computer Scientist". I created a Time class:
|
| class Time:
|
| def __init__(self, hours, minutes, seconds):
| self.hours = hours
| self.minutes = minut
> I created a function to print the Time object:
>
> def printTime(time):
> print "%d:%d:%d" % (time.hours, time.minutes,
> time.seconds)
>
> However, when I type '00', I get the following:
time = Time(12,34.4,00)
printTime(time)
> 12:34:0
Hi Chris,
You'll want to check some of th
I'm working on a problem from "How To Think Like A
Computer Scientist". I created a Time class:
class Time:
def __init__(self, hours, minutes, seconds):
self.hours = hours
self.minutes = minutes
self.seconds = seconds
I created a
Kent Johnson wrote:
> Alfonso wrote:
>
>> I'm writing a script to retrieve and print some links of a page. These
>> links begin wiht "/dog/", so I use a regular expresion to try to find
>> them. The problem is that the script only retrieves a link per line in
>> the page. I mean, if the line
Alfonso wrote:
> I'm writing a script to retrieve and print some links of a page. These
> links begin wiht "/dog/", so I use a regular expresion to try to find
> them. The problem is that the script only retrieves a link per line in
> the page. I mean, if the line hat several links, the script o
I'm writing a script to retrieve and print some links of a page. These
links begin wiht "/dog/", so I use a regular expresion to try to find
them. The problem is that the script only retrieves a link per line in
the page. I mean, if the line hat several links, the script only reports
the first.
ar; tutor@python.org
Subject: Re: [Tutor] Printing the Carriage return character
>Not sure if this is a python thing or a Operating system
> peculiarity,
An IDLE thing specifically - or maybe even a Tkinter thing...
> Why does the line
> print "FirstLine" + "\rSecondLin
>Not sure if this is a python thing or a Operating system peculiarity,
An IDLE thing specifically - or maybe even a Tkinter thing...
> Why does the line
> print "FirstLine" + "\rSecondLine"
> produce different output when run via IDLE and when run in the python
> prompt (both under Windows X
Hi,
Not sure if this is a python thing or a Operating system peculiarity,
but here goes:
Why does the line
print "FirstLine" + "\rSecondLine"
produce different output when run via IDLE and when run in the python
prompt (both under Windows XP)?
Output in IDLE (ver 1.1.1, python 2.4.1):
>>> print
Danny Yoo wrote:
>
> On Thu, 2 Feb 2006, kevin parks wrote:
>
>
>>Danny (hope you are good!) & co,
>>
>>I see that biz about random.seed()... but in the absence of setting that
>>... does it just grab a value from the system clock?
>
>
> Yes. Here's what the documentation says officially:
>
On Thu, 2 Feb 2006, kevin parks wrote:
> Danny (hope you are good!) & co,
>
> I see that biz about random.seed()... but in the absence of setting that
> ... does it just grab a value from the system clock?
Yes. Here's what the documentation says officially:
"""current system time is also used
Danny (hope you are good!) & co,
I see that biz about random.seed()... but in the absence of setting
that ... does it
just grab a value from the system clock?
Is there a way to just let it generate it's usual, known seed... but
then observe
what that is in case you get an especially good run of
> I am having some fun with python and making multiple runs on an
> algorhythm and sometimes getting some fun stuff that i would like to be
> able to reproduce, but there are some random elements in it. I wonder is
> there a way to see the random seed, and make note of it so that you
> could then
hi.
I am having some fun with python and making multiple runs on an
algorhythm and sometimes getting some fun stuff that i would like to be
able to reproduce, but there are some random elements in it. I wonder
is there a way to see the random seed, and make note of it so that you
could then se
On Wed, 4 Jan 2006, John Corry wrote:
> I am using the following code to send a text file to the printer:-
> This code works on windows XP + Windows 2000. However it does not work on
> windows 98SE.
Here's another alternative, which might be even simpler, if it works for
you, invoking the go
I've edited the subject line to be a little more clear.
On Wed, 4 Jan 2006, John Corry wrote:
> I am using the following code to send a text file to the printer:-
[ snip ]
> This code works on windows XP + Windows 2000. However it does not work on
> windows 98SE.
Well, at least that narrows
Hi + Happy New Year,
With help from several people from the mailing list I have been able to
print out text files on my windows XP machine. I have tried using the same
program on my windows 98SE machine and I get the following error:
PythonWin 2.4.2 (#67, Oct 30 2005, 16:11:18) [MSC v.1310 32 bi
>>> "John Corry" < [EMAIL PROTECTED] > 12/24/2005 12:28 PM >>>Hi + Season's Greetings!I have put together a program that queries and modifies a Gadfly database.I have captured my output. I now want to print it to paper.I have written the output to a text file. I have searched the tutor mailinglist
gt;I have played about with it and saved it in various places but I can't get
>it to work. Any suggestions? Do I need to import other modules? Do I need
>to use Pythonwin?
>
>Thanks,
>
>John.
>
>-Original Message-
>From: [EMAIL PROTECTED]
>[mailto:[EMAI
On Tue, 27 Dec 2005, John Corry wrote:
> I am saving the code to c:\python24\jhc2.py
> The code creates the file c:\python24\testprint.txt
John, I would *very* strongly advise not to store your code in c:\python24
or any subdirectory in it. That is where Python itself lives, and it's
very possib
On Mon, 26 Dec 2005, John Corry wrote:
> Thanks for the prompt reply. This is exactly what I am looking for.
> However, I have tried the code on the page and I can't get it to work.
...
> Traceback (most recent call last):
> File "c:\python24\jhc.py", line12, in ?
> 0
> pywintypes.error:
ECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Danny Yoo
Sent: 24 December 2005 19:33
To: John Corry
Cc: Tutor
Subject: Re: [Tutor] Printing
> I have downloaded win32, win32com, Preppy and PIL. I have had a go at
> using them but can't get them to work. At the moment I can't even
John Corry wrote:
>
> Hi + Season's Greetings!
>
> I have put together a program that queries and modifies a Gadfly database.
> I have captured my output. I now want to print it to paper.
>
> I have written the output to a text file. I have searched the tutor mailing
> list and used the mailin
> I have downloaded win32, win32com, Preppy and PIL. I have had a go at
> using them but can't get them to work. At the moment I can't even print
> the text file.
>
> Is there a good helpguide/FAQ page which deals with printing text files
> or is there simple code which prints a text file?
Hi
Hi + Season's Greetings!
I have put together a program that queries and modifies a Gadfly database.
I have captured my output. I now want to print it to paper.
I have written the output to a text file. I have searched the tutor mailing
list and used the mailing list advice to get my data into
Hi Danny,
thanks for your email.
In the example I've shown, there are no odd elements
except for character case.
In the real case I have a list of 100 gene names for
Humans.
The human gene names are conventioanlly represented in
higher cases (eg.DDX3X). However, NCBI's gene_info
dataset the
On Sat, 3 Dec 2005, Srinivas Iyyer wrote:
> >>> a
> ['apple', 'boy', 'boy', 'apple']
>
> >>> b
> ['Apple', 'BOY', 'APPLE-231']
>
> >>> for i in a:
> pat = re.compile(i,re.IGNORECASE)
> for m in b:
> if pat.match(m):
> print m
Hi Srinivas,
We may
Dear group,
I have two lists:
>>> a
['apple', 'boy', 'boy', 'apple']
>>> b
['Apple', 'BOY', 'APPLE-231']
>>> for i in a:
pat = re.compile(i,re.IGNORECASE)
for m in b:
if pat.match(m):
print m
Apple
APPLE-231
BOY
At 10:02 PM 11/3/2005, Johan Geldenhuys wrote:
Found it. This is what I was
looking for:
"""
>>> print ('file'+'dir'.center(20))+('\n'+'='*15)
file dir
===
>>>
"""
I am glad you found what you wanted. I'm sad that you did not tell us
more precisely what you wanted, as we cou
Found it. This is what I was looking for:
"""
>>> print ('file'+'dir'.center(20))+('\n'+'='*15)
file dir
===
>>>
"""
It's actually a string operator 'center(width)' that I was
looking for.
I saw the '%', but that is wahat I wanted to use.
Johan
Colin J. Williams wrote:
bob wrote:
>At 11:31 AM 11/3/2005, Johan Geldenhuys wrote:
>
>
>>Hi all,
>>Just a quick question;
>>
>>How do I code this output:
>>"""
>>files dirs
>>==
>>"""
>>
>>I want to print something a few space away from the left side or in the
>>middle of the line.
>>
>>
>
>In the
At 11:31 AM 11/3/2005, Johan Geldenhuys wrote:
>Hi all,
>Just a quick question;
FWIW saying that does not help. It takes time to read it, and I can judge
the question length by reading the question. The real concern is what does
it take to construct an answer.
_
At 11:31 AM 11/3/2005, Johan Geldenhuys wrote:
>Hi all,
>Just a quick question;
>
>How do I code this output:
>"""
>files dirs
>==
>"""
>
>I want to print something a few space away from the left side or in the
>middle of the line.
In the Python Library Reference look up 2.3.6.2 S
Hi all,
Just a quick question;
How do I code this output:
"""
files dirs
==
"""
I want to print something a few space away from the left side or in the
middle of the line.
Thanks,
Johan
___
Tutor maillist - Tutor@python.org
http://m
00
From: Jason Massey <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] printing an acronym
Something like this:
def acro(a):
... b = a.split()
... c = ""
... for d in b:
... c+=d[0].upper()
... return c
other than the horrible variable nam
Forwarding to tutor
-- Forwarded message --
Date: Mon, 26 Sep 2005 08:32:02 -0500
From: Jason Massey <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] printing an acronym
Something like this:
def acro(a):
... b = a.split()
... c = &q
On Sat, 24 Sep 2005 [EMAIL PROTECTED] wrote:
> How could I get the following to print out an acronym for each phrase
> entered such as if I entered random access memory it word print out RAM?
Hello,
Just out of curiosity, are you already familiar with Python's "lists"?
If so, then you might
> Hello
> How could I get the following to print out an acronym for each phrase
> entered such as if I entered random access memory it word print out RAM?
> import string
> def main():
> phrase = (raw_input("Please enter a phrase:"))
> acr1 = string.split(phrase)
> acr2 = string
Hello
How could I get the following to print out an acronym for each phrase
entered such as if I entered random access memory it word print out RAM?
import string
def main():
phrase = (raw_input("Please enter a phrase:"))
acr1 = string.split(phrase)
acr2 = string.capwords(phrase
> I am writing a program to store name/contact/business transaction
> information. I would like the ability to print out a form for each
> client with all this stored information. Can somone point me in the
> write direction for printing documents.
I usually just create html files. PDF would work
hello,
I am writing a program to store name/contact/business transaction information. I would like the ability to print out a form for each client with all this stored information. Can somone point me in the write direction for printing documents. How do I go about setting up a printable page w
Kevin schrieb:
I just started getting in to python and for taking a look at the for
loop. I want to print out a box
of O's 10o chars long by 10 lines long this is what I came up with. Is
there a better way to do
this:
j = 'O'
for i in j*10:
print i * 100
Thanks
Kevin
Hi Kevin,
I don't know,
- Original Message -
From: "Kevin" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, March 01, 2005 12:35 AM
Subject: [Tutor] printing out a box of O's
> there a better way to do
> this:
>
> j = 'O'
> for i in j*10:
> print i * 100
Its not bad,
for y in range(10):
for x in range(10):
print "O",
print '\n'
Or -
for y in range(10):
print "O"*10
On Mon, 28 Feb 2005 18:35:08 -0600, Kevin <[EMAIL PROTECTED]> wrote:
> I just started getting in to python and for taking a look at the for
> loop. I want to print
I just started getting in to python and for taking a look at the for
loop. I want to print out a box
of O's 10o chars long by 10 lines long this is what I came up with. Is
there a better way to do
this:
j = 'O'
for i in j*10:
print i * 100
Thanks
Kevin
___
> So I wrote the program included below and it only prints the last
line
> of the file.
> I have one question. Do I need to put ts and pe into a list before I
> print then to screen or I am just missing something. Thanks.
You just need to indent your last print statement so it is inside
the loop
At 01:03 PM 2/8/2005, Kooser, Ara S wrote:
Content-class:
urn:content-classes:message
Content-Type: multipart/alternative;
boundary="_=_NextPart_001_01C50E19.4E45912A"
Hello all,
I am writing a program to take a data file,
divide it up into columns and print the information back w
Kooser, Ara S wrote:
Hello all,
I am writing a program to take a data file, divide it up into columns
and print the information back with headers. The data files looks like this
0.0 -3093.44908 -3084.59762 387.6432926.38518 0.3902434E+00
-0.6024320E-04 0.4529416E-05
1.0 -3
Title: Printing columns of data
Hello all,
I am writing a program to take a data file, divide it up into columns and print the information back with headers. The data files looks like this
0.0 -3093.44908 -3084.59762 387.64329 26.38518 0.3902434E+00 -0.6024320E-04 0.4529416
Duh, whack myself on the head a few times.
Thanks,
Jacob
> Max Noel wrote:
> >
> > On Dec 19, 2004, at 06:16, Jacob S. wrote:
> >
> >> Would this work for you?
> >>
> >> a = ['Name = stuff','CGTATAGCTAGCTA','Name = stuff','CGATATGCCGGCTA']
> >> for index,thing in enumerate(a):
> >> if "Name=
Max Noel wrote:
On Dec 19, 2004, at 06:16, Jacob S. wrote:
Would this work for you?
a = ['Name = stuff','CGTATAGCTAGCTA','Name = stuff','CGATATGCCGGCTA']
for index,thing in enumerate(a):
if "Name=" in thing:
del a[index]
A faster way to do this would be to use something like:
if thi
On Dec 19, 2004, at 06:16, Jacob S. wrote:
Would this work for you?
a = ['Name = stuff','CGTATAGCTAGCTA','Name = stuff','CGATATGCCGGCTA']
for index,thing in enumerate(a):
if "Name=" in thing:
del a[index]
I know, that it might be slow, but I thought that maybe it would hold
its
own bec
Would this work for you?
a = ['Name = stuff','CGTATAGCTAGCTA','Name = stuff','CGATATGCCGGCTA']
for index,thing in enumerate(a):
if "Name=" in thing:
del a[index]
I know, that it might be slow, but I thought that maybe it would hold its
own because it doesn't have to import the re modu
Hi Kumar,
I've been studiously avoiding re, and I think you can too for this problem -
>I want to remove Name=Xxxx_at identifiers.
>My List:
>['Name=32972_at',
>'Cell1=432\t118\tN\tcontrol\t32972_at\t0\t13\tA\tA\tA\t0\t75952\t-1\t-1\t99\t',
>'Cell2=432\t117\tN\tcontrol\t32972_at\t0\t13\tA\tT\t
> I know I am wrong here because I do not know how to
> search and remove an element in a list. Can any one
> please help me.
This is what the filter function is for...
But you can use list comprehensions too:
[element for element in list if element not foo]
so in your case:
lst = f.readlines(
101 - 200 of 206 matches
Mail list logo