I printed out some random numbers to a list and use 'print mylist' and
they came out like this:
['102\n', '231\n', '463\n', '487\n', '555\n', '961\n']
I was using 'print mylist.rstrip()' to strip off the '\n'
but kept getting an error of :
AttributeError: 'list' object has no attribute
:
5fc821071002081854k2fa92309ned9389b9f3d91...@mail.gmail.com
Content-Type: text/plain; charset=iso-8859-1
python
-- next part --
An HTML attachment was scrubbed...
URL:
http://mail.python.org/pipermail/tutor/attachments/20100209/a46c4683/attachment-0001.htm
On Wed, 10 Feb 2010 02:28:43 am Ken G. wrote:
I printed out some random numbers to a list and use 'print mylist'
and they came out like this:
['102\n', '231\n', '463\n', '487\n', '555\n', '961\n']
I was using 'print mylist.rstrip()' to strip off the '\n'
but kept getting an error of :
Kent Johnson wrote:
On Tue, Feb 9, 2010 at 10:28 AM, Ken G. beach...@insightbb.com wrote:
I printed out some random numbers to a datafile and use 'print mylist' and
they came out like this:
['102\n', '231\n', '463\n', '487\n', '555\n', '961\n']
How are you generating this list? You
Ken G. wrote:
I printed out some random numbers to a list and use 'print mylist' and
they came out like this:
['102\n', '231\n', '463\n', '487\n', '555\n', '961\n']
I was using 'print mylist.rstrip()' to strip off the '\n'
but kept getting an error of :
AttributeError: 'list' object has no
On Tue, Feb 9, 2010 at 11:09 AM, Ken G. beach...@insightbb.com wrote:
Kent Johnson wrote:
On Tue, Feb 9, 2010 at 10:28 AM, Ken G. beach...@insightbb.com wrote:
I printed out some random numbers to a datafile and use 'print mylist' and
they came out like this:
['102\n', '231\n', '463\n',
There was so many different solutions presented here to me.
Thanks to all. By adding '.strip('\n') to the last two lines below, it
came out:
Sorted List
['102', '231', '463', '487', '555', '961']
for line in file.readlines():
print line.strip('\n'),
mylist.append(line.strip('\n'))
I am a little embarrassed. I just happen to found a program I wrote in
December that create random numbers into a file, copy the numbers into a
list, print the numbers unsorted and sorted from the list without
printing '\n'. Nevertheless, I do thanks you all for trying to help me out.
Ken
Form me the solution is getting into interactive mode, which I had never
heard of until this morning.
On 2/9/2010 9:04 AM, Wayne Watson wrote:
Well, you are correct. Finally, my latest post to the MPL list caught
the eye of John Hunter. I think he wrote MPL. The way out is
interactive use.
Hi all,
I wanna deploy a django program on apache2.2. So I downloaded
mod_wsgi-win32-ap22py26-3.0.so and copied it into apache2.2/modules/,
renamed mod_wsgi.so.
in httpd.conf I appended sentence:
LoadModule python_module modules/mod_wsgi.so
Then It failed to start the server:
httpd.exe: Syntax
Joson,
Everything looks good but I think the *module name is incorrect.*
Change: LoadModule *python_module *modules/mod_wsgi.so
To: LoadModule *wsgi_module *modules/mod_wsgi.so
Glen
On Tue, Feb 9, 2010 at 2:27 PM, Joson zhuchu...@gmail.com wrote:
Hi all,
I wanna deploy a django program on
Joson,
Everything looks good but I think the *module name is incorrect.*
Change: LoadModule *python_module *modules/mod_wsgi.so
To: LoadModule *wsgi_module *modules/mod_wsgi.so
Glen
On Tue, Feb 9, 2010 at 2:27 PM, Joson zhuchu...@gmail.com wrote:
Hi all,
I wanna deploy a django program on
I'm looking a 1800+ line someone else wrote. It uses one large dialog
for menus, and has a large area for images. A few menus open small
dialogs, for example, to enter a file name. The File menu has an exit
choice. The only other exit is the x in the upper right corner of the
large dialog. I'm
Hi guys,
I just wrote this message, but after restarting ipython all worked fine.
How is it to be explained that I first had a namespace error which,
after a restart (and not merely a new run Sande_celsius-main.py), went
away? I mean, surely the namespace should not be impacted by ipython at
I just wrote this message, but after restarting ipython all worked fine.
How is it to be explained that I first had a namespace error which, after a
restart (and not merely a new run Sande_celsius-main.py), went away? I
mean, surely the namespace should not be impacted by ipython at all!?
Hello Wesley,
thanks for your reply. I was surprised about the limited information
too. Sadly (?), I can't reproduce the error any more...
David
On 10/02/10 11:13, wesley chun wrote:
I just wrote this message, but after restarting ipython all worked fine.
How is it to be explained that I
hi,
how to clear contents of a file with out actually deleting it,
basically wat im trying to do is copy a source file into a common file ,run
the common file,after that i need to copy another source file into the
common file,i ant to clear the contents of the common file before copying
sudhir prasad wrote:
hi,
how to clear contents of a file with out actually deleting it,
basically wat im trying to do is copy a source file into a common
file ,run the common file,after that i need to copy another source
file into the common file,i ant to clear the contents of the common
18 matches
Mail list logo