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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21,411,408 | 2014-01-28T16:34:00.000 | 2 | 1 | 0 | 0 | python,image-processing,embedded,octave | 21,412,797 | 2 | false | 0 | 0 | I am bit surprised that you don't stick to C/C++ - many convenient image processing libraries exists. Even though, I have like 20 years of experience with C, 8 years of experience with Matlab and only 1 years of experience with Python, I would choose Python together with OpenCV, which is an extremely optimized library ... | 1 | 0 | 0 | I want to perform image processing on a low-end (Atom processor) embedded computer or microcontroller that is running Linux.
I'm trying to decide whether I should write my image processing code in Octave or Python. I feel comfortable in both languages, but is there any reason why I should use one over the other? Are th... | Octave/MATLAB vs. Python On An Embedded Computer | 0.197375 | 0 | 0 | 812 |
21,411,914 | 2014-01-28T16:56:00.000 | 0 | 0 | 0 | 1 | python,batch-file,unicode | 21,412,006 | 2 | false | 0 | 0 | If you are using shell constructs such as redirection, you need the parameter shell=True. | 1 | 0 | 0 | I am using Python to create windows commands using subprocess.call(command) where command is a string I've generated for the Windows command. I need the results of my command to output to a .txt file so I use 2>> C:\Users\me\out.txt as part of command except Python does not seem to recognize the greater than character... | Python not recognizing the greater than sign? | 0 | 0 | 0 | 274 |
21,414,191 | 2014-01-28T18:46:00.000 | 0 | 0 | 1 | 0 | python,networking,network-programming | 21,414,605 | 4 | false | 0 | 0 | It really depends of your technical requirements, program architecture etc. But basically i could recommend you to use some kind of message queue service to communicate between your applications. RabbitMQ, for example. | 1 | 0 | 0 | Im new to programing. I want to know if there is a way to send a variable created on one computer in python to another computer running another python script on the same network. Basically lets say when the Variable is equal to 5 i want the other script to print 5 | Pass variable between python scripts on different computers. | 0 | 0 | 0 | 2,013 |
21,417,637 | 2014-01-28T21:49:00.000 | 2 | 0 | 0 | 0 | python,django | 21,417,983 | 2 | true | 1 | 0 | Yes, Django won't recognize the field if you change the name. I will say that the "field does not exist", so YES, you have to run Django's South migrate / schemamigration as you asked.
Datatype YES as well. Django may be okay at first if you only change the field type depending, but may run into problems later depe... | 2 | 2 | 0 | The problem is pretty self-explanatory in the title. Do I need to do that or I just need to edit the existing migration file? | Do I need to user schemamigration and migrate commands after changing a field name or a field data type in a model? | 1.2 | 0 | 0 | 54 |
21,417,637 | 2014-01-28T21:49:00.000 | 1 | 0 | 0 | 0 | python,django | 21,418,000 | 2 | false | 1 | 0 | You need to do a schemamigration every time you change your models.
On every call of python manage.py migrate command south record number of the latest migration applied into database migrationhistory table. So if you just change existing migration it won't be applied because south would think it's already applied.
You... | 2 | 2 | 0 | The problem is pretty self-explanatory in the title. Do I need to do that or I just need to edit the existing migration file? | Do I need to user schemamigration and migrate commands after changing a field name or a field data type in a model? | 0.099668 | 0 | 0 | 54 |
21,419,369 | 2014-01-28T23:49:00.000 | 1 | 0 | 1 | 0 | python | 21,419,493 | 3 | true | 0 | 0 | Internally the Int object is stored as 2's complement representation like in C (well, this is true if range value allow it, python can automagically convert it to some other representation if it does not fit any more).
Now to get the string representation you have to change that to a string (and a string merely some un... | 1 | 5 | 0 | I understand it's easy to convert an int to a string by using the built-in method str(). However, what's actually happening? I understand it may point to the
__str__ method of the int object but how does it then compute the “informal” string representation? Tried looking at the source and didn't find a lead; any he... | What's actually happening when I convert an int to a string? | 1.2 | 0 | 0 | 118 |
21,420,269 | 2014-01-29T01:20:00.000 | 2 | 0 | 0 | 0 | python,python-2.7,max,pickle | 21,420,290 | 3 | false | 0 | 0 | You would need to load your existing pickle'd object, modify it, and then dump it again with the modifications. | 1 | 1 | 0 | I am trying to save high scores in a game that I am creating, but each time I do a pickle.dump, it overwrites my previous data. Any help? | I am trying to save high scores with pickle, but how do I add to an already pickled document and then get the max? | 0.132549 | 0 | 0 | 262 |
21,423,798 | 2014-01-29T06:36:00.000 | 0 | 0 | 1 | 0 | python,multithreading,thread-safety,twisted | 21,423,872 | 3 | false | 0 | 0 | Either Threading or Twisted can do this.
ie. If you use twisted, you won't need to use Threading.
Keep in mind that some servers have a limit on the number of connections they will allow from a single IP address. | 1 | 2 | 0 | I am looking to set up an HTTP server which takes in some input and then the application needs to send multiple HTTP requests at the same time (to another server). What is the best approach for this?
If I use the Twisted framework, do I still need to use threading? | Python: Multiple HTTP requests at the same time | 0 | 0 | 1 | 2,932 |
21,426,024 | 2014-01-29T08:44:00.000 | 0 | 0 | 0 | 0 | python,django,authorization,server-side | 21,426,172 | 3 | false | 1 | 0 | The authentification method in every application connects to the same webservice for autentification. | 2 | 1 | 0 | There are multiple mobile apps.
I want people using one app to login with their same login credentials into all other apps.
What is the best approach to implement this?
I'm thinking to create a separate authorization server that will issue tokens/secrets on registering and logins. It will have a validation API that wil... | One login for multiple products | 0 | 0 | 1 | 386 |
21,426,024 | 2014-01-29T08:44:00.000 | 1 | 0 | 0 | 0 | python,django,authorization,server-side | 21,427,549 | 3 | true | 1 | 0 | First check if OAuth could be adapted to using this, that would save you a lot of work. Of course all the services and apps would have to talk to some backend network server to sync tokens issued to apps.
Half-secure/maybe-abusable solution: have symmetric cipher encrypted cookie that webpages (and apps?) hold and use ... | 2 | 1 | 0 | There are multiple mobile apps.
I want people using one app to login with their same login credentials into all other apps.
What is the best approach to implement this?
I'm thinking to create a separate authorization server that will issue tokens/secrets on registering and logins. It will have a validation API that wil... | One login for multiple products | 1.2 | 0 | 1 | 386 |
21,434,332 | 2014-01-29T14:42:00.000 | 1 | 0 | 1 | 0 | python,inheritance,module,code-reuse | 21,434,602 | 5 | false | 0 | 0 | A module is an instance, not a class, so you can't inherit from it any more than you can inherit from 6.
If your stuff has state, you should have classes, not modules.
If you have two modules that need the same stuff, then it either a) one of them should have it and the second should use the first, or b) they should bo... | 2 | 4 | 0 | So I hear that modules are very pythonic and I structure my code with modules a lot and avoid classes.
But now I'm writing a module Formula that has a lot of the same functionality as the module Car. How should I handle that?
Duplicate code in both modules?
Convert to classes?
Refactor code to add a third, parent modu... | How to extend (inheritance) a module in Python? | 0.039979 | 0 | 0 | 6,016 |
21,434,332 | 2014-01-29T14:42:00.000 | 1 | 0 | 1 | 0 | python,inheritance,module,code-reuse | 21,434,599 | 5 | false | 0 | 0 | Modules can sometimes be used to implement Singletons, but they aren't meant to be a replacement for classes. You can only import the module once, while a class can have multiple instances.
If you need inheritance, use a class. | 2 | 4 | 0 | So I hear that modules are very pythonic and I structure my code with modules a lot and avoid classes.
But now I'm writing a module Formula that has a lot of the same functionality as the module Car. How should I handle that?
Duplicate code in both modules?
Convert to classes?
Refactor code to add a third, parent modu... | How to extend (inheritance) a module in Python? | 0.039979 | 0 | 0 | 6,016 |
21,434,533 | 2014-01-29T14:51:00.000 | 4 | 0 | 1 | 1 | python | 21,434,929 | 2 | false | 0 | 0 | I'm writing a Python IDE and I want to let user to choose the interpreter for executing the program.
Just do it like other IDEs then and simply supply a dialog where users can add interpreters they want to be able to run the code with.
Eclipse does this for example for Java Runtimes, and it’s perfectly fine to have it... | 1 | 8 | 0 | I need to present the user a list of Python installations to choose from for executing something. I suppose in Windows I could get this information from registry. Don't know about Linux and Mac.
Any hints? Or maybe you even know a place where I could find Python code for this?
EDIT: it is not important that I find rea... | How to list all Python versions installed in the system? | 0.379949 | 0 | 0 | 4,374 |
21,436,787 | 2014-01-29T16:24:00.000 | 1 | 1 | 0 | 0 | java,python,sockets | 21,436,939 | 2 | true | 1 | 0 | A meta-answer would be to use JSON, since JSON generators and parsers can be found for every major programming language. | 2 | 0 | 0 | I am using OpenCV on my Raspberry Pi to track circular objects. Then, I want to send the coordinate and radius values in an array of floats across the LAN to the Java program
I can send strings all fine with the code I have, but I'm having trouble trying to send numerical datatypes. What is the correct process for this... | How to send an array from Python (client) to Java (Server)? | 1.2 | 0 | 0 | 129 |
21,436,787 | 2014-01-29T16:24:00.000 | 1 | 1 | 0 | 0 | java,python,sockets | 21,437,109 | 2 | false | 1 | 0 | Have you looked at BSON? It's like JSON, but optimised for a little more speed. | 2 | 0 | 0 | I am using OpenCV on my Raspberry Pi to track circular objects. Then, I want to send the coordinate and radius values in an array of floats across the LAN to the Java program
I can send strings all fine with the code I have, but I'm having trouble trying to send numerical datatypes. What is the correct process for this... | How to send an array from Python (client) to Java (Server)? | 0.099668 | 0 | 0 | 129 |
21,439,346 | 2014-01-29T18:19:00.000 | 2 | 0 | 1 | 0 | python,permutation,alphabetical | 21,439,435 | 4 | false | 0 | 0 | It might be faster to run it in reverse: index your document, and for each word, see if it is a subset of your list of letters. | 1 | 4 | 0 | So I am making a word generator that takes several inputted letters, puts them in all possible positions, and matches them with a document to find words. If I am approaching this wrong please tell me! If not how can I do this?
Thanks | How can I generate a list of all possible permutations of several letters? | 0.099668 | 0 | 0 | 11,854 |
21,440,163 | 2014-01-29T18:59:00.000 | 5 | 1 | 1 | 0 | python,global-variables,closures | 21,440,260 | 1 | true | 0 | 0 | Local and closed-over names are enumerated during compilation. At runtime, they're stored in C arrays and accessed using integers/indices. LOAD_FAST and LOAD_DEREF take a C integer and perform a C array lookup.
Global names cannot be enumerated at compile time, they can be added and removed during run time by any code ... | 1 | 5 | 0 | Functions declared at module level never have a closure and access non-local variables via LOAD_GLOBAL.
Functions declared not at module level may have a closure and access non-local, variables via LOAD_DEREF if those variables are not global.
So basically we have three ways of storing and loading variables GLOBAL (glo... | Implementation of Global variables vs Dereferenced variables | 1.2 | 0 | 0 | 190 |
21,440,987 | 2014-01-29T19:42:00.000 | 0 | 0 | 0 | 0 | python,django,django-admin | 21,442,464 | 1 | false | 1 | 0 | What would be best to do is write your core project on one side, and store it in a repository (version control). Apart from that, write your sub-applications as requirements and store/track them on separate version control.
Then, to keep everything working together and keep it all integrated, what you should do is that... | 1 | 0 | 0 | I have core django admin project that when my customers purchase needs to be modified both in configuration and function. Each customer will have their own instance of the project installed on a different server. Currently I am using django apps to separate out the difference in clients and using settings.py to load th... | Django admin project distribution and management | 0 | 0 | 0 | 82 |
21,442,470 | 2014-01-29T20:57:00.000 | 0 | 1 | 0 | 0 | php,python,raspberry-pi,home-automation | 31,495,240 | 2 | false | 0 | 0 | Use a websocket (e.g., on Node.js) to open a channel of communication between the Raspberry Pi and the Web page. Run a socket server on the Web server and run clients on your Rasberry Pis. Then create a simple messaging protocol for commands that the Web server will send over the websocket and that the Raspberry Pis wi... | 2 | 0 | 0 | I am planning on doing a bit of home automation. I decided on going with the RPi, because it is cheap, and can connect to the internet wirelessly via a USB dongle. I was planning on controlling the system through a PHP webpage hosted on my webserver. I was wondering if I could make it so that when I click a button on t... | Python, PHP: Controlling RPi GPIO from website on a separate server | 0 | 0 | 1 | 525 |
21,442,470 | 2014-01-29T20:57:00.000 | 0 | 1 | 0 | 0 | php,python,raspberry-pi,home-automation | 21,864,500 | 2 | false | 0 | 0 | I don't think it would be as easy as 'sending a signal' to your Pi. What you could do, however, is set up a MySQL database on the server with your control signals input to the database and have the Pi poll it every so often to check the values.
For actually controlling, you would simply use UPDATE statements to set the... | 2 | 0 | 0 | I am planning on doing a bit of home automation. I decided on going with the RPi, because it is cheap, and can connect to the internet wirelessly via a USB dongle. I was planning on controlling the system through a PHP webpage hosted on my webserver. I was wondering if I could make it so that when I click a button on t... | Python, PHP: Controlling RPi GPIO from website on a separate server | 0 | 0 | 1 | 525 |
21,445,897 | 2014-01-30T00:55:00.000 | 0 | 0 | 0 | 1 | python,web-services,google-app-engine,rest,qualtrics | 21,449,385 | 1 | true | 1 | 0 | I am familiar with Qualtrics but I will answer (b) first.
You can write a Python Web Service in a variety of ways, depending on your choice:
You could write a simple get handler
Use Google Cloud Endpoints
Use one of several Web Services Python libraries
Having said that, a quick glance at Qualtrics indicated that it ... | 1 | 0 | 0 | Has anyone out there created a a.) web service for Qualtrics or b.) a Python web service on Google App Engine?
I need to build in some functionality to a Qualtrics survey that seems only a web service (in the Qualtrics Survey Flow) could do, like passing parameters to a web service then getting a response back.
I've l... | Creating a web service for Qualtrics written in Python on Google App Engine | 1.2 | 0 | 0 | 909 |
21,446,649 | 2014-01-30T02:19:00.000 | 2 | 0 | 0 | 0 | python,django | 21,447,135 | 1 | true | 1 | 0 | Well, there's an amount of subjectivity in this choice. It does depend on whether all of these different documents are pretty much the same thing (just relatively minor variations but still more or less similar), or if they have a large amount of very specific functionality.
I guess yours is probably the first, in whic... | 1 | 1 | 0 | I have an abstract model called documents. Types of documents like "invoices" and "quotes" inherit from this class.
This is my first Django project and I'm a bit unclear of the best folder structure. I was planning to make each type of document get its own app. So, there would be an app for "invoices" and an app for "... | Best Folder Structure For Abstract Models | 1.2 | 0 | 0 | 590 |
21,447,430 | 2014-01-30T03:47:00.000 | 0 | 0 | 1 | 0 | python,ipython,ipython-parallel | 21,489,974 | 1 | true | 0 | 0 | I ran some tests. The LoadBalancedView assigns tasks to engines (nodes) immediately after being apply'd. If more nodes join later, the the load is not recalculated and the tasks are left to the original engines to complete. Only tasks created after the engine has registered with the controller can be assigned to that e... | 1 | 1 | 0 | I have a few questions about the IPython parallel LoadBalancedView class which I couldn't find in the docs.
How does a LoadBalancedView deal with nodes entering and exiting the pool? Does it recalculate loads and reassign? Otherwise once nodes join the older ones would still be backed up with tasks.
When a task is a... | IPython parallel LoadBalancedView task assignment particulars | 1.2 | 0 | 0 | 93 |
21,454,046 | 2014-01-30T10:37:00.000 | 4 | 0 | 0 | 0 | python,orm,openerp,odoo | 27,442,462 | 1 | false | 1 | 0 | Yes, when issuing a ORM '.search' query, pass in Python False to represent database nulls. The ORM has no 'is' operator, so you must query for ('column', '=', False). Similarly, when '.browse' returns rows, database nulls are converted into Python False.
I believe the reason for this is that xmlrpc (which is used to se... | 1 | 1 | 0 | Within OpenERP, when you define a new char field in python and set False as default value, the field will be set to NULL in the db, the ORM taking care of the conversion. Does the ORM also convert integer type the same way, or should I be careful that it may convert it to 0 instead of NULL?
Where could I find the on th... | Does OpenERP convert False value to NULL when affected to integer? | 0.664037 | 0 | 0 | 1,668 |
21,455,014 | 2014-01-30T11:20:00.000 | 1 | 0 | 1 | 0 | postgresql,plpython | 21,455,200 | 1 | true | 0 | 0 | The PL/Python procedural language allows PostgreSQL functions to be written in the Python language.
PL/Python2U untrusted procedural language | 1 | 3 | 0 | what is difference between plpython, plpythonu, plpython2u.
What does u and 2u mean.
Looking around I could't find any info on that matter. | What is difference between plpython, plpythonu, plpython2u | 1.2 | 0 | 0 | 1,112 |
21,455,134 | 2014-01-30T11:25:00.000 | 75 | 1 | 0 | 0 | python,unit-testing,pytest | 21,462,398 | 4 | true | 0 | 0 | You can also use --collect-only, this will show a tree-like structure of the collected nodes. Usually one can simply -k on the names of the Function nodes. | 2 | 53 | 0 | I can't find a way to list the tests which I can call with py.test -k PATTERN
How can I see the list of the available tests? | List available tests with py.test | 1.2 | 0 | 0 | 18,525 |
21,455,134 | 2014-01-30T11:25:00.000 | 4 | 1 | 0 | 0 | python,unit-testing,pytest | 21,455,508 | 4 | false | 0 | 0 | -v verbose tells you which test cases are run, i.e. which did match your PATTERN. | 2 | 53 | 0 | I can't find a way to list the tests which I can call with py.test -k PATTERN
How can I see the list of the available tests? | List available tests with py.test | 0.197375 | 0 | 0 | 18,525 |
21,455,719 | 2014-01-30T11:50:00.000 | 0 | 0 | 0 | 0 | python,pelican | 50,008,098 | 3 | false | 1 | 0 | When you press Ctrl + C or Ctrl + z, do not restart the HTTP server: it is running in the background, and that is the exact reason as why you are getting that error message.
To see that the server is running in the background after pressing the any of the key combinations above, try to edit and save any file: you will... | 2 | 3 | 0 | Hi I just started working with Pelican and it really suits my needs, I had tried to build blogs in Flask and other frameworks but I really just wanted something simple so I can post about math, and pelican just works.
My question is when I am testing on my machine, I start the server; however when I stop the server to ... | Pelican restarting you server | 0 | 0 | 0 | 990 |
21,455,719 | 2014-01-30T11:50:00.000 | 2 | 0 | 0 | 0 | python,pelican | 27,992,709 | 3 | false | 1 | 0 | For your development server, you can also use the script ./develop_server.sh that comes with the last versions of pelican (at least with the 3.5.0).
Build the blog and load a server with ./develop_server.sh start: it reloads each time you edit your blog (except the settings). Simply stop with ./develop_server.sh stop w... | 2 | 3 | 0 | Hi I just started working with Pelican and it really suits my needs, I had tried to build blogs in Flask and other frameworks but I really just wanted something simple so I can post about math, and pelican just works.
My question is when I am testing on my machine, I start the server; however when I stop the server to ... | Pelican restarting you server | 0.132549 | 0 | 0 | 990 |
21,457,402 | 2014-01-30T13:06:00.000 | -1 | 0 | 1 | 0 | python,matplotlib,tkinter,python-3.3 | 21,458,494 | 1 | false | 0 | 0 | I suggest you get matplotlib from your distro's repositories. Pip is fine for installing simple, pure Python packages but isn't very convenient for packages such as matplotlib or numpy, for which a lot of non-Python dependencies need to be solved. Your package manager should nicely take care of all this stuff for you. | 1 | 2 | 0 | I have a fresh Python 3.3 installation on Red Hat Enterprise Linux 6.5, including Tkinter — python3.3 -m tkinter works and shows a dialogue. However, when I run pip3.3 install matplotlib, at the Optional Backend Dependencies, it says:
Tkinter: no
* TKAgg requires Tkinter
How does matplotlib determine th... | When installing through pip, how do I tell matplotlib how to find tkinter? | -0.197375 | 0 | 0 | 492 |
21,458,155 | 2014-01-30T13:42:00.000 | 1 | 0 | 0 | 0 | python,file,openerp | 21,458,634 | 4 | false | 0 | 0 | Generally there's no way to retrieve the path of a file just from it's content. There may be file formats for which this is possible, but in the general case there is no way.
However, if you need the file's path only to feed the file into some other part of your program, there is another way: Just dump your binary data... | 2 | 2 | 0 | Is it possible to get the path of a file from binary data?
I have only binary data which came from reading the file, but have no information of file path.
Does the binary data have the information of path? if yes then How can I get it.
I need to read xlsx file using python xlrd lib, which requires the file path,
but i... | Get File path from binary data | 0.049958 | 0 | 0 | 4,238 |
21,458,155 | 2014-01-30T13:42:00.000 | 0 | 0 | 0 | 0 | python,file,openerp | 21,458,351 | 4 | false | 0 | 0 | If you are getting the binary data from a stream, then there is NO way of getting the file path.
If you think about it, the data may also be coming through stdin or through a network socket, so no file path is associated with it.
A possible approach is to manipulate the program to attach file path information along wit... | 2 | 2 | 0 | Is it possible to get the path of a file from binary data?
I have only binary data which came from reading the file, but have no information of file path.
Does the binary data have the information of path? if yes then How can I get it.
I need to read xlsx file using python xlrd lib, which requires the file path,
but i... | Get File path from binary data | 0 | 0 | 0 | 4,238 |
21,458,423 | 2014-01-30T13:54:00.000 | 7 | 0 | 1 | 0 | python,ipython-notebook | 21,458,549 | 1 | true | 0 | 0 | Is it possible that one of the cells got a lot of output data?
if so,
try editing the file manually (with notepad++ or something like this), and delete cell's output | 1 | 4 | 0 | So my iPython notebook comes up in my browser (chrome) and when I open my specific notebook a new tab opens. However the work does not load up! The page also freezes. Is this an iPython issue or something wrong with the file? Was working yesterday. I've restared comp etc. but no luck
Update: just tried renaming noteboo... | iPython notebook not loading | 1.2 | 0 | 0 | 3,514 |
21,462,118 | 2014-01-30T16:33:00.000 | 1 | 0 | 0 | 0 | python,c++,qt | 21,467,816 | 3 | false | 0 | 1 | You can use the Qt Graphics View Framework. Create a QGraphicsView and a QGraphicsScene for it. Add items using QGraphicsScene::addPixmap (that returns QGraphicsPixmapItem which is derived from QGraphicsItem) and adjust their positions using QGraphicsItem::setPos. QGraphicsView will effectively draw your scene and hand... | 3 | 1 | 0 | I need to display a chart that can be very large, for example the image resolution could be 100 000 x 1000. However, it seems like I am limited to 32768 x 32768 by the QImage.
I can't reasonably redraw directly the chart at every paintEvent so I need to store it into a QImage (it could be a QPixmap that won't change an... | Draw an image too big to fit into a QImage | 0.066568 | 0 | 0 | 622 |
21,462,118 | 2014-01-30T16:33:00.000 | 2 | 0 | 0 | 0 | python,c++,qt | 21,462,850 | 3 | false | 0 | 1 | You probably do not want to display more than one QImage of data at a time. Few screens are more than 32k pixels wide or tall.
So you want an abstract type that produces QImages on request for reading, at offsets and possibly at different zoom factors.
The next problem is modifying this abstract type. An easy to use,... | 3 | 1 | 0 | I need to display a chart that can be very large, for example the image resolution could be 100 000 x 1000. However, it seems like I am limited to 32768 x 32768 by the QImage.
I can't reasonably redraw directly the chart at every paintEvent so I need to store it into a QImage (it could be a QPixmap that won't change an... | Draw an image too big to fit into a QImage | 0.132549 | 0 | 0 | 622 |
21,462,118 | 2014-01-30T16:33:00.000 | 0 | 0 | 0 | 0 | python,c++,qt | 21,469,131 | 3 | false | 0 | 1 | You do realize that a 100,000 x 1000 RGBA QImage is 400MBytes? There's no point in wasting all that memory. Really, none.
Just paint it every time, one request, in the paintEvent. Be clever about it so that you only paint what needs to be shown. I'd think one should focus on optimizing the painting process and your dat... | 3 | 1 | 0 | I need to display a chart that can be very large, for example the image resolution could be 100 000 x 1000. However, it seems like I am limited to 32768 x 32768 by the QImage.
I can't reasonably redraw directly the chart at every paintEvent so I need to store it into a QImage (it could be a QPixmap that won't change an... | Draw an image too big to fit into a QImage | 0 | 0 | 0 | 622 |
21,463,282 | 2014-01-30T17:24:00.000 | 0 | 0 | 1 | 0 | python-3.x | 21,463,343 | 3 | false | 0 | 0 | An octet and a byte is the same.
A bit is just one 0 or 1. Eight bits make a byte. | 2 | 3 | 0 | What's the difference between a "bit" and "octet"? Some python books, depending on the author, seem to use the terms interchangeably. I asked a PHD level guy and he said there was a difference but didn't explain what the difference was. | What's the difference between a "bit" and "octet"? | 0 | 0 | 0 | 4,355 |
21,463,282 | 2014-01-30T17:24:00.000 | 9 | 0 | 1 | 0 | python-3.x | 21,463,473 | 3 | false | 0 | 0 | A bit is a single binary digit.
An octet is a collection 8 bits, sometimes called a "byte". There is no formal definition of a byte as 8 bits (though it is the generally accepted standard). The term octet is used when it is necessary to unambiguously specify that there are only 8 bits in the collection. | 2 | 3 | 0 | What's the difference between a "bit" and "octet"? Some python books, depending on the author, seem to use the terms interchangeably. I asked a PHD level guy and he said there was a difference but didn't explain what the difference was. | What's the difference between a "bit" and "octet"? | 1 | 0 | 0 | 4,355 |
21,469,046 | 2014-01-30T22:45:00.000 | 0 | 0 | 0 | 1 | windows-8.1,python-idle | 26,771,569 | 1 | false | 0 | 0 | Find file HOME/.idlerc/config-keys.cfg, where on Win7 HOME would be 'C:/Users/yourloginname', and delete the key binding or, if there is nothing else in the file or nothing you want to keep, the whole file.
If you were to run Idle from a console with python -m idlelib, you would probably see an error message. (Yes, yo... | 1 | 1 | 0 | I feel like I have been coming the internet for days with absolutely no result.
I have taken some web programming classes, and would like to learn some python, just because programming is wicked interesting altogether, and have run into a fairly large hurdle given my experience.
the problem is this: Python.exe (or is i... | Python IDLE GUI not starting | 0 | 0 | 0 | 2,234 |
21,469,470 | 2014-01-30T23:14:00.000 | 28 | 0 | 0 | 0 | python,django,django-i18n | 32,872,393 | 3 | false | 1 | 0 | In your settings.py just add 'django.middleware.locale.LocaleMiddleware' to your MIDDLEWARE_CLASSES setting, making sure it appears after 'django.contrib.sessions.middleware.SessionMiddleware'. | 1 | 20 | 0 | I have a django 1.6 site with i18n working. I can change the frontend language with a select box in the top of the template, but I don't know if there is a django app or trick to change the admin language, because it seems to store somewhere in session variable, and it keeps the first language I have used in the fronte... | How can I change Django admin language? | 1 | 0 | 0 | 18,987 |
21,471,470 | 2014-01-31T02:31:00.000 | 0 | 0 | 0 | 0 | python,c++ | 21,518,936 | 1 | false | 0 | 1 | It seems no solution to do that after a few attempts. A simple way to fix this problem is wrapping the c++ code with SWIG, so can pass it to other SWIG-wrapped modules. | 1 | 0 | 0 | I was using Python to process some data (int array). It is very slow. So I put the processing function in a c++ DLL and talk with it through ctypes. The data are loaded from swig-wrapped modules (c++). I browsed almost everywhere but found nothing to convert swig object of type 'int *' pointer to ctypes int pointer. Ho... | How to convert swig object of type 'int *' to ctypes int* | 0 | 0 | 0 | 640 |
21,473,532 | 2014-01-31T06:06:00.000 | 0 | 0 | 0 | 0 | python,django,image | 21,473,553 | 1 | true | 1 | 0 | Storing your images in database to serve them on a page is not a good idea.
Upload them to a CDN , and store the URLs in your database. | 1 | 0 | 0 | I am storing images as base64 string in database(MYSQL) and then when requested from client side(HTML webpages simply), sending base64 strings of images along with some other data from tables and then embedding this data in img tag on client side. These tags are built on dynamically using javascript. But this approach... | sending image on client side takes too much time in django | 1.2 | 0 | 0 | 83 |
21,477,016 | 2014-01-31T09:53:00.000 | 6 | 0 | 0 | 0 | python,python-2.7 | 21,477,105 | 2 | true | 0 | 0 | If your input is [0x20, 0x00], then you can do (arr[1]<<8)|arr[0].
If your input is ["0x20", "0x00"], then you can do int(arr[1],16)<<8)|int(arr[0],16). | 1 | 0 | 0 | I have an unsigned integer that is 16 bits coming in on the USB, these appear as 2 bytes in my list that is returned, e.g. [0x20, 0x00]. How would I combine these in to a number in python? | Unsigned integer 16 bits little endian to Python variable | 1.2 | 0 | 0 | 954 |
21,480,554 | 2014-01-31T12:52:00.000 | 1 | 0 | 1 | 0 | python,eclipse,jar,pydev,jython | 21,758,703 | 1 | true | 1 | 0 | Yes, PyDev is not able to read an 'aggregating' jar, so, you really have to add those other jars manually. | 1 | 0 | 0 | I'm using Eclipse, PyDev and Jython together on a project.
It works well, but I have a problem with an external jar.
This jar is special, has no .class files inside it just a manifest which uses Class-Path attribute to list additional jars (just aggregating a bunch of jars).
It seems like adding this as an external jar... | Eclipse, PyDev, Jython, external JAR | 1.2 | 0 | 0 | 483 |
21,483,236 | 2014-01-31T15:06:00.000 | 2 | 0 | 0 | 0 | python,matplotlib,label,axes | 21,483,417 | 1 | true | 0 | 0 | Try this: axes.xaxis.set_tick_params(label1On=False) | 1 | 1 | 1 | Is there a way to remove the labels of the x axis, but not the grid lines?
Both solutions to remove the labels also removed my grid lines.
I tried: axes.get_xaxis().set_visible(False) and axes.get_xaxis().set_ticks([]) | Python Matplotlib remove xlabels but not grid | 1.2 | 0 | 0 | 90 |
21,485,237 | 2014-01-31T16:36:00.000 | 2 | 0 | 1 | 0 | python,logic | 21,485,454 | 2 | false | 0 | 0 | is not not doesn't work. This is not a very bad thing, as it's never needed.
is not has the same operator precedence as is, which makes sense. is has a higher operator precedence than not, otherwise x is not y would mean x is (not y), when it needs to mean x is not (y).
But you can't figure out if a is not not b becau... | 1 | 1 | 0 | For some reason there is a syntax error in the following logical evaluation:
True is not None and not False is not not not None
The error can be narrowed down to this statement:
False is not not None
Where the second not is highlighted.
This isn't important at all, but I was just interested in why this might be failing... | Weird syntax error in python 3.x logic | 0.197375 | 0 | 0 | 151 |
21,485,769 | 2014-01-31T17:00:00.000 | 11 | 0 | 1 | 0 | python,matplotlib,latex | 21,486,017 | 1 | true | 0 | 0 | Try ax.set_ylabel(r'$\langle B_{\mathrm{e}} \rangle$') for labeling Y-Axis or ax.set_title(r'$\langle B_{\mathrm{e}} \rangle$') for the title of the axes. | 1 | 6 | 1 | How to label axes in Matplotlib using LaTeX expression $\langle B_{\mathrm{e}} \rangle$?
I need to label my axis with nice looking "<" and ">" LaTeX brackets. | How to label axes in Matplotlib using LaTeX brackets? | 1.2 | 0 | 0 | 7,377 |
21,486,362 | 2014-01-31T17:29:00.000 | 1 | 0 | 0 | 1 | python,linux,django,celery | 21,489,049 | 1 | true | 1 | 0 | Here is one approach: in your Django web application, write a message to a queue (e.g., RabbitMQ) containing the information that you need. In a separate system, read the message from the queue and perform any file actions. You can indeed use Celery for setting up this system. | 1 | 0 | 0 | Does anyone knows of a proven and simple way of running a system command from a django application?
Maybe using celery? ...
From my research, it's a problematic task, since it involves permissions and insecure approaches to the problem. Am i right?
EDIT: Use case: delete some files on a remote machine.
Thanks | How to run a system command from a django web application? | 1.2 | 0 | 0 | 148 |
21,490,336 | 2014-01-31T21:23:00.000 | 3 | 0 | 1 | 0 | python,ubuntu,pip | 21,490,370 | 2 | true | 0 | 0 | Any single pip installation is (roughly) specific to one Python installation. You can, however, have multiple parallel pip installations. Your package manager probably has a package called pip-3.3 or similar. If not, you can manually install it (run the get-pip.py script using Python 3.3), though you'll have to be care... | 1 | 1 | 0 | I'm using Ubuntu, how do I instruct pip to use the Python3 installation and not Python2.6? 2.6 is the default installation on Ubuntu. I can't upgrade that as it will break Ubuntu. | Instructing Pip to Use Python 3 | 1.2 | 0 | 0 | 95 |
21,497,489 | 2014-02-01T11:31:00.000 | 2 | 0 | 0 | 0 | python,flask,python-babel,flask-babel | 22,099,629 | 2 | false | 1 | 0 | It's not possible to use Babel in database translations, as database content is dynamic and babel translations are static (they didn't change).
If you read the strings from the database you must save the translations on the database. You can create a translation table, something like (locale, source, destination), and... | 1 | 9 | 0 | I'm using Flask-Babel for translating string.
In some templates I'm reading the strings from the database(postgresql).
How can I translate the strings from the database using Flask-Babel? | translating strings from database flask-babel | 0.197375 | 1 | 0 | 1,789 |
21,498,342 | 2014-02-01T12:57:00.000 | 1 | 0 | 1 | 1 | python,subprocess | 21,498,354 | 1 | true | 0 | 0 | Given you're working in a Linux/POSIX environment you could read the EDITOR environment variable using the os.environ map. | 1 | 0 | 0 | I am launching the text editor but for different users the default text editor could be different, so how do I get the name of which text editor is being used just to handle if an error occur switch to different text editor ? | how do I get the name of application launched by subprocess in python? | 1.2 | 0 | 0 | 35 |
21,500,736 | 2014-02-01T16:47:00.000 | 0 | 0 | 1 | 0 | python,regex,machine-learning | 21,604,563 | 6 | false | 0 | 0 | There were suggestions about unsupervised learning, but I recommend to use supervised learning, so you'll categorize 100-200 positions manually, and then algo will do the rest.
There are number of resources, libraries, etc. - look please at "Programming Collective Intelligence" book - they provided good machine learni... | 2 | 11 | 0 | Problem:
I am given a long list of various position titles for jobs in the IT industry (support or development); I need to automatically categorize them based on the general type of job they represent. For example, IT-support analyst, help desk analyst... etc. Could all belong to the group IT-Support.
Current Approach:... | Python - A way to learn and detect text patterns? | 0 | 0 | 0 | 13,027 |
21,500,736 | 2014-02-01T16:47:00.000 | 0 | 0 | 1 | 0 | python,regex,machine-learning | 21,549,987 | 6 | false | 0 | 0 | This sounds like a clustering, or unsupervised, problem rather than a decision tree one (do you know all the roles in advance, and can you provide labelled data).
If it were me, I'd be tempted to build a bag-of-words style representation of your strings and run a generic clustering algorithm (k-means, say) to see what ... | 2 | 11 | 0 | Problem:
I am given a long list of various position titles for jobs in the IT industry (support or development); I need to automatically categorize them based on the general type of job they represent. For example, IT-support analyst, help desk analyst... etc. Could all belong to the group IT-Support.
Current Approach:... | Python - A way to learn and detect text patterns? | 0 | 0 | 0 | 13,027 |
21,501,848 | 2014-02-01T18:28:00.000 | 0 | 0 | 1 | 0 | python,c,compilation | 21,501,934 | 3 | false | 0 | 0 | Variables in Python are just references to objects. The memory for an object is allocated at runtime in the moment that the object is instantiated. | 3 | 1 | 0 | I was wondering what happens internally so that using Python you don't need to declare a variable type before assign it to something.
Other languages like C reserve memory prior to the assignment phase.
I was just wondering what happens on compilation time so that Python can skip that step? | Assignments in Python | 0 | 0 | 0 | 89 |
21,501,848 | 2014-02-01T18:28:00.000 | 0 | 0 | 1 | 0 | python,c,compilation | 21,501,899 | 3 | false | 0 | 0 | Well, I think the python don't skip that step, what he does is look for the value inside the variable and then he should knows what type of variable it is. Like:
a = 5
b = 5.0
Python will look, what value is inside the a, well it's five, so lets make this variable an integer! And then move to the next variable. | 3 | 1 | 0 | I was wondering what happens internally so that using Python you don't need to declare a variable type before assign it to something.
Other languages like C reserve memory prior to the assignment phase.
I was just wondering what happens on compilation time so that Python can skip that step? | Assignments in Python | 0 | 0 | 0 | 89 |
21,501,848 | 2014-02-01T18:28:00.000 | 1 | 0 | 1 | 0 | python,c,compilation | 21,501,929 | 3 | true | 0 | 0 | If you look deep down at the C level, all Python objects are of type PyObject*, and allocated on the heap. Variables are just names (usually implemented as hash map entries) you bind to these objects. | 3 | 1 | 0 | I was wondering what happens internally so that using Python you don't need to declare a variable type before assign it to something.
Other languages like C reserve memory prior to the assignment phase.
I was just wondering what happens on compilation time so that Python can skip that step? | Assignments in Python | 1.2 | 0 | 0 | 89 |
21,502,099 | 2014-02-01T18:50:00.000 | 2 | 0 | 1 | 0 | python,scipy,spyder | 70,327,984 | 3 | false | 0 | 0 | I just started exploring Spyder 4.1.5 (unfortunately could not get 5.1.5 installed), and found this for EOL settings:
'Tools' > 'Preferences' > choose 'Editor' in the list on the left > 'Advanced setting' tab on the right > at the bottom is the 'End-of-line characters' section.
To convert existing CRLF to LF, select th... | 1 | 14 | 0 | I am using Spyder IDE to develop code and the IDE currently has default end-of-line character set to be CRLF. I would like to use '\n' instead because all my existing source code uses '\n' and so I don't want to have a bunch of new files that use a different end-of-line character.
Is there a way to specify the default ... | Spyder IDE: How do you configure default end-of-line character? | 0.132549 | 0 | 0 | 5,094 |
21,503,147 | 2014-02-01T20:20:00.000 | 2 | 0 | 0 | 1 | python,macos,python-imaging-library,pillow | 22,077,355 | 1 | false | 0 | 0 | Reinstall X11 from XQuartz.org
Install the latest XCode
Install the command line tools:
xcode-select --install
Worked for me on mavericks | 1 | 0 | 0 | I'm having trouble upgrading from PIL to PILLOW on my mac. I tried "brew install libtiff lbjpeg webp littlecms" but homebrew couldn't find the lbjpeg - any tips? | Changing from PIL to PILLOW on a mac | 0.379949 | 0 | 0 | 301 |
21,504,617 | 2014-02-01T22:40:00.000 | 5 | 0 | 1 | 1 | python,eclipse,python-2.7,ubuntu | 24,506,641 | 1 | false | 0 | 0 | Configure Aptana Studio's python interpreter( you can configure more than one)
In aptana, Window -> Preferences -> Interpreter Python and create a New interpreter. Select the python executable from the virtual environment (in windows it is python.exe which resides in Scripts subfoler of the virtualenv,where as in ubunt... | 1 | 3 | 0 | I did some searches on this topic and the solutions didn't work for me. I am running both a Linux (Ubuntu) environment and Windows. My system is Windows 8.1 but I have virtualbox with Ubuntu on that.
Starting with Windows... I created a venv directory off the root of the e drive. Created a project folder and then r... | How do I tell Aptana Studio to use Python virtualenv? | 0.761594 | 0 | 0 | 2,520 |
21,507,215 | 2014-02-02T04:56:00.000 | 3 | 1 | 1 | 0 | python,git,git-config | 21,507,326 | 1 | true | 0 | 0 | git has support for integrating with local keyring/password management utilities; search google for "git (name of your keyring program)". (These are called "credential helpers".)
Alternatively, if your remote is over SSH, you can use public key authentication, along with ssh-agent to remember the password to your priva... | 1 | 0 | 0 | I have made a git command in python, want user to save email password in git config but don't want any user to understand if he opens .gitconfig file !! | how to save password to git config in encrypted format that is is not readable if .gitconfig is opened | 1.2 | 0 | 0 | 292 |
21,507,956 | 2014-02-02T06:58:00.000 | 3 | 0 | 1 | 0 | python,matplotlib | 21,508,062 | 1 | true | 0 | 0 | Creating sample data
In [3]: data = {'title1': {10:20, 4:10}, 'title2':{8:10, 9:20, 10:30}}
In [4]: data
Out[4]: {'title1': {4: 10, 10: 20}, 'title2': {8: 10, 9: 20, 10: 30}}
Iterating over data; creating x and y for each title and plotting it in new figure
In [5]: for title, data_dict in data.iteritems():
...: ... | 1 | 1 | 1 | I need help plotting a dictionary, below is the data sample data set. I want to create a graph where x:y are (x,y) coordinates and title'x' would be the title of the graph.. I want to create individual graphs for each data set so one for title1':{x:y, x:y}, another one for title2:{x:y, x:y}....and so on.
Any help woul... | Plotting dictionaries within a dictionary in Myplotlib python | 1.2 | 0 | 0 | 6,297 |
21,509,104 | 2014-02-02T09:43:00.000 | 1 | 1 | 0 | 0 | python,webserver | 21,509,226 | 2 | false | 0 | 0 | With Flask you can do that in about ten lines of code. | 1 | 0 | 0 | I need to access my python programs through IP address for making it to do something in server. Creating Apache Server for only one python script is not good solution.
In server it works like: python script.py --arg
Now I need something like http://xxx.xxx.xxx.xxx:xxxx/script.py --arg or something else. Main idea is to... | Best way to create simple web server for python files | 0.099668 | 0 | 1 | 205 |
21,509,623 | 2014-02-02T10:46:00.000 | 0 | 0 | 0 | 0 | python,tkinter,raspberry-pi,on-screen-keyboard | 21,511,280 | 1 | true | 0 | 1 | You don't need to simulate keypresses if all you want to do is insert the numbers into the entry widget. Just have the buttons directly insert their value into the entry widget with the entry widget insert method. | 1 | 0 | 0 | I am using Tkinter to create an application which requires a 0-9 numerical keypad to be built in to the UI.
I plan to do this with 10 button widgets which enter the relevant number(s) into the currently selected Entry widget.
I do not want to use one of the pre-made on-screen keyboards (e.g. Matchbox-keyboard) that ar... | In Python (on Raspberry Pi) how do I create an embedded keypad within my Tkinter window | 1.2 | 0 | 0 | 1,024 |
21,509,787 | 2014-02-02T11:04:00.000 | 0 | 0 | 1 | 0 | python,merge | 21,510,352 | 1 | false | 0 | 0 | Open the gene descripion file, and load a dictionary where key would be the gene number, and the value would be the sample description.
Then open the module file, and loop on its lines. For each line, look for the corresponding gene entry in the dictionary. Print the module, gene, sample description.
That's it! If yo... | 1 | 0 | 0 | @tim-pietzcker I would like to merge two tab-delimited text files that share one common column. I have an 'identifier file' that looks like this (2 columns by 1050 rows):
module 1 gene 1
module 1 gene 2
..
module x gene y
I also have a tab-delimited 'target' text file that looks like this (36 columns by... | Merge two tab delimited text files by one common column in python | 0 | 0 | 0 | 689 |
21,510,739 | 2014-02-02T12:46:00.000 | 0 | 0 | 1 | 0 | python,virtual-machine | 21,511,103 | 2 | false | 0 | 0 | Run this in command prompt
python -c "from platform import python_implementation; print python_implementation()" | 1 | 4 | 0 | I installed Python in my PC. how to find out which VM came with it.
is it cpython or ipython or jpython? | How to find out which VM i have in my Python installation? | 0 | 0 | 0 | 68 |
21,514,258 | 2014-02-02T18:11:00.000 | 0 | 1 | 0 | 0 | python,python-3.x,cgi,fork | 21,541,263 | 1 | true | 0 | 0 | Never run application from cgi scripts, It's very insecure. Use any DB and cron for this. Store data from your cgi script to DB and run from cron mail script that will sending all emails. | 1 | 0 | 0 | I am making a website for a sports team. there is a python 3.3 cgi script that allows a user to input match data. I would like to send an email to everyone on the mailing list to tell them that there has been a new match submitted, but I obviously don't want the person inputting the data to be waiting for ages while al... | How to fork a python script in the background from cgi script | 1.2 | 0 | 0 | 217 |
21,514,717 | 2014-02-02T18:50:00.000 | 0 | 0 | 1 | 0 | linux,qt,pyqt,size,python-2.x | 21,546,276 | 1 | true | 0 | 1 | I can't think of a way of doing what you want, but if you are using a standard PyQt distro, standard practice is to leave it up to the user to download and install dependencies. This could be automated by having an install script part of your ISO, that determines if pyqt is needed and if not available fetches the pyqt ... | 1 | 2 | 0 | I have a PyQt program that's apart of package which is only about 9MB. This isn't much of a concern except that the Qt dependencies that get drawn in with it combined are closer to 100MB.
So my question is there any logical and safe way of including only portions of the Qt library that I could include in my package and... | Including only minimal Qt library with a program | 1.2 | 0 | 0 | 223 |
21,516,027 | 2014-02-02T20:48:00.000 | 3 | 0 | 1 | 0 | python,pycharm,pyscripter | 21,516,091 | 6 | false | 0 | 0 | Run -> Edit configuration -> select the script you want to run and give it a display name -> OK
Now you can run it with the green "Run" button. The green bug button (next to the run button) will run it in debug mode.
Remark: next to the run button you can monitor the script/configuration you run by selecting it's displ... | 2 | 16 | 0 | Are there any smooth way to run Python scripts in the PyCharm's console?
My previous IDE - PyScripter - provides me with that nice little feature. As far as I know PyCharm has 2 ways of running script in console:
1) Select a bunch of code and press Ctrl+Alt+E.
2) Save the code in a file and import it from the Console.
... | Running code in PyCharm's console | 0.099668 | 0 | 0 | 22,031 |
21,516,027 | 2014-02-02T20:48:00.000 | 28 | 0 | 1 | 0 | python,pycharm,pyscripter | 22,387,377 | 6 | false | 0 | 0 | In the Run/Debug Configuration, add -i to the interpreter options. This will stop it from closing a python session even after a successful run. I.e. you will be able to see all the variable contents | 2 | 16 | 0 | Are there any smooth way to run Python scripts in the PyCharm's console?
My previous IDE - PyScripter - provides me with that nice little feature. As far as I know PyCharm has 2 ways of running script in console:
1) Select a bunch of code and press Ctrl+Alt+E.
2) Save the code in a file and import it from the Console.
... | Running code in PyCharm's console | 1 | 0 | 0 | 22,031 |
21,516,287 | 2014-02-02T21:10:00.000 | 0 | 0 | 0 | 1 | google-app-engine,python-2.7,google-cloud-endpoints | 23,165,174 | 2 | true | 1 | 0 | From what I gather, Google has enabled partial response for their APIs, but has not yet explained how to enable it for custom APIs.
I'm assuming if they do let us know, it might entail annotations, and possibly overriding a method or two.
I've been looking also, to no avail.
I've been looking into this just due to a re... | 1 | 0 | 0 | I am learning endpoints and saw that other Google APIs have this "fields" query attribute.
Also it appears in the api explorer.
I would like to get a partial response for my api also, but when using the fields selector from the api explorer it is simply ignored by the server.
Do I need to implement something in the s... | How do you return a Partial response in app engine python endpoints? | 1.2 | 0 | 1 | 418 |
21,517,296 | 2014-02-02T22:48:00.000 | 0 | 0 | 1 | 0 | ipython,ipython-notebook | 27,819,206 | 3 | false | 0 | 0 | Updating iPython Notebook solved several problems I had with iPython Notebook; for instance, it autosaves, or auto-correction is disabled, or %matplotlib inline works now (before updating, I had to use --pylab inline in the command line when I was running $ipython notebook).
As I use coda on my mac, I updated iPython N... | 1 | 4 | 0 | Does anyone know if there's an option (or a suggested hack) to make IPython notebooks save automatically before executing a cell?
Many times I've been working on something without saving for quite some time, then I execute a stupid command that prints so much crap to the console that my browser becomes unresponsive, le... | How to autosave ipython notebook | 0 | 0 | 0 | 2,023 |
21,517,747 | 2014-02-02T23:35:00.000 | 2 | 1 | 0 | 1 | python,python-2.7,python-3.x,emacs,autocomplete | 21,522,470 | 1 | true | 0 | 0 | Maybe disable auto-complete at all? BTW from my feeling relying on company, not jedi, the distraction from auto-complete in most cases is far over gain. Emacs comes with a lot of great tools making edits faster: abbrev, dabbrev etc. which seem much more efficient. Well, if jedi delivers really intelligent completions, ... | 1 | 3 | 0 | I just now realize what is causing the trouble:
Whenever the interpreter is busy, my Emacs buffer containing the python script buffer gets stuck, as I suspect that Emacs is trying to get the information of a function, and display it as a pop up. My usual solution is to spam C-g, but that gets old quickly.
It has been b... | Emacs freezing when asking Jedi/Auto Complete information while Interpreter is busy | 1.2 | 0 | 0 | 673 |
21,518,268 | 2014-02-03T00:53:00.000 | 1 | 0 | 0 | 0 | python,django,mongodb,postgresql,amazon-s3 | 21,518,701 | 1 | true | 1 | 0 | Its good to have different settings for production and dev.
So you can just create a settings folder and have settings may be prod.py and dev.py. this will let you use diff apps for eg: you actually don't need debug tool bar on prod.
And regarding the file, I feel you dont have to worry about the structure as such, ... | 1 | 0 | 0 | I'm having trouble in establishing an ideal setup where I can distinguish between production and test environment for my django app.
I'm using a postgresql database that stores a relative file path to a s3 bucket after I upload an image. Am I supposed to make a production copy of all the files in the s3 bucket and con... | How should I set up my dev enviornment for a django app so that I can pull on static s3 files? | 1.2 | 1 | 0 | 41 |
21,518,745 | 2014-02-03T02:07:00.000 | 4 | 0 | 1 | 0 | python,regex,sed,awk | 21,518,754 | 2 | false | 0 | 0 | No. Python provides this behavior through the re.sub function or the equivalent method on compiled regexp objects, but does not use the sed-style syntax. | 1 | 0 | 0 | I'm writing something in Python and I require a s/old/new/flags-style regular expression replacement method for Python, with that syntax. Is this something that Python provides, without me having to call sed or something?
Thanks. | s/old/new syntax regex replacement in Python | 0.379949 | 0 | 0 | 102 |
21,518,819 | 2014-02-03T02:22:00.000 | 7 | 0 | 1 | 0 | python,c | 21,518,829 | 4 | true | 0 | 0 | This is simply not valid in Python. You can't use an assignment as an expression. | 4 | 2 | 0 | New to both python, and fairly beginner in C. Why will the subject code return an error in python?
Does the assignment not have a return value? | why does this work in c but not in python: (a = 5) == 5 | 1.2 | 0 | 0 | 121 |
21,518,819 | 2014-02-03T02:22:00.000 | 1 | 0 | 1 | 0 | python,c | 21,519,846 | 4 | false | 0 | 0 | C's design influenced Python noticeably (check out the string % operator), but some things were rejected because they were a source of errors in C code. Assignment expressions where one such. Preincrement and postincrement were rejected for similar reasons, but += (and similar) eventually made it in. | 4 | 2 | 0 | New to both python, and fairly beginner in C. Why will the subject code return an error in python?
Does the assignment not have a return value? | why does this work in c but not in python: (a = 5) == 5 | 0.049958 | 0 | 0 | 121 |
21,518,819 | 2014-02-03T02:22:00.000 | 2 | 0 | 1 | 0 | python,c | 21,518,879 | 4 | false | 0 | 0 | I am going to expand on Simeon's answer.
First off, you are putting parenthesis around an expression. If you type that into the interpreter by itself you will get a syntax error. That is because parenthesis are only defined/interpreted in context - there is no context for Python when you are using an expression wit... | 4 | 2 | 0 | New to both python, and fairly beginner in C. Why will the subject code return an error in python?
Does the assignment not have a return value? | why does this work in c but not in python: (a = 5) == 5 | 0.099668 | 0 | 0 | 121 |
21,518,819 | 2014-02-03T02:22:00.000 | 1 | 0 | 1 | 0 | python,c | 21,520,908 | 4 | false | 0 | 0 | If you evaluate this statement, it comes down to
True == 5
Does that make sense anywhere? I don't believe so. | 4 | 2 | 0 | New to both python, and fairly beginner in C. Why will the subject code return an error in python?
Does the assignment not have a return value? | why does this work in c but not in python: (a = 5) == 5 | 0.049958 | 0 | 0 | 121 |
21,520,459 | 2014-02-03T05:39:00.000 | -1 | 1 | 0 | 0 | python,httprequest,buildbot | 22,557,265 | 2 | false | 0 | 0 | Just my thoughts..As far as I know it is better to use a python script from a build step. Simple and easy to control. The logic being:
the entire buildbot is inside one http connection/session and sending another http request somewhere might have issues with the connection/session.
from the buildbot httpstep descripti... | 1 | 1 | 0 | I am using buildbot version 0.8.5 and need to send an HTTP post request from it as a step. After searching for it on internet, I found that the latest version 0.8.8 has a step called HTTPStep for doing so. Is there any similar step in the older version?
I know it can be done using batch file or python program using url... | Sending http post request in buildbot | -0.099668 | 0 | 1 | 268 |
21,521,587 | 2014-02-03T07:09:00.000 | 12 | 0 | 1 | 1 | python,libcurl,pycurl | 22,518,780 | 2 | false | 0 | 0 | Use one of the two methods
Method 1:
sudo easy_install pycurl
Method 2:
pip install pycurl | 1 | 5 | 0 | I am very new to python and need help installing the pycurl library on my machine. I am running python 2.7 at the moment. A brief tutorial would be much appreciated. | Installing pycurl on mac | 1 | 0 | 0 | 10,669 |
21,527,115 | 2014-02-03T12:11:00.000 | 1 | 0 | 1 | 0 | windows,jython,python-sphinx,jython-2.5 | 21,824,353 | 1 | true | 1 | 0 | I have managed to get it working. The problem was that the manual installation and the use of Jython meant that certain environment variables that were expected were not in place. Also, the use of Windows 7 (and I believe MS Windows in general) means that Python scripts without an extension cannot be run without callin... | 1 | 1 | 0 | Once sphinx-apidoc has been run the command C:\path\to\doc\make html produces an error beginning:
The 'sphinx-build' command was not found [snip]
However the command does exist and the relevant environment variables are set.
More detail:
1 - Trying to run sphinx_apidoc:
'C:\path\to\jython\bin\sphinx-apidoc' is not r... | How to get Sphinx working with Jython on an unnetworked Windows 7 computer? | 1.2 | 0 | 0 | 376 |
21,527,471 | 2014-02-03T12:28:00.000 | 4 | 0 | 1 | 0 | python,virtualenv,pip | 21,527,635 | 2 | false | 0 | 0 | virtualenv is used to create seperate environment for each project, based on its dependencies.
If --no-site-packages is not set, then the virtual envrironment will only contain symbolic links ( shortcuts) to the global site-packages.
If it is set, then it creates a copy of the site package to provide fully isolated env... | 1 | 1 | 0 | I am very new to python. I am trying to install virtualenv and create a sample project.
I could see the option like --no-site-packages. I tried(virtualenv myapp) without specifying option and try to install flask package(pip install flask). It installs in the package in lib/python2.7/site-packages/flask.
What is the p... | What is --no-site-packages in virtualenv | 0.379949 | 0 | 0 | 2,339 |
21,529,226 | 2014-02-03T13:55:00.000 | 1 | 0 | 0 | 0 | python,django,unit-testing,plugins,django-cms | 21,529,356 | 1 | true | 1 | 0 | create a page with cms.api... and then get the right placeholder form page.placeholders.all() and call the add_plugin() with this. | 1 | 0 | 0 | My Django app needs a test that follows the following scenario: creates a page, edits it by adding a new plugin, then saves it. So far, I am stuck at adding the plugin to the page. How can I do this programatically in a test?
I looked over add_plugin() from cms.api, but it needs a placeholder, which I have no idea how ... | Add plugin on Django-CMS page programatically in unit test | 1.2 | 0 | 0 | 710 |
21,532,724 | 2014-02-03T16:39:00.000 | 1 | 0 | 0 | 0 | python,scikit-learn | 21,532,842 | 2 | false | 0 | 0 | Clustering is not in itself that well-defined a problem (a 'good' clustering result depends on your application) and k-means algorithm only gives locally optimal solutions based on random initialization criteria. Therefore I doubt that the results you would get from clustering a random 2GB subsample of the dataset woul... | 1 | 1 | 1 | I am using scikit-learn. I want to cluster a 6gb dataset of documents and find clusters of documents.
I only have about 4Gb ram though. Is there a way to get k-means to handle large datasets in scikit-learn?
Thank you, Please let me know if you have any questions. | Handling K-means with large dataset 6gb with scikit-learn? | 0.099668 | 0 | 0 | 2,177 |
21,535,003 | 2014-02-03T18:36:00.000 | 1 | 1 | 0 | 0 | python,api,soundcloud | 30,069,248 | 3 | false | 0 | 0 | You can also do the following :
import soundcloud
token= 'user_access_token'
client = soundcloud.Client(access_token=token)
user_info = client.get('/me')
user_favorites = client.get('/me/favorites')
user_tracks = client.get('/me/tracks')
and so on... | 1 | 1 | 0 | Issues using SoundCloud API with python to get user info
I've downloaded the soundcloud library and followed the tutorials, and saw on the soundcloud dev page that user syntax is, for example /users/{id}/favorites.
I just don't know how to use python to query user information. Specifically, i would like to print a lis... | soundcloud api python user information | 0.066568 | 0 | 0 | 503 |
21,535,028 | 2014-02-03T18:37:00.000 | 2 | 1 | 0 | 0 | python,robotframework,python-unittest | 26,558,782 | 3 | false | 1 | 0 | Robot is not at all based on xunit technologies. Personally I think it makes a great unit testing framework for python code, since you can create keywords that can directly import your modules. I use this technique for some projects I work on.
With robot, you can tag your unit tests or put them all in a separate hierar... | 2 | 6 | 0 | Our group is evaluating Robot Test Framework for our QA group, not just for BDD, but also to possibly cover a lot of our regular functionality testing needs. It certainly is a compelling project.
To what extent, if any, is Robot Framework based on xunit (unittest) architecture? I see that unittest asserts can be used, ... | Running unittest Test Cases and Robot Framework Test Cases Together | 0.132549 | 0 | 0 | 7,792 |
21,535,028 | 2014-02-03T18:37:00.000 | 10 | 1 | 0 | 0 | python,robotframework,python-unittest | 21,565,221 | 3 | false | 1 | 0 | RobotFramework is not the right tool for unit testing.
Unit-tests should be written in the same language of the units (modules, classes, etc.)
The ability to describe scenarios in natural language (which is one of the strongest features of systems like RF) is worthless in unit tests. At this level of testing scenarios... | 2 | 6 | 0 | Our group is evaluating Robot Test Framework for our QA group, not just for BDD, but also to possibly cover a lot of our regular functionality testing needs. It certainly is a compelling project.
To what extent, if any, is Robot Framework based on xunit (unittest) architecture? I see that unittest asserts can be used, ... | Running unittest Test Cases and Robot Framework Test Cases Together | 1 | 0 | 0 | 7,792 |
21,535,376 | 2014-02-03T18:54:00.000 | 6 | 1 | 0 | 0 | python,scheduler,win32com | 21,536,420 | 1 | true | 0 | 0 | Office isn't designed to run as a service, and needs to be run interactively. You'll need to change your task configuration in Task Scheduler to run the task as the currently logged-in user, on the current user's desktop, with the current user's privileges. | 1 | 5 | 0 | I have a python script that sends out an email using win32com and Outlook. The script runs without a hitch when I run it through an interpreter or double-click on the script. However, when I run it through the Task Scheduler, I get the following message:
"Something went wrong. We couldn't start your program. Please try... | Python script involving Outlook through win32com runs when double-clicking, but not through task scheduler | 1.2 | 0 | 0 | 2,057 |
21,536,786 | 2014-02-03T20:13:00.000 | 0 | 0 | 0 | 0 | python,svg | 21,537,454 | 3 | false | 0 | 0 | I simple used circles as dots, with a tiny radius. | 1 | 1 | 0 | I'd like to draw a curve with svgwrite, I'd like to do it pixel by pixel because I'm doing some calculations on the coordinates.
How could I do it? | Draw a pixel or point | 0 | 0 | 0 | 772 |
21,538,086 | 2014-02-03T21:24:00.000 | 2 | 0 | 0 | 1 | python,process,uwsgi | 21,546,696 | 1 | false | 0 | 0 | Use --lazy-apps, in this way the app will be loaded by each worker after the master has been fully spawned (and its external daemons started) | 1 | 1 | 0 | I have a separate process that I want to run alongside the python process I have managed by uWSGI. I wanted to use the attach-daemon option to start this process, but it seems that bash command specified in attach-daemon does not get called until after the python process' app gets started up. However, I need the proces... | uwsgi attach-daemon before python process starts | 0.379949 | 0 | 0 | 380 |
21,538,859 | 2014-02-03T22:07:00.000 | 39 | 0 | 1 | 0 | python,django,pycharm | 22,899,916 | 16 | false | 1 | 0 | To set your environment variables in PyCharm do the following:
Open the 'File' menu
Click 'Settings'
Click the '+' sign next to 'Console'
Click Python Console
Click the '...' button next to environment variables
Click the '+' to add environment variables | 6 | 45 | 0 | I have moved my SECRET_KEY value out of my settings file, and it gets set when I load my virtualenv. I can confirm the value is present from python manage.py shell.
When I run the Django Console, SECRET_KEY is missing, as it should. So in preferences, I go to Console>Django Console and load SECRET_KEY and the appropria... | Pycharm: set environment variable for run manage.py Task | 1 | 0 | 0 | 74,590 |
21,538,859 | 2014-02-03T22:07:00.000 | 15 | 0 | 1 | 0 | python,django,pycharm | 21,603,624 | 16 | false | 1 | 0 | Same here, for some reason PyCharm cant see exported env vars.
For now i set SECRET_KEY in PyCharm Run/Debug Configurations -> "Environment variables" | 6 | 45 | 0 | I have moved my SECRET_KEY value out of my settings file, and it gets set when I load my virtualenv. I can confirm the value is present from python manage.py shell.
When I run the Django Console, SECRET_KEY is missing, as it should. So in preferences, I go to Console>Django Console and load SECRET_KEY and the appropria... | Pycharm: set environment variable for run manage.py Task | 1 | 0 | 0 | 74,590 |
21,538,859 | 2014-02-03T22:07:00.000 | 22 | 0 | 1 | 0 | python,django,pycharm | 30,374,246 | 16 | false | 1 | 0 | Another option that's worked for me:
Open a terminal
Activate the virtualenv of the project which will cause the hooks to run and set the environment variables
Launch PyCharm from this command line.
Pycharm will then have access to the environment variables. Likely because of something having to do with the PyCharm ... | 6 | 45 | 0 | I have moved my SECRET_KEY value out of my settings file, and it gets set when I load my virtualenv. I can confirm the value is present from python manage.py shell.
When I run the Django Console, SECRET_KEY is missing, as it should. So in preferences, I go to Console>Django Console and load SECRET_KEY and the appropria... | Pycharm: set environment variable for run manage.py Task | 1 | 0 | 0 | 74,590 |
21,538,859 | 2014-02-03T22:07:00.000 | 20 | 0 | 1 | 0 | python,django,pycharm | 28,723,630 | 16 | false | 1 | 0 | You can set the manage.py task environment variables via:
Preferences| Languages&Frameworks| Django| Manage.py tasks
Setting the env vars via the run/debug/console configuration won't affect the built in pycharm's manage.py task. | 6 | 45 | 0 | I have moved my SECRET_KEY value out of my settings file, and it gets set when I load my virtualenv. I can confirm the value is present from python manage.py shell.
When I run the Django Console, SECRET_KEY is missing, as it should. So in preferences, I go to Console>Django Console and load SECRET_KEY and the appropria... | Pycharm: set environment variable for run manage.py Task | 1 | 0 | 0 | 74,590 |
21,538,859 | 2014-02-03T22:07:00.000 | 0 | 0 | 1 | 0 | python,django,pycharm | 41,200,535 | 16 | false | 1 | 0 | Please note that the answer mentioned by "nu everest" works but you will not see Console tab available unless you create a project in pycharm. As individual files can be run without creating a project in pycharm some people might be confused. Although you have also to note that settings are lost to run-configurations t... | 6 | 45 | 0 | I have moved my SECRET_KEY value out of my settings file, and it gets set when I load my virtualenv. I can confirm the value is present from python manage.py shell.
When I run the Django Console, SECRET_KEY is missing, as it should. So in preferences, I go to Console>Django Console and load SECRET_KEY and the appropria... | Pycharm: set environment variable for run manage.py Task | 0 | 0 | 0 | 74,590 |
21,538,859 | 2014-02-03T22:07:00.000 | 4 | 0 | 1 | 0 | python,django,pycharm | 65,267,215 | 16 | false | 1 | 0 | When using PyCharm along with Django, there are multiple sections where you can set environment variables (EVs):
File > Settings > Languages and Frameworks > Django
There's no purpose to set EVs here
File > Settings > Build, Execution, Deployment > Console > Python Console
There's no purpose to set EVs here
File... | 6 | 45 | 0 | I have moved my SECRET_KEY value out of my settings file, and it gets set when I load my virtualenv. I can confirm the value is present from python manage.py shell.
When I run the Django Console, SECRET_KEY is missing, as it should. So in preferences, I go to Console>Django Console and load SECRET_KEY and the appropria... | Pycharm: set environment variable for run manage.py Task | 0.049958 | 0 | 0 | 74,590 |
21,540,126 | 2014-02-03T23:39:00.000 | 2 | 1 | 1 | 0 | python,c,programming-languages,yacc,ply | 21,540,275 | 1 | true | 0 | 1 | If you are implementing a compiler in PLY, the compilation may take longer - but that's irrelevant the execution speed of your program.
For example, you could use PLY to write a C compiler. The compiler may or may not be faster than your other C compiler, but the resulting executable should run at a similar speed (unle... | 1 | 0 | 0 | I'm interested in creating my own programming language and I would like to use python. My question is, would a language written in Python using the PLY library be considerably slower than CPython or would they be about the same in terms of program execution speed?
Also in terms of performance how much better would it b... | Would a language written in Python using PLY be slow? | 1.2 | 0 | 0 | 243 |
21,545,072 | 2014-02-04T06:02:00.000 | 1 | 0 | 1 | 0 | python,pip,ipython,conda | 21,581,989 | 2 | false | 0 | 0 | If you're worried about it, you can just delete your Anaconda installation and start over. Or you can create a new conda environment conda create and work from that. | 2 | 8 | 0 | I'm trying to deal with iPython and the associated tools, but and in the process, I ended up installing ipython, numpy, scipy and other packages on both pip and conda (conda comes with a bunch of these goodies).
Any ideas/suggestions on what to do about resolving this? It hasn't caused me any problems yet, but I'm afr... | Python packages duplicates installed with pip and conda | 0.099668 | 0 | 0 | 3,444 |
21,545,072 | 2014-02-04T06:02:00.000 | 5 | 0 | 1 | 0 | python,pip,ipython,conda | 21,571,529 | 2 | false | 0 | 0 | A couple of points of clarification:
conda is the packaging tool used in the Anaconda python distribution. So, when you say "conda comes with a bunch of these goodies", I'm assuming you mean Anaconda.
If you pip installed a bunch of packages, and then installed Anaconda, you should be fine: After a successful installa... | 2 | 8 | 0 | I'm trying to deal with iPython and the associated tools, but and in the process, I ended up installing ipython, numpy, scipy and other packages on both pip and conda (conda comes with a bunch of these goodies).
Any ideas/suggestions on what to do about resolving this? It hasn't caused me any problems yet, but I'm afr... | Python packages duplicates installed with pip and conda | 0.462117 | 0 | 0 | 3,444 |
21,545,635 | 2014-02-04T06:40:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine | 37,264,173 | 2 | false | 1 | 0 | Sorry to revive this old question, but I have a solution for this issue given a few constraints with possible workarounds. Basically, the cursors for previous pages can be stored and reused for revisiting that page.
Constraints:
This requires that pagination is done dynamically (e.g. with Javascript) so that older curs... | 1 | 6 | 0 | I want to do pagination in google app engine search api using cursors (not offset). the forward pagination is straight forward , the problem is how to implement the backward pagination. | Pagination in Google App EngineSearch API | 0.099668 | 0 | 0 | 575 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.