On 10/6/2010 11:58 AM Joel Goldstick said...
On Wed, Oct 6, 2010 at 2:50 PM, Emile van Sebille wrote:
On 10/6/2010 9:25 AM Eduardo Vieira said...
Of course this solution is simpler:
extracted = a[a.index("i")+1:]
But I didn't want to build a list in memory with "readlines()" in the
case
On Wed, Oct 6, 2010 at 2:50 PM, Emile van Sebille wrote:
> On 10/6/2010 9:25 AM Eduardo Vieira said...
>
>
>
> Of course this solution is simpler:
>> extracted = a[a.index("i")+1:]
>> But I didn't want to build a list in memory with "readlines()" in the
>> case of a file.
>>
>
> This is what I
On 10/6/2010 9:25 AM Eduardo Vieira said...
Of course this solution is simpler:
extracted = a[a.index("i")+1:]
But I didn't want to build a list in memory with "readlines()" in the
case of a file.
This is what I do unless the files are _really big_
For-me-really-big-is-over-200Mb-ish-ly y'rs
"Eduardo Vieira" wrote
The other day I was writing a script to extract data from a file
from
the line where a text is found to the end of the file.
The standard pattern here is to use a sentinel, in pseudo code:
def checkLine(line, start='',end=''):
if (start in line) or (end in line):
"Crusier" wrote
I have also found that there is something called Scrapy. Please
kindly
comment on it. Which one is easier to use compared with Beautiful
Soup?
Well I can safely say that Beautiful Soup will be exactly the same
as Beauitiful Soup to use! :-)
As for scrapy I'd never heard of
Am 06.10.2010 18:25, schrieb Eduardo Vieira:
The other day I was writing a script to extract data from a file from
the line where a text is found to the end of the file. The same
functionality is this sed script:
'1,/regexp/'d
I couldn't put my head to work around this and came up with a solution
Hi tutors,
I'm trying to fetch data from an MS SQL Server database with pymssql, but
non-ascii results get garbled.
>>> import pymssql
>>> conn = pymssql.connect(user='sa', password=myPassword, host=server,
database=targetDatabase, as_dict=True)
>>> curs = conn.cursor()
>>> curs.execute("select C
Eduardo Vieira wrote:
> The other day I was writing a script to extract data from a file from
> the line where a text is found to the end of the file. The same
> functionality is this sed script:
> '1,/regexp/'d
> I couldn't put my head to work around this and came up with a solution
> using list
The other day I was writing a script to extract data from a file from
the line where a text is found to the end of the file. The same
functionality is this sed script:
'1,/regexp/'d
I couldn't put my head to work around this and came up with a solution
using list slicing. But how can I do that? I w
hello
On Tue, Oct 5, 2010 at 5:57 PM, Susana Iraiis Delgado Rodriguez
wrote:
> Hello, I already solved the problem, I change all the code, instead of using
> os.system I changed to subprocess.Popen() and it worked fine:
> import shlex, subprocess
> def process():
> print "Ingresa en el sigui
Got it fixed.
Thanks y'all.
Regards,
--Original Message--
From: Dave Angel
To: Dipo Elegbede
Cc: tutor
Subject: Re: [Tutor] cgi help
Sent: Oct 6, 2010 12:30
On 2:59 PM, Dipo Elegbede wrote:
> here is the code:
>
> http://pastebin.com/K2Fxq6ac
>
> kindly help me figure out my mistake.
>
>
On 2:59 PM, Dipo Elegbede wrote:
here is the code:
http://pastebin.com/K2Fxq6ac
kindly help me figure out my mistake.
It is supposed to return a table of environmental variables but it returns
only the header and a blank page.
thanks
Care to define "return" ?
How are you running this cod
Hi Emile,
I have also found that there is something called Scrapy. Please kindly
comment on it. Which one is easier to use compared with Beautiful
Soup?
Thanks in advance.
Cheers,
Hank
___
Tutor maillist - Tutor@python.org
To unsubscribe or change su
Yes, so I did a pastebin and resent to the group.
Thanks.
Sent from my BlackBerry wireless device from MTN
-Original Message-
From: Joel Goldstick
Sender: tutor-bounces+delegbede=dudupay@python.org
Date: Wed, 6 Oct 2010 05:54:03
To: tutor
Subject: Re: [Tutor] CGI HELP
__
On Wed, Oct 6, 2010 at 5:25 AM, Dipo Elegbede wrote:
> Hi all,
>
> I wrote this code as an example from a book:
>
> #!c:\Python26\python.exe
> # Program displaying CGI environment variables.
>
> import os
> import cgi
>
> def printHeader(title):
> print """Content-type: text/html
>
>
> "-//W3C/
here is the code:
http://pastebin.com/K2Fxq6ac
kindly help me figure out my mistake.
It is supposed to return a table of environmental variables but it returns
only the header and a blank page.
thanks
--
Elegbede Muhammed Oladipupo
OCA
+2348077682428
+2347042171716
www.dudupay.com
Mobile Bank
Hi all,
I wrote this code as an example from a book:
#!c:\Python26\python.exe
# Program displaying CGI environment variables.
import os
import cgi
def printHeader(title):
print """Content-type: text/html
http://www.w3.org/1999/xhtml";>
%s
""" % title
rowNumber = 0
backgroundColour = "white
> But something like the "%.%de " %n is exactly what I am looking for - if I
>could get it to work.
Sorry my bad, I missed a % sign:
>>> n=5
>>> "%%.%de" % n
'%.5e'
You need two %% to create a % in the output.
Alan G.
___
Tutor maillist - Tut
18 matches
Mail list logo