python twisted tutorial/question - python

Got a simple question regarding twisted.
I can create a trivial basic test with a web server like apache, where http://foo.com/index.php instantiates the index.php for the "foo" site/app...
I'm trying to figure out how the heck I can create a twisted server, where I run different backend functions based on the input!
I know, embarrasingly simple.. but none of what I've seen regarding twisted/server/client/etc.. discusses this.
Comments/pointers/samples are greatly welcome.
thanks

Have you read this?
http://krondo.com/blog/?page_id=1327

You may find http://twistedmatrix.com/documents/current/web/howto/web-in-60/index.html helpful.

Related

Directus custom filter/search with python machine learning

I want to implement my own filter in directus based on python machine learning.
User posts a message/question to the Server
Directus save the message/question
at this moment, a python script search for similar message/question (machine learning)
Directus answers with the answer found by the python script
Is this possible ?
How can I implement something like this?
Thanks in advance
I think you'd have to use Hooks. Hooks allow you to run any arbitrary code when certain events happen in the system. When a user posts something new, you would pass along the posted message to your python script.

Xchat2: Intercept submitted lines from text box before sending to server

I am attempting to write a script in python and was wondering if there is a method to delay a line typed into the textbox/inputbox to enable some processing before it is sent to the server.
I would like to utilize python as I have already solved the issue of processing, just not the issue with the interception.
Thanks in advance.
I'm not pretty sure, but after seeing the xchat API for python I saw some functions that maybe could help you. Anyway, the best you can do is check out the documentacion for yourself here http://xchat.org/docs/xchatpython.html#head-baa362bb6aeeed1851452bd2ecc9253317db1e64.
Good luck!

Has anyone done a python tornado compatible firebase implementation?

I did a search but did not come up with any hits for a tornado.websocket implementation of the firebase sdk. Abe Haskin's python-firebasin runs inside a thread. I know its possible to port thinking about it not sure it is trivial, particularly if you try to make the rootdataref dynamic. Was wondering if anyone had been down this path?

How steamkit work?

Currently, i want to implement a trading system for steam games (with python).
So, i searched github, but sadly, there are only
https://github.com/Jessecar96/SteamBot
https://github.com/Jessecar96/SteamKit2
Yeah, they works good. But they are C# -- don't tell me python can't do this :).
So, i want to start with the steamkit part. I thought it's not difficult(maybe just some web-apis), but when i kinda review the code of SteamKit2, i find it seems use TcpConnection to Steam Network, don't know how they get the protocol.
Does anyone has any idea about this, i think about use python load steamkit2.dll, but im really noob with C#
You don't want to use the SteamKit2 port on that repository. It is a branch (and an out dated one at that) of the official SteamKit2 repository. It also looks like they are attempting to get rid of the branch based on this issue discussion.
To answer your question, there is a port of SteamKit to Python. It is called PySteamKit and is written by one of the contributors to SteamKit2.
Unfortunately, there doesn't seem to be much documentation in the Wiki of either the official SteamKit or the Python port on how to use the package. You may have to look at the Samples provided by SteamKit which are in C#.

Rookie Python-questions

Is it possible to make python run on your homepage? I know, this is a really stupid question but please don't pick on me for my stupidity :)
If it is possible, how? Do you have to upload/install the executing part of Python to you website using FTP? or...?
Edit: Just found out my provider does not support python and that shell access is completely restricted. Problem solved :)
Everything depends on the hosting provider you use for your homepage -- do they offer Python among their services, and, if so, what version, and how do you write server-side scripts to use it (is it CGI-only, or...?) -- if not, or the version / deployment options disappoint, what do they allow in terms of giving you shell access and running long-time processes?
It's impossible for us to judge any of these aspects, because every single one of them depends on your hosting provider, and absolutely none of them depends on Python itself!-)
Yes, you can. I don't know exactly how but I know it is possible. Mabye look into this website:
https://trinket.io/
This website lets you do this. I sent them a message to see how they do it so I will update this to let you know after they respond.
Python is a scripting language, though it is used gracefully for building back end web applications.

Categories

Resources