Re: [Tutor] guess my number game

2018-05-09 Thread Alan Gauld via Tutor
On 9 May 2018 2:30 am, Kerri Murphy wrote: Hi there, Yes, the first code does a good job by asking them to go higher or lower after each guess, in the pop up window. My point is that the code you posted can't even run, let alone do a good job. The indentation is all messe

Re: [Tutor] calling printf() in a C language DLL using ctypes.CDLL

2018-05-09 Thread James Chapman
A long time ago when I was working with Python and DLLs I slapped together a basic and ugly example. You can find it here: https://github.com/James-Chapman/python-code-snippets/ tree/master/DLL_C_funcs_w_callbacks The whole thing should load into Visual Studio. I can't guarantee that it works in i

Re: [Tutor] calling printf() in a C language DLL using ctypes.CDLL

2018-05-09 Thread Brad M
Hmmm, I guess then it's time for me to ask this question: Is how I do this the way you do it? I have been inserting lines like this: print("The program got here!") all over my python code whenever I want to know where the program went. If you want to know where your program went when something

Re: [Tutor] guess my number game

2018-05-09 Thread Kerri Murphy
Hi there, Yes, the first code does a good job by asking them to go higher or lower after each guess, in the pop up window. The 2nd code works, but only outputs all the higher and lower outputs after the 10 guesses. Everyone in the class has the same result basically. When I searched on various

Re: [Tutor] guess my number game

2018-05-09 Thread Kerri Murphy
Perhaps the indentation was changed when I copy and pasted it, but also we've only been using codeskulptor to run our answers. That code did work on ours, so that is weird. But yes there are a lot of errors. We just type it into code skulptor and press play. A box pops up for any user input.

[Tutor] Choice of tools

2018-05-09 Thread Brad M
Hi all, I have a question about how to choose a proper IDE for C/C++ I have been using visual studio ever since my C++ 101 days, but now I realized there is a problem: feature lock-in! As an aside, I can't get "Error squiggles" to show up in my .c project in visual studio 2017, where as in my .cp

[Tutor] Append to list

2018-05-09 Thread Rick Jaramillo
Hello, I’m having trouble understanding the following behavior and would greatly appreciate any insight. l = [1,2,3,4] b=[] for i in range(l): print l b.append(l) l.pop(0) print b OUTPUT [1,2,3,4] [2,3,4] [3,4] [4] [[],[],[],[]] My confusions is the output for b. I don’t unde

Re: [Tutor] Choice of tools

2018-05-09 Thread Ben Finney
Brad M writes: > Hi all, I have a question about how to choose a proper IDE for C/C++ You will likely get better-informed advice from a forum specific to C and C++, then. This forum is for people learning Python. -- \ “If you don't fail at least 90 percent of the time, you're not | `\

Re: [Tutor] Append to list

2018-05-09 Thread Alan Gauld via Tutor
On 9 May 2018, at 23:57, Rick Jaramillo wrote: > >Hello, >I’m having trouble understanding the following behavior and would greatly >appreciate any insight. >l = [1,2,3,4] >b=[] >for i in range(l): >    print l >    b.append(l) >    l.pop(0) >print b >OUTPUT >[1,2,3,4] >[2,3,4] >[3,4] >[4] >

Re: [Tutor] Choice of tools

2018-05-09 Thread Alan Gauld via Tutor
On 9 May 2018, at 23:54, Brad M wrote: > >As an aside, I can't get "Error squiggles" to show up in my .c project in >visual studio 2017, where as in my .cpp project it promptly notifies me I don't know visual studio so this is a guess. But remember that c and c++ are very different. C++ is mu

Re: [Tutor] Append to list

2018-05-09 Thread Steven D'Aprano
On Wed, May 09, 2018 at 10:56:45AM -0700, Rick Jaramillo wrote: > > Hello, > > I’m having trouble understanding the following behavior and would greatly > appreciate any insight. > > l = [1,2,3,4] > b=[] > > for i in range(l): That's not actually your code, is it? Because range(l) gives a T