I am building an GPS tracker application in Python. How can I use Google Maps in my application?
Google maps is a client-side web application, meaning it can only run in a web browser. You will have to use a web server with your python application (using mod_wsgi or the like and some type of web library like tornado or cherrypy). The web server will serve HTML and javascript files which may make use of Google Maps.
I don't see why you'd need a web server. There are various network APIs to google-maps including this one http://code.google.com/apis/maps/documentation/webservices/index.html, and python can access those APIs using urllib and/or httplib
Try googling "python google map" - it seems there are some python packages already out there which encapsulate these APIs.
I do know there is a Client Library created for Python.
You can download it with pip install -U googlemaps
More information can be found here: https://github.com/googlemaps/google-maps-services-python
The documentation here: https://googlemaps.github.io/google-maps-services-python/docs/2.4.4/
Related
I'm currently trying to develop an application to use ms-graph API using python.
I'm trying to use SSO authentication but I cant find any resources or documentation related.
I found this documentation https://learn.microsoft.com/en-us/office/dev/add-ins/develop/sso-in-office-add-ins
but it is only for javascript.
I wrote a script using Flask and another script using O365 python package.
It doesnt seem like its a Single sign on application that I try to achieve...
I'm looking for any documentation that could help.
You are referring to the Office web add-ins where you could also use SSO. But it seems you are developing a standalone application where Graph API is used. In that case you may find the Configure SAML-based single sign-on for your application using the Microsoft Graph API tutorial helpful.
I'm getting my feet wet with GCP and GAE, also nodejs and python and networking (I know).
[+] What I have:
Basically I have some nodejs code that takes in some input and is supposed to then send that input to some python code that will do more stuff to it. My first idea was to deploy the nodejs code via GAE, then host the python code in a python server, then make post requests from the nodejs front-end to the python server backend.
[+] What I would like to be able to do:
just deploy both my nodejs code and my python code in the same project and instance of GAE so that the nodejs is the frontend that people see but so that the python server is also running in the same environment and can just communicate with the nodejs without sending anything online.
[+] What I have read
https://www.netguru.co/blog/use-node-js-backend
Google App Engine - Front and Backend Web Development
and countless other google searches for this type of setup but to no avail.
If anyone can point me in the right direction I would really appreciate it.
You can't have both python and nodejs running in the same instance, but they can run as separate services, each with their own instance(s) inside the same GAE app/project. See Service isolation and maybe Deploying different languages services to the same Application [Google App Engine]
Using post requests can work pretty well, but will likely take some effort to ensure no outside access.
Since you intend to use as frontend the nodejs service you're limited to using only the flexible environment for it, which limits the inter-service communication options - you can't use push queues (properly supported only in the standard environment) which IMHO would be a better/more secure solution than post requests.
Another secure communication option would be for the nodejs service to place the data into the datastore and have the python service pick it up from there - the datastore is shared by all instances/versions/services inside the same GAE app. Also more loosely coupled IMHO - each service can function (at least for a while) without the other being alive (not possible if using the post requests).
Maybe of interest: How to tell if a Google App Engine documentation page applies to the standard or the flexible environment
UPDATE:
Node.JS is currently available in the standard environment as well, so you can use those features, see:
Now, you can deploy your Node.js app to App Engine standard environment
Google App Engine Node.js Standard Environment Documentation
I have some entities added on datastore - made a little web app (in Python) to read and write from the datastore through endpoints. I am able to use the webapp through endpoints from javascript.
I want to access the web app from an installed application on PC. Is there a way to access endpoints from installed applications written in Python? How?
Is there any other way to access the datastore from PC installed applications written in Python?
That's one of the beauties of AppEngine's endpoints. You should use the Python Client Library for Google's APIs to communicate with your endpoints
pip install --upgrade google-api-python-client
Then you'll construct a resource object to communicate with your api using the apiclient.discovery.build function. For eg:
from apiclient.discovery import build
api_root = 'https://<APP_ID>.appspot.com/_ah/api'
api = 'api_name'
version = 'api_version'
discovery_url = '%s/discovery/v1/apis/%s/%s/rest' % (api_root, api, version)
service = build(api, version, discoveryServiceUrl=discovery_url)
You can then perform operations at service.<endpoint_method> etc
A more complete example with authentication can be found here.
EDIT:
Or as #Zig recommends, directly use the Google Cloud API
pip install googledatastore
Trivial example
I have a website with miniwebhost.com, which supports python. I want to have a page that runs one of my text based games I have made on Python. So, how would I go about doing it? I know I have to make it executable and something about a cgi-bin(which I have). Put your answer in clear steps please.
Site is: www.rosshudson.co.uk/
Python web applications are often hooked to the web server (e.g. Apache httpd) using the WSGI module. Note that your app need to handle the HTTP requests correctly either by using a framework (like Django) or the BaseHttpServer, BaseHttpRequestHandler from the standard library.
I want to use Google Data API on a Symbian device with pys60 but I couldn't find any doc.
Is there any way to install Google Data APIs Python Client Library on Symbian ?
According to the Google Data API protocol documentation, even the client libraries are basically just sending XML data over HTTP, so it should be possible (in theory, at least) to send the same data from your own PyS60 application by grokking the code of the Python client. If memory serves me right, ElementTree is included in Python 2.5, and should by extension, be in PyS60. It's the only required dependency for the Python client library.
Google Data Api is just a bunch of interpreted Python code. It should run in any Python 2.2 interpreter after you download it from the project page. It has a nice tutorial.
Maybe you want to know how to install downloaded Python packages.