how to update wikipages automatically using python scripts - python

I am using a internal wiki for my projects is there anything available so that I can update my wiki entries automatically using a python script? So that I don't need to go always to the wikipage and edit those pages manually.
Thanks,
Beeth

You could use Mechanize. Using this, you can essentially automate browser activity

Related

How to use brython to create an interactive python script writer

I am trying to create a site which auto generates python code and is presented to the user in an ide style where they can edit it then run it live using brython.
I am having trouble setting up the ide part I found brython console but that won't work for editing things. So my question is are there any existing implementations I can use?
I think you want an extensible web IDE. An IDE that runs in the browser that expects you to build on top of, so that you can likely get the text out of it to provide to Brython. I'd try searching for terms like these:
extensible web IDE
web IDE framework
IDE framework in JavaScript
et c.

How to use Firefox add-on SDK / places/bookmarks API from Python

I am looking for a kick-start on how to access Firefox bookmarks, folders and tabs from Python using Firefox SDK.
I already tested accessing places.sqlite through the SQLite3 library, but it can run in read-only mode since Firefox locks the database while in use.
How do I initialize the SDK from Python (3.x but I would be willing to use 2.7 too, in case) and send basic commands like create a folder, create a bookmark or tag it?
As you might have already guessed I am learning and rather inexperienced...
Yet I searched quite a bit without finding anything of value other than this link Manipulating bookmarks using Places that clearly uses some other language.
I have investigated a little further, or better: asked to an experienced friend.
The answer seems to be: you cannot invoke Firefox's SDK from anything different than Javascript. It has no bindings for other languages, also because they could not work in Firefox.
In addition to that the guide I linked might be old, since Firefox has moved onto supporting web extensions.
It looks like I might have to shift my focus back to JS if I want to pursue this project.

Change Google Chrome Settings using Python

I am a basic python programmer.
I would like to change the settings of google chrome, especially the proxy and LAN settings automatically with a program.
I tried looking at the webbrowser library, but I don't think its sufficient.
I looked at the selenium library, but I do not know where to start looking for my requirements in the library, could someone provide a resource or a method on how to automate my tasks? I looked at another questions which describes a process using c#. But thats not my problem. I want the required documentation for my exact purpose.
http://seleniumhq.github.io/selenium/docs/api/py/api.html
which of these must I use?
What you need to use is the Selenium WebDriver API, with Python bindings (lots of other languages are also supported, and many frameworks are available).
Here's a good Python example, plus there's a huge number of helpful questions on this site.
Here's a good description of the ChromeDriver (the WebDriver library that automates a Chrome browser) complete with installation instructions and example Python code.
I personally recommend BrowserMob as a proxy server for Selenium. Although it's Java-based, once it's running you can control it via a REST API - I assume you want to be able to manipulate requests/responses, that kind of thing?
In any case, there are lots of proxy servers available, and the configuration to use one within your Python code is pretty standard. See this example (see also the links).

What do I need to successfully run a website in my browser that executes Python scripts?

I currently simply have a local website on my Mac. I can view the webpage's HTMl and CSS and run the javascript functions in browser on my computer, but the next step I want to take is incorporating python scripts for accessing a MySQL database and returning results.
I am clearly new to this, and would love some guidance. Right now, on my computer, I have MySQL installed and I can run it in the terminal just fine. What else do I need as far as database and server equipment – if anything – to get some dynamic website running locally? My current, albeit incredibly limited, understanding is that I have a MySQL database stored on my machine that can be accessed through a Python script – also on my machine – and a link to this script in the HTML file. Is this even right, or do you recommend certain tutorials to fill in the gaps or teach me from the ground up?
I am sorry I am asking a lot; the few tutorials I have found have seemed to cover what I am hoping to do. Many thanks in advance.
Here you go. https://docs.djangoproject.com/en/1.4/intro/install/
Just follow the installation guide, and you'll be up and running in no time.
If you have MySQL installed on your machine along with Python, get a version of MySQLDb library for Python and have fun with it. Moreover, you can do almost any data operation with these combinations. If you want your website to go live (and do not wish to go through web frameworks) just look for a hosting plan that gives you a Python installed server access.

XAMPP - Execute Python script on web page

How can I execute a Python script on a webpage?
I've used XAMPP to create the Apache server. Are there any tutorials/examples or guides on how to execute a .py script? I'm using Windows 7 and have installed Python on my local machine. If I access the .py script via the web link, it looks as if its HTML code and nothing is executed.
Typically, you don't execute Python in the browser. Instead, the browser accesses a resource (or "webpage", like http://example.com/mypage) by requesting the resource from the server. The server (for example, Apache), when administered correctly, passes off handling of the request to some Python script. Then, your Python script creates some output (for example, HTML) which the server then returns to the browser for the browser to display.
However, some web sites have found it useful to have logic (scripts) run in the browser, rather than on the server. The standard way of doing this is using JavaScript (although in the past there WERE other languages built into browsers, such as VBScript in Internet Explorer).
Right now, pretty much all browsers have settled on JavaScript as THE scripting language in the browser. In order for you to use any other language in the browser (including Python), the browser must support that scripting language (or needs to have an add-on to support that scripting language). Simply having Python installed on your client alongside the browser is not enough. For more information, please see the Python documentation Web Browser Programming.
Another option is to use something like Pyjs. This is a library that has you write your code in Python, and converts the necessary parts to JavaScript. This isn't exactly "Python in the browser", but it might be something you are looking for.
I guess this links will help....
https://community.apachefriends.org/f/viewtopic.php?t=42975
Usually a good resource for Python is the official documentation.
They do a great job of explaining many aspects of Python. Using Python on the web is a big part and they have a great overview.

Categories