Trying to Understand Python - Page 1
Forum section: electronics / general

author: admiralk
author_rank: Regular Contributor
timestamp: June 11, 2022, 11:48:43 pm
content: I have been getting into machine learning lately and ell the examples or descriptions use python. The one intro I am trying to use has a line in the code that simply will not work for me, also I am unable to figure out why.I get the same error writing the entire code, minimalist as it is, but I have narrowed it down to this.Code:def sigmoid(z):return 1.0/(1.0+np.exp(-z))def feedforward(self, a):for b, w in zip(self.biases, self.weights):a = sigmoid(np.dot(w, a)+b)return aThe error is undefined name 'sigmoid'. I was able to figure out other syntax errors, but this one has me stumped. There are other uses of the function that do not throw an error. and I only moved the function to where it is to disprove a linear problem.If anyone has an idea what I am missing, it would be greatly appreciated.

author: ataradov
author_rank: Super Contributor
timestamp: June 12, 2022, 12:01:27 am
content: Is sigmoid() defined inside the class? Alignment seems to suggest so, but then it should be called as self.sigmoid() and should take "self" as a first argument.Can you attach a complete minimal example as a text file? It would be much easier to figure out, there is not enough context here.

author: admiralk
author_rank: Regular Contributor
timestamp: June 12, 2022, 01:03:58 am
content: Yes, it is all one class. Adding self did remove the error, but I still do not understand why.The code comes from this series of videosThe full code is herehttps://github.com/stephencwelch/Neural-Networks-DemystifiedThe particular file isCode:"""network.py~~~~~~~~~~A module to implement the stochastic gradient descent learningalgorithm for a feedforward neural network. Gradients are calculatedusing backpropagation. Note that I have focused on making the codesimple, easily readable, and easily modifiable. It is not optimized,and omits many desirable features."""#### Libraries# Standard libraryimport random# Third-party librariesimport numpy as npclass Network(object):def __init__(self, sizes):"""The list ``sizes`` contains the number of neurons in therespective layers of the network. For example, if the listwas [2, 3, 1] then it would be a three-layer network, with thefirst layer containing 2 neurons, the second layer 3 neurons,and the third layer 1 neuron. The biases and weights for thenetwork are initialized randomly, using a Gaussiandistribution with mean 0, and variance 1. Note that the firstlayer is assumed to be an input layer, and by convention wewon't set any biases for those neurons, since biases are onlyever used in computing the outputs from later layers."""self.num_layers = len(sizes)self.sizes = sizesself.biases = [np.random.randn(y, 1) for y in sizes[1:]]self.weights = [np.random.randn(y, x)for x, y in zip(sizes[:-1], sizes[1:])]def feedforward(self, a):"""Return the output of the network if ``a`` is input."""for b, w in zip(self.biases, self.weights):a = sigmoid(np.dot(w, a)+b)return adef SGD(self, training_data, epochs, mini_batch_size, eta,test_data=None):"""Train the neural network using mini-batch stochasticgradient descent. The ``training_data`` is a list of tuples``(x, y)`` representing the training inputs and the desiredoutputs. The other non-optional parameters areself-explanatory. If ``test_data`` is provided then thenetwork will be evaluated against the test data after eachepoch, and partial progress printed out. This is useful fortracking progress, but slows things down substantially."""if test_data: n_test = len(test_data)n = len(training_data)for j in xrange(epochs):random.shuffle(training_data)mini_batches = [training_data[k:k+mini_batch_size]for k in xrange(0, n, mini_batch_size)]for mini_batch in mini_batches:self.update_mini_batch(mini_batch, eta)if test_data:print "Epoch {0}: {1} / {2}".format(j, self.evaluate(test_data), n_test)else:print "Epoch {0} complete".format(j)def update_mini_batch(self, mini_batch, eta):"""Update the network's weights and biases by applyinggradient descent using backpropagation to a single mini batch.The ``mini_batch`` is a list of tuples ``(x, y)``, and ``eta``is the learning rate."""nabla_b = [np.zeros(b.shape) for b in self.biases]nabla_w = [np.zeros(w.shape) for w in self.weights]for x, y in mini_batch:delta_nabla_b, delta_nabla_w = self.backprop(x, y)nabla_b = [nb+dnb for nb, dnb in zip(nabla_b, delta_nabla_b)]nabla_w = [nw+dnw for nw, dnw in zip(nabla_w, delta_nabla_w)]self.weights = [w-(eta/len(mini_batch))*nwfor w, nw in zip(self.weights, nabla_w)]self.biases = [b-(eta/len(mini_batch))*nbfor b, nb in zip(self.biases, nabla_b)]def backprop(self, x, y):"""Return a tuple ``(nabla_b, nabla_w)`` representing thegradient for the cost function C_x. ``nabla_b`` and``nabla_w`` are layer-by-layer lists of numpy arrays, similarto ``self.biases`` and ``self.weights``."""nabla_b = [np.zeros(b.shape) for b in self.biases]nabla_w = [np.zeros(w.shape) for w in self.weights]# feedforwardactivation = xactivations =  # list to store all the activations, layer by layerzs = [] # list to store all the z vectors, layer by layerfor b, w in zip(self.biases, self.weights):z = np.dot(w, activation)+bzs.append(z)activation = sigmoid(z)activations.append(activation)# backward passdelta = self.cost_derivative(activations[-1], y) * \sigmoid_prime(zs[-1])nabla_b[-1] = deltanabla_w[-1] = np.dot(delta, activations[-2].transpose())# Note that the variable l in the loop below is used a little# differently to the notation in Chapter 2 of the book. Here,# l = 1 means the last layer of neurons, l = 2 is the# second-last layer, and so on. It's a renumbering of the# scheme in the book, used here to take advantage of the fact# that Python can use negative indices in lists.for l in xrange(2, self.num_layers):z = zs[-l]sp = sigmoid_prime(z)delta = np.dot(self.weights[-l+1].transpose(), delta) * spnabla_b[-l] = deltanabla_w[-l] = np.dot(delta, activations[-l-1].transpose())return (nabla_b, nabla_w)def evaluate(self, test_data):"""Return the number of test inputs for which the neuralnetwork outputs the correct result. Note that the neuralnetwork's output is assumed to be the index of whicheverneuron in the final layer has the highest activation."""test_results = [(np.argmax(self.feedforward(x)), y)for (x, y) in test_data]return sum(int(x == y) for (x, y) in test_results)def cost_derivative(self, output_activations, y):"""Return the vector of partial derivatives \partial C_x /\partial a for the output activations."""return (output_activations-y)#### Miscellaneous functionsdef sigmoid(z):"""The sigmoid function."""return 1.0/(1.0+np.exp(-z))def sigmoid_prime(z):"""Derivative of the sigmoid function."""return sigmoid(z)*(1-sigmoid(z))I do not get errors on the other calls to sigmoid(), although that might just be because Python stops looking after the first one?I will not get into why VSCode does not work but spider works fine since I really do not care, as long as I can get something to work.Thanks for looking ataradov

author: ataradov
author_rank: Super Contributor
timestamp: June 12, 2022, 01:06:46 am
content: This code has sigmoid() outside of the class as a helper function. Either is fine, but the semantics are different and the call differs accordingly.

author: admiralk
author_rank: Regular Contributor
timestamp: June 12, 2022, 01:16:06 am
content: OK, I see that now. Never worked with Python before and I find it confusing. I assume I need to add self to sigmoid_prime() as well to get it to work, or get rid of the white space?Hopefully I can get things working this time. Do not care if it works right, just that it does something at this point.Thanks.

author: ataradov
author_rank: Super Contributor
timestamp: June 12, 2022, 01:22:21 am
content: Python has significant white spaces, alignment matters. What you need to do depends on your goal. If you want those functions inside the class, they need to take self as a first argument, if you are fine with them being outside, you don't need to do anything special for the calls, but then they need to be located outside of the class.

author: admiralk
author_rank: Regular Contributor
timestamp: June 12, 2022, 03:14:13 am
content: I am just trying to understand the algorithms. I was able to figure out the other errors I made on my own, but this one eluded me, I am used to C/C++. White spaces are for clarity in there and not part of the syntax.It is also frustrating that variables do not need types and even more so that every example I have seen so far uses horrendous names for them.

author: IanB
author_rank: Super Contributor
timestamp: June 12, 2022, 03:22:35 am
content: It's really important to recognize that whitespace (indentation) is significant in Python, and takes the place of braces {} in languages like C.Also Python is a scripting (rapid development, prototyping) language, and the lack of enforced types is a part of that.

author: ataradov
author_rank: Super Contributor
timestamp: June 12, 2022, 03:26:28 am
content: And in recent versions there is optional strong typing, but it kind of defeats the purpose.But also, most of those basic NN algorithms are trivial matrix operations, you should be able to just implement them in C++ if you are more familiar with it.

author: admiralk
author_rank: Regular Contributor
timestamp: June 12, 2022, 04:11:29 am
content: That is the idea, but I need to understand the algorithm first. Every AI tutorial/example I have found uses Python. It has been a while, but I could probably dig up the C++ matrix operations from school work. Pretty basic unless you are going for ultimate optimization. I am just trying to figure out how it al works.

author: jeremy
author_rank: Super Contributor
timestamp: June 12, 2022, 07:57:12 am
content: Depending on what you preferences are, you might be better off using an IDE like PyCharm Community. It has some static analysis tools which would have given you a warning that "self" was missing. I think maybe VSCode can also do a similar thing too? I just tried your code now in PyCharm and it automatically added the self while I was typing, but even when I manually deleted it there were warnings like "Usually first parameter to a method is named self".I think the terrible variable names is just a bad research-ism habit which has escaped from academia now that machine learning has become a lot more popular. Everyone can name variables poorly, but if you've ever tried to understand a complex MATLAB library written by an academic, you'll know what I mean.I think the main issue is that in the mathematical notation that comes from the research articles everything is i, j, k, n, phi, etc but there are other indicators like fonts, greek symbols, subscript/superscript etc that get lost when converting to ASCII. It gets worse when people do things like represent lowercase "eta" (the greek letter) as "n", rather than calling the variable "efficiency" or something like that...

author: tszaboo
author_rank: Super Contributor
timestamp: June 12, 2022, 08:43:24 am
content: Quote from: admiralk on June 12, 2022, 04:11:29 amIt just provides a function, which returns a value between 0 and 1, non linear, based on the input value.It has been shown that the function actually doesn't really matter, because all that matters is that it is not linear. The learning and the coefficients of each neuron takes care of the rest.

author: janoc
author_rank: Super Contributor
timestamp: June 12, 2022, 11:21:55 am
content: Quote from: ataradov on June 12, 2022, 12:01:27 amNot necessarily - adding "self" makes it into a member function (method). Without self it is a so called "static" function and needs to be called as "Classname.sigmoid(...)" where Classname is the name of the class it was defined in. This is useful for scoping (polluting the global/module namespace is bad style) and typically used for various factory functions or utilities that don't require an object instance to work.There is a third option, a so called class method - then the first argument isn't "self" (instance/object) but the class itself it was called on. That has sometimes uses too.However, in modern Python one is supposed to annotate both static and class methods using appropriate decorators - @classmethod and @staticmethod to make this explicit. It will work without but it is a bad style - and a class method can't be really declared otherwise. Python's "self" is not a special keyword, only a conventional name for the first argument - so without the decorator Python wouldn't know if a normal method or a class method was intended.Quote from: ataradov on June 12, 2022, 03:26:28 amOne isn't required to use it. The entire point of it is that one can catch many errors that would otherwise only manifest themselves at runtime by throwing exceptions because some unexpected type/object has been passed into a function, or perhaps the object has the right type but someone forgot to update some part of the code after refactoring - and now some attribute is missing/has been renamed, resulting in AttributeError exceptions.Unless you have a 100% test coverage (and even if you do, it doesn't ensure that one is actually testing meaningful things) this is bound to happen to you sooner or later, especially for various corner cases on code paths that don't get exercised often. This is a major pain with dynamic languages like Python or Javascript and that's why in both cases the optional types are available (Typescript in the case of Javascript). It is one more tool to make production Python code more robust without sacrificing flexibility of the language.There are also some other applications of it - e.g. the IDEs use the typing information where available to both lint your code checking for such mistakes and also to provide better suggestions/completions. That's what VSCode does, for example - Microsoft's Pylance plugin is all based around static analysis and typing. If the typing information isn't available, one gets only very basic functionality from the IDE. Also JITs and the language virtual machines can use the typing info for optimizations (Python doesn't do that yet).Adding optional strong typing to a dynamically typed language for these reasons is nothing new - e.g. Common Lisp had optional types for decades. There it helps both with generating diagnostics and also with compiler optimizations.

author: admiralk
author_rank: Regular Contributor
timestamp: June 12, 2022, 06:55:48 pm
content: Thanks for all the tips.I finally got it all working, after fixing several typos. I am still pretty shaky on how Python works. I would like to be able to use VSCode, but it does not seem to be able to find numpy for some reason. If I could find a tutorial on Python for someone that already knows how to program it would be helpful. It is just too painful going through all the basics in what I have found so far, just to try and pick out what is specific to Python.I did not post the correct source for this though. What I am actually working on now ishttp://neuralnetworksanddeeplearning.com/.I want to be able to use data from these sensorshttps://www.st.com/en/imaging-and-photonics-solutions/vl53l5cx.htmlinitially, and eventually some sort of camera.

author: IanB
author_rank: Super Contributor
timestamp: June 12, 2022, 07:39:17 pm
content: Quote from: admiralk on June 12, 2022, 06:55:48 pmA good way to use Python for ML and other things is to use Jupyter Notebook, it is very interactive and shows you plots and graphs interleaved with your input.I haven't really used Python with VSCode, but it is not Code that has to find a package like numpy. Numpy is installed as a Python extension using pip, and then an IDE like Code just uses the version of Python you tell it to. If numpy is not recognized, you are probably not pointing Code at the right version of Python on your computer.A good hint for using Python for ML and visualization is to use the Anaconda distribution. Anaconda comes with all the important numerical and graphing packages included out of the box, so it simplifies things tremendously.

author: IanB
author_rank: Super Contributor
timestamp: June 12, 2022, 07:43:06 pm
content: Quote from: admiralk on June 12, 2022, 06:55:48 pmJust go tohttps://www.coursera.org/and search for Python, machine learning, or anything that interests you. There are many free courses, and you can usually view (or "audit") paid courses for free, so you can access a lot of learning without buying a paid subscription.

author: admiralk
author_rank: Regular Contributor
timestamp: June 12, 2022, 11:26:49 pm
content: Quote from: IanB on June 12, 2022, 07:39:17 pmI think you are right about VSCode not seeing the right version. It is supposed to be 2.7.15, the Anaconda version, and that is what it says in the status bar, but checking the version tells me 2.7.16, which is the version I have associated with GNAT studio. I am getting used to Spyder though, so I probably will not worry about it too much.I dislike cloud/web applications, so aside from taking a look at notebooks I pretty much ignored it.

author: jeremy
author_rank: Super Contributor
timestamp: June 12, 2022, 11:29:42 pm
content: You probably should change over to python 3, python2.7 is very obsolete and you’ll probably find that a lot of tutorials and libraries simply don’t work with it.

author: IanB
author_rank: Super Contributor
timestamp: June 12, 2022, 11:37:49 pm
content: Quote from: admiralk on June 12, 2022, 11:26:49 pmJupyter is not a cloud/web app, it installs and runs locally on your computer. It just uses a browser window for its UI.Quote from: jeremy on June 12, 2022, 11:29:42 pmThis. Python 3.10 is the current shipping version.

author: admiralk
author_rank: Regular Contributor
timestamp: June 12, 2022, 11:49:30 pm
content: That could be, but all the ML examples I have seen so far use 2.7, so I would think using 3.x would be more problematic. Also since I am on a win7 machine, the latest versions simply will not work to begin with. I have plenty of VMs; Mac, Linux, and windows from DOS to 10., but I prefer to work natively when I can.@IanB I should take another look in that case. Maybe I misunderstood what I was looking at?

author: janoc
author_rank: Super Contributor
timestamp: June 13, 2022, 03:47:16 pm
content: Quote from: admiralk on June 12, 2022, 11:49:30 pmThen time to find more up to date/recent examples. Python 2 has been EOL for more than 10 years now.Pretty much no current versions of major libraries support Python 2.x anymore. That includes stuff like Pytorch, Numpy, Scipy, Tensorflow ...So you are wasting your time building on obsolete tools that will give you no end of grief when you will need to update something - and everything breaks because it isn't working in Python 2 anymore.Windows 7 is supported up to Python 3.9 so you should have no issues with finding a more recent toolset.Really, don't write new Python 2 code. You are setting yourself up for a ton of completely avoidable pain.

author: admiralk
author_rank: Regular Contributor
timestamp: June 13, 2022, 06:31:36 pm
content: Well, I am not planning on writing very much new Python code. I will be using C/C++ when I start writing for myself. I just need to understand the Python so I can understand, and work thought, the examples I find. Which reminds me, I need to look up tuples as I do not think they are what I am thinking they are.

author: janoc
author_rank: Super Contributor
timestamp: June 13, 2022, 09:19:09 pm
content: Quote from: admiralk on June 13, 2022, 06:31:36 pmThen for your own sake,do not learn Python 2!Python 3 is sufficiently different from Python 2 that you will struggle trying to figure out why things aren't working. I mean, it is still Python but it is like learning C++98 today because you have found some tutorial for it - all the while everyone else uses C++11 as a minimum and a lot of new code simply expects at least C++17 or newer. And then you are stumped seeing black magic like lambdas and people talk about "universal" references for whatever reason.

author: admiralk
author_rank: Regular Contributor
timestamp: June 14, 2022, 10:01:39 pm
content: Thanks for the warning, but as far as I understand it Python 2 was never the same as Python 3. 3 was not just an updated version like C++98 vs C++17. Therefore I never expected code written in one to work flawlessly with the other, anymore than I would expect the same from code written in any two different languages, regardless of the similarities.I mentioned C++ out of hand, but I have been looking to give Ada a try. I would certainly prefer learning modern Ada over modern Python.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 14, 2022, 10:28:31 pm
content: Quote from: janoc on June 13, 2022, 09:19:09 pm

author: janoc
author_rank: Super Contributor
timestamp: June 15, 2022, 11:44:27 am
content: Quote from: admiralk on June 14, 2022, 10:01:39 pmWell, if you expect C++17 code to compile with C++98 compiler, good luck. That's not what I would consider as "just an updated version". Also C++17 has removed and deprecated quite a few things that worked in C++98 - auto_ptr, functional, random_shuffle() among others. So even the backwards compatibility isn't 100%.That's the same sort of difference we are talking about with Python 2 vs Python 3.

author: janoc
author_rank: Super Contributor
timestamp: June 15, 2022, 11:47:30 am
content: Quote from: SiliconWizard on June 14, 2022, 10:28:31 pmGiven that Python is used for a lot of infrastructure and tooling as a scripting language (code build systems, sysadmin stuff, etc.) and it is the most popular programming language at the moment (no doubt driven by the machine learning and scientific computing where it has practically completely eliminated Matlab), ignoring it is at your own peril even if you don't write applications in it.

author: admiralk
author_rank: Regular Contributor
timestamp: June 15, 2022, 11:10:57 pm
content: Quote from: janoc on June 15, 2022, 11:44:27 amExactly.There might come a time when I need some updated functionality, but until then, there is no benefit to updating for the sake of having the latest and greatest...anything.

author: janoc
author_rank: Super Contributor
timestamp: June 16, 2022, 10:44:26 am
content: Quote from: admiralk on June 15, 2022, 11:10:57 pmSorry but that's complete BS. This is not about some fad or 'latest and greatest' but that you are literally setting up yourself for a failure because you are using obsolete andlong unsupportedtooling. GCC will still compile C++98 code with the right switches. Python 2 codewill not runin Python 3 and Python 3 code (i.e. all current libraries and tools)will not workin Python 2.Given that you literally don't know much about the language, are asking for advice - and then promptly decide to ignore it, good luck

author: admiralk
author_rank: Regular Contributor
timestamp: June 16, 2022, 10:35:23 pm
content: Quote from: janoc on June 16, 2022, 10:44:26 amNo, I was asking about a specific problem, where it turned out I was confused by the format and did not notice the function was outside the class. Since what I am working on uses Python 2, trying to use Python 3 would only cause troubles, as you repeatedly state. In fact, I would probably be having even more trouble. So, actually I am following your advice, just not the way you keep insisting on. Oh wait, I should find newer examples, right? Well, this is what I started with and what I intend to finish, before starting another one. If it makes you feel better, the next one I have planned will use Python 3, If what ever I do after that goes back to Python 2, then I will do the same. Once I get a good enough understanding of all this, I might never use Python again.The right tool for the job is not necessarily the shiniest one.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 17, 2022, 04:15:19 pm
content: Quote from: admiralk on June 16, 2022, 10:35:23 pmIt's not that, using the latest and newest, at all. It's thatPython 2 is no longer officially supported; it is EOL'd.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 17, 2022, 06:04:06 pm
content: Quote from: admiralk on June 16, 2022, 10:35:23 pmSure, but while I may agree with you if you had to deal with a large code base written in Python 2 and porting it to Python 3 would be a major risk, if you're just starting with Python and are dealing with some code example, that's a completely wrong approach IMHO. That would be a bit like trying to learn C in 2022 using the original C and the first edition of the K&R book and complaining this is all confusing and that all compilers you've tried so far keep giving you warnings and errors.

author: admiralk
author_rank: Regular Contributor
timestamp: June 18, 2022, 01:33:13 am
content: Quote from: SiliconWizard on June 17, 2022, 06:04:06 pmlol, pip might be worse than you guys. It is also nice that someone actually understands where I am coming from. I did start with Python 3, the latest Anaconda version. It did not work on my ancient machine. Went back a few versions, and still it did not work. I figured it must be an incompatibility problem between 2 and 3. Went farther back to 2.7 and still had problems, which is when I finally decided to ask here.

author: retiredfeline
author_rank: Frequent Contributor
timestamp: June 18, 2022, 09:02:42 am
content: Are you one of those people clinging on to an ancient OS like XP?

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 18, 2022, 04:36:20 pm
content: Quote from: admiralk on June 18, 2022, 01:33:13 amWell, Python 3 works on any version of Linux you have a compiler for, including for machines over two decades old, so it's not that.It sounds more like"I did not find Python 3binariesfor my ancient OS version"instead. Just because upstream does not providesuitable binaries as a download, does not mean Python 3 is not compatible; it only means there are not enough users/demand for upstream to bother building such binaries.Indeed, I would suggest you check theWinPythonbinaries, especially WinPython64-3.10.4 (and the downloads that include PyQt5, if you are interested in Qt 5 user interfaces in Python).

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 18, 2022, 06:22:04 pm
content: Or use a language that is more widely supported on more OSs without having to go through hoops.Python 3 is not supported on Windows 7 and older anymore, for instance, starting with version 3.9 IIRC (somewhere from 3.8 to 3.10, not quite sure), and I'm sure it's not supported on many other "older" OSs anymore either.The problem with Python is that you only have ONE implementation AFAIK. That's interestingly (but understandably) the case for most languages that are not standardized. So it's the same for Rust, Go (AFAIK), etc. That means that you are stuck with what ONE team decides, and that's it. I don't like that at all.Sure, you can always try building Python yourself if binaries are not available for your particular environment, but there's absolutely no guarantee that it will work or that it will even build.MSYS2 has managed to provide Python 3 binaries, compatible with Windows 7, but that did require a fricking lot of patching. Not something for the faint of heart. (Oh and unfortunately, the MSYS2 team decided to stop supporting Win 7 sometime in 2022. Didn't happen yet, but I'm expecting sometime near the end of the year.) So beyond that point, you'll be on your own.

author: IanB
author_rank: Super Contributor
timestamp: June 18, 2022, 08:41:18 pm
content: Quote from: SiliconWizard on June 18, 2022, 06:22:04 pmIf there is only one implementation, does that not mean, by definition, that the one implementation is the standard?

author: admiralk
author_rank: Regular Contributor
timestamp: June 19, 2022, 12:22:44 am
content: Quote from: retiredfeline on June 18, 2022, 09:02:42 amNo, but mostly because when I went to 64 bit, Windows 7 was the only option. Since this post started out in an AI area, I will entertain this question. Can you tell me what Windows 10, or 11, offers that XP did not? Support for applications is a moot point since Microsoft basically killed that, not the software developers. It is not hardware support. My 20 year old machine specs out similar to any modern one, and is better than many. Security? Well now we get into the bit where the OS thinks it knows better. Granted Microsoft turns off many of its new features on final release, It does not necessarily remove them. They may just sit dormant until the next release.IF you think current Widows OSs do not implement AI, you should probably look a little closer. Personally , I do not want an OS telling me what I should or should not do.@ SiliconWizard you make valid points. 3.7 still works and is the minimum for Tensorflow, so no problems there. I do not expect a conflict when switching between versions. I have not tried yet, so maybe I am not right?QuoteIs that even possible? I am constantly stuck in some kind of loop. At the moment I cannot get my phone to connect to the computer. It will start charging, but I cannot upload my app for testing. I have quite a few steps between that and when I get to anything discussed in this thread.

author: ve7xen
author_rank: Super Contributor
timestamp: June 20, 2022, 07:19:04 pm
content: QuoteThere are at least a couple implementations. PyPy (self-hosted JIT) and IronPython (.NET CLR) come to mind, but there are / have been a few others like Jython (which I think is defunct).The language standard is here:https://docs.python.org/3/reference/. I am not sure it is complete enough to implement the language without also consulting CPython, but I believe it is close.QuotePython 3.8 is the last version to run on Windows 7, or 3.7 on XP. So get that, at least. You might be missing a few minor language features and some library improvements but it will be substantially similar.QuoteYou've got to be kidding. The APIs constantly move forward on all axes. Whether you deem these improvements 'worthy' or not, software developers need to track them. At some point supporting the old way either hobbles functionality unnecessarily, or is just a waste of maintenance effort. How do you propose they even set up an automated test environment for Windows 7 when it's no longer available? Microsoft no longer supports XP or 7, so neither does Python. It shouldn't be a big surprise. I really don't quite grok why people expect a 13 / 21 year old operating system to run modern code, and act all indignant about it when developers stop supporting their vintage OS. That's the consequence of wanting to run ancient software. Do you also expect a DOS 6.22 Python interpreter to be released by the Python team?Quotelolwut