Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8747

Re: Problem!!

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'character,': 0.07; 'backslash': 0.09; 'parsing': 0.09; 'subject:Problem': 0.09; 'am,': 0.13; 'wrote:': 0.15; 'filenames': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'said.': 0.16; 'string:': 0.16; 'mon,': 0.16; 'written': 0.17; 'linux': 0.18; 'received:209.85.210.174': 0.19; 'received:mail- iy0-f174.google.com': 0.19; 'help.': 0.19; 'work,': 0.20; 'header :In-Reply-To:1': 0.22; 'literal': 0.23; 'code': 0.24; 'string': 0.26; 'windows': 0.26; 'work.': 0.28; 'character': 0.28; 'message- id:@mail.gmail.com': 0.28; 'code,': 0.29; 'character.': 0.30; 'differences': 0.30; "won't": 0.32; 'chris': 0.32; 'skip:" 20': 0.33; 'to:addr:python-list': 0.34; 'skip:" 10': 0.36; 'file': 0.36; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'run': 0.39; 'goes': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.40; 'raw': 0.40; 'skip:r 20': 0.40; 'your': 0.60; 'special': 0.67; 'share': 0.68; 'subject:!!': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=oOHmltB9qQY7OuNyltPT2za49elxX3UXjlxPsQ1gRtM=; b=S1TWi0OzyEgr4pfMMC6cYHSCEzAVS/T9oJBwfRpj90a33NKTr/JQMr6K7iTwEwNiaC K7yYRgGzx/Bttv3fbna4GsEbQszl1vgP+1UN/ehYdyR6HHtMYNPV5VWsIiAVqJacrces U8yOu0ijK3nYjGyXr48IuWiNNZbsqcdHSB99I=
MIME-Version 1.0
In-Reply-To <fa5036fe-ae67-4860-9f78-9469ad0c7b49@g12g2000yqd.googlegroups.com>
References <fa5036fe-ae67-4860-9f78-9469ad0c7b49@g12g2000yqd.googlegroups.com>
Date Mon, 4 Jul 2011 09:54:28 +1000
Subject Re: Problem!!
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.590.1309737271.1164.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1309737271 news.xs4all.nl 21810 [2001:888:2000:d::a6]:47790
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:8747

Show key headers only | View raw


On Mon, Jul 4, 2011 at 9:41 AM, amir chaouki <chaouki.amir@gmail.com> wrote:
> i have written code on linux for parsing text files and it works great
> but when i try to run it on windows it goes crazy, do you have any
> idea???

If you share your code, we may be able to help. Alternatively, here's
a few differences to look at:

1) Filenames - if you have a literal for your file name,
"/home/foobar/file" will work, but "c:\path\newfile.txt" won't -
backslash is a special character. Make it a raw string:
r"c:\path\newfile.txt" - that will work.

2) End of line characters. If you divide the contents of the file on
the "\n" character, and then try to work with the end of each line,
you may find that the string has a "\r" character at the end.

3) What Irmen de Jong said. :)

Chris Angelico

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Problem!! amir chaouki <chaouki.amir@gmail.com> - 2011-07-03 16:41 -0700
  Re: Problem!! Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2011-07-04 01:47 +0200
    Re: Problem!! TheSaint <nobody@nowhere.net.no> - 2011-07-04 15:16 +0800
      Re: Problem!! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-04 20:48 +1200
  Re: Problem!! rantingrick <rantingrick@gmail.com> - 2011-07-03 16:54 -0700
  Re: Problem!! Chris Angelico <rosuav@gmail.com> - 2011-07-04 09:54 +1000
    Re: Problem!! amir chaouki <chaouki.amir@gmail.com> - 2011-07-03 16:58 -0700
      Re: Problem!! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-05 09:30 +1000
      Re: Problem!! Nobody <nobody@nowhere.com> - 2011-07-05 09:14 +0100
  Re: Problem!! Ben Finney <ben+python@benfinney.id.au> - 2011-07-04 10:12 +1000
  Re: Problem!! Grant Edwards <invalid@invalid.invalid> - 2011-07-04 00:34 +0000
    Re: Problem!! milosh zorica <miloshzorica@gmail.com> - 2011-07-03 21:57 -0300

csiph-web