#start
import re
exclude = re.compile('vn|vt|^$|^#')
fileName = '/tmp/x'
theFileOpened = open(fileName,'r')
theTextAsList = theFileOpened.readlines()
theTextAsListStripped = []
for aLine in theTextAsList:
theTextAsListStripped.append
Hi I am trying to parse a text file and create a list of all the lines
that don't include: "vn", "vt" or are empty. I want to make this as
fast as possible because I will be parsing many files each containing
thousands of lines. I though I would give list comprehensions a try.
The last 3 lines of t
Does anyone know of a link to a really good tutorial that would help me
with subprocess.Popen? a tutorial that uses really small words and more
examples than explanation? After 15 years of scripting, I'm ashamed to
say that I'm still not all that familiar with input, output, pipes, etc.
much beyon
ok, i figured it out:
>>> from BeautifulSoup import BeautifulSoup
>>> for EVENT in TABLE_CONTENT:
... for index, item in enumerate(EVENT):
... if index == 4:
... soup = BeautifulSoup(item)
... for a in soup.findAll('a'):
...
Hello,
When I try this, I get the following error:
☹ python
* master 697cedfitools"
Python 2.7.2 (default, Jan 28 2012, 14:53:22)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import dateutil.parser as dpars
Hello Akarsh,
Welcome to the Python tutor list.
On 21 August 2012 13:29, akarsh a wrote:
> sir,
> How to read an excel file row by row and write each row to different
> text files?
> ie, if i have an excel file consists of m raw and n columns as follws
> 1 as mmm 1525 cv 10.2
>
sir,
How to read an excel file row by row and write each row to different
text files?
ie, if i have an excel file consists of m raw and n columns as follws
1 as mmm 1525 cv 10.2
2 xv fvbgd 1411 dc 12.5
..
I want to read ea
On Mon, Aug 20, 2012 at 11:21 PM, Steven D'Aprano wrote:
>
> Indentation has meaning in Python. When you send email, if your email
> program (possibly GMail?) mangles the indentation, your code will become
> invalid, unreadable mess. You need to fix this. Often the easiest way to fix
> this is to
On 08/21/2012 12:59 AM, Alan Gauld wrote:
> On 21/08/12 06:42, Ray Jones wrote:
>
>>Files = glob.iglob(os.path.join(znDir, '*'))
>>print Files
>>
>>for moveFile in Files:
>> print moveFile
>>
>> Nothing happens. The 'print...moveFile' never happens, even though print
>> Files shows
On 21/08/12 06:42, Ray Jones wrote:
Files = glob.iglob(os.path.join(znDir, '*'))
print Files
for moveFile in Files:
print moveFile
Nothing happens. The 'print...moveFile' never happens, even though print
Files shows it to be an iglob generator object.
Good but does it contain a
On 21/08/12 06:12, Osemeka Osuagwu wrote:
right_product(row, col) for (row = 0, col = 18) I had anticipated this
and added the "if col>len(data[row])-3:" statement
But because of zero indexing you need this to be either:
if col >= len(data[row])-3:
or
if col > len(data[row])-4:
ie. if row
11 matches
Mail list logo