Re: [Tutor] Project suggestions

2014-03-13 Thread Bod Soutar
On 13 March 2014 02:29, Scott W Dunning wrote: > Hey Everyone, > > I just got through doing a Guess-the-number script and was looking for > something else to practice on. Do any of you have any suggestions on some > things I could work on? Keep in mind I am not only extremely new to python > I

Re: [Tutor] Project suggestions :p:

2014-03-13 Thread Paradox
On 03/12/2014 10:29 PM, Scott W Dunning wrote: Hey Everyone, I just got through doing a Guess-the-number script and was looking for something else to practice on. Do any of you have any suggestions on some things I could work on? Keep in mind I am not only extremely new to python I am new

Re: [Tutor] c++ on python

2014-03-13 Thread Russel Winder
On Wed, 2014-03-12 at 22:05 +, Alan Gauld wrote: > On 12/03/14 16:49, Stefan Behnel wrote: > > Alan Gauld, 12.03.2014 10:11: > >> If it were a library then you would have to call > >> the individual C++ functions directly using > >> something like ctypes, which is usually more > >> complex. > >

Re: [Tutor] c++ on python

2014-03-13 Thread Oscar Benjamin
On 7 March 2014 14:29, Gabriele Brambilla wrote: > Hi, > in the next days I will receive a c++ code that I would like to run in > python (http://docs.python.org/2/extending/index.html). > It should be self consistent (no extraroutines). > I want to be ready to use it... Has someone some C++ code

Re: [Tutor] Loop Issue

2014-03-13 Thread spir
On 03/13/2014 12:40 AM, Danny Yoo wrote: The context is the beginning of the thread: https://mail.python.org/pipermail/tutor/2014-March/100543.html with the loop: ### while health != 0: ... ### The point, and reason why this loop was (potentially) infinite, is that the condition

Re: [Tutor] Project suggestions

2014-03-13 Thread spir
On 03/13/2014 03:29 AM, Scott W Dunning wrote: Hey Everyone, I just got through doing a Guess-the-number script and was looking for something else to practice on. Do any of you have any suggestions on some things I could work on? Keep in mind I am not only extremely new to python I am new t

Re: [Tutor] Project suggestions

2014-03-13 Thread spir
On 03/13/2014 07:17 AM, Ben Finney wrote: Scott W Dunning writes: I just got through doing a Guess-the-number script and was looking for something else to practice on. Do any of you have any suggestions on some things I could work on? Keep in mind I am not only extremely new to python I am new

Re: [Tutor] Project suggestions

2014-03-13 Thread spir
On 03/13/2014 03:29 AM, Scott W Dunning wrote: Hey Everyone, I just got through doing a Guess-the-number script and was looking for something else to practice on. Do any of you have any suggestions on some things I could work on? Keep in mind I am not only extremely new to python I am new t

Re: [Tutor] Loop Issue

2014-03-13 Thread Dave Angel
spir Wrote in message: > On 03/13/2014 12:40 AM, Danny Yoo wrote: >> The context is the beginning of the thread: >> >> https://mail.python.org/pipermail/tutor/2014-March/100543.html >> >> with the loop: >> >> >> ### >> while health != 0: >> ... >> ### > > The point, and reason why this

Re: [Tutor] c++ on python

2014-03-13 Thread Stefan Behnel
Alan Gauld, 12.03.2014 23:05: > On 12/03/14 16:49, Stefan Behnel wrote: >> Alan Gauld, 12.03.2014 10:11: >>> If it were a library then you would have to call >>> the individual C++ functions directly using >>> something like ctypes, which is usually more >>> complex. >> >> ctypes won't talk to C++,

Re: [Tutor] c++ on python

2014-03-13 Thread Russel Winder
On Thu, 2014-03-13 at 16:57 +0100, Stefan Behnel wrote: […] > The thing is: if you have to write your own wrapper anyway (trivial or > not), then why not write it in Cython right away and avoid the intermediate > plain C level? If the task is two write an adapter (aka wrapper) then perhaps use SWI

Re: [Tutor] c++ on python

2014-03-13 Thread James Chapman
Perhaps I should look into Cython as I'm currently working on a project that utilises a C API. I've been finding that getting the data types to be exactly what the C API is expecting to be the hardest part. With the original question in mind, here's an example calling into a C++ external C API:

Re: [Tutor] c++ on python

2014-03-13 Thread Stefan Behnel
James Chapman, 13.03.2014 17:35: > Perhaps I should look into Cython as I'm currently working on a > project that utilises a C API. > > I've been finding that getting the data types to be exactly what the C > API is expecting to be the hardest part. > > With the original question in mind, here's

Re: [Tutor] c++ on python

2014-03-13 Thread Stefan Behnel
Russel Winder, 13.03.2014 17:29: > On Thu, 2014-03-13 at 16:57 +0100, Stefan Behnel wrote: > […] >> The thing is: if you have to write your own wrapper anyway (trivial or >> not), then why not write it in Cython right away and avoid the intermediate >> plain C level? > > If the task is two write a

[Tutor] Beginner - list not returning correct variable value

2014-03-13 Thread Marc Eymard
Hello Tutor, I am a self-taught Python script beginner and I do it from the Michael Dawson Book. In attached script, can somebody tell me why the values of the variables strenght_points, health_points, wisdom_points and dexterity_points stay at 0 value when 'printing' their value from the list

Re: [Tutor] Loop Issue

2014-03-13 Thread Yanni Phone
OK, thank you. I knew the loop was infinite but usuyally when I did infinite loops before, I had them print out a message, so it was obvious. Thanks for the clarification. On Thu, Mar 13, 2014 at 9:38 AM, spir wrote: > On 03/13/2014 12:40 AM, Danny Yoo wrote: > >> The context is the beginning o

Re: [Tutor] Beginner - list not returning correct variable value

2014-03-13 Thread Alan Gauld
On 13/03/14 16:12, Marc Eymard wrote: In attached script, can somebody tell me why the values of the variables strenght_points, health_points, wisdom_points and dexterity_points stay at 0 value when 'printing' their value from the list attributes[] Because when you create the list you use the