Q_Id int64 337 49.3M | CreationDate stringlengths 23 23 | Users Score int64 -42 1.15k | Other int64 0 1 | Python Basics and Environment int64 0 1 | System Administration and DevOps int64 0 1 | Tags stringlengths 6 105 | A_Id int64 518 72.5M | AnswerCount int64 1 64 | is_accepted bool 2
classes | Web Development int64 0 1 | GUI and Desktop Applications int64 0 1 | Answer stringlengths 6 11.6k | Available Count int64 1 31 | Q_Score int64 0 6.79k | Data Science and Machine Learning int64 0 1 | Question stringlengths 15 29k | Title stringlengths 11 150 | Score float64 -1 1.2 | Database and SQL int64 0 1 | Networking and APIs int64 0 1 | ViewCount int64 8 6.81M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27,493,323 | 2014-12-15T21:19:00.000 | 1 | 0 | 1 | 0 | python,version-control,version,updates,conflict | 27,493,427 | 4 | false | 0 | 0 | Of course there is always a chance that upgrading a system component could cause errors. The Python devs do, however, take backwards compatibility fairly seriously.
If this is a serious concern you should make sure your software has adequate unit tests, and run them on the updated Python before installing it on your pr... | 2 | 0 | 0 | Question: I'm a new python user. I'm currently using v2.7.6 in a tied relations with other systems and files written in different languages. Does updating to v2.7.9 might cause any issues?
Any hidden conflicts for using py files that were written in 2.7.6 and/or using files written in other languages?
Could is a bit of... | Python - Can updating 2.7.6 to 2.7.9 cause any problems/conflicts? | 0.049958 | 0 | 0 | 656 |
27,494,758 | 2014-12-15T23:03:00.000 | 118 | 0 | 1 | 1 | python,command-line | 27,494,871 | 6 | true | 0 | 0 | Add a shebang line to the top of the script:
#!/usr/bin/env python
Mark the script as executable:
chmod +x myscript.py
Add the dir containing it to your PATH variable. (If you want it to stick, you'll have to do this in .bashrc or .bash_profile in your home dir.)
export PATH=/path/to/script:$PATH | 2 | 72 | 0 | How can I run a python script with my own command line name like 'myscript' without having to do 'python myscript.py' in the terminal? | How do I make a python script executable? | 1.2 | 0 | 0 | 145,067 |
27,494,758 | 2014-12-15T23:03:00.000 | 1 | 0 | 1 | 1 | python,command-line | 66,843,453 | 6 | false | 0 | 0 | The simplest way that comes to my mind is to use "pyinstaller".
create an environment that contains all the lib you have used in your code.
activate the environment and in the command window write pip install pyinstaller
Use the command window to open the main directory that codes maincode.py is located.
remember to k... | 2 | 72 | 0 | How can I run a python script with my own command line name like 'myscript' without having to do 'python myscript.py' in the terminal? | How do I make a python script executable? | 0.033321 | 0 | 0 | 145,067 |
27,497,044 | 2014-12-16T03:27:00.000 | 1 | 0 | 0 | 0 | python,linux,django,amazon-web-services,amazon-ec2 | 27,500,649 | 1 | true | 1 | 0 | Just install blinker by typing pip install blinker in the console.
Be sure you install it in your virtualenv if by any chance you use one, just by activating it before executing the pip command.
You may also review your staging procedure to correctly install project dependencies. | 1 | 0 | 0 | I am getting this error: signalling support is unavailable because the blinker library is not installed.
I am running Django 1.6.5 under python 2.6.9.
Is it possible that the error will go away if i update python on the server to 2.7.x?
If so how can I update the server without losing everything I have done upto this ... | Runtime error alongside Django on Amazon AWS EC2 Linux AMI issue | 1.2 | 0 | 0 | 274 |
27,499,268 | 2014-12-16T07:05:00.000 | 2 | 0 | 0 | 0 | python,windows,audio | 27,499,520 | 1 | false | 1 | 0 | Sound cards are for playing audio, not sending data. You can't rely on an arbitrary signal not being altered by the hardware, much less the software. For example, many sound cards have a capacitor in series with the output to filter out DC bias. If you try to pass a DC-biased (or very low frequency) signal through s... | 1 | 1 | 0 | We have a python program which outputs specific waveforms over the audio to drive an LED, for an easy and cheap robot programming device.
With the windows systems that we've tested everything works fine, but on some systems the waveform seems to be altered. We've used the control panel to disable any 'enhancements' fo... | Is it possible to ensure audio isn't modified when playing back under Windows | 0.379949 | 0 | 0 | 39 |
27,499,546 | 2014-12-16T07:24:00.000 | 3 | 0 | 0 | 0 | python,post,scrapy | 27,499,859 | 2 | false | 1 | 0 | Use some traffic monitoring software , i personally use fiddler. it will help you to check the requests sent from python as well as from browsers | 2 | 4 | 0 | How to debug a scrapy Request object?
requestobj= FormRequest.from_response(response, formxpath =form_xpath,callback=self.parse1)
I need to check formdata of requestobj .But I didn't find any documentation for debugging Request object | scrapy debug Request object | 0.291313 | 0 | 1 | 764 |
27,499,546 | 2014-12-16T07:24:00.000 | 1 | 0 | 0 | 0 | python,post,scrapy | 27,615,272 | 2 | false | 1 | 0 | try sending request to:
http://httpbin.org/
or
http://echo.opera.com/
you will get a response with information your request | 2 | 4 | 0 | How to debug a scrapy Request object?
requestobj= FormRequest.from_response(response, formxpath =form_xpath,callback=self.parse1)
I need to check formdata of requestobj .But I didn't find any documentation for debugging Request object | scrapy debug Request object | 0.099668 | 0 | 1 | 764 |
27,503,003 | 2014-12-16T10:55:00.000 | 10 | 0 | 1 | 1 | python,installation | 27,523,478 | 4 | true | 0 | 0 | I found the solution. The registry had wrong entries. As I have a 32 bit version installed I went to HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER\SOFTWARE\wow6432node\Python\PythonCore\2.7\InstallPath and the value was set to C:\Python27 while my installation is in D:\Python27. So I changed all the registry values to match the... | 1 | 6 | 0 | I'm on Windows 7. I have Python 2.7 installed for years. I installed recently Python 3.4. I'm trying to use the new py launcher. When I open the cmd terminal and type py -2, I get this error message: Requested Python version (2) not installed. How can make py aware of my python 2.7 installation?
Note: python 2.7 is ins... | py launcher does not find my Python 2.7 | 1.2 | 0 | 0 | 21,363 |
27,509,088 | 2014-12-16T16:16:00.000 | 0 | 0 | 0 | 0 | python,openerp,pycharm,openerp-7 | 27,548,485 | 1 | false | 1 | 0 | Any change made directly in the OpenERP/Odoo GUI is not written back to the module and will overwritten in the next module upgrade.
Use those direct changes only for experimenting or fast prototyping.
Changes you mean to be final should always be made in your module files. | 1 | 4 | 0 | SO i'm using Open ERP 7 and wanted to make a custom module. I've put everything into PyCharm to edit parts there, but sometimes I edit some forms or add some fields with in OpenERP itself under the Database structure.
Any changes I make under the Database Structure (e.g adding a field) won't show up in my PyCharm. Is t... | Keeping custom module synced in OpenERP7 | 0 | 0 | 0 | 46 |
27,510,077 | 2014-12-16T17:08:00.000 | 2 | 0 | 1 | 0 | python,self-modifying | 27,510,374 | 1 | true | 0 | 0 | My first inclination is to say "don't do that". Self-modifying Python (really any language) makes it extremely difficult to maintain a versioned library.
You make a bug fix and need to redistribute - how do you merge data you stored via self-modification.
Very hard to authenticate packaging using a hash - once the lo... | 1 | 0 | 0 | I've considered storing the high scores for my game as variables in the code itself rather than as a text file as I've done so far because it means less additional files are required to run it and that attributing 999999 points becomes harder.
However, this would then require me to run self-modifying code to overwrite ... | Self-modifying Python code to keep track of high scores | 1.2 | 0 | 0 | 414 |
27,513,601 | 2014-12-16T20:43:00.000 | 1 | 0 | 1 | 0 | python,shell | 27,517,551 | 1 | false | 0 | 0 | You can't. You're entering a literal tab character. Python isn't responsible for how it displays; your terminal is.
It's possible your terminal has a way to configure this, but I'd advise against it, as other programs are very likely to assume the de facto standard tabstop of 8. | 1 | 0 | 0 | How does one set number of spaces per tab key in interactive shell - I can't seem to find it, in the docs. | Python how to set number of spaces per tab key in interactive shell | 0.197375 | 0 | 0 | 188 |
27,514,985 | 2014-12-16T22:17:00.000 | 4 | 0 | 0 | 1 | python,google-app-engine | 34,706,288 | 2 | false | 1 | 0 | Yes!! What you are trying to do is not possible. The reason is that there are absolute references in the backup files to the original backup location (bucket). So moving the files to another GCS location will not work.
Instead you have to leave the backup files in the original GCS bucket and give your new project read ... | 2 | 8 | 0 | My goal was to duplicate my Google App Engine application. I created new application, and upload all needed code from source application(python). Then I uploaded previously created backup files from the Cloud Storage of the source application (first I downloaded those files to PC and than uploaded files to GCS bucket ... | Backup in one and restore in another Google App Engine application by using Cloud Storage? | 0.379949 | 1 | 0 | 961 |
27,514,985 | 2014-12-16T22:17:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine | 29,852,870 | 2 | false | 1 | 0 | Given the message, my guess is that the target application has no read access to the bucket where the backup is stores. Add the application to the permitted users to that bucket before creating the backup so that the backup objects will inherit the permission. | 2 | 8 | 0 | My goal was to duplicate my Google App Engine application. I created new application, and upload all needed code from source application(python). Then I uploaded previously created backup files from the Cloud Storage of the source application (first I downloaded those files to PC and than uploaded files to GCS bucket ... | Backup in one and restore in another Google App Engine application by using Cloud Storage? | 0.099668 | 1 | 0 | 961 |
27,517,192 | 2014-12-17T01:59:00.000 | 0 | 0 | 0 | 0 | python,cherrypy | 27,565,293 | 2 | false | 1 | 0 | Set tools.sessions.persistent to False | 1 | 0 | 0 | In cherrypy is there a configuration option so that sessions do not have a "timeout", or if they do, expire immediately when the browser is closed? Right now tools.sessions.on is true and tools.sessions.timeout is 60 minutes. | Cherrypy session timeout on browser closed? | 0 | 0 | 1 | 474 |
27,517,255 | 2014-12-17T02:05:00.000 | 0 | 0 | 1 | 1 | python,windows,command-line,command | 27,557,706 | 2 | false | 0 | 0 | Issue resolved. Since no feasible solution was found in 2 days, I decided to wipe all keys containing 'python' from registry as well as some files that were not parts of other programs. This resolved the issue after re-installing python.
If anyone finds the true cause of this misbehavior and other - less brutal - solut... | 1 | 1 | 0 | I seem to have problem launching python from command line. I tried various things with no success.
Problem: When trying to run python from the command line, there is no response i.e. I do not get message about 'command not found' and console does not launch. Only option to open python console is to run C:\Python34\pyth... | Python console not launching properly from command line | 0 | 0 | 0 | 632 |
27,517,939 | 2014-12-17T03:40:00.000 | 1 | 1 | 0 | 1 | python,c++,protocol-buffers | 27,687,619 | 1 | false | 0 | 1 | So this is a happy non-answer using my experience. The pure-python bindings for google protobuf are a terrible port of C/C++ stuff. However, I had quite a bit of success wrapping C google protobuf generated bindings using cffi. Someone should go ahead and create a more generic binding, but that would just a short consu... | 1 | 2 | 0 | Protobuf with pure python performance 3x slowly on pypy than CPython do.
So I try to use c++ implementation for pypy.
These are two error (PyFloatObject undefined and const char* to char*) when I compile protobuf(2.6.1 release) c++ implementation for pypy.
I compile successfully after I modify python/google/protobuf/py... | Is there any way to use Google Protobuf on pypy? | 0.197375 | 0 | 0 | 567 |
27,519,480 | 2014-12-17T06:21:00.000 | 1 | 0 | 1 | 0 | python,class,oop,iterator,python-3.4 | 27,519,520 | 3 | false | 0 | 0 | I don't quite get what you are meaning by body. I suppose you are talking about the definition of the method __iter__.
Well sometimes you could use yield to return a generator. In this case, you could write the generating logic in the body of __iter__.
Or returning another iterator might involve some logic. So it's not... | 2 | 1 | 0 | What is the significance of the body of the __iter__ method in a class definition in Python?
It is my understanding that an __iter__ method must return an iterator; then shouldn't every __iter__ method only contain a return statement which returns an iterator (defined elsewhere) ? Why is there a body in the __iter__ m... | What is the point of the body of the __iter__ method? | 0.066568 | 0 | 0 | 76 |
27,519,480 | 2014-12-17T06:21:00.000 | -1 | 0 | 1 | 0 | python,class,oop,iterator,python-3.4 | 27,519,544 | 3 | false | 0 | 0 | The iter method returns an iterator or defines a getitem method, taking sequential indexes starting from zero and raising an IndexError when the indexes are no longer valid. | 2 | 1 | 0 | What is the significance of the body of the __iter__ method in a class definition in Python?
It is my understanding that an __iter__ method must return an iterator; then shouldn't every __iter__ method only contain a return statement which returns an iterator (defined elsewhere) ? Why is there a body in the __iter__ m... | What is the point of the body of the __iter__ method? | -0.066568 | 0 | 0 | 76 |
27,519,822 | 2014-12-17T06:50:00.000 | 1 | 0 | 1 | 0 | python,class,numpy | 27,519,855 | 1 | false | 0 | 0 | You can't.
Stick a numpy array on your instance, and put whatever you want inside that. | 1 | 1 | 0 | For example, I would like to store attributes in a numpy array. | How can I change the container type for a class in python? | 0.197375 | 0 | 0 | 43 |
27,519,960 | 2014-12-17T07:02:00.000 | 10 | 0 | 0 | 0 | python,django,bokeh | 27,520,156 | 1 | false | 1 | 0 | No need to reinvent.
bokeh-server is a webserver and can listen on arbitrary port.
you can have your django webserver listen on some other arbitrary port.
... and integrate the two:
have redirects from django to bokeh-server, or
webserver in front, e.g. nginx which does reverse-proxy. | 1 | 13 | 0 | From what I read the dynamic and big data rendering capabilities of Bokeh are accessible by use of the bokeh-server.
In Bokeh documentation there is a brief mention of embedding the bokeh-server in a Flask application using the blueprint api. This option retains all of the Bokeh's dynamic and big data rendering capabil... | How to embed Bokeh server in Django application | 1 | 0 | 0 | 5,749 |
27,521,836 | 2014-12-17T09:09:00.000 | 1 | 0 | 1 | 0 | python,numpy | 27,522,080 | 1 | false | 0 | 0 | Objects of type numpy.array are n-dimensional, meaning they can represent 2-dimensional matrices, as well as 3D, 4D, 5D, etc.
The numpy.matrix, however, is designed specifically for the purpose of 2-dimensional matrices. As part of this specialisation, some of the operators are modified, for example * refers to matrix ... | 1 | 0 | 1 | It seesms like we can have n dimensional array by numpy.array
also numpy.matrix is exact matrix I want.
which one is generally used? | Which object in Numpy Python is good for matrix manipulation? numpy.array or numpy.matrix? | 0.197375 | 0 | 0 | 83 |
27,523,124 | 2014-12-17T10:13:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,google-cloud-datastore | 27,540,122 | 1 | true | 1 | 0 | No, it is done asynchronously and you are not able to control this process. Hooks available only for by key gets, not for index queries. Try to build your datastore with parent-child relationships, so you can do ancestor queries, they are always consistent. | 1 | 1 | 0 | Is there a way to know / detect if an object (after being put to the datastore) has been written to an index i.e. object would be visible in a relevant query? Maybe something like a hook method?
Thanks! | Completion of App Engine Index Writes (Python) | 1.2 | 0 | 0 | 45 |
27,528,859 | 2014-12-17T15:19:00.000 | 3 | 0 | 0 | 1 | python,google-app-engine,cron | 27,530,878 | 1 | false | 1 | 0 | You can schedule a cron job to run every hour, because every hour there is 9 am somewhere. | 1 | 0 | 0 | I want to schedule a task for 9:00 AM in every country. (basically 9:00 AM in every time zone). How can I schedule that in google appengine?
Will it take multiple timezones for time zone parameter?
Thanks in advance | Multiple Time Zones in Google Appengine Cron Job | 0.53705 | 0 | 0 | 571 |
27,534,078 | 2014-12-17T20:16:00.000 | 1 | 0 | 0 | 0 | python,django,django-models,django-templates,django-admin | 27,534,164 | 1 | true | 1 | 0 | Well you have to save it somewhere in order to map the user and the image....
So I can think of 2 solutions -
Have a field that stores the path. Then you can access it via the template, something like this - <img src="{{author.photo_path}}">
If you're saying the path might change, you can have a user ID for each user... | 1 | 0 | 0 | I'm creating a basic blog in Django. One of my classes is for the authors. Each contains Name, Position, Biography, etc., and I'm attempting to associate existing images with each author to be used as avatars, essentially.
FileField and ImageField aren't what I want to use as I already have images stored statically els... | Associate Existing Image File with Django Model | 1.2 | 0 | 0 | 360 |
27,538,582 | 2014-12-18T03:03:00.000 | 0 | 0 | 0 | 1 | python,scripting,hotkeys,hid | 28,269,358 | 1 | true | 0 | 0 | Uinput is the definitive, Kernel-guru sanctioned way to do this on Linux.
Thanks to @Reily Grant for the Mac info! | 1 | 0 | 0 | I couldn't find a way to do this on Mac and Linux. With Windows one could use ctypes and then use console.SendKeys. So far as I can tell there is certainly no way that Apple would let a humble user take over the mouse and keyboard, but how might an average Joe do this on Linux? Despite no findings, I would assume th... | Keyboard emulation in python, cross platform | 1.2 | 0 | 0 | 509 |
27,538,753 | 2014-12-18T03:22:00.000 | 0 | 0 | 1 | 0 | python,terminal,pycharm | 27,539,114 | 1 | false | 0 | 0 | I can't reproduce the issue you're experiencing. I remapped "Hide Active Tool Window" to Ctrl-Shift-H in PyCharm 4.0.3 on OS X and it worked fine.
Preferences -> (Search box) "keymap" -> (Keymap Search box) "hide active"
Right-click, Add Keyboard Shortcut | 1 | 2 | 0 | When using the terminal window in PyCharm, I cannot find a way to use a keyboard shortcut to close the terminal window, other than SHIFT+ESC. This particular keyboard shortcut is going to give me carpal tunnel. Trying to assign a custom keyboard shortcut like COMMAND+\ does not work. Also pressing the ESC key alone doe... | PyCharm 4.0 Terminal Window | 0 | 0 | 0 | 317 |
27,539,852 | 2014-12-18T05:35:00.000 | 1 | 0 | 1 | 0 | python,string,parsing,format,character | 27,539,969 | 4 | false | 0 | 0 | Do you mean the list method?
s='abccda'
list(s) # ['a', 'b', 'c', 'c', 'd', 'a'] | 1 | 2 | 0 | In Python 2.7 how do I parse 'abc' into 'a b c' for a very long string (like 1000 chars)?
Or how would I convert 'abccda' to '1 2 3 3 4 1'? (where each unique letter maps to a unique digit, 1-4)
I imagine I could pop the chars off, one by one, but I'm new to Python and wonder if there is a simple function that does it. | python parse string into individual chararcters | 0.049958 | 0 | 0 | 116 |
27,542,828 | 2014-12-18T09:08:00.000 | 2 | 0 | 0 | 0 | python-3.x,gtk2 | 27,592,574 | 1 | true | 0 | 1 | Technically, it is possible, but not advisable.
If you compile GTK 2.24 yourself with GObject introspection turned on, and don't have GTK 3.x installed, then you should be able to use from gi.repository import Gtk to access the GTK 2 API.
However, this is not supported in any way, and even prints out a warning message ... | 1 | 1 | 0 | I want to create some GTK+2 applications using Python 3. I searched many places, but can only find tutorials for using GTK+2 together with Python 2, using PyGtk, or GTK+3 together with Python 3, using PyGobject. Is there any way to create GTK+2 applications using Python 3? | Is it possible to create GTK+2.x applications using Python 3? | 1.2 | 0 | 0 | 824 |
27,553,319 | 2014-12-18T18:30:00.000 | 0 | 0 | 0 | 0 | python,python-3.x,urllib | 27,556,712 | 1 | false | 0 | 0 | Now how do I store the last known absolute url to extract the netloc
from it and append it to relative url? Should I save the last known
absolute URL in a text file?
What do you think is wrong with this? Seems to make sense to me... (depending on context, obviously) | 1 | 0 | 0 | I am new to Python programming. While making an application, I ran into this problem.
I am parsing URL using urllib library of python. I want to convert any relative url into its corresponding absolute url. I get relative and absolute URLs in random fashiion and they may not be from the same domain. Now how do I store... | URL parsing issue in python | 0 | 0 | 1 | 117 |
27,555,520 | 2014-12-18T20:55:00.000 | 1 | 0 | 1 | 0 | python,class | 27,555,893 | 2 | false | 0 | 0 | If your program starts assuming big dimensions, yes, you could split your classes or simply your functions according to what they do. Usually functions that do similar tasks or that work on the same data are put together.
To import a file containing a set of functions that you defined, if the file is in the same folder... | 1 | 0 | 0 | I am wondering if it would be a good idea to use different .py scripts for different parts of a Python program. Like one .py file for a calculator and another for class files and etc. If it is a good idea, is it possible?
If possible, where can I find how to do so?
I am asking this because I find it confusing to have ... | Is it a good idea to make use different Python scripts for programs? | 0.099668 | 0 | 0 | 545 |
27,558,514 | 2014-12-19T01:27:00.000 | -2 | 1 | 0 | 0 | python,pycharm,remote-access,interpreter | 53,589,468 | 3 | false | 0 | 0 | i meet the same error, file->settings checking your interpreter setting,
You don't set the 'host' and 'post',or your set but the content was clear. check again, and it truly work | 2 | 6 | 0 | I have a remote interpreter set up in PyCharm.
Everytime I close and reopen PyCharm, the connection seems to be broken, and the process to "reopen" the connection doesn't feel efficient to me.
Before doing the following, it is not possible to run any script.
Here is what I usually do:
File -> Settings
Project -> Proj... | Connecting to remote interpreter when starting PyCharm | -0.132549 | 0 | 0 | 10,796 |
27,558,514 | 2014-12-19T01:27:00.000 | 2 | 1 | 0 | 0 | python,pycharm,remote-access,interpreter | 27,585,038 | 3 | false | 0 | 0 | This was a bug in version 4.0.2 of PyCharm and was corrected in version 4.0.3.
Edit: No longer true. I tried with another computer and having the most recent version doesn't fix the problem. | 2 | 6 | 0 | I have a remote interpreter set up in PyCharm.
Everytime I close and reopen PyCharm, the connection seems to be broken, and the process to "reopen" the connection doesn't feel efficient to me.
Before doing the following, it is not possible to run any script.
Here is what I usually do:
File -> Settings
Project -> Proj... | Connecting to remote interpreter when starting PyCharm | 0.132549 | 0 | 0 | 10,796 |
27,559,330 | 2014-12-19T03:32:00.000 | 1 | 0 | 1 | 0 | python,django,terminal,komodoedit | 27,559,411 | 1 | true | 1 | 0 | Let's start from the beginning:
You are in your project folder eg /home/me/myproject
You create a new virtualenv, eg virtualenv /home/me/virtualenvs/myprojectenv
You activate the new virtualenv:
source /home/me/virtualenvs/myprojectenv/bin/activate
...this means that python and pip commands now point to the versions i... | 1 | 0 | 0 | I sincerely apologize for the noobish dribble thats about to come out here:
Okay so I am following along with a youtube tutorial using terminal/django/komodo edit to make a simple website. This is my first time really using terminal, I am having issues. I have read up on the terminal and searched this site for my que... | Terminal/django/komodo edit | 1.2 | 0 | 0 | 323 |
27,561,003 | 2014-12-19T06:48:00.000 | 1 | 0 | 0 | 1 | python,svn,jenkins | 27,594,747 | 1 | false | 0 | 0 | I'd not do this. There isn't an OOTB solution as this would generally be seen as a terrible idea - committing on at least two levels:
1. committing derived artifacts is sub-optimal
2. committing binaries is sub-optimal
However if I absolutely had too I'd setup a job that did the binary commit that shared the same work... | 1 | 0 | 0 | Is there any OOTB way to get a post build step to push the results of a Jenkins build back to a (Subversion) repository? We use one repository for sources and another to record the binaries for every commit to trunk (very useful for debugging). The Jenkins pull on the source SVN repository change works perfectly, the... | Jenkins: How to push build artifacts back to source control? | 0.197375 | 0 | 0 | 620 |
27,564,320 | 2014-12-19T10:42:00.000 | 2 | 1 | 1 | 0 | python,regex,raspberry-pi,raspbian | 27,578,046 | 1 | false | 0 | 0 | Python itself supports regexes (via a built-in module). If you're just interested in playing around with them, import re in an interactive shell, and you have access to Python's regular expression engine. | 1 | 2 | 0 | Is there an editor that I could install on the Raspbian OS to practice Regex with? If not, what about through Python? If so, is there a good python IDE out there for Raspbian that supports Regexs? | Using Regular Expressions on my Raspberry Pi | 0.379949 | 0 | 0 | 335 |
27,567,450 | 2014-12-19T13:48:00.000 | 0 | 0 | 0 | 1 | python-2.7,subprocess | 27,570,551 | 1 | false | 0 | 0 | REINSTALLING the python bindings resolved my issue. I don't see GDAL on the paths below but its working now. Is it supposed to be there so since its not, I might probably have another round of GDAL head scratching in the future?
:::::::::::::::::::::::::::::::::::::::
THIS is what I currently have when I type in sys.pa... | 1 | 0 | 0 | I get an error when trying to run ogr2ogr thru subprocess but I am able to run it using just the windows command prompt. The script will be part of a series of processes that start with batch importing gpx files unto a postgres db. Can somebody please tell me what's wrong? Thanks!
::::::::::::::::::::::::::::
Running T... | ERROR: 'ogr2ogr' is not recognized as an internal or external command, operable program or batch file when running ogr2ogr in python script | 0 | 1 | 0 | 1,962 |
27,567,560 | 2014-12-19T13:56:00.000 | 18 | 0 | 1 | 0 | python,anaconda,miniconda | 27,584,745 | 1 | true | 0 | 0 | You can safely delete the tar.bz2 files. They are only used as a cache. The command conda clean -t will clean them automatically. | 1 | 22 | 0 | On my desktop PC I have anaconda installed, and on my laptop - to save space - I thought i'd install miniconda and be selective about the modules I install. So I installed a handful, numpy, scipy etc. I didn't install anything which isn't part of the default anaconda install, but I just realized my miniconda install is... | Anaconda vs miniconda space | 1.2 | 0 | 0 | 10,520 |
27,568,886 | 2014-12-19T15:18:00.000 | 1 | 0 | 1 | 0 | python,python-2.7,opencv,numpy,upgrade | 27,580,194 | 2 | false | 0 | 0 | Upgrading to new version can give you more stable and featured version. Usually this is the case - version 2.7 is mature and stable. I think you do not need to re-install/reconfigure the packages again because of this stability (2.7.6 and 2.7.9 are 2.7 anyway). Problems are hardly possible, although they may be in very... | 1 | 4 | 1 | I'm using Python for my research. I have both version of Python on my system: 3.3.2 and 2.7.6. However due to the compatibility with the required packages (openCV, Numpy, Scipy, etc.) and the legacy code, I work most of the time with Python 2.7.6.
It took me quite a lot of effort at the beginning to set up the environm... | Install Python 2.7.9 over 2.7.6 | 0.099668 | 0 | 0 | 11,082 |
27,572,366 | 2014-12-19T19:04:00.000 | 3 | 0 | 1 | 1 | python,windows,cmd | 27,572,488 | 3 | false | 0 | 0 | You'll have to make changes to the PATH environmental variable. To do this, click the Start button, right click on "Computer", hit "Properties", click "Advanced System Settings" in the left sidebar. Then click the Environmental Variables button.
Under User or System variables, there will be a variable called "PATH" tha... | 2 | 4 | 0 | I have both Python 2.7 and 3.4 installed on my Windows Machine. When I type Python in CMD it defaults to Python2.7. How do I switch to 3.4? | Changing between Python 2.x and 3.x in windows CMD? | 0.197375 | 0 | 0 | 6,850 |
27,572,366 | 2014-12-19T19:04:00.000 | 2 | 0 | 1 | 1 | python,windows,cmd | 33,028,953 | 3 | false | 0 | 0 | Simply changing the name of the python.exe to anything (ex:pytoioion.exe) in your C:/Python34 or C:/Python27 will switch between the two versions. To verify, run this on your command prompt
C:Users/(your_name)>python | 2 | 4 | 0 | I have both Python 2.7 and 3.4 installed on my Windows Machine. When I type Python in CMD it defaults to Python2.7. How do I switch to 3.4? | Changing between Python 2.x and 3.x in windows CMD? | 0.132549 | 0 | 0 | 6,850 |
27,577,032 | 2014-12-20T04:49:00.000 | 3 | 0 | 0 | 0 | python,html | 27,577,078 | 1 | true | 0 | 0 | Yes. Cloudflare can block bots from downloading files. Blocking is usually done by detecting the user-agent or including javascript in a webpage. I would examine the pdf file in notepad and see what it contains also try adding a user-agent option in your python code. | 1 | 1 | 0 | I am writing a program in python that will automatically download pdf files from a website once a day.
When trying to test I noticed that the files downloaded had the correct extension but they are very small (<1kB) compared to the normal size of about 100kB when downloaded manually.
Can a website block a program from ... | Can a website stop a program from downloading files automatically? | 1.2 | 0 | 1 | 76 |
27,577,522 | 2014-12-20T06:03:00.000 | -3 | 0 | 1 | 0 | python,list | 27,577,549 | 2 | false | 0 | 0 | Couldn't you do
max([m(p) for p in pairs]) | 1 | 0 | 0 | Suppose I have a list of tuples: pairs = [(4,5),(2,6),(6,9),(8,7),(1,1)].
And I have a function def m(pair): return pair[0]**2 + pair[1]**2.
I seek to find the element of pairs for which m returns the greatest output. Specifically, I want to do this as pythonically as possible.
It is clear to me that I could do this w... | Most Pythonic Way to Select Particular Tuple from List of Tuples | -0.291313 | 0 | 0 | 66 |
27,577,584 | 2014-12-20T06:13:00.000 | 0 | 0 | 0 | 0 | python,selenium | 27,580,663 | 2 | false | 0 | 0 | chromedriver needs to be installed on the machine that will launch the instance of the Chrome browser.
If the machine that launches the Chrome instance is the same machine as where the Python script resides, then the answer to your question is "yes".
If the machine that launches the Chrome instance is a machine differ... | 1 | 0 | 0 | I have tried searching the official documentation, but no result. Does Chrome Web Driver needs to be in client's system for a python script using Selenium to run? I basically want to distribute compiled or executable file versions of the application to the end user. How do i include Chrome Web driver with that package? | Does Chrome Web Drivers needs to be in Client's System while using Selenium | 0 | 0 | 1 | 179 |
27,584,321 | 2014-12-20T21:05:00.000 | 2 | 0 | 0 | 0 | python,amazon-dynamodb,boto,sample | 27,599,549 | 2 | true | 0 | 0 | Use Table.scan(max_page_size=1000) | 1 | 2 | 0 | I am using amazon dynamodb and accessing it via the python boto query interface. I have a very simple requirement
I want to get 1000 entries. But I don't know the primary keys beforehand. I just want to get 1000 entries. How can I do this? ...I know how to use the query_2 but that requires knowing primary keys beforeh... | python dynamodb get 1000 entries | 1.2 | 0 | 1 | 1,903 |
27,584,508 | 2014-12-20T21:29:00.000 | 0 | 0 | 0 | 0 | python,django,mysql-python,selinux | 27,734,160 | 4 | false | 1 | 0 | Couple of permission issues that I notice:
Make sure your credentials for mySQLdb have access to the database.
If you are using IP and Port to connect to the database, try using localhost.
Make sure the user (chmod permissions) have access to the folder where mySQL stores stuff. Sometimes when storing media and things... | 1 | 8 | 0 | I'm using the mySQLdb module within my django application which is linked to Apache via WSGI.
However I'm getting permission issues (shown below). This is down to SElinux and if I set it to passive everything is ok.
ImproperlyConfigured: Error loading MySQLdb module:
/opt/django/virtenv/django15/lib/python2.7/site-p... | Python MySQLdb with SELinux | 0 | 1 | 0 | 1,090 |
27,586,108 | 2014-12-21T02:02:00.000 | 0 | 0 | 0 | 0 | python-3.x,tkinter,exe,py2exe | 29,677,578 | 1 | false | 0 | 1 | As far as I understand there is not a version of py2exe for python3.x
You'd be best of going for cx_freeze (Sentdex also has a tutorial on that on that) | 1 | 0 | 0 | I have made a small program in Python that involves tkinter, and I made it a pyw file because it has a shortcut on the desktop and I do not want the command prompt to get in the way. I used py2exe following the sentdex tutorial on youtube, and I got an output file, but the output file shows an error and exits before I ... | Python py2exe with tkinter (pyw file) | 0 | 0 | 0 | 216 |
27,587,347 | 2014-12-21T06:52:00.000 | 0 | 0 | 1 | 0 | python | 35,722,925 | 1 | false | 0 | 0 | Your description is too generic, but I'll answer as to what is the most likely issue: your environment.
Fundamentally, eclipse does NOT use the pythonpath set in your environment. It has its own internal configuration (python interpreter, pythonpath, etc...).
So make sure your environment variables match your eclipse c... | 1 | 0 | 0 | I made a small game of pong in python and the idle I used was eclipse and all of it works (for the most part). But when I try to run the game through the python launcher rather than eclipse it crashes immediately. In fact any program that I make in eclipse won't run outside of it. I'm basically trying to figure out how... | running python modules in python launcher | 0 | 0 | 0 | 60 |
27,592,456 | 2014-12-21T18:32:00.000 | 119 | 0 | 1 | 0 | python,pandas,series,floor,ceil | 27,592,508 | 5 | true | 0 | 0 | You can use NumPy's built in methods to do this: np.ceil(series) or np.floor(series).
Both return a Series object (not an array) so the index information is preserved. | 1 | 92 | 1 | I have a pandas series series. If I want to get the element-wise floor or ceiling, is there a built in method or do I have to write the function and use apply? I ask because the data is big so I appreciate efficiency. Also this question has not been asked with respect to the Pandas package. | Floor or ceiling of a pandas series in python? | 1.2 | 0 | 0 | 103,550 |
27,594,703 | 2014-12-21T23:04:00.000 | 1 | 0 | 0 | 0 | python,django,sqlite | 27,594,818 | 1 | true | 1 | 0 | The user accessing the database (www-data?) needs to have write privileges to the folder the data resides in as well as the file itself. I would probably change the group ownership (chgrp) of the folder to www-data and add a group sticky bit to the folder as well (chmod g+s dbfolder). The last one makes sure that any... | 1 | 2 | 0 | I am trying to get writing privileges to my sqlite3.db file in my django project hosted on bluehost, but I cannot get any other chmod command to work besides the dangerous/risky chmod 777. When I chmod 777 the db file and the directory, everything works perfectly.
However, in order to be more prudent, I’ve tried chmod... | Django on CentOS/Bluehost: Attempt to Write a Readonly Database, which Chmod besides 777 to use? | 1.2 | 1 | 0 | 310 |
27,596,890 | 2014-12-22T05:11:00.000 | 0 | 0 | 0 | 0 | python,excel,charts | 27,599,618 | 1 | true | 0 | 0 | It seems that all the python module could only create excels but not activate existing charts. Try xlrd and xlwt. Good luck. | 1 | 0 | 0 | I use python 2.7.3 and Windows7.
I want to decorate the Excel chart by using Python.
It's not necessary to make charts from start to end.
First step(EXCEL STEP), I store data in the Excel sheet and make line chart roughly.
(by selecting data range and using hot-key 'ALT+N+N+enter')
Next step(PYTHON STEP), I want to m... | Selecting or activating existing Excel chart | 1.2 | 1 | 0 | 191 |
27,597,017 | 2014-12-22T05:29:00.000 | 2 | 0 | 1 | 0 | python-3.4,spyder,splinter | 27,599,980 | 1 | true | 0 | 0 | Okay. So, I could make it work with a work-around.
Inspite of adding C:\Python34 & its Lib (site-packages) folder to PATH environment variable and Spyder's Python Path Manager, it failed to recognize splinter package while running the code in Spyder. So, I copied & pasted Splinter (followed by Selenium) package-folders... | 1 | 1 | 0 | Though splinter is installed on my Windows Vista, spyder gives an error when I import it.
When I import in windows command prompt, it successfully imports & also shows path to the init file.
Have added explicit path in PYTHONPATH Manager of Spyder and Updated module list. Yet, did not help.
Have checked my PATH enviro... | Spyder not recognizing splinter | 1.2 | 0 | 0 | 1,149 |
27,600,761 | 2014-12-22T10:24:00.000 | 1 | 0 | 0 | 0 | python,scrapy | 27,602,635 | 1 | true | 1 | 0 | If the request has the dont_filter attribute set, the offsite middleware will allow the request even if its domain is not listed in allowed domains. | 1 | 1 | 0 | So I've been wondering regarding a spider, if maybe some of my requests might be getting filtered because they are to the url endpoint but with different body arguments (form data). Does the dont_filter=True make sense with FormRequest object? | scrapy: does it make sense to disable filtering on a formrequest? | 1.2 | 0 | 1 | 134 |
27,603,128 | 2014-12-22T12:52:00.000 | 2 | 1 | 0 | 0 | python,design-patterns,sequence,bioinformatics | 27,603,419 | 3 | false | 0 | 0 | I would do this in two steps. First, translate the nucleotide sequence into the amino acid sequence, using a mapping of codon to amino acid (CAT maps to H, CAC maps to H, CGT maps to R, CGC maps to R, etc.). Second, use the Boyer-Moore algorithm to search for specific amino acid sequences, or regular expressions if y... | 2 | 0 | 0 | I am trying to generate a nucleotide motif that will code chosen amino acids. For example - histidine is coded by CAT, CAC. Arginine is CGT, CGC, CGA, CGG,AGA and AGG. The pattern is:
position in codon - C or A
position in codon - A or G
position - A, T, C or G
by that rule you can define chosen amino acids (H and R)... | Bioinformatics - common motif for amino acids | 0.132549 | 0 | 0 | 235 |
27,603,128 | 2014-12-22T12:52:00.000 | 0 | 1 | 0 | 0 | python,design-patterns,sequence,bioinformatics | 27,894,330 | 3 | true | 0 | 0 | The problem was solved:
1) I made a library of all codons from the aminoacids of choise (ex. Met and Trp are AUG and UGG - so library of all combinations consists of [A/U][U/G][G] - AUG,AGG,UUG,UGG
2) Created two lists - first of "good" aminoacids - AUG, UGG and second of "bad" - AGG, UUG
3) Calculated the amount of "g... | 2 | 0 | 0 | I am trying to generate a nucleotide motif that will code chosen amino acids. For example - histidine is coded by CAT, CAC. Arginine is CGT, CGC, CGA, CGG,AGA and AGG. The pattern is:
position in codon - C or A
position in codon - A or G
position - A, T, C or G
by that rule you can define chosen amino acids (H and R)... | Bioinformatics - common motif for amino acids | 1.2 | 0 | 0 | 235 |
27,604,441 | 2014-12-22T14:16:00.000 | 0 | 0 | 1 | 0 | python | 27,604,701 | 3 | false | 0 | 0 | %f stands for Fixed Point and will force the number to show relative to the number 1 (1e-3 is shown as 0.001). %e stands for Exponential Notation and will give you what you want (1e-3 is shown as 1e-3). | 2 | 0 | 1 | I have some values that I need to print in scientific notation (values of the order of 10^-8, -9)
But I would like to don't print a long number, only two digits after the .
something as:
9.84e-08
and not
9.84389879870496809597e-08
How can I do it? I tried to use
"%.2f" % a
where 'a' is the number containing the v... | how to print finite number of digits USING the scientific notation | 0 | 0 | 0 | 93 |
27,604,441 | 2014-12-22T14:16:00.000 | 2 | 0 | 1 | 0 | python | 27,604,491 | 3 | true | 0 | 0 | try with this :
print "%.2e"%9.84389879870496809597e-08 #'9.84e-08' | 2 | 0 | 1 | I have some values that I need to print in scientific notation (values of the order of 10^-8, -9)
But I would like to don't print a long number, only two digits after the .
something as:
9.84e-08
and not
9.84389879870496809597e-08
How can I do it? I tried to use
"%.2f" % a
where 'a' is the number containing the v... | how to print finite number of digits USING the scientific notation | 1.2 | 0 | 0 | 93 |
27,608,053 | 2014-12-22T18:02:00.000 | 1 | 0 | 0 | 0 | python,opencv,image-processing | 27,689,079 | 1 | true | 0 | 0 | There is a standard Python functionimghdr.what. It rulez!
^__^ | 1 | 1 | 1 | I read an image (of unknown format, most frequent are PNGs or JPGs) from a buffer.
I can decode it with cv2.imdecode, I can even check if it is valid (imdecode returns non-None).
But how can I reveal the image type (PNG, JPG, something else) of the buffer I've just read? | OpenCV: how to get image format if reading from buffer? | 1.2 | 0 | 0 | 2,355 |
27,608,372 | 2014-12-22T18:27:00.000 | 6 | 0 | 0 | 0 | python,flask | 27,608,409 | 2 | true | 1 | 0 | Anything that is static, app-wide, doesn't change much, and has important information for all users, should use config. (e.g. secret keys, options to modify the app from project to project, emails, generic messages)
Session should only be used to store relevant user data as the data is modified through each page. (e.g.... | 2 | 1 | 0 | Is there a rule for when to use Flask.config vs. flask.session to store variables? | When should I use the Flask.config vs. use flask.session? | 1.2 | 0 | 0 | 170 |
27,608,372 | 2014-12-22T18:27:00.000 | 4 | 0 | 0 | 0 | python,flask | 27,608,411 | 2 | false | 1 | 0 | Yes, most definitely.
The config is for global, project-level variables: the location of files, keys for any APIs you might be using, your database access settings, things like that.
The session is for variables related to the current user's session on the site: their previous choices on a multi-page form, preferences,... | 2 | 1 | 0 | Is there a rule for when to use Flask.config vs. flask.session to store variables? | When should I use the Flask.config vs. use flask.session? | 0.379949 | 0 | 0 | 170 |
27,614,494 | 2014-12-23T05:21:00.000 | 0 | 0 | 0 | 0 | python,django,django-migrations | 27,615,457 | 2 | false | 1 | 0 | I have done the migration from 1.6 to 1.7 on an existing project. It was fairly painless.
I renamed my old South migrations folders and let the django 1.7 migrations create a new one. (i.e. $mv appname/migrations appname/migrations.south) That will make it easier to go back to South for any reason and will keep fro... | 1 | 0 | 0 | I have a Django application initially created for version 1.6 and I've just finished the upgrade for the last version. All the models has managed = False and prior none of them was managed by south and now I want to start using Django migrations for 1.7 version.
Which would be the best and seamless way to do it? I'm af... | Best way to add Django migrations to a django project | 0 | 0 | 0 | 635 |
27,615,219 | 2014-12-23T06:33:00.000 | 0 | 0 | 0 | 0 | wxpython,customdialog | 27,622,152 | 1 | true | 0 | 1 | Just create self.C in your custom dialog's __init__ method. Then bind your OK button to a handler and update it as you mentioned. Then you should be able to get its value just as you stated: value = dlg.C.GetValue().
One thing to keep in mind is that when you create the OK button, do not set its id to wx.OK. If you do,... | 1 | 1 | 0 | I have create some custom dialogs in wxpython that I am very happy with. I can execute pretty much anything I want based on user interaction and then once "OK" is selected collect the information from whatever functions I have run.
What I am wondering is there a way to execute a final function at the time "OK" is sele... | WXPYTHON CUSTOM DIALOG | 1.2 | 0 | 0 | 237 |
27,615,239 | 2014-12-23T06:34:00.000 | 3 | 0 | 1 | 0 | python,interpreter | 27,615,291 | 3 | false | 0 | 0 | The .py extension is a convention. You can, in fact, invoke the interpreter on any file. In some cases, however, keeping with the convention is important. For example, if you write a module (something that you import) then the interpreter won't "guess" that your python source code is hiding in a .txt file. It will sear... | 3 | 1 | 0 | I found this fact Interesting , The interpreter seems to be working fine with python ex1.txt , though It should have been ex1.py . What may be the reason for this ? Is there any documentation on this type of behaviour . The ex1.py or ex1.txt are the having the same print "hello", will this change if I have any code cha... | What's the difference between .py and .txt for an Interpreter in python? | 0.197375 | 0 | 0 | 2,252 |
27,615,239 | 2014-12-23T06:34:00.000 | 9 | 0 | 1 | 0 | python,interpreter | 27,615,288 | 3 | true | 0 | 0 | There should be no difference once the Python has been launched; that is, the interpreter itself does not handle Python source-code differently depending on the source file's extension.
However, the .py extension has special meaning for the import statement, which looks for modules. A module is (generally) either a te... | 3 | 1 | 0 | I found this fact Interesting , The interpreter seems to be working fine with python ex1.txt , though It should have been ex1.py . What may be the reason for this ? Is there any documentation on this type of behaviour . The ex1.py or ex1.txt are the having the same print "hello", will this change if I have any code cha... | What's the difference between .py and .txt for an Interpreter in python? | 1.2 | 0 | 0 | 2,252 |
27,615,239 | 2014-12-23T06:34:00.000 | 2 | 0 | 1 | 0 | python,interpreter | 27,615,307 | 3 | false | 0 | 0 | Extensions are more like recommendations. There are generally two types of files - binary and ASCII. Binary files are pretty much just ones and zeroes, and are usually executable, but not editable. Binary files include something like a .docx file, because even though you can open it in Microsoft Word (which can decode ... | 3 | 1 | 0 | I found this fact Interesting , The interpreter seems to be working fine with python ex1.txt , though It should have been ex1.py . What may be the reason for this ? Is there any documentation on this type of behaviour . The ex1.py or ex1.txt are the having the same print "hello", will this change if I have any code cha... | What's the difference between .py and .txt for an Interpreter in python? | 0.132549 | 0 | 0 | 2,252 |
27,616,098 | 2014-12-23T07:44:00.000 | 0 | 0 | 0 | 0 | python,web,pyramid | 27,616,278 | 2 | false | 1 | 0 | You need a table with current editor, record_id and timeout. The first editor asks per POST-request to edit a record and you put a new line in this table, with a reasonable timeout, say 5 min. The first editor gets an "ok" in return. For the second editor you find a match for the record_id in the table, look at the tim... | 1 | 1 | 0 | I'm developing intranet web app that is based on Pyramid with SQLAlchemy.
It eventually may (will) happen that 2 users will edit the same record. How can I handle the requirement to notify the user who started editing later that particular record is being edited by the first user? | Notifying user's browser of change without websockets | 0 | 1 | 0 | 55 |
27,616,903 | 2014-12-23T08:49:00.000 | 1 | 0 | 1 | 0 | python,argparse,python-2.x,optparse | 27,628,187 | 2 | true | 0 | 0 | Based on discussions that I've seen on the Python bug issue site, optparse is not really deprecated. Don't expect further development, but it isn't going to disappear any time soon.
All of argparse is contained in one file, argparse.py. So you could grab that from almost anywhere, and put it on your load path. A pos... | 1 | 0 | 0 | I did a quick research into documentation and did not find any evidence that suggests argparse is supported before 2.6. We have development network as well as servers that use Python 2.5.1 to do a lot of things. I had an idea to upgrade it, but didn't realise that there is a change request process that needs to be gone... | Availability of argparse in Python 2.x versions | 1.2 | 0 | 0 | 607 |
27,626,783 | 2014-12-23T19:28:00.000 | 0 | 0 | 0 | 0 | python,selenium | 70,415,232 | 2 | false | 0 | 0 | Try relocating elements each time it goes back to previous page. That will surely work but it is time consuming. | 1 | 44 | 0 | I have created a little screen scraper and everything seems to be working great, the information is being pulled and saved in a db. The only problem I am having is sometimes Python doesn't use the driver.back() so it then trys to get the information on the wrong page and crashes. I have tried adding a time.sleep(5) but... | Python selenium browser driver.back() | 0 | 0 | 1 | 58,493 |
27,627,619 | 2014-12-23T20:34:00.000 | 0 | 0 | 0 | 0 | python,browser,size | 27,627,672 | 1 | false | 1 | 0 | I am not sure about what you are trying to do, but I have pretty good reasons to believe that this is something you want to handle in your css/js side of the application.
I am not familiar with app-engine, but the browser does not send it's viewport size with requests (unless you put it yourself in request data).
So if... | 1 | 0 | 0 | I am using WebApp2 with python (and app-engine). Is there a way to tell the screen size of the browser in python? I am trying to figure if the browser size is less than 768. | how to tell browser screen size in python | 0 | 0 | 0 | 209 |
27,628,174 | 2014-12-23T21:22:00.000 | 2 | 0 | 0 | 0 | python,heroku,host,crossbar | 27,666,089 | 1 | true | 1 | 0 | For the host use 0.0.0.0. For the port number it's slightly more complicated...
When it creates a web dynamo Heroku sets a PORT environment variable with the dynamo's port. To set this in crossbar you need to create a script that reads that variable and writes it into your config wherever the port is requested. Then yo... | 1 | 3 | 0 | I'm trying to get a Crossbar.io app running on Heroku. Crossbar.io requires you to put the app's host in a config file that's used to launch the app. I've tried the following:
my-app-name.herokuapp.com: No dice. I imagine Heroku does some fancy redirection internally that prevents this from working.
$HOSTNAME: running... | Get host and port for Heroku app | 1.2 | 0 | 0 | 1,682 |
27,628,753 | 2014-12-23T22:10:00.000 | 1 | 0 | 0 | 0 | python,network-programming,client-server,port,server | 27,628,809 | 3 | false | 0 | 0 | In order to do that the server must listen on a certain port(s).
This means the client(s) will need to interact on these ports with it.
So... no it is impossible to do that on some random unknown port. | 3 | 1 | 0 | I'm trying to build a simple python server that a client can connect to without the client having to know the exact portnumber. Is that even possible? The thought is to choose a random portnumber and using it for clients to connect.
I know you could use bind(host, 0) to get a random port number and socket.getsockname(... | How to give a python client a port number from a python server | 0.066568 | 0 | 1 | 689 |
27,628,753 | 2014-12-23T22:10:00.000 | 0 | 0 | 0 | 0 | python,network-programming,client-server,port,server | 27,630,673 | 3 | false | 0 | 0 | Take a look at Zeroconf, it seems to be the path to where you are trying to get to. | 3 | 1 | 0 | I'm trying to build a simple python server that a client can connect to without the client having to know the exact portnumber. Is that even possible? The thought is to choose a random portnumber and using it for clients to connect.
I know you could use bind(host, 0) to get a random port number and socket.getsockname(... | How to give a python client a port number from a python server | 0 | 0 | 1 | 689 |
27,628,753 | 2014-12-23T22:10:00.000 | 0 | 0 | 0 | 0 | python,network-programming,client-server,port,server | 27,628,855 | 3 | false | 0 | 0 | You need to advertise the port number somehow. Although DNS doesn't do that (well, you could probably cook up some resource record on the server object, but that's not really done) there are many network services that do. LDAP like active directory (you need write rights), DNS-SD dns service discovery, universal plug a... | 3 | 1 | 0 | I'm trying to build a simple python server that a client can connect to without the client having to know the exact portnumber. Is that even possible? The thought is to choose a random portnumber and using it for clients to connect.
I know you could use bind(host, 0) to get a random port number and socket.getsockname(... | How to give a python client a port number from a python server | 0 | 0 | 1 | 689 |
27,629,227 | 2014-12-23T22:57:00.000 | -1 | 0 | 0 | 0 | python,scipy,least-squares,intel-mkl | 45,621,086 | 1 | false | 0 | 0 | You could try Intel's python distribution. It includes a pre-built scipy optimized with MKL. | 1 | 6 | 1 | I'm doing a Monte Carlo simulation in Python in which I obtain a set of intensities at certain 2D coordinates and then fit a 2D Gaussian to them. I'm using the scipy.optimize.leastsq function and it all seems to work well except for the following error:
Intel MKL ERROR: Parameter 6 was incorrect on entry to DGELSD.
Th... | Intel MKL Error with Gaussian Fitting in Python? | -0.197375 | 0 | 0 | 860 |
27,629,281 | 2014-12-23T23:03:00.000 | 0 | 0 | 1 | 0 | python,python-idle | 27,642,836 | 2 | false | 0 | 0 | No, not now. Since you are at least the second person to ask this, I added the idea to my personal list of possible enhancements. However, while running a selection would not be a problem, producing accurate tracebacks for exception would be. Doing so is an essential part of Python's operation.
Currently, one can di... | 1 | 0 | 0 | I am new to python programming... Just wanted to know does IDLE has a concept of 'executing selected statements'??
F5 runs the whole program... Is there any way to do this? | Python: Executing selected statements | 0 | 0 | 0 | 211 |
27,632,485 | 2014-12-24T06:25:00.000 | 1 | 1 | 1 | 0 | python,c++,ide,cloud,saas | 27,633,513 | 1 | true | 0 | 0 | Based on Wikipedia:
Software as a service (SaaS) is a software licensing and delivery
model in which software is licensed on a subscription basis and is
centrally hosted
There are many implementations of SaaS. Such as ERP, CRM, CMS, etc. Find out by your self what kind of service will you offer to your customers.... | 1 | 0 | 0 | I want to make simple online IDE with cloud storage feature, let us say this should be implement in C++,Python ,etc...
Does it SaaS (I mean the IDE :-) ) ?
I'm new in SaaS and Cloud world , where to start to make something like what I said above ?
Thanks. | Integrated Development Environment with SaaS | 1.2 | 0 | 0 | 140 |
27,633,641 | 2014-12-24T08:09:00.000 | 1 | 0 | 0 | 0 | javascript,python,amazon-s3 | 27,647,682 | 1 | true | 1 | 0 | I'd suggest spinning up one or more EC2 instances and running your thumbnail job there. You'll eliminate almost all lot of the bandwidth costs (free from ec2 instances in the right region to s3), and certainly the transfer speed will be faster within the AWS network.
For 600K files to process, you may want to consider ... | 1 | 0 | 0 | I have about 600k images url (in a list) and I would like to achieve the following :
Download all of them
generate a thumbnail of specific dimensions
upload them to Amazon s3
I have estimated my images average to about 1mb which would be about 600gb of data transfer for downloads. I don't believe my laptop and my I... | Bulk download of web images | 1.2 | 0 | 1 | 83 |
27,635,631 | 2014-12-24T10:46:00.000 | 1 | 0 | 1 | 0 | python,pip | 28,909,169 | 2 | false | 0 | 0 | I don't know how long the following solution has been around for, but I found you can simply run
pip install my_compressed_package.tar.gz
and pip will know what to do. All done locally, no network access needed. | 1 | 1 | 0 | I am unable to install multiple packages listed in a file using single command line, I know that we can install multiple packages listed in a file using -r switch and we can use local sources to install using --no-index --find-links switches, but I am not sure if we can combine these two, I tried but its not working, s... | pip install multiple packages listed in file with sources from local directory | 0.099668 | 0 | 0 | 4,130 |
27,637,281 | 2014-12-24T12:53:00.000 | 27 | 0 | 0 | 0 | python,r,pandas | 27,637,837 | 8 | true | 0 | 0 | summary() ~ describe()
head() ~ head()
I'm not sure about the str() equivalent. | 1 | 69 | 1 | I'm only aware of the describe() function. Are there any other functions similar to str(), summary(), and head()? | What are Python pandas equivalents for R functions like str(), summary(), and head()? | 1.2 | 0 | 0 | 53,740 |
27,641,616 | 2014-12-24T19:51:00.000 | 1 | 1 | 0 | 0 | python,database,numpy,dataset,storage | 27,641,772 | 1 | true | 0 | 0 | Reading 500 files in python should not take much time, as the overall file size is around few MB. Your data-structure is plain and simple in your file chunks, it ll not even take much time to parse I guess.
Is the actual slowness is bcoz of opening and closing file, then there may be OS related issue (it may have very... | 1 | 0 | 1 | I've accumulated a set of 500 or so files, each of which has an array and header that stores metadata. Something like:
2,.25,.9,26 #<-- header, which is actually cryptic metadata
1.7331,0
1.7163,0
1.7042,0
1.6951,0
1.6881,0
1.6825,0
1.678,0
1.6743,0
1.6713,0
I'd like to read these arrays into memory selectively. W... | Better way to store a set of files with arrays? | 1.2 | 0 | 0 | 66 |
27,642,293 | 2014-12-24T21:26:00.000 | 0 | 0 | 0 | 0 | android,qpython3 | 27,642,399 | 1 | false | 0 | 1 | Try to run it in console because you can communicate with the interpreter directly | 1 | 0 | 0 | Im using Qpython3 on Android 4.2.2. Im currently able to list the latest sms from a particular contact and extract a 10 digit phone number. I want to update a contact's phone number with this number.
How should I do this ?
To be more precise, I want to be able to:
Access the contact list.
Update contact phone number ... | How do I add a phone number to a contact using Qpython3 | 0 | 0 | 0 | 90 |
27,645,172 | 2014-12-25T07:32:00.000 | 0 | 1 | 0 | 0 | python,nginx,uwsgi | 27,646,090 | 1 | false | 1 | 0 | The limit here is nginx. It cannot avoid (unless when in websockets mode) buffering the input. You may have more luck with apache or the uWSGI http router (albeit i suppose they are not a viable choice) | 1 | 0 | 0 | I have an api with publishers + subscribers and I want to stop a publisher from uploading a lot of data if there are no subscribers. In an effort to avoid another RTT I want to parse the HTTP header, see if there are any subscribers and if not return an HTTP error before the publisher finishes sending all of the data. ... | Can uWSGI return a response before the POST data is uploaded? | 0 | 0 | 1 | 244 |
27,647,676 | 2014-12-25T13:34:00.000 | 2 | 0 | 1 | 0 | python-3.x,python-asyncio | 27,649,541 | 2 | false | 0 | 0 | Well, it uses reactor for posix. Windows implementation has proactor event loop too. | 2 | 3 | 0 | asyncio is an event driven core lib of python 3.4. I know twisted, a similar lib for asyncio, implements the Reactor pattern, but what kind of pattern does asyncio implement? | What pattern of event driven procession does asyncio implement? | 0.197375 | 0 | 0 | 582 |
27,647,676 | 2014-12-25T13:34:00.000 | 0 | 0 | 1 | 0 | python-3.x,python-asyncio | 66,377,064 | 2 | false | 0 | 0 | As @AndrewSvetlov answered, Python already will select the most performant selector for you, depending on your operating system. Different selector event loops will be, ensuring to get the tightest loop, the most performant selector available on your operating system. So it implements both patterns. | 2 | 3 | 0 | asyncio is an event driven core lib of python 3.4. I know twisted, a similar lib for asyncio, implements the Reactor pattern, but what kind of pattern does asyncio implement? | What pattern of event driven procession does asyncio implement? | 0 | 0 | 0 | 582 |
27,648,619 | 2014-12-25T15:41:00.000 | 1 | 0 | 1 | 0 | python,multithreading | 27,648,660 | 2 | false | 0 | 0 | Threads won't help you due to the GIL serializing them. However, you can still use multiprocessing and share the data between processes using the mmap module or equivalent. This will require the data to be structured to be readable from the file, so you won't be able to use, say, dictionaries - but using a file-based s... | 1 | 1 | 0 | Is it possible to deal in python with shared memory parallel tasks? My task should be parallel over several cores (though threading module does not fit here, as far as I know the only facilities to do that is multiprocessing). There are lots of tasks for which I create a thread (in a python case process) pool. Then I n... | Memory sharing multithreading programming in Python | 0.099668 | 0 | 0 | 2,821 |
27,651,530 | 2014-12-25T23:26:00.000 | 1 | 0 | 0 | 0 | python,http,python-requests | 27,651,589 | 2 | false | 1 | 0 | Basically you don't. If the web server is returning a 302 unless it decides to include the old html(which would be very odd ) you are basically out of luck.
Now if you hit it with a web browser and it doesn't redirect you, then perhaps it is doing something like user agent sniffing and redirecting based on that. So in... | 1 | 0 | 0 | I'm trying, in Python, using the requests library, to get the HTML for a website that automatically redirects to another one. How do I avoid this and get the HTML for the original site, if possible? I know it exists and has HTML for it because I have accessed it via the Chrome view-source function. Any help appreciated... | If a website gives a 302 HTTP response code, can I get the original link's raw HTML still? | 0.099668 | 0 | 1 | 66 |
27,654,405 | 2014-12-26T07:54:00.000 | 1 | 0 | 0 | 0 | python,django | 27,654,493 | 1 | false | 1 | 0 | so there are developers A and B.
if it is very important you both have notification enabled in git so that you know what your friend has pushed.
lets imagine, A and B are working at the same time on same django app, possibly on the same models.py.
if A pushes changes on models.py, B needs to apply these changes in h... | 1 | 4 | 0 | We are 2 developers working on a django application. As we are in the initial stages of the app our models are changing rapidly and so are django migration files. So if one of us pushes the migrations to git and when the other one pulls them and tries to apply them, django is not able to find a common migration point a... | How to manage migrations in django 1.7 among developers? | 0.197375 | 0 | 0 | 56 |
27,654,494 | 2014-12-26T08:06:00.000 | 5 | 0 | 0 | 0 | python,python-3.x,tkinter,label | 32,515,869 | 3 | false | 0 | 1 | Use can use grid_remove() to hide the label.
like self.myLabel.grid_remove(). If you want to show it again then use self.myLabel.grid(). This will show widget on its original position on grid. | 1 | 4 | 0 | How could I hide an existing Label when a button is clicked in Python(Tkinter)? | Hide label when a button is clicked in Python | 0.321513 | 0 | 0 | 29,265 |
27,661,082 | 2014-12-26T19:25:00.000 | 2 | 1 | 0 | 1 | python,ssh,paramiko,activestate,pypm | 27,667,123 | 1 | true | 0 | 0 | I feel really foolish.
After reading that paramiko has replaced ssh module there still is an ssh module available.
Ooops!! | 1 | 0 | 0 | I am new to python scripting and started to look into a script to allow me to SSH to a box and check it is still running.
I have installed ActiveState (Python 2.7) on my windows desktop.
Using PyPM I have installed paramiko and pycrypto
but when I try to execute my scripts I get the following error:
Script: python C:... | Installing modules with PyPM on ActiveState | 1.2 | 0 | 0 | 320 |
27,664,809 | 2014-12-27T05:55:00.000 | 0 | 1 | 1 | 1 | python,terminal,ide | 27,664,945 | 1 | true | 0 | 0 | As soon as you don't mess up with the system files, you might not do any damages. Be sure what files you might be disturbing. If your code is too, ummmm, core, try to give ideone.com a try. This might help you with the things you might b touching.
Terminal might not give you enough interactions, but as you told that yo... | 1 | 0 | 0 | I get slightly nervous posting in here because these are not my waters yet. Please bear with, I am very new to the world of code. I do my best to find answers to questions before I ask them; time is very valuable so I appreciate yours.
When I run code under Python in Terminal do I run the risk of damaging my system if... | Where To Test Python Code | 1.2 | 0 | 0 | 629 |
27,664,896 | 2014-12-27T06:12:00.000 | 0 | 1 | 0 | 1 | python,c++,linux,openshift,openshift-client-tools | 27,665,587 | 1 | true | 0 | 0 | all the 'rhc port-forward appname' does is set up SSH tunnels behind the scenes. If you want people to tunnel into your appication you will need to get their public SSH key into your application as an approved key. Then you can set up an SSH tunnel whatever way you chose. | 1 | 0 | 0 | I'm trying to test and distribute my python application in script or executable form (client). I already have my openshift server setup and running. I'm confused on setting up port forwarding with other users to test it out with.
Do other clients (publicly) need to download rhc and run 'rhc port-forward appname' on the... | Public Client App Port Forwarding with OpenShift | 1.2 | 0 | 0 | 211 |
27,665,320 | 2014-12-27T07:32:00.000 | 2 | 0 | 1 | 0 | python,anaconda,conda | 28,100,853 | 2 | false | 0 | 0 | Python virtualenvs (or pyvenvs) are very Python specific. The create an environment that pretends to be a distinct installation of Python, while reusing some data from the base Python. Only Python packages can be installed into a virtualenv, because that's really the only thing that makes sense.
Conda environments are... | 1 | 2 | 0 | Are conda's envs a wrapper around pyenv, a similar version or are they a distinct implementation? They seem identical, but I do not know for sure. Are they interchangeable? | Are environments in conda a wrapper for pyenv? | 0.197375 | 0 | 0 | 589 |
27,666,895 | 2014-12-27T11:44:00.000 | 0 | 0 | 1 | 0 | string,loops,python-3.x | 27,669,014 | 3 | false | 0 | 0 | Remember that position is the index, while S[position] is the character at that position. | 1 | 0 | 0 | How to read the index value of a specific character (say '+') from a string without using any function. They told me to do this using for loop. (Home work, I am not allowed to use homework tag due to low reputation)
I was doing this:
S = input()
for position in range(0,len(S)):
if S[position] == '+':
... | How to get the index value of a character from a string in Python? | 0 | 0 | 0 | 106 |
27,667,517 | 2014-12-27T13:06:00.000 | 0 | 0 | 0 | 1 | python,file,ntfs | 27,667,551 | 2 | false | 0 | 0 | This is a problem of the underlying file system. Use a file system that is better suited for large amount of files. Built a directory tree, sort the files into directories after the first, second, third ... character of the filename. | 1 | 1 | 0 | I have a folder with about 220,000 text files. I need to open them in a certain order, and do something with the content. At the moment, I just use open, and it takes, on average, about half a second to open a file. Is there any faster way to do it?
If it matters - I'm on Windows. | How to open files from a very large folder quickly? | 0 | 0 | 0 | 516 |
27,669,710 | 2014-12-27T17:31:00.000 | 0 | 0 | 1 | 0 | python-2.7,data-structures | 27,693,828 | 1 | false | 0 | 0 | If you plan on sorting it, just use an array. Arrays just make it so much simpler when it comes to sorting.
Choosing a data structure mainly lies in your goals for the application. Would you like quick indexing and look up times? Use an array. Is your input size unknown, and search times are not as important? Use a li... | 1 | 0 | 0 | I'm pretty new to python and just need some advice. I'm basically making a python reddit tool that will help me find the top comments, their score, and save them so they can be sorted by highest score at a later time.
Initially I was going to save them to a dictionary with a 'score:comment' format but was told this was... | Best data-structure to save a word to a corresponding number? | 0 | 0 | 0 | 31 |
27,676,834 | 2014-12-28T13:27:00.000 | 1 | 0 | 1 | 0 | python,json,django,multithreading,django-models | 27,676,874 | 2 | false | 1 | 0 | I don't know where you would have read that signals are executed in threads, because it is not at all true. Django does not do anything with threads, and neither should you: if you want to execute something out of process, use a task queue system like Celery. | 1 | 5 | 0 | I have post_save signal on one of my models which calls json.dumps on a large python dictionary. I want to call this json.dumps in a separate thread so it may not slow down the save call on my model. I was wondering if it is okay to spawn a new thread from inside a post_save signal? I have read that post_save signals a... | Is it okay to spawn a thread from django post save signal? | 0.099668 | 0 | 0 | 826 |
27,678,990 | 2014-12-28T17:47:00.000 | 0 | 0 | 0 | 0 | python,cassandra,load-testing | 27,688,141 | 1 | false | 0 | 0 | For a few million, I'd say just use CSV (assuming rows aren't huge); and see if it works. If not, inserts it is :)
For more heavy duty stuff, you might want to create sstables and use sstable loader. | 1 | 0 | 1 | I am generating load test data in a Python script for Cassandra.
Is it better to insert directly into Cassandra from the script, or to write a CSV file and then load that via Cassandra?
This is for a couple million rows. | Python/Cassandra: insert vs. CSV import | 0 | 1 | 0 | 364 |
27,682,975 | 2014-12-29T03:17:00.000 | 3 | 0 | 0 | 0 | python,web-scraping | 27,683,149 | 1 | true | 0 | 0 | The infinite scroll is probably using an Ajax query to retrieve more data as you scroll. Use your browser's dev tools to inspect the request structure and try to hit the same endpoint directly. In this way you can get the data you need, often in json or xml format.
In chrome open the dev tools (Ctrl + shift + I in wi... | 1 | 0 | 0 | I am trying to use python to scrape a website implemented with infinite scroll. Actually, the web is pinterest. I know how to use selenium webdriver to scrape a web with infinite scroll. However, the webdriver basically imitates the process of visiting the web and is slow, much slower than using BeautifulSoup and urlli... | Is there any fast ways to scrape a website with infinite scroll? | 1.2 | 0 | 1 | 3,050 |
27,683,900 | 2014-12-29T05:36:00.000 | 1 | 1 | 1 | 0 | python,time,timeit | 27,684,364 | 2 | false | 0 | 0 | The time it takes to run the setup code doesn't affect the timeit module's timing calculations.
You should be able to pass your matrix into the setup parameter using import, eg
"from __main__ import mymatrix" | 1 | 2 | 0 | I am trying to use the timeit module to time the speed of an algorithm that analyzes data.
The problem is that I have to do run some setup code in order to run this algorithm. Specifically, I have to load some documents from a database, and turn it into matrix representation.
The timeit module does not seem to allow m... | Timeit module - Passing objects to setup? | 0.099668 | 0 | 0 | 601 |
27,684,920 | 2014-12-29T07:17:00.000 | -1 | 0 | 1 | 1 | python,linux,windows,ubuntu,exe | 27,685,003 | 2 | false | 0 | 0 | if you can't get the python to run on windows a packaged exe version is impossible. | 1 | 0 | 0 | I have python program that I've been writing on Ubuntu. For some reasons I could not properly installed on windows few libraries that I used, there are some problems I can't solve in libraries. I used PyInstaller to build run file in Ubuntu. And it is works perfectly. But now I faced a problem, I need to run this appli... | How to compile linux application into win *.exe file | -0.099668 | 0 | 0 | 257 |
27,690,197 | 2014-12-29T13:51:00.000 | 3 | 1 | 1 | 1 | python,bash,shell,operating-system,temp | 27,708,677 | 2 | true | 0 | 0 | As a general rule, you should remove the temporary files that you create.
Recall that the $TEMP directory is a shared resource that other programs can use. Failure to remove the temporary files will have an impact on the other programs that use $TEMP.
What kind of impacts? That will depend upon the other programs. ... | 1 | 2 | 0 | It's a common question not specifically about some language or platform. Who is responsible for a file created in systems $TEMP folder?
If it's my duty, why should I care where to put this file? I can place it anywhere with same result.
If it's OS responsibility, can I forgot about this file right after use?
Thanks and... | Should I delete temporary files created by my script? | 1.2 | 0 | 0 | 1,430 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.