Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'output': 0.05; 'preferably': 0.05; 'attribute': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:files': 0.09; 'wrote': 0.14; 'received:80.91.229.3': 0.16; 'received:97': 0.16; 'received:plane.gmane.org': 0.16; 'subject:Writing': 0.16; 'url.': 0.16; 'trying': 0.19; 'help.': 0.21; 'appears': 0.22; 'instance,': 0.24; 'string,': 0.24; 'define': 0.26; 'holds': 0.26; 'order.': 0.26; 'header:X-Complaints-To:1': 0.27; 'file': 0.32; 'class': 0.32; 'add': 0.35; 'done': 0.36; 'operating': 0.37; 'to:addr :python-list': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'kindly': 0.61; "you're": 0.61; 'email addr:gmail.com': 0.63; 'information': 0.63; 'group,': 0.63; 'dear': 0.65; 'close': 0.67; 'line,': 0.68; 'subject': 0.69; 'coming,': 0.84; 'subject:times': 0.84; 'subject::': 0.85; 'esteemed': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re:Writing Multiple files at a times Date: Sun, 29 Jun 2014 09:33:04 -0400 (EDT) Organization: news.gmane.org References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2_1114015048.1404048784188" X-Gmane-NNTP-Posting-Host: 97.73.240.15 X-Newsreader: PiaoHong.Usenet.Client.VIP:1.54 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1404048700 news.xs4all.nl 2954 [2001:888:2000:d::a6]:38709 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73729 ------=_Part_2_1114015048.1404048784188 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit subhabangalore@gmail.com Wrote in message: > Dear Group, > > I am trying to crawl multiple URLs. As they are coming I want to write them as string, as they are coming, preferably in a queue. > > If any one of the esteemed members of the group may kindly help. > >From your subject line, it appears you want to keep multiple files open, and write to each in an arbitrary order. That's no problem, up to the operating system limits. Define a class that holds the URL information and for each instance, add an attribute for an output file handle. Don't forget to close each file when you're done with the corresponding URL. -- DaveA ------=_Part_2_1114015048.1404048784188--