Q_Id
int64
2.93k
49.7M
CreationDate
stringlengths
23
23
Users Score
int64
-10
437
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
DISCREPANCY
int64
0
1
Tags
stringlengths
6
90
ERRORS
int64
0
1
A_Id
int64
2.98k
72.5M
API_CHANGE
int64
0
1
AnswerCount
int64
1
42
REVIEW
int64
0
1
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
15
5.1k
Available Count
int64
1
17
Q_Score
int64
0
3.67k
Data Science and Machine Learning
int64
0
1
DOCUMENTATION
int64
0
1
Question
stringlengths
25
6.53k
Title
stringlengths
11
148
CONCEPTUAL
int64
0
1
Score
float64
-1
1.2
API_USAGE
int64
1
1
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
15
3.72M
5,350,599
2011-03-18T10:21:00.000
0
0
0
0
0
python,mongodb,pymongo
0
5,377,084
0
3
0
false
0
0
You can simply get config databasr and execute find() on shards collection just like normal collection.
1
0
0
0
I have a Webserver running in Python. He is getting some Data from some Apps and need to store these in MongoDB. My MongoDB is sharded. Now i want that my Webserver know how much Shards MongoDB has. At the moment he reads this from a cfg file. There is an Statement in MongoDb named printshardingstatus where u can see ...
Execute MongoDb Statements in Python
1
0
1
1
0
1,576
5,351,250
2011-03-18T11:23:00.000
0
0
0
0
1
python,web-services,soap,soaplib
0
5,389,161
0
1
0
true
1
0
a bit ugly, but looks like it works: if '' != length: body = input.read(int(length)) elif req_env.get("HTTP_TRANSFER_ENCODING").lower() == 'chunked': chunk_size = int(input.readline(), 16) while chunk_size > 0: chunk_read_size...
1
0
0
0
I have soap webservice built with soaplib, but if client sent chunked request it fails on length = req_env.get("CONTENT_LENGTH") body = input.read(int(length)) because length is '' (empty string), any ideas how to fix soaplib?
fix soaplib to support chunked requests
0
1.2
1
0
1
279
5,360,050
2011-03-19T04:22:00.000
2
0
0
1
0
python,linux,asynchronous,multiprocessing,gevent
0
6,671,124
0
2
1
false
0
0
I'd consider custom socket IPC or using ZeroMQ.
1
2
0
0
Scenario I have a server process implemented in Python and gevent, which is connecting to a backend service over TCP/IP and serving many Web clients (~1000 per process) with fast changing dynamic content based on the changes delivered by the backend service. The service is running on Ubuntu 10.04 and won't run on Windo...
What is the best way to implement a pool of worker processes compatible with gevent?
0
0.197375
1
0
0
1,761
5,370,778
2011-03-20T19:12:00.000
0
0
0
0
1
python,tcp,network-programming
0
5,370,827
0
2
0
false
0
0
In a thread that "serves" client use some global count that is increased when client connects and decreased when disconnects. If you want to count from OS level then use nestat -an with proper grep filter and wc -l (on Windows uses ports of grep and wc)
1
4
0
0
I'm using Pythons SocketServer.ThreadingTCPServer. Now I want to know how many clients are connected at a certain moment. How to solve this?
How to count connected clients in TCPServer?
0
0
1
0
1
4,268
5,371,632
2011-03-20T21:27:00.000
1
1
1
0
0
python,encoding,wxpython
0
5,371,727
0
3
0
true
0
0
If you want a really simply version, use python's base64 module. The file won't be recognizable opening in notepad anymore, but it'll be easy to decode if you know what you are doing. If you actually want to prevent any other program from being able to encode it: don't. You can spend a lot of effort and the only thing ...
1
0
0
0
This one is a little tricky to explain. I would like to create a file, lets say, a .test file. Now, this is ridiculously easy to create and write, but I would like to encode the information so I could only interpret the information with the Test Program. So, this Test Program would be able to create and read the .test ...
Encoding a file
0
1.2
1
0
0
165
5,371,808
2011-03-20T21:59:00.000
0
0
0
0
0
python,windows,internet-explorer,automation,pamie
0
5,372,020
0
1
0
false
0
0
It is ie.listBoxSelect, using the source code as documentation.
1
0
0
0
How do I interact with a select box using PAMIE?
how to interact with a `select` input with PAMIE?
0
0
1
0
0
132
5,377,347
2011-03-21T12:07:00.000
0
0
0
0
0
python,stocks
0
5,377,789
0
2
0
false
0
0
You could think about using a method that calculates the concave hull of your data. There are probably existing python implementations you could find. This will give you the boundary that encloses your timeseries. If there are outliers in your dataset that you wish to exclude, you could apply some sort of filter or smo...
1
0
1
0
I have read the topic: How do I calculate a trendline for a graph? What I am looking for though is how to find the line that touches the outer extreme points of a graph. The intended use is calculation of support, resistance lines for stock charts. So it is not a merely simple regression but it should also limit the n...
how to calculate trendline for stock charts
0
0
1
0
0
2,927
5,381,208
2011-03-21T17:17:00.000
2
0
0
0
0
python,flask
0
5,381,900
0
5
0
false
1
0
I can't see how there could be any way of stopping this from working. Flask and Bottle, like Django, are just Python underneath, and Python allows you to break up files into modules. As long as you importing the relevant functions into the main script, they will just work exactly as if they were defined there.
2
11
0
0
I've been looking into microframeworks for Python, and have come across two interesting options, Flask and Bottle. each have some similar features. One thing I noticed is that all the example sites show all the application code located inside a single Python file. Obviously, for even moderately sized sites, this would ...
Flask/Bottle project organization
0
0.07983
1
0
0
7,590
5,381,208
2011-03-21T17:17:00.000
0
0
0
0
0
python,flask
0
26,026,153
0
5
0
false
1
0
It really depends what you are trying to achieve, for micro service/applications/websites bottle is very straight forward and light weight. If you plan your application to grow by the time then Flask might be good option for you coz it has lot of extensions. We have about 40 to 50 micro services written in bottle and n...
2
11
0
0
I've been looking into microframeworks for Python, and have come across two interesting options, Flask and Bottle. each have some similar features. One thing I noticed is that all the example sites show all the application code located inside a single Python file. Obviously, for even moderately sized sites, this would ...
Flask/Bottle project organization
0
0
1
0
0
7,590
5,382,305
2011-03-21T19:00:00.000
0
1
0
0
0
python,gstreamer
0
8,164,493
0
1
0
false
0
0
If you're creating a source element, you probably want to subclass gst.BaseSrc. Then, IIRC, the main thing you need to do is implement the do_create() virtual method. Don't forget to gobject.type_register() your class; you may also need to set the time format using set_format(). I second the recommendation to look at t...
1
0
0
0
i have quite a lot of experience with python and gst-python, but no experience with plain gstreamer. does anyone know (well, someone on earth probably does but...) how to create a custom element? i got as far as class MyElement(Element): by intuition, but i have no idea what next... simply what i was hoping for was a "...
How to make a custom element im gst-python
0
0
1
0
1
1,272
5,387,895
2011-03-22T07:09:00.000
2
0
1
0
0
python,character-encoding
1
58,780,738
0
7
0
false
0
0
I had exactly this issue in a recent project which really is a pain in the rear. I finally found it's because the Python we used in Docker has encoding "ansi_x3.4-1968" instead of "utf-8". So if anyone out there using Docker and got this error, following these steps may thoroughly solve your problem. create a file and...
2
78
0
0
I am parsing an XSL file using xlrd. Most of the things are working fine. I have a dictionary where keys are strings and values are lists of strings. All the keys and values are Unicode. I can print most of the keys and values using str() method. But some values have the Unicode character \u2013 for which I get the abo...
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 3 2: ordinal not in range(128)
0
0.057081
1
0
0
137,788
5,387,895
2011-03-22T07:09:00.000
0
0
1
0
0
python,character-encoding
1
47,410,460
0
7
0
false
0
0
for me this works unicode(data).encode('utf-8')
2
78
0
0
I am parsing an XSL file using xlrd. Most of the things are working fine. I have a dictionary where keys are strings and values are lists of strings. All the keys and values are Unicode. I can print most of the keys and values using str() method. But some values have the Unicode character \u2013 for which I get the abo...
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 3 2: ordinal not in range(128)
0
0
1
0
0
137,788
5,393,185
2011-03-22T14:58:00.000
-1
0
0
0
0
python,window,pygtk,gtk
0
5,441,492
0
4
0
false
0
1
You can also use gtk.Dialog.run (if it's a Dialog) aditional to gtk.Window.present
1
3
0
0
I have a gtk.Window. How do I set it to be the active window? I can call is_active() to see whether it already is, but I don't see where to make it active. Bonus points: given a gtk.Widget, how do I make the window it is a part of the active window?
gtk: set active window
0
-0.049958
1
0
0
4,336
5,397,528
2011-03-22T20:37:00.000
0
0
0
0
0
python,django,mercurial,apache2,mod-python
0
5,397,870
0
1
0
true
1
0
I thought about this, good idea for development. Use mercurial in common way. And of course you need deploy mercurial server before. If you update your django project, it will be compiled on the fly. My workflow: Set up mercurial server or use bitbucket Init repo locally Push repo to central repo On server pull repo...
1
0
0
0
I'm creating a server with Apache2 + mod_python + Django for development and would like to know how to use Mercurial to manage application development. My idea is to make the folder where the Mercurial stores the project be the same folder to deploy Django. Thank you for your attention!
How to use Mercurial to deploy Django applications?
0
1.2
1
1
0
627
5,402,847
2011-03-23T09:02:00.000
0
0
0
0
0
python,django
0
5,403,151
0
2
0
true
1
0
Django doesn't really offer you place where things that are commonly used all over the project can live. I think the most common approach to solve this is to create a 'project'-app, which holds such project-relevant things like models, templatetags or widgets for example...
2
0
0
0
I'm trying to start with Django. I'm developing an App. This App is called "Directory" and will store info about websites. I must to create a database table called "Genders", but this is a generic database table and could be used in other App. My question... how to deal with this kind of situation in Django? And in wic...
Where to put generic Database Tables on Django?
0
1.2
1
0
0
208
5,402,847
2011-03-23T09:02:00.000
1
0
0
0
0
python,django
0
5,403,490
0
2
0
false
1
0
In django, you don't (generally) create database tables. You create models, and let the django ORM create tables for you. To prevent having two tables in your database called gender, django will prefix the model name with the name of the app. Thus, if your app was called foo, your model class was Gender, you would have...
2
0
0
0
I'm trying to start with Django. I'm developing an App. This App is called "Directory" and will store info about websites. I must to create a database table called "Genders", but this is a generic database table and could be used in other App. My question... how to deal with this kind of situation in Django? And in wic...
Where to put generic Database Tables on Django?
0
0.099668
1
0
0
208
5,407,664
2011-03-23T15:30:00.000
0
0
1
0
0
python,netbeans,ide,tabstop
0
5,512,865
0
1
0
true
0
0
...Netbeans want to switch from spaces to tabs, not the other way around... ergh – Rafe Kettler Mar 23 at 15:36 I use netbeans meanwhile and like it. Yes I converted all spaces to tabs and retab it to 4 in php and python regards
1
0
0
0
For a python project I am trying an IDE, coming from vim but I have troube how my code is shown resp. indentation. Many lines should be indented because they are inside if-then-else statements. In SPE and netbeans there are many lines where the indention-space (four) are collapsed. But I checked the files with tabnan...
Tab/spaces indention issues in IDE's vs vim
0
1.2
1
0
0
310
5,415,600
2011-03-24T06:37:00.000
7
0
0
0
0
python,django
0
29,631,137
0
3
0
false
1
0
Most the time, loading the page in a new tab can be a real pain in the ar** for the user. Nevertheless it can still be necessary sometimes. If you really need to render your POST results in a new tab, use the target="_blank" as an attribute of your <form>.
1
13
0
0
i have to open the result page using render_to_response on a new tab
how to open url in new tab from django?
0
1
1
0
0
28,137
5,427,875
2011-03-25T02:21:00.000
2
0
0
0
0
python,macos,tkinter,exit
0
5,427,950
0
1
0
false
0
1
I figured out how. I just put a simple exit() command after the main loop.
1
2
0
0
I need to know how to do this on a mac because whenever I try quitting it, I have to force quit it. Is there a proper way when the user clicks the exit button that Tkinter will exit normally?
Python: How can I make my tkinter app exit properly?
0
0.379949
1
0
0
888
5,436,185
2011-03-25T17:49:00.000
2
0
0
0
0
python,url,ipv6,libpcap,sniffing
0
5,446,765
0
1
0
true
0
0
Unfortunately, with IPv6 you are stuck doing your own TCP re-assembly. The good news that you are only concerned with URL data which should (generally) be in one or two packets. You should be able to get away with using pylibpcap to do this. You'll want to use setfilter on your pcap object to make sure you are only lo...
1
5
0
0
Does anyone know how to write a live data sniffer in Python which extracts the originating IP address and the full URL that was being accessed? I have looked at pulling data from urlsnarf however IPv6 is not supported (and the connections will be to IPv6 hosts). While I can pull data from tcpdump and greping for GET/PO...
URL Sniffing in Python
0
1.2
1
0
1
1,843
5,445,994
2011-03-26T23:07:00.000
6
0
0
0
0
python,regex,django
0
5,446,040
0
4
0
false
1
0
Don't ever send passwords in the URL. They belong in the POST body, which is not stored by browsers (you can repeat POSTs in browsers, but POST data is not stored in the history).
1
0
0
0
I want to match a url that: begins with /signup and ends with password=goodbye That's it. If something begins with that and ends with that, how do I match that in regex? I understand that I should do this in urls.py, but I have to because of certain reasons. Please answer how I would match it this way. I have to becaus...
How do I match this URL in Django's urls.py?
0
1
1
0
0
1,876
5,447,482
2011-03-27T05:42:00.000
0
1
1
0
0
php,python,debugging
0
5,447,505
0
5
0
false
0
0
Python has a debugger: pdb. If you use Werkzeug, then you can also access each frame of a stack trace and debug there on an error
3
0
0
0
I am quite new with development. In some programming language such as python and PHP there is not a good debugger. How is the development going on without a debugger? just put the logs in the source code? Especially for the framework developers, how do they test their codes? Thank you very much. -Stefan-
How a framework development works without a debugger?
0
0
1
0
0
94
5,447,482
2011-03-27T05:42:00.000
2
1
1
0
0
php,python,debugging
0
5,447,522
0
5
0
false
0
0
Your answer concerning the debugging in Python is truly nonsense. Python has a reasonable "pdb" debugger which is useful since years. Apart from that you can have a powerful IDE as WingIDE giving you all debugging and inspection power you need. Making such wild claims about Python is not appropriate. That's why this qu...
3
0
0
0
I am quite new with development. In some programming language such as python and PHP there is not a good debugger. How is the development going on without a debugger? just put the logs in the source code? Especially for the framework developers, how do they test their codes? Thank you very much. -Stefan-
How a framework development works without a debugger?
0
0.07983
1
0
0
94
5,447,482
2011-03-27T05:42:00.000
0
1
1
0
0
php,python,debugging
0
5,452,043
0
5
0
false
0
0
python -m pdb foo.py And even without using that, usually you get detailed tracebacks when an error happens so many people don't know about pdb because they can just read the error message containing everything they ever wanted to know. It's not like C where it just goes boom and says "Segmentation fault" and leaves yo...
3
0
0
0
I am quite new with development. In some programming language such as python and PHP there is not a good debugger. How is the development going on without a debugger? just put the logs in the source code? Especially for the framework developers, how do they test their codes? Thank you very much. -Stefan-
How a framework development works without a debugger?
0
0
1
0
0
94
5,448,698
2011-03-27T10:38:00.000
6
0
0
1
0
python,google-app-engine,sendmail
0
5,450,093
0
1
0
true
1
0
You can't. Sending email from someone without their knowledge isn't permitted by App Engine. You can send email from any administrator address; you could add a "donotreply@yourapp.com" type address as an administrator and send email from that address.
1
3
0
0
I'm using GAE send mail- but I dont want the sender of the mail to get a coppy of the mail. as for now, when a user is sending mail he gets a mail saying that he sent a mail to someone and the body of the sent mail, how do I disable that?
how to have google apps engine send mail- not send a copy of the mail to the sender
0
1.2
1
0
0
288
5,449,091
2011-03-27T12:05:00.000
0
1
0
0
0
python,twitter
0
16,450,651
0
4
0
false
0
0
The newest version of python-twitter allows you to retweet with the command api.PostRetweet(tweet_id) where api is a logged-in api and tweet_id is the id of the tweet you want to retweet.
1
4
0
0
I wanted to know if this was possible- I want to use Python to retweet every tweet a person sends out. If yes then how can I implement this?
Sending out twitter retweets with Python
1
0
1
0
1
4,449
5,453,256
2011-03-27T23:36:00.000
0
0
0
0
0
python,tkinter,pyusb
0
5,489,197
0
2
0
false
0
1
Might I suggest that instead of trying to constantly monitor the presence of a USB device you include a search or refresh button that will check just once.
1
2
0
0
I would like to monitor the presence of USB devices and have found modules such as PyUSB that serve this purpose. However, I don't know how to run USB detection services alongside the Tkinter main loop. Is this possible?
Tkinter and detection of USB devices
0
0
1
0
0
874
5,473,301
2011-03-29T13:29:00.000
0
0
1
0
0
python,format,xls
0
5,473,492
0
4
0
false
0
0
If the available tools like xlrd, xlwt, and xlutils don't work, you may have to fall back to programmatically editing the file with Excel via COM. Of course, you'll need a copy of Excel, have to work from Windows, and it will be slower than other approaches.
1
2
0
0
Is there a way to write something into an XLS file with python while keeping the initial format of this XLS file unchanged (such as font size, cell background color, etc)Thanks!
how to write into XLS with python with format unchanged?
0
0
1
0
0
763
5,473,340
2011-03-29T13:31:00.000
3
0
0
0
0
python,django,django-models,django-templates,captcha
0
5,473,845
0
4
0
false
1
0
Your question about which 3rd party solution is "better" is subjective, and stackoverflow doesn't generally like to answer subjective questions. Take some time and evaluate each in light of your needs. You often don't need a fancy image captcha. Even a simple question like "what color is an orange?" will stop most spam...
1
0
0
0
I am a Django newbie. I created an app which has a user login/registration page. Now I want to include CAPTCHA also in the registration page. Can somebody guide me how to implement this in Django as i am quite new to it. On googling I found there are many modules which do the function out of the box. If this is the way...
Including CAPTCHA on user registration page with Django
0
0.148885
1
0
0
2,880
5,479,387
2011-03-29T21:52:00.000
-1
0
0
1
1
python,perl,iis,iis-7,cgi
1
5,479,573
0
3
0
false
1
0
the windows TCP stack is limited to 4GB file uploads. Anymore than that is not possible.
2
1
0
0
We need to handle massive file uploads without spending resources on an IIS 7 server. To emphasize how light-weight this needs to be, let's say that we need to handle file uploads of sizes that are completely insane, like 100GB uploads, or something that can continue running for an extremely long time without consuming...
Need CGI (or another solution compatible with IIS 7) to handle *massive* uploads
0
-0.066568
1
0
0
300
5,479,387
2011-03-29T21:52:00.000
3
0
0
1
1
python,perl,iis,iis-7,cgi
1
5,483,933
0
3
0
false
1
0
You want WebDAV, not CGI. It provides all the nice bits that make file transfers not suck, like resuming and pausing.
2
1
0
0
We need to handle massive file uploads without spending resources on an IIS 7 server. To emphasize how light-weight this needs to be, let's say that we need to handle file uploads of sizes that are completely insane, like 100GB uploads, or something that can continue running for an extremely long time without consuming...
Need CGI (or another solution compatible with IIS 7) to handle *massive* uploads
0
0.197375
1
0
0
300
5,479,897
2011-03-29T22:56:00.000
1
0
1
0
0
python
0
5,479,995
0
3
0
false
0
0
You need to use the os.path library. If you start off with directory d then os.path.abspath(os.path.join(d, '..')) will return that directory's parent. You do this until you get to /mnt, for each directory running chown on it.
1
1
0
0
Folks, Might find this on searching, but need this rather quickly done: I have the path like this: /mnt/path1/path2/path3/ I need to chown all the directories such as /mnt, /mnt/path1, /mnt/path1/path2, /mnt/path1/path2/path3, how to get this done in python? I cannot do 'chown -R /mnt/' since it tries to chown all the ...
Python: How to do this string manipulation
0
0.066568
1
0
0
292
5,484,900
2011-03-30T10:09:00.000
3
0
0
1
1
python,google-app-engine,local-storage
0
5,486,121
0
2
0
true
1
0
How the datastore reads and writes its underlying files varies - the standard datastore is read on startup, and written progressively, journal-style, as the app modifies data. The SQLite backend uses a SQLite database. You shouldn't have to care, though - neither backend is designed for robustness in the face of failur...
1
0
0
0
I have just noticed that when I have a running instance of my GAE application, there nothing happens with the datastore file when I add or remove entries using Python code or in admin console. I can even remove the file and still have all data safe and sound in admin area and accessible from code. But when I restart my...
Does local GAE read and write to a local datastore file on the hard drive while it's running?
0
1.2
1
0
0
196
5,491,851
2011-03-30T20:19:00.000
4
0
1
0
0
python,couchdb
0
5,498,961
0
1
0
true
0
0
I just added show/list support to couchdb-python. Any problems, please use the mailing list.
1
2
0
0
The python-couchdb package ( used as import couchdb ) provides a db.view() function to access a couchdb "_view", but how do you access a "_show" or "_list" function?
CouchDB and Python: how to use "_show" and "_list" functions?
0
1.2
1
0
0
429
5,498,704
2011-03-31T10:54:00.000
0
0
1
1
0
python,file-management
0
5,631,968
0
2
0
true
0
0
It is impossible, OS does not store such info about files. Answered by 'atzz' in comment
1
0
0
0
lets say that some files were renamed by Python script, is it possible to get this 'rename time' using Python (It can be seen in Far Manager)? (Windows) It seems it is not possible through STAT, etc Any ideas ?
python file was renamed, how to get 'rename time'
1
1.2
1
0
0
239
5,502,787
2011-03-31T16:01:00.000
2
0
1
0
0
c++,python,c,connection,io
0
5,502,815
0
3
0
true
0
0
Yes. Open the first file in Python, process it and save the results to a second file. Then open the second file in your C or C++ program and use the data.
1
3
0
0
What I am trying to do is that I want to read a file using python, and then with the data in the file, create a variable in c/c++(I don't want to read var from the file :) ). Is this possible? If this is possible, then how would you do it? Thank you guys!
connecting c/c++ and python
1
1.2
1
0
0
5,001
5,514,330
2011-04-01T13:51:00.000
2
0
1
0
0
python
0
5,514,359
0
4
0
false
0
0
Google for python decorator and you will find enough answers to your question.
1
1
0
0
Just a quick question, Could someone link me to the documentation for the use of @ in python? Due not being able to google @ and not knowing the use or name of it I'm not sure how to find it on my own :) Many thanks!!
Python documentation for @?
0
0.099668
1
0
0
366
5,529,075
2011-04-03T10:38:00.000
3
0
1
0
0
python,large-data,database
0
5,529,194
0
3
0
false
0
0
Go with a NoSQL database like MongoDB which is much easier to handle data in such a case than having to learn SQL.
1
4
0
0
I'm working on an academic project aimed at studying people behavior. The project will be divided in three parts: A program to read the data from some remote sources, and build a local data pool with it. A program to validate this data pool, and to keep it coherent A web interface to allow people to read/manipulate ...
Handle large data pools in python
0
0.197375
1
0
0
1,451
5,538,280
2011-04-04T12:14:00.000
3
0
0
0
0
python,parsing,redirect
0
5,538,415
0
2
0
false
0
0
You can not get hold of the redirection URL through parsing the HTML source code. Redirections are triggered by the server and NOT by the client. You need to perform a HTTP request to the related URL and check the HTTP response of the server - in particular for the HTTP status code 304 (Redirection) and the new URL.
1
6
0
0
I made a little parser using HTMLparser and I would like to know where a link is redirected. I don't know how to explain this, so please look this example: On my page I have a link on the source: http://www.myweb.com?out=147, which redirects to http://www.mylink.com. I can parse http://www.myweb.com?out=147 without any...
Determining redirected URL in Python
0
0.291313
1
0
1
8,180
5,553,798
2011-04-05T14:46:00.000
3
0
1
0
0
c++,python,boost
0
5,951,300
0
2
0
false
0
0
bjam is used for compiling boost itself (although your can use it as configuration tool for your code aswell). Running the utility should compile the library and does not require any further work, afaik. The include and library paths you have listed in your second post are correct, as far as I can tell (assuming the pa...
2
4
0
0
I'm having a bit of trouble finding a guide that allows me to integrate the Boost.Python compilation into VS 8. It seems like it depends heavily on this bjam utility to build the source, but there isn't any mention of how this can integrate into VS 8 interface. I can see that the bjam program calls VS 8 to do much of ...
Integrating Boost.Python with Visual Studio 8
0
0.291313
1
0
0
1,049
5,553,798
2011-04-05T14:46:00.000
0
0
1
0
0
c++,python,boost
0
5,556,549
0
2
0
false
0
0
I found the issue, thanks for the suggestion Phillip. It turns out I just needed to provide the correct header and library directories to VS 8 and compile as a DLL (not a console program). Include Directories: \boost-python\boost_1_46_1 \Python27\include` Library Directories: \Python27\libs \boost-python\boost_1_46...
2
4
0
0
I'm having a bit of trouble finding a guide that allows me to integrate the Boost.Python compilation into VS 8. It seems like it depends heavily on this bjam utility to build the source, but there isn't any mention of how this can integrate into VS 8 interface. I can see that the bjam program calls VS 8 to do much of ...
Integrating Boost.Python with Visual Studio 8
0
0
1
0
0
1,049
5,568,330
2011-04-06T14:48:00.000
5
0
1
1
0
python,macos
0
5,568,374
0
1
0
true
0
0
You can simply type python3.2 instead of just python to use python 3.2.
1
6
0
0
Python 2.5 came installed on my Mac. I downloaded Python 3.2 and have it running in my IDE. When I open the terminal in Mac and type in Python, it tells me I'm working with 2.5. 1) What do I enter in the command line to change from 2.5 to 3.2? 2) Once I get to 3.2 (using your answer), how do I get back to 2.5 if I wa...
Changing versions of Python in command line
0
1.2
1
0
0
3,806
5,572,489
2011-04-06T20:22:00.000
1
0
0
1
0
python,pdf,printing,pygtk
0
5,572,506
0
3
0
false
0
1
Have you considered generating HTML?
1
2
0
0
I am developing an application which has to be able to print a couple of pages with Python. Now I am searching for a method to create these pages and print them. It should work on Linux and Windows. The pages contain tables, images and text. I developed the GUI with PyGtk, but I think it's convenient to create an image...
OS independent printing with Python
0
0.066568
1
0
0
2,696
5,581,005
2011-04-07T12:28:00.000
1
0
0
0
0
python,django
0
5,581,104
0
2
0
false
1
0
You can use Django Debug Toolbar and enable it only for choosen IPs
1
1
0
0
I'm supplying a Django project to a client, who has requested a 'debugging' page that will show useful information. [UPDATE for clarity: We'd like this page so we can use it for debugging in future: the clients are not very technical and I won't have direct access to their servers. In the event of future issues, it wo...
Add a debugging page to a Django project?
0
0.099668
1
0
0
94
5,581,466
2011-04-07T12:59:00.000
1
0
0
0
0
python,mysql,django,django-models,django-blob
0
5,581,586
0
3
0
true
1
0
Django's ORM has no field for binary large objects. Either use something like a FileField, or search for candidate field classes using a search engine.
1
2
0
0
I want to create a table like so - CREATE TABLE trial_xml ( id int(11) DEFAULT NULL, pid int(11) DEFAULT NULL, sid varchar(256) CHARACTER SET utf8 NOT NULL, data blob, PRIMARY KEY (soid), KEY suid_index (suid) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 my question is how do I set "data" field as "blob" in django'...
Django models "blob" field
0
1.2
1
0
0
4,606
5,587,280
2011-04-07T20:34:00.000
1
0
1
0
0
python,substitution,encryption
0
5,587,409
0
3
0
false
0
0
I would first get a list of English words for reference. Next construct a list of possible 2 and 3 letter words. Then just start testing those small words in your cipher. Once you guess at a small word, check the larger words against your word list. If some of the words no longer have possible completions in the li...
1
1
0
0
I know similar questions have been asked, but this is kind of a trivial case. Given a text file endcoded with a substitution cipher, I need to decode it using python. I am not given any examples of correctly deciphered words. The relationship is 1-to-1 and case doesn't make a difference. Also, punctuation isn't changed...
Solving a substitution cipher with python
0
0.066568
1
0
0
6,917
5,588,081
2011-04-07T21:50:00.000
0
0
0
0
0
python,django
0
5,588,180
0
1
0
true
1
0
If you are calling admin.autodiscover() in your urls.py Django's admin.site will be looking for admin.py files in all packages of your INSTALLED_APPS and import all found ModelAdmin classes and add them to the admin.site. You have three inputs for SearchKeyword appearing in the admin because the there are three InlineA...
1
0
0
0
I am reading Chapter 3 of "Practical Django Projects", on how to make a CMS. I have improved the search function and everything works fine. However I am wondering why everythings works... On page 35, I have added an admin.py file in the cms/search/ directory. How does the compiler know that he needs to take this file i...
"Practical Django Projects" - Search function
1
1.2
1
0
0
179
5,591,230
2011-04-08T06:20:00.000
-3
1
0
0
0
php,python
0
5,591,381
0
2
0
false
0
0
After some clarifications at last it came clear that your question was "how to connect PHP to HTTP server" So, actually you were interested in three letters: CGI. However I still doubt you will get any good from it.
1
1
0
0
How can I make a PHP 5.3 webserver using Python? I know how to make a simple HTTP server, but how can I include PHP? Thanks.
PHP Webserver in Python
0
-0.291313
1
0
1
1,908
5,602,488
2011-04-09T02:22:00.000
2
0
1
0
0
python,permutation,random-sample
0
5,602,512
0
6
0
false
0
0
I don't know how python implements its shuffle algorithm, but the following scales in linear time, so I don't see why a length of 10 is such a big deal (unless I misunderstand your question?): start with the list of items; go through each index in the list in turn, swapping the item at that index it for an item at a r...
2
3
1
0
How to randomly pick all the results, one by one (no repeats) from itertools.permutations(k)? Or this: how to build a generator of randomized permutations? Something like shuffle(permutations(k)). I’m using Python 2.6. Yeah, shuffle(r) could be used if r = list(permutations(k)), but such a list will take up too much t...
Random picks from permutation generator?
0
0.066568
1
0
0
4,221
5,602,488
2011-04-09T02:22:00.000
2
0
1
0
0
python,permutation,random-sample
0
5,603,207
0
6
0
false
0
0
There's no way of doing what you have asked for without writing your own version of permutations. Consider this: We have a generator object containing the result of permutations. We have written our own function to tell us the length of the generator. We then pick an entries at random between the beginning of the list...
2
3
1
0
How to randomly pick all the results, one by one (no repeats) from itertools.permutations(k)? Or this: how to build a generator of randomized permutations? Something like shuffle(permutations(k)). I’m using Python 2.6. Yeah, shuffle(r) could be used if r = list(permutations(k)), but such a list will take up too much t...
Random picks from permutation generator?
0
0.066568
1
0
0
4,221
5,612,390
2011-04-10T14:24:00.000
0
0
0
1
1
python,django,google-app-engine
0
5,612,643
0
2
0
true
1
0
Thanks Abdul you made me realize what the problem is. I had changed a URL in my application to point to the application that I had deployed to Google-App Engine. It should have been pointing to my local application. I had myapp.appspot.com/move instead of localhost/move
1
1
0
0
I'm wondering if anyone has experienced problems with Google-App Engine's logging facility. Everything was working fine for me until this morning, I ran my local server and no logging messages were being displayed (well, none of my logging messages, the server GET messages etc.. are being displayed). Even errors are no...
Google-App Engine logging problem
1
1.2
1
0
0
252
5,614,372
2011-04-10T20:07:00.000
3
1
1
0
0
python,c,encoding
0
5,614,405
0
2
0
true
0
0
C as a language does not facilitate string encoding. A C string is simply a null-terminated sequence of characters (8-bit signed integers, on most systems). A wide string (with characters of type wchar_t, typically 16-bit integers) can also be used to hold larger character values; however, again, C standard library fu...
1
0
0
0
How can i change character encoding of a string to UTF-8? I am making some execv calls to a python program but python returns the strings with the some characters cut of. I don't know if this a python issue or c issue but i thought if i can change the strings encoding in c and then pass it to python, it should do the t...
How to change a strings encoding as utf 8 in C
0
1.2
1
0
0
1,560
5,617,641
2011-04-11T06:40:00.000
2
0
1
0
0
python,fortran
1
5,618,401
0
2
0
false
0
0
Your basic problem is that you are storing large arrays of data on the stack. This is bad design and is probably due to the way the Fortran code is implemented. Large arrays need to be stored on the heap and dynamically allocated there. To solve this problem you will need to understand and modify your Fortran code acc...
1
0
0
0
I have a python code which imports dll's created by f2py (from fortran routines). Now the python program crashes if the arrays in fortran are too large. How do I manage with this? By increasing stack size? Or heap? I've tried to study the matter, but I still do not understand how I can increase the stack or should I us...
dll load error in python due to insufficient stack size?
0
0.197375
1
0
0
295
5,621,952
2011-04-11T13:20:00.000
0
0
1
1
0
macos,uninstallation,python-3.2
0
23,726,032
1
3
0
false
0
0
just uninstall 3x version of python if you have already installed it. Eclipse has that option when you click "see whats already installed". Install later 2.7 version. It works for me on my OS X 10.9.2 with Eclipse Juno.
2
10
0
0
According to the documentation from python.org, python 3.2 install on mac os requires an upgrade to tcl/tk 8.5.9 (for use of IDLE). In my haste, I have done both. Now my friend told me that python 3 is not recommended yet because only the built-ins and a few modules have been released for 3. The stable one so far is 2....
Uninstall python 3.2 on mac os x 10.6.7
0
0
1
0
0
19,603
5,621,952
2011-04-11T13:20:00.000
4
0
1
1
0
macos,uninstallation,python-3.2
0
5,627,279
1
3
0
false
0
0
I did the same (3.2 on a mac 10.6) and: -Moved both the Python 3.2 folder and the ActiveState ActiveTcl folder from the Applications Folder to the Trash. -Moved the Python.framework folder from the Library/Frameworks folder to the Trash. Running System profiler shows only the 2.6 version of Python. Marcos
2
10
0
0
According to the documentation from python.org, python 3.2 install on mac os requires an upgrade to tcl/tk 8.5.9 (for use of IDLE). In my haste, I have done both. Now my friend told me that python 3 is not recommended yet because only the built-ins and a few modules have been released for 3. The stable one so far is 2....
Uninstall python 3.2 on mac os x 10.6.7
0
0.26052
1
0
0
19,603
5,626,672
2011-04-11T19:46:00.000
0
0
0
0
1
python,django,testing,django-models,django-testing
0
5,626,840
0
1
0
true
1
0
You could try creating a whole new app that you only use on your development server. E.g., if your app is called myapp you would call your testing app myapp_test. Then in myapp_test's models.py you would from myapp import models and then subclass your models in there. Then in your settings.py you either just try and re...
1
1
0
0
Is it possible to have a set of models just for testing purposes? The idea is that I've written an app that contains some helper abstract model HelperBase. Now I'd like to provide some models that would inherit from it in order to test it, say DerivedTest1, DerivedTest2. However I wouldn't really like those test models...
Test specific models in Django
1
1.2
1
0
0
292
5,627,868
2011-04-11T21:37:00.000
1
0
0
0
1
python,django,unicode,utf-8,scrapy
0
5,628,065
0
3
0
false
1
0
U+FFFD is the replacement character that you get when you do some_bytes.decode('some-encoding', 'replace') and some substring of some_bytes can't be decoded. You have TWO of them: u'H\ufffd\ufffdftsitz' ... this indicates that the u-umlaut was represented as TWO bytes each of which failed to decode. Most likely, the si...
1
3
0
0
I'm using Scrapy and Python (as part of a Django project) to scrape a site with German content. I have libxml2 installed as the backend for Scrapy selectors. If I extract the word 'Hüftsitz' (this is how it is displayed on the site) through selectors, I get: u'H\ufffd\ufffdftsitz' (Scrapy XPath selectors return Unicod...
Unicode and UTF-8 encoding issue with Scrapy XPath selector text
1
0.066568
1
0
0
15,989
5,636,251
2011-04-12T13:47:00.000
0
1
0
0
0
python
0
5,639,270
0
1
0
false
0
0
The description for the Digi 3G states that it is capable of python scripting, using a custom development environment. To make this work, you would have to use the python source code from paramiko; the executable would not be installable directly on the router (since the executable is designed to be run on a computer,...
1
0
0
0
I'm using a Digi 3G router that can be programmed with python, and I want it to make periodic SSH connections to another device. I've read everything about paramiko, but don't know how to install it in the router. I want to know if there is any other way of including paramiko into a device, apart from installing (i.e. ...
SSH connection with python from a device (not computer)
0
0
1
0
1
202
5,660,354
2011-04-14T08:14:00.000
0
0
1
0
0
python,gtk,wxpython
1
5,660,469
0
1
0
false
0
1
Add the directory containing the library given in the error to your ld search paths. See the ldconfig(8) man page for details.
1
0
0
0
I am a relative newbie with Python and was trying to install wxPython 2.9 using Python 2.6. I did a build from source and then installed the package both being done in a non-standard (local) path. When I try and import wx (having provided the path to the installation folder in my environment variable), I get the follow...
Error while installing wxPython package in a non-standard path
0
0
1
0
0
380
5,661,385
2011-04-14T09:49:00.000
3
0
1
1
0
python
0
5,733,166
0
9
0
false
0
0
This will vary depending on your target market. In specialized niche industries there is more variety in how stuff is distributed. In heavily commoditized areas I would expect native OS package (at least if I were a customer). I tend to take the quality of the deployment package as indicative of the quality of the s...
2
37
0
0
I have the task of packaging and shipping a commercial application bundle, which will include: a python library (developed by us) some python programs depending on the library above additional libraries not developed by us, but which are dependencies of our library. a complete python installation (python 2.6) addition...
Packaging and shipping a python library and scripts, the professional way
0
0.066568
1
0
0
8,155
5,661,385
2011-04-14T09:49:00.000
15
0
1
1
0
python
0
5,731,719
0
9
0
true
0
0
This is not a complete answer but just a bunch of ideas. I wrote an installer for a client that incorporated some ideas that might be useful to you. It was Linux only so I focussed on just that. We needed to ship specific custom versions of mySQL, lighttpd, python, memcached, a few 3rd party Python modules and some cu...
2
37
0
0
I have the task of packaging and shipping a commercial application bundle, which will include: a python library (developed by us) some python programs depending on the library above additional libraries not developed by us, but which are dependencies of our library. a complete python installation (python 2.6) addition...
Packaging and shipping a python library and scripts, the professional way
0
1.2
1
0
0
8,155
5,677,809
2011-04-15T13:54:00.000
1
1
1
0
0
python,testing
0
5,677,921
0
3
0
false
0
0
Altering sys.path much in production environment may be unwise. Altering it for testing is usually OK. If you don't want to tinker with the variable from sys, use an environment variable named PYTHONPATH, it's a clean and documented way.
2
20
0
0
I'm in the process of redesigning/refactoring my Python quantum chemistry package (pyquante). One of the things I don't like about the existing release is that I have to install the package to run the test suite. That is, the test suite has statements like from PyQuante import SCF, and, of course, this PyQuante could r...
How can I test my python module without installing it
0
0.066568
1
0
0
10,868
5,677,809
2011-04-15T13:54:00.000
6
1
1
0
0
python,testing
0
5,678,267
0
3
0
false
0
0
I would honestly insist on using virtualenv, its designed for this exact reason in mind. very small overhead, and if you ever mess up just delete directory. I am sure as you grow, things won't be as simple as they are now for your current situation. Take it as an opportunity to learn.
2
20
0
0
I'm in the process of redesigning/refactoring my Python quantum chemistry package (pyquante). One of the things I don't like about the existing release is that I have to install the package to run the test suite. That is, the test suite has statements like from PyQuante import SCF, and, of course, this PyQuante could r...
How can I test my python module without installing it
0
1
1
0
0
10,868
5,679,203
2011-04-15T15:44:00.000
0
1
0
1
0
python,django,linux,fabric
0
5,680,308
0
2
0
false
0
0
You could also try any of the distributed computing packages. Pyro is one of them that might interest you.
1
1
0
0
We have around 250 identical linux server which runs a business critical web application for a bank. Basically we do a lot of scripting work but now i want to centralize that only in one location. That means run on one server and and deploy it in many. I know you guys must be thinking that this is an easy task and can ...
Python scripting in linux
1
0
1
0
0
304
5,680,487
2011-04-15T17:50:00.000
0
0
0
0
0
python,image,performance,wxpython
0
5,681,008
0
2
0
false
0
1
I would think a ListCtrl in ICON style would be the best way to do this. If you look at the wxPython Demos, the UltimateListCtrl sample in the wx.LC_ICON style is a good example of what you could create.
1
1
0
0
Which is the most efficient method to display a grid of about 1000 clickable images in wxPython ? Currently i am using a GridSizer filled with StaticBitmap objects. But its quite slow for 500+ images. One more thing is that, i have a listbox of categories on the left. That is to filter the images. Categories will be l...
Efficient method for a grid of clickable images in wxPython?
0
0
1
0
0
796
5,681,407
2011-04-15T19:26:00.000
1
0
1
0
0
python
0
5,681,599
0
3
0
false
0
0
Basic idea Open the file Iterate over the lines For every line read, increment some counter, e.g. line_no += 1; Split the line by whitespace (you will get a list) Check if the list contains the word (use in), then use list.index(word) to get the index, store that index in some variable word_no = list.index(word) print...
1
1
0
0
i wonder how to know , a position inside the .txt when I read. this is my txt cat dog monkey bird this my printing Word: cat Position: line 1 , word 1 (1,1) any idea?
How to know a position (.txt)
0
0.066568
1
0
0
262
5,688,053
2011-04-16T16:51:00.000
5
0
1
0
0
python,django,virtualenv
0
21,246,463
1
3
0
false
1
0
Since the question was about easy_install, it's useful to know that (with setuptools v2.1) you can specify version numbers with easy_install like you can with pip. Thus: $ easy_install django==1.3 will install django 1.3. This was important for my problem (which Google directed me here to solve), when I needed to ins...
1
8
0
0
I just broke my environment because of django 1.3. None of my sites are able to run. So, i decided to use virtualenv to set virtual environment with different python version as well as django. But, seems like if i download the package and install using "sudo python setup.py install" this does not get added to my virtu...
how do you install django older version using easy_install?
1
0.321513
1
0
0
12,466
5,692,968
2011-04-17T10:22:00.000
1
0
0
0
0
python,qt,python-3.x,pyqt4
0
5,693,049
0
1
0
true
0
1
Didn't use this for some thime, but I think you had to change paletteForegroundColor and change segmentStyle to QLCDNumber::Filled or QLCDNumber::Flat
1
0
0
0
Using PyQt4 and Python 3 do you know how I can change the color of a QLcdNumber during the runtime ?
Change the color of the text of QLcdNumber
0
1.2
1
0
0
1,466
5,705,420
2011-04-18T15:41:00.000
1
0
0
0
0
python,twisted
0
5,707,345
0
1
0
false
0
0
You have code in the sample you pasted which takes an action when an XML-RPC call completes. printValue prints the result of a call and printError print an error which occurs during a call. If you want to make another call after one finishes, then maybe instead of just printing something in printValue, you could issue...
1
1
0
0
I have a simple client code using xmlrpclib. try: Server.func1 Server.func2 ..... Server.funcN except: pass , where Server - ServerProxy from xmlrpclib. How to do this on twisted ? I see this example: from twisted.web.xmlrpc import Proxy from twisted.internet import reactor def printV...
using several xmlrpc commands on twisted
0
0.197375
1
0
1
305
5,732,384
2011-04-20T14:56:00.000
0
1
0
1
0
python,wordpress
0
5,732,608
0
2
0
false
1
0
Urllib is an option, but because your script is running on the local machine anyway, I would probably use os.system. That way you can execute the php script like from a shell. You have to look into the php file on how to pass the parameters.
2
3
0
0
I have a python program that sets up a wordpress site on my server. It downloads the zip and unzips it into a directory, sets up the database and user, configures the config file. Now I would like to call the the wp_install function in wp-admin/include/upgrade.php and pass it the parameters it needs $weblog_title, $use...
Automate WordPress Install from python
0
0
1
0
0
1,206
5,732,384
2011-04-20T14:56:00.000
1
1
0
1
0
python,wordpress
0
5,732,698
0
2
0
false
1
0
It looks like wp_install() gets called inside of /wp-admin/install.php during step 1, and after form data has been validated. If you submit ?step=1& ... (all of the other required form fields) it should result in calling wp_install. So yes, you should be able to use urllib(2) for this.
2
3
0
0
I have a python program that sets up a wordpress site on my server. It downloads the zip and unzips it into a directory, sets up the database and user, configures the config file. Now I would like to call the the wp_install function in wp-admin/include/upgrade.php and pass it the parameters it needs $weblog_title, $use...
Automate WordPress Install from python
0
0.099668
1
0
0
1,206
5,736,264
2011-04-20T20:31:00.000
6
0
1
0
0
python,singleton,static-methods
0
5,736,285
0
1
0
false
0
0
By definition, a static method does not have a self parameter. That's what makes it static. If it did have a self parameter, it would be a regular method and not a static method.
1
1
0
0
As in the title I want to know how to have a self instance in a staticmethod in python.
How to have a self instance in a staticmethod in Python
0
1
1
0
0
213
5,737,483
2011-04-20T22:42:00.000
6
0
0
0
0
python,django,svn
0
5,737,523
0
1
0
true
1
0
You can have a post-commit hook in the svn repo that uses, ideally, a restful interface to your Django app and adds the note. That way your app remains very simple.
1
1
0
0
I have a small bug tracker written in django. I'd like to integrate it with an svn repository so that when someone commits to svn it will automatically add a note to an issue in the bug tracker. Does anyone have any input on how to best approach this? Should I setup svn hooks? use a cron job and pull from the log?
SVN Integration with django
0
1.2
1
0
0
478
5,760,936
2011-04-22T23:18:00.000
0
0
1
0
0
python,string,unicode,character-encoding
0
27,403,026
0
5
1
false
0
0
Do not str() cast to string what you've got from model fields, as long as it is an unicode string already. (oops I have totally missed that it is not django-related)
1
19
0
0
I am dealing with unicode strings returned by the python-lastfm library. I assume somewhere on the way, the library gets the encoding wrong and returns a unicode string that may contain invalid characters. For example, the original string i am expecting in the variable a is "Glück" >>> a u'Gl\xfcck' >>> print a Traceb...
Handle wrongly encoded character in Python unicode string
0
0
1
0
0
41,975
5,771,925
2011-04-24T17:03:00.000
1
0
0
0
0
python,mysql
0
5,771,943
0
5
0
false
0
0
Not possible with standard SQL functionality.
2
10
0
0
In Python, is there a way to get notified that a specific table in a MySQL database has changed?
python: how to get notifications for mysql database changes?
1
0.039979
1
1
0
30,571
5,771,925
2011-04-24T17:03:00.000
10
0
0
0
0
python,mysql
0
5,771,988
0
5
0
false
0
0
It's theoretically possible but I wouldn't recommend it: Essentially you have a trigger on the the table the calls a UDF which communicates with your Python app in some way. Pitfalls include what happens if there's an error? What if it blocks? Anything that happens inside a trigger should ideally be near-instant. Wh...
2
10
0
0
In Python, is there a way to get notified that a specific table in a MySQL database has changed?
python: how to get notifications for mysql database changes?
1
1
1
1
0
30,571
5,780,397
2011-04-25T16:17:00.000
0
0
0
0
0
python,django,django-filer
0
13,129,716
0
2
0
false
1
0
Had a similar problem. I had missed that when easy_thumbnails is automatically pulled in by pip, you still have to explicitly add it to your INSTALLED_APPS in settings.py. I spotted this because when I was uploading images, they weren't appearing in the clipboard, and when inspecting the response from the upload, there...
1
3
0
0
Can someone point me in the right direction on how to use Django-filer? I have installed the necessary tools for the filer to work and I get the Filer tab in the admin interface, but when I upload an image to the app I am not able to get the preview thumbimage. The image is also uploaded to the Media_root path(Public f...
How to use Django-filer(asset file manager)?
0
0
1
0
0
1,363
5,788,891
2011-04-26T10:18:00.000
1
0
1
1
0
python,shell
0
33,261,131
0
13
0
false
0
0
Besides subprocess.call, you can also use subprocess.Popen. Like the following subprocess.Popen(['./script', arg1, arg2])
1
74
0
0
I would like to run a command in Python Shell to execute a file with an argument. For example: execfile("abc.py") but how to add 2 arguments?
Execute a file with arguments in Python shell
0
0.015383
1
0
0
186,617
5,789,455
2011-04-26T11:12:00.000
0
0
0
1
0
python,windows,delphi,lua,desktop-application
0
5,789,728
0
2
0
false
0
0
Does anyone use anything else for shrink wrap apps on windows? e.g. Java, python etc. Yes. I assume you're not really asking about Java, since that is so wide-spread. I can count quite a few Java applications that I use, and I don't operate in the "Enterprise" environment. There are tools that allow you to ship Python...
1
2
0
0
Does anyone use a scripting language only solution to produce a binary (.exe) to produce a commercial desktop application for windows or mac? e.g. Java, python etc. If so how do you distribute your app and does using a scripting language cause any problems with the installation? I'm asking about users that can download...
desktop development language compiled binary or scripting language (windows)?
0
0
1
0
0
525
5,795,492
2011-04-26T19:35:00.000
7
0
0
0
0
python,sqlalchemy,eager-loading
0
5,819,858
0
2
1
true
0
0
To force loading lazy attributes just access them. This the simplest way and it works fine for relations, but is not as efficient for Columns (you will get separate SQL query for each column in the same table). You can get a list of all unloaded properties (both relations and columns) from sqlalchemy.orm.attributes.ins...
1
7
0
0
I have some database structure; as most of it is irrelevant for us, i'll describe just some relevant pieces. Let's lake Item object as example: items_table = Table("invtypes", gdata_meta, Column("typeID", Integer, primary_key = True), Column("typeName", String, index=True), ...
Completing object with its relations and avoiding unnecessary queries in sqlalchemy
1
1.2
1
1
0
3,854
5,797,038
2011-04-26T22:06:00.000
0
0
0
0
0
python,django,settings
0
5,797,047
0
2
0
false
1
0
Either put them in the user profile model, or create another model with a one-to-one to User.
1
9
0
0
I would like have additional settings tied to each user in my application (beyond, is_staff, is_admin etc etc). Basically I'd like to have different settings to customize their user experience (ie: don't show tooltips, how many rows to display in results tables, other flags for turning things on or off). Are there best...
modeling user settings in django
0
0
1
0
0
6,716
5,814,837
2011-04-28T06:59:00.000
2
0
0
0
0
python,api,hosting,dns,registration
0
5,814,951
0
3
0
false
1
0
There is no general API for this. You have to check back with your own domain registration organization. This is specific to the related domain provider.
1
6
0
0
I'm trying to make a website that allows you to setup a photo gallery with a custom domain name. Users of the site don't know how to register or configure domain names, so this has to be done for them. User enters desired domain name in a box (we check if it's available) and click 'register' button and our website regi...
What is the best API for registering and configuring domain names?
0
0.132549
1
0
1
4,713
5,819,205
2011-04-28T13:14:00.000
0
0
0
0
0
python,django
0
5,821,241
0
2
0
false
1
0
If you just want to append some links like in the Restaurant change view, you don't really need to use an inline as this provides a form for changing data. I would probably override change_view in RestaurantAdmin to get a list of the related menus and pass it as an extra_context. And then override the model specific ch...
1
0
0
0
Hi I have a list of restaurants (e.g. McDonalds, etc), with menus (e.g Lunch Menu, Dinner Menu), submenus (e.g. Appetizers, Sandwidches, etc.) and dishes (Angus Burger, Chicken Burger, etc.) They are all linked by foreign keys. Is there a way, so that in the Restaurant admin, I have Menu as a tabular inline, with a lin...
In Django Admin, how do you have cascaded InlineModelAdmin
0
0
1
0
0
412
5,821,895
2011-04-28T16:27:00.000
0
0
0
0
0
python,graph,matplotlib,histogram
0
5,821,933
0
2
0
false
0
0
Just convert the values yourself before they are entered. In numpy, you can do just array/1000 instead of array.
1
3
1
0
I have a histogram I'm drawing in matplotlib with some 260,000 values or so. The problem is that the frequency axis (y axis) on the histogram reaches high numbers such as 100,000... What I'd really like is to have the y labels as thousands, so instead of, for instance: 100000 75000 50000 25000 0 To have this: 100 75...
Matplotlib histogram, frequency as thousands
0
0
1
0
0
3,743
5,826,697
2011-04-29T00:48:00.000
1
0
1
0
1
python
0
5,826,729
0
6
0
false
0
0
The answer to both question is to use a loop. Print the "{" and then loop through all the elements printing them. But the input inside a loop and keep looping until you get what you want.
1
2
0
0
So i had to write a program that asks for a user input (which should be a 3 letter string) and it outputs the six permutations of the variations of the placements of the letters inside the string. However, my professor wants the output to be surrounded by curly brackets whereas mine is a list (so it is square brackets)...
Advice on python program
0
0.033321
1
0
0
121
5,830,706
2011-04-29T10:09:00.000
0
0
0
0
0
java,python
0
5,835,814
0
2
0
false
1
0
You could always run the jar files in a subprocess and use PIPE for IO (or temp files). This works pretty well for us (we are generating PDF from our Django app with flying saucer and iText)
1
0
0
0
Hi I have few jar files which are few calculations compiled into jar files. I have a python web app which is supposed to interact with these jar files and get me the data. I have heard that it can be done using the java bridge. Can someone let me know how this could be done or at least point me to the right link.
Integrating python webapp with some jar files
0
0
1
0
0
124
5,832,787
2011-04-29T13:36:00.000
4
0
0
0
0
python,mysql
0
5,832,825
0
3
0
false
0
0
It is very simple - select data from one server, select data from another server and aggregate using Python. If you would like to have SQL query with JOIN - put result from both servers into separate tables in local SQLite database and write SELECT with JOIN.
2
29
0
0
In MySQL, I have two different databases -- let's call them A and B. Database A resides on server server1, while database B resides on server server2. Both servers {A, B} are physically close to each other, but are on different machines and have different connection parameters (different username, different password et...
MySQL -- Joins Between Databases On Different Servers Using Python?
1
0.26052
1
1
0
32,061
5,832,787
2011-04-29T13:36:00.000
3
0
0
0
0
python,mysql
0
5,832,954
0
3
0
false
0
0
No. It is not possible to do the join as you would like. But you may be able to sort something out by replicating one of the servers to the other for the individual database. One data set is under the control of one copy of MySQL and the other dataset is under the control of the other copy of MySQL. The query can only...
2
29
0
0
In MySQL, I have two different databases -- let's call them A and B. Database A resides on server server1, while database B resides on server server2. Both servers {A, B} are physically close to each other, but are on different machines and have different connection parameters (different username, different password et...
MySQL -- Joins Between Databases On Different Servers Using Python?
1
0.197375
1
1
0
32,061
5,843,508
2011-04-30T17:39:00.000
2
0
1
0
0
python,xcode,xcode4,pyobjc
0
7,815,044
0
3
0
false
0
1
I've successfully built a MacRuby GUI app in XCode 4.2 on Lion today following a MacRuby tutorial on Apple's site. MacRuby also includes a template in XCode 4.2. I'm a Python programmer and really hoped to use it, but at this point I've given up on PyObjC. I use Tk in Python for quick little apps and maybe switch to Ma...
1
13
0
0
Xcode 3 had templates for building Cocoa subclasses in Python. I've recently upgraded to Xcode 4 but I cannot find out how I can use other languages besides the C family (C, C++, Obj-C) in Xcode 4. Does anyone know?
PyObjC on Xcode 4
0
0.132549
1
0
0
7,826
5,844,869
2011-04-30T21:56:00.000
35
0
1
1
0
python,virtualenv
0
13,261,064
0
4
1
false
0
0
Virtualenv is a tool to create isolated Python environments. Let's say you're working in 2 different projects, A and B. Project A is a web project and the team is using the following packages: Python 2.8.x Django 1.6.x The project B is also a web project but your team is using: Python 2.7.x Django 1.4.x The machine...
1
358
0
1
I've been hearing the buzz about virtualenv lately, and I'm interested. But all I've heard is a smattering of praise, and don't have a clear understanding of what it is or how to use it. I'm looking for (ideally) a follow-along tutorial that can take me from Windows or Linux with no Python on it, and explain every step...
Comprehensive beginner's virtualenv tutorial?
0
1
1
0
0
149,425
5,846,022
2011-05-01T02:33:00.000
0
0
0
1
0
python
0
5,846,054
0
2
0
false
0
0
Reinstalling would work. In the future, don't delete Frameworks you didn't install.
1
0
0
0
I download python 3.2 and my first thought was that I need to uninstall the python 2.6.1 pre-installed in my computer. But later I found in python.org "You should never modify or delete these, as they are Apple-controlled and are used by Apple- or third-party software". I used "sudo rm -rf /Library/Frameworks/Python.Fr...
how to recover python 2.6.1 that was pre-installed in my macbook pro?
0
0
1
0
0
1,053
5,848,496
2011-05-01T12:59:00.000
0
0
0
0
0
python,url,flask
0
5,848,509
0
2
0
false
1
0
By pointing all the subdomains of that domain to the same website via DNS, and then inspecting the HTTP 1.1 Host header to determine which user website is being viewed.
1
2
0
0
Suppose there is a web app name thesite.com. I need to give every user a url of his own. For eg- if alice signs up, she gets a space of her own at the url "alice.thesite.com".. How do I achieve this. Thanks Alice
how to map url with usernames prefixed?
0
0
1
0
1
164
5,858,446
2011-05-02T14:34:00.000
0
0
0
0
1
opencv,python-2.7,iplimage
1
5,859,924
0
3
0
false
0
1
This must be an issue with the default codecs. OpenCV uses brute force methods to open video files or capture from camera. It goes by trial and error through all sources/codecs/apis it can find in some reasonable order. (at least 1.1 did so). That means that on n different systems (or days) you may get n different ways...
1
1
1
0
I am running Python2.7.1 and OpenCV 2.2 without problems in my WinXP laptop and wrote a tracking program that is working without a glitch. But for some strange reason I cannot get the same program to run in any other computer where I tried to install OpenCV and Python (using the same binaries or appropriate 64 bit bina...
IplImage 'None' error on CaptureFromFile() - Python 2.7.1 and OpenCV 2.2 WinXP
0
0
1
0
0
1,705
5,862,238
2011-05-02T20:41:00.000
6
0
0
1
0
python,email,tornado
0
7,483,440
0
2
0
false
1
0
I wonder why you would handle registration like that. The usual way to handle registration is: Write the user info to the database, but with an 'inactive' label attached to the user. Send an email to the user. If the user confirms the registration, then switch the user to 'active'. If you don't want to write to the d...
1
5
0
0
I'm working with Tornado and MongoDB and I would like to send a confirmation email to the user when he creates an account in my application. For the moment, I use a simple XHTML page with a form and I send information to my MongoDB database using Tornado. I would like to have an intermediate step which sends an email t...
How can I send a user registration confirmation email using Tornado and MongoDB?
0
1
1
1
0
3,734
5,880,867
2011-05-04T08:49:00.000
1
0
0
1
0
python,parallel-processing,celery
0
5,882,479
0
1
0
true
0
0
Giving an example is difficult as messaging is a bit complex, but what you can do basically is: rewrite your program to be a task or write a task that calls your program using subprocess configure celery to have 10 workers execute as many tasks as you need to get your job done, Celery will add them to its queue Celery...
1
0
0
0
lets say i have a python programm whitch i want to run always max 10 times in parallel using celery / rabbigmq and if some of the process finish i want to know about it so i can start a new process. how can i do so? some examples would be nice
python create celery task job
0
1.2
1
0
0
485
5,889,111
2011-05-04T19:53:00.000
0
0
1
0
0
python,regex,perl
0
5,889,138
0
3
0
false
0
0
Replace using regular expression \,\s*FROM and replace with FROM.
1
2
0
0
I have a string "THIS IS, A STRING, FROM" How can I remove a comma before the FROM statement?
Regexp beginner: how to remove comma before a keyword?
0
0
1
0
0
411
5,895,707
2011-05-05T09:50:00.000
1
0
0
0
0
python,django,wordpress
0
5,914,160
0
4
0
false
1
0
If you can get away with running Django and Wordpress as separate apps, you can just use nginx to handle which requests go to which app. For example, if the CMS portion you'd like Wordpress for is only a blog, you could have nginx send example.com/blog/ to wordpress, and anything else to django.
1
1
0
0
now I have a site which based on django(the python framework) which can run stable. in this site we need to use wordpress as a cms. the server config on ubuntu and nginx, but i don't know how to combine the django and wordpress together.any tips is wonderful. thanks in advance!
how to combine django and wordpress based on ubuntu and nginx
0
0.049958
1
0
0
1,879
5,907,312
2011-05-06T05:51:00.000
1
0
0
0
0
django,apache,apache2,mod-python
0
5,907,442
0
1
0
true
1
0
If you only have user level access to the machine (ie: you don't have root), then you won't be able to control what web server runs and you can only control its settings to a limited regard. You will have to consider contacting your provider or looking for a different hosting package if the server doesn't meet you need...
1
1
0
1
I have developed a web application in Django and would like to go online i have an FTP access to the hosting server I am a beginner to "setting up a website" i would like to know how to install apache on that server and have my application working Kindly provide detailed info as i am newbie, any links or tutorials woul...
How to set up Apache server via an FTP account
0
1.2
1
0
0
347
5,911,382
2011-05-06T12:25:00.000
1
0
1
0
1
python,exception,video-capture
1
24,388,352
0
2
0
false
0
0
I know this is a really old thread. I kept getting this error after instantiating the Device a second time. Moving the code to the main thread fixed the problem for me.
1
1
0
0
I use the Python (2.7) package VideoCapture. When I try to instantiate the Device, I get an Exception: Error: Capture Graph could not be created. I use cam = Device(), so nothing special there. I have one laptop where this works without a problem, and another where I get the Exception. They are different, but both ha...
VideoCapture: Capture Graph Error
0
0.099668
1
0
0
1,280
5,913,049
2011-05-06T14:44:00.000
1
0
1
0
0
python,timezone
0
5,913,087
0
5
0
false
0
0
call datetime.now() with the time zone (as a tzinfo object) as an argument.
1
0
0
0
I have countrynames and utcoffset of that country How to find out out local time in that country using utcoffset?
how to findout local time using utcoffset and countryname in python
0
0.039979
1
0
0
1,509