is there a way to read iphone messages through python? - python

I am working on a project that requires the program to take in text received via SMS. But, whenever I look on the internet, I find services like twilio, which works only through an external number. That is, one may send a text to the twilio number so that the python program may receive and process it.
For my purposes, I intend people texting me through my personal number, and python accessing the body of that text for processing. Is there any way to do this? (PS: i don't have a mac)

You might want to look into this. It’s not in python, but there having a solution in python isn’t that simple, hence not that popular

Related

Safety/Encryption for python script (bot)

I built a python script (bot) for a game and I do plan on building a GUI for it to make it more user friendly. However I wanted to add some sort of security along with it, something that would only give access to whoever I want, so maybe adding some kind of encryption key to it, I was thinking something along the lines of an encrypted key to unlock the files and with limited use(a few days for example). I am new when it comes to this specific 'security' topic, so I need help better understanding what my options are and what I can do or search for. Thank you for reading.
after days of searching and trying I figured the easiest way was to use a web API to check requests, you can use for example cryptolens web api or any other api and your encrypted file will work just fine.

Speech recognition for python, raspberry pi

This is a really big ask but I have tried for about 4 months now trying to get this to work. So, I am creating a personal assistant using a raspberry pi 3 model B and python (I know they are not the best of choices). Most of it works apart from the main feature, the speech to text (STT). I would like it to convert all spoken words to text and when you finish a sentence I would like it to enter and finish so the text can be processed as a string. Do you have any suggestions on what I could use to do this or any links to help me.
Thanks in advance.
I have completed similar project to yours recently.
If internet connection is not a problem for you, I would suggest using Wit.ai. It has nice Python API, or you could use it through HTTP API.
Your assistant would have to record speech, then send data to remote API and receive response with text as an answer.
Take into account, that STT process is quite complex, so trying to solve it with local solutions might be a bit too much to cope with for Raspberry. What's more, you would have to (probably) prepare vocabularies, etc. Using remote STT service, you don't have to do that.
If you cannot, or do not want to use remote service, you can always try CMU Sphinx. But for that, you need somebody else to help you with it, as I have no experience using it whatsoever.

Invoke CTRL+V to an open window

I have something in my clipboard, and I'd like to run a python script that invokes CTRL+V as if it was pressed on the keyboard, and pastes the clipboard's content to the current focused window (say chrome). Any idea how to do that?
You have an X-Y problem.
What you want to accomplish is programmatically take data from one program (where you hit cntrl-V) and place it into another arbitrary program (chrome).
There are two ways to do that:
First
You can either set the programs up to have a data exchange mechanism such as a system pipe, or a network connection. This requires some API for data exchange to be already included in the program or access to the source so you might add one. There are very specific channels for cross program data exchange and you wont do well to try to circumvent them. Program A cant just say
get_program_b().get_text_box().add(clip_board);
That would be a violation of Process Isolaton and an OS like windows is written expressly to make it impossible. Some programs are designed to take input from other programs.
popen.open('mysql -e "ISNERT INTO table (a) VALUES ('4')")
Chrome is not one of those programs, chrome avoids allowing programs from doing this because it would be a target for programs to do things like, get the saved password or credit card data out of chrome. Or use save password to login to someone account and buy things in someone elses name.
Second
You could try to spoof user input and input the data exactly like a user would so chrome wont know the difference. But spoofing a user is hard to do and intentionally so because it prevents malicious scripts from taking control of a computer and doing bad things. The makers of windows are accutely aware that spoofing input is a method to circumvent allowed data exchange channels. So the makers of windows made it hard to do. You need to have access to a lot of system assets that most programs wont be given. At a minimum a program has to run as admin on windows to accomplish this, then there are libs that will let you do it. Even then Im willing to bet there are easier way to get the job done. On a machine where you have access to anything and everything it is possible. If you don't have admin access, it should be downright impossible without knowing some unpatched exploit in the system.
Therefore
What you are trying to do goes against what the computer was designed to let you do. If we had more information on what you want to accomplish maybe some of the wonderful people here could help. Getting to the end result you want shouldnt be that hard. But you way of doing it is like trying to run across the ocean, when you just need a boat. As it is my answer is -- dont do it, that's not how windows was designed to work.

python script output to webpage

I wrote a python script that reads in text from a file and writes a text file of definitions. I want to somehow integrate my program with a webpage for the whole world to see.
I want to be able to retrieve input text from one text box, have the python script process it, then display the output in the other text box.
I have done quite a bit of research thus far but I am still unsure of the best way to go about doing this. I tried using google's app engine but encountered too many problems, for example the app engine runtime environment uses python 2.5.2, I wrote my program using 3.1.2. Other than that I just felt that I was beginning to waste my time trying to port my program over.
I'm starting to think that javascript is the way to go or maybe pyjamas. I was also wondering if it would be possible to just have the python program constantly running on the server and to perform a system call.
I posses very little knowledge when it comes to web development. I appreciate any advice.
You could use the cgi module and create a CGI script, if your server supports it.
It's a much bigger question, involving:
Where are you going to host the site,
How slow is the script (can it execute in a few seconds or not),
Does it need access data from files or a database,
How complex is it,
etc.
I would suggest you read about Django:
http://docs.djangoproject.com/en/1.2/
That is probably the easiest way to set up a simple web site, but is also very powerful if you want to do something more in the future (related to this project or not).
However, since your script is Python 3 only, you don't have too many options, see this question:
https://stackoverflow.com/questions/373945/what-web-development-frameworks-support-python-3
I suppose, if not too hard, it is worth thinking about converting it to Python 2.7.
If that is an option, then you might very well go down to Python 2.5 and use Google App Engine. It gives you many things for free and you really don't need to worry about many things that you would if you were to set up your server. It includes a modified (better to say, shrunk down) version of Django 1.1. When you say you are wasting your time porting from 3.x to 2.5, I guess you were not counting the time that you will waste setting all other things up.

I want to make a temporary answerphone which records MP3s

An artistic project will encourage users to ring a number and leave a voice-mail on an automated service. These voice-mails will be collected and edited into a half-hour radio show.
I want to make a temporary system (with as little as possible programming) which will:
Allow me to establish a public telephone number (preferably in the UK)
Allow members of the public to call in and receive a short pre-recorded message
Leave a message of their own after the beep.
At the end of the project I'd like to be able to download and convert the recorded audio into a format that I can edit with a free audio-editor.
I do not mind paying to use a service if it means I can get away with doing less programming work. Also it's got to be reliable because once recorded it will be impossible to re-record the audio clips. Once set up the whole thing will run for at most 2 weeks.
I'm a python programmer with some basic familiarity with VOIP, however I'd prefer not to set up a big complex system like Asterisk since I do not ever intend to use the system again once the project is over. Whatever I do has to be really simple and disposable. Also I have access to Linux and FreeBSD systems (no Windows, sorry).
Thanks!
I use twilio, very easy, very fun.
Skype has a voicemail feature which sounds perfect for this and I suppose you would need a SkypeIn number as well
You may want to check out asterisk. I don't think it will become any easier than using an existing system.
Maybe you can find someone in the asterisk community to help set up such a system.
Take a look at Sipgate.co.uk, they provide a free UK dial in number and free incoming calls. Not so relavant for you but they also have a python api.
They are a SIP provider and there are many libraries (e.g. http://trac.pjsip.org/repos/wiki/Python_SIP_Tutorial ) for sip in python - so you could set up a python application to login to your sipgate account, pick up and incoming calls and dump the sound to a wav/mp3 whatever.

Categories