Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.swapon.de!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.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.029 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'assignment': 0.07; 'paths': 0.07; 'subject:file': 0.07; 'learn,': 0.09; 'subject:How': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'given,': 0.16; 'subject:txt': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'txt': 0.31; 'file': 0.32; 'figure': 0.32; "we're": 0.32; 'subject:from': 0.34; 'problem': 0.35; 'created': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'detail': 0.37; 'explain': 0.39; 'how': 0.40; 'read': 0.60; 'break': 0.61; "you're": 0.61; 'back': 0.62; "you'll": 0.62; "you've": 0.63; 'more': 0.64; 'samuel': 0.84; 'skip:/ 30': 0.84; 'subject:read': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=/zWT9UE6diPMiJes5kzVetkBXF8rYGM6WoPW9ISqhxA=; b=QRAtuyeF7Ix02jaU00cE53IEOlArmw4mxNW/u/8X77QaTTs3WjSzooWUYybWceMfGf CVmpE4R2kMWnKgdnYvcfdQvXTkHSs6/Wtct7gCLnGSZnBKccBGHA7VLQqoayZNSdqmz2 5ca8opKFMJmXF5rrFOwl3HCdhHi04rKJrhzDNJnjczX740/qlqkiV14oYZJtBS5wPHYv p5kOO86HI9L+ftZOMgtsnHF3BLi+mMv/yziFe56S3LRkmZoZ4fMRDSzCXl4sOg0Of6y+ /gobR1QHp0K4mAFsmQlXpgDl3i0sMXPqHXwcFtmagnkQYx2Hp7nIbv0QCaER4aeoue1u WEdQ== MIME-Version: 1.0 X-Received: by 10.52.136.98 with SMTP id pz2mr648665vdb.70.1401719379921; Mon, 02 Jun 2014 07:29:39 -0700 (PDT) In-Reply-To: References: Date: Tue, 3 Jun 2014 00:29:39 +1000 Subject: Re: How to read a directory path from a txt file From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1401719388 news.xs4all.nl 2863 [2001:888:2000:d::a6]:60212 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72413 On Tue, Jun 3, 2014 at 12:18 AM, Samuel Kamau wrote: > I have created a txt file with various paths to directories. The paths look like this > /home/wachkama/Desktop/api/genshi > /home/wachkama/Desktop/www/portal/schedule > /home/wachkama/Desktop/show/help.genshi > > How do i read this paths in python ? This sounds like homework. You'll need to go back to the problem you've been given, figure out what you're actually trying to accomplish, and then break that down into several pieces. We're happy to help you learn, but we will not just do the assignment for you, as that's counter-productive for all of us. If it *isn't* homework, please explain in much more detail what it is you're trying to do here. ChrisA