Case Solution: Doing Business in Sierra Leone Graeme Hossie at London Mining (A) by Brian C. Pinkham, Ken Mark

2017-10-15 Thread premikasharma97
1.  What priorities should Hossie consider?

2.  What are some of the concerns around enforcement of the contracts?

3.  How should Hossie carry out negotiations?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: An endless loop

2017-10-15 Thread bartc

On 15/10/2017 03:10, Stefan Ram wrote:

   I made an error I made a thousand times before.

   I had programmed an endless loop.

   But never did I see before so clear why it's called
   an endless loop. (Tested in IDLE.)

from turtle import *

reset(); reset(); shape( 'turtle' ); showturtle()

def poly( n, length ):
 i = 0
 while i < n:
 forward( length )
 left( 360/n )

poly( 5, 100 )
done()


I assume you're talking about the while-loop (because on my machine, it 
hangs just using 'from turtle...' or 'import turtle').


That looks to be a repeat-N-times loop. There isn't a dedicated 
statement for that, the closest Python feature would be 'for i in 
range(n)' with i a dummy loop variable.


--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: An endless loop

2017-10-15 Thread Peter J. Holzer
On 2017-10-15 10:15, bartc  wrote:
> On 15/10/2017 03:10, Stefan Ram wrote:
>>I made an error I made a thousand times before.
>> 
>>I had programmed an endless loop.
>> 
>>But never did I see before so clear why it's called
>>an endless loop. (Tested in IDLE.)
>> 
>> from turtle import *
>> 
>> reset(); reset(); shape( 'turtle' ); showturtle()
>> 
>> def poly( n, length ):
>>  i = 0
>>  while i < n:
>>  forward( length )
>>  left( 360/n )
>> 
>> poly( 5, 100 )
>> done()
>
> I assume you're talking about the while-loop (because on my machine, it 
> hangs just using 'from turtle...' or 'import turtle').

No graphics? 

For those of you who can't use turtle graphics and aren't familiar
enough with it to see what it does without running the program: It
displays a turtle running through the same (pentagon-shaped) loop over
and over again.

Yes, that's a very nice visualization of an endless loop.

hp

-- 
   _  | Peter J. Holzer| Fluch der elektronischen Textverarbeitung:
|_|_) || Man feilt solange an seinen Text um, bis
| |   | h...@hjp.at | die Satzbestandteile des Satzes nicht mehr
__/   | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel
-- 
https://mail.python.org/mailman/listinfo/python-list


what is credit in data mining?

2017-10-15 Thread Umar Yusuf
Hello, 

Anyone useful idea or material on: credit in data mining?



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: An endless loop

2017-10-15 Thread Chris Angelico
On Sun, Oct 15, 2017 at 9:15 PM, bartc  wrote:
> On 15/10/2017 03:10, Stefan Ram wrote:
>>
>>I made an error I made a thousand times before.
>>
>>I had programmed an endless loop.
>>
>>But never did I see before so clear why it's called
>>an endless loop. (Tested in IDLE.)
>>
>> from turtle import *
>>
>> reset(); reset(); shape( 'turtle' ); showturtle()
>>
>> def poly( n, length ):
>>  i = 0
>>  while i < n:
>>  forward( length )
>>  left( 360/n )
>>
>> poly( 5, 100 )
>> done()
>
>
> I assume you're talking about the while-loop (because on my machine, it
> hangs just using 'from turtle...' or 'import turtle').
>
> That looks to be a repeat-N-times loop. There isn't a dedicated statement
> for that, the closest Python feature would be 'for i in range(n)' with i a
> dummy loop variable.

You can use that or "for _ in range(n)" as a pretty effective form of
that loop. I've never had a problem with it. Python doesn't need
another type of loop.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: An endless loop

2017-10-15 Thread bartc

On 15/10/2017 12:20, Chris Angelico wrote:

On Sun, Oct 15, 2017 at 9:15 PM, bartc  wrote:



I assume you're talking about the while-loop (because on my machine, it
hangs just using 'from turtle...' or 'import turtle').


(Machine was screwed up I think, as I had to restart it shortly after 
for other reasons. When the turtle graphics worked.)



That looks to be a repeat-N-times loop. There isn't a dedicated statement
for that, the closest Python feature would be 'for i in range(n)' with i a
dummy loop variable.


You can use that or "for _ in range(n)" as a pretty effective form of
that loop. I've never had a problem with it. Python doesn't need
another type of loop.


I could understand that sentiment if there were already dozens. But I 
believe there's only, what, two loop types? To implement a number of 
basic looping requirements which, if not that numerous, are somewhat 
more than two.


Not exactly taxing the grey matter which already has those extra loop 
types in mind, and has to find a way to express them in terms of only two.


--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: An endless loop

2017-10-15 Thread Ned Batchelder

On 10/15/17 9:59 AM, bartc wrote:

On 15/10/2017 12:20, Chris Angelico wrote:

On Sun, Oct 15, 2017 at 9:15 PM, bartc  wrote:



I assume you're talking about the while-loop (because on my machine, it
hangs just using 'from turtle...' or 'import turtle').


(Machine was screwed up I think, as I had to restart it shortly after 
for other reasons. When the turtle graphics worked.)


That looks to be a repeat-N-times loop. There isn't a dedicated 
statement
for that, the closest Python feature would be 'for i in range(n)' 
with i a

dummy loop variable.


You can use that or "for _ in range(n)" as a pretty effective form of
that loop. I've never had a problem with it. Python doesn't need
another type of loop.


I could understand that sentiment if there were already dozens. But I 
believe there's only, what, two loop types? To implement a number of 
basic looping requirements which, if not that numerous, are somewhat 
more than two.


Not exactly taxing the grey matter which already has those extra loop 
types in mind, and has to find a way to express them in terms of only 
two.




We've covered this before.  A challenge for the group: let's not create 
yet another 100-reply thread rehashing the design of Python looping... 
Please? :)


--Ned.

--
https://mail.python.org/mailman/listinfo/python-list


Re: An endless loop

2017-10-15 Thread Steve D'Aprano
On Mon, 16 Oct 2017 01:38 am, Ned Batchelder wrote:

> We've covered this before.  A challenge for the group: let's not create
> yet another 100-reply thread rehashing the design of Python looping...
> Please? :)

Certainly!

So... who thinks that Python should implement tail recursion optimization so
that we can forgo iteration altogether?

*wicked grin*



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 2 -> 3, urllib.urlopen (corrected the case)

2017-10-15 Thread Irv Kalb

> On Oct 14, 2017, at 6:46 PM, Ben Bacarisse  wrote:
> 
> Irv Kalb  writes:
> 
>> Thank you!
> 
> You're welcome.
> 
> 
>>> Just a data point...  It works here:
>>> 
>>> $ python3 t.py
>>> Response is:  b'156.99\n'
>>> $ cat t.py
>>> import urllib.request
>>> fullURLWithParameters = 'http://finance.yahoo.com/d/quotes.csv?s=aapl&f=l1'
>>> # read all the data
>>> response = urllib.request.urlopen(fullURLWithParameters).read()
>>> 
>>> print('Response is: ', response)
>>> $ python3 --version
>>> Python 3.5.2
>> 
>> I have not tried this on anything but my Mac.  I'm running 3.6.1
> 
>>> For example, here:
>>> 
>>> $ wget -q -O - 'http://finance.yahoo.com/d/quotes.csv?s=aapl&f=l1' 
>>> 156.99
>>> 
>>> Finally, wget -S shows that the resource has moved.  It is now at
>>> 
>>> Location: http://download.finance.yahoo.com/d/quotes.csv?s=aapl&f=l1
>>> 
>>> I don't think this has anything to do with your problem, but it's worth
>>> noting.
>> 
>> That DID fix it.  I changed the URL to add 'download/' and it worked
>> perfectly.
> 
> That's... interesting.
> 
>> Apparently, Python 3 differs from Python 2 in the way that it is
>> handling a missing/forwarding URL, because the original code in Python
>> 2.7 works perfectly.
> 
> Python 3 works for me.  I still suspect it's some system difference
> rather than being, say, a 3.6.1 vs 3.5.2 difference.  What happens if
> you change the URL to use https rather than http?
> 
> -- 
> Ben.
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

Trying https (with and without the "download." part) results in the same 
traceback as I was seeing earlier.

Thanks again,

Irv
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 2 -> 3, urllib.urlopen (corrected the case)

2017-10-15 Thread Ben Bacarisse
Irv Kalb  writes:

>> On Oct 14, 2017, at 6:46 PM, Ben Bacarisse  wrote:
 Finally, wget -S shows that the resource has moved.  It is now at
 
 Location: http://download.finance.yahoo.com/d/quotes.csv?s=aapl&f=l1
 
 I don't think this has anything to do with your problem, but it's worth
 noting.
>>> 
>>> That DID fix it.  I changed the URL to add 'download/' and it worked
>>> perfectly.
>> 
>> That's... interesting.
>> 
>>> Apparently, Python 3 differs from Python 2 in the way that it is
>>> handling a missing/forwarding URL, because the original code in Python
>>> 2.7 works perfectly.
>> 
>> Python 3 works for me.  I still suspect it's some system difference
>> rather than being, say, a 3.6.1 vs 3.5.2 difference.  What happens if
>> you change the URL to use https rather than http?
>> 
>
> Trying https (with and without the "download." part) results in the
> same traceback as I was seeing earlier.

It looks like there may be something amiss with your local certificates,
at least as far as Python's SSL code in concerned.  That's a Dark Art to
me so I can't really help (and it might be Mac specific).

The error might have showed up in the first test because the redirection
was to an https: URL.

-- 
Ben.
-- 
https://mail.python.org/mailman/listinfo/python-list


how to read in the newsreader

2017-10-15 Thread Andrew Z
Gents,
 how do i get this group in a newsreader? The digest i'm getting is not
workable for me - i can't reply , can only read the replies from the
members of the group. Or. maybe, it shouldn't be a news reader
please advise..

P.S. Oh the comp.lang.python is a nightmare because of spam...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to read in the newsreader

2017-10-15 Thread Michael Torrie
On 10/15/2017 08:50 PM, Andrew Z wrote:
> Gents,
>  how do i get this group in a newsreader? The digest i'm getting is not
> workable for me - i can't reply , can only read the replies from the
> members of the group. Or. maybe, it shouldn't be a news reader
> please advise..
> 
> P.S. Oh the comp.lang.python is a nightmare because of spam...

Regardless of what usenet reader you use, com.lang.python will have the
same spam everywhere.  So maybe reading via usenet isn't that useful anyway.

I just subscribe to the mailing list and then have a rule in my email
filter to stick all list messages in their own folder (or gmail label).
I'm using gmail, so I just use gmail's filtering settings.  Then I view
email using IMAP and a conventional email reader that supports real
threading of messages.  Works great.  A lot of spam is filtered out this
way, also.  In fact very little spam gets through to my folder between
python.org's filtering and gmail's spam detection.

I'm subscribed to maybe a dozen email lists, and I filter all of them
into their own folders.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to read in the newsreader

2017-10-15 Thread Andrew Z
Michael, that's what i use too - gmail. But i get the digest only and can't
really reply that way. i was hoping to get the mail.python.org list

On Mon, Oct 16, 2017 at 12:00 AM, Michael Torrie  wrote:

> On 10/15/2017 08:50 PM, Andrew Z wrote:
> > Gents,
> >  how do i get this group in a newsreader? The digest i'm getting is not
> > workable for me - i can't reply , can only read the replies from the
> > members of the group. Or. maybe, it shouldn't be a news reader
> > please advise..
> >
> > P.S. Oh the comp.lang.python is a nightmare because of spam...
>
> Regardless of what usenet reader you use, com.lang.python will have the
> same spam everywhere.  So maybe reading via usenet isn't that useful
> anyway.
>
> I just subscribe to the mailing list and then have a rule in my email
> filter to stick all list messages in their own folder (or gmail label).
> I'm using gmail, so I just use gmail's filtering settings.  Then I view
> email using IMAP and a conventional email reader that supports real
> threading of messages.  Works great.  A lot of spam is filtered out this
> way, also.  In fact very little spam gets through to my folder between
> python.org's filtering and gmail's spam detection.
>
> I'm subscribed to maybe a dozen email lists, and I filter all of them
> into their own folders.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to read in the newsreader

2017-10-15 Thread Chris Angelico
On Mon, Oct 16, 2017 at 3:19 PM, Andrew Z  wrote:
> Michael, that's what i use too - gmail. But i get the digest only and can't
> really reply that way. i was hoping to get the mail.python.org list

Turn off digests then. Easy!

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to read in the newsreader

2017-10-15 Thread Andrew Z
i'm typing without thinking. Sorry. Let me try again.

I subscribed to python-list@python.org. That has 0 spam ( as far as i can
see), but i can only get a digest.
They do say the list and comp.python group are bidirectional, but - at comp
- tons of spam, there - none.

The google groups doesn't seemed to filter anything in the comp group. But
what you recommend is to access the group using regular email client and
use it's spam filtering . Did i get that right ?


On Mon, Oct 16, 2017 at 12:19 AM, Andrew Z  wrote:

> Michael, that's what i use too - gmail. But i get the digest only and
> can't really reply that way. i was hoping to get the mail.python.org
> list
>
> On Mon, Oct 16, 2017 at 12:00 AM, Michael Torrie 
> wrote:
>
>> On 10/15/2017 08:50 PM, Andrew Z wrote:
>> > Gents,
>> >  how do i get this group in a newsreader? The digest i'm getting is not
>> > workable for me - i can't reply , can only read the replies from the
>> > members of the group. Or. maybe, it shouldn't be a news reader
>> > please advise..
>> >
>> > P.S. Oh the comp.lang.python is a nightmare because of spam...
>>
>> Regardless of what usenet reader you use, com.lang.python will have the
>> same spam everywhere.  So maybe reading via usenet isn't that useful
>> anyway.
>>
>> I just subscribe to the mailing list and then have a rule in my email
>> filter to stick all list messages in their own folder (or gmail label).
>> I'm using gmail, so I just use gmail's filtering settings.  Then I view
>> email using IMAP and a conventional email reader that supports real
>> threading of messages.  Works great.  A lot of spam is filtered out this
>> way, also.  In fact very little spam gets through to my folder between
>> python.org's filtering and gmail's spam detection.
>>
>> I'm subscribed to maybe a dozen email lists, and I filter all of them
>> into their own folders.
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to read in the newsreader

2017-10-15 Thread Andrew Z
hmm. i did do that.  maybe just a delay.
I'll see how it will go tomorrow then. Thank you gents.

On Mon, Oct 16, 2017 at 12:30 AM, Chris Angelico  wrote:

> On Mon, Oct 16, 2017 at 3:19 PM, Andrew Z  wrote:
> > Michael, that's what i use too - gmail. But i get the digest only and
> can't
> > really reply that way. i was hoping to get the mail.python.org list
>
> Turn off digests then. Easy!
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Case Solution: Detroit Bikes Becoming the Biggest Bicycle Manufacturer in North America by Kent Walker, Neda Demiri

2017-10-15 Thread bagriarsh50
hello can i get solution
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Return str to a callback raise a segfault if used in string formating

2017-10-15 Thread dieter
Vincent Vande Vyvre  writes:
> Le 14/10/17 à 15:59, Stefan Behnel a écrit :
> ...
> Thanks, I know Cython but the code is already in C.
>
> This is a lib released as a frontend.  Then usable only in command line.

This does not prevent the use of "Cython". In fact, one of
its use cases is the creation of bindings - a thin wrapper around
a C library to make it easily usable from Python.

An example is "lxml", a binding for the C library "libxml2".
Another one is "dm.xmlsec.binding", a binding for the C library
"libxmlsec".

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to read in the newsreader

2017-10-15 Thread Pete Forman
Andrew Z  writes:

> hmm. i did do that.  maybe just a delay.
> I'll see how it will go tomorrow then. Thank you gents.
>
> On Mon, Oct 16, 2017 at 12:30 AM, Chris Angelico  wrote:
>
>> On Mon, Oct 16, 2017 at 3:19 PM, Andrew Z  wrote:
>> > Michael, that's what i use too - gmail. But i get the digest only
>> > and can't really reply that way. i was hoping to get the
>> > mail.python.org list
>>
>> Turn off digests then. Easy!

If you do stick with a digest then check your newsreader for a feature
to expand it. Then you can read and reply as if you were getting
individual posts.

-- 
Pete Forman
-- 
https://mail.python.org/mailman/listinfo/python-list