"kumar s" wrote
For example:
x1.py =
second = raw_input()
x = second.split('\t')
y = x[1:]
print '\t'.join(y)
%cat mybigfile.rod | python x1.py
chr1433 433 rs56289060 0
+ - - -/C genomic insertion unknown 0 0
unknown between 1
My qu
On 16 March 2010 08:28, Steven D'Aprano wrote:
> On Tue, 16 Mar 2010 10:22:55 am kumar s wrote:
>> thanks Benno.
>>
>> supplying 3.6 GB file is over-kill for the script.
>
> Then supply a smaller file.
>
>
>> This is the reason I chose to input lines on fly.
>
> I don't understand what you are try
On 15 March 2010 12:38, Karjer Jdfjdf wrote:
> I want to use **kwargs to check a list of conditions (if true do this, if
> false do nothing) besides required parameters ( in sample a and b).
> Sometimes I want to add a Python object (in example a dictionary and a
> list). Below is my first **kwar
On Tue, 16 Mar 2010 10:22:55 am kumar s wrote:
> thanks Benno.
>
> supplying 3.6 GB file is over-kill for the script.
Then supply a smaller file.
> This is the reason I chose to input lines on fly.
I don't understand what you are trying to say.
--
Steven D'Aprano
On Tue, 16 Mar 2010 09:52:26 am kumar s wrote:
> Dear group:
> I have a large file 3GB. Each line is a tab delim file.
[...]
> Now I dont want to load this entire file. I want to give each line as
> an input and print selective lines.
datafile = open("somefile.data", "r")
for line in datafile:
thanks Benno.
supplying 3.6 GB file is over-kill for the script. This is the reason I chose
to input lines on fly.
thanks
Kumar
- Original Message
From: Benno Lang
To: kumar s
Cc: tutor@python.org
Sent: Mon, March 15, 2010 7:19:24 PM
Subject: Re: [Tutor] raw_input()
On 16 Mar
On 16 March 2010 08:04, kumar s wrote:
> %cat mybigfile.rod | python x1.py
> Traceback (most recent call last):
> File "x1.py", line 2, in
> second = raw_input()
> EOFError: EOF when reading a line
>
> How to notify that at EOF break and suppress exception.
try:
second = raw_input()
exce
Here it worked after trying a while loop:
x1.py =
while True:
second = raw_input()
x = second.split('\t')
y = x[1:]
print '\t'.join(y)
%cat mybigfile.rod | python x1.py
Traceback (most recent call last):
File "x1.py", line 2, in
second = raw_inpu
Dear group:
I have a large file 3GB. Each line is a tab delim file.
example lines of it:
585 chr1433 433 rs56289060 0 + - -
-/C genomic insertion unknown 0 0 unknown between 1
585 chr1491 492 rs55998931 0
On Mon, 15 Mar 2010 13:26:27 -0400
Brian Jones wrote:
> I tried a couple of things I could think of, and successfully got the module
> and class without issue, but the one missing piece was the method name.
All methods and funcs (and types) have a __name__ attr.
from types import FunctionType a
wrote
Just introducing myself to say hiHi!
Hi welcome, but please don't include lots of attachments.
It blows up people's mailboxes and bandwidth allowances.
Better to post them on a website and send a link.
I'm very new to programming, ...
place to start I found out that python a
On Mon, 15 Mar 2010 05:38:43 -0700 (PDT)
Karjer Jdfjdf wrote:
> I want to use **kwargs to check a list of conditions (if true do this, if
> false do nothing) besides required parameters ( in sample a and b).
> Sometimes I want to add a Python object (in example a dictionary and a list).
> Bel
On Mon, Mar 15, 2010 at 10:23 AM, wrote:
> Hey,
> Just introducing myself to say hiHi!
>
> I'm very new to programming, I got interested in it when I decided to have
> a go at html. When looking around for a place to start I found out that
> python and C++ are the usual starting place bu
"Prasad" wrote
I am writing a function to find correct transformer lamination for
specific wattage. It gives an error message:
UnboundLocalError: local variable 'stdArea' referenced before assignment
Please al;ways senmd the full error text not just the last line.
However in your case we ca
I am writing a function to find correct transformer lamination for
specific wattage. It gives an error message:
UnboundLocalError: local variable 'stdArea' referenced before assignment
def power2lam():
voltAmp=raw_input("How much power in Watts you want to handle?:
")
#following dictio
On Mon, Mar 15, 2010 at 1:38 PM, Karjer Jdfjdf wrote:
>
> I have 2 questions about this code:
>
> 1. Can I use this in Python 3 ? I'm not sure if I can use **kwargs in
> Python 3 because it uses the "apply" builtin (if I understand it correctly)
>
> "At this writing, both apply and the special ca
On Mon, Mar 15, 2010 at 1:26 PM, Brian Jones wrote:
> Hi all,
>
> I have some code that is a plugin for a larger app, and I'd like to be able
> to properly log issues that arise in the plugin code. I may not be
> maintaining this code forever, and I'd like the logging to work even if it's
> refac
Hi all,
I have some code that is a plugin for a larger app, and I'd like to be able
to properly log issues that arise in the plugin code. I may not be
maintaining this code forever, and I'd like the logging to work even if it's
refactored later and code moved around, method names change, etc. So I
hi, i tried this, my problem is that the file isfrom a python list -
here is the code i have so far:
http://paste.lisp.org/+22E5/1
as the first line for each item contains the 'title' which has
different tags, i want to find a way to strip this out.
any advise much appreciated
On Mo
Hi,
assuming that your content is in input.txt, you can do :
>>> f = open("/path/to/content.txt")
>>> f.readline()
it will return the first line only
cheers,
- Rafik
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription option
hello,
i have this string
http://paste.lisp.org/+22E5
which is extracted from an html page file using regex. the issue i
have is that i am unsure how to strip the first tag in this case
Association NAtionale des Producteurs de QUInoa (ANAPQUI) as
on the pages this is not consistent. for example s
I want to use **kwargs to check a list of conditions (if true do this, if false
do nothing) besides required parameters ( in sample a and b). Sometimes I want
to add a Python object (in example a dictionary and a list). Below is my first
**kwargs-brew.
###START
def function_with_kwargs(a, b,
On Mon, Mar 15, 2010 at 4:53 AM, Alan Gauld wrote:
>
> "David Hutto" wrote
>
> Caveat: I know zero about Blender... but...
>
I *thought* that since the code was in Python it might be the way I was
executing it. I think now it might be how the other windows are updated in
blender when the command
"David Hutto" wrote
Caveat: I know zero about Blender... but...
When I execute the script, it shows my main window, then if I
press the CKEY it's *supposed* to call the cleanSlate() function,
My problem is, it doesn't execute cleanSlate() until I hit the
ESCKEY, or the QKEY.
--- On Mon, 3/15/10, David Hutto wrote:
> From: David Hutto
> Subject: Command not issued until after escape from loop
> To: tutor@python.org
> Date: Monday, March 15, 2010, 2:15 AM
> In the following code, the portion
> I'm having a problem with is outlined in stars, but since
> the overall c
25 matches
Mail list logo