0 answers

nginx/uwsgi/flask not using CSS files in template

I've got a flask app I'm trying to run off CentOS 6.6, Python 6.6, uwsgi 2.0.8 and nginx 1.0.15. I have selinux disabled. It runs using flask, but while trying to set it up with nginx it's displaying ...

3 answers

can time.sleep(secs) suspend QNetworkAccessManager does request asynchronously?

QNetworkAccessManager can do requests asynchronously, and time.sleep(secs) can suspend the execution for the given number of seconds. I was confused by the code below. Is t2 here always greater than ...

0 answers

Why is DataFrame.loc[[1]] 1,800x slower than df.ix [[1]] and 3,500x than df.loc[1]?

I have a DataFrame with 4.8 million rows, and selecting a single row using .iloc[[ id ]](with a single-element list) takes 489 ms, almost half a second, 1,800x times slower than the identical .ix[[ id ...

0 answers

Calling GAE NDB query with dynamic property name

Google AppEngine NDB queries are strange beasts. Say I have a class (and ndb entity) of Car with color and weight properties. I can do Car.query(Car.color == "blue") I've never seen any Python 2 ...

0 answers

Why do I get a 'CannedArray' object has no attribute 'pickled' in ipython gather statement?

So for various reasons I won't explain I have done some weird things to change my home directory and path. This means that my ipcluster_config.py file looks like this: c = get_config() ...

1 answer

How do I select a link with a right arrow as the text with xpath?

I'm attempting to select the next button on a website, and it has a right arrow as the text of the link. When I view the source using "scrappy shell" it shows me the character as its unicode literal ...

1 answers | 15 mins ago by Brad T on Stack Overflow stackoverflow.com
2 answers

Bind the instance argument of a descriptor method to the calling object instance

In a descriptor, the second argument to __get__ and __set__ is bound to the calling object instance (and the third argument to __get__ is bound to the calling owner class object): class Desc(): ...

2 answers | 23 mins ago by Rick Teachey on Stack Overflow stackoverflow.com
1 answer

Find variables defined in other module (python)

I have a module testing system in Python where individual modules call something like: class Hello(object): _DOC_ATTR = { 'greeting': ''' a greeting message. >>> h = ...

0 answers

No session object on non localhost

I am having problems with session object in Web2py. On localhost the code below works perfectly fine. Session object stores what I need. However, once I run it like so: $python web2py.py -i ...

1 answer

Redirect to file directory non existent

I'm calling this command in Python: os.system('echo %s > `find $HOME -iname p410.yaml`' % string) This works fine on OSX, but on Ubuntu gives me /home/path/to/p410.yaml: Directory nonexistent. ...

1 answers | 42 mins ago by chris on Stack Overflow stackoverflow.com
2 answers

How can I get the exponent of each number in a np.array?

Lets say I have the array: x = np.array([0.00001,0.001]) numpy will make the numbers to array([ 1.00000000e-05, 1.00000000e-03]) Now I want to get the exponents, something like ...

2 answers | 48 mins ago by varantir on Stack Overflow stackoverflow.com
0 answers

IPython ipengineapp creation with keyword arguments

I am trying to write a script that will start an new engine. Using some code from IPython source I have: [engines.py] def make_engine(): from IPython.parallel.apps import ipengineapp as app ...

0 answers

Can't stop web server in Google App Engine Launcher

I am running development web server in Google App Engine Launcher without any troubles. But I can't successfully stop it. When I am press Stop button, nothing happens. Nothing adds in logs after ...

0 answers

Error in changing fastq header and written back with BioPython

I am trying to change fastq header with postfix /1 and /2 and written back as new fie. However, I got this error: No suitable quality scores found in letter_annotations of SeqRecord Is there any ...

1 answer

Save python random forest model to file

In R, after running "random forest" model, I can use save.image("***.RData") to store the model. Afterwards, I can just load the model to do predictions directly. Can you do a similar thing in ...

0 answers

How to write a custom Gtk.CellRenderer which would show Gtk.ColorButton

I am using Python 3 and Gtk+ 3. I have a list of colors stored in a Gtk.ListStore. I want to display these colors as Gtk.ColorButton with a Gtk.CellRenderer so that the users would be able to view the ...

3 answers

Python Regex search + Offset

I am trying to search for a particular string in a line and print 10 characters after the string in the line. For example : "Empty user name specified in NTLM authentication. Port=443, Client ...

3 answers | 1 hour ago by Sagar Kadambi on Stack Overflow stackoverflow.com
1 answer

Flask, Keep getting 404 serving static files using send_static_file

I followed the instructions from How to serve static files in Flask, but still couldn't get it working. Here's my project structure: Project_path | +--app | | | +--main.py +--static | ...

1 answers | 1 hour ago by laike9m on Stack Overflow stackoverflow.com
1 answer

How should an accumulator in a Python clock be handled correctly?

I'm writing a small clock object in Python that can be started, stopped and reset. I'm having difficulty knowing how to keep track of the accumulation of time correctly. Right now, the way the update ...

1 answers | 1 hour ago by d3pd on Stack Overflow stackoverflow.com
0 answers

Werkzeug FileStorage not saving .pdf files

I am trying to upload a file (different filetypes, .py, .txt, .pdf, .docx, etc..), using Flask's request context, which returns me a file werkzeug FileStorage object where I can call .save() to store ...

0 answers

Scikit-learn kmeans clustering

I'm supposed to be doing a kmeans clustering implementation with some data. The example I looked at from http://glowingpython.blogspot.com/2012/04/k-means-clustering-with-scipy.html shows their test ...

0 answers

Capture linphonec output

I'm setting a SIP client (Asterisk) on a headless machine, using linphone. I need to capture the dtmf codes of the keys pressed by the remote user. In linphonec, when a user presses a key, it ...

1 answer

Error importing class in django

I have a django app called customer. Inside customer.models I have some model classes one of them is Tooth. I also created a new python file inside my app's directory called callbacks.py to store some ...

1 answers | 1 hour ago by Apostolos on Stack Overflow stackoverflow.com
0 answers

Browser performance tests through selenium

We are using protractor for testing internal angularjs applications. Besides functional tests, we check for performance regressions with the help of protractor-perf which is based on nodejs ...

0 answers

Incorrect resetting when using reset original view function

I used Tkinter to perform some computations and analytical data display after importing and analyzing the input data. Everything works fine. But one problem is, for some data, especially for those ...

0 answers

XMPP League of Legends Python

I am trying to create a bot that reads a message in a file and then send it to a recipient in League of Legends. I am using xmpppy library. If you have a better and easier one you can tell me :) ...

1 answer

Django Form sending only File field

Hello guys i am a rather new to Django and Python as well. Using Django version 1.8 and python ver 2.7.6 want to update the fields of a form into the DB, so would like to send all of them at the ...

3 answers

Can't get CKEditor plugins to work in django

I am trying to get the CKEditor plugin, codesnippet, to work in the django admin but am unable to. CKEditor works if I don't define any CKEDIT_CONFIGS in my settings.py. It also works if take out the ...

3 answers | 1 hour ago by jsnow on Stack Overflow stackoverflow.com
0 answers

How to use linalg.lstsq() with sparse matrix? How to save BIG sparse matrix to portable data format

I am learing python now and having one question regarding numpy.linalg.lstsq() it always give me some error if there is a sparse matrix: Here is a test I did I = np.array([0,3,1,0]) J = ...

1 answer

To response the query result with the equivalent performance as `psycopg2` does

I try to explain my case clearly. I want to use Ruby on Rails to response the query result with the equivalent performance as psycopg2 does. I use psycopg2 Python package to query my database ...

15 30 50 per page
1 2 3