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
6,308,649
2011-06-10T15:33:00.000
10
1
0
0
c++,python,shared-libraries
6,308,733
2
false
0
0
Honestly C++ is a bit messy. You could do something like create a pure C function which wraps the C++ functionality (which you then call from python) but at that point you might as well write your tests in C++. Unfortunately the only tool out there for this (that I know of) is SWIG. It's sad that it's called the "simpl...
1
4
0
I have a libfoo.so library built from C++ code (compiled with gcc), and I would like to quickly test some of its exported classes (basically, instantiating a class then calling its methods to check the output). While I could do that in C/C++ with a main file that links to the library in question and build my tests, but...
Testing a C++ library with Python
1
0
0
2,846
6,310,087
2011-06-10T17:38:00.000
2
0
0
0
python,scipy,sparse-matrix
6,312,608
3
false
0
0
No. Any matrix in Scipy, sparse or not, must be instantiated with a size.
1
1
1
I just started to learn to program in Python and I am trying to construct a sparse matrix using Scipy package. I found that there are different types of sparse matrices, but all of them require to store using three vectors like row, col, data; or if you want to each new entry separately, like S(i,j) = s_ij you need t...
sparse matrix from dictionaries
0.132549
0
0
4,150
6,310,624
2011-06-10T18:34:00.000
0
1
0
0
python,django,amazon-ec2,amazon-web-services,cloud-hosting
6,311,394
3
false
1
0
I usually simply scp -R my whole site directory into /home/bitnami of my AMI. I'm using Apache/NGINX/Django with mod_wsgi. So the directory (for example /home/bitnami/djangosites/) gets referred to based on my mod_wsgi path in my apache cfg file. In other words, why not just move the whole directory recursively (scp -R...
1
1
0
Im in the process of launching a Django app on ec2, but have hit a wall trying to install my code on my AMI instance. This is my situation: I have a bitnami AMI up and running that has Django, apache, Postgresql, and nearly all my dependancies pre installed, and I have my fully functional Django app running on my local...
Installing a my Django app on ec2
0
0
0
618
6,311,322
2011-06-10T19:43:00.000
4
1
0
0
python,debugging
6,311,351
5
true
0
0
Use the logging module rather than printing stuff to stdout. Using the interpreter in interactive mode is a great way to try out code, and pdb is very useful for real debugging.
1
1
0
In PHP, it was extremely easy to start hacking away and figuring out what was going on on a page. Just throw in a bunch of echos and print_r's and that was about it. It appears that this technique is not working for me in python. I am getting practice by hacking around in a python photo upload module, and when a pho...
Experienced Python programmers (ESPECIALLY former php programmers) : How do I debug python?
1.2
0
0
147
6,311,577
2011-06-10T20:11:00.000
3
1
1
0
python,eclipse,pydev
6,317,735
1
true
0
0
Yes - just run them as normal and use the Console menu to flip between them. If you run them under the debugger, you can also use the Debug view in the Debug perspective to terminate them - in either case, using the red square icon to do the terminating.
1
3
0
I am in the process of building a system in python that centralizes the compilation of our code to a set of machines. I have all three programs written, running and working; however I'm still trying to weed out some of the more elusive bugs. I have been mostly testing over the localhost interface and therefore run all ...
Is there a way to run two or more python modules simultaneously from Eclipse(pyDev)?
1.2
0
0
2,548
6,311,705
2011-06-10T20:25:00.000
0
0
1
0
python,unit-testing,testing,mocking,decorator
6,312,040
1
false
0
0
You can't mock a decorator. A decorator replaces your function at compile time with the decorated function. If a function is decorated, you cannot test that function without the decorator without pulling the guts of the function out into another (non-decorated) function.
1
0
0
I saw you posting around decorators. I am having a hard time finding out how to Mock a decorator. Most searches show me how to write a decorate to help tes, but to be clear, I already have decorators and when I am unittesting a function that HAS a decorator I would like to mock it so its response is not part of the tes...
Python/Django Patching/Mocking a functions current decorator
0
0
0
488
6,312,495
2011-06-10T21:58:00.000
9
0
1
0
python,function
6,312,522
4
true
0
0
Short answer: no. Long answer: If you have readline support enabled, you can use the up-arrow to "redefine" it line-by-line.
1
8
0
What are the ways to edit a function defined in the environment of Python IDLE (or console)?
Edit a function in Python IDLE
1.2
0
0
13,965
6,313,982
2011-06-11T04:06:00.000
1
0
0
0
python,django,google-app-engine,user-interface,visualization
6,314,144
3
false
1
0
Does it have to be in python? The GAE has wonderful support for GWT. The GWT eclipse plugin can compile and deploy directly to the GAE with no further modification. The best solution that meets all three of your requirements will be to use GWT + GAE/J. If you're mainly looking for a charting/graphing solution, there ar...
2
2
0
I'm creating an app that allows users to query, manipulate, and explore a very large graph. What's the 'best' way to create a gui + visualization for my project? By best I mean the following: 1. conforms to web standards, no flavor of the month solution 2. allows creative flexibility 3. intuitive, won't require weeks t...
What are my options for MVC, GUI + Interactive Visualization in App Engine (python)?
0.066568
0
0
658
6,313,982
2011-06-11T04:06:00.000
4
0
0
0
python,django,google-app-engine,user-interface,visualization
6,314,329
3
true
1
0
App Engine is flexible on the UI side. The Python supports Django templates (0.96 out of the box, and 1.2 with a one-line config change). Django templates are easy to use, and are JavaScript toolkit neutral. I use jQuery, but that's a personal choice that App Engine doesn't impose. On the UI side, it's a safe choice, a...
2
2
0
I'm creating an app that allows users to query, manipulate, and explore a very large graph. What's the 'best' way to create a gui + visualization for my project? By best I mean the following: 1. conforms to web standards, no flavor of the month solution 2. allows creative flexibility 3. intuitive, won't require weeks t...
What are my options for MVC, GUI + Interactive Visualization in App Engine (python)?
1.2
0
0
658
6,314,746
2011-06-11T07:37:00.000
3
0
0
0
javascript,python,django,frameworks
6,321,230
3
false
1
0
If you already have experience with jQuery, then go on with jQuery! I use Django + jQuery + Postgresql for all my projects and couldn't be any happier with this powerful combination.
2
2
0
I want to develop a web application using Django, but I can't decide which javascript framework to use. May be some of you guys has developed Django + JS Framework application? I personally prefer JQuery because it is easy and fast, but other libraries like Dojo has so cool features and widgets. That I want to switch t...
Django + js Framework
0.197375
0
0
2,131
6,314,746
2011-06-11T07:37:00.000
2
0
0
0
javascript,python,django,frameworks
6,314,809
3
false
1
0
jQuery and Scriptaculous are good choices, But if you want to develop desktop like functionality over the web Qooxdoo helps alot :-)
2
2
0
I want to develop a web application using Django, but I can't decide which javascript framework to use. May be some of you guys has developed Django + JS Framework application? I personally prefer JQuery because it is easy and fast, but other libraries like Dojo has so cool features and widgets. That I want to switch t...
Django + js Framework
0.132549
0
0
2,131
6,314,982
2011-06-11T08:40:00.000
1
0
0
0
python,sockets,fuse
6,422,522
2
true
0
0
What you could look at is using pyx or a C module for Python that implements the required functionality in C and then you can manipulate and or use it from your Python script. This would allow you to send over the file descriptor and have the Python script act upon it. Other things you can do is write a small C wrapper...
1
1
0
I am implementing a python script to do fuse mount programatically. I have written an equivalent in C, by making use of socketpair and recvmsg api's. But in python recvmsg is not implemented, so I am stuck. Can anyone of you tell me a python equivalent of this? Any help would be appreciated. Let me tell why do I need r...
what is recvmsg equivalent in python?
1.2
0
0
3,056
6,315,109
2011-06-11T09:17:00.000
0
0
1
0
python,decimal
6,315,223
1
true
0
0
Maybe float("0.5")? that might be more suited to your problem.
1
0
0
I've made a program that calculates the flat rate interest of a loan based on the amount borrowed, the %/year (interest), and the length of time to pay it back... here's where my problem starts: I let the user input the years to pay it back, BUT, if the length of time is under a year the user is forced to use a decima...
I don't know how to change an input into integer with decimals
1.2
0
0
105
6,315,654
2011-06-11T11:35:00.000
3
0
0
1
python,django,deployment,amazon-ec2,amazon-web-services
6,315,809
1
false
1
0
The answer is pretty obvious. If you start with the Bitnami stack you'll save yourself the hassle of installing and configuring the various components (web server, gateway, python and the required libs, DB, etc.). So if you app is pretty straight forward (typical web app) then sure, start with the bitnami stack. At mos...
1
2
0
I have a complex university project that requires building some specific libraries and the use of threads (AppEngine out of the question), and I want to deploy in on EC2 (Free tier deal). I was wondering what would be best, to start with a bare linux distribution or the BitNami Django stack ? I've seen similar question...
Deploying Django project on EC2 with BitNami image
0.53705
0
0
488
6,319,207
2011-06-11T23:46:00.000
127
0
1
0
python,multithreading,list,python-3.x,python-multithreading
18,568,017
4
false
0
0
To clarify a point in Thomas' excellent answer, it should be mentioned that append() is thread safe. This is because there is no concern that data being read will be in the same place once we go to write to it. The append() operation does not read data, it only writes data to the list.
1
200
0
I notice that it is often suggested to use queues with multiple threads, instead of lists and .pop(). Is this because lists are not thread-safe, or for some other reason?
Are lists thread-safe?
1
0
0
128,287
6,319,507
2011-06-12T01:09:00.000
0
1
0
0
python,objective-c,cocoa,server-side
18,298,127
3
false
0
0
I concur, try doing it in objective-c But if you are looking for a similar language that also has rich wen development frameworks widely used, take a look at Ruby. The syntax is quite different but the object model is fairly similar and won't actually feel that far away. The framework Ruby on Rails is also a very rich...
1
6
0
A bit of background: I have been developing apps for the past 2 years for Mac and iOS. I really like Objective-c and Cocoa/Cocoa-Touch framework. I did java and c++ before I started programing for iOS and now when I look at these languages i literally get a headache (The syntax mainly but also lack of classes provided ...
Objective-c Server Side
0
0
0
3,015
6,319,575
2011-06-12T01:31:00.000
1
1
0
0
python,apache,lighttpd
6,319,726
2
false
1
0
That you have mentioned gevent is important. Does that mean you are specifically trying to implement a long polling application? If you are and that functionality is the bulk of the application, then you will need to put your gevent server behind a front end web server that is implemented using async techniques rather ...
2
3
0
I'm a newbie to developing with Python and I'm piecing together the information I need to make intelligent choices in two other open questions. (This isn't a duplicate.) I'm not developing using a framework but building a web app from scratch using the gevent library. As far as front-end web servers go, it seems I have...
Apache + mod_wsgi / Lighttpd + wsgi - am I going to see differences in performance?
0.099668
0
0
2,472
6,319,575
2011-06-12T01:31:00.000
5
1
0
0
python,apache,lighttpd
6,319,667
2
true
1
0
Apache... Apache is by far the most widely used web server out there. Which is a good thing. There is so much more information on how to do stuff with it, and when something goes wrong there are a lot of people who know how to fix it. But, it is also the slowest out of the box; requring a lot of tweaking and a beefier ...
2
3
0
I'm a newbie to developing with Python and I'm piecing together the information I need to make intelligent choices in two other open questions. (This isn't a duplicate.) I'm not developing using a framework but building a web app from scratch using the gevent library. As far as front-end web servers go, it seems I have...
Apache + mod_wsgi / Lighttpd + wsgi - am I going to see differences in performance?
1.2
0
0
2,472
6,319,583
2011-06-12T01:33:00.000
0
0
1
0
algorithm,performance,python
6,319,610
6
false
0
0
1) You are trying to return well formed numbers 'up to' n digits in your approach, that is probably not the thing they were asking for 2) Sorting each number in that range is a bit silly. You may check whether each number is a well formed one by comparing the consecutive digits, which will take O(d) time for each numbe...
2
0
0
I found this in an interview questions forum: Write a function to return well formed numbers of size n. A well formed number is one in which digit i is less than digit i+1, for example 123, 246, 349 etc So here's how I would do it in Python: input number of digits (x) loop over all the numbers of x digits for...
Return well-formed numbers
0
0
0
371
6,319,583
2011-06-12T01:33:00.000
2
0
1
0
algorithm,performance,python
6,319,609
6
false
0
0
In my opinion, you've already lost if you're checking every number. I'd implement this with a stack. Start by putting 1-9 on the stack. When you take a number off of the stack, add another number to it if you can following those rules. If it's n digits, then print it. If it's not n digits, put it back on the stack. Let...
2
0
0
I found this in an interview questions forum: Write a function to return well formed numbers of size n. A well formed number is one in which digit i is less than digit i+1, for example 123, 246, 349 etc So here's how I would do it in Python: input number of digits (x) loop over all the numbers of x digits for...
Return well-formed numbers
0.066568
0
0
371
6,320,107
2011-06-12T04:22:00.000
3
0
1
0
python,multithreading,thread-safety,python-3.x
6,320,177
3
true
0
0
Like the other have said, Python objects are mostly thread-safe. Although you will need to use Locks in order to protect an object in a place that require it to go through multiple changes before being usable again.
1
5
0
Are Python ints thread-safe? I cannot find a definitive answer for this from Google.
Are Python ints thread-safe?
1.2
0
0
6,944
6,320,415
2011-06-12T05:49:00.000
2
0
1
0
python,unicode,python-3.x,decode,pickle
6,320,431
1
true
0
0
It's hard to say without you showing your code, but it looks like you opened the file in text mode with a "gbk" encoding. It should probably be opened in binary mode. If that doesn't happen, make a small code example that fails, and paste it in here.
1
1
1
I'm trying to load an object (of a custom class Area) from a file using pickler. I'm using python 3.1. The file was made with pickle.dump(area, f) I get the following error, and I would like help trying to understand and fix it. File "editIO.py", line 12, in load area = pickle.load(f) File "C:\Python31\lib\pic...
UnicodeDecodeError: 'gbk' codec can't decode bytes
1.2
0
0
4,835
6,320,954
2011-06-12T08:27:00.000
1
0
0
0
python,linux,ubuntu,python-3.x,tkinter
6,338,479
8
false
0
1
If you installed python-tk and the system is running python 2.6 then it is most likely that you installed Tkinter for python 2.6. Try installing python3-tk.
4
8
0
I am running Ubuntu 10.10, and I installed Python 3.2 today. The system is already running Python 2.6. I typed idle3.2 in the terminal and it gave me: IDLE can't import Tkinter. Your Python may not be configured for Tk. So I searched on Stack Overflow (and in some other places) for a solution, I installed python-tk, ...
IDLE can't import Tkinter. Your Python may not be configured for Tk
0.024995
0
0
46,374
6,320,954
2011-06-12T08:27:00.000
2
0
0
0
python,linux,ubuntu,python-3.x,tkinter
13,890,255
8
false
0
1
The problem is caused by the version between python and idle not matching. U can check your python version by typing : python Then sudo aptget install the right idle version same with your python version
4
8
0
I am running Ubuntu 10.10, and I installed Python 3.2 today. The system is already running Python 2.6. I typed idle3.2 in the terminal and it gave me: IDLE can't import Tkinter. Your Python may not be configured for Tk. So I searched on Stack Overflow (and in some other places) for a solution, I installed python-tk, ...
IDLE can't import Tkinter. Your Python may not be configured for Tk
0.049958
0
0
46,374
6,320,954
2011-06-12T08:27:00.000
0
0
0
0
python,linux,ubuntu,python-3.x,tkinter
18,475,938
8
false
0
1
Type "idle-python2.6" in the terminal..it worked for me
4
8
0
I am running Ubuntu 10.10, and I installed Python 3.2 today. The system is already running Python 2.6. I typed idle3.2 in the terminal and it gave me: IDLE can't import Tkinter. Your Python may not be configured for Tk. So I searched on Stack Overflow (and in some other places) for a solution, I installed python-tk, ...
IDLE can't import Tkinter. Your Python may not be configured for Tk
0
0
0
46,374
6,320,954
2011-06-12T08:27:00.000
1
0
0
0
python,linux,ubuntu,python-3.x,tkinter
8,566,253
8
false
0
1
you need to install tk or tk-dev packages for ubuntu.
4
8
0
I am running Ubuntu 10.10, and I installed Python 3.2 today. The system is already running Python 2.6. I typed idle3.2 in the terminal and it gave me: IDLE can't import Tkinter. Your Python may not be configured for Tk. So I searched on Stack Overflow (and in some other places) for a solution, I installed python-tk, ...
IDLE can't import Tkinter. Your Python may not be configured for Tk
0.024995
0
0
46,374
6,321,696
2011-06-12T11:32:00.000
0
0
0
0
python,selenium,web-scraping,selenium-webdriver,windmill
6,322,502
1
false
1
0
Before using tools like Selenium that are designed for front end testing and not for scraping, you should have a look at where the data on the site comes from. Find out what XHR requests are made, what parameters they take and what the result is. For example the site you mentioned in your comment does a POST request wi...
1
2
0
I'm a Python programmer specializing in web-scraping, I had to ask this question as I found nothing relevant. I want to know what are the popular, well documented frameworks that are available for Python for scraping pure Javascript based sites? Currently I know Mechanize and Beautiful Soup but they do not interact wi...
Choosing a Python webscraping framework for handling pure Javascript based sites
0
0
1
1,041
6,325,094
2011-06-12T22:22:00.000
3
0
0
0
php,python,django,magento,e-commerce
6,325,410
8
true
1
0
I've no experience with Django. I develop websites using Wordpress and a year ago I tested Magento (not tested it since). I was surprised of how user friendly Magento was. Both front end and backend. It was really easy to set up. You can easily customize the layout as well using Magento template API. Here are some pros...
2
10
0
I need to develop a new site with the e-commerce part. I'm here to get some hints from you on which road I should go on. The site will have a static part which include some static pages and the e-commerce part for sell the products. I'm a Django and PHP developer but this is the first time I need to develop an e-commer...
E-commerce from scratch or not
1.2
0
0
12,769
6,325,094
2011-06-12T22:22:00.000
0
0
0
0
php,python,django,magento,e-commerce
6,325,503
8
false
1
0
Many of us have been in the same situation before - code-from-scratch (CFS) or use a framework. My experience - I started scripting with Perl. And one of the most used module (for web programming) of PERL is CGI. Some considered it a 'heavy' module and thus a few had developed a 'lighter' version of it. For a newbie, ...
2
10
0
I need to develop a new site with the e-commerce part. I'm here to get some hints from you on which road I should go on. The site will have a static part which include some static pages and the e-commerce part for sell the products. I'm a Django and PHP developer but this is the first time I need to develop an e-commer...
E-commerce from scratch or not
0
0
0
12,769
6,325,775
2011-06-13T01:02:00.000
1
0
1
0
python,oop
6,325,854
6
false
0
1
You're conflating two meanings of the "destroying" idea. The Item should get destroyed in a "gameplay" sense. Let the garbage collector worry about when to destroy it as an object. Who has a reference to the Item? Perhaps the player has it in his inventory, or it is in a room in the game. In either case your Invent...
3
5
0
Every once in a while I like to take a break from my other projects to try to make a classic adventure text-based-game (in Python, this time) as a fun project, but I always have design issues implementing the item system. I'd like for the items in the game to descend from one base Item class, containing some attribute...
Managing Items in an Object Oriented game
0.033321
0
0
1,852
6,325,775
2011-06-13T01:02:00.000
0
0
1
0
python,oop
6,325,828
6
false
0
1
Assuming you call a method when the item is used, you could always return a boolean value indicating whether it's broken.
3
5
0
Every once in a while I like to take a break from my other projects to try to make a classic adventure text-based-game (in Python, this time) as a fun project, but I always have design issues implementing the item system. I'd like for the items in the game to descend from one base Item class, containing some attribute...
Managing Items in an Object Oriented game
0
0
0
1,852
6,325,775
2011-06-13T01:02:00.000
-1
0
1
0
python,oop
6,325,868
6
false
0
1
at first: i don't have any python experience, so think about this in a more general way your item should neither know or care ... your Item should have an interface that says it is something destroyable. containers and other objects that care about things that can be destroyed, can make use of that interface that destr...
3
5
0
Every once in a while I like to take a break from my other projects to try to make a classic adventure text-based-game (in Python, this time) as a fun project, but I always have design issues implementing the item system. I'd like for the items in the game to descend from one base Item class, containing some attribute...
Managing Items in an Object Oriented game
-0.033321
0
0
1,852
6,326,279
2011-06-13T03:02:00.000
3
0
1
0
python,ubuntu,python-3.x
6,326,624
2
false
0
0
You can't remove Python 2, Ubuntu will stop working. Python 3 is however a separate package and can be installed in parallell. Since Python3's exe is called 'python3' this doesn't have any negative effects.
2
2
0
Is this going to break anything? Is there anything I would need to keep in mind if I do uninstall the older versions?
Updating to Python 3 on Kubuntu 11.04 -- do/should I uninstall previous versions?
0.291313
0
0
803
6,326,279
2011-06-13T03:02:00.000
4
0
1
0
python,ubuntu,python-3.x
6,326,303
2
true
0
0
Personally, I would keep both around (and when upgrading to Ubuntu 11.04, I did). The problem is that there are still a lot of libs which are only in Python 2.x. The good news is that they are decreasing in number/prominence, but too much relies on the older way of doing things to reliably remove it. If you feel more c...
2
2
0
Is this going to break anything? Is there anything I would need to keep in mind if I do uninstall the older versions?
Updating to Python 3 on Kubuntu 11.04 -- do/should I uninstall previous versions?
1.2
0
0
803
6,327,592
2011-06-13T07:18:00.000
2
1
0
0
php,python,rest,google-cloud-storage
9,041,894
1
true
1
0
Fundamentally, your PHP code and gsutil are both using the RESTful interface (gsutil is actually layered atop an open source Python library called boto which implements the bulk of the REST interface), however, there are several reasons to consider using gsutil: Gsutil takes care of OAuth 2.0 authentication/authorizat...
1
0
0
We all know that working with S3 is a pain: deleting virtual directories requires to delete all the objects from within the path, etc. At least with RESTful API this is the case. I was wondering whether there would be any performance improvement if I would use PHP to call GSUtil rather than using my own PHP class. Is t...
GSUtil vs PHP RESTful class
1.2
0
0
766
6,328,289
2011-06-13T08:43:00.000
1
0
0
0
python,django
6,328,303
2
false
1
0
For a list page, you could just generate a table. For an add/edit page, use Django Forms.
1
2
0
I know we can generate Database Tables from models, which enables a fast development. Can we also generate HTML templates from models, such as list/add/edit? You know we can do this in Grails. Hopefully we can also do that in Django.
Can I generate html templates from models
0.099668
0
0
131
6,329,347
2011-06-13T10:39:00.000
3
0
1
0
python,dictionary,attributes,reference,parent-child
6,329,386
4
true
0
0
Add some prefix for attributes you don't want to save and exclude them while saving.
3
5
0
I am creating a series of object instances, the attributes of which i save and load using their __dict__ attribute. I would like to keep some attributes outside of __dict__, simply because i do not want them to be saved or loaded. More specifically: I created a parent object merely holding a list of children objects. C...
How to keep attribute outside __dict__?
1.2
0
0
2,309
6,329,347
2011-06-13T10:39:00.000
1
0
1
0
python,dictionary,attributes,reference,parent-child
6,329,399
4
false
0
0
This approach won't work and so is not going to solve your problem. You should instead extend your framework to allow you to specify which attributes were to be omitted from the save/load. However, it seems odd that you aren't using one of the built in persistence techniques, e.g. pickle, that already offer such featu...
3
5
0
I am creating a series of object instances, the attributes of which i save and load using their __dict__ attribute. I would like to keep some attributes outside of __dict__, simply because i do not want them to be saved or loaded. More specifically: I created a parent object merely holding a list of children objects. C...
How to keep attribute outside __dict__?
0.049958
0
0
2,309
6,329,347
2011-06-13T10:39:00.000
1
0
1
0
python,dictionary,attributes,reference,parent-child
6,329,478
4
false
0
0
You can override the __getattr__ and __setattr__ methods of your object to hide your attributes from __dict__. But you need to store your additional attributes somewhere else. Also it makes it very hard to figure out which members your object really has. So it is more a hack than a good solution.
3
5
0
I am creating a series of object instances, the attributes of which i save and load using their __dict__ attribute. I would like to keep some attributes outside of __dict__, simply because i do not want them to be saved or loaded. More specifically: I created a parent object merely holding a list of children objects. C...
How to keep attribute outside __dict__?
0.049958
0
0
2,309
6,330,335
2011-06-13T12:21:00.000
1
0
0
0
python,authentication,openid,google-openid
6,330,374
1
true
0
0
From the client's perspective, an OpenID login is very similar to any other web-based login. There isn't a defined protocol for the client; it is an ordinary web session that varies based on your OpenID provider. For this reason, I doubt that any such libraries exist. You will probably have to code it yourself.
1
1
0
I'm writing a python script that scrapes a website, where the website uses OpenID auth to identify me via google. Is there a python library that will handle do this for me, or do I need to find out and replicate the steps that my browser already does? Otherwise, is there some standard way of doing this in some other la...
Python - How to request pages from website that uses OpenID
1.2
0
1
698
6,332,562
2011-06-13T15:30:00.000
2
0
0
1
python,google-app-engine,email,backend,task-queue
6,337,957
1
true
1
0
Enqueue a single task which sends emails sequentially, checking the wallclock time after each email. When the time approaches 10 minutes, chain another task to continue where the current task left off. If you want to send emails faster, parallelize this, and enqueue several tasks that each send emails to a subset of us...
1
1
0
I'm working on a voting app where I need to send an email to each voter to inform him or her about the election. I see three methods for doing this and I'm curious what the approximate limits on the number of emails I could send with each method: In a user request, add a task to a task queue where each task sends one...
limits of bulk email in GAE
1.2
0
0
196
6,333,345
2011-06-13T16:32:00.000
0
0
0
0
python,matplotlib
26,627,020
2
false
0
0
from matplotlib.widgets import Button real_points = plt.axes().scatter(x=xpts, y=ypts, alpha=.4, s=size, c='green', label='real data') #Reset Button #rect = [left, bottom, width, height] reset_axis = plt.axes([...
1
1
1
I have a python function that generates a list with random values. After I call this function, I call another function that plots the random values using matplotlib. I want to be able to click some key on the keyboard / mouse, and have the following happen: (1) a new list of random values will be re-generated (2) the...
python matplotlib -- regenerate graph?
0
0
0
1,009
6,333,590
2011-06-13T16:53:00.000
1
0
0
0
python,paramiko
6,343,363
1
false
0
0
Create ssh key pairs for each server, use ssh-copy-id to copy public keys from server A to Server B, and from Server C to Server A. All you have to do then is to tell your script to ssh to remote server A and then execute scp to copy files over to Server B. Edit: You have to setup your ssh keys without a passphrase ! (...
1
0
0
I want to transfer files from say server A to server B directly. The script performing this operation is residing on some other server say C. How can it be achieved without being saving files temporarily on server C or local system..
establish connection with multiple servers simultaneously using python paramiko package
0.197375
0
1
529
6,335,248
2011-06-13T19:24:00.000
1
0
0
1
python,google-app-engine,logging
6,337,910
1
true
1
0
App Engine stores logging information in a set of circular buffers. When it runs out of space, it overwrites older log entries with the new data. What you're seeing is requests for which the detailed logs have been overwritten by newer requests.
1
0
0
This might not be bug, but feature. I'm having problem views expanded logs when searching logs in dashboard on app engine. Search results show first couple of logs in full detail, but rest of log entries are obscured. Every new entry in log is shown in full details, but older ones get obscured over the time. Same beh...
GAE expanded log view
1.2
0
0
96
6,335,548
2011-06-13T19:53:00.000
0
0
1
0
python,time
6,336,220
2
false
0
0
Fork a subprocess to do the actual job; kill the job if it exceeds your run-time limit.
1
0
0
I'm having trouble figuring out how to do this. I'm trying to run a python script for a set duration. And every 1/10 of the duration I need it to run something. The problem is this step can take any amount of time to complete. I cannot go over the maximum duration set at the start. Example: Duration 20 hours Interval ...
Python Time Problem
0
0
0
363
6,337,798
2011-06-14T00:11:00.000
0
0
0
0
python,mysql,connect,mysql-python,rowcount
6,339,210
1
false
0
0
Turn autocommit on. The commit operation just "confirms" updates already done. The alternative is rollback, which "undoes" any updates already made.
1
0
0
I'm using MySQLdb in Python. I have an update that may succeed or fail: UPDATE table SET reserved_by = PID state = "unavailable" WHERE state = "available" AND id = REQUESTED_ROW_ID LIMIT 1; As you may be able to infer, multiple processes are using the database, and I need processes to be ab...
How do I get the actual cursor.rowcount upon .commit?
0
1
0
576
6,337,811
2011-06-14T00:14:00.000
2
0
0
0
python,django,solr,django-haystack
16,082,986
4
false
1
0
You can achieve the same behavior without having to touch the solr schema. In your index, make your text field an EdgeNgramField instead of a CharField. Under the hood this will generate a similar schema to what lindstromhenrik suggested.
2
7
0
I am using haystack within a project using solr as the backend. I want to be able to perform a contains search, similar to the Django .filter(something__contains="...") The __startswith option does not suit our needs as it, as the name suggests, looks for words that start with the string. I tried to use something like...
Django-Haystack with Solr contains search
0.099668
0
0
2,893
6,337,811
2011-06-14T00:14:00.000
0
0
0
0
python,django,solr,django-haystack
14,520,797
4
false
1
0
I am using an expression like: .filter(something__startswith='...') .filter_or(name=''+s'...') as is seems solr does not like expression like '...*', but combined with or will do
2
7
0
I am using haystack within a project using solr as the backend. I want to be able to perform a contains search, similar to the Django .filter(something__contains="...") The __startswith option does not suit our needs as it, as the name suggests, looks for words that start with the string. I tried to use something like...
Django-Haystack with Solr contains search
0
0
0
2,893
6,337,812
2011-06-14T00:14:00.000
1
0
1
0
python,sqlalchemy
6,338,431
1
true
0
0
What is the problem here? SQLAlchemy maintains a thread-local connection pool..what else do you need?
1
0
0
I want to do the following: Have a software running written in Python 2.7 This software connects to a database (Currently a MySQL database) This software listen for connections on a port X on TCP When a connection is established, a client x request or command something, then the software use the database to store, rem...
How to use SQLAlchemy in this context
1.2
1
0
183
6,338,867
2011-06-14T03:51:00.000
10
0
1
0
python,class,inheritance,friend
6,339,959
4
false
0
0
The philosophy of Python is that issues like access control are up to programmer discipline. It doesn't attempt to encode in the language which parts of the program are internal implementation details, and which are part of the documented interface. Thus, it doesn't need constructs like friend to try to declare which o...
2
18
0
Is there any way to make certain variables in classes "private" (or whatever self.__var really is) but be accessible to another class, like friends in c++, except in python? I do not want the variables in either class being messed with. Nor do I want to copy the entire code over and convert it for the second class.
"Friend"ing classes in python
1
0
0
18,344
6,338,867
2011-06-14T03:51:00.000
26
0
1
0
python,class,inheritance,friend
6,338,881
4
true
0
0
No, there is not such an option. Use names that start with single underscores and tell the other people working on your project to not be silly about what they access.
2
18
0
Is there any way to make certain variables in classes "private" (or whatever self.__var really is) but be accessible to another class, like friends in c++, except in python? I do not want the variables in either class being messed with. Nor do I want to copy the entire code over and convert it for the second class.
"Friend"ing classes in python
1.2
0
0
18,344
6,338,950
2011-06-14T04:07:00.000
0
0
0
0
python
6,338,988
2
false
0
0
On my system it's C:\Python27\Tools\i18n. It may be similar for you.
2
0
0
I am using openSUSE11.3 and wanna use gettext in my app. BUt I cannot find two python utilities pygettext.py and msgfmt.py. Could you guys tell me where can I find them? What's the path? Thanks in advance.
help: where can I find pygettext.py and msgfmt.py?
0
0
0
1,848
6,338,950
2011-06-14T04:07:00.000
0
0
0
0
python
15,863,258
2
false
0
0
Under openSUSE and SLES you need to install python-demo and then msgfmt.py will be available in /usr/share/doc/packages/python/Tools/i18n.
2
0
0
I am using openSUSE11.3 and wanna use gettext in my app. BUt I cannot find two python utilities pygettext.py and msgfmt.py. Could you guys tell me where can I find them? What's the path? Thanks in advance.
help: where can I find pygettext.py and msgfmt.py?
0
0
0
1,848
6,339,541
2011-06-14T05:42:00.000
0
0
0
0
python,flash,facebook,facebook-graph-api
6,349,413
2
true
1
0
I suppose so... just set a click event handler inside the Flash movie to redirect the user to wherever you want.
2
1
0
Is there anyway I can add a link to a flash file I post on my wall using the rest/graph api, such that when a user clicks on the flash file playing, it takes them to my app? Thanks.
Link within flash file posted on facebook wall possible?
1.2
0
1
262
6,339,541
2011-06-14T05:42:00.000
1
0
0
0
python,flash,facebook,facebook-graph-api
15,536,720
2
false
1
0
I don't know if you still require this , But here is the solution to what you are seeking: Use the Feed dialog , and specify in the link parameter the URL of your APP , and in the source parameter , the URL of the flash file you want to post.
2
1
0
Is there anyway I can add a link to a flash file I post on my wall using the rest/graph api, such that when a user clicks on the flash file playing, it takes them to my app? Thanks.
Link within flash file posted on facebook wall possible?
0.099668
0
1
262
6,340,479
2011-06-14T07:37:00.000
0
1
0
1
python,perl
70,644,949
4
false
0
0
IF you want to see output in "real time" and not when script has finished running , Add -u after python. example : my $ret = system("python -u pdf2txt.py arg1 arg2");
1
17
0
I need to call "/usr/bin/pdf2txt.py" with few arguments from my Perl script. How should i do this ?
How to call a python script from Perl?
0
0
0
31,279
6,340,739
2011-06-14T08:07:00.000
1
0
0
0
python,recv
6,340,763
2
false
0
0
The socket in Python is blocking by default, unless you change it.
1
3
0
In python the recv is a blocking function or not? I'm learned in the Uni C and there the was blocking and non-blocking socket. So I just wan to ask weather in python the recv function is a blocking function or not.
Python tcp send receive functions
0.099668
0
1
653
6,340,972
2011-06-14T08:28:00.000
1
1
1
0
c#,php,asp.net,python,web-services
6,341,033
4
false
1
0
You can do whatever you like. Personally i wouldnt use php because i dont know very much php. But you can do it, you could expose a soap web service and there are libraries that will let php talk to it. No one here will be able to tell you what you haven't already told us. Asp.Net will probably be easier because of how...
3
4
0
I have a code written in C# I would like to use as the back-end of a site I'm building. I would prefer not to build the site front-end in ASP.NET (which integrates nicely with C#), and to use PHP or Python instead. Is that reasonable? Should I re-consider using ASP.NET? How can I achieve that?
Connecting C# Back-end with PHP frontend
0.049958
0
0
3,827
6,340,972
2011-06-14T08:28:00.000
0
1
1
0
c#,php,asp.net,python,web-services
43,901,958
4
false
1
0
Ugh, in normal instances, reading data with C# writing it to files and loading up with PHP sound slow, inefficient and down wright crazy. I believe these terms are being used wrongly. Client Server - user machine - database great for private networks where you connect to the DB without going over the internet vs n-Tier...
3
4
0
I have a code written in C# I would like to use as the back-end of a site I'm building. I would prefer not to build the site front-end in ASP.NET (which integrates nicely with C#), and to use PHP or Python instead. Is that reasonable? Should I re-consider using ASP.NET? How can I achieve that?
Connecting C# Back-end with PHP frontend
0
0
0
3,827
6,340,972
2011-06-14T08:28:00.000
3
1
1
0
c#,php,asp.net,python,web-services
6,341,059
4
false
1
0
Just use asp.net mvc framework for the frontend instead of plain asp.net. It's easy to learn. And if you know php it will be easy to you undestand asp.net mvc. I don't see the reasons if you are using c# backend use php frontend. For sure you can create service layer on c# and communicate with php through it, but it d...
3
4
0
I have a code written in C# I would like to use as the back-end of a site I'm building. I would prefer not to build the site front-end in ASP.NET (which integrates nicely with C#), and to use PHP or Python instead. Is that reasonable? Should I re-consider using ASP.NET? How can I achieve that?
Connecting C# Back-end with PHP frontend
0.148885
0
0
3,827
6,341,823
2011-06-14T09:52:00.000
5
0
0
0
python,dictionary,tcp
6,341,947
4
false
0
0
Pickle is considered insecure for sending data structures across connections as the object can never be trustfully reconstructed. This is why yaml, json or any other format is considered preferable.
2
9
0
I'm a python beginner, and I'm curious how can I send a dictionary through TCP
Python sending dictionary through TCP
0.244919
0
1
22,945
6,341,823
2011-06-14T09:52:00.000
0
0
0
0
python,dictionary,tcp
46,536,775
4
false
0
0
yes. its might be unsecured. but you can use https and send it thru post method. for get mehtod, try to consider encrypt pickle before sending
2
9
0
I'm a python beginner, and I'm curious how can I send a dictionary through TCP
Python sending dictionary through TCP
0
0
1
22,945
6,342,183
2011-06-14T10:27:00.000
0
0
0
0
python,django-admin
7,200,879
4
false
1
0
I used Omokoli's solution from above but to make the field use my custom widget I did: class MyModelAdminForm(forms.ModelForm): class Meta: model = get_model('myapp', 'mymodel') widgets = { 'original_link': OutputWidget, }
1
0
0
I want to add some html element (button, "a" tag, etc ) to a django admin page. How can i do it? Please help.
Adding custom button or a tag to django admin
0
0
0
1,283
6,344,070
2011-06-14T13:17:00.000
0
0
0
0
python,xml,sax
6,657,346
1
false
0
0
When you are concatenating the documents together, just replace the beginning <? and ?> with <!-- and -->, this will comment out the xml declarations.
1
3
0
Is there a way to "skip" a line using a SAX XML parser? I've got a non-confirming XML document which is a concatenation of valid XML documents and thus the <?xml ...?> appears for each document. Also note I need to use a SAX parser since the input documents are huge. I tried crafting a "custom stream" class as feeder ...
python sax parser skipping over exception
0
0
1
494
6,345,156
2011-06-14T14:29:00.000
4
0
1
0
python,image,ms-word,extract,pywin32
6,932,276
4
false
0
0
Docx files can be unzipped for extracting the images.
1
6
0
I would like to run a script on a folder full of word documents that reads through the documents and pulls out images and their captions (text right below the images). From the research I've done, I think pywin32 might be a viable solution. I know how to use pywin32 to find strings and pull them out, but I need help wi...
Using Python to extract images and text from a word document
0.197375
0
0
8,790
6,346,757
2011-06-14T16:22:00.000
3
1
0
0
python,c,linux,dynamic-linking
6,346,820
2
false
0
0
If this is your own application you could rearrange the build so your executable is only main() { real_main(); } and real_main() is in libapp.so. Then you could test libapp.so with your existing code. If it's possible to load another executable it probably involves loading ld.so and getting it to do the work. If you ...
1
1
0
I wrote a little testing framework that uses 'nm' to inspect shared libraries and look for test functions. I then use Python's ctypes library to dynamically load the shared object and execute the test functions. Is there a way to do this with an executable? When I tried the same trick on an executable module Python rep...
Can I dynamically load an executable on linux?
0.291313
0
0
5,178
6,347,374
2011-06-14T17:12:00.000
1
0
0
0
java,python,validation,import-from-csv
6,509,510
1
false
1
0
Can you imagine a DSL that would do it? How will the rules look like? Several months ago I worked on such problem - in the end it turned out to be harder than it seemed first. The first step was obvious - all rows were parsed and placed to the special data stuctures so I could work with them; the ones with missing f...
1
3
0
I am faced with CSV files which come from clients and which can contain hundreds of thousands of rows. Is there a DSL (or wildly popular library in Java or Python) which can efficiently run calculations on this information, applying various rules to issue warnings and errors (user-configurable, of course)?
Is there a standard DSL for data integrity validation?
0.197375
0
0
976
6,347,588
2011-06-14T17:30:00.000
9
1
1
0
python,import,global
6,347,667
2
true
0
0
How about something like globals()["os"] = __import__("os")? I guess this could be wrapped in a generic function if you wanted since the module name is a string.
1
11
0
I am trying to import a module from inside a function and have it be available to my whole file the same way it would be if I imported outside any functions and before all the other code. The reason it is in a function is because I don't have much control over the structure of the script. Is this possible without resor...
Is it possible to import to the global scope from inside a function (Python)?
1.2
0
0
5,294
6,348,011
2011-06-14T18:09:00.000
0
0
0
0
python,vba,scripting,excel
6,361,909
3
false
0
0
You can also use the PyWin32 libraries to script this with Python using typical COM techniques. This lets you use Python to do your processing, and still save all of the extra parts of each workbook that other Python Excel libraries may not handle.
1
4
0
I've trying to make large changes to a number of excel workbooks(over 20). Each workbook contains about 16 separate sheets, and I want to write a script that will loop through each workbook and the sheets contains inside and write/modify the cells that I need. I need to keep all string validation, macros, and formattin...
Scripting changes to multiple excel workbooks
0
1
0
3,284
6,348,094
2011-06-14T18:15:00.000
4
0
0
0
python,pylons,pyramid
6,360,651
2
true
1
0
Pyramid (like most WSGI applications) can be mounted on any domain and url prefix. Thus the application itself doesn't actually know what urls it is responsible for unless you code that into your application specifically (an INI setting, for example). This is why request.application_url exists... because the applicatio...
1
5
0
Is there any way to get pyramid absolute application url in main() function? I want to add it into global settings, so it could be called every where(in templates and js files). In pyramid documents there is some functions would help, but all of them need a request object and must call in a view. Thanks.
pyramid: get application absolute url
1.2
0
0
2,905
6,348,988
2011-06-14T19:31:00.000
1
1
0
0
python,passwords,smtp,hardcoded
6,349,049
3
false
0
0
Store your data as environment variables or inside a configuration file...
3
2
0
i wanna know if it is possible not to hard code my user name and password in a script that copy a file in the operation system and send it via smtp [gmail] Thank you!
There is a way not to hard code username & pass when sending mail [python]
0.066568
0
0
1,677
6,348,988
2011-06-14T19:31:00.000
1
1
0
0
python,passwords,smtp,hardcoded
6,349,407
3
true
0
0
I bet that best way will be to keep password encrypted, algo is your choice. Then when user give you credentials you check if it match stored encrypted data and then send it. This will take off the step you have to keep plaintext password in any file/database. Anyway you didn't say if you realy need to keep password pl...
3
2
0
i wanna know if it is possible not to hard code my user name and password in a script that copy a file in the operation system and send it via smtp [gmail] Thank you!
There is a way not to hard code username & pass when sending mail [python]
1.2
0
0
1,677
6,348,988
2011-06-14T19:31:00.000
1
1
0
0
python,passwords,smtp,hardcoded
6,349,055
3
false
0
0
make the script take the username as command line args. if you import sys, then sys.argv is the list of all command line args, where the first is the name of the python script itself.
3
2
0
i wanna know if it is possible not to hard code my user name and password in a script that copy a file in the operation system and send it via smtp [gmail] Thank you!
There is a way not to hard code username & pass when sending mail [python]
0.066568
0
0
1,677
6,351,765
2011-06-15T00:38:00.000
0
1
0
0
python,ruby,perl,templates,programming-languages
6,351,798
4
false
1
0
Virtually anything that allows procedural code to compute the template result.
1
5
0
What template engines / template languages are turing complete? I heard about these so far: FreeMarker (implemented in java) MovableTypes template language (in perl) xslt :-( Cheetah (in Python) Smarty (in PHP) Any others (especially implemented with perl)? Ps: Don't waste time with clarifying me MVC, and why turing ...
Turing complete template engines
0
0
0
630
6,352,644
2011-06-15T03:15:00.000
0
1
0
1
python
6,353,057
2
false
0
0
You can use CookieJar.add_cookie_header to add your cookie to a http request header.
1
0
0
I wish to convert a bash script that's currently using "curl -b 'cookie'" into a Python script. I've looked at Pycurl, but I couldnt' find a -b equivalent. There are also urllib and urllib2, but I couldn't see an easy way to replicate the line. Any help would be great.
Python equivalent for curl -b (--cookie)
0
0
0
262
6,353,957
2011-06-15T06:37:00.000
2
0
0
1
python,shell
6,354,008
5
false
0
0
Have you thought about using "set -e" if you can depend on the exit status of the programs you're running?
2
1
0
I'm starting to get sick of shell scripts to perform automations and glue codes between stuff. I love using it for quick and dirty data processing, but even for simple 3 line code that spawns a process and remembers its process id, it's taking me very long time to program it correctly. For every commands, if I don't e...
Shell script replacement?
0.07983
0
0
509
6,353,957
2011-06-15T06:37:00.000
1
0
0
1
python,shell
6,354,023
5
false
0
0
What is the question? I don't think many would consider Python 'verbose'. It is brought up often to show how a language can NOT be verbose compared to, say, Java. By the way, Perl, syntactically and historically, can be placed between shell-scripting and Python, I think.
2
1
0
I'm starting to get sick of shell scripts to perform automations and glue codes between stuff. I love using it for quick and dirty data processing, but even for simple 3 line code that spawns a process and remembers its process id, it's taking me very long time to program it correctly. For every commands, if I don't e...
Shell script replacement?
0.039979
0
0
509
6,355,449
2011-06-15T09:09:00.000
1
0
0
0
python,django,string
6,355,486
1
true
1
0
The most flexible way - is to create custom template filter. If string needs formatting, it will do that, if it doesn't - just output it.
1
1
0
I have a question list for a questionnaire which are stored in database but some questions has to be modified by certain parameters. For example, if someone selects an employer name from previous page, some questions should have employer's name "Do you like to work for ........ company ?". One solution might be savinf ...
Formatting strings with python in django
1.2
0
0
170
6,356,190
2011-06-15T10:15:00.000
0
0
0
1
python,pygtk,glade
6,441,716
1
true
0
1
I searched GTK API and I found that GTK TreeView does what I want.
1
0
0
I am trying to make a file manager in python that looks like GNOME default file manager (nautilus) Because I am developing a FilePane plugin for a python written text editor. I don't know if there is a widget to give me the same look of Nautilus. If not, what widgets can I use to get a nice looking file manager?
PyGTK Glade File Manager
1.2
0
0
622
6,357,737
2011-06-15T12:34:00.000
17
0
0
1
python,soap,concurrency,twisted,celery
6,359,524
2
true
0
0
Is either Celery or Twisted a more generally appropriate framework here? Depends on what you mean by "generally appropriate". If they'll both solve the problem adequately, are there pros/cons to using one vs the other? Not an exhaustive list. Celery Pros: Ready-made distributed task queue, with rate-limiting, re-tr...
1
29
0
I'm writing a Python application that needs both concurrency and asynchronicity. I've had a few recommendations each for Twisted and Celery, but I'm having trouble determining which is the better choice for this application (I have no experience with either). The application (which is not a web app) primarily centers ...
Twisted or Celery? Which is right for my application with lots of SOAP calls?
1.2
0
0
5,662
6,358,335
2011-06-15T13:22:00.000
1
0
1
0
python,django,performance,dictionary
6,358,531
5
false
0
0
To add another aspect: for very small dictionaries and heavy timing constraints, the time to compute hashes might be a substancial fraction of the overall time. Therefore, for (say) 5 elements, it might be faster to use an array and a sequential search (of course, wrapped up into some MiniDictionary object), maybe even...
2
8
0
I'm going to have 1 small dictionary (between 5 and 20 keys) that will be referenced up to a hundred times or so for one page load in python 2.5. I'm starting to name the keys which it will be looking up and I was wondering if there is a key naming convention I could follow to help dict lookup times.
Naming dict keys for fast lookup in python
0.039979
0
0
1,968
6,358,335
2011-06-15T13:22:00.000
0
0
1
0
python,django,performance,dictionary
6,358,473
5
false
0
0
Python dictionaries have a fast path for string keys, so use these (rather than, say, tuples). The hash value of a string is cached in that string, so it's more important that the strings remain the same ones than their actual value; string constants (i.e., strings that appear verbatim in the program and are not the re...
2
8
0
I'm going to have 1 small dictionary (between 5 and 20 keys) that will be referenced up to a hundred times or so for one page load in python 2.5. I'm starting to name the keys which it will be looking up and I was wondering if there is a key naming convention I could follow to help dict lookup times.
Naming dict keys for fast lookup in python
0
0
0
1,968
6,359,581
2011-06-15T14:44:00.000
1
1
0
0
python,views,plone
6,360,580
1
true
1
0
Just import it and call it as any other function. You don't want to make it a view - that requires you to do a MultiAdapter lookup which is a real pain, and completely unnecessary. [Edit - strictly using a view is a MultiAdapter lookup, but you can shortcut it via traversal, but that still isn't worth the effort]
1
0
0
I have a Python function registered as a View in Plone. I need to be able to call another function from within this registered function. I'm not sure if it would be best to register this other function as a view as well and try to call that (don't know how to call other views), or if there is a better way to handle t...
Python Plone views call others
1.2
0
0
327
6,362,228
2011-06-15T18:06:00.000
3
0
0
0
python,wxpython
6,362,267
3
false
0
1
Look at Grid or ListCtrl to create the columns. I think Grid is a better choice for editing as you can add TextCtrls or the like to the columns.
2
1
0
I want to have a table like display on one of panels where the user can fill in data into pre-made columns. I'm not sure what widget will give me this functionality. I want users to be able to edit elements they have already added, and to easily add another element. Any suggestions?
Looking for a wxpython widget that would let user's fill in data like they would in a table
0.197375
0
0
94
6,362,228
2011-06-15T18:06:00.000
0
0
0
0
python,wxpython
6,383,556
3
false
0
1
Try ListCtrl with TextEditMixin - it's pretty neat and offers keyboard navigation to move between cells.
2
1
0
I want to have a table like display on one of panels where the user can fill in data into pre-made columns. I'm not sure what widget will give me this functionality. I want users to be able to edit elements they have already added, and to easily add another element. Any suggestions?
Looking for a wxpython widget that would let user's fill in data like they would in a table
0
0
0
94
6,363,111
2011-06-15T19:24:00.000
1
0
1
0
python,curl,concurrency,download,urllib2
6,363,541
1
true
0
0
It's not fancy, but you can use urllib.urlretrieve, and a pool of threads or processes running it. Because they're waiting on network IO, you can get multiple threads running concurrently - stick the URLs and destination filenames in a Queue.Queue, and have each thread suck them up. If you use multiprocessing, it's eve...
1
0
0
I'm trying to download multiple images concurrently using Python over the internet, and I've looked at several option but none of them seem satisfactory. I've considered pyCurl, but don't really understand the example code, and it seems to be way overkill for a task as simple as this. urlgrabber seems to be a good choi...
Downloading images from multiple websites concurrently using Python
1.2
0
1
500
6,364,430
2011-06-15T21:10:00.000
6
1
1
0
python,perl
6,368,606
2
false
0
0
Perl strings definitely are not immutable. Each string has a buffer, the initial offset of the string in the buffer, the length of buffer, and the amount of the buffer used. Additionally, for utf8 strings, the character length is cached when it needs to be calculated. At one point, there was some caching of addition...
1
12
0
I've been wondering lately how various operations I perform on basic types like strings and integers work in terms of performance, and I figure I could get a much better idea of this if I knew how those basic types were implemented (i.e. I've heard strings and integers are immutable in Python. Does that mean any operat...
How are basic data types (strings and integers) implemented in Python and Perl
1
0
0
1,412
6,364,688
2011-06-15T21:35:00.000
0
0
1
0
python,regex
7,301,378
5
false
0
0
If the string is multiline and always in the same order (SID, LSID, Auth), you can use this: wantedresult = originalstring.strip().split('\n')[-1].split('=')[-1] strip is necessary to remove the extra newline most servers include at the end of the original string.
1
3
0
I'd like to retrieve the Auth= value from the multiline string below. I've tried Python re.match with no success. Will appreciate if I can get any help? SID=DQAAALsAAABCeyCMlOaYMHkv55TUQFxA71fxE1LpgpmL1G_o8YennFwBhar2I_LNmJjGjvLHVQy8tSRfYdLnUIHhKyD0FTZBzXyG_s8U4Pt97n9hPz68ZFSM42Qv6Qxuk74TQygHJXhjLWXNuD5mMsh8_MAs-nmhST...
Use Python Re module to extract text from multiline
0
0
0
2,282
6,365,623
2011-06-15T23:28:00.000
2
0
0
0
python,numpy,scipy,fft,fftw
6,368,360
6
false
0
0
Where I work some researchers have compiled this Fortran library which setups and calls the FFTW for a particular problem. This Fortran library (module with some subroutines) expect some input data (2D lists) from my Python program. What I did was to create a little C-extension for Python wrapping the Fortran library, ...
1
31
1
What is the fastest FFT implementation in Python? It seems numpy.fft and scipy.fftpack both are based on fftpack, and not FFTW. Is fftpack as fast as FFTW? What about using multithreaded FFT, or using distributed (MPI) FFT?
Improving FFT performance in Python
0.066568
0
0
27,277
6,369,049
2011-06-16T08:26:00.000
3
0
1
0
utf-8,special-characters,python-sphinx,restructuredtext
14,228,087
4
false
1
0
I would use MathML within rst :math:`m \times p`
1
3
0
I'm writing reST documents that will be rendered to HTML and PDF using Sphinx. My source files are UTF-8, and expect my HTML to be displayed as UTF-8. What's the best practice for writing the multiplication sign? That is: ×, not x. I know I can insert it as a Unicode character. If I were writing LaTeX, I'd use \times....
How do I write the Multiplication Sign in reStructuredText (reST)?
0.148885
0
0
6,465
6,370,138
2011-06-16T10:03:00.000
0
0
1
0
python,user-interface
6,370,162
2
false
0
0
Make it return the date as a string, and then display it with your GUI toolkit.
1
0
0
I am creating SIMPLE LOG FILE UTLITY gui using python. Each time I run the program, the source file is copied to the destination file and the source file is deleted. When the utility is started I want the display to say "The Log file was last updated (date goes here)". I have created a function named modification() us...
Updating a utility to show the date last modified
0
0
0
99
6,370,335
2011-06-16T10:21:00.000
1
0
0
1
python,image,api,google-app-engine,timeout
6,373,752
1
true
1
0
If you directly use the App Engine URLfetch API, you can adjust the timeout for your request. The default is 5 seconds, and it can be increased to 10 seconds for normal handlers, or to 10 minutes for fetches within task queue tasks or cron jobs. If the external API is going to take more than 10 seconds to respond, prob...
1
1
0
I'm building an application in Python on App Engine. My application receives images as email attachments. When an email comes in, I grab the image and need to send it to a third party API. The first thing I did was: 1) make a POST request to the third party API with the image data I stopped this method because I had so...
App Engine TimeOut Error: Serving a third-party API with an image stored on App Engine
1.2
0
0
494
6,370,804
2011-06-16T11:08:00.000
3
0
0
0
python,gtk,icons,status
6,477,243
1
true
0
1
You can't. Gtk+ itself doesn't even know if it was single or double clicked. From the Gtk+ documentation about the ::activate signal: Gets emitted when the user activates the status icon. If and how status icons can activated is platform-dependent. Interestingly Qt knows about this (it has Trigger and DoubleClick). M...
1
3
0
I'm using python GTK under Gnome (Gnome 3 in Fedora 15). I'd like to catch events when the user double clic on the icon in the tray area. I found that "activate" signals is called when the user do a single clic, but can't find the signal or a proper way to call a method when the user double clic on it. How can I do ? T...
gtk.StatusIcon with double click
1.2
0
0
477
6,371,060
2011-06-16T11:27:00.000
7
0
1
1
python,linux,keyboardinterrupt
6,371,096
1
true
0
0
It's still CtrlC. Or you could send a SIGINT to the process.
1
1
0
I'm using red hat 5 linux, and I would like to know what key combination raises a KeyboardInterrupt exception in python 2.6. I know that it is Ctrl+ c under windows. Regards,
Python KeyboardInterrupt button
1.2
0
0
796
6,371,097
2011-06-16T11:30:00.000
2
1
0
0
python,cgi
6,371,127
2
true
0
0
Definitely the wrong tool. Multiple times. Store the file outside of the document root. Store a key to the file in the user's session. Use a web framework. Use WSGI.
2
1
0
I have a web page that uses a Python cgi script to store requested information for later retrieval by me. As an example, the web page has a text box that asks "What is your name?" When the user inputs his name and hits the submit button, the web page calls the Python cgi script which writes the user's name to mytextfil...
Python CGI how to save requested information securely?
1.2
0
1
104
6,371,097
2011-06-16T11:30:00.000
0
1
0
0
python,cgi
6,371,124
2
false
0
0
Store it outside the document root.
2
1
0
I have a web page that uses a Python cgi script to store requested information for later retrieval by me. As an example, the web page has a text box that asks "What is your name?" When the user inputs his name and hits the submit button, the web page calls the Python cgi script which writes the user's name to mytextfil...
Python CGI how to save requested information securely?
0
0
1
104
6,372,453
2011-06-16T13:12:00.000
5
0
1
0
python
6,372,488
3
true
0
0
Not only would they still need the Python interpreter, but the compiled python byte-code files are not guaranteed to work across different platforms.
1
4
0
I want to add Python as a scripting language to my game. If instead of distributing PY script, I distribute the PYC compiled files with my game, will the user still need Python installed, or will the DLL be sufficient?
Do I need Python installed if I have PYC files?
1.2
0
0
1,300
6,372,616
2011-06-16T13:25:00.000
3
0
1
0
python
6,372,700
3
false
0
0
Search top to bottom in each column for contiguous sets of characters then search left to right in each row for the same. Its going to be O(n^2) but I don't think you'll be able to get much better.
1
3
0
Any idea whats a simple and fast way to get all words placed on a Scrabble board while the board is represented by 2D Array of chars? Thanks in advance
Find all words placed on a Scrabble board
0.197375
0
0
1,213
6,373,779
2011-06-16T14:43:00.000
4
1
0
0
python,command,linkedin
6,393,078
2
true
0
0
The Member to Member API will return a 2xx status code if your message is accepted by LinkedIn. And a 4xx status code if there's an error. This means the message was put into the LinkedIn system, not that it has been opened, read, emailed, etc. You cannot get that via the API.
1
0
0
I want to access my linkedin account from command prompt and then i wanted to send mails from my account using command. Also, I need the delivery reports of the mails. Can anyone knows how can use that?
How to access linkedin from python command
1.2
0
1
1,130
6,374,899
2011-06-16T16:00:00.000
6
0
0
0
python,django,django-syncdb
6,374,988
3
false
1
0
2 steps: Take a dump from an existing database containing all the required data using the command dumpdata After syncdb, load the fixture using the command loaddata
1
4
0
I create a site in Django and here is my Question How to make something like this: On init (for example, when someone run "syncdb"?) I need to create a group with permissions and extend superuser profile from User to UserProfile(when user register it's not a problem but first admin/superuser is autocreated when app is ...
Django create groups on init, extending superuser profile
1
0
0
2,720