Socket programming for mobile phones in Python

I've written code for communication between my phone and comp thru TCP sockets. When I type out the code line by line in the interactive console it works fine. However, when i try running the script directly through filebrowser.py it just wont work. I'm using Nokia N95. Is there anyway I can run this script directly without using filebrowser.py?


Asked by: Edward282 | Posted: 01-10-2021






Answer 1

Have you read Hack a Mobile Phone with Linux and Python? It is rather old, but maybe you find it helpful.

Answered by: Elian624 | Posted: 02-11-2021



Answer 2

If the code is working in the interactive interpreter when typed, but not when run directly then I would suggest seeing if your code has reached a deadlock on the socket, for example both ends are waiting for data from the other. When typing into the interactive interpreter there is a longer delay between the execution of each line on code.

Answered by: Ted759 | Posted: 02-11-2021



Answer 3

Well, it doesn't appear to be a deadlock situation. It throws an error saying remote server refused connection. However, like I said before, if i type the very same code into the interactive interpreter it works just fine. I'm wondering if the error is because the script is run through filebrowser.py?

Answered by: Walter311 | Posted: 02-11-2021



Answer 4

Don't you have the "Run script" menu in your interactive Python shell?

Answered by: Freddie403 | Posted: 02-11-2021



Similar questions

Socket programming in Python -- actual remote port

I've been doing a bit of network programming these days in Python and would like to confirm the flow I think happens between the client and the server: The servers listens to a given advertised port (9999) The client connects to the server by creating a new socket (e.g. 1111) The servers accepts the client request and automatically spawns a new socket (????) which would now handle the commun...


Python Socket Programming

I am developing a testbed for cloud computing environment. I want to establish multiple client connection to a server. What I want is that, server first of all send a data to all the clients specifying sending_interval and then all the clients will keep on sending their data with a time gap of that time_interval (as specified by the server). Please help me out, how can I do the same using python socket program. (i.e. I wan...


Send image using socket programming Python

I am trying to send an image file using socket programming in python. I am able to send a text file. But I have been trying to send an image file, by opening it and reading the contents of the image file in a string and then sending the string and receiving it on the client side and then writing it to a file with the same name in a different directory, but I am unable to open the file. Also I am posting my code below, the ...


socket programming in python doubts

i am having trouble and a lot of questions about socket programming attached code below ( all parts have been taken from the and written together) i am trying to send mouse data to the client ,howver getting the error: Traceback (most recent call last): File "srvr.py", line 29, in <module> serv.sendall(status) File "/usr/lib/python2.7/socket.py", line 224, in meth return getattr(self._sock...


Raw Socket Programming UDP Python

How can I add custom fields like IP and UDP headers in python in the SOCK_RAW format?I want to have a custom field in the packet and use that field in computation.


Socket Programming with python

Ok, so I'm using python to learn socket programming. I'll move on to c in due time. I thought that I would write a silly game to learn sockets with; feel free to use the source code yourself (.bmp files are 50x50 pixel images that I made in gimp). The server does not work at this point. (I'm pretty sure that it's hanging on the "c, addr = s.accept()") I think a way to handle this is by using two threads...


Socket error - with simple socket programming using python

There is a server process listening in my machine at port 8000. And, a client process is trying to communicate to the server continuously. Everytime it opens a new socket connection and closes the connection for some reason. This is a continuously process. But, when I'm trying to do with the pasted code here, I'm unable to create the socket connection after certain limit. In my windows machine, it throws error after creati...


Socket Programming in Python

I am working on a proof of concept using python that emulates a server/client communication using sockets to send UDP packets. I can easily do a simple client to server and back to client comms, but I am trying to introduce a "middle-man" into that communication. Conceptually the problem can be descirbed as, if "Joe" is the main client, he will send a message to "Steve" who is the middle man who will do something with that...


ios - Socket programming python on real server

I'm following this http://www.raywenderlich.com/3932 for socket programming in iOS where the server coding is in PYTHON, however, I just want to know that according to this tutorial, the author used localhost and run the code from terminal such that python server.py to execute and listen for socket....


TCP socket programming in Python -- login FTP

I'm learning TCP socket programming and I want to create a fake ftp client -- not using any ftp library. I have searched and read many articles, but did not find a clue how to login with username and password after the connection is built.. As you can see in the following code, the socket is created and the connection to the remote host can be successfully built, but then how can I send the username and password to ...


python - What's a good resource for starting to write a programming language, that's not context free?

Closed. This question does not meet Stack Overflow guid...


python - OPENGL User Interface Programming

Closed. This question does not meet Stack Overflow guid...


python - Which is the most useful Mercurial hook for programming in a loosely connected team?

I recently discovered the notify extension in Mercurial which allows me quickly send out emails whenever I push changes, but I'm pretty sure I'm still missing out on a lot of functionality which could make my life a lot easier. notify-extension: https://www.mercurial-scm.org/wiki/NotifyExtension Which Me...


functional programming - Pattern matching of lists in Python

I want to do some pattern matching on lists in Python. For example, in Haskell, I can do something like the following: fun (head : rest) = ... So when I pass in a list, head will be the first element, and rest will be the trailing elements. Likewise, in Python, I can automatically unpack tuples: (var1, var2) = func_that_returns_a_tuple()


python - Convert CVS/SVN to a Programming Snippets Site

I use cvs to maintain all my python snippets, notes, c, c++ code. As the hosting provider provides a public web- server also, I was thinking that I should convert the cvs automatically to a programming snippets website. cvsweb is not what I mean. doxygen ...


What are the benefits of using Python for web programming?

What makes Python stand out for use in web development? What are some examples of highly successful uses of Python on the web?


functional programming - Modify bound variables of a closure in Python

Is there any way to modify the bound value of one of the variables inside a closure? Look at the example to understand it better. def foo(): var_a = 2 var_b = 3 def _closure(x): return var_a + var_b + x return _closure localClosure = foo() # Local closure is now "return 2 + 3 + x" a = localClosure(1) # 2 + 3 + 1 == 6 # DO SOME MAGIC HERE TO TURN "var_a" of the closure into 0 # ...


Interested in Collective Programming for the web -- Ruby or Python or PHP?

Closed. This question is opinion-based. It is not c...


network programming - How do you determine if an IP address is private, in Python?

In Python, what is the best way to determine if an IP address (e.g., '127.0.0.1' or '10.98.76.6') is on a private network? The code does not sound difficult to write. But there may be more edge cases than are immediately apparent, and there's IPv6 support to consider, etc. Is there an existing library that does it? ...


c# - ORM (object relational manager) solution with multiple programming language support

Is there a good ORM (object relational manager) solution that can use the same database from C++, C#, Python? It could also be multiple solutions, e.g. one per language, as long as they can can access the same database and use the same schema. Multi platform support is also needed. Clarification: The idea is to have one database and access this from software written in several different pr...






Still can't find your answer? Check out these communities...



PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python



top