Traceback (most recent call last):
File "C:/Python25/Progs/WebCrawler/spider2.py", line 47, in
x = scrapeSites("http://www.yahoo.com";)
File "C:/Python25/Progs/WebCrawler/spider2.py", line 31, in
scrapeSites
site = iterator.next()
RuntimeError: Set changed size during iteration
def j
On 26 Maj, 03:04, [EMAIL PROTECTED] wrote:
> On 26 Maj, 01:30, I V <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Sun, 25 May 2008 15:49:16 -0700, notnorwegian wrote:
> > > i meant like set[pos], not iterate but access a specific position in the
> > > set.
>
On 26 Maj, 01:30, I V <[EMAIL PROTECTED]> wrote:
> On Sun, 25 May 2008 15:49:16 -0700, notnorwegian wrote:
> > i meant like set[pos], not iterate but access a specific position in the
> > set.
>
> If you need to access arbitrary elements, use a list instead of a s
On May 25, 9:32 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Sun, 25 May 2008 00:10:45 -0700, notnorwegian wrote:
> > sets dont seem to be so good because there is no way to iterate them.
>
> Err:
>
> In [82]: for x in set(['a', '
>>> x = 5
>>> x /= 2
>>> x
2
>>> x *=11.4
>>> x
22.801
ok where does the 1 in the come from?
--
http://mail.python.org/mailman/listinfo/python-list
On 25 Maj, 08:56, Rares Vernica <[EMAIL PROTECTED]> wrote:
> use a set to store them:
>
> >>> s=set()
> >>> s.add('a')
> >>> s.add('b')
> >>> s
> set(['a', 'b'])
> >>> s.add('a')
> >>> s
> set(['a', 'b'])
> >>> s.add('c')
> >>> s
>
> set(['a', 'c', 'b'])
>
>
>
> it does remove duplicates, but is it
when using recursion should one use a return statement or not?
there is a difference obv since with a return statement it will
ultimately return a value if not recursing forever.
but is there a guideline for this or it just taste or is it
considering good style or pythonic to always have a return
im writing a webcrawler.
after visiting a new site i want to store it in alphabetical order.
so obv i want fast insert. i want to delete duplicates too.
which datastructure is best for this?
--
http://mail.python.org/mailman/listinfo/python-list
i have some confusion over this.
sure a class is basically a classification, like for example an animal
or flower. and an object/instance of that class is then for example a
cat.
an object is an instance of a class. that i know, i also know how to
program with classes etc.
i am just confused abo
i am writing a simple webspider .
how do i avoid getting stuck at something like this:
Enter username for W3CACL at www.w3.org:
?
i can obv add an if-clause for the specific site but since i guess
there will be more of the same thats ov not a viable approach in the
long run.
--
http://mail.pytho
On 24 Maj, 07:01, Ben Finney <[EMAIL PROTECTED]>
wrote:
> [EMAIL PROTECTED] writes:
> > On 24 Maj, 05:48, Ben Finney <[EMAIL PROTECTED]>
> > wrote:
> > > Can you tell us exactly which programs you mean when you say "the
> > > shell" and "the commandprompt"?
>
> > commandprompt = windows dos-windows
On 24 Maj, 05:48, Ben Finney <[EMAIL PROTECTED]>
wrote:
> [EMAIL PROTECTED] writes:
> > when running a very computationalheavy program in the shell it
> > sometimes freezes but the commandprompt runs it without problems
>
> Can you tell us exactly which programs you mean when you say "the
> shell"
when running a very computationalheavy program in the shell it
sometimes freezes but the commandprompt runs it without problems and
muh faster, why?
also, the command prompt starts at C:\Users\user>
i want to start at C:\python25\progs
how do i change that?
--
http://mail.python.org/mailman/lis
url = re.compile(r"((http|ftp|https)\:\/\/)(www)?([a-zA-Z]{1}([\w\-]+
\.)+([\w]{2,5}))(:[\d]{1,5})?((/?\w+/)+|/?)(\w+
\.[\w]{3,4})?((\?\w+=\w+)?(&\w+=\w+)*)?")
damn i hate these things.
i want it to only match http://www.name.any/etc
not http://wiki.x etc
--
http://mail.python.org/mailman/listi
url = re.compile(r"^((ht|f)tp(s?)\:\/\/|~/|/)?([\w]+:\w+@)?([a-zA-Z]
{1}
([\w\-]+\.)+
([\w]{2,5}))(:[\d]{1,5})?((/?\w+/)+|/?)(\w+\.[\w]{3,4})?((\?\w+=\w+)?
(&
\w+=\w+)*)?")
why isnt this url catching something like:
http://www.showmedo.com/latestVideoFeed/rss2.0?
tag=python" />
site = urllib.url
On 23 Maj, 02:02, [EMAIL PROTECTED] wrote:
> this program doesnt produce any output, however i know from testing
> that the url-regexp matches urls...
>
> import urllib
> import re
>
> site = urllib.urlopen("http://www.python.org";)
>
> email = re.compile(r'[EMAIL PROTECTED],4}')
> url = re.compile
this program doesnt produce any output, however i know from testing
that the url-regexp matches urls...
import urllib
import re
site = urllib.urlopen("http://www.python.org";)
email = re.compile(r'[EMAIL PROTECTED],4}')
url = re.compile("^((ht|f)tp(s?)\:\/\/|~/|/)?([\w]+:\w+@)?([a-zA-Z]{1}
([\w\
i want to search a document for a particular regexp and then store
that regexp to a file.
but search and match only returns matchobjects(what are those anyway?
i dont get what to do with them, do they contain true/false,
stringposition etc?)
how do i do:
for rows in file:
print regexp.find #
import Tkinter
from Tkinter import *
i have a program where if i comment out either of those import-
statements i get an error.
i thought they meant the same thing and from was supposed to be just
to imort just a specific function and the * imports everything in the
module.
but aparently the abov
anyone using psyche?
how do you run it on Vista? what file do you click? there is no
obvious file like psyche.py...
--
http://mail.python.org/mailman/listinfo/python-list
class TaskGroup:
def __init__(self):
self.group = []
def addTask(self, task):
self.group.append(task)
is this wrong? i have a program thats too big to post but should i
just do group.append in addTask?
reason is when later doing TaskGroup.group i get None
--
http://mail
i have a big file with sentences, the first file of each sentence
contains a colon(:) somewher eon that line
i want to jump past that sentence.
if all(x != ':' for x in line):
this way i can check but i dont want to check for every line in the
whole file, quite unnecessary when i only need to
ch
if i want o test:
if a == 5 and b ==5 and c==5 ... z==5
is there some synctactic suagr for this?
rather than maiking one of my own i mean, something built-in like:
if a,b,c... z == 5:
--
http://mail.python.org/mailman/listinfo/python-list
i am confused.
x=5
y=5
x==y -> True
x is y -> True
shouldnt x is y return False since they shouldnt(dont?) point to the
same place in memory, they just store an equal value?
--
http://mail.python.org/mailman/listinfo/python-list
' '.join([`x x` for x in range(1, 6)])
anyone can tell me what im doing wrong?
--
http://mail.python.org/mailman/listinfo/python-list
25 matches
Mail list logo