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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9,430,027 | 2012-02-24T11:31:00.000 | 0 | 0 | 0 | 0 | python,networkx | 56,307,005 | 2 | false | 0 | 0 | Alternatively, depending on the type of graph--namely, directed, strongly or weakly connected, or undirected--create component subgraphs (sub_G), that is,
(G.subgraph(c) for c in connected_components(G))
or if directed:
nx.weakly_connected_component_subgraphs(G) or
nx.strongly_connected_component_subgraphs(G)
Further... | 1 | 14 | 0 | I'm using networkx to manage large network graph which consists of 50k nodes.
I want to calculate the shortest path length between a specific set of nodes, say N.
For that i'm using the nx.shortest_path_length function.
In some of the nodes from N there might not be a path so networkx is raising and stopping my progr... | Networkx - Shortest path length | 0 | 0 | 1 | 14,103 |
9,430,829 | 2012-02-24T12:31:00.000 | 1 | 0 | 0 | 0 | java,python,ms-word,docx,doc | 9,431,308 | 3 | false | 1 | 0 | Anything you can do with word, you can do with the word com object.
Install PythonWin.
Use the object browser under "Tools->COM browser" to find what you need. | 1 | 0 | 0 | For a web-to-print we need to generate a .doc (Microsoft Word 2003+) compatible templates/documents where we need to position some data inside the document (basically we need to auto-generated letter heads for address, phone, contact information etc.).
Which Python or Java based solutions can be used here that providin... | Generating DOC (and DOCX) templates using Python or Java with absolute positioned boxes | 0.066568 | 0 | 0 | 1,110 |
9,431,870 | 2012-02-24T13:53:00.000 | 1 | 0 | 0 | 0 | python,qt,customization,pyside,qtreeview | 9,434,264 | 1 | true | 0 | 1 | I'd recomend you use simple QTreeWidget and insert complex widgets with setItemWidget. While Qt's widhets are alien, they are not so heavy to draw, but:
You shouldn't create delegates.
You shouldn't handle events (If you are going to place button in view and draw it using delegates, you had to handle all its events, s... | 1 | 0 | 0 | I'm new to PySide and Qt at all, and now need to create an application which has a tree view with styled items. Each item needs two lines of text (different styles), and a button. Many items are supposed to be in the view, so I chose QTreeView over QTreeWidget. Now I managed to add simple text items (non-styled) to the... | Customize QTreeView items | 1.2 | 0 | 0 | 1,305 |
9,432,332 | 2012-02-24T14:26:00.000 | 0 | 0 | 0 | 0 | python,odbc | 9,432,486 | 1 | false | 0 | 0 | The server side of ODBC is already done, it is your RDBMS.
ODBC is a client side thing, most implementations are just a bridge between ODBC interface and the native client interface for you-name-your-RDBMS-here.
That is why you will not find anything about the server side of ODBC... :-)
Implementing a RDBMS (even with ... | 1 | 1 | 0 | I'd like to add a feature to my behind the firewall webapp that exposes and ODBC interface so users can connect with a spreadsheet program to explore our data.
We don't use a RDBMS so I want to emulate the server side of the connection.
I've searched extensively for a library or framework that helps to implement the se... | Are there any libraries (or frameworks) that aid in implementing the server side of ODBC? | 0 | 1 | 0 | 59 |
9,434,494 | 2012-02-24T16:35:00.000 | 0 | 0 | 1 | 0 | python,asynchronous,client,asyncsocket | 9,527,618 | 1 | false | 0 | 0 | Is it possible for each thread (each client) to open their own socket? In that case, it's all a non-issue: Only the client in that one thread has a handle on that socket and so it automatically gets the correct data from the server. For the server, all of these connections from the client will look like completely inde... | 1 | 2 | 0 | first thing is, I'm a long time lurker but the first time user, I'd like to thank you all for creating the site!
I'm in a situation that I need to implement the client part of a proprietary protocol. The protocol uses TCP/IP underneath and the message flow can be summarized as follows:
Client connects to server
Client... | Long-lived multithreaded client for a proprietary protocol (Python, select, epoll) | 0 | 0 | 1 | 494 |
9,435,259 | 2012-02-24T17:29:00.000 | 0 | 0 | 0 | 1 | python,django,centos,cpanel,yum | 9,775,582 | 4 | false | 1 | 0 | You can install any version of python from source as long as you don't overwrite cPanel's python 2.4 installation at /usr/bin. To do this, use the -prefix= option when you configure the python 2.x or python 3.x source for build. | 2 | 1 | 0 | I have a server which is running CentOS with cpanel/whm. Otherwise, it is pretty much a standard set up.
My problem is that such server is running python 2.4 and I need python 2.6 or later. How do I upgrade without breaking anything?
By the way, I currently have a django application running on that server, which I woul... | Update python in server running centos/whm? | 0 | 0 | 0 | 2,583 |
9,435,259 | 2012-02-24T17:29:00.000 | 0 | 0 | 0 | 1 | python,django,centos,cpanel,yum | 10,049,589 | 4 | false | 1 | 0 | The simplest way to install an alternate version of Python is to download the source and compile it. When you've finished running ./configure and make, you'll want to install using make altinstall, with python 2.6 you'd end up with an interpreter named python26 | 2 | 1 | 0 | I have a server which is running CentOS with cpanel/whm. Otherwise, it is pretty much a standard set up.
My problem is that such server is running python 2.4 and I need python 2.6 or later. How do I upgrade without breaking anything?
By the way, I currently have a django application running on that server, which I woul... | Update python in server running centos/whm? | 0 | 0 | 0 | 2,583 |
9,440,303 | 2012-02-25T01:31:00.000 | 3 | 0 | 0 | 1 | python,twisted | 9,440,925 | 2 | false | 0 | 0 | You need to set the %PATHEXT% environment variable to include .py, as well as %PATH% including the path to twistd. Your most-recently-installed version of Python should then automatically launch it, assuming the filetype association was set correctly by the installer. | 1 | 2 | 0 | I'm trying to develop a Twisted Web server but can't seem to run the twistd command. I've tried setting the python path and even included the path to the twistd.py script in my Path but nothing seems to work.
I'm using Twisted 12.0.0 and Python 2.7 on Windows. Any help would be hugely appreciated. | 'twistd' is not a recognized internal or external command | 0.291313 | 0 | 0 | 1,615 |
9,445,370 | 2012-02-25T15:35:00.000 | 6 | 0 | 1 | 0 | python,zeromq | 9,445,393 | 7 | false | 0 | 0 | Encode as JSON before sending, and decode as JSON after receiving. | 3 | 14 | 0 | What is the correct/best way to send objects like lists or dicts over zeromq in python?
What if we use a PUB/SUB pattern, where the first part of the string would be used as a filter?
I am aware that there are multipart messages, but they where originally meant for a different purpose. Further you can not subscribe al... | lists or dicts over zeromq in python | 1 | 0 | 0 | 8,528 |
9,445,370 | 2012-02-25T15:35:00.000 | 7 | 0 | 1 | 0 | python,zeromq | 9,445,781 | 7 | false | 0 | 0 | In zeroMQ, a message is simple a binary blob. You can put anything in it that you want. When you have an object that has multiple parts, you need to first serialize it into something that can be deserialized on the other end. The simplest way to do this is to use obj.repr() which produces a string that you can execute ... | 3 | 14 | 0 | What is the correct/best way to send objects like lists or dicts over zeromq in python?
What if we use a PUB/SUB pattern, where the first part of the string would be used as a filter?
I am aware that there are multipart messages, but they where originally meant for a different purpose. Further you can not subscribe al... | lists or dicts over zeromq in python | 1 | 0 | 0 | 8,528 |
9,445,370 | 2012-02-25T15:35:00.000 | 18 | 0 | 1 | 0 | python,zeromq | 9,445,903 | 7 | true | 0 | 0 | Manual serialization
You turn the data into a string, concatenate or else, do your stuff. It's fast and doesn't take much space but requires work and maintenance, and it's not flexible.
If another language wants to read the data, you need to code it again. No DRY.
Ok for very small data, but really the amount of work i... | 3 | 14 | 0 | What is the correct/best way to send objects like lists or dicts over zeromq in python?
What if we use a PUB/SUB pattern, where the first part of the string would be used as a filter?
I am aware that there are multipart messages, but they where originally meant for a different purpose. Further you can not subscribe al... | lists or dicts over zeromq in python | 1.2 | 0 | 0 | 8,528 |
9,446,769 | 2012-02-25T18:27:00.000 | 1 | 0 | 0 | 0 | python,plone,zope | 9,456,924 | 1 | false | 1 | 0 | You are not saving the file on the filesystem, but in the Zope object database. You'd have to use python code (not a python script) to open a filepath with the open built-in function to save the data to. | 1 | 2 | 0 | I am using plone to build my site.
In one page template, I have the <input type="file" name="file"> and this form: <form method="post" action="addintoDb" enctype="multipart/form-data"
The addintoDb is a python script that save my information into db:context.addParam(name=request.name, path=request['file']).
in my db ... | upload file with python script in plone | 0.197375 | 1 | 0 | 890 |
9,449,927 | 2012-02-26T02:09:00.000 | 1 | 0 | 1 | 0 | python | 9,450,016 | 3 | false | 0 | 0 | You may try importing pdb and doing a pdb.pprint.pprint(response)
If it's a program running on your own machine, you can also do a pdb.set_trace() and play with response.
The ipdb module has nicer versions, but it's not usually installed by default. | 1 | 0 | 0 | I would like to interrogate all new emails (one by one) and find the contents of them so that I can use the contents for another application.
My first step was interpreting the return values from a search done via the search attr of an IMAP4 object. I'm trying to figure out what data is in a list that I have returne... | find all items in list object | 0.066568 | 0 | 0 | 176 |
9,451,214 | 2012-02-26T07:03:00.000 | 1 | 0 | 0 | 0 | android,python,html,cordova,titanium | 10,339,850 | 1 | false | 1 | 0 | PhoneGap: Simply put your HTML(5), JavaScript and CSS code. You can use 3rd party JavaScript libraries like jQuery, MooTools, etc. You need to code or use libraries to get native feel/UI look. Nothing much different than straight way. PhoneGap just gives you additional mobile features and events which you can bring nat... | 1 | 1 | 0 | I don't have much experience developing native mobile apps. But I am in need of developing an app that runs in all mobile platforms. I came across Titanium and Phonegap as possible solution. And I am not sure how they work?
Is it basically that you create a web-app that runs on server. And PhoneGap/Titatnium simply wra... | Do HTML5 mobile app run on server and are accessed via web browser of sorts? | 0.197375 | 0 | 0 | 1,089 |
9,451,929 | 2012-02-26T09:23:00.000 | 5 | 1 | 1 | 0 | python | 17,551,576 | 6 | false | 0 | 0 | You get a good idea if you compile python from source. Usually it's gcc that compiles the *.c files | 1 | 98 | 0 | What is the base language Python is written in? | Base language of Python | 0.16514 | 0 | 0 | 106,795 |
9,452,318 | 2012-02-26T10:24:00.000 | 1 | 0 | 1 | 0 | python,login | 9,452,378 | 1 | true | 0 | 1 | TKinter's Entry widget has a show option. If you set this option to a single character (e.g. *), this character is displayed instead of the actual characters.
If you don't want the asterisk (*) character, you can try the the bullet (•, "\u2022" in Python). | 1 | 0 | 0 | I'm doing a little user/password emulator with a super simple visual interface (using Tkinter) and I need to hide the characters when the user is typing his password.
I need to hide them by that kind of dots that all the systems use when you are going to login into somewhere.
Thanks in advance. | Hiding characters in Python by dots | 1.2 | 0 | 0 | 1,068 |
9,452,631 | 2012-02-26T11:19:00.000 | 4 | 1 | 0 | 1 | python,information-retrieval,inverted-index | 9,452,656 | 2 | false | 0 | 0 | Worry about optimization after the fact. Write the code, profile it, stress test it, identify the slow parts and offset them in Cython or C or re-write the code to make it more efficient, it might be faster if you load it onto PyPy as that has a JIT Compiler, it can help with long running processes and loops.
Remember
... | 1 | 2 | 0 | I am working on building an inverted index using Python.
I am having some doubts regarding the performance it can provide me.
Would Python be almost equally as fast in indexing as Java or C?
Also, I would like to know if any modules/implementations exists (and what are they, some link please?) for the same and how w... | Inverted Index System using Python | 0.379949 | 0 | 0 | 2,059 |
9,454,974 | 2012-02-26T16:48:00.000 | 0 | 1 | 1 | 0 | python,irc | 9,454,999 | 1 | true | 0 | 0 | It shouldn't matter.
Python 3 is more Unicode compatible, but that's only a good thing.
The most obvious and visible thing changed in Python 3 is print. In Python 3.0 it is a function and requires parentheses. | 1 | 0 | 0 | Which would it make more sense to code an IRC bot in: Python 2 or 3? With 3 I heard you have to do extra stuff because it's unicode(?). | Python 2 vs Python 3 for an IRC bot? | 1.2 | 0 | 0 | 355 |
9,455,651 | 2012-02-26T18:05:00.000 | 4 | 0 | 0 | 0 | python,matrix | 9,455,730 | 2 | true | 0 | 0 | In theory, an element of {0, 1} should consume at most 1 bit per cell. That means 8 cells per byte or 1192092895 megabytes or about one petabyte, which is too much, unless you are google :) Not to mention, even processing (or saving) such matrix would take too much time (about a year I'd say).
You said that in many cas... | 1 | 2 | 1 | So I'm designing a matrix for a computer vision project and believe I have one of my calculations wrong. Unfortunately, I'm not sure where it's wrong.
I was considering creating a matrix that was 100,000,000 x 100,000,000 with each 'cell' containing a single integer (1 or 0). If my calculations are correct, it would ... | RAM requirements for matrix processing | 1.2 | 0 | 0 | 793 |
9,456,442 | 2012-02-26T19:35:00.000 | 0 | 1 | 0 | 0 | python,mechanize,twill | 9,465,091 | 1 | false | 0 | 0 | Set the proxy environment variable before you run the twill script.
sh/ksh/bash
export HTTP_PROXY=blah:8080
csh
setenv HTTP_PROXY blah:8080
It's worth nothing, this should work by setting os.environ['http_proxy'], but it might not if you set it after you import twill. Twill may be checking this once on startup? The on... | 1 | 0 | 0 | I've tried to create a twill test that changes the proxy server settings of 2 different tests. I need to trigger this change in runtime without relaunching the test script.
I've tried to use the "http_proxy" environment variable by setting os.environ["HTTP_PROXY"], but it's only changes the proxy setting for the first ... | twill - changing the proxy server setting in runtime | 0 | 0 | 0 | 478 |
9,456,954 | 2012-02-26T20:41:00.000 | 0 | 0 | 0 | 1 | python,database,linux,datastore,distributed-system | 9,466,181 | 5 | false | 0 | 0 | What you describe reminds me of an Apache Cassandra cluster configured so that each machine hosts a copy of the whole dataset and reads and writes succeed when they reach a single node (I never did that, but I think it's possible). Nodes should be able to remain functional when WAN links are down and receive pending up... | 1 | 1 | 0 | I have a handful of servers all connected over WAN links (moderate bandwidth, higher latency) that all need to be able to share info about connected clients. Each client can connect to any of the servers in the 'mesh'. Im looking for some kind of distributed database each server can host and update. It would be impo... | Distributed state | 0 | 1 | 0 | 981 |
9,457,170 | 2012-02-26T21:08:00.000 | 1 | 0 | 1 | 0 | python,multithreading,tkinter | 9,457,843 | 1 | true | 0 | 1 | I've heard that you can call event_generate from the non-GUI thread. If you do call event_generate, I've read that you should give the value of tail to the when parameter.
I've personally only done this in one project, but it seemed to work fine. | 1 | 1 | 0 | I have a program that receives serial data and uses matplotlib to graph it using Tkinter. I have this working currently, but I've had to use the .after() function to poll a queue for data. In other UI frameworks I've used in the past (different projects in C) there has been a way to ask the UI framework to call a func... | Is there a way to request a function to be called on Tkinter mainloop from a thread which is not the mainloop? | 1.2 | 0 | 0 | 269 |
9,458,870 | 2012-02-27T01:04:00.000 | -2 | 0 | 1 | 1 | python,windows,resize,cmd | 9,459,072 | 3 | false | 0 | 0 | Change the console size by right-clicking on console titlebar -> Properties -> Layout -> Window size | 1 | 10 | 0 | I'm writing a program in Python, the data I want it to show must be able to fit on the screen at the same time without needing to scroll around. The default command line size does not allow for this.
Is there any way to automatically resize a command line window in Python without creating a GUI? The program will only b... | Automatically Resize Command Line Window | -0.132549 | 0 | 0 | 19,100 |
9,459,745 | 2012-02-27T03:38:00.000 | 2 | 1 | 1 | 0 | python,algorithm,word,nlp,linguistics | 9,466,414 | 2 | false | 0 | 0 | I would say it's a good idea to start by taking the examples you gave or other ones you like and doing some sort of analysis for all your ideas on them: e.g. phoneme to to letter ratio, etc; whatever sounds reasonable and that you can calculate. The more samples the better. Hopefully this will give you a good idea of w... | 1 | 13 | 0 | I'm a big fan of discovering sentences that can be rapped very quickly. For example, "gotta read a little bit of Wikipedia" or "don't wanna wind up in the gutter with a bottle of malt." (George Watsky)
I wanted to write a program in Python that would enable me to find words (or combinations of words) that can be arti... | Find words and combinations of words that can be spoken the quickest | 0.197375 | 0 | 0 | 1,243 |
9,459,780 | 2012-02-27T03:44:00.000 | 1 | 0 | 0 | 0 | python,django,views,request | 9,459,943 | 1 | false | 1 | 0 | If applications placed in one project (work in one site) doesn't matter what application.
But if applications runs in different sites you need, for example, shared between sites session storage and, i think, user table. | 1 | 1 | 0 | I have a django application called 'main'. user authentication and everything seems fine. And I created a new app called 'upload' from startapp command.
user can login on 'main' app but I can not get the logged in user from request.user on views of another app ('upload' app). It returns Anonymous user all the time. any... | How to get logged in user in django views across different apps | 0.197375 | 0 | 0 | 229 |
9,461,085 | 2012-02-27T06:49:00.000 | 2 | 0 | 0 | 1 | python,google-app-engine,.htaccess,openid,.htpasswd | 9,461,964 | 2 | false | 1 | 0 | AFAIK, GAE does not support such setup (static password after OpenID login).
The only way I see to make this work would be to serve static content via your handler:
Client makes a request for static content
Your handler is registered to handle this URL
Handler checks is user is authenticated. If not, requests a passw... | 1 | 0 | 0 | So I'm working with AppEngine (Python) and what I want to do is to provide OpenID Login setting a Default provider so the user can Log-In without problems using that provider. The thing is, I want to prompt the user a Password right after they login in order to show static content (HTML Pages); If the user doesn't ente... | Password Protect Static Page AppEngine HowTo? | 0.197375 | 0 | 0 | 1,804 |
9,462,212 | 2012-02-27T08:48:00.000 | 47 | 0 | 0 | 0 | python,django,centos,pythonpath | 47,015,891 | 8 | false | 1 | 0 | I had the same error, and this fix my issue
python -m pip install django
:) Done! | 2 | 30 | 0 | I am using centos linux.
I had python 2.6 with django and now i upgraded to python 2.7.
Python 2.6 is located in /usr/lib/python2.6.
Python 2.7 is located in /usr/local/lib/python2.7.
They both have site-packages directory and they both contain django 1.2.
If i run python i get the 2.7 version.
My problem is that if t... | Import Error: No module named django | 1 | 0 | 0 | 170,766 |
9,462,212 | 2012-02-27T08:48:00.000 | 1 | 0 | 0 | 0 | python,django,centos,pythonpath | 66,738,274 | 8 | false | 1 | 0 | python3 -m django --version1
for me it was that^ | 2 | 30 | 0 | I am using centos linux.
I had python 2.6 with django and now i upgraded to python 2.7.
Python 2.6 is located in /usr/lib/python2.6.
Python 2.7 is located in /usr/local/lib/python2.7.
They both have site-packages directory and they both contain django 1.2.
If i run python i get the 2.7 version.
My problem is that if t... | Import Error: No module named django | 0.024995 | 0 | 0 | 170,766 |
9,463,471 | 2012-02-27T10:29:00.000 | 0 | 0 | 0 | 0 | python,parsing,street-address | 19,011,951 | 7 | false | 0 | 0 | Carefully check your dataset to ensure that this problem hasn't already been handled for you.
I spent a fair amount of time first creating a taxonomy of probably street name ending, using regexp conditionals to try to pluck out the street number from the full address strings and everything and it turned out that the at... | 1 | 23 | 0 | I have a list of US addresses I need to break into city,state, zip code,state etc.
example address : "16100 Sand Canyon Avenue, Suite 380
Irvine, CA 92618"
Does anyone know of a library or a free API to do this? Google/Yahoo geocoder is forbidden to use by the TOS for commercial projects..
It would be awesome to find ... | Is there a library for parsing US addresses? | 0 | 0 | 0 | 26,970 |
9,463,565 | 2012-02-27T10:36:00.000 | 1 | 0 | 0 | 0 | python,wxpython | 9,466,460 | 1 | true | 0 | 1 | I have a feeling that's a limitation of the native widget. It's an all or nothing affair. You could make the label a part of the image on the tool item though. Or you might be able to do it with FlatMenu which has a Toolbar widget equivalent that's written in pure Python, so you can hack it. See the wxPython demo for a... | 1 | 0 | 0 | Does anyone know if it's possible to add a label to a single tool in a wx.ToolBar? I've found a global setting but no option to set it for a single tool. | Can I add a label to a single tool in a wxPython toolbar? | 1.2 | 0 | 0 | 172 |
9,465,807 | 2012-02-27T13:28:00.000 | 0 | 1 | 0 | 0 | ssh,python-3.x,connection | 17,140,320 | 3 | false | 0 | 0 | No. Paramiko does not work with Python 3.x yet | 1 | 0 | 0 | Is there any easy way to initiate ssh connection with Python 3 without using popen? I would like to achieve password and password less authentication. | How to initiate ssh connection with Python 3 | 0 | 0 | 1 | 1,977 |
9,468,435 | 2012-02-27T16:24:00.000 | 37 | 0 | 0 | 0 | python,terminal,interpreter,readline | 9,468,954 | 3 | true | 0 | 0 | I open info readline and found:
-- Function: int rl_expand_prompt (char *prompt)
Expand any special character sequences in PROMPT and set up the
local Readline prompt redisplay variables. This function is
called by `readline()'. It may also be called to expand the
primary prompt if the `rl_on_ne... | 1 | 24 | 0 | I use standard tips for customizing interactive Python session:
$ cat ~/.bashrc
export PYTHONSTARTUP=~/.pystartup
$ cat ~/.pystartup
import os
import sys
import atexit
import readline
import rlcompleter
historyPath = os.path.expanduser("~/.pyhistory")
def save_history(historyPath=historyPath):
import readline
... | How to fix column calculation in Python readline if using color prompt | 1.2 | 0 | 0 | 2,890 |
9,469,389 | 2012-02-27T17:30:00.000 | 3 | 0 | 0 | 0 | python,http,sockets,networking,ftp | 9,469,432 | 2 | true | 0 | 0 | Python has http client libraries -- you can easily use those to post data to a web server. Read up on the documentation for the python core libraries. | 1 | 0 | 0 | We are building an in house software package that will exclusively be used on Verizon aircards. We want a simple way to send data from the laptop to our servers. Originally we were going to use python and FTP but found out that Verizon's ToS sometimes block ftp access. Our next idea was to use port 80 to send files. Ho... | Sending data to remote servers with python | 1.2 | 0 | 1 | 1,471 |
9,469,645 | 2012-02-27T17:47:00.000 | 5 | 0 | 0 | 0 | python,simplehttpserver | 9,469,677 | 1 | true | 0 | 0 | No. If the client gets a Connection refused, this means that the connection request did not reach the server application. Therefore, the server application cannot possibly register these errors.
Check firewalls, routing, connectivity, and correctness of server address and port. | 1 | 3 | 0 | A Python web server started with
python -m SimpleHTTPServer
will print on the console requests it has accepted. Can I get it to print requests that returned a connection refused to the client?
I am trying to debug why it refuses some requests from an Android client. | Python SimpleHTTPServer able to register connection attempts? | 1.2 | 0 | 1 | 1,571 |
9,469,932 | 2012-02-27T18:08:00.000 | 43 | 0 | 1 | 0 | python,windows,performance,pyinstaller | 9,474,575 | 7 | false | 0 | 1 | Tell PyInstaller to create a console-mode executable. This gives you a working console you can use for debugging.
At the top of your main script, even before the first import is run, add a print "Python Code starting". Then run your packaged executable from the command line. This way you can get a clear picture whether... | 7 | 71 | 0 | I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python... | App created with PyInstaller has a slow startup | 1 | 0 | 0 | 58,999 |
9,469,932 | 2012-02-27T18:08:00.000 | 13 | 0 | 1 | 0 | python,windows,performance,pyinstaller | 15,892,172 | 7 | false | 0 | 1 | I agree with above answers. My Qt python program needed about 5 seconds to start up on a decent PC when using onefile mode. After I change to --onedir, it only took around one second to start; almost immediately after user double clicks the exe file. But the drawback is that there are many files in that directory whic... | 7 | 71 | 0 | I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python... | App created with PyInstaller has a slow startup | 1 | 0 | 0 | 58,999 |
9,469,932 | 2012-02-27T18:08:00.000 | 66 | 0 | 1 | 0 | python,windows,performance,pyinstaller | 9,470,393 | 7 | false | 0 | 1 | I suspect that you're using pyinstaller's "one file" mode -- this mode means that it has to unpack all of the libraries to a temporary directory before the app can start. In the case of Qt, these libraries are quite large and take a few seconds to decompress. Try using the "one directory" mode and see if that helps? | 7 | 71 | 0 | I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python... | App created with PyInstaller has a slow startup | 1 | 0 | 0 | 58,999 |
9,469,932 | 2012-02-27T18:08:00.000 | 1 | 0 | 1 | 0 | python,windows,performance,pyinstaller | 9,470,332 | 7 | true | 0 | 1 | I have 'compiled' a few wxPython apps using py2exe and cx_Freeze, None of them take more than 4 seconds to start.
Are you sure sure it's not your code ?
maybe some network or some I/O resource call holding your app ?
Have you tried other machine than yours? Even the fastest hardware can be slow sometimes with the wro... | 7 | 71 | 0 | I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python... | App created with PyInstaller has a slow startup | 1.2 | 0 | 0 | 58,999 |
9,469,932 | 2012-02-27T18:08:00.000 | 3 | 0 | 1 | 0 | python,windows,performance,pyinstaller | 49,350,571 | 7 | false | 0 | 1 | For my application, the long startup time almost entirely was caused by the antivirus system. Switching it off reduced the startup in my case from 3 minutes to less than 10secs!
To bring these measurements into perspective: My application was bundled with extra data files (about 150 files with a payload of 250MB), besi... | 7 | 71 | 0 | I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python... | App created with PyInstaller has a slow startup | 0.085505 | 0 | 0 | 58,999 |
9,469,932 | 2012-02-27T18:08:00.000 | 3 | 0 | 1 | 0 | python,windows,performance,pyinstaller | 57,366,288 | 7 | false | 0 | 1 | In case anyone is still have this issue, I resolved mine by running the exe locally and not on any sharedrives. This took the startup time from over a minute to under 10 seconds. | 7 | 71 | 0 | I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python... | App created with PyInstaller has a slow startup | 0.085505 | 0 | 0 | 58,999 |
9,469,932 | 2012-02-27T18:08:00.000 | 1 | 0 | 1 | 0 | python,windows,performance,pyinstaller | 68,760,139 | 7 | false | 0 | 1 | I solved this by adding an exception to the anti-virus monitoring software (F-Secure). It removed the wait of several minutes before running. | 7 | 71 | 0 | I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python... | App created with PyInstaller has a slow startup | 0.028564 | 0 | 0 | 58,999 |
9,470,170 | 2012-02-27T18:25:00.000 | 1 | 0 | 0 | 0 | python,pyside,qwebpage | 9,470,209 | 1 | true | 1 | 1 | The way to get a byte array out of a unicode is to encode it. | 1 | 0 | 0 | I'm using QWebKit to render a a pdf-page. Untill now, I used setHtml(), to feed the html code to the QMainFrame and then render() to print the content or export it to pdf. So far so good, but I want to use setContent() to include inline-svg-images to the frame, which get not displayed, using setHtml().
But setContent()... | Using QWebFrame.setContent() with unicode (Python+PySide) | 1.2 | 0 | 0 | 284 |
9,472,750 | 2012-02-27T21:42:00.000 | 1 | 0 | 0 | 0 | python,pyglet | 9,473,902 | 5 | false | 0 | 1 | To paraphrase Monty Python
No no he's not stagnant, he's, he's restin'!
Open source maintainers move on or get busy with other things. If you feel Pyglet is a good choice for your application create a clone of the repo, put your changes up on insert code hosting flavor of the month, and get some work done. There ar... | 2 | 6 | 0 | To make it quick and dirty - I'm a newb programmer who's looking hard at Pyglet, it looks like a really clean and friendly module to use, unlike something like PyGame which is, even by looking with my own inexperienced eyes, a beast.
However. PyGame is constantly being used, updated, reused by lots of people and seems... | Python - Is it worthwhile to invest time in apparently stagnant modules? | 0.039979 | 0 | 0 | 2,144 |
9,472,750 | 2012-02-27T21:42:00.000 | 10 | 0 | 0 | 0 | python,pyglet | 9,472,827 | 5 | true | 0 | 1 | as the owner of a "dormant" package, my own take is:
a more popular package is going to have better support from the community. for many people i think this overrides any other consideration. it's often better to have support for a mediocre package than battle with an awesome package no-one else is using.
and it may... | 2 | 6 | 0 | To make it quick and dirty - I'm a newb programmer who's looking hard at Pyglet, it looks like a really clean and friendly module to use, unlike something like PyGame which is, even by looking with my own inexperienced eyes, a beast.
However. PyGame is constantly being used, updated, reused by lots of people and seems... | Python - Is it worthwhile to invest time in apparently stagnant modules? | 1.2 | 0 | 0 | 2,144 |
9,474,755 | 2012-02-28T00:47:00.000 | 1 | 0 | 1 | 0 | python,string,indexing,readline | 9,474,878 | 4 | false | 0 | 0 | In a Python slice, you specify the first item you want, followed by the first item you don't want. | 2 | 2 | 0 | i open a file
line = file.readline()
and use line[0:2] to select the first 3 chars in the line.
But weired, the line[0:2] only contains 2 chars.
Therefore, i must use line[0:3] to select the first 3 chars, and it works
But why?
I checked the file, there are no spaces at the beginning of each line
Anybody know this | string from readline start from 1 in python? | 0.049958 | 0 | 0 | 1,385 |
9,474,755 | 2012-02-28T00:47:00.000 | 2 | 0 | 1 | 0 | python,string,indexing,readline | 9,474,770 | 4 | false | 0 | 0 | Because your slice goes from before character 0 to before character 2. That is, from before character 0 to after character 1. That is, the first two characters starting with character 0. | 2 | 2 | 0 | i open a file
line = file.readline()
and use line[0:2] to select the first 3 chars in the line.
But weired, the line[0:2] only contains 2 chars.
Therefore, i must use line[0:3] to select the first 3 chars, and it works
But why?
I checked the file, there are no spaces at the beginning of each line
Anybody know this | string from readline start from 1 in python? | 0.099668 | 0 | 0 | 1,385 |
9,475,014 | 2012-02-28T01:18:00.000 | 0 | 0 | 1 | 0 | pydev,ipython | 9,502,749 | 2 | false | 1 | 0 | Actually, Eclipse itself can have multiple consoles open at the same time... if you want, you can create multiple console views and pin a different console to each view (if you don't pin the console, one console will be shown on top of the other and you'll have to do the switching from one to the other manually).
As it... | 1 | 4 | 0 | I have ipython working in pydev when using the normal interactive console, however when entering debug mode the console reverts to the standard pydev console. If I close this console and re-open it, ipython returns and I can use it as normal. Am I missing something, or is this a bug?
-Eric | Ipython in pydev interactive debugging console(eclipse) | 0 | 0 | 0 | 1,810 |
9,475,063 | 2012-02-28T01:24:00.000 | 0 | 0 | 0 | 1 | python,windows,google-app-engine,deployment,credentials | 9,477,977 | 1 | true | 1 | 0 | The launcher will always prompt you for credentials, it uses the no_cookies flag to make sure the given credentials are passed and not the one stored in the system.
What you can do is create a batch file that will deploy the application, you can provide credentials using the --email and --passin flags. | 1 | 1 | 0 | When I deploy an application using the Google App Engine Launcher (version 1.6.2) on Windows, the following command options show in the output window:
Running command: "[u'C:\Python27\pythonw.exe',
'-u', u'C:\Program Files (x86)\Google\google_appengine\appcfg.py',
'--no_cookies', u'--email=xxxx.xxxx@xxxx.xxx', '--... | Can I turn off the "no_cookies" option in Google App Engine Launcher (version 1.6.2) on Windows? | 1.2 | 0 | 0 | 650 |
9,475,290 | 2012-02-28T01:55:00.000 | 1 | 0 | 0 | 0 | python,operating-system,multiprocessing | 9,475,336 | 2 | false | 1 | 0 | Not on purpose. They let the OS worry about sharing pages between the instances of the library. | 2 | 0 | 0 | One of the more clever things Android does to conserve memory and increase startup time is share pages between multiple Dalvik interpreters by forking processes from a the zygote process. When an application loads, the static, readonly library code pages are shared between the parent and the child.
Does python or mult... | Do multiple Python interpreters on a server share pages in memory? | 0.099668 | 0 | 0 | 94 |
9,475,290 | 2012-02-28T01:55:00.000 | 2 | 0 | 0 | 0 | python,operating-system,multiprocessing | 9,475,484 | 2 | true | 1 | 0 | This is an operating system feature (not a language feature) that at least Linux and probably most OSes offer. It's nothing unique to Android.
So yes, Python and multiprocessing do essentially the same thing if you are running on Linux, simply because they use fork() to spawn additional processes. | 2 | 0 | 0 | One of the more clever things Android does to conserve memory and increase startup time is share pages between multiple Dalvik interpreters by forking processes from a the zygote process. When an application loads, the static, readonly library code pages are shared between the parent and the child.
Does python or mult... | Do multiple Python interpreters on a server share pages in memory? | 1.2 | 0 | 0 | 94 |
9,475,982 | 2012-02-28T03:26:00.000 | 8 | 0 | 1 | 0 | python,list,copy | 9,475,990 | 1 | true | 0 | 0 | L[:] produces a copy of the list. Its a whole new list contain the same items as L. As a result, its stored in a different place in memory and has a different id. | 1 | 2 | 0 | I'm curious about the difference and relationship between id(L) and id(L[:]), where L is a list.
The official documentation says this about id():
CPython implementation detail: This is the address of the object in memory.
But I don't understand why id(L) and id(L[:]) have different values. | python list id(L) and id(L[:]) | 1.2 | 0 | 0 | 362 |
9,477,214 | 2012-02-28T06:07:00.000 | 0 | 0 | 0 | 1 | python-2.7,python-idle | 48,256,587 | 3 | false | 0 | 0 | The first thing you need to do is locate your python on your computer by right clicking on it and clicking properties. After that go into your file folder and follow the path that the property finder told you, then find something that looks like this:
C:\Users\DELL\AppData\Local\Programs\Python\Python36\Lib\idlelibCidl... | 1 | 0 | 0 | For some reason the python 2.7.2 IDLE shell is not opening. I get an error that says:
"IDLE can't bind to a TCP/IP port, which is necessary to communicate with its Python execution server. This might be because no networking is installed on this computer. Run IDLE with the -n command line switch to start without a subp... | Python 2.7.2 IDLE shell not working | 0 | 0 | 0 | 7,359 |
9,478,347 | 2012-02-28T08:05:00.000 | 2 | 0 | 0 | 0 | python,image-processing,interpolation,mask,astronomy | 9,478,656 | 3 | false | 0 | 0 | What you want is not interpolation at all. Interpolation depends on the assumption that data between known points is roughly contiguous. In any non-trivial image, this will not be the case.
You actually want something like the content-aware fill that is in Photoshop CS5. There is a free alternative available in The GIM... | 1 | 7 | 1 | I have photo images of galaxies. There are some unwanted data on these images (like stars or aeroplane streaks) that are masked out. I don't just want to fill the masked areas with some mean value, but to interpolate them according to surrounding data. How do i do that in python?
We've tried various functions in SciPy... | How do i fill "holes" in an image? | 0.132549 | 0 | 0 | 5,262 |
9,479,492 | 2012-02-28T09:35:00.000 | 0 | 1 | 1 | 1 | python,memory | 9,951,397 | 2 | false | 0 | 0 | What does the application do? What libraries does it use? What else is different between those machines? It's hard to give a general answer.
The VIRT value indicates how much memory the process has requested from the operating system in one way or another. But Linux is lazy in this respect: that memory won't actually b... | 1 | 2 | 0 | I have an python application in production (on CentOS 6.2 / Python 2.6.6) that takes up to:
800M VIRT / 15M RES / 2M SHR
The same app run on (Fedora 16 / Python 2.7.2) "only" takes up to:
56M VIRT / 15M RES / 2M SHR
Is it an issue ?
What's the explanation of this difference ?
I'm wondering if it could go wrong anyt... | Python VIRT Memory Usage | 0 | 0 | 0 | 1,159 |
9,484,724 | 2012-02-28T15:27:00.000 | 1 | 0 | 0 | 1 | python,user-interface,ubuntu,tkinter,restriction | 9,489,644 | 3 | false | 0 | 1 | Don't start a window manager. Only start your program, e.g. from xinitrc. Make the program full-screen | 1 | 1 | 0 | I wrote a python GUI in Tkinter for a time-clock system. The micro machine is wall mounted and the employees only have access to the touchscreen menu I programmed and a barcode swipe. I know how to get the script to start on startup, but how do I prevent them from exiting out or opening other menus? Basically the sole ... | How do I limit a Ubuntu machine to a Python GUI? | 0.066568 | 0 | 0 | 224 |
9,484,814 | 2012-02-28T15:32:00.000 | 0 | 0 | 1 | 0 | python,json,sqlite | 9,484,859 | 2 | false | 0 | 0 | If your data fits in memory and you only require to access elements by key, a dictionary is probably just enough for your needs. | 2 | 2 | 0 | I am playing around with python and thought I would make a simple language learning program... ie: lanuageA | languageB | type of word | synonym | antonym |
basically flash cards...
I have made a crude version using python and json, and have just started playing with sqlite3... Is a database a better way to organize th... | json or sqlite3 for a dictionary | 0 | 1 | 0 | 371 |
9,484,814 | 2012-02-28T15:32:00.000 | 1 | 0 | 1 | 0 | python,json,sqlite | 9,485,889 | 2 | true | 0 | 0 | Who is going to modify your data?
If you plan to only modify the word set yourself (as a developer, not a user of an application), you can use JSON to keep the data on the disk
If you want to allow users of your application to add/edit/remove flashcards, you should use a database (sqlite3 is OK), because otherwise you... | 2 | 2 | 0 | I am playing around with python and thought I would make a simple language learning program... ie: lanuageA | languageB | type of word | synonym | antonym |
basically flash cards...
I have made a crude version using python and json, and have just started playing with sqlite3... Is a database a better way to organize th... | json or sqlite3 for a dictionary | 1.2 | 1 | 0 | 371 |
9,485,761 | 2012-02-28T16:27:00.000 | 2 | 0 | 0 | 0 | python,django,html,google-app-engine | 9,485,888 | 3 | false | 1 | 0 | A viable approach for a rich client widget like this is to use a stack like:
[ your javascript user interface ]
[ a js lib for your graphics ]
backbone.js for managing your objects client side
django-tastypie for wrapping your django objects in a RESTful API
django for defining your backend | 2 | 13 | 0 | I have used both of these (Python and HTML5) seperately, however I'm keen to use the full power of Python over the web using HTML5 to draw things and handle the client side of things. I guess I'm looking for avenues to go down in terms of implementation. Here are some things I'd like to do if possible:
Have very inter... | Mixing HTML5 Canvas and Python | 0.132549 | 0 | 1 | 29,496 |
9,485,761 | 2012-02-28T16:27:00.000 | 4 | 0 | 0 | 0 | python,django,html,google-app-engine | 9,486,058 | 3 | false | 1 | 0 | I do exactly what you have mentioned using Django on the server side and HTML5 canvas/javascript on the client side. I'm pretty happy with the results but would like to point out that what you do with a Canvas on the client side doesn't have anything to do with what you use on the server side for Python. | 2 | 13 | 0 | I have used both of these (Python and HTML5) seperately, however I'm keen to use the full power of Python over the web using HTML5 to draw things and handle the client side of things. I guess I'm looking for avenues to go down in terms of implementation. Here are some things I'd like to do if possible:
Have very inter... | Mixing HTML5 Canvas and Python | 0.26052 | 0 | 1 | 29,496 |
9,485,905 | 2012-02-28T16:36:00.000 | 1 | 1 | 1 | 0 | python,pyc | 9,485,942 | 5 | false | 0 | 0 | I'm not sure about .pyc files (very minor gain is at least not creating .pyc files again), but there's a '-O' flag for the Python interpreter which produces optimised bytecode (.pyo files). | 2 | 8 | 0 | We can write a piece of python code and put it in already compiled ".pyc" file and use it. I am wondering that is there any kind of gain in terms of performance or it is just a kind of modular way of grouping the code.
Thanks a lot | is there any kind of performance gain while using .pyc files in python? | 0.039979 | 0 | 0 | 9,152 |
9,485,905 | 2012-02-28T16:36:00.000 | 1 | 1 | 1 | 0 | python,pyc | 9,485,947 | 5 | false | 0 | 0 | Yes, simply because the first time you execute a .py file, it is compiled to a .pyc file.
So basically you have to add the compilation time. Afterwards, the .pyc file should be always used. | 2 | 8 | 0 | We can write a piece of python code and put it in already compiled ".pyc" file and use it. I am wondering that is there any kind of gain in terms of performance or it is just a kind of modular way of grouping the code.
Thanks a lot | is there any kind of performance gain while using .pyc files in python? | 0.039979 | 0 | 0 | 9,152 |
9,486,574 | 2012-02-28T17:16:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine,memcached,google-cloud-datastore | 9,498,169 | 3 | false | 1 | 0 | I'd suggest you split your entities in a root entity and a couple linked ones holding each some of the 150 attributes - this way, when you update one attribute, you only need to save one (or two, if the update reflects on the root entity) smaller entities to the datastore instead of a huge one.
Use memcache to prevent ... | 3 | 1 | 0 | My web application will have ~150 fields and when value is changed in any field (at least one), I should save changed value.
How should I store such values with GAE? Should I save them directly in datastore? Should I use memcache temporarily and then save all values at once in datastore? Or, some other approach should... | What should be used to store data in GAE? | 0 | 0 | 0 | 109 |
9,486,574 | 2012-02-28T17:16:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine,memcached,google-cloud-datastore | 9,487,492 | 3 | false | 1 | 0 | First of all you should find out how you are going to use your data. Which queries are you planning to make? What is the size of your entities?
Datastore is very different from relational databases. That is It doesn't really matter how many properties are changed, because there is no way to update a property on its own... | 3 | 1 | 0 | My web application will have ~150 fields and when value is changed in any field (at least one), I should save changed value.
How should I store such values with GAE? Should I save them directly in datastore? Should I use memcache temporarily and then save all values at once in datastore? Or, some other approach should... | What should be used to store data in GAE? | 0 | 0 | 0 | 109 |
9,486,574 | 2012-02-28T17:16:00.000 | 3 | 0 | 0 | 1 | python,google-app-engine,memcached,google-cloud-datastore | 9,486,718 | 3 | false | 1 | 0 | The datastore is your database. Memcache is to store data that's fetched from the datastore and kept temporarily in memory to avoid too many calls back to the database. You should first design your app around the datastore and then use memcache to improve performance.
Depending on your programming language of choice (j... | 3 | 1 | 0 | My web application will have ~150 fields and when value is changed in any field (at least one), I should save changed value.
How should I store such values with GAE? Should I save them directly in datastore? Should I use memcache temporarily and then save all values at once in datastore? Or, some other approach should... | What should be used to store data in GAE? | 0.197375 | 0 | 0 | 109 |
9,486,827 | 2012-02-28T17:30:00.000 | 2 | 1 | 1 | 0 | python,objective-c,regex | 9,487,143 | 2 | true | 0 | 0 | If you’re looking for raw speed, neither of those two would be a very good choice. For execution speed, you’d choose Perl. For how quickly you could code it up, either Python or Perl alike would easily beat the time to write it in Objective C, just as both would easily beat a Java solution. High-level languages that... | 1 | 1 | 0 | This question might seem vague, sorry. Does anybody have experience writing RegEx with Objective-C and Python? I am wondering about the performance of one vs the other? Which is faster in terms of 1. runtime speed, and 2. memory consumption? I have a Mac OS application that is always running in the background, and I'd ... | RegEx performance in Objective-C vs Python | 1.2 | 0 | 0 | 601 |
9,488,543 | 2012-02-28T19:40:00.000 | 2 | 0 | 1 | 0 | python,git,merge,conflict,resolve | 9,489,348 | 1 | false | 1 | 0 | Study how other systems (like e.g. ikiwiki) handle these things.
Commit requests will come in sequentially. Try to commit them. If there are conflicts or if a commit request is based on a previous HEAD, report that back to the person sending the commit request complete with the differences of the edits with the current... | 1 | 1 | 0 | I'm working on a django-based wiki. It has section edit capabilities (the sections being delimited by the markdown headers) and it is using git (a single repo) to store the revisions, via the Git Python library.
I'm trying to figure out how I can handle several concurrent edits of the same page (using git-python).
Than... | How to handle merges/conflicts in my git based wiki? | 0.379949 | 0 | 0 | 311 |
9,489,560 | 2012-02-28T20:52:00.000 | 3 | 1 | 0 | 0 | python,zeromq,pyzmq | 9,491,177 | 2 | true | 0 | 0 | You state that converting numbers to str is inefficient. And yet, unless you have a truly exotic network, that is exactly what must occur no matter what solution is chosen, because all networks in wide use today are byte-based.
Of course, some ways of converting numbers to byte-strings are faster than others. Perform... | 1 | 1 | 0 | I want to send lots of numbers via zeromq but converting them to str is inefficient. What is the best way to send numbers via zmq? | send a number by zeromq pyzmq | 1.2 | 0 | 0 | 2,967 |
9,490,058 | 2012-02-28T21:31:00.000 | 7 | 0 | 1 | 0 | python,string,substring | 9,490,115 | 3 | false | 0 | 0 | Slicing is not bounds-checked by the built-in types. And although both of your examples appear to have the same result, they work differently; try them with a list instead. | 1 | 105 | 0 | Why doesn't 'example'[999:9999] result in error? Since 'example'[9] does, what is the motivation behind it?
From this behavior I can assume that 'example'[3] is, essentially/internally, not the same as 'example'[3:4], even though both result in the same 'm' string. | Why does substring slicing with index out of range work? | 1 | 0 | 0 | 30,364 |
9,491,227 | 2012-02-28T23:07:00.000 | 1 | 0 | 1 | 1 | python,http,google-app-engine,asynchronous,web2py | 9,491,366 | 3 | false | 1 | 0 | If you're brave, you might try the Experimental new DB api, NDB. It has async APIs for working with the datastore + URL fetch. If those are the things you hoped to do async-ly, then you're in luck. | 1 | 3 | 0 | I've got a Python app making 3 different api calls one after another in the same block of code. I'd like to execute these calls asynchronously, and then perform an action when they're all complete.
A couple notes:
Other answers regarding async actions point to frameworks like Twisted and Celery, but I'm building a Web... | GAE-ready asynchronous operations in Python? | 0.066568 | 0 | 0 | 182 |
9,493,514 | 2012-02-29T04:15:00.000 | 3 | 0 | 1 | 0 | python,decorator | 9,493,542 | 4 | false | 0 | 0 | I'm uneasy posting an answer like this, because something always seems to bubble up out of the depths of the python standard libraries to prove me wrong. But I'm pretty sure the answer is no.
The problem is that decorators are just functions themselves -- the whole @foo thing is just syntactic sugar for func = foo(fun... | 3 | 4 | 0 | Is there any way I can obtain a list of the decorators applied to a function without resorting to hackish things like decorating the decorators? | Can I get a list of the decorators applied to a function? | 0.148885 | 0 | 0 | 483 |
9,493,514 | 2012-02-29T04:15:00.000 | 1 | 0 | 1 | 0 | python,decorator | 9,493,537 | 4 | false | 0 | 0 | I believe that this is not possible because the decorators have the option to replace the function, wrap the function, return anything they want. It's not so much that they are "applied" to the function. | 3 | 4 | 0 | Is there any way I can obtain a list of the decorators applied to a function without resorting to hackish things like decorating the decorators? | Can I get a list of the decorators applied to a function? | 0.049958 | 0 | 0 | 483 |
9,493,514 | 2012-02-29T04:15:00.000 | 3 | 0 | 1 | 0 | python,decorator | 9,493,594 | 4 | true | 0 | 0 | Not really. First, because not all decorators return a wrapper function; it is possible for a decorator to simply modify the existing function (setting an attribute on it, perhaps) -- Python doesn't record what function touched every attribute, obviously. Second, while you can probably ask the garbage collector for clo... | 3 | 4 | 0 | Is there any way I can obtain a list of the decorators applied to a function without resorting to hackish things like decorating the decorators? | Can I get a list of the decorators applied to a function? | 1.2 | 0 | 0 | 483 |
9,494,480 | 2012-02-29T06:23:00.000 | 2 | 0 | 1 | 0 | python,vb.net,visual-studio-2010,installation | 9,494,583 | 1 | false | 0 | 0 | Right click on the solution and select View > Custom Actions.
Right Click on the Install folder and select Add Custom Action.
Add File on the file you need to run
Pretty sure that's all there is to it. The .NET Deployment creates a MSI file that allows more complex modifications by MSI tools outside of VS. | 1 | 1 | 0 | I am using a visual studios installer to install a couple of applications. I have a Python script that i have exported to an .exe that sets up and creates a database if the application is going to be a server.
Question: How can i make the script run on program install , and stop if there is an error in the script? | Run script on install (vb.net and Python) | 0.379949 | 0 | 0 | 469 |
9,494,539 | 2012-02-29T06:28:00.000 | 1 | 0 | 1 | 0 | python,programming-languages,language-design | 9,496,423 | 2 | false | 0 | 0 | It is possible indeed to customise your language as you like. Some languages provide powerful metaprogramming features (unfortunately, Python is not one of them). Take a look at Lisp macros, or Nemerle, or Converge (the latter is the closest to Python). Some languages, like Katahdin, would even allow you to modify the ... | 1 | 2 | 0 | I've always wondered this since I started to code: is there any way to customize deep portions of a language to your taste.
For example, I code mainly in Python would like to use the | or : characters to denote the boundary of a Set. I use sets frequently and hate typing set(some_list) or explicitly set([a,b,b,c,d])... | coding language customization | 0.099668 | 0 | 0 | 123 |
9,498,665 | 2012-02-29T11:54:00.000 | 1 | 0 | 1 | 0 | python | 9,498,732 | 4 | false | 0 | 0 | How long is your string and I understand that it is not constantly changing as your list of string is?
A good idea is to iterate over the words in the string and have dictionary for the words and increment the count for each word. With this in place. You can then looking for the word in the list in the dictionary and ... | 1 | 6 | 0 | I have a list of words, lets say: ["foo", "bar", "baz"] and a large string in which these words may occur.
I now use for every word in the list the "string".count("word") method. This works OK, but seems rather inefficient. For every extra word added to the list the entire string must be iterated over an extra time.
... | Count occurrences of a couple of specific words | 0.049958 | 0 | 0 | 10,312 |
9,499,173 | 2012-02-29T12:27:00.000 | 2 | 0 | 0 | 0 | python,http,redirect,pylons | 9,499,524 | 1 | true | 1 | 0 | The correct way is sending HTTP status code 302 instead of 200 and adding Location: <url> to response headers. How to do this depends on the WEB framework you are running your Python app on. | 1 | 2 | 0 | I am trying to make a redirection from a python app to another site. I am currently doing it in the controller which works just fine but breaks the back browser button.
I know that a redirection with meta refresh or js, will allow me to add a delay so the user will have time to go back but I read everywhere that these ... | How to properly redirect to another site without breaking the browser back button? | 1.2 | 0 | 1 | 219 |
9,499,396 | 2012-02-29T12:44:00.000 | 3 | 1 | 1 | 0 | python,open-source,github | 9,499,693 | 1 | false | 0 | 0 | You'd normally do setup.py develop or pip install -e .
So you don't want the installer to copy it anywhere else.
Using this mode, a special link file is created in your site-packages directory. This link points back to the current folder or 'root package'. Any changes you make to the software here will be reflected imm... | 1 | 0 | 0 | I would like to contribute to open source Python project hosted on github.
But the code base comes as module that needs to be installed using pip or smth like this.
Which means I do "git clone", "setup.py install" the code will be placed after installation into another (non repo) folder.
The question is which folder I ... | Contributing to Python: edit git/cloned code or installed code? | 0.53705 | 0 | 0 | 119 |
9,499,490 | 2012-02-29T12:50:00.000 | 0 | 0 | 0 | 0 | python,filemaker | 21,190,136 | 3 | false | 0 | 0 | You may want to checkout PyFileMaker (python object wrapper for FM.) It enables you to access/edit FileMaker server database. | 2 | 2 | 0 | I was hoping to calculate fields using some rather complicated functions, which I don't think I can realistically write in filemaker.
I would prefer to write a script to extract data into python, perform some procedures and then import it back into filemaker (so a user can see the results "live" in layouts, without hav... | Python in Filemaker Pro | 0 | 0 | 0 | 5,103 |
9,499,490 | 2012-02-29T12:50:00.000 | 3 | 0 | 0 | 0 | python,filemaker | 9,504,035 | 3 | true | 0 | 0 | That python module is meant to work with FileMaker server: send GET/POST requests, get back response in XML, and parse it. Technically you can use it to do a lot (add and delete records, run scripts, etc.) but in your case it won't fit.
There are some plug-ins that can execute shell commands, so this way you can call P... | 2 | 2 | 0 | I was hoping to calculate fields using some rather complicated functions, which I don't think I can realistically write in filemaker.
I would prefer to write a script to extract data into python, perform some procedures and then import it back into filemaker (so a user can see the results "live" in layouts, without hav... | Python in Filemaker Pro | 1.2 | 0 | 0 | 5,103 |
9,500,524 | 2012-02-29T14:02:00.000 | 1 | 0 | 0 | 0 | python,eclipse,scipy | 9,500,809 | 1 | true | 0 | 0 | Try to recreate your project in PyDev and add these new libraries. | 1 | 1 | 1 | I just installed Scipy and Numpy on my machine and added them to the System Library option in eclipse.
Now the program runs fine, but eclipse editor keeps giving this red mark on the side says "Unresolved import".
I guess I didn't configure correctly.
Any one know how to fix this ?
Thanks. | Eclipse editor doesn't recognize Scipy content | 1.2 | 0 | 0 | 611 |
9,500,818 | 2012-02-29T14:23:00.000 | 2 | 0 | 0 | 0 | python,geocoding,geospatial | 9,501,038 | 3 | false | 0 | 0 | scipy.spatial has a kd-tree implementation that might be the most popular in Python. | 1 | 3 | 0 | I am looking for a minimalistic solution for doing basic geospatial search in Python.
We have a dataset of roughly 10 k locations and we need to solve the find the all locations within a radius of N kilometers from a given location. I am not looking for explicit database with geospatial support. I hope to get around an... | Minimalistic geospatial searching solution for Python | 0.132549 | 0 | 0 | 373 |
9,502,453 | 2012-02-29T16:02:00.000 | 2 | 0 | 1 | 0 | python,zodb,repoze.bfg | 9,503,664 | 2 | false | 0 | 0 | A PersistentDict (now called a PersistentMapping) is a class that inherits from UserDict.IterableUserDict and persistent.Persistent.
UserDict.IterableUserDict is a built-in python class that simulates an iterable dictionary and persistent.Persistent is a Zope class that enables an instance of itself to be saved in the ... | 1 | 4 | 0 | When should I use a PersistentDict, and when should I use a Folder? What is the difference between them in terms of updates, internal structure, performance, etc? | When PersistentDict, when Folder? | 0.197375 | 0 | 0 | 953 |
9,502,596 | 2012-02-29T16:10:00.000 | 0 | 0 | 0 | 0 | python,django,jasperserver | 10,683,426 | 2 | false | 1 | 0 | You could, for example, in an iframe, do a post to j_spring_security_check to authenticate the user, that way when you redirect him to the login page, the user would be authenticated | 1 | 0 | 0 | I have a Django application and I use Jasperserver to generate reports. Can I somehow share the login session from Django to jasperserver to eliminate login step in jasperserver ?
Thanks. | Django to share login session with Jasperserver | 0 | 0 | 0 | 506 |
9,506,281 | 2012-02-29T20:40:00.000 | 13 | 0 | 1 | 1 | python,virtualenv,virtualenvwrapper | 9,506,329 | 2 | true | 0 | 0 | Put it in a user-neutral directory, and make it group-readable.
For instance, for libraries, I use /srv/http/share/ for sharing code across web applications.
You could use /usr/local/share/ for normal applications. | 1 | 19 | 0 | I have a Python virtualenv (created with virtualenvwerapper) in one user account. I would like to use it from another user account on the same host.
How can I do this?
How can I set up virtual environments so as to be available to any user on the host? (Primarily Linux / Debian but also Mac OSX.)
Thanks. | Sharing Python virtualenv environments | 1.2 | 0 | 0 | 22,585 |
9,506,894 | 2012-02-29T21:27:00.000 | 1 | 1 | 0 | 0 | python,internet-explorer,browser-cache,browser-history | 9,508,666 | 2 | false | 0 | 0 | If you wanted to do this for Firefox history, it's an SQLITE database in the file places.sqlite in the user's firefox profile. It can be opened with python's sqlite3 library. Now if you only care about Explorer (as implied by your mention of index.dat), well I don't know about that. | 1 | 2 | 0 | I want to display all the Internet History Information of a system using Python. The index.dat file holds all the history information of user, but it's encoded. How can I decode it?
[I have heard about WinInet Method INTERNET_CACHE_ENTRY_INFO. It provides information about websites visited, hit counts, etc.]
Are there ... | How do I Retrieve and Display the Internet History Information in Python? | 0.099668 | 0 | 1 | 5,552 |
9,509,958 | 2012-03-01T02:52:00.000 | 3 | 0 | 0 | 0 | python,pygtk | 9,511,745 | 1 | true | 0 | 1 | You'll need to arrange that in the window manager. If the program doesn't have the input focus, it doesn't even receive keystrokes. | 1 | 0 | 0 | This question isn't about how to grab the keypress, i'm using accelators for that(but fi thats the wrong way by all means correct me)
Once i start my program, i press ESC to hide it with window.hide_all().
the user may then do other things in other programs, etc, but I want to make it so whenever the user presses, for ... | How can I bring a pyGTK program to visibility, at any time, with a keypress? | 1.2 | 0 | 0 | 65 |
9,510,565 | 2012-03-01T04:20:00.000 | 0 | 0 | 0 | 0 | python,django,actionscript,flash | 9,521,701 | 2 | false | 1 | 0 | Hexagonit.swfheader checks Flash version, which is part of Michael's question, but doesn't cover ActionScript version, does it? | 1 | 0 | 0 | I need to validate an uploaded SWF to ensure it meets certain Flash and ActionScript version limitations. Anyone know a good Python library to parse metadata out of a SWF? | Check a SWF's Flash Version and ActionScript version from Python? | 0 | 0 | 1 | 587 |
9,516,431 | 2012-03-01T12:41:00.000 | 2 | 1 | 1 | 0 | c++,python,shared-objects | 9,516,707 | 3 | false | 0 | 0 | If you have the C++ source code, I would say boost python is the best way because it's very easy to get this up and running and it's flexible. If you don't have C++ source then checkout ctypes. | 2 | 1 | 0 | What's the best way to call C++ function from shared object in python. Can I can solve this problem without additional python extension? | The best way to call C++ function from shared object in python | 0.132549 | 0 | 0 | 459 |
9,516,431 | 2012-03-01T12:41:00.000 | 1 | 1 | 1 | 0 | c++,python,shared-objects | 9,516,904 | 3 | false | 0 | 0 | Another way is to use swig (http://www.swig.org/) to generate a python module wrapping the C++ code. | 2 | 1 | 0 | What's the best way to call C++ function from shared object in python. Can I can solve this problem without additional python extension? | The best way to call C++ function from shared object in python | 0.066568 | 0 | 0 | 459 |
9,517,054 | 2012-03-01T13:26:00.000 | 6 | 0 | 0 | 0 | python,multithreading,postgresql,web-applications,concurrency | 9,521,531 | 1 | true | 1 | 0 | Flask will execute each request in a separate thread or even in separate processes. The number of threads and processes to spawn is determined by the WSGI server (for example, Apache with mod_wsgi).
If you use SQLAlchemy ScopedSessions, the session is perfectly thread-safe. You must not share ORM-controlled objects acr... | 1 | 1 | 0 | I am developing web app on flask, python, sqlalchemy and postgresql.
My question is here regarding concurrency handling in this app.
How I wrote the app :
I take the example of adding user in database. I post the form and a view is called. I process all the form data and then call add_user(*arg) which uses sqlalchemy ... | Concurrency handling in python based webapp | 1.2 | 0 | 0 | 2,325 |
9,517,223 | 2012-03-01T13:38:00.000 | 0 | 0 | 0 | 1 | python,subprocess | 9,517,502 | 2 | false | 0 | 0 | It sounds like you have to establish a UDP server and client. | 1 | 2 | 0 | I have a server written in Python that basically accepts incoming connection from clients and feeds the data received from them into a subprocess (one instance per connection) which then processes the data and returns the result to the server so that it can send it back to the client.
The problem is that the data is st... | Python subprocess: streaming in and out | 0 | 0 | 0 | 205 |
9,517,829 | 2012-03-01T14:22:00.000 | 2 | 0 | 0 | 0 | python,django,django-models | 9,517,891 | 3 | false | 1 | 0 | It sounds like you want each category to have a ForeignKey to Person. | 2 | 1 | 0 | i am new to both python and Django, trying to create a database that hold general information about people, so i have this:
a model for a Person (contain general info).
a model for a Category that a person belongs to (a person can be in multiple categories at the same time).
each category contain its own extra data (... | django: creating a model for Person who can be Writer or Actor or both | 0.132549 | 0 | 0 | 98 |
9,517,829 | 2012-03-01T14:22:00.000 | 0 | 0 | 0 | 0 | python,django,django-models | 9,519,078 | 3 | false | 1 | 0 | The multiple 1to1 rel is the way to go.
Define an ActorProfile model, a WriterProfile model etc, with each having a fk to User. Use some orm magic to load then when necessary.
It's basic that the FK is in the profile model, otherwise you'll need to add a new column on the user table each time you need a new kind of pro... | 2 | 1 | 0 | i am new to both python and Django, trying to create a database that hold general information about people, so i have this:
a model for a Person (contain general info).
a model for a Category that a person belongs to (a person can be in multiple categories at the same time).
each category contain its own extra data (... | django: creating a model for Person who can be Writer or Actor or both | 0 | 0 | 0 | 98 |
9,518,065 | 2012-03-01T14:34:00.000 | 1 | 0 | 1 | 0 | python,zip,package,egg | 9,518,116 | 3 | true | 0 | 0 | An egg is a zip file.
You'll be able to use the md5sum (or any other hash function) on your file regardless of which method you use to package it - they don't care about the extension of the file, just that the binary contents are the same. | 1 | 0 | 0 | I'm planning to package my large python program into a single file;
My requirements are:
only 1 file to download
file can be checksummed
ideally file contains some version info
uses system python
so far the best candidates for package format are .egg and .zip.
What are practical differences between eggs and zips?
Wh... | How to package a runnable python program in 1 file | 1.2 | 0 | 0 | 1,128 |
9,519,346 | 2012-03-01T15:52:00.000 | 1 | 1 | 0 | 1 | python,embedded | 24,161,759 | 6 | false | 0 | 0 | fyi I just ported CPython 2.7x to non-POSIX OS. That was easy.
You need write pyconfig.h in right way, remove most of unused modules. Disable unused features.
Then fix compile, link errors. Then it just works after fixing some simple problems on run.
If You have no some POSIX header, write one by yourself. Implement al... | 1 | 24 | 0 | I am working with an ARM Cortex M3 on which I need to port Python (without operating system). What would be my best approach? I just need the core Python and basic I/O. | Porting Python to an embedded system | 0.033321 | 0 | 0 | 7,622 |
9,519,717 | 2012-03-01T16:11:00.000 | 1 | 1 | 0 | 0 | python,nosetests | 9,519,888 | 3 | false | 0 | 0 | parameter -s - Not capturing stdout | 1 | 18 | 0 | I've tried "nosetests p1.py > text.txt" and it is not working.
What is the proper way to pipe this console output? | how do i redirect the output of nosetests to a textfile? | 0.066568 | 0 | 0 | 5,685 |
9,521,289 | 2012-03-01T17:47:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine | 9,521,520 | 3 | false | 1 | 0 | i am not 100% sure about that but what i used to do is compare the last cursor with the actual cursor and i think i noticed that they were the same so i came to the conclusion that it was the last cursor. | 1 | 0 | 0 | I am fetching records from gae model using cursor() and with_cursor() logic as used in paging. but i am not sure how to check that there is no any other record in db that is pointed by cursor. i am fetching these records in chunks within some iterations.when i got my required results in the first iteration then in next... | cursor and with_cursor() in GAE | 0 | 1 | 0 | 550 |
9,522,877 | 2012-03-01T19:45:00.000 | 9 | 0 | 1 | 0 | arguments,python,idioms | 9,522,937 | 7 | false | 0 | 0 | I don't like any of those options.
I'd define two different functions, perform_solar(a, b, c) and perform_view(a, b, c) and let the caller decide which ones he wants to use, in which order and with which arguments.
If the reason why you thought you'd have to pack these into one single function is that they share state... | 1 | 26 | 0 | I have a Python function which requires a number of parameters, one of which is the type of simulation to perform. For example, the options could be "solar", "view" or "both.
What is a Pythonic way to allow the user to set these?
I can see various options:
Use a string variable and check it - so it would be func(a, b,... | Pythonic way to have a choice of 2-3 options as an argument to a function | 1 | 0 | 0 | 28,001 |
9,523,147 | 2012-03-01T20:02:00.000 | 0 | 1 | 0 | 0 | php,python,web | 9,523,459 | 2 | false | 1 | 0 | You can set up a web server also on the remote computer, perhaps using the same software as on the public server, so you do not need to learn another technology. The public server can make HTTP requests and the remote server responds by communicating with the serial device. | 1 | 3 | 0 | I am working on my senior project at university and I have a question. My advisor and other workers don't know much more on the matter so I thought I would toss it out to SO and see if you could help.
We want to make a website that will be hosted on a server that we are configuring. That website will have buttons on it... | Website to computer communications | 0 | 0 | 1 | 232 |
9,523,570 | 2012-03-01T20:31:00.000 | 1 | 0 | 0 | 0 | c++,python,random,simulation,probability | 9,523,685 | 4 | false | 0 | 0 | At least in C++, rand is sometimes rather poor quality, so code should rarely use it for anything except things like rolling dice or shuffling cards in children's games. In C++ 11, however, a set of random number generator classes of good quality have been added, so you should generally use them by preference.
Seeding ... | 1 | 2 | 1 | I heard that computation results can be very sensitive to choice of random number generator.
1 I wonder whether it is relevant to program own Mersenne-Twister or other pseudo-random routines to get a good number generator. Also, I don't see why I should not trust native or library generators as random.uniform() in nu... | Random number generation with C++ or Python | 0.049958 | 0 | 0 | 3,275 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.