I have built two very small pythons (pymite and tinypy) where one is not maintained anymore. The following summarises the experience.
pymite
I found the most recent version : https://github.com/dwhall/p14p
It is a Python for microcontroller s. I don't have one, so I will build it for my Windows 10, with an Ubuntu installed from Microsoft store.
I downloaded the archive as a zip file, unzip...
User Profile
Collapse
-
Trying out two small Pythons (pymite and tinypy)
-
Here you probably should have a peak at something I wrote about pointers (http://bytes.com/topic/c/answers/956...16-bit-pointer).
You start by sending a pointer s into the method func. Try to write printf("%d\n",s ); What is the output? Probably a weird value, because that is the address to the pointer (made by the compiler). Now, what you do, it to add 1 to the pointer value,... -
Pointers, it seems to be surrounded with a certain mystique.
First, a pointer is something that points to the memory in your computer. The memory is an array.
for instance;
int a[] = {1,2,3,4,5};
An array right, this array is placed somewhere in memory.
Code:void main(){ int a[] = {1,2,3,4,5}; printf("%d\n",a); }
Leave a comment:
-
Ok, let me get this right?
This is your claim. You have a graph. You have two point, a start point and an end end point. You run Djikstras shortest path algorithm, so you find one the shortest path between the start and end point. Let's call this path A.
Then, you insert another node into the graph, and tell us that A is no longer the shortest path?
Have I understood the claim right? Then it is a bit unfair...Leave a comment:
-
Does a MINT-like OS run on for instance the Atari Falcon? In that case, you could run Python on an Atari Falcon, although you would not experience the "Atari feeling".
I have been planning to try to run Python on an even "worse" device than an Amiga. For instance, could something like Pymite be compiled to run on an old device with very limited memory?Leave a comment:
-
How to Run Python on the Commodore Amiga
20 years ago, I was using a commodore Amiga. Last night I asked myself; could Python be run on such a computer?
[IMGNOTHUMB]http://bytes.com/attachment.php? attachmentid=71 14[/IMGNOTHUMB]
I browsed python.org, and found the first relase of a Python for the Amiga to be Python 1.4.
http://www.python.org/download/releases/
When I look at:
http://www.python.org/download/releases/binarie... -
-
Two ways to run Python programs from C#
Some time ago we created an example of how you could use Python from C, both as a separate process and how you
could embed it and run it as part of your C program. Then we realised; perhaps people don't write C programs anymore,so we made the same example in Java. After looking at the bytes.com forum, we started to suspect that perhaps people use C# instead of Java and C.
So here we close the loop and present a C# version!...Last edited by kudos; Aug 4 '13, 11:18 PM. Reason: make the title consistent with the two other posts -
-
Three ways to run Python programs from Java
A week ago, I presented http://bytes.com/topic/python/insigh...hon-together-c. Since then, I realized that perhaps people don't program that much in C. Perhaps people write programs in Java!
Here I present three different options running Python programs from Java; first using the (old) Runtime class, then the ProcessBuilder class and finally embedding Python code in Java, with Jython (a Python... -
(I am not close to my python interpreter, so I don't get to test it....)
But isn't orange, 255,160,0 i RGB colors? I assume 40 tint, means 40% orange, so what would happen if you added the following to each pixel:
R = (R + (255*0.4))%255
G = (G + (160*0.4))%255
B = (B + (0*0.4))%255
Would that give you a orange tint?Leave a comment:
-
Three ways to run Python programs from C
One question, that often comes up is: How to call Python from my C program? There are numerous ways, so let us review three of them.
System Approach
We could call Python from C program by using the system function, which basically means, we do need have an already written python program, or you would need to make a C program write a python program to disk. Here is a quick example:
Code:#include <stdio.h>
-
Encrypting your mails using Python
I read somewhere that other people read your mail. People that are using gmail reports that that they seems to get ads related to their mails, so perhaps Google reads it! After reading this, panic and paranoia strikes, and you wonder, what could I do about this?
What could we do in Python? First I want to add a message, then I want to encrypt it, send it with gmail, and then I would like to be able to decrypt it afterwards.
... -
How would this work?
Code:import winsound winsound.Beep(3000,2000)
Leave a comment:
-
Have you had a look at the select function? (Which are found in most operating systems?)Leave a comment:
-
Check out Sculpt, which is mentioned in my last article : http://bytes.com/topic/python/insigh...terpreter-logoLeave a comment:
-
Trying out sculpt, an online python interpreter with Logo
Yesterday, I checked out sculpt (http://www.skulpt.org/) which turned out to be an online python interpreter written (or compiled?) to JavaScript. There are other examples, but the way sculpt differs, is that it gives the programmer access to a html5 canvas throught pythons Logo interface.
Does python really have a logo interface? Last time I touched this programming language was in middle school almost 25 years ago!
Some... -
Python based artificial intelligence for a flash game
"dogfight 2" is a flash based biplane game at rock solid arcade.
http://www.rocksolidarcade.com/games/dogfight2/
Wouldn't it be cool to make a python program, an Artificial intelligence (AI), that could play the dogfight game for us?
Aware that making an efficient AI for playing such a game is a very difficult task, I settle for creating a simple framework that starts the game and looping the... -
answer
112?
if I convert the numbers to base 5, then I would get
1(5) = 1(10)
2(5) = 2(10)
4(5) = 4(10)
13(5) = 8(10)
31(5) = 16(10)
so, 32(10) = 112(5)..
just a guess...
-kudosLeave a comment:
-
There is some unclearities here, however I guess the way to go would be the following:
Code:filec = {} for f in file: key ="" for r in range(3): key+=f[r] if(filec.has_key[key]): filec[key]+=f+"\n" else: filec[key]=f+"\n" for k in filec.keys(): f = open(k,"w") f.write(filec[k]) f.close()
Leave a comment:
No activity results to display
Show More
Leave a comment: