I would like to compile my script into .pyo. Currently, only the modules imported are compiled into .pyc. The main script is not compiled. How do I compile the main script and the imported modules into .pyo? I prefer the optimized version because it is harder to decompile back to source.
Hi, I have a MySql database with a table which is constantly growing with real-time data coming in. I would like to write a python script which copies this growing table to another table in another MySql database in real-time. Database replication was "invented" for these cases. When established, d...
I have a MySql database with a table which is constantly growing with real-time data coming in. I would like to write a python script which copies this growing table to another table in another MySql database in real-time. Which python libraries should I use? Are there any sample code or open-source...
The time seen on my RPi is 26Sep13. How can the correct time be set and last permanently? I am worried that I need to set the time everytime after reboot. Thank you.
I am trying to implement a retriggerable multivibrator function with python on Raspberry Pi. This is how it works; - User presses a button - LED will light up for 5secs, then go off. - If user presses the button again before the 5secs expire, the on duration will be extended by another 5 secs. This ...
I have a RF device that has a transmitted power of up to 30dBm. This device has multiple antenna output connectors. When it is turned on, there is no antenna connected to some of the RF outputs. Will this lead to higher than normal radiation compared to having an antenna connected to it? At the mome...
What is the difference of running multiple python scripts and a single multi-threaded script? May I know what are the pros and cons of each approach? Right now, my preference is to run multiple separate python scripts because it is simpler.
This sounds like a basic question. I know when I connect wrong voltage into a MCU pin, it may spoil the MCU. But when I pump in very high power supply current, the device does not spoil. I just know it as a practitioner but cannot explain it. Can someone explain the theory? Thank you very much.
Lithium batteries have been in the news lately for the wrong reasons. Boeing, Samsung, Apple have all reported incidents of battery explosion. Why are lithium batteries prone to explosion?
Will it be safer to use NiMH batteries? Are they less prone to explosion compared to lithium batteries?
Will IR(infrared-red) sensors be affected by sunlight? My sensor works in the Far infrared-red range wavelength (5um-15um). Is it correct to say that the sensor works in different wavelength from sunlight, so it should not be affected?
Sorry in advance for the rant, it's a bit all over the place, but it's an interesting that seems to have got me going. To use your examples consultants, lawyers, accountants and doctors tend to specialise in specific fields. Lawyers may only work on family law, criminal law, commercial law or whate...
Sometimes, I wonder why engineers cannot be paid by the hour for their services like consultants, lawyers, accountants, even doctors. One reason I can think of is that the engineering outcome (specs) can be easily measured. So, it is hard to screw customers like some management consultants did to th...
Does this mean that all software such as Dropbox which are written in python can be reverse-engineered? How does big companies like Dropbox protect their software?
Is it possible to use python to call C/C++ functions? Do such C functions need to be specially created to be callable by python? To access hardware peripherals from python, is the right approach to write C functions to access the hardware and then make it callable by python?
One disadvantage about scripting languages is that their source code cannot be hidden. For python, can the source code be protected by distributing byte code only?
helpme, I am developing for myself. This is why I want to keep development time as short as possible. Not trying to sell for profit. I can appreciate that. So you have to ask yourself some questions: 1) What is it I actually want to make? 2) Which platforms out there support the features I need to ...
Development for Windows Mobile with Visual Studio may be easy. Who knows, nobody uses Windows Mobile? If you want a platform to develop for, mobile or otherwise, isn't it better to select one that is actually used by a lot of people? On top of that I would add that I don't want to develop for any c...
Over lunch, a mobile developer told me that the simplest development mobile platform is actually Windows, not Android or iOS. This is because of Visual Studio. What are your opinions? I am not a mobile app developer but trying to pick a platform to develop on.
I have some python scripts which I would like to start automatically after boot-up. Is there a folder in Raspbian which I can put the python scripts which I want to start after boot-up?
Anyone can suggest any way to launch a python script automatically after boot-up?
I don't know if your router/other computers will allow that. To them, you could as well be broadcasting a virus. They probably have protection against it. I just found a solution. The following 2 lines need to be run first; udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) udp_socket.se...
I read it somewhere in an interview in one of the MagPi magazine issues. Maybe I remembered incorrectly. But the fact remains that the polyfuse was removed from USB.
Safe yes, most of the time. It is things that require a UL cert that don't have one that you should be concerened about. Do a search on all the exploding iPhones in China lately. There have been vendors there selling chargers to consumers that run the mains power right to phone battery. In China th...