[Sara Johnson]
> Sorry to be so confusing. Just realized a dumb mistake I made. It
> doesn't need to be resorted alphabetically and numerically. I need one
> list alphabetical and one numerical.
>
>
> (Alphabetical) List 1, [('Fred', 20), ('Joe', 90), ('Kent', 50),
> ('Sara', 80)]
>
>
On 10/07/07, bhaaluu <[EMAIL PROTECTED]> wrote:
> >>> file.readlines()
> Traceback (most recent call last):
> File "", line 1, in ?
> AttributeError: 'str' object has no attribute 'readlines'
This error here is caused by this earlier statement:
> >>> file=open('text.txt').read()
'file' is now
Greetings,
On 7/9/07, John Fouhy <[EMAIL PROTECTED]> wrote:
>
> The best way to find out what the functions do is to experiment with them.
>
> eg:
>
> >>> f = open('text.txt', 'r')
> >>> f.readlines()
>
> and look at the output.
I like that idea. I made a simple english plain text file, thus:
fi
On 10/07/07, elis aeris <[EMAIL PROTECTED]> wrote:
> from the document i know that if I want to open a text file I do:
>
> f = open("text.txt", "r+")
>
> and thus create f as an file object i can then use.
>
> however, i don't understand these functions
>
> .readline
> .readlines
> .read
> .xlinesr
elis aeris wrote:
> python 3.9 File Objects of Python Library Reference
>
>
>
> from the document i know that if I want to open a text file I do:
>
> f = open("text.txt", "r+")
>
> and thus create f as an file object i can then use.
>
> however, i don't understand these functions
>
> .readline
> .
python 3.9 File Objects of Python Library Reference
from the document i know that if I want to open a text file I do:
f = open("text.txt", "r+")
and thus create f as an file object i can then use.
however, i don't understand these functions
.readline
.readlines
.read
.xlinesread
I have a
It seems to me that what you need is this.
http://www.python.net/crew/mhammond/win32/Downloads.html
I think the key that you are missing here is that python does not include
functions that you ask without downloading something special. Check the
link, download those extensions, and read the docu
"Tony Noyeaux" <[EMAIL PROTECTED]> wrote
> I am looking for a good online resource for
>
> the "def Menu"
def is the command for defining a function.
Menu, in this vcase, is the name of the function being defined.
You will find functions explained in the Modules and Functions
topic of my tut
I am looking for a good online resource for
the "def Menu" and/or "elif choice" commands.
Any help would be much appreciated.
_
Don't get caught with egg on your face. Play Chicktionary!
http://club.live.com/chicktiona
"Sara Johnson" <[EMAIL PROTECTED]> wrote
> this is sort of a script that was written and I'm making
> modifications to. Due to my serious lack of experience,
> I'm afraid to rewrite anything.
This is probably a long shot given the code you've posted so far,
but I don't suppose there are an
Sorry, just needing to clarify. As I may have eluded to in other posts, this
is sort of a script that was written and I'm making modifications to. Due to
my serious lack of experience, I'm afraid to rewrite anything. However, would
I accomplish the same result by copying the lists, then break
Maybe this reference will help:
http://xahlee.org/perl-python/sort_list.html
Just the first part of the discussion there.
On Jul 9, 2007, at 9:54 AM, Sara Johnson wrote:
> Sorry to be so confusing. Just realized a dumb mistake I made. It
> doesn't need to be resorted alphabetically and numeri
Sorry to be so confusing. Just realized a dumb mistake I made. It doesn't
need to be resorted alphabetically and numerically. I need one list
alphabetical and one numerical.
(Alphabetical) List 1, [('Fred', 20), ('Joe', 90), ('Kent', 50), ('Sara',
80)]
(Numerical) List 2, [('
I think what you want to do is start from the beginning with two
separate lists, sort each one however you want, and then either join
them with zip() or simply reference them as (list1[n], list2[n]).
I believe there's also a way to use zip() to separate your list of
tuples into separate list
"Sara Johnson" <[EMAIL PROTECTED]> wrote
>>Use append() to add more data, then sort again to get it in order:
In [6]: data.append(('Joe', 90))
In [7]: data.sort()
In [8]: data
Out[8]: [('Fred', 20), ('Joe', 90), ('Kent', 50), ('Sara', 80)]
>
> What happens if I need to sort alphab
"jim stockford" <[EMAIL PROTECTED]> wrote
>> (The tests at the end are poorly written too.
>
> If you'd be willing to share your strong words, I'd
> be grateful to learn better alternatives.
OK, The strong words referred to the entire piece and
the biggest error was the lack of try/except or g
16 matches
Mail list logo