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
10,489,377
2012-05-07T21:26:00.000
4
0
1
0
python,3d,visualization,physics,simulation
10,859,872
4
true
0
0
3D support for python is fairly weak compared to other languages, but with the way that most of them are built, the appearance of the program is far more mutable than you might think. For instance, you talked about Vpython, while many of their examples are not visually appealing, most of them are also from previous rel...
1
6
1
What are good libraries for creating a python program for (visually appealing) 3D physics simulations/visualizations? I've looked at Vpython but the simulations I have seen look ugly, I want them to be visually appealing. It also looks like an old library. For 3D programming I've seen suggestions of using Panda3D and p...
What are good libraries for creating a python program for (visually appealing) 3D physics simulations/visualizations?
1.2
0
0
5,810
10,490,018
2012-05-07T22:30:00.000
2
0
0
1
python,macos,bash,mercurial,automator
10,492,057
1
true
0
0
The steps in your manual workflow can become the steps in a shell script quite literally. One difference is that you might use sed to modify files rather than open them in an editor. You'd use positional parameters or getopts to pass in your parameters. See man bash for information on those. Then come back and ...
1
0
0
I frequently (more than once a week) create new 'projects' on my development machine (Mac). I'm trying to streamline the workflow and automate what I do manually now: Create a project folder structure (I have a template directory structure which I copy) Clone (Mercurial) a boilerplate source code baseline into the ne...
Scripting on Mac to automate creation of project folder structure and Mercurial repository/subrepository cloning
1.2
0
0
640
10,493,188
2012-05-08T05:45:00.000
2
0
0
0
python,django
10,493,743
5
false
1
0
CherryPy would serve you the best if you are looking for a minimalist one.
2
3
0
I have a small python app that I would like to convert into a webapp. I have look at some frameworks out there such as django. I need some suggestions on a very simple framework. All my webapp will have is a textbox and two buttons.
Simplest framework for converting python app into webapp?
0.07983
0
0
1,030
10,493,188
2012-05-08T05:45:00.000
0
0
0
0
python,django
10,497,657
5
false
1
0
+1 for bottle. Nevertheless, consider that the scope usually grows when developing web apps and that text box and those 2 buttons will later on need: templates, lots of routes, maybe translations, etc. So, always consider using something that would allow you to move into some powerful framework such as web2py or Djang...
2
3
0
I have a small python app that I would like to convert into a webapp. I have look at some frameworks out there such as django. I need some suggestions on a very simple framework. All my webapp will have is a textbox and two buttons.
Simplest framework for converting python app into webapp?
0
0
0
1,030
10,495,324
2012-05-08T08:42:00.000
2
0
0
0
mongodb,python-3.x,turbogears2
10,650,606
1
true
0
0
For SQLAlchemy you can achieve something like that using a smarter Session. Just subclass the sqlalchemy.orm.Session class and override the get_bind(self, mapper=None, clause=None) method. That method is called each time the session has to decide which engine to use and is expected to return the engine itself. You can ...
1
2
0
I have come across a requirement that needs to access a set of databases in a Mongodb server, using TurboGear framework. There I need to list down the Databases, and allow the user to select one and move on. As far as I looked, TurboGear does facilitate multiple databases to use, but those needs to be specify beforehan...
How to change the database on the fly in python using TurboGear framework?
1.2
1
0
305
10,495,393
2012-05-08T08:46:00.000
0
0
1
1
python,process
10,495,460
3
false
0
0
Have a look how communicate is implemented. There are essentially 2 ways to do it: either use select() and be notified whether you can read/write, or delegate the read and write, which both can block, to a thread, respectively.
2
0
0
I have a subprocess that I use. I must be able to asynchronously read and write to/from this process to it's respective stdout and stdin. How can I do this? I have looked at subprocess, but the communicate method waits for process termination (which is not what I want) and the subprocess.stdout.read method can block. T...
Opening and communicating with a subprocess
0
0
0
130
10,495,393
2012-05-08T08:46:00.000
0
0
1
1
python,process
10,497,549
3
false
0
0
Have you considered using some queue or NOSQL DB for inter process communication? I would suggest you to use Redis, and read and write to different keys with your processes.
2
0
0
I have a subprocess that I use. I must be able to asynchronously read and write to/from this process to it's respective stdout and stdin. How can I do this? I have looked at subprocess, but the communicate method waits for process termination (which is not what I want) and the subprocess.stdout.read method can block. T...
Opening and communicating with a subprocess
0
0
0
130
10,496,168
2012-05-08T09:40:00.000
0
0
0
0
python,pyqt4,qtablewidget
10,537,246
1
true
0
1
Qt provides a (modified) Model->View framework and so the data in a table, or any other GUI widget, is stored in a data model. It's the data in the model that you want to persist. The GUI widgets themselves don't provide any facilities to do this. There's no standard data persistence method implemented in the Qt data m...
1
1
0
Is there some simple way in PyQt to store data from QTableWidget to some file, and use that content again? It's not a critical task for me, so i don't want to invent some custom xml rules or somethin else.
How to import/export QTableWidget to some file?
1.2
0
0
1,493
10,496,821
2012-05-08T10:26:00.000
1
0
0
0
python,database,python-2.7,hdf5,pytables
10,497,547
1
false
0
0
The general way to archive records from one table of a given database to another one is to copy records into the target table, and then to delete the same records in the origin table. That said, depending of your database engine and the capabilities of the language built on top of that, you can write atomic query comma...
1
1
0
I have one table with Time32 column and large number of rows. My problem is next. When my table reaches thousand million rows, I want start archiving every row older than specified value. For creating query I will use Time32 column which represents timestamp for collected data in row. So,using this query I want delete...
Pytables - Delete rows from table by some criteria
0.197375
1
0
1,114
10,499,419
2012-05-08T13:17:00.000
0
0
1
0
python,class,design-patterns
10,499,592
6
false
0
1
You can import symbols from settings.py in any module they are needed. That's the concept. An actual problem is when you have circular imports. e.g. What if you had some symbols inside engine.py that were needed in main.py and vice versa. In that situation a common pattern is to break these dependencies in a third modu...
1
6
0
I was recently told that I should keep my code in separate files; like main.py, engine.py, settings.py and so on. Although this surely does have benefits, like easier management, scalability and others, to me it seems like it has too many drawbacks... For example, if I have a script called settings.py, where some thing...
How to organize my Python code into multiple classes?
0
0
0
9,182
10,500,237
2012-05-08T14:06:00.000
1
0
0
0
python,pdf,pdf-generation,reportlab,xhtml2pdf
10,517,245
1
false
1
0
If you cannot achieve the results you need with xhtml2pdf, I suggest you use ReportLab directly. ReportLab contains support for RML, ReportLabs own markup language that lets you easily create formatted text, and has a support library called Platypus that makes layout fairly simple using Python objects to represent doc...
1
2
0
I generate PDFs with the xhtml2pdf Python package. The output is not optimal. I use floating divs in order to place images and text on the page. In HTML this works but after PDF rendering, images and text ar placed underneath eachother which is not what I want. From surfing the web I learned that the Report Lab package...
Is there a workaround to get floating divs in Report Lab?
0.197375
0
0
819
10,500,536
2012-05-08T14:24:00.000
2
0
0
0
python,mod-wsgi,cherrypy
13,859,477
1
true
1
0
If you're setting the environment configuration to either production, embedded or test_suite then automatically log.screen is set to False. Manually setting this to true will give you a full trace-back displayed on screen. Alternatively you'd have to start digging in your web server logs.
1
0
0
I have a cherrypy app with works fine on my local machine, but not on my server. If an exception is thrown in a request handler, I see the following message in my browser: The server encountered an unexpected condition which prevented it from fulfilling the request. How can I tell cherrypy to display the exception?...
Display exceptions in mod_wsgi hosted cherrypy app
1.2
0
0
166
10,501,247
2012-05-08T15:03:00.000
10
0
1
0
python,random,hash
29,804,021
13
false
0
0
The OP requested to create random filenames not random files. Times and UUIDs can collide. If you are working on a single machine (not a shared filesystem) and your process/thread will not stomp on itself, use os.getpid() to get your own PID and use this as an element of a unique filename. Other processes would obvious...
1
131
0
In Python, what is a good, or the best way to generate some random text to prepend to a file(name) that I'm saving to a server, just to make sure it does not overwrite. Thank you!
Best way to generate random file names in Python
1
0
0
124,655
10,507,230
2012-05-08T22:04:00.000
4
0
1
0
python
10,507,290
11
false
0
0
Parse the file into a python list using file.readlines() or file.read().split('\n') Identify the position where you have to insert a new line, according to your criteria. Insert a new list element there using list.insert(). Write the result to the file.
1
85
0
Is there a way to do this? Say I have a file that's a list of names that goes like this: Alfred Bill Donald How could I insert the third name, "Charlie", at line x (in this case 3), and automatically send all others down one line? I've seen other questions like this, but they didn't get helpful answers. Can it be don...
Insert line at middle of file with Python?
0.072599
0
0
140,226
10,509,661
2012-05-09T04:04:00.000
-1
0
0
0
python,django
12,107,307
1
true
1
0
I don't know if this is exactly what you want, but you could check filesize at two timepoints and then compare the filesize. For sure if the download is pausing for some reason, this solution is not very good.
1
1
0
I would just like to ask if it's possible for me to check the status of a file (csv file) download in Django . I have a template page with a button, which when clicked, opens a 'Save As' dialog box for downloading a file from the server (file content is retrieved from db). after the download is complete i want to upda...
Detecting File Download Completion Status
1.2
0
0
431
10,510,450
2012-05-09T05:43:00.000
0
1
0
0
python,mercurial,path,pythonpath
10,510,460
1
false
0
0
"site-package"? Did you mean "site-packages"?
1
2
0
I am having weird behaviors in my Python environment on Mac OS X Lion. Apps like Sublime Text (based on Python) don't work (I initially thought it was an app bug), and now, after I installed hg-git, I get the following error every time I lauch HG in term: *** failed to import extension hggit from /Library/Frameworks/P...
Python: Failed to import extension - Errno 2
0
0
1
2,128
10,510,574
2012-05-09T05:59:00.000
-1
0
1
0
python,readline,pdb,libreadline
29,533,150
2
false
0
0
I had a similar issue and for me the solution was to use the set trace command that comes with django instead of the pdb package.
1
14
0
I have an application running Python 2.6.X. Starting the Python interpreter in interactive mode (with or without using virtualenv): readline support working (command history). Starting my application with the same Python interpreter (virtualenv-ed or not): no readline support available when using pdb.set_trace(): curso...
No readline support while using pdb.set_trace()
-0.099668
0
0
1,355
10,512,569
2012-05-09T08:38:00.000
4
1
0
0
python,python-2.6
10,512,800
2
false
0
0
Here's one way - find the lyrics on the web and train a classifier to determine if the lyrics are sad or happy. Even if you wont get good enough accuracy this way you could use it as part of the solution in conjunction with the harmony/melody analysis.
1
0
0
My actual work is to find mood of song i.e. either a sad song or a happy song. I try to find frequencies of mp3 file with fft but it just give the frequencies of small files, like ringtone. Can you guide me which audio feature, such as pitch, timbre, loudness, tempo, could be use to find mood of a songs which are in cu...
How to find mood from song
0.379949
0
0
3,877
10,512,965
2012-05-09T09:06:00.000
0
1
1
0
python,jython,wlst
11,896,984
1
false
0
0
When the name of the variable used to do something like print or use in some other expression without assigning the value for the variable before it was defined then WLST/Python will raises NameError. Check that your HashMap varialbe assigned with value and then sent for other Python script.
1
0
0
I have a function(say method1) imports hashmap in a python file (say file1.py) and it invokes another method (say method2) in another py file (file2.py) not having the import but method2 uses hashmap. When method1 is invoked inside WLST.sh, no problem. But when I invoke it as $MW_HOME/oracle_common/bin/wlst.sh file1.p...
Package importing issue in jython file
0
0
0
165
10,513,759
2012-05-09T09:54:00.000
2
0
0
0
python,django,twitter
10,516,808
3
false
1
0
You could just extract the code into your own project and that will work. But the benefits of using an open source library is that there's a good chance when Twitter or Social Network X changes it's API, the library, if popular, would get updated as opposed to you needing to make the change.
1
1
0
I use Django-social-auth to authenticate the users of a Django project. So I guess I have all the necessary information about a Twitter user to make a post on their behalf on their Twitter account. So do I really need to install a new app? or with the info at hand how would I do that? Isn't it just a matter of posting ...
Django users post to twitter
0.132549
0
0
783
10,515,907
2012-05-09T12:17:00.000
0
0
0
0
python,nltk,document-classification
10,516,123
4
false
0
0
There could be many reasons for the classifier not working, and there are many ways to tweak it. did you train it with enough positive and negative examples? how did you train the classifier? did you give it every word as a feature, or did you also add more features for it to train on(like length of the text for examp...
2
2
1
I'm doing a project on document classification using naive bayes classifier in python. I have used the nltk python module for the same. The docs are from reuters dataset. I performed preprocessing steps such as stemming and stopword elimination and proceeded to compute tf-idf of the index terms. i used these values to ...
document classification using naive bayes in python
0
0
0
2,839
10,515,907
2012-05-09T12:17:00.000
1
0
0
0
python,nltk,document-classification
21,133,966
4
true
0
0
A few points that might help: Don't use a stoplist, it lowers accuracy (but do remove punctuation) Look at word features, and take only the top 1000 for example. Reducing dimensionality will improve your accuracy a lot; Use bigrams as well as unigrams - this will up the accuracy a bit. You may also find alternative w...
2
2
1
I'm doing a project on document classification using naive bayes classifier in python. I have used the nltk python module for the same. The docs are from reuters dataset. I performed preprocessing steps such as stemming and stopword elimination and proceeded to compute tf-idf of the index terms. i used these values to ...
document classification using naive bayes in python
1.2
0
0
2,839
10,517,501
2012-05-09T13:50:00.000
3
0
1
0
python
10,517,582
2
false
0
0
The specific problem arises because the software tries to interpret 107.24 as an integer number, which it is not. Why it does this, or where this number is coming from, is really hard to tell from the little information given in your question.
1
0
0
i am new in python, i just try to play a video in avg player through python. All the videos are played successfully, but one video has through this value error. i am not sure why this error was happened . if you know describe me.
ValueError: invalid literal for int() with base 10: '107.24'
0.291313
0
0
2,480
10,517,696
2012-05-09T14:00:00.000
0
1
0
0
python,selenium
10,517,715
1
false
0
0
You are running them as unittests instead of normally. Are you using Eclipse? You're probably pressing the wrong button.
1
0
0
I have a problem when running some python scripts. I get the message 'Ran 0 tests in 0.000s'. This occured out of know where. Soem scripts still do work however. I can't find any difference between the scripts as why some should run and some don't. I've done a bit of research and 'unittest' seems to be a common theme....
Python Scripts no longer run
0
0
0
196
10,517,900
2012-05-09T14:13:00.000
1
0
0
0
python,sqlite,web-hosting
10,518,010
1
true
0
0
I could upload the db file to any web hosting service to any directory Supposing that the service has the libraries installed to handle sqlite, and that sqlite is installed. Would I be able to run a Python script that writes to SQLite Yes, well, maybe. As of Python 2.5, Python includes sqlite support as part of it's...
1
0
0
I looked at the sqlite.org docs, but I am new to this, so bear with me. (I have a tiny bit of experience with MySQL, and I think using it would be an overkill for what I am trying to do with my application.) From what I understand I can initially create an SQLite db file locally on my MAC and add entrees to it using a ...
Understanding SQLite conceptually
1.2
1
0
143
10,519,454
2012-05-09T15:42:00.000
0
1
0
1
java,python,perl,client
10,519,519
1
false
1
0
What you are talking about is Web Services. A corollary to this is XML and SOAP. In Java, Python, C#, C++... any language, you can create a Web Service that conforms to a standard pattern. Using NetBeans (Oracle's Java IDE) it is easy to create Java web services. Otherwise, use google to search for "web services tutori...
1
3
0
I have a java application as server (installed on Tomcat/Apache) and another java application as client. The client's task is to get some arguments and pass them to the server and call an adequate method on the server to be execute. I want to have the client in other languages like Perl, Python or TCL. So, I‌ need to k...
Execute java methodes via a Python or Perl client
0
0
0
114
10,522,243
2012-05-09T18:47:00.000
2
0
0
1
python,google-app-engine,app-inventor
10,561,318
1
false
1
0
The solution I found was to do nothing with shival wolfs code on app engine, and to replace the 'postfile' block in the app inventor code with a 'posttext' block with the text you want to send attached to it. Also change the filename variable to the name you want the file called including file type (i.e. .xml, .csv, ....
1
0
0
newbie here in need of help. Using App Inventor amd App Engine. Learning python as i go along. Still early days. Need to post text data from AI to app engine, save in blob store as file (.xml), to be emailed as an attachment. Am able to send pictures using Shival Wolfs wolfwebmail2, and am sure with a bit of playing ...
convert text post into xml file using python in google app engine
0.379949
0
1
265
10,522,290
2012-05-09T18:49:00.000
1
0
0
0
python,sql,excel,ms-access
10,522,435
4
false
0
0
While data concerning the frequency of individual tags should be very simple to construct, data concerning the relationships between tags is very difficult and falls under the realm of data mining. Here is what I would do, at a very high level, assuming you have a response table, a tag table, and a response_tag table....
3
2
0
I have thousands of survey responses that have been tagged according to the content of the response. Each response can have one tag or many (up to 20), and the tags are independent of one another rather than being structured into category-subcategory or something. I want to be able to do analysis like the following: H...
Best approach to doing analysis of sets of tags?
0.049958
0
0
144
10,522,290
2012-05-09T18:49:00.000
1
0
0
0
python,sql,excel,ms-access
10,522,611
4
false
0
0
You have a quite small dataset, so you do not need any kind of ORM really, just load all data in Python and chew a report of it. SQL as a language is horrible for a more complex data analysis (e.g. where you really want to crosstabulate things etc).
3
2
0
I have thousands of survey responses that have been tagged according to the content of the response. Each response can have one tag or many (up to 20), and the tags are independent of one another rather than being structured into category-subcategory or something. I want to be able to do analysis like the following: H...
Best approach to doing analysis of sets of tags?
0.049958
0
0
144
10,522,290
2012-05-09T18:49:00.000
0
0
0
0
python,sql,excel,ms-access
10,523,469
4
false
0
0
Go with SQL! It is very powerful for data analysis. It will allow you to ask questions in the future about the data. Questions that you have not yet thought of. Although SQL as a language may seem a bit cumbersome, it is much easier to use than a "real" programming language. In your case, SQL interfaces to Excel, s...
3
2
0
I have thousands of survey responses that have been tagged according to the content of the response. Each response can have one tag or many (up to 20), and the tags are independent of one another rather than being structured into category-subcategory or something. I want to be able to do analysis like the following: H...
Best approach to doing analysis of sets of tags?
0
0
0
144
10,524,564
2012-05-09T21:47:00.000
3
1
1
1
python,debian,plone,virtualbox,zope
10,527,263
2
false
0
0
I've done some experimenting with VirtualBox recently. It's great, but I'm pretty sure that the shared folders are going to be limited to what's supported by the host operating system. Windows doesn't have anything like hard or symbolic links. I suspect that you're trying to do this so that you can edit instance files ...
2
2
0
I'm running Windows 7 64bit as my Host OS and Debian AMD64 as my Guest OS. On my Windows machine a folder called www is mounted on Debian under /home/me/www. I have no problem installing Plone on Debian (the guest OS) with the unified installer. However, when I try to change the default install path from /home/me/Plone...
Can't Install Plone on VirtualBox Shared Folder because Python Fails to Install
0.291313
0
0
419
10,524,564
2012-05-09T21:47:00.000
0
1
1
1
python,debian,plone,virtualbox,zope
10,543,865
2
false
0
0
How about using Debian's mount --bind to mount specific Host folders to portions of the installation tree?
2
2
0
I'm running Windows 7 64bit as my Host OS and Debian AMD64 as my Guest OS. On my Windows machine a folder called www is mounted on Debian under /home/me/www. I have no problem installing Plone on Debian (the guest OS) with the unified installer. However, when I try to change the default install path from /home/me/Plone...
Can't Install Plone on VirtualBox Shared Folder because Python Fails to Install
0
0
0
419
10,528,064
2012-05-10T05:35:00.000
3
0
1
0
python
10,528,093
2
false
0
0
Usually they are objects which map to database tables (their instances map to rows in the corresponding tables).
2
0
0
This question was asked to me in an interview for a Python developer position. If anyone can answer this with respect to Python then it would be of great help. Generic definitions are also welcome.
What are Python 'model objects'?
0.291313
0
0
282
10,528,064
2012-05-10T05:35:00.000
6
0
1
0
python
10,528,163
2
false
0
0
Read on wikipedia on Model-View-Controller architecture. Model classes refer generically to the domain model. Martin Fowler on MVC: "a clear division between domain objects that model our perception of the real world, and presentation objects that are the GUI elements we see on the screen. Domain objects should be comp...
2
0
0
This question was asked to me in an interview for a Python developer position. If anyone can answer this with respect to Python then it would be of great help. Generic definitions are also welcome.
What are Python 'model objects'?
1
0
0
282
10,532,642
2012-05-10T11:02:00.000
2
0
0
0
c++,python
10,532,867
2
false
0
0
There are many, many factors that will influence the available bandwidth: your hardware (network card, router, WiFi stability, cabling), what you are doing (other downloads, machine load) and what is happening elsewhere (bandwidth to target server, ISP issues, etc.). And all of those can change at any moment in time to...
1
0
0
I am trying to get the available bandwidth from my PC. Suppose I'm streaming a video at 2 Mbps and my network card is of 100 Mbps, my program should tell me that 98 Mbps is available. Is it easy to do in C++ or Python? And how can I find the available bandwidth using any of the suggested programming language. Any hel...
Find available bandwidth from Python or C++
0.197375
0
0
832
10,533,864
2012-05-10T12:20:00.000
4
0
0
0
python,django,celery,code-organization,django-celery
10,550,920
1
true
1
0
Celery have special configuration settings named: CELERY_IMPORTS. Its a list with files named which need to be imported and checked for existing Celery task functions. So, i think django-celery just add there something like */tasks.py. In your way you can add somethings in footer of your manage.py script in put in CELE...
1
1
0
All my celery tasks are contained under a tasks.py under each Django app of mine. It's quite cluttered. I'd like to move my celery periodic tasks into a check.py file under each app maainly to make it easier to organise and manage my code. Is there a provision in django-celery to do this? Thanks.
How can I place my Django/Celery periodic tasks and regular tasks in separate files?
1.2
0
0
303
10,534,950
2012-05-10T13:24:00.000
0
0
1
0
python,graph
10,535,067
1
false
0
0
The generic answer is to write a method that allows you to scale the y value for each data set to lay on the graph the way you want it. Then all your data points will have a y value on the same scale, and you can label the Y axis based upon how you define your translation for each data set.
1
0
1
I want to make a line graph with multiple sets of data on the same graph. But they all scale differently so will need individual y axis scales. What code will put each variable on a separate axis?
How to have multiple y axis on a line graph in Python
0
0
0
150
10,539,724
2012-05-10T18:02:00.000
1
0
0
1
python,shutil,copytree
10,540,159
3
false
0
0
The error code is telling you that you don't have the permission to either read the source or write to the destination. Did the permission settings of your files and folders change?
1
2
0
I want to copy folder from my local server on my computer, using function shutil.copytree, i using macOS, but today i have problem,python always show me the same message,"[error 1] operation not permitted",but yesterday mine script work without problems with same folders... Can someone tell me whats is the problem, wh...
Problems with shutil.copytree
0.066568
0
0
6,653
10,541,085
2012-05-10T19:44:00.000
1
0
0
0
python,mysql,windows
10,541,253
3
false
0
0
You don't need the entire MySQL database server, only the MySQL client libraries.
1
0
0
I'm trying to install MYSQLdb on a windows client. The goal is, from the Windows client, run a python script that connects to a MySQL server on a LINUX client. Looking at the setup code (and based on the errors I am getting when I try to run setup.py for mysqldb, it appears that I have to have my own version of MySQL...
Install MYSQLdb python module without MYSQL local install
0.066568
1
0
1,771
10,542,019
2012-05-10T20:57:00.000
0
0
1
0
python,numpy
10,542,061
2
false
0
0
You can change the value of the parameter A if the parameter you pass to A is a global parameter. The other way round would be to pass the variable from function to function. From what I understand in python, the object is not copied when you do so.
1
1
0
I have a python function func(A). A is a numpy.array and can be big such that I hesitate copying it over and over again. This func(A) wants to change the content of A. I know this a python newbie issue. I used to program in C and it could be done by pointers. How can I change the content of A so that the change is also...
python: function parameter updating issues
0
0
0
197
10,542,367
2012-05-10T21:24:00.000
5
0
1
0
python,pickle,data-persistence
10,542,398
2
true
0
0
When you want to store Python objects that aren't text, aren't easily serialized with other libraries (JSON, msgpack, etc), and don't want to write your own serialization and deserialization code. Generally speaking, pickle should be a serialization and deserialization method of last resort: It isn't speedy (msgpack is...
2
0
0
I get the idea that pickle is an object persistence library that lets me write out a data structure to disk, and reload it. Why/when would I do this vs the 'traditional' method of using a text file? EDIT: Actually that isn't a helpful way to phrase the question. I mean what are the situations where pickle would be easi...
python pickle: what is it? when would i use it?
1.2
0
0
195
10,542,367
2012-05-10T21:24:00.000
1
0
1
0
python,pickle,data-persistence
10,542,397
2
false
0
0
With pickle or similar, you can get textual representations of objects that can be used to reconstitute those objects. Without something like pickle, you cannot, without writing your own persistence code.
2
0
0
I get the idea that pickle is an object persistence library that lets me write out a data structure to disk, and reload it. Why/when would I do this vs the 'traditional' method of using a text file? EDIT: Actually that isn't a helpful way to phrase the question. I mean what are the situations where pickle would be easi...
python pickle: what is it? when would i use it?
0.099668
0
0
195
10,542,638
2012-05-10T21:47:00.000
0
0
1
0
python,python-2.7
10,542,674
1
true
0
0
This depends on the complexity of the 3rd party package. If it is pure python, you may simply bundle it with the rest of your code. If it needs a more complicated install process, you will probably need users to install it themselves.
1
1
0
I'm writing a program that relies on the user having third party packages already installed. Is there any way to include those packages in my installer, or will they have to install them separately? I'm using distutils in 2.7 if it matters.
How can I include a 3rd party package when I build in Python?
1.2
0
0
72
10,543,992
2012-05-11T00:46:00.000
2
1
1
0
python,python-2.7,ctypes
10,544,224
2
true
0
0
there is no "regular C implementation" in most cases. Python data structures are one to three order of magnitudes higher level. To answer you question "how fast are ctypes in python?" - the answer is "pretty fast". look at numpy for an idea of it.
2
1
0
I just started looking into ctypes and was a little curious on how they work. How does it compare speed wise to the regular C implementation? Will using ctypes in a python program speed it up or slow it down is basically what I am wondering. Thanks!
How fast are ctypes in python?
1.2
0
0
1,191
10,543,992
2012-05-11T00:46:00.000
-1
1
1
0
python,python-2.7,ctypes
10,544,690
2
false
0
0
If speed is only concern don't use Python, PHP, Perl or other scripting language. Write whatever in C or Assembly. Since these scripting languages are fast enough to build Google, Facebook and Amazon, you will find that they are fast enough for whatever you are thinking about.
2
1
0
I just started looking into ctypes and was a little curious on how they work. How does it compare speed wise to the regular C implementation? Will using ctypes in a python program speed it up or slow it down is basically what I am wondering. Thanks!
How fast are ctypes in python?
-0.099668
0
0
1,191
10,545,957
2012-05-11T05:36:00.000
1
0
1
0
python,pandas
10,546,350
6
false
0
0
I might try to concatenate the files before feeding them to pandas. If you're in Linux or Mac you could use cat, otherwise a very simple Python function could do the job for you.
2
18
1
I am trying to create a pandas DataFrame and it works fine for a single file. If I need to build it for multiple files which have the same data structure. So instead of single file name I have a list of file names from which I would like to create the DataFrame. Not sure what's the way to append to current DataFrame in...
creating pandas data frame from multiple files
0.033321
0
0
24,945
10,545,957
2012-05-11T05:36:00.000
3
0
1
0
python,pandas
10,563,786
6
false
0
0
Potentially horribly inefficient but... Why not use read_csv, to build two (or more) dataframes, then use join to put them together? That said, it would be easier to answer your question if you provide some data or some of the code you've used thus far.
2
18
1
I am trying to create a pandas DataFrame and it works fine for a single file. If I need to build it for multiple files which have the same data structure. So instead of single file name I have a list of file names from which I would like to create the DataFrame. Not sure what's the way to append to current DataFrame in...
creating pandas data frame from multiple files
0.099668
0
0
24,945
10,547,099
2012-05-11T07:17:00.000
8
0
1
0
python,bytecode,backwards-compatibility,pyc
10,547,117
1
true
0
0
No, they are usually not even compatible between minor releases (e.g. 2.6 vs 2.7). However, since you usually have the .py files, too, python will automatically compile them for the currently used version.
1
9
0
Python 2 and 3, are the bytecode (pyo & pyc) backward compatible? can i execute python 2 pyo & pyc file with python 3?
Python 2 and 3, are the bytecode (pyo & pyc) backward compatible?
1.2
0
0
1,539
10,549,402
2012-05-11T10:08:00.000
7
0
0
0
python,data-structures,latitude-longitude,kdtree
16,015,768
2
true
0
0
A binary search tree cannot handle the wraparound of the polar representation by design. You might need to transform the coordinates to a 3D cartesian space and then apply your favorite search algorithm, e.g., kD-Tree, Octree etc. Alternatively, if you could limit the input range of coordinates to a small region on the...
1
11
0
Are there any packages in Python that allow one to do kdtree-like operations for longitude/latitudes on the surface of a sphere? (this would need to take into account the spherical distances properly, as well as the wraparound in longitude).
KDTree for longitude/latitude
1.2
0
0
6,675
10,550,858
2012-05-11T11:56:00.000
1
1
0
1
python,linux,cgi,subprocess
10,550,999
3
false
0
0
Either the environment is different (maybe it's trying to write to the wrong dir) or more likely, the cgi isn't running as the same user that you are logging in as. For example, it's fairly common for cgi scripts to be executed as "nobody" or "www" etc. You could try getting the cgi to write a file into /tmp. That shou...
1
1
0
I have a python CGI script which takes form input x andy (integers) and passes it to a C++ executable using subprocess in which the program writes the sum of the two values to a text file. The code works fine on my local machine. However, after much testing ,I found that whenever I run this program on my server (in /v...
Unable to write to file programmatically on linux server
0.066568
0
0
1,569
10,550,870
2012-05-11T11:56:00.000
0
0
1
0
python,performance,python-3.x,pickle
10,551,845
2
false
0
0
Depending on how seriously you need to solve this problem, you may want to look at memcached, if that is not overkill.
1
1
0
I have some Pickled data, which is stored on disk, and it is about 100 MB in size. When my python program is executed, the picked data is loaded using the cPickle module, and all that works fine. If I execute the python multiple times using python main.py for example, each python process will load the same data multipl...
Sharing Data in Python
0
0
0
188
10,551,042
2012-05-11T12:08:00.000
2
0
0
0
python,sqlalchemy,pyramid
10,555,714
1
true
1
0
You have to setup your project in the same way that the alchemy scaffold is constructed. Put "sqlalchemy" in your setup.py requires field and run "python setup.py develop" to install the dependency. This is all just python and unrelated to Pyramid.
1
0
0
I know that pyramid comes with a scaffold for sqlalchemy. But what if I'm using the pyramid_jqm scaffold. How would you integrate or use sqlalchemy then? When I create a model.py and import from sqlalchemy I get an error that he couldnt find the module.
Using sqlalchemy in pyramid_jqm
1.2
1
0
101
10,551,960
2012-05-11T13:06:00.000
3
0
0
0
python,django,debugging
10,552,934
2
true
1
0
Solved it by including 'include_html': 'True', next to 'class': 'django.utils.log.AdminEmailHandler', in the LOGGING setting in settings.py. Now I get HTML reports via email that contain all of the locals() info.
1
4
0
When your Django app raises an exception, Django sends you an email to report you of the error which includes some useful information. That's great. But there's one piece of information that would be helpful in debugging but is missing from those emails: locals(). How can I make Django's error emails include locals()?
How can I make Django's error emails report `locals()`?
1.2
0
0
200
10,552,242
2012-05-11T13:24:00.000
1
0
0
0
python,django
10,552,835
2
false
1
0
You can do it client-side by adding those nagging message in the cookies and showing them on every page load. with a close function handler that would remove the cookie.
1
3
0
I have a Django app. I've implemented a few "nag" boxes in a rather manual way, and I'm now looking for a dedicated module/framework for such nags. What do I mean by "nag"? Those are little boxes that show up near the top of each page on the site, similar to Django's built-in messages, that tell the user of something t...
Looking for a Django nag system
0.099668
0
0
121
10,555,844
2012-05-11T17:17:00.000
0
0
1
0
python
10,556,284
3
false
0
0
Rather than thinking of this as 'how do I dynamically create a class', think of it as an opportunity to use the metaprogramming capabilities of Python instead. The first place I'd look for ideas is to the standard library source for xmlrpclib -- look specifically at how it uses __getattr__ to handle otherwise non-exis...
1
7
0
I've seen these "Dynamically create a class" questions which are answered saying, "use the type() function". I'm sure I'll have to at some point but right know I'm clueless. But from what I've seen you have to already know something about the class, such as a name. What I'm trying to do is parse an idl type of file a...
Dynamically creating a class from file in Python
0
0
0
10,709
10,557,475
2012-05-11T19:29:00.000
1
0
0
0
python,http,networking,post
10,557,539
3
false
0
0
Yes, it's possible to send the same info as the browser does. Depending on how the browser communicates with the server, it could be as simple as adding username and password as HTTP POST parameters. Other common methods are for the browser to send a hash of the password, or to log in with more than one step.
1
2
0
I've got a website that I want to check to see if it was updated since the last check (using hash). The problem is that I need to enter a username and password before I can visit the site. Is there a way to input the username and the password using python?
send post request python
0.066568
0
1
11,449
10,558,044
2012-05-11T20:16:00.000
14
0
1
0
python,clojure
10,558,919
4
true
1
0
I built an embarrassingly parallel number-crunching application with a backend in Clojure (on an arbitrary number of machines) and a frontend in Ruby on Rails. I don't particularly like RoR, but this was a zero-budget project at the time and we had a Rails programmer at hand who was willing to work for free. The Clojur...
3
8
0
I am working on a big project that involves a lot of web based and AI work. I am extremely comfortable with Python, though my only concern is with concurrent programming and scaling this project to make it work on clusters. Thus, Clojure for AI and support for Java function calls and bring about concurrent programming....
Is mixing Clojure with Python a good idea?
1.2
0
0
3,402
10,558,044
2012-05-11T20:16:00.000
4
0
1
0
python,clojure
10,558,126
4
false
1
0
If you can build both sides to use Data and Pure(ish) Functions to communicate then this should work very well. wrapping your clojure functions in web services that take and retrun JSON (or more preferably clojure forms) should make them accessible to your Python based front end will no extra fuss. Of course it's more...
3
8
0
I am working on a big project that involves a lot of web based and AI work. I am extremely comfortable with Python, though my only concern is with concurrent programming and scaling this project to make it work on clusters. Thus, Clojure for AI and support for Java function calls and bring about concurrent programming....
Is mixing Clojure with Python a good idea?
0.197375
0
0
3,402
10,558,044
2012-05-11T20:16:00.000
0
0
1
0
python,clojure
10,562,377
4
false
1
0
In such scenarios I personally like to start in the below sequence. Divide the system into subsystems with "very clear" definition of what each system does and that definition should follow the principle of "do one thing and keep it simple". At this stage don't think about language etc. Choose the platform (not langua...
3
8
0
I am working on a big project that involves a lot of web based and AI work. I am extremely comfortable with Python, though my only concern is with concurrent programming and scaling this project to make it work on clusters. Thus, Clojure for AI and support for Java function calls and bring about concurrent programming....
Is mixing Clojure with Python a good idea?
0
0
0
3,402
10,558,381
2012-05-11T20:44:00.000
1
0
0
0
python
10,558,645
1
true
0
0
Look at the Python modules httplib and urllib for the fetching part. There are a couple xml modules in Python for parsing. You could also look at BeautifulSoup which is not part of standard Python modules.
1
0
0
I'm new to python and I need to know if there is and equivalent to perl's LWP and HTTP::Parse. I've a perl script to get the content from an URL and parsing it and I would like to port it to python.
python equivalent to perl's LWP and HTTP::Parse
1.2
0
1
909
10,558,670
2012-05-11T21:09:00.000
1
0
1
0
python,c,arrays
10,765,426
4
false
0
0
In Python, there are no “raw” values; everything is an object and knows its type. Even integers are objects (try printing (1).__class__ or 1 .__class__). Everything you do in C with Python objects, you do through a PyObject * (a pointer to the object).¹ A Python list is a dynamic (i.e. resizable) array of PyObject *. ...
1
1
0
Python can have a list with different data types in it i.e. [1,"two",3]. Python was implemented in c, so how would I create an array with different data types in it using c?
How does python have different data types in an array?
0.049958
0
0
3,734
10,558,986
2012-05-11T21:38:00.000
1
0
1
0
python
10,559,192
6
false
0
0
Rather than replacing it, you could overload the print function! In python 2.x this is not directly possible. But there are tools that convert python 2.x into python 3 code. Run your code through the converter, then overload the print function. Versions of python below 2.6 still support print functions (and hence overl...
2
6
0
I'm using python 2.6 and have a bunch of print statments in my long program. How can I replace them all with my custom print function, lets call it scribble(). Because if I just search and replace print with scribble( there is no closing parentesis. I think regular expressions is how, but I have experimented with th...
python replace print with function
0.033321
0
0
5,343
10,558,986
2012-05-11T21:38:00.000
0
0
1
0
python
10,559,016
6
false
0
0
The is one place where a real IDE would help you out if you're not using one already. Using an IDE like PyCharm or Eclipse you could use refactoring to replace all calls to a particular function with a different call.
2
6
0
I'm using python 2.6 and have a bunch of print statments in my long program. How can I replace them all with my custom print function, lets call it scribble(). Because if I just search and replace print with scribble( there is no closing parentesis. I think regular expressions is how, but I have experimented with th...
python replace print with function
0
0
0
5,343
10,560,005
2012-05-12T00:10:00.000
1
1
0
0
python,module,urllib2,httplib
10,569,571
1
false
0
0
Okay, I'm so silly. Here's the answer I was looking for r = requests.get("http://someurl") r.history[1].url will return the URL
1
1
0
I'm writing a script, to help me do some repetitive testing of a bunch of URLs. I've written a python method in the script that it opens up the URL and sends a get request. I'm using Requests: HTTP for Humans -http://docs.python-requests.org/en/latest/- api to handle the http calls. There's the request.history that re...
Python trace URL get requests - using python script
0.197375
0
1
1,706
10,560,041
2012-05-12T00:18:00.000
1
0
0
0
python,listbox,tkinter
10,560,466
1
false
0
1
Bind to the event <<ListboxSelect>> instead of <1>, this event will fire after the current selection has been updated. If you genuinely need for the binding to work literally on a press of the mouse button you will have to rearrange the order of the bind tags for the widget.
1
1
0
After creating a simple window/widget layout with Page (page.sourceforge.net) I found that the listbox curselection() call returns the proper index when releasing Button-1. When hit, it returns the previous index (the item which we just leave). Becasue of some timer activities I'd like to get the clicked index at click...
Getting Tkinter listbox item when hit Button-1
0.197375
0
0
875
10,560,446
2012-05-12T01:58:00.000
0
0
0
0
python,pygame
33,223,021
4
false
0
1
The above code posted by aquasheep is brilliant! Although in lines: for i in range(0,sheet_rect.height-len_sprt_y,size[1]):#rows for i in range(0,sheet_rect.width-len_sprt_x,size[0]):#columns I had to remove -len_sprt_y and -len_sprt_x it just would not load the last sprites on the x and y axis. It may vary depending ...
1
9
0
I want to import a sprite sheet and select one sprite. How would I do this in Python/pygame?
How do you select a sprite image from a sprite sheet in Python?
0
0
0
13,966
10,561,025
2012-05-12T04:12:00.000
0
0
0
0
python,database,django,api
18,869,159
3
false
1
0
Try django-extensions it has a runscript command you put in a scripts directory. Oddly the command seems to be missing from the main documentation but if you google django-extensions runscript you will find examples and documentation.
1
1
0
I'm try to populate data into my db and I'd like to use the django API to do so. I've written a python module that allows me to this very easily. However, within the django shell (manage.py), it doesn't seem possible to run my "populate.py" file. Is it possible to run my populate.py from the django shell? Or alternati...
running python module from django shell (manage.py)
0
0
0
3,142
10,561,426
2012-05-12T05:52:00.000
0
0
0
0
python,plone
10,561,638
1
true
0
0
Products.PressRoom is the answer yahooo! :)
1
0
0
Hi I have tried UpfrontContacts, collective.contacts couldn't get to build the zope.conf. Any for the version of Plone i.e 4.1 ? Please let me know the exact steps to implement the same also. Also tried Membrane. But don't know how to use it.
Any addons for contacts for Plone 4.1
1.2
0
0
78
10,562,380
2012-05-12T09:07:00.000
2
0
0
0
python,html,iteration,web-scraping
10,562,395
2
false
1
0
Recursion is usually the easiest way to go. However, that might give you a StackOverflowError after some time if someone creates a directory with a symlink to itself or a parent.
1
0
0
I need to scrape a website that has a basic folder system, with folders labled with keywords - some of the folders contain text files. I need to scan all the pages (folders) and check the links to new folders, record keywords and files. My main problem ise more abstract: if there is a directory with nested folders and ...
HTML scraping: iterating through nested directories
0.197375
0
1
273
10,563,162
2012-05-12T11:06:00.000
0
0
1
0
python,licensing,virtualenv
10,564,061
2
false
0
0
I'm not a lawyer, but just on common sense I'm pretty sure that when you're distributing a big collection of copyrighted documents covered by numerous licenses that you would have to clearly communicate what licenses cover what documents in order for the licensees to know what license conditions they have to adhere to....
1
3
0
I'd like to provide a Python application to a client as zipped Virtualenv directory. I'm wondering what's the best way to include the licenses of Python itself and of the used 3 party libraries. What do I have to keep in mind? I'd need to include the licences of Python, pip and any installed libraries, right? What woul...
Licences of 3 party code: What do I have to keep in mind? What's the best way to organize them?
0
0
0
82
10,565,079
2012-05-12T15:36:00.000
0
0
0
1
python,eclipse,pydev
10,644,024
1
false
1
0
Maybe you have an old version of the debugger in your pythopath? Please check your interpreter configuration and see if you didn't add it there by accident.
1
0
0
i get a incompatible debugger version in eclipse while using pydev my default port of the pydev debugger is 5678
I am getting incompatitble debugger version in eclipse while using pydev
0
0
0
113
10,565,929
2012-05-12T17:25:00.000
1
0
0
1
python,google-app-engine,web2py
10,566,246
1
true
1
0
You have to read the logs on GAE dashboard to figure out the Python exception it is throwing
1
2
0
I'm working with Web2py and Google App Engine SDK. I have an action that works using the WSGI version, but fails when running on SDK. Inside this action, there are no imports specific from GAE libraries... but I can't figure out what is wrong cause I only got the message: Internal error Ticket issued: unknown And there...
How to find the error on web2py and GAE SDK when I got Internal error - Ticket issued: unknow
1.2
0
0
554
10,566,204
2012-05-12T18:08:00.000
3
0
1
0
python,regex
10,566,357
3
true
0
0
You could use also re.findall('[(][^)]*[)]|\S+', key), if you do not have parentheses within parentheses.
1
3
0
I'm splitting strings to generate keys for a dictionary but I'm having trouble with parentheses. I'd like to take the string contemporary building(s) (2000 c.e. to present) and split it into three keys: contemporary, building(s), and (2000 c.e. to present) Up to now, I've been using re.findall('\w+', key) Any help is g...
How can I split a string while preserving parentheses
1.2
0
0
266
10,567,766
2012-05-12T22:09:00.000
1
1
1
0
visual-studio-2010,visual-studio,ironpython,ptvs
10,568,603
1
true
0
0
You probably are running the latest version of IronPython and re-installed PTVS. PTVS currently installs IronPython support conditionally on whether or not it detects that IronPython is installed. Something changed in the latest version of IronPython and the PTVS installer fails to detect that IronPython is installed...
1
2
0
I wanted to change interpreter to IronPython in Visual Studio 2010 with Python Tools for Visual Studio. Last time I hadn't problems with this I got CPython and IronPython on list but now IronPython magically disappeared. After this I tried to restore it and done this: I reinstalled PTVS, this still didn't helped I rei...
PTVS doesn't detect IronPython installation
1.2
0
0
853
10,569,251
2012-05-13T04:07:00.000
5
0
1
0
python,functional-programming
10,569,397
2
true
0
0
You're right that an iterator can return a different result on each call, so it cannot be called referentially transparent. However, the aggregate actions of consuming an iterable can be referentially transparent eventhough the individual steps are not. For example, list('cat') is deterministic and referentially trans...
2
2
0
It seems obvious to me that an Iterator object X, the methods: X.next() python 2.x X.__next__() python 3.x are not referentially transparent because every invocation returns a different result. But, I just need confirmation that I am correct. Thanks.
Is the next method referentially transparent for python Iterators?
1.2
0
0
101
10,569,251
2012-05-13T04:07:00.000
0
0
1
0
python,functional-programming
10,569,323
2
false
0
0
It is as referentially transparent as X will let it be. The method itself does not change transparency, but the iterable can be as simple or as complex as desired.
2
2
0
It seems obvious to me that an Iterator object X, the methods: X.next() python 2.x X.__next__() python 3.x are not referentially transparent because every invocation returns a different result. But, I just need confirmation that I am correct. Thanks.
Is the next method referentially transparent for python Iterators?
0
0
0
101
10,569,310
2012-05-13T04:26:00.000
3
0
0
0
python,django,pinax,django-1.3
10,571,697
5
false
1
0
The problem that pinax solves is that it avoids you hunting around for the best app that does something, as pinax bundles it together for you. So if you want to get something up and running quickly, pinax makes that easy. For example, it is - by far - the quickest way to get a django project going with twitter bootstra...
3
15
0
I am trying to understand Pinax and plan to use it in my next project. I have started with a pinax basic project, and now I have something to go with runserver. Now, I understand that I can customize the initial setup that I got from pinax and customize the profiles, themes, etc as per my requirements. But is that all ...
Django-Pinax : How do you use a pinax app apart from what you get with a pinax base project?
0.119427
0
0
4,505
10,569,310
2012-05-13T04:26:00.000
9
0
0
0
python,django,pinax,django-1.3
10,908,828
5
true
1
0
You seem to be assuming that unless all of Pinax is useful, Pinax as a project isn't useful. It was never the intention that Pinax be a single thing, all of which you use on a given project. If all you find helpful is the project layout, that's fine. Pinax suggests a standard project layout (which you can use alone wit...
3
15
0
I am trying to understand Pinax and plan to use it in my next project. I have started with a pinax basic project, and now I have something to go with runserver. Now, I understand that I can customize the initial setup that I got from pinax and customize the profiles, themes, etc as per my requirements. But is that all ...
Django-Pinax : How do you use a pinax app apart from what you get with a pinax base project?
1.2
0
0
4,505
10,569,310
2012-05-13T04:26:00.000
1
0
0
0
python,django,pinax,django-1.3
10,692,708
5
false
1
0
Pinax 0.7 was bundled with some apps and starter projects like social_projects which could be used for building a site more quickly, but I things changed in pinax 0.9. I think pinax has reinvented its structure for some reasons (eg,In pinax 0.7 some people were complaining that it was messy to customize starter projec...
3
15
0
I am trying to understand Pinax and plan to use it in my next project. I have started with a pinax basic project, and now I have something to go with runserver. Now, I understand that I can customize the initial setup that I got from pinax and customize the profiles, themes, etc as per my requirements. But is that all ...
Django-Pinax : How do you use a pinax app apart from what you get with a pinax base project?
0.039979
0
0
4,505
10,569,341
2012-05-13T04:37:00.000
0
0
0
0
python,django
10,572,800
1
false
1
0
What I can think of: You can use a custom authentication backend. Allow someone to enter a playername and password (or whatever you use for authorisation). Log in the user associated with that player (in order to be able to keep using Django's authentication system), but store which player was selected. When editing pl...
1
0
0
I have a Django app set up using standard Django user auth. In which users can log in, add their players (Player model - Foreign Key to User model), and add results for their players (Results model - Foreign Key to Player model). I would like to also have the players (each entry in Player model) that the user creates b...
Multiple logins accessing specific results without using groups in Django
0
0
0
43
10,569,768
2012-05-13T06:26:00.000
10
0
0
0
python,google-app-engine,python-2.7,wsgi,webapp2
10,594,001
4
false
0
0
You can fetch the query string to the current request with self.request.query_string; thus you can redirect to a new URL with self.redirect('/new/url?' + self.request.query_string).
1
19
0
I want to make a redirect and keep what is the query string. Something like self.redirect plus the query parameters that was sent. Is that possible?
How to make a redirect and keep the query string?
1
0
1
12,957
10,569,853
2012-05-13T06:47:00.000
0
0
1
0
python,list,sorting,dictionary
10,569,942
2
false
0
0
have you already tried sorted(list_for_sorting, key=dictionary_you_wrote.__getitem__) ?
1
3
1
I'm trying to make a sorting system with card ranks and their values are obtained from a separate dictionary. In a simple deck of 52 cards, we have 2 to Ace ranks, in this case I want a ranking system where 0 is 10, J is 11, Q is 12, K is 13, A is 14 and 2 is 15 where 2 is the largest valued rank. The thing is, if ther...
Sorting a list with elements containing dictionary values
0
0
0
198
10,570,615
2012-05-13T09:19:00.000
2
0
0
0
python,xml,lxml
10,570,673
2
true
0
0
No you generally cannot - and not just XML files, any file format. You can only update "in place" if you overwite bytes exactly (i.e. don't add or remove any characters, just replace some with something of the same byte length). Using a form of database sounds like a good option.
1
1
0
I'm working on a script which involves continuously analyzing data and outputting results in a multi-threaded way. So basically the result file(an xml file) is constantly being updated/modified (sometimes 2-3 times/per second). I'm currently using lxml to parse/modify/update the xml file, which works fine right now. B...
Are there ways to modify/update xml files other than totally over writing the old file?
1.2
0
1
153
10,570,652
2012-05-13T09:23:00.000
2
0
0
0
python,plone
10,571,827
1
true
1
0
zope.formlib applies actions based on the presence of the action name in the request; usually this is done by giving the submit button the name of the action. By including that name in your GET request you thus invoke the action. Note that actions are prefixed by both the form identifier and the 'action' keyword, so th...
1
2
0
I've a form built with zope.formlib. When I fill the form and push submit, I can see the result in the browser. Now, I would like to reference these results from other places so the results would be avaible for the users without filling the form. I've tried to built an URL adding the parameters after the form URL to do...
Send GET request to Plone form built with zope.formlib
1.2
0
0
319
10,571,484
2012-05-13T11:52:00.000
1
0
1
0
python,eclipse,pydev,indentation
10,644,095
2
true
0
0
Check in the preferences > general > workspace if you have 'refresh on access' and 'refresh with native hooks' both checked (that may solve your problem). Another thing to check is in your external tool configuration: it has a 'refresh' tab, where you can choose to refresh the selected resource upon completion. Another...
1
2
0
I'm new to eclipse. One thing I notice about eclipse+PyDev is that it give me warning if the indentation is not in multiple of 4 space. That is fine because I could use "reindent.py" to just reindent it. And I manage to setup it as the external tools. But the problem is, when I use it, (using Run->Externaltools->reinde...
Eclipse, using external tools to edit text directly
1.2
0
0
665
10,571,655
2012-05-13T12:18:00.000
3
0
0
1
python,monitoring,tornado
10,576,242
1
true
0
0
The question is a bit obscure but the assumption here is that you are asking what web application performance monitoring tools exist. In this case you are asking for one that will work with the Tornado ASYNC API vs the WGSI container that sits on top of Tornado web server. You mention 'RPM Lite' which would interpret a...
1
3
0
Tornado web can be used wth WSGI or ASYNC container. There are numerous solutions for WSGI container. Most appealing solution by now is RPM Lite, but it requires Tornado to run in wsgi mode which I do not want. I need solution that will fully monitor Tornado Async application. EDOT: Thanks @Graham for reading between...
What is best monitoring tool for Tornado as Async container?
1.2
0
0
1,541
10,571,960
2012-05-13T13:03:00.000
1
0
0
0
python,django,django-admin,celery,django-celery
10,572,634
3
false
1
0
You can simply unregister celerys models like admin.site.unregister(CeleryModelIdoNotWantInAdmin)
1
8
0
I have no need to the celery modules in my Django admin. Is there a way I could remove it?
How can I disable the Django Celery admin modules?
0.066568
0
0
3,492
10,573,217
2012-05-13T16:13:00.000
3
0
0
1
python,google-app-engine,backend,background-thread
10,573,307
1
false
1
0
There is a combobox in the top left corner of the versions/backends of your application switch to the backend there and you will see the backend logs.
1
2
0
I'm writing an app that writes log entries from a BackgroundThread object on a backend instance. My problem is that I don't know how to access the logs. The docs say, "A background thread's os.environ and logging entries are independent of those of the spawning thread," and indeed, the log entries don't show up with t...
Where are the logs from BackgroundThreads on App Engine?
0.53705
0
0
354
10,574,403
2012-05-13T19:03:00.000
0
0
1
0
python,artificial-intelligence
10,574,718
2
false
0
0
You want a directed graph, where bot statements are nodes and player responses are arcs. You may also want arcs to have some built-in intelligence - to enable/disable themselves based on player state (ie if the player does not have the blue key then "unlock the blue door" is not an available option). Sample code to fol...
1
4
0
I'm working on a text-based RPG in Python, but I'm stuck on NPCs. I need something that's kind of like a tree. For example: Bot: hello there. 1. Hi, what's your name? 2. Hi, Where do you live? > 2 Player: Where do you live? Bot: That's a creepy question. Why do you ask? 1. I was just curious. 2. Never mind. 3. Hide yo...
Python tree-based chat bot
0
0
0
2,649
10,575,184
2012-05-13T20:57:00.000
2
0
0
1
python,google-app-engine
10,575,238
3
false
1
0
Those warnings shouldn't prevent you from seeing new 'content,' they simply mean that you are missing some libraries necessary to run local versions of CloudSQL (MySQL) and the Images API. First to do is try to clear your browser cache. What changes did you make to your Hello World app?
3
0
0
I am absolute beginner using google app engine with python 2.7. I was successful with creating helloworld app, but then any changes I do to the original app doesn't show in localhost:8080. Is there a way to reset/refresh the localhost. I tried to create new projects/directories with different content but my localhost c...
Localhost is not refreshing/reseting
0.132549
1
0
437
10,575,184
2012-05-13T20:57:00.000
0
0
0
1
python,google-app-engine
10,593,822
3
false
1
0
Press CTRL-F5 in your browser, while on the page. Forces a cache refresh.
3
0
0
I am absolute beginner using google app engine with python 2.7. I was successful with creating helloworld app, but then any changes I do to the original app doesn't show in localhost:8080. Is there a way to reset/refresh the localhost. I tried to create new projects/directories with different content but my localhost c...
Localhost is not refreshing/reseting
0
1
0
437
10,575,184
2012-05-13T20:57:00.000
0
0
0
1
python,google-app-engine
41,388,817
3
false
1
0
You can try opening up the DOM reader (Mac: alt+command+i, Windows: shift+control+i) the reload the page. It's weird, but it works for me.
3
0
0
I am absolute beginner using google app engine with python 2.7. I was successful with creating helloworld app, but then any changes I do to the original app doesn't show in localhost:8080. Is there a way to reset/refresh the localhost. I tried to create new projects/directories with different content but my localhost c...
Localhost is not refreshing/reseting
0
1
0
437
10,575,432
2012-05-13T21:34:00.000
0
0
0
0
python,html
10,576,447
2
false
1
0
Yes it is possible. You have to use the web frameworks such as Django to do this. You can receive the input from the HTML file with name attribute in the HTML file and if you return back the output you can use the value attribute. Web Frameworks use Handlers to receive and post the data to the HTML form. In order to ...
1
2
0
I have a Python script that runs on my Linux server. I want to make a simple HTML page to be the "front-end" of my script. It will just take 2 values from a web form (that user will insert acessing the webpage) and send them to the Python script on background as variables, then Python will operate with these values and...
Python with HTML front-end
0
0
0
4,095
10,576,151
2012-05-13T23:55:00.000
1
1
1
0
python,macports
12,093,366
2
false
0
0
The proper solution for this problem was to make it sure your PYTHONHOME environment variable is set correctly. You will receive this error if PYTHONHOME is pointing to invalid location or to another Python installation you are trying to run.
2
1
0
Ok, I recently installed Python27 with macports, but something happened and I created a mess. So I uninstalled it with sudo port uninstall --follow-dependents python27. Then I reinstalled it, did sudo port select --set python python27. All successful up to this point. But now I go to run python, and I get an error: Im...
ImportError: No module named site - Python27 - MacPorts
0.099668
0
0
3,480
10,576,151
2012-05-13T23:55:00.000
0
1
1
0
python,macports
25,899,137
2
false
0
0
I had this problem and in the end it turned out to be to do with permissions. Stupid mac-ports did something, not quite sure what, but I applied sudo chmod -R a+x $PYTHONPATH (which basically makes all files beneath $PYTHONPATH executable by everyone). It's a nasty, and perhaps dangerous fix from a security perspective...
2
1
0
Ok, I recently installed Python27 with macports, but something happened and I created a mess. So I uninstalled it with sudo port uninstall --follow-dependents python27. Then I reinstalled it, did sudo port select --set python python27. All successful up to this point. But now I go to run python, and I get an error: Im...
ImportError: No module named site - Python27 - MacPorts
0
0
0
3,480
10,577,866
2012-05-14T05:26:00.000
1
0
0
0
python,plone
10,596,347
1
true
1
0
Go to Site setup / CSV Replicata tool, and select PressRoom content(s) as exportable (and then select the schemata you want to be considered during import/export).
1
1
1
How to use Products.csvreplicata 1.1.7 with Products.PressRoom 3.18 to export PressContacts to csv in Plone 4.1? Or is there any other product to import/export all the PressRoom contacts into csv.
How to use Products.csvreplicata 1.1.7 with Products.PressRoom to export PressContacts in Plone 4.1
1.2
0
0
153
10,578,763
2012-05-14T07:01:00.000
0
0
0
0
python,webcam
10,578,877
1
true
0
0
not really sure what you want to happen but if your going to implement this kind of feature in a website I think you should use a flash application instead of python (or if possible html 5). though your using python on the development of you web app it would only run on the server side instead and the feature you want ...
1
3
0
I have written a program using Python and OpenCV where I perform operations on a video stream in run time. It works fine. Now if I want to publish it on a website where someone can see this using their browser and webcam, how do I proceed?
Access webcam over internet using Python
1.2
0
1
878
10,579,518
2012-05-14T08:04:00.000
0
0
0
0
python,random
71,463,872
10
false
0
0
If you want to generate 2 random integers between 2 negative values than print(f"{-random.randint(1, 5)}") can also do the work.
1
15
1
I am starting to learn python, I tried to generate random values by passing in a negative and positive number. Let say -1, 1. How should I do this in python?
How to generate negative random value in python
0
0
0
43,543
10,579,824
2012-05-14T08:29:00.000
72
0
1
0
python,wxpython,jython,ironpython
10,579,887
1
true
0
1
Jython and IronPython are different python implementations, both of which run on different virtual machines. Jython runs on the JVM (Java virtual machine) and IronPython runs on the CLR (common language runtime). This means that programs using these implementations can take advantage of the libraries and ecosystem of t...
1
41
0
I am quite new in Python programming. While googling I found some of the Python related words. I just wanted to know what is the difference among Python, Jython, IronPython, and wxPython. I know wxPython is for GUI programming. But what are Jython and IronPython? Please help me.
What is the difference between Python vs Jython vs IronPython vs wxPython?
1.2
0
0
37,688
10,580,772
2012-05-14T09:36:00.000
0
0
0
0
python,html,selenium
10,586,476
2
false
1
0
For the Selenium RC API, you need to use the SelectWindow command to switch to the pop-up window. The window can be specified either by its name (as specified on the JavaScript window.open() function) or its title. To switch back to the main window, use SelectWindow(None).
1
5
0
I have an issue when trying to test a web application with Selenium/Python. Basically I can't test elements of a pop-up window. A scenario: I can test all elements for a page. But when I go to click on a button that opens up a small pop up box I can't test the elements on the popup. It's like the pop up isn't in focus...
Selenium: Testing pop-up windows
0
0
1
7,687