I am a beginner. I want to save the output data of the following programme in
a file through the programme. Please suggest me the way. I am using Python
2.3.3 on mandrake linux 10 and using "Idle" to save the output to a file
presently.
Thanks in advance.
#programme to calculate various parame
Albert Sweigart dixit:
> You need to specify an ordering function, in your case, len():
By the way, is there any reason why the compare func parameter is called 'key'?
Denis
la vita e estrany
http://spir.wikidot.com/
_
On 12/4/2009 1:22 PM, Kent Johnson wrote:
max() finds the 'largest' in sort order. Strings sort in dictionary
order so the max of a list strings will be the one that comes last in
dictionary order.\
To prevent confusion: When Kent said "dictionary order" it means
real-life dictionary, the thic
On Dec 3, 2009, at 18:25, Hugo Arts wrote:
On Fri, Dec 4, 2009 at 2:08 AM, Tony Cappellini
wrote:
I have a list of 2300 strings.
When I call max() on the list, it returned an item with 37
characters. I am only passing 1 argument to max().
I know for a fact that the largest item has 57 c
max() for strings returns the largest string in an alphabetical sense.
So max(['z', 'aa']) would return 'z'.
You need to specify an ordering function, in your case, len():
max( ['z', ''], key=len)
...which will return '' because it is ordering by key.
-Al Sweigart
On Fri, Dec 4, 2009 at 2:08 AM, Tony Cappellini wrote:
>
> I have a list of 2300 strings.
>
> When I call max() on the list, it returned an item with 37 characters. I am
> only passing 1 argument to max().
> I know for a fact that the largest item has 57 characters, and when I
> called mylist.ind
On 12/4/2009 12:08 PM, Tony Cappellini wrote:
What are the assumptions when calling max on a list of strings?
Does the list need to be sorted? In my case, the list is sorted.
max determines whether one is larger than the other with "<" operator.
max on a list of string will determine the last
On Thu, Dec 3, 2009 at 8:08 PM, Tony Cappellini wrote:
>
> I have a list of 2300 strings.
>
> When I call max() on the list, it returned an item with 37 characters. I am
> only passing 1 argument to max().
> I know for a fact that the largest item has 57 characters, and when I
> called mylist.ind
Hi, folks. I just wanted to thank Martin Walsh and Kent Johnson, both of whom
furthered my education by replying (on-list) that the "P=" syntax is used to
refer to a named group in the same regular expression, i.e., the one in which
the "P" construct was used in the first place. This is as opp
I have a list of 2300 strings.
When I call max() on the list, it returned an item with 37 characters. I am
only passing 1 argument to max().
I know for a fact that the largest item has 57 characters, and when I called
mylist.index('my_57_character_string') the index was found.
Printing len(mylist
Thank you very much!
I had forgotten that unix URLs are case sensitive.
Also, I changed my 'For' statements to your suggestion, tweaked the
exception code a little, and it's working.
So, there are obviously several ways to open files. Do you have a standard
practice, or does it depend on the fil
Playing Devil's Advocate here...
wrote
- Clean easy to read syntax
- Easy to learn
But if the rest already know Perl that's not such a
compelling argument.
- Object Oriented as needed
- Large community
Yep, Perl does that too.
- Multi-platform
Yep, Perl too.
- Fits in your head
skrab...@comcast.net wrote:
My dept at work is reviewing all the different programming languages
that we use and Python is kind of on the chopping block because I'm
the only one using it so far. Basically, it would mean that no new
development would be done in Python.
If most of the developers
Dave Angel ieee.org> writes:
> Once you have an *array* of integers, you have much more than 32 bits to
> work with. For example, with an array of size 10, you now have 320 bits
> to work with. He's just pointing out that it's a little bit awkward to
> address a group of bits that are not al
skrab...@comcast.net, 03.12.2009 18:46:
> My dept at work is reviewing all the different programming languages
> that we use and Python is kind of on the chopping block because I'm
> the only one using it so far. Basically, it would mean that no new
> development would be done in Python.
>
> What
On Thu, Dec 3, 2009 at 12:46 PM, wrote:
> What I need to do is show that Python is a good tool and it should be
> in our toolbox. The other language that would be used instead of
> Python is Perl. Perl is currently used more in our dept. I can't say
> I'm a big fan of Perl, but I'll use if I hav
On Thu, Dec 3, 2009 at 10:13 AM, Steve Bricker
wrote:
> We have Python applications for work with testing reports printed to PDF
> files. Don't know if you have that needed.
>
> Steve Bricker
> Now blogging at srbricker.blogspot.com
>
> On Thu 09/12/03 11:46 , skrab...@comcast.net sent:
>
> My de
BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }We
have Python applications for work with testing reports printed to PDF
files. Don't know if you have that needed.
Steve Bricker
Now blogging at srbricker.blogspot.com
On Thu 09/12/03 11:46 , skrab...@comcast.net sent:
My de
My dept at work is reviewing all the different programming languages
that we use and Python is kind of on the chopping block because I'm
the only one using it so far. Basically, it would mean that no new
development would be done in Python.
What I need to do is show that Python is a good tool and
Roy Hinkelman wrote:
Your list is great. I've been lurking for the past two weeks while I
learned the basics. Thanks.
I am trying to loop thru 2 files and scrape some data, and the loops
are not working.
The script is not getting past the first URL from state_list, as the
test print shows
Your list is great. I've been lurking for the past two weeks while I learned
the basics. Thanks.
I am trying to loop thru 2 files and scrape some data, and the loops are not
working.
The script is not getting past the first URL from state_list, as the test
print shows.
If someone could point me
21 matches
Mail list logo