[Tutor] Tutor Digest, Vol 85, Issue 103

Susana Iraiis Delgado Rodriguez susana.delgado_s at utzmg.edu.mx
Mon Mar 28 18:02:50 CEST 2011


Thank you to everyone!

I changed the txt mode for my system, from 'wb' to 'w' and finally I got
what I need.

Than you!
2011/3/28 <tutor-request at python.org>

> Send Tutor mailing list submissions to
>        tutor at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://mail.python.org/mailman/listinfo/tutor
> or, via email, send a message with subject or body 'help' to
>        tutor-request at python.org
>
> You can reach the person managing the list at
>        tutor-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Tutor digest..."
>
>
> Today's Topics:
>
>   1. Re: Pygame install help (Wayne Werner)
>   2. Re: Write new line(enter) in txt (Susana Iraiis Delgado Rodriguez)
>   3. Re: Write new line(enter) in txt (Joel Goldstick)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 28 Mar 2011 10:27:25 -0500
> From: Wayne Werner <waynejwerner at gmail.com>
> To: Chuck <duxchux at gmail.com>
> Cc: tutor at python.org
> Subject: Re: [Tutor] Pygame install help
> Message-ID:
>        <AANLkTinACrDGdsJ4zkozB_gov6NF1+i8T_DCAOXfA2Gu at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> On Sun, Mar 27, 2011 at 12:31 PM, Chuck <duxchux at gmail.com> wrote:
>
> > Does anyone have familiarity with installing pygame? It seems simple and
> > straight forward enough, then why do I get the following from IDLE? This
> is
> > the 3.1 Windows pygame .msi install...
> >
> > Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)]
> > on win32
> > Type "copyright", "credits" or "license()" for more information.
> > >>> import pygame
> > Traceback (most recent call last):
> >   File "<pyshell#0>", line 1, in <module>
> >     import pygame
> >   File "C:\Python32\lib\site-
> > packages\pygame\__init__.py", line 95, in <module>
> >     from pygame.base import *
> > ImportError: DLL load failed: The specified module could not be found.
> > >>>
> >
>
> Pygame support for Python 3 is a bit spotty (AFAIK). It will probably be
> easier using an earlier version of Python when working with Pygame.
>
> HTH,
> Wayne
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mail.python.org/pipermail/tutor/attachments/20110328/4d663213/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Mon, 28 Mar 2011 09:28:18 -0600
> From: Susana Iraiis Delgado Rodriguez <susana.delgado_s at utzmg.edu.mx>
> To: "Flynn, Stephen (L & P - IT)" <Steve.Flynn at capita.co.uk>
> Cc: tutor at python.org
> Subject: Re: [Tutor] Write new line(enter) in txt
> Message-ID:
>        <AANLkTim0MRcDbXYJA=eTfLkHS9N2s3To-vg_7wbFSSuG at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Ok Flyyn!
> Thank you for answered my question. I think I didn't explain what I need.
> The printing statement is used to print a message to  the Windows console,
> then the other line written in the else statement is:
> log.write('No existe el archivo ' +shx+"\n")
> This is the part I'm struggling with, I don't know how to add the "new
> line"
> to the txt
>
> 2011/3/28 Flynn, Stephen (L & P - IT) <Steve.Flynn at capita.co.uk>
>
> > You don't "print" a newline when you print each line of the file
> > contents...
> >
> >
> > print 'El archivo ' +shx +' existe'
> >
> >
> >
> >
> >
> > You need to add a newline:
> >
> > print 'El archivo ' +shx +' existe' + '\n'
> >
> >
> >
> >
> > ________________________________________
> > From: tutor-bounces+steve.flynn=capita.co.uk at python.org [mailto:
> > tutor-bounces+steve.flynn=capita.co.uk at python.org] On Behalf Of Susana
> > Iraiis Delgado Rodriguez
> > Sent: Monday, March 28, 2011 4:12 PM
> > To: tutor at python.org
> > Subject: [Tutor] Write new line(enter) in txt
> >
> > Hello list!!
> >
> > This is a very simple question!! I want to write some lines in a txt
> file,
> > but my output looks like this:
> > No existe el archivo C:\?ndice.dbfNo existe el archivo
> C:\?ndice_dwg.dbfNo
> > existe el archivo C:\?ndice_raster.dbf
> > I need it to look like this:
> > No existe el archivo C:\?ndice.dbf
> > No existe el archivo C:\?ndice_dwg.dbf
> > No existe el archivo C:\?ndice_raster.dbf
> >
> > The code I wrote is:
> > log = open ('errors.txt','wb')
> > shp = 'Error al abrir el archivo' +filepath
> > log.write(shp+"\n")
> > n = os.path.splitext(filepath)
> > p = n[0]+'.prj'
> > shx = n[0]+'.shx'
> > dbf = n[0]+'.dbf'
> > if os.path.exists(shx):
> >                         print 'El archivo ' +shx +' existe'
> >                 else:
> >                         log.write('No existe el archivo ' +shx+"\n")
> >                 if os.path.exists(dbf):
> >                         print 'El archivo ' +dbf +' existe'
> >                 else:
> >                         log.write('No existe el archivo ' +dbf+"\n")
> > log.close()
> >
> >
> > This email has been scanned for all viruses by the MessageLabs SkyScan
> > service.
> >
> > This email and any attachment to it are confidential.  Unless you are the
> > intended recipient, you may not use, copy or disclose either the message
> or
> > any information contained in the message. If you are not the intended
> > recipient, you should delete this email and notify the sender
> immediately.
> >
> > Any views or opinions expressed in this email are those of the sender
> only,
> > unless otherwise stated.  All copyright in any Capita material in this
> email
> > is reserved.
> >
> > All emails, incoming and outgoing, may be recorded by Capita and
> monitored
> > for legitimate business purposes.
> >
> > Capita exclude all liability for any loss or damage arising or resulting
> > from the receipt, use or transmission of this email to the fullest extent
> > permitted by law.
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mail.python.org/pipermail/tutor/attachments/20110328/bc0814df/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 3
> Date: Mon, 28 Mar 2011 11:43:25 -0400
> From: Joel Goldstick <joel.goldstick at gmail.com>
> To: Susana Iraiis Delgado Rodriguez <susana.delgado_s at utzmg.edu.mx>
> Cc: tutor at python.org
> Subject: Re: [Tutor] Write new line(enter) in txt
> Message-ID:
>        <AANLkTik8-iOvkMyY_KJR6jSpcqWZeFqUbwah_kBmEmbd at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> On Mon, Mar 28, 2011 at 11:28 AM, Susana Iraiis Delgado Rodriguez <
> susana.delgado_s at utzmg.edu.mx> wrote:
>
> > Ok Flyyn!
> > Thank you for answered my question. I think I didn't explain what I need.
> > The printing statement is used to print a message to  the Windows
> console,
> > then the other line written in the else statement is:
> >
> > log.write('No existe el archivo ' +shx+"\n")
> > This is the part I'm struggling with, I don't know how to add the "new
> > line" to the txt
> >
> > 2011/3/28 Flynn, Stephen (L & P - IT) <Steve.Flynn at capita.co.uk>
> >
> >> You don't "print" a newline when you print each line of the file
> >> contents...
> >>
> >>
> >>
> >> print 'El archivo ' +shx +' existe'
> >>
> >>
> >>
> >>
> >>
> >> You need to add a newline:
> >>
> >> print 'El archivo ' +shx +' existe' + '\n'
> >>
> >>
> >>
> >>
> >> ________________________________________
> >> From: tutor-bounces+steve.flynn=capita.co.uk at python.org [mailto:
> >> tutor-bounces+steve.flynn=capita.co.uk at python.org] On Behalf Of Susana
> >> Iraiis Delgado Rodriguez
> >> Sent: Monday, March 28, 2011 4:12 PM
> >> To: tutor at python.org
> >> Subject: [Tutor] Write new line(enter) in txt
> >>
> >>
> >> Hello list!!
> >>
> >> This is a very simple question!! I want to write some lines in a txt
> file,
> >> but my output looks like this:
> >> No existe el archivo C:\?ndice.dbfNo existe el archivo
> C:\?ndice_dwg.dbfNo
> >> existe el archivo C:\?ndice_raster.dbf
> >> I need it to look like this:
> >> No existe el archivo C:\?ndice.dbf
> >> No existe el archivo C:\?ndice_dwg.dbf
> >> No existe el archivo C:\?ndice_raster.dbf
> >>
> >> The code I wrote is:
> >> log = open ('errors.txt','wb')
> >>
> >
>
> Change the above line to
>      log = open('errors.txt, 'w')
>
> You are opening your log file in binary mode, so your operating system
> doesn't convert your '\n' to what it needs for new line
>
>
> > shp = 'Error al abrir el archivo' +filepath
> >> log.write(shp+"\n")
> >> n = os.path.splitext(filepath)
> >> p = n[0]+'.prj'
> >> shx = n[0]+'.shx'
> >> dbf = n[0]+'.dbf'
> >> if os.path.exists(shx):
> >>                         print 'El archivo ' +shx +' existe'
> >>                 else:
> >>                         log.write('No existe el archivo ' +shx+"\n")
> >>                 if os.path.exists(dbf):
> >>                         print 'El archivo ' +dbf +' existe'
> >>                 else:
> >>                         log.write('No existe el archivo ' +dbf+"\n")
> >> log.close()
> >>
> >>
> >> This email has been scanned for all viruses by the MessageLabs SkyScan
> >> service.
> >>
> >> This email and any attachment to it are confidential.  Unless you are
> the
> >> intended recipient, you may not use, copy or disclose either the message
> or
> >> any information contained in the message. If you are not the intended
> >> recipient, you should delete this email and notify the sender
> immediately.
> >>
> >> Any views or opinions expressed in this email are those of the sender
> >> only, unless otherwise stated.  All copyright in any Capita material in
> this
> >> email is reserved.
> >>
> >> All emails, incoming and outgoing, may be recorded by Capita and
> monitored
> >> for legitimate business purposes.
> >>
> >> Capita exclude all liability for any loss or damage arising or resulting
> >> from the receipt, use or transmission of this email to the fullest
> extent
> >> permitted by law.
> >>
> >
> >
> > _______________________________________________
> > Tutor maillist  -  Tutor at python.org
> > To unsubscribe or change subscription options:
> > http://mail.python.org/mailman/listinfo/tutor
> >
> >
>
>
> --
> Joel Goldstick
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mail.python.org/pipermail/tutor/attachments/20110328/9812ccbb/attachment.html
> >
>
> ------------------------------
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
> End of Tutor Digest, Vol 85, Issue 103
> **************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110328/f6e9df8b/attachment-0001.html>


More information about the Tutor mailing list