Tuesday, February 23, 2010

comp.lang.python - 25 new messages in 13 topics - digest

comp.lang.python
http://groups.google.com/group/comp.lang.python?hl=en

comp.lang.python@googlegroups.com

Today's topics:

* python dowload - 4 messages, 4 authors
http://groups.google.com/group/comp.lang.python/t/83054f9fc83066f7?hl=en
* formatting a number as percentage - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/cfcdbdeba49f63dc?hl=en
* Signature-based Function Overloading in Python - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/7abc18970a1757e7?hl=en
* What's Going on between Python and win7? - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.python/t/ff028548e8841d37?hl=en
* Is this secure? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/ffff2b290db4e811?hl=en
* Creating variables from dicts - 5 messages, 5 authors
http://groups.google.com/group/comp.lang.python/t/bb1797ffb6fc3bd7?hl=en
* SMTPServerDisconnected - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/a1ab7644a72f96f7?hl=en
* Verifying My Troublesome Linkage Claim between Python and Win7 - 2 messages,
2 authors
http://groups.google.com/group/comp.lang.python/t/ba27d93256f5c275?hl=en
* Milenko Kindl and America's Worst French Fries - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/8805f06ec9fa09ed?hl=en
* Bay Area PUG Meeting [Speaker] Thursday in Mountain View, CA? - 2 messages,
2 authors
http://groups.google.com/group/comp.lang.python/t/e1e074f04c5b570c?hl=en
* When will Python go mainstream like Java? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/1675ca5386896fa5?hl=en
* Problem creating executable, with PyQwt - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/bab959c093b98239?hl=en
* Question for you - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/c1c8a35517fb062d?hl=en

==============================================================================
TOPIC: python dowload
http://groups.google.com/group/comp.lang.python/t/83054f9fc83066f7?hl=en
==============================================================================

== 1 of 4 ==
Date: Tues, Feb 23 2010 12:17 pm
From: Tim Chase


monkeys paw wrote:
> I used the following code to download a PDF file, but the
> file was invalid after running the code, is there problem
> with the write operation?
>
> import urllib2
> url = 'http://www.whirlpoolwaterheaters.com/downloads/6510413.pdf'
> a = open('adobe.pdf', 'w')

Sure you don't need this to be 'wb' instead of 'w'?

> for line in urllib2.urlopen(url):
> a.write(line)

I also don't know if this "for line...a.write(line)" loop is
doing newline translation. If it's a binary file, you should use
.read() (perhaps with a modest-sized block-size, writing it in a
loop if the file can end up being large.)

-tkc


== 2 of 4 ==
Date: Tues, Feb 23 2010 12:17 pm
From: Jerry Hill


On Tue, Feb 23, 2010 at 2:42 PM, monkeys paw <monkey@joemoney.net> wrote:
> I used the following code to download a PDF file, but the
> file was invalid after running the code, is there problem
> with the write operation?
>
> import urllib2
> url = 'http://www.whirlpoolwaterheaters.com/downloads/6510413.pdf'
> a = open('adobe.pdf', 'w')
> for line in urllib2.urlopen(url):
>    a.write(line)

Two guesses:

First, you need to call a.close() when you're done writing to the file.

This will happen automatically when you have no more references to the
file, but I'm guessing that you're running this code in IDLE or some
other IDE, and a is still a valid reference to the file after you run
that snippet.

Second, you're treating the pdf file as text (you're assuming it has
lines, you're not writing the file in binary mode, etc.). I don't
know if that's correct for a pdf file. I would do something like this
instead:

Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit
(Intel)] on win32
IDLE 2.6.4

>>> import urllib2
>>> url = 'http://www.whirlpoolwaterheaters.com/downloads/6510413.pdf'
>>> a = open('C:/test.pdf', 'wb')
>>> data = urllib2.urlopen(url).read()
>>> a.write(data)
>>> a.close()

That seems to works for me, in that it downloads a 16 page pdf
document, and that document opens without error or any other obvious
problems.

--
Jerry


== 3 of 4 ==
Date: Tues, Feb 23 2010 12:20 pm
From: David Robinow


On Tue, Feb 23, 2010 at 2:42 PM, monkeys paw <monkey@joemoney.net> wrote:
> I used the following code to download a PDF file, but the
> file was invalid after running the code, is there problem
> with the write operation?
>
> import urllib2
> url = 'http://www.whirlpoolwaterheaters.com/downloads/6510413.pdf'
> a = open('adobe.pdf', 'w')
> for line in urllib2.urlopen(url):
>    a.write(line)

If you're running Windows, try
a = open('adobe.pdf', 'wb')

[Works for me]


== 4 of 4 ==
Date: Tues, Feb 23 2010 12:22 pm
From: "ssteinerX@gmail.com"

On Feb 23, 2010, at 2:42 PM, monkeys paw wrote:

> I used the following code to download a PDF file, but the
> file was invalid after running the code, is there problem
> with the write operation?
>
> import urllib2
> url = 'http://www.whirlpoolwaterheaters.com/downloads/6510413.pdf'
> a = open('adobe.pdf', 'w')

Try 'wb', just in case.

S

> for line in urllib2.urlopen(url):
> a.write(line)
> --
> http://mail.python.org/mailman/listinfo/python-list


==============================================================================
TOPIC: formatting a number as percentage
http://groups.google.com/group/comp.lang.python/t/cfcdbdeba49f63dc?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Feb 23 2010 12:09 pm
From: "Günther Dietrich"


Hans Mulder <hansmu@xs4all.nl> wrote:

>> Did you try this:
>>
>>>>> print('%d%%' % (0.7 * 100))
>> 70%
>
>That method will always round down; TomF's method will round to
>the nearest whole number:
>
> >>> print "%d%%" % (0.698 * 100)
>69%
> >>> print "{0:.0%}".format(.698)
>70%

It was intended as a hint to this way of formatting. He could also try:

>>> print('%.0f%%' % (0.698 * 100))
70%

Best regards,

Günther

==============================================================================
TOPIC: Signature-based Function Overloading in Python
http://groups.google.com/group/comp.lang.python/t/7abc18970a1757e7?hl=en
==============================================================================

== 1 of 2 ==
Date: Tues, Feb 23 2010 12:35 pm
From: Arnaud Delobelle


Michael Rudolf <spamfresser@ch3ka.de> writes:

> Just a quick question about what would be the most pythonic approach
> in this.
>
> In Java, Method Overloading is my best friend, but this won't work in
> Python:
>
>>>> def a():
> pass
>>>> def a(x):
> pass
>>>> a()
> Traceback (most recent call last):
> File "<pyshell#12>", line 1, in <module>
> a()
> TypeError: a() takes exactly 1 argument (0 given)
>
> So - What would be the most pythonic way to emulate this?
> Is there any better Idom than:
>
>>>> def a(x=None):
> if x is None:
> pass
> else:
> pass
>

There are a number of frameworks for function overloading out there. FWIW,
there is actually one in the Python sandbox (for Python 3):

http://svn.python.org/view/sandbox/trunk/Overload3K/

--
Arnaud

== 2 of 2 ==
Date: Tues, Feb 23 2010 2:55 pm
From: Lie Ryan


On 02/24/10 05:25, Michael Rudolf wrote:
> Just a quick question about what would be the most pythonic approach in
> this.
>
> In Java, Method Overloading is my best friend, but this won't work in
> Python:
<snip>
> So - What would be the most pythonic way to emulate this?
> Is there any better Idom than:
>
>>>> def a(x=None):
> if x is None:
> pass
> else:
> pass

Python's idiom for this has always been to use "if arg is None:"; but
now with the (relatively) new decorator feature, though is not yet a
popular idiom, it is now possible to do something like this:

#!/usr/bin/env python

from functools import wraps

def overloaded(func):
@wraps(func)
def overloaded_func(*args, **kwargs):
for f in overloaded_func.overloads:
try:
return f(*args, **kwargs)
except TypeError:
pass
else:
# it will be nice if the error message prints a list of
# possible signatures here
raise TypeError("No compatible signatures")

def overload_with(func):
overloaded_func.overloads.append(func)
return overloaded_func

overloaded_func.overloads = [func]
overloaded_func.overload_with = overload_with
return overloaded_func

#############

@overloaded
def a():
print 'a() without args'
pass

@a.overload_with
def _(n):
# note that, just like property(), the function's name in
# the "def _(n):" line can be arbitrary, the important
# name is in the "@overloads(a)" line
print 'a() with args'
pass

a()
a(4)
a(4, 5) # ERROR: no matching signature

PS: I posted the code to recipe book, for future reference:
http://code.activestate.com/recipes/577064-simple-function-overloading-with-decorator/

==============================================================================
TOPIC: What's Going on between Python and win7?
http://groups.google.com/group/comp.lang.python/t/ff028548e8841d37?hl=en
==============================================================================

== 1 of 3 ==
Date: Tues, Feb 23 2010 12:35 pm
From: "Michel Claveau - MVP"


Hi!

> Symbolic links are available in NTFS starting with Windows Vista.

No.
Hardlink come with NTFS, and already exists in W2K (and NT with specifics utilities).

@-salutations
--
Michel Claveau

== 2 of 3 ==
Date: Tues, Feb 23 2010 1:11 pm
From: buggsy2@sdlfkj.com


"W. eWatson" <wolftracks@invalid.com> writes:

> I noted that this search box has
> some sort of filter associated with it. Possibly, in my early stages
> of learning to navigate in Win7, I accidentally set the filter.
>
> Comments?

FYI, the only truly reliable and powerful file search utility I've found
for Windows is Agent Ransack (http://download.mythicsoft.com/agentran.exe)


== 3 of 3 ==
Date: Tues, Feb 23 2010 1:40 pm
From: Benjamin Kaplan


On Tue, Feb 23, 2010 at 3:35 PM, Michel Claveau - MVP
<enleverLesX_XXmcX@xmclavxeaux.com.invalid> wrote:
> Hi!
>
>> Symbolic links are available in NTFS starting with Windows Vista.
>
> No.
> Hardlink come with NTFS, and already exists in W2K (and NT with specifics utilities).
>
> @-salutations
> --
> Michel Claveau
>

And there's a difference between hard links and symbolic links.
Symbolic links were added to NTFS starting with Windows Vista.

http://msdn.microsoft.com/en-us/library/aa365680%28VS.85%29.aspx

> --
> http://mail.python.org/mailman/listinfo/python-list
>

==============================================================================
TOPIC: Is this secure?
http://groups.google.com/group/comp.lang.python/t/ffff2b290db4e811?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Feb 23 2010 12:49 pm
From: Robert Kern


On 2010-02-23 13:59 PM, mk wrote:
> On Feb 23, 7:19 pm, Paul Rubin<no.em...@nospam.invalid> wrote:
>
>> The code is pretty ugly. The main problem is you end up with a password
>> that's usually 5 letters but sometimes just 4 or fewer.
>
> Well I didn't write the whole thing here, in actual use I'd write a
> loop repeating the function until I have enough characters and then
> I'd select a substring of specified length.
>
> Anything else in the code that is ugly and I should correct?

I would recommend using random.SystemRandom.choice() on a sequence of acceptable
characters. E.g. (untested)

import random
import string


characters = string.letters + string.digits + '~!@#$%^&*()-+=,;./\?><|'
# ... or whatever.

def gen_rand_string(length):
prng = random.SystemRandom()
chars = []
for i in range(length):
chars.append(prng.choice(characters))
return ''.join(chars)

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco


==============================================================================
TOPIC: Creating variables from dicts
http://groups.google.com/group/comp.lang.python/t/bb1797ffb6fc3bd7?hl=en
==============================================================================

== 1 of 5 ==
Date: Tues, Feb 23 2010 12:53 pm
From: vsoler


Hi,

I have two dicts

n={'a', 'm', 'p'}
v={1,3,7}

and I'd like to have

a=1
m=3
p=7

that is, creating some variables.

How can I do this?


== 2 of 5 ==
Date: Tues, Feb 23 2010 1:10 pm
From: Arnaud Delobelle


vsoler <vicente.soler@gmail.com> writes:

> Hi,
>
> I have two dicts
>
> n={'a', 'm', 'p'}
> v={1,3,7}

These are sets, not dicts.

> and I'd like to have
>
> a=1
> m=3
> p=7

As sets are unordered, you may as well have

a = 3
m = 7
p = 1

or any other permutation. You need some sequences instead. E.g.

n = ['a', 'm', 'p']
v = (1, 3, 7)

Then you can do:

for name, value in zip(n, v):
globals()[name] = value

After this the names, 'a', 'm' and 'p' will be bound to the values you
want in the global namespace. However, it is almost always a bad idea
to do this. Can you explain why you need to do this?

--
Arnaud


== 3 of 5 ==
Date: Tues, Feb 23 2010 1:21 pm
From: Hai Vu


On Feb 23, 12:53 pm, vsoler <vicente.so...@gmail.com> wrote:
> Hi,
>
> I have two dicts
>
> n={'a', 'm', 'p'}
> v={1,3,7}
>
> and I'd like to have
>
> a=1
> m=3
> p=7
>
> that is, creating some variables.
>
> How can I do this?

I think you meant to use the square brackets [ ] instead of the curly
ones { } to define the list:

>>> n = ['a', 'b', 'c']
>>> v = [3, 5, 7]
>>> for x, y in zip(n, v):
... exec '%s=%d' % (x, y)
...
>>> a
3
>>> b
5
>>> c
7

---
The key is the use of the exec statement, which executes the strings
"a=3", "b=5", ... as if they are python statements.


== 4 of 5 ==
Date: Tues, Feb 23 2010 1:31 pm
From: MRAB


vsoler wrote:
> Hi,
>
> I have two dicts
>
> n={'a', 'm', 'p'}
> v={1,3,7}
>
Those aren't dicts, they're sets.

> and I'd like to have
>
> a=1
> m=3
> p=7
>
> that is, creating some variables.
>
> How can I do this?

The real question is not how, but why?

Anyway, assuming you want them to be global variables:

globals().update(dict(zip(n, v)))

On my machine the variables didn't get the correct values because, as I
said, 'n' and 'v' are sets, so the order of the members is arbitrary.


== 5 of 5 ==
Date: Tues, Feb 23 2010 2:56 pm
From: Luis M. González


On Feb 23, 5:53 pm, vsoler <vicente.so...@gmail.com> wrote:
> Hi,
>
> I have two dicts
>
> n={'a', 'm', 'p'}
> v={1,3,7}
>
> and I'd like to have
>
> a=1
> m=3
> p=7
>
> that is, creating some variables.
>
> How can I do this?

You are probably coming from another language and you're not used to
python's data structures.
If you want a list of items, you use tuples or lists. Examples:

('a', 'm', 'p') ---> this is a tuple, and it's made with
parenthesis ()
['a', 'm', 'p'] ---> this is a list, and it's made with brackets
[]

Check the documentation to see the difference between tuples and
lists.
For now, lets just use lists and forget about tuples...
Now if you want a sequence of items ordered a key + value pairs, use a
dictionary, as follows:

{'name': 'joe', 'surname': 'doe', 'age': 21} ---> this is a dict,
and it's made with curly braces {}.

Curly braces are also used to create sets, but you don't need them now
(check the documentation to learn more about sets).
So going back to your question, you should have two lists, as follows:

n = ['a', 'm', 'p']
v = [1,3,7] --> note that I used brackets [], not curly
braces {}.

And now you can build a dict formed by the keys in "n" and the values
in "v":

myDict = {} --> this is an new empty dictionary
for k,v in zip(n,v):
myDict[k] = v

This results in this dictionary: {'a': 1, 'p': 7, 'm': 3}.

Hope this helps...
Luis

==============================================================================
TOPIC: SMTPServerDisconnected
http://groups.google.com/group/comp.lang.python/t/a1ab7644a72f96f7?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Feb 23 2010 12:53 pm
From: Jonathan Gardner


On Tue, Feb 23, 2010 at 8:47 AM, Victor Subervi <victorsubervi@gmail.com> wrote:
> Hi;
> I think the last main thing I have to do on my server is get a running email
> server up. Now that I've nuked sendmail and given up on postfix, I'm back to
> trying to get qmail up and running again. Of course, there are no active
> discussion lists for *any* email server, so I have to turn here for help.
> While running a script that worked perfectly well on another server to send
> an email, I get the following error:
> A problem occurred in a Python script. Here is the sequence of function
> calls leading up to the error, in the order they occurred.
> A problem occurred in a Python script. Here is the sequence of function
> calls leading up to the error, in the order they occurred.
>  /var/www/html/globalsolutionsgroup.vi/simplemail/mail2.py
>    52 </head>
>    53 <body>'''
>    54 my_mail()
>    55 print '''
>    56 </body>
> my_mail = <function my_mail>
>  /var/www/html/globalsolutionsgroup.vi/simplemail/mail2.py in my_mail()
>    33       to_address = ourEmail1,
>    34       subject = subject,
>    35       message = message
>    36   ).send()
>    37   Email(
> message = 'Name: beno -\nMessage: test'
>  /var/www/html/globalsolutionsgroup.vi/simplemail/simplemail.py in
> send(self=<simplemail.Email object>)
>   344         smtp = smtplib.SMTP()
>   345         if self.smtp_server:
>   346             smtp.connect(self.smtp_server)
>   347         else:
>   348             smtp.connect()
> smtp = <smtplib.SMTP instance>, smtp.connect = <bound method SMTP.connect of
> <smtplib.SMTP instance>>, self = <simplemail.Email object>, self.smtp_server
> = 'localhost'
>  /usr/lib64/python2.4/smtplib.py in connect(self=<smtplib.SMTP instance>,
> host='localhost', port=25)
>   305         if not self.sock:
>   306             raise socket.error, msg
>   307         (code, msg) = self.getreply()
>   308         if self.debuglevel > 0: print>>stderr, "connect:", msg
>   309         return (code, msg)
> code undefined, msg = 'getaddrinfo returns an empty list', self =
> <smtplib.SMTP instance>, self.getreply = <bound method SMTP.getreply of
> <smtplib.SMTP instance>>
>  /usr/lib64/python2.4/smtplib.py in getreply(self=<smtplib.SMTP instance>)
>   349             if line == '':
>   350                 self.close()
>   351                 raise SMTPServerDisconnected("Connection unexpectedly
> closed")
>   352             if self.debuglevel > 0: print>>stderr, 'reply:',
> repr(line)
>   353             resp.append(line[4:].strip())
> global SMTPServerDisconnected = <class smtplib.SMTPServerDisconnected>
> SMTPServerDisconnected: Connection unexpectedly closed
>       args = ('Connection unexpectedly closed',)
> I cannot find the qmail logs. I assumed they'd be in either
> /var/qmail/supervise/qmail-send
> or
> /var/qmail/supervise/qmail-smtpd
> but I find no logs there.
>
> [SSH] Protocol Version 2 (OpenSSH_4.3)
> [SSH] Cipher: aes128-cbc
> Logged in (password)
> Last login: Tue Feb 23 05:24:00 2010 from 66.248.168.67
> [beno@13gems ~]$ su
> Password:
> [root@13gems beno]# man netstat
> [root@13gems beno]# netstat
> Active Internet connections (w/o servers)
> Proto Recv-Q Send-Q Local Address               Foreign Address
> State
> getnameinfo failed
> tcp        0    268 nrelectric.com:ssh          [UNKNOWN]:61912
> ESTABLISHED
> Active UNIX domain sockets (w/o servers)
> Proto RefCnt Flags       Type       State         I-Node Path
> unix  7      [ ]         DGRAM                    10842  /dev/log
> unix  2      [ ]         DGRAM                    10370
>  @/org/kernel/udev/udevd
> unix  2      [ ]         DGRAM                    6077731
> unix  3      [ ]         STREAM     CONNECTED     6077679
> unix  3      [ ]         STREAM     CONNECTED     6077678
> unix  2      [ ]         DGRAM                    6077675
> unix  2      [ ]         DGRAM                    11556
> unix  2      [ ]         DGRAM                    11511
> unix  2      [ ]         DGRAM                    10990
> [root@13gems beno]#
>
> How do I trouble-shoot this?

Try connecting to the port that is supposed to accept mail messages
via telnet and issue a few SMTP commands.

--
Jonathan Gardner
jgardner@jonathangardner.net

==============================================================================
TOPIC: Verifying My Troublesome Linkage Claim between Python and Win7
http://groups.google.com/group/comp.lang.python/t/ba27d93256f5c275?hl=en
==============================================================================

== 1 of 2 ==
Date: Tues, Feb 23 2010 1:00 pm
From: "W. eWatson"


On 2/23/2010 11:14 AM, Gib Bogle wrote:
> W. eWatson wrote:
>> On 2/23/2010 8:26 AM, Rick Dooling wrote:
>>> No telling what Windows will do. :)
>>>
>>> I am a mere hobbyist programmer, but I think real programmers will
>>> tell you that it is a bad habit to use relative paths. Use absolute
>>> paths instead and remove all doubt.
>>>
>>> http://docs.python.org/library/os.path.html
>>>
>>> RD
>> You may be right. The actual 300 line program just reads the folder
>> without specifying any path. I'm not that familiar with os path, but
>> have seen it used.
>
> How do you invoke the program? Do you use a Command Prompt window?
IDLE, but I'm prett sure I tried it (300 lines) with Cprompt.


== 2 of 2 ==
Date: Tues, Feb 23 2010 1:29 pm
From: Gib Bogle


W. eWatson wrote:
> On 2/23/2010 11:14 AM, Gib Bogle wrote:
>> W. eWatson wrote:
>>> On 2/23/2010 8:26 AM, Rick Dooling wrote:
>>>> No telling what Windows will do. :)
>>>>
>>>> I am a mere hobbyist programmer, but I think real programmers will
>>>> tell you that it is a bad habit to use relative paths. Use absolute
>>>> paths instead and remove all doubt.
>>>>
>>>> http://docs.python.org/library/os.path.html
>>>>
>>>> RD
>>> You may be right. The actual 300 line program just reads the folder
>>> without specifying any path. I'm not that familiar with os path, but
>>> have seen it used.
>>
>> How do you invoke the program? Do you use a Command Prompt window?
> IDLE, but I'm prett sure I tried it (300 lines) with Cprompt.

I don't know what you mean by "300 lines". Have you opened a Command Prompt
window, changed to the directory where you copied the files, and executed:
python your_prog.py
?

==============================================================================
TOPIC: Milenko Kindl and America's Worst French Fries
http://groups.google.com/group/comp.lang.python/t/8805f06ec9fa09ed?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Feb 23 2010 1:02 pm
From: Milenko Kindl


Milenko Kindl

In spite of the name, French fries are practically an American
birthright. They're offered as the first choice side dish with nearly
every fast-food and sit-down chain meal available. But here's the
catch: In a recent study of 7,318 New York City patrons leaving fast
food chains during the lunch hour, researchers learned that combo meals
—meaning meals with sides—averaged 1,100 calories each, which is over
half a day's allotment. It goes to show: When your regular meals at
these restaurants are already pushing the nutritional envelope, adding
an extra 300 (or more!) empty calories can make for a dietary
disaster.

The authors of the best-selling weight-loss series Eat This, Not That!
and Cook This, Not That! have rounded up three of the worst orders of
fries available at chain restaurants across the country. We've also
offered up the surprising winner of the fast food French fry cook-off—
you'll never believe which restaurant chain produces the healthiest
fried spuds!


Worst Curly Fries
Arby's Curly Fries (Large)
640 calories
34 g fat (5 g saturated, 0 g trans)
1,460 mg sodium

Arby's is famous for its curly fries—too bad they're overloaded with
fat, calories and sodium. When one side dish accounts for nearly three-
quarters of your daily allotment of salt, you know there's a problem.
As fun as these curli-Qs are, stick to the Homefry variety at Arby's—
downsizing to a small Curly Fries will still leave you with a 410-
calorie side, which is more than many of Arby's sandwiches!

Bonus tip: For full nutrition information for all of your favorite
chain restaurants and thousands of foods, download the bestselling Eat
This, Not That! iPhone app. It's like having your own personal
nutritionist in your pocket at all times, and will help you avoid the
caloric calamities and guide you to the best ways to lose your belly
fast.

Eat This Instead!
Homestyle Fries (Small)
350 calories
15 g fat (2 g saturated)
720 mg sodium


Worst Wedge Fries
Jack in the Box Bacon Cheddar Wedges
715 calories
45 g fat (13 g saturated, 1 g trans)
905 mg sodium

It doesn't take a nutritionist to identify the hazards of a grease-
soaked, cheese-slathered sack of deep-fried potatoes, but by
appearance alone, nobody could guess what's really at stake when you
order this side from Jack's. The American Heart Association recommends
that people cap their trans fat intake at 1 percent of total calories.
For people on a 2,000-calorie diet, that's about 2 grams per day. See
the problem? Another issue, of course, is the overload in calories—
about one-third your daily allotment!

Bonus tip: Cheese fries are clearly an unhealthy choice. But sometimes
healthy-seeming options are just as dangerous as the obvious diet-
sinkers. For 30 jaw-dropping examples, check out The 30 Worst
Sandwiches in America.

Eat This Instead!
Grilled Chicken Strips (4) with Fire Roasted Salsa
185 calories
2 g fat (0.5 g saturated)
805 mg sodium


Worst Fries for Your Blood Pressure
Dairy Queen Chili Cheese Fries
1,240 calories
71 g fat (28 g saturated, 0.5 g trans)
2,550 milligrams sodium

This one's a no-brainer: Chili, cheese, fried potatoes. But even a
savvy eater couldn't possibly anticipate how bad these 3 ingredients
could be when combined by one heavy-handed fast-food company. There's
as much sodium in this side dish as you'll find in 15 strips of bacon.
Stick with classic ketchup and recapture nearly a day's worth of
sodium and 930 calories.

Bonus tip: Save calories, time, and money with our free Eat This, Not
That! newsletter. Sign up today and you'll get the Eat This, Not That!
guide to shopping once and eating for a week for free!

Eat This Instead!
French Fries (regular)
310 calories
13 g fat (2 g saturated)
640 mg sodium


Worst Regular Order of Fries
Five Guys Fries (large)
1,464 calories
71 g fat (14 g saturated)
213 mg sodium

Unfortunately, Five Guys doesn't offer anything but fries in the side
department. Your safest bet, of course, is to skip the fries
altogether (you'd be better off adding a second patty to your burger),
but if you can't bring yourself to eat a burger sans fries, then split
a regular order. That will still add 310 calories to your meal, but it
beats surrendering more than 75% of your day's calories to a greasy
paper bag.

Bonus tip: Sides account for a third of our combo-meal calories—but
drinks account for a quarter of the total calories we consume each
day! Battle the liquid bulge: Avoid all drinks on this shocking list
of The Worst Drinks in the Supermarket.

Eat This Instead!
Regular Fries (1/2 serving)
310 calories
15 g fat (3 g saturated)
45 mg sodium


Worst Fries in America
Chili's Texas Cheese Fries w/Jalapeno Ranch
1,920 calories
147 g fat (63 g saturated)
3,580 mg sodium

The only thing that comes close to redeeming this cheesy mound of lard
and grease is the fact that it's ostensibly meant to be shared with a
few friends. Even so, you'll collectively be taking in an entire day's
worth of calories, three days' allotment of saturated fat, and a day
and a half's allotment of sodium. What's even scarier, if you can
imagine, is that even if you try to order more sensibly and ask for
the "half" order of Texas Cheese Fries, you'll still receive a
disastrous dish that packs in 1,400 calories. There's one French fries
side dish at Chili's that's acceptable, although even in its much-
reduced form, you'd be better off splitting it.

Bonus Tip: See what other Chili's items made our list of The 20 Worst
Restaurant Foods in America.

Eat This Instead!
Homestyle Fries
380 calories
23 g fat (4 g saturated)
230 mg sodium


Best Fast Food Fries in America
McDonald's Small French Fries
230 calories
11 g fat (1.5 g saturated)
160 mg sodium

Out of the big three fast food joints (Mickey D's, Wendy's, and BK),
you'll find the least caloric, least salty fries underneath the golden
arches. The key to ordering a smart side dish is portion sizing—and
McDonald's has that under control.

------------

Follow Men's Health and Women's Health editor Dave Zinczenko on
Twitter. You'll get the best life-changing health, nutrition and
exercise secrets every day.

Check out the cutting-edge guide to fast and easy weight loss, the
brand-new Big Book of Exercises.

Feeling lousy? Find the right medicine to ease the cold and flu

Get more nutrition, health, and fitness secrets from Men's Health:
Subscribe today with this special offer and save 50% off the cover
price.

==============================================================================
TOPIC: Bay Area PUG Meeting [Speaker] Thursday in Mountain View, CA?
http://groups.google.com/group/comp.lang.python/t/e1e074f04c5b570c?hl=en
==============================================================================

== 1 of 2 ==
Date: Tues, Feb 23 2010 1:23 pm
From: "W. eWatson"


On 2/23/2010 7:49 AM, W. eWatson wrote:
> Anyone here going to the meeting,Subject? As far as I can tell, it meets
> from 7:30 to 9 pm. Their site shows no speaker yet, and there seems to
> be an informal group dinner at 6 pm at some place yet unknown. Comments?

== 2 of 2 ==
Date: Tues, Feb 23 2010 2:50 pm
From: aahz@pythoncraft.com (Aahz)


In article <hm0tdp$lac$1@news.eternal-september.org>,
W. eWatson <wolftracks@invalid.com> wrote:
>
>Anyone here going to the meeting,Subject? As far as I can tell, it meets
>from 7:30 to 9 pm. Their site shows no speaker yet, and there seems to
>be an informal group dinner at 6 pm at some place yet unknown. Comments?

Subscribe to http://mail.python.org/mailman/listinfo/baypiggies
--
Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/

"Many customs in this life persist because they ease friction and promote
productivity as a result of universal agreement, and whether they are
precisely the optimal choices is much less important." --Henry Spencer

==============================================================================
TOPIC: When will Python go mainstream like Java?
http://groups.google.com/group/comp.lang.python/t/1675ca5386896fa5?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Feb 23 2010 2:26 pm
From: Ben Finney


Stefan Behnel <stefan_ml@behnel.de> writes:

> Chris Rebert, 23.02.2010 06:45:
> > Indeed. Python is at position 7, just behind C#, in the TIOBE Index:
> > http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
>
> That index is clearly flawed. A language like PHP (whatever that is
> supposed to be comparable with) can't possibly be on the rise, can it?

Why not? What do you think the TIOBE measures, and why would PHP not be
rising by that measure?

--
\ "To save the world requires faith and courage: faith in reason, |
`\ and courage to proclaim what reason shows to be true." |
_o__) —Bertrand Russell |
Ben Finney

==============================================================================
TOPIC: Problem creating executable, with PyQwt
http://groups.google.com/group/comp.lang.python/t/bab959c093b98239?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Feb 23 2010 2:28 pm
From: David Boddie


On Tuesday 23 February 2010 05:32, Gib Bogle wrote:

> David Boddie wrote:
>
>> I have previously referred people with py2exe/PyQt issues to this page on
>> the PyQt Wiki:
>>
>> http://www.py2exe.org/index.cgi/Py2exeAndPyQt
>>
>> If you can somehow convince py2exe to include the QtSvg module (and
>> presumably the libQtSvg library as well) then perhaps that will solve
>> this problem.
>>
>> David
>
> Thanks David, that worked a treat. :-)

If you could update the Wiki (or maybe the py2exe Wiki, if they have one)
to say what you did, that would be useful for others in the future. Then
they'll only be one search away from the answer. :-)

David

==============================================================================
TOPIC: Question for you
http://groups.google.com/group/comp.lang.python/t/c1c8a35517fb062d?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Feb 23 2010 2:57 pm
From: Daniel Fetchinson


>> Hello, Dave;
>>
>> My name is Craig Connor and I am a senior s/w developer at Northrop
>> Grumman.
>>
>> I have a question for you. I have installed* Boost* (via the
>> Installer), and stored it into my
>>
>> C Drive inside a dir called:
>>
>> * C:\boost_1_42*
>>
>> I also installed the* Boost Jam* into a directory called:
>>
>> * C:\boost-jam-3.1.17*
>>
>> I am using 2 separate compilers in my* Win OS XP (SP3)*
>>
>> and I would like to be able to use the Python module of Boost
>>
>> in order to embed Python.h into my C++ compiler.
>>
>> The C++ compilers that I have are:
>>
>> o* Dev-cpp*, and
>>
>> o* Visual C++.net* (of* MS Visual Studio.Net 2008*).
>>
>> Problem:
>>
>> When I compile a simple program, I keep getting the error:
>> "*pyconfig.h: No such file or directory*".
>>
>> The program I am trying to start with is (below):
>>
>> *#include <iostream>*
>>
>> *#include<boost/any.hpp>*
>>
>> *#include<boost/python.hpp>*
>>
>> *using namespace std;*
>>
>> *int main( )*
>>
>> *{*
>>
>> * cout << "Hello, Boost World!!" << endl;*
>>
>> * boost::any a(5);*
>>
>> * a = 7.67;*
>>
>> * std::cout<<boost::any_cast<double>(a)<<std::endl;*
>>
>> * *
>>
>> * system( "PAUSE" );*
>>
>> * return 0;*
>>
>> *}*
>>
>>
>> Also:
>>
>> I did set up my environmental config to go to the Boost dir.
>>
>> Question:
>>
>> Do you know what am I doing wrong?
>>
>> Regards,
>>
>> Craig Connor
>>
>> 720.622.2209
>>
> Hello Connor,
>
> I think you have the wrong email address - this is Python-dev, an email
> list for the development *of* Python.
>
> All the best,
>
> Michael Foord

[redirecting to python-list from python-dev]

And the fact that you are a "senior s/w developer" at Northrop Grumman
surely doesn't sound like good advertisement for said firm.

Cheers,
Daniel

--
Psss, psss, put it down! - http://www.cafepress.com/putitdown


==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.python"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.python?hl=en

To unsubscribe from this group, send email to comp.lang.python+unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.python/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate