Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Python as First Langauge
Post: RE: Python as First Langauge

Yep, I know this. And, indeed, developer time counts. And also, you need not optimize everything. I always tell a story when I hear this: I once did an exercise that a colleague gave to students myse...
mga010 News and Discussions 20 9,114 Jul-28-2020, 04:46 PM
    Thread: Python as First Langauge
Post: RE: Python as First Langauge

I have now decided for Java. The reason is that Java is closer to the machine. I want the students to think about the way an algorithm works and to get a picture of what is actually happening in the...
mga010 News and Discussions 20 9,114 Jul-27-2020, 04:03 PM
    Thread: Python as First Langauge
Post: RE: Python as First Langauge

Thanks for the hint to Type Annotations. I missed that till now. It is used in none of the books I looked into or in sample code. For a guy like me that has written tens of thousands of lines of code ...
mga010 News and Discussions 20 9,114 Jul-05-2020, 05:34 PM
    Thread: Python as First Langauge
Post: RE: Python as First Langauge

The Zeller reference is a good read. I have some arguments against this page, however. (By the way, the page should be formatted for an easier read.) He is exaggerating the complexity of Java and hid...
mga010 News and Discussions 20 9,114 Jul-04-2020, 02:33 PM
    Thread: Python as First Langauge
Post: RE: Python as First Langauge

Thanks for the answers. I hear the claim that it is easier to get results in Python. For the level of this class, I have my doubts because I do not want to program games or UIs, nor do machine learn...
mga010 News and Discussions 20 9,114 Jul-02-2020, 03:04 PM
    Thread: Python as First Langauge
Post: Python as First Langauge

I do not know where to ask this. This forum is linked from Python.org. So it seems just right. I am going to teach a first-year university course in programming next year for students of mathematics ...
mga010 News and Discussions 20 9,114 Jul-02-2020, 10:09 AM
    Thread: C-API - Cannot create module
Post: RE: C-API - Cannot create module

(Jun-24-2020, 10:50 AM)Gribouillis Wrote: If you've found a method that works, that's perfect. This API evolves with every version of python and I don't use it very often, so I'm probably a bit rust...
mga010 General Coding Help 6 2,818 Jul-02-2020, 06:15 AM
    Thread: C-API - Cannot create module
Post: RE: C-API - Cannot create module

Thanks, I now found an easy method which works: #include <stdio.h> #include <Python.h> const char* pystart = "print('Start')\n\ import eumat\n\ print(dir(eumat))\n\ print(eumat.test())"...
mga010 General Coding Help 6 2,818 Jun-24-2020, 10:44 AM
    Thread: C-API - Cannot create module
Post: RE: C-API - Cannot create module

As far as I know, the method PyModule_Create() does not create a file. So I do not know what you mean. Sorry. I have found a partial solution. Importing the module in C was not necessary in Python 2,...
mga010 General Coding Help 6 2,818 Jun-24-2020, 09:44 AM
    Thread: C-API - Cannot create module
Post: C-API - Cannot create module

I have another problem with my project (convert to Python 3 - Euler Math Toolbox). The following code should create a module. But it does not work. The interpreted line "import eumat" returns "module ...
mga010 General Coding Help 6 2,818 Jun-23-2020, 06:18 PM
    Thread: C-API for Python 3 - Get String from Object
Post: RE: C-API for Python 3 - Get String from Object

(Jun-22-2020, 04:12 PM)Gribouillis Wrote: With your code, the object t will not be a bytes object but a str object, that's why PyBytes_AsString fails and return NULL. You could replace pystart with ...
mga010 General Coding Help 2 3,603 Jun-23-2020, 04:32 PM
    Thread: C-API for Python 3 - Get String from Object
Post: C-API for Python 3 - Get String from Object

I try to read a string from a python object in the C-API but seem to be incapable to find the documentation on how to do that properly in Python 3. The problem could be Unicode or any other issue I am...
mga010 General Coding Help 2 3,603 Jun-22-2020, 03:07 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020