0
votes
1answer
21 views

How do languages whose variables don't have sigils deal with dynamic dispatch/invocation?

Dynamic languages allow dispatching with and invoking on values from variables whose values are only known at run-time. Contrasting examples in Perl: class names constant Foo::Bar->some_method ...
0
votes
1answer
10 views

Pyramid app with handlebar.js: I don't need a template for this view; how to disable?

I'm adding a page to a complex Pyramid-based app that uses Handlebar templates. I need a file download URL that doesn't need a template, but the system is giving me a 404 code for missing template ...
1
vote
0answers
17 views

Trouble sending HTML form input to Python script

I'm having trouble sending user input from an HTML form to a Python script. Ideally, I want a Python script, with HTML user input as a variable, to run whenever a user enters input and clicks a submit ...
0
votes
1answer
16 views

Google App Engine Python, Jquery and Javascript for a cascade select

I tried a lot of tutorials and forums but I can't find how to make a cascade select work in the Google App Engine ! I tried this code, I have two selects but... it's not a cascade select... The ...
0
votes
1answer
26 views

django / python collections issue

I have some code that I can not get my head around. The more I look at it the more confused I become. There are two date values and a language code that is passed into a js function. Then there is a ...
0
votes
0answers
10 views

Accessing GCE API from my web site

I am trying to access GCE information in a read only way to display data about an infrastructure on my web site. Basically I want to get an OAuth2 token using JS API and then pass it to a Python ...
1
vote
1answer
20 views

Django selenium how to get page text using find_element

I am trying to get the the text 'Incorrect Credentials' using selenium. This is what I have tried... message_text = self.driver.find_element(By.XPATH, ...
0
votes
1answer
23 views

generate a preview of markdown on flask form

I am trying to make an interface very much like this text box and preview below it on stack overflow question form. I use hoep to handle the markup on my flask backend. The following is my code for ...
0
votes
2answers
38 views

How to search for JavaScript variables in a file, using Python?

I have directory with many JaveScript files. Here I want to scan each file and want to replace each JavaScript variable with string like 'str1', 'str2', 'str3', ..., 'strn' and so on. My question is: ...
0
votes
0answers
42 views

json.loads in python containing non standard characters

What I'm trying to do is grab some text in my web application (string literals containing non English characters such as ă) with Javascript. Pass it to an object and then use JSON.Stringify() on the ...
0
votes
2answers
32 views

Flask, python dictionary to highcharts JS figure

I have a flask web-application. In this application I call "bar.htm" return render_template('bar.htm', mapping=mapping) where mapping is a dictionary like: mapping = {'jack': 4098, 'sape': 4139} ...
0
votes
1answer
27 views

How to let users sign in with LinkedIn on Flask?

I'm building a website using the (awesome) Python Flask framework and I now want to let users log in with their LinkedIn account. I managed to display the LinkedIn login button after which I can ...
0
votes
0answers
27 views

Download Excel file with Ajax and Flask

User presses a button contained within a form on the page: <form id="form"> <input type="button" id="export" value="Export"/> </form> Upon clicking the button, the following ...
0
votes
2answers
25 views

returning ajax error from python to jquery

I am doing an AJAX form post in jQuery. However, when I return an error code from my Python server,it's being read as success instead of as error. My code is below. I am a noob in Python. So apologize ...
0
votes
1answer
21 views

How to get text generated by JS in Selenium?

I am trying to get the text "Incorrect Credentials" which is placed on page (js) when the user enters an incorrect user name and password... login_button.click() self.driver.implicitly_wait(10) # ...
0
votes
1answer
35 views

Expand/Collapsible list of objects

I'm trying to display a list of object Models (Robots), the models have a field Parent which can be another Robot. I've implemented a nested list using MPTT for Django: {% load mptt_tags %} ...
0
votes
1answer
12 views

is it possible to use pyexecjs with scrapy?

I stumbled upon pyexecjs a while ago, and I was wondering if it could be used with scrapy to crawl JS generated data. https://github.com/doloopwhile/PyExecJS I checked the examples of how the library ...
0
votes
1answer
15 views

Web2py String var to JavaScript

I have a function: def productdetails(): if session.login == False: redirect(URL('petscart','default','login')) myproducts=db(db.Products.product_number > 0).select() return ...
0
votes
1answer
27 views

Is there a Javascript function similar to the Python Counter function?

I am attempting to change a program of mine from Python to Javascript and I was wondering if there was a JS function like the Counter function from the collections module in Python. Syntax for ...
0
votes
1answer
18 views

How can we send a GET request to a python bottle server without using Javascript?

This is the simple HTML page with a text box and a search button <!DOCTYPE html> <html> <body> <input type="text" name="queryString"><br> <button type="button" ...
0
votes
1answer
35 views

Python POST JSON - Is a web framework required?

Im a bit new to python and trying to understand a simple JSON POST example (I am using AngularJS). I have read other Q's on SO and I see most folks use some type of framework (ie, cherrypy). I am ...
0
votes
1answer
49 views

Python - Detect browser closure to kill webserver

Ok, I'm writing a pyqt software to generate a webpage. Due to some security issues with Chrome and other things, I need a webserver to test the webpage. So I thought to create a button called run, ...
1
vote
1answer
23 views

Rendering JSON in template DJANGO

This is working on my local machine, but when I run it on my VPS it always throws a javascript erorr in this line: var post_array = [{'title': u'How To Hire A Designer', 'url': ...
0
votes
1answer
17 views

How can I send a code snippet of javascript using Tornado's self.write method?

I was trying to send a small piece of javascript to the browser, using Tornado's self.write method: @tornado.web.asynchronous @tornado.gen.coroutine def post(self): [...] #deal with arguments, ...
0
votes
0answers
23 views

jQuery 403 Error: CSRF verification failed. Request aborted

I have a jQuery-UI-Slider which keeps giving me a 403 Permissions error in FireBug Console or in Terminal when I move the slider when testing it on my local machine. The application is built in ...
0
votes
1answer
13 views

Generate Hmac in Javascript from python code

I am trying to generate an hmac hash in javascript. here is some python code I want to replicate in Javascript: mac = hmac.new("33fsfsdgvwrg2g223f4f42gf4f34f43f", digestmod=hashlib.sha1) ...
0
votes
0answers
61 views

atom editor: node-gyp rebuild crashes

I'm trying to install an atom package that uses node-gyp. But it crashes each time. Here's the apm output: Installing autocomplete-clang to /home/lars/.atom/packages ✗ > [email protected] install ...
0
votes
1answer
20 views

server based bokeh plot update

I am using bokeh to embed a chart into an html template served by flask. I am using the autoload server method which returns a script which is then embedded into the html by the template renderer. ...
0
votes
2answers
26 views

Django “static” files - Javascript

Minor terminology question: I see Django refers to images, CSS and Javascript scripts as "static" files (https://docs.djangoproject.com/en/dev/howto/static-files/). However, a Javascript script is not ...
0
votes
1answer
44 views

how can I transfer the javascript code to python code?

the javascript code is here: var goat=6111+7380; var hen=5548+7476^goat; var seal=2094+4451^hen; var rat=1687+7000^seal; var pig=3997+8240^rat; And I want get the goat, hen seal variable and so ...
0
votes
2answers
47 views

D3 Pre-Rendering

I'm still a beginner with JS + Python and I'd be really happy to get your help on one problem. What I basically need to to is to pre-render a d3js visualization of a network (as for example ...
0
votes
1answer
19 views

How can I save every Outlook Express Email as an html without clicking “Save As” for every email [closed]

I am trying to save a whole slew of emails as html in Outlook Express, but the program only lets me save them individually. If I click "Save As" on more than one email Outlook only lets me save them ...
-1
votes
0answers
20 views

Connecting client to websocket chat

I've designed a websocket chat using python, javascript and html. I've also created a register and login page which functions efficiently. The only confusion I have is connecting the login to the ...
1
vote
2answers
30 views

AJAX not resolving url correctly

I have an HTML form that I want to submit to a flask endpoint, /add_int. When the form is submitted I intercept it with Jquery and submit the form to the endpoint using AJAX as follows: var form = $( ...
0
votes
2answers
58 views

How can I retrieve a JavaScript variable using Python? [closed]

I'm trying to retrieve a Javascript variable using Python and I'm having some issues... Here is what the variable looks like : <script type="text/javascript"> var exampleVar = [ {...}, ...
0
votes
1answer
27 views

“method not allowed” in a python function for flask

I want to save on a .ttl file a type 'person' resource from a javascript function: this is my sparql query: @app.route('/registraAnnotatore/<author>+<mail>', methods=['POST']) def ...
0
votes
1answer
20 views

Python Error When Accessing JSON Data From AngularJS POST

I am trying to send data to a python script via POST but unable to read it. The UI is in AngularJS. I have seen similar questions but they are either not using AngularJS or not using POST. The ...
0
votes
0answers
16 views

Javascript bookmarklet button on python application

I have this code creating a simple browser using pywebkitgtk #!/usr/bin/python import sys, re import gtk, gobject import webkit DEFAULT_URL = 'http://www.facebook.com' # Change this as you Wish class ...
0
votes
0answers
18 views

Can a key logger in python be set to record only a browser window (firefox)

I assembled the key logger from this video: http://www.youtube.com/watch?v=kUQz87TMHZM It works great, but is too good. I need to limit its functionality to only recording entries in a Firefox, ...
0
votes
1answer
38 views

how to create highcharts formatted json structure with python

I am trying to create some json that will render a highchart graph with python/django. here is what my view looks like so far: class LineHighChart(object): title = {} def weight_graph(request): ...
0
votes
0answers
12 views

Direction to create script to launch, close, relaunch (or perhaps refresh) browser

My question probably entails something a bit involved, but lets see. I created a js metric script that does a few things, one of them being "page load time". I need a way to be able to have ...
0
votes
0answers
17 views

Passing Object in the url to call the web API in Python

I want to call a web api , where the url contains a json object also. I am able to create the json object. But urllib.request.urlopen(url) is throwing a bad request exception. The web api is as ...
-1
votes
0answers
18 views

Couldn't stay connect to a a socket connection.

I try to use websocket to send a file with the HTML5 tag input file. On the loadind page, I am connecting to the server (flask-Socket framework on python) (Ready State0). But I have always a ready ...
-1
votes
0answers
37 views

How can we use Python, Javascript and MySQL on a website

My goal is to use the following: MySQL (database) Python (Connection to database and outputs information that will be taken from Javascript) Javascript (Frontend to display information) I tried ...
0
votes
1answer
38 views

How to store a JQuery submitted variable and reuse it at a later stage in a Python/Django project?

I have developed an application using Python2.7 and Django 1.6 which uses the below slider bar to allow a user to rate various images using a multi page SessionWizardView form. The user rating is ...
1
vote
1answer
30 views

Parsing through the HTML and scripts on a webpage using python?

I'm currently using Beautiful Soup to parse through the HTML of a webpage. However, I would also like to recursively parse through any .js files on the webpage as well. My goal is to look for certain ...
0
votes
0answers
25 views

Javascript (jQuery) Client is not working with python webservice

I'm trying to build a small restful web service with python. Therefore I used flask (and now bottle). For testing purposes I wrote a small android application and everything works just fine. I can ...
0
votes
1answer
29 views

Python Django: Pass json from view to javascript in template

I am new to django. From my findings, I tried this way, but didn't work. <script type="text/javascript" > var data = {{json}} </script> I am trying to use data table from this ...
0
votes
1answer
28 views

Redirect after AJAX GET request in Django

I am new with Django and AJAX (javascript). Finally I can send some arguments to a django view. This view render an edit form. I send the parameters and the view response the form with the info that I ...
0
votes
1answer
26 views

Caching somewhere preventing updated templates in Django 1.6

Apologies for the poor title. I have a template errror when running a Django 1.6 server and accessing a particular set of templates. I've removed TemplateSyntaxError at /url_name Could not ...