Hi,
Thanks for all the help, I guessed that there would be a module out
there providing a function to do this but wanted to go through the
process as a learning exercise. The modulus operator was just what I was
looking for, I had been trying to check for a difference between the
division and the
Hi,
import urllib
from BeautifulSoup import BeautifulSoup
page = urllib.urlopen(url) # url is the page address, if you are reading
a file in your hard drive you could use just open(filename) too, and no
needing to urllib
soup = BeautifulSoup(page)
#links = [str(link) for link in
Hello,
I am kind of stuck with this problem for many days. I would
really appreciate the person who helps me in solving this problem.
Here is how I am stuck..
I have files named 'x.pdb', 'y.pdb',. in one directory. I am
using python to read the files in that directory and do a
Jeff Molinari [EMAIL PROTECTED] wrote
How exacly can you use python to create a web site?
Short question, lots of answers!
Have a look at the WebProgramming Topic Guide on python.org.
http://wiki.python.org/moin/WebProgramming
And check out the CgiScripts topic then the Web Frameworks topic.
max . [EMAIL PROTECTED] wrote
does anyone know of a tutorial for finding links in a web site with
python.
Beautifulsuop has been mentioned but its not part of standard python.
Her is an example of the standard library parser:
html = '''
htmlheadtitleTest page/title/head
body
center
h1Here
So I took Kents advice and refactored but I have uncovered another
problem which I am hoping people may be able to help with. I realized
that the string I was using to identify the end of a record can in some
cases not be found (i.e. if a commit wasn't reviewed). This can lead to
additional
lohith madireddy [EMAIL PROTECTED]
I have files named 'x.pdb', 'y.pdb',. in one directory. I am
using python to read the files in that directory and do a system
operation on each of the file using os.system. When I use this, it
always gives an error saying 'could not read the file'.
dear all,
I am trying to implement a text from mod_python manual. the code is:
from mod_python import apache
def handler(req):req.content_type =text/plain\n\n
req.send_http_header()req.write(Hello World!!!)return apache.ok
and the conf file of apache is having
Directory
Matt Smith wrote:
ere is the final code I have come up with, any comments?
# A program to determine whether a year is a leap year or not
def is_leap_year(year):
# Function that accepts a year as input and returns true if it is a leap
year, false if it is not
if year % 4 == 0 and
Gardner, Dean wrote:
So I took Kents advice and refactored but I have uncovered another
problem which I am hoping people may be able to help with. I realized
that the string I was using to identify the end of a record can in some
cases not be found (i.e. if a commit wasn't reviewed). This can
heh... forwarding to the list, too.
-- Forwarded message --
From: Jason Massey [EMAIL PROTECTED]
Date: May 15, 2007 6:51 AM
Subject: Re: [Tutor] Text matching
To: Gardner, Dean [EMAIL PROTECTED]
Look at it a different way. If the one thing that is sure to be there is
the
Howdy,
I would be interested in some discussion of
which of the following approaches is preferred and why.
class RstManager:
def __init__(self, text):
self.text = text
self.parseRst()
def parseRst(self):
parsed = do stuff to self.text
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Alan Gauld
Sent: Tuesday, May 15, 2007 1:44 AM
To: tutor@python.org
Subject: Re: [Tutor] File access by os.system
lohith madireddy [EMAIL PROTECTED]
I have files named 'x.pdb',
Matt Smith wrote:
Here is the implementation of calendar.isleap():
def isleap(year):
Return 1 for leap years, 0 for non-leap years.
return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
Hi Kent,
Thanks for the help. For future reference how do I go look at the
Kent Tenney wrote:
Howdy,
I would be interested in some discussion of
which of the following approaches is preferred and why.
class RstManager:
def __init__(self, text):
self.text = text
self.parseRst()
def parseRst(self):
parsed = do
On 5/15/07, Mike Hansen [EMAIL PROTECTED] wrote:
Should the os.system command be something like
command = dsspcmbi -v %s %s %(Pdb, temp1)
os.system(command)
?
Yes.
--
- Rikard - http://bos.hack.org/cv/
___
Tutor maillist - Tutor@python.org
Hey Matt,
Matt Smith wrote:
I guessed that there would be a module out
there providing a function to do this but wanted to go through the
process as a learning exercise.
Good form, old boy.
Here is the final code I have come up with, any comments?
I think your code looks fine. I like to do
Hey ShivKumar,
ShivKumar Anand wrote:
*I am getting this error message:*
Traceback (most recent call last):
File C:\Python24\exp\Web\SoapTest.py, line 1, in ?
from mod_python import apache
File C:\Python24\lib\site-packages\mod_python\apache.py, line 28, in ?
import _apache
Kent Johnson [EMAIL PROTECTED] wrote
Howdy,
I would be interested in some discussion of
which of the following approaches is preferred and why.
class RstManager:
def __init__(self, text):
self.parsed = parseRst(text)
def parseRst(self, text):
parsed = do stuff to
Hi!
I have good python knowledge but I don't know how to face a project.Yes, i
can do some small projects, but i'm scared of big projectsI don't know
how to start!!
Then, I'm looking for a book or web with projects, like console text games
or console programs explained from scratch to
On Tue, 15 May 2007, Kent Johnson wrote:
Matt Smith wrote:
Thanks for the help. For future reference how do I go look at the
implementation of a particular function (the ones coded in Python, I
don't know C)?
Look in the lib directory that was installed with Python. The location
Rikard Bosnjakovic wrote:
On 5/15/07, Mike Hansen [EMAIL PROTECTED] wrote:
Should the os.system command be something like
command = dsspcmbi -v %s %s %(Pdb, temp1)
os.system(command)
?
Yes.
Not Quite, I think.
import tempfile
help(tempfile.TemporaryFile)
Help on function
22 matches
Mail list logo