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 releases, the most recent release includes both extrusions, materials, and skins, which allow you to customize your appearance much moreso than before.
It is probably worth noting also, that it is simply not possible to make render-quality images in real time (cycles is a huge step in that direction, but it's still not quite there). I believe that most of your issue here is you are looking for something that technology is simply not capable of now, however if you are willing to take on the burden for making your simulation look visually appealing, Vpython (which is a gussied up version of PyOpenGL) is probably your best bet. Below is a run down of different technologies though, in case you are looking for anything more general:
Blender: The most powerful python graphics program available, however it is made for graphic design and special effects, though it has very complex physics running underneath it, Blender is not made for physics simulations. Self contained.
Panda3D: A program very often compared to Blender, however mostly useful for games. The game engine is nicer to work with than Blender's, but the render quality is far lower, as is the feature-richness. Self contained
Ogre: A library that was very popular for game development back in the day, with a lot of powerful functionality, especially for creating game environments. Event handling is also very well implemented. Can be made to integrate with other libraries, but with difficulty.
VPython: A library intended for physics simulations that removes a lot of the texture mapping and rendering power compared to the other methods, however this capability is still there, as VPython is largely built from OpenGL, which is one of the most versatile graphics libraries around. As such, VPython also is very easy to integrate with other libraries.
PyOpenGL: OpenGL for Python. OpenGL is one of the most widely use graphics libraries, and is without a doubt capable of producing some of the nicest visuals on this list (Except for Blender, which is a class of its own), however it will not be easy to do so. PyOpenGL is very bare bones, and while the functionality is there, it will be harder to implement than anything else. Plays very will with other libraries, but only if you know what you're doing.
| 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 python-ogre but I'm not sure if it is really suited for exact simulations. Also, I would prefer a library that combines well with other libraries (E.g. pygame does not combine so well with other libraries).
|
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 ask specific focused
questions.
-- Dennis Williamson
| 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 newly created folder structure
Clone another (Mercurial) repository as a sub-repository of the above baseline repository
Modify .hgsub config file (Mercurial) to set up sub-repository
Modify hgrc config file (Mercurial) to set up default push folder
Do an initial commit (Mercurial)
Create a series of aliases in my bash_profile
What's the best (or easiest) way to script the above workflow? I'd like to pass a couple of parameters such as project name, and sub-repository name, etc.
Is this something that I can easily to in a shell script? Automator? Python script?
Thanks.
Prembo.
|
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 Django.
| 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 then store a list of engines wherever you prefer and return the correct one.
When using Ming/MongoDB the same can probably be achieved by subclassing the ming.Session in model/session.py and overridding the ming.Session.db property to return the right database.
| 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 beforehand in the development.ini.
Is there a way to just connect to the db server(or to a particular database first) and then get the list of databases and select one on the fly?
|
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.
The subprocess is not a Python script but can be edited if absolutely necessary. In total I will have around 15 of these subprocesses.
|
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.
The subprocess is not a Python script but can be edited if absolutely necessary. In total I will have around 15 of these subprocesses.
|
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 model components. Qt does provide fatures to persist data structures to disc in binary (QDataStream), text (QTextStream) and XML (QDomDocument) formats. However if you're using PyQt you're probably better off using Python's built-in data persistence libraries such as Pickle or Shelve, or it's JSON or XML libraries.
| 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 commands that do an atomic 'copy then delete' for you, but it is dependent of your database engine capabilities.
In your case of old records archiving, a robust approach can be to copy the records you want to archive by chunks by copying blocks of n records (n sized to your amount of data you can temporary clone, it is a trade-off between temporary additional size and the overhead of a copy delete action), then deleting those n records, and so on until to archive all the records fulfilling your condition Time32 field older than a given timestamp threshold.
| 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 old rows in working table, and store in other table reserved for storing archive records. Is it possible? If yes, what is most efficient way?
I know for whereAppend() method, but this method only copy records, not delete from actual table. Thaks for advice. Cheers!
|
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 module, where main.py and engine.py could import from, without any problem.
| 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 things like sizes of onscreen objects, speed of the simulation and color of various objects are defined, what do I do if those variables are needed both in my engine.py script and my main.py script? Do I import it two times, in both scripts? It seems rather messy. What if some of my classes, that are in the engine.py script, require code from main.py?
Let me show you the exact situation...
My main.py script imports Pygame in itself, initializes it, and so on. It used to have a class which represented an onscreen object, and that class had a method draw, which just called a Pygame draw function. Now, when I put the class inside my engine.py script, things no longer work, because Pygame doesn't exist there! I ended up importing both settings.py and Pygame in the engine.py, and then importing the engine into main.py, but then it's more like an initializer than an engine... Is there a way to deal with things like these, like general guide lines?
|
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 document parts and page layouts.
The reason you are having problems, by the way, is that xhtml2pdf has to essentially act like a HTML rendering engine that outputs to PDF rather than the screen directly. As it took a long time and a lot of effort to make good rendering engines for browsers, so, too, does it seem that xhtml2pdf will take a lot of effort to make it of similar quality. This isn't to say that xhtml2pdf is bad, just that it's going to take time for it to be as good as rendering in a browser, and if PDF output for its own sake is what you really are interested in, I think using ReportLab directly is a better choice.
| 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 that is used by xhtml2pdf can not handle floating divs. Does a workaround exist? I have tried webkit rendering via QT but the resulting PDFs are of low quality, i.e. character spacing is completely wrong.
|
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? I see no log information in the appache log or somewhere else. I would expect some flag where I can say "DEBUG=True" or something like that. But I could not find anything in the documentation.
|
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 obviously not get the same PID. If you are multithreaded, get the thread id. If you have other aspects of your code in which a single thread or process could generate multiple different temp files, you might need to use another technique. A rolling index can work (if you aren't keeping them so long or using so many files you would worry about rollover). Keeping a global hash/index to "active" files would suffice in that case.
So sorry for the longwinded explanation, but it does depend on your exact usage.
| 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 done, preferably with either a method or a loop?
|
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 update my DB with its status (if download complete status = Downloaded ,if abort status = aborted , if Cancel Status= Canceled . How can i do this ?
|
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/Python.framework/Versions/2.7/lib/python2.7/site-package/hggit/: [Errno 2] No such file
or directory
So it probably is a Python environment set up error. Libraries and packages are there in place.
Any idea how to fix it?
Notes:
I installed hg-git following hg-git web site directions.
I also added the exact path to the extension in my .hgrc file as: hggit = /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-package/hggit/
Python was installed using official package on Python web site.
Echoing $PYTHONPATH in term print anything
|
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(): cursor keys not working. Operating system is Linux.
|
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 current playlist? And is it
neccessary for this to find frequencies?
And I am working in python 2.6 with module tkinter.
|
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.py
NameError: HashMap
Note: I can't modify file2.py as it already shipped to customer.
Thanks,
Ashok
|
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 to a Twitter API with the relevant info?
|
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 example)?
what exactly are you trying to classify? does the specified classification have specific words that are related to it?
So the question is rather broad. Maybe If you give more details You could get more relevant suggestions.
| 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 train the classifier but the accuracy is very poor(53%). What should I do to improve the accuracy?
|
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 weighting techniques such as log(1 + TF) * log(IDF) will improve accuracy. Good luck!
| 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 train the classifier but the accuracy is very poor(53%). What should I do to improve the accuracy?
|
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. As far as I know I dind't change my code and I've included import unittest.
I don't feel there is a need to post my code as there's no difference (except for the name odf the file) between the scripts that run and the scripts that don't run.
Any ideas?
|
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 standard library.
What questions should I ask a potential hosting service
Usually, in their technical specs they will list what databases/libraries/languages are supported. I have successfully ran Python sites w/ sqlite databases on Dreamhost.
SQLite would run on Unix
Most *nix flavors have pre-packaged sqlite installation binaries. The hosting provider should be able to tell you this as well.
| 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 Firefox extension. I could then store any number of tables and images (as binary). Once my site that uses this db is live, I could upload the db file to any web hosting service to any directory. In my site I could have a form that collects data and sends a request to write that data to the db file. Then, I could have an iOS app that connects to the db and reads the data. Did I get this right?
Would I be able to run a Python script that writes to SQLite? What questions should I ask a potential hosting service? (I want to leave MediaTemple, so I am looking around...)
I don't want to be limited to a Windows server, I am assuming SQLite would run on Unix? Or, does it depend on a hosting service? Thanks!
|
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 tutorial [your programming language]
| 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 know how to establish the communication and what is the communication structure. I'm not seeking for some codes but rather to know more about how to execute some java codes via other languages. I try to google it, but I mostly found the specific question/answer and not a tutorial or something like that. I wonder if I should search for a specific expression ? Do you know any tutorial or site whom explains such structures considering all aspects ?
Many thanks
Bye.
|
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, .txt etc). This appears to work for me.
| 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 with the code i can change it to save the text post as a file in blob store to do the same operation.
As stated newbie learning fast.
Many thanks in advance for any pointers.
|
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.
Create a summary table that lists each unique combination of response tags, along with a column that will indicate how many times this combination occurs. The table structure should be something like combination (id, count), combination_tags(combination_id, tag_id). Use a procedural statement (ORM or SQL Cursors) to populate the table, and then use ad-hoc queries to sample the data.
This is not a simple operation, but it will get you results using a simple RDBMS, without having to use enterprise level data mining solutions.
| 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:
How many instances of a given tag are there?
Which tags occur most frequently overall?
Where tag X is present, which other tags appear along with it most frequently?
List of all tags with the count of each next to it
Select subsets of the data to do similar analysis on (by country, for example)
The people I'm working with have traditionally tackled everything in Excel (general business strategy consulting work), and that won't work in this case. Their response is to change the project framework to something that Excel can handle in a pivot table, but it would be so much better if we could use more robust tools that allow for more sophisticated relationships.
I've been learning SQLite but am starting to fear that the kinds of things I want to do will be pretty complicated.
I've also been learning Python (for unrelated reasons) and am kind of wondering if an ORM tool and some Python code might be the better way to go.
And then there's something like Access (which I don't have but would possibly be willing to get if it's a sweet spot for this kind of thing).
In summary, I'd love to know how hard these kinds of analysis would be to do overall and which tools would best be suited for the job. I'm completely open to the idea that I'm thinking about some of or all of the problem in a way that's backwards and would welcome any advice on any aspect of what I've written here.
|
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:
How many instances of a given tag are there?
Which tags occur most frequently overall?
Where tag X is present, which other tags appear along with it most frequently?
List of all tags with the count of each next to it
Select subsets of the data to do similar analysis on (by country, for example)
The people I'm working with have traditionally tackled everything in Excel (general business strategy consulting work), and that won't work in this case. Their response is to change the project framework to something that Excel can handle in a pivot table, but it would be so much better if we could use more robust tools that allow for more sophisticated relationships.
I've been learning SQLite but am starting to fear that the kinds of things I want to do will be pretty complicated.
I've also been learning Python (for unrelated reasons) and am kind of wondering if an ORM tool and some Python code might be the better way to go.
And then there's something like Access (which I don't have but would possibly be willing to get if it's a sweet spot for this kind of thing).
In summary, I'd love to know how hard these kinds of analysis would be to do overall and which tools would best be suited for the job. I'm completely open to the idea that I'm thinking about some of or all of the problem in a way that's backwards and would welcome any advice on any aspect of what I've written here.
|
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, so users can get access to the data through a tool they are familiar with.
If you do go with SQL, a real database (SQLLite) is a better solution than MSAccess.
I feel strongly enough in SQL as an analysis tool that I wrote a book on the subject, "Data Analysis Using SQL and Excel". You might check out the Amazon comments (http://www.amazon.com/Data-Analysis-Using-SQL-Excel/dp/0470099518/ref=pd_sim_b_1) to understand how effective it can be.
| 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:
How many instances of a given tag are there?
Which tags occur most frequently overall?
Where tag X is present, which other tags appear along with it most frequently?
List of all tags with the count of each next to it
Select subsets of the data to do similar analysis on (by country, for example)
The people I'm working with have traditionally tackled everything in Excel (general business strategy consulting work), and that won't work in this case. Their response is to change the project framework to something that Excel can handle in a pivot table, but it would be so much better if we could use more robust tools that allow for more sophisticated relationships.
I've been learning SQLite but am starting to fear that the kinds of things I want to do will be pretty complicated.
I've also been learning Python (for unrelated reasons) and am kind of wondering if an ORM tool and some Python code might be the better way to go.
And then there's something like Access (which I don't have but would possibly be willing to get if it's a sweet spot for this kind of thing).
In summary, I'd love to know how hard these kinds of analysis would be to do overall and which tools would best be suited for the job. I'm completely open to the idea that I'm thinking about some of or all of the problem in a way that's backwards and would welcome any advice on any aspect of what I've written here.
|
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 out of the shared directory with host tools. You might be able to pull this off by installing to non-shared files, then copying the critical parts (like the src directory if you're doing this for development purposes) to a host directory, and then (and only then) establishing that existing host directory as a shared directory.
If you try it, let us know how it works!
| 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 to /home/me/www/plone, the installation always fails because Python fails to install. In the install.log it says
ln: failed to create hard link 'python' => 'python2.6': Operation not permitted
It looks like it might have something to do with access permissions, but I have tried to run the install script either using sudo or as a normal user, none of it helps. The script installs fine elsewhere, just not in the shared folder in Virtualbox.
Any suggestions?
More Information: I don't have a root account on Debian (testing, System Python version is 2.7) and always use sudo.
|
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 to /home/me/www/plone, the installation always fails because Python fails to install. In the install.log it says
ln: failed to create hard link 'python' => 'python2.6': Operation not permitted
It looks like it might have something to do with access permissions, but I have tried to run the install script either using sudo or as a normal user, none of it helps. The script installs fine elsewhere, just not in the shared folder in Virtualbox.
Any suggestions?
More Information: I don't have a root account on Debian (testing, System Python version is 2.7) and always use sudo.
|
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 completely self contained and work without reference to the presentation, they should also be able to support multiple presentations, possibly simultaneously."
In a limited sense in Django and some other Web frameworks this is now synonymous with objects that map to database tables, but as a generic concept is not limited to.
| 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 make things more interesting. The end result is that there is no way to useful way calculate the available bandwidth. The best you can do is to try downloading (or uploading, depending on what direction you are interested in) some testdata to the target server and see what bandwidth you can use. Keep in mind that TCP has a speeds up over time so you need to run your test for a while to get the real available bandwidth.
| 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 help will be appreciated.
|
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 CELERY_IMPORTS scripts what you want to use.
| 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, what could have happened?
|
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 on the windows box. Is there a way (perhaps another module) that will let me accomplish this? I need to have people on multiple boxes run a script that will interact with a MySQL database on a central server.
|
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 valid outside the scope of the func(A)?
|
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 far faster and more compact), isn't secure (don't ever use pickle as a storage format for cookies or other client-accessible data!), isn't interoperable (no implementations for non-Python languages exist)... but it works for objects and data types which aren't generally supported elsewhere (though not all Python objects).
| 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 easier/more convenient, and when would it get me into trouble? What sort of data or design pattern lends itself to pickle?
|
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 easier/more convenient, and when would it get me into trouble? What sort of data or design pattern lends itself to pickle?
|
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 pandas or is there a way for pandas to suck a list of files into a DataFrame.
|
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 pandas or is there a way for pandas to suck a list of files into a DataFrame.
|
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 surface, you could apply an appropriate map projection to this region, i.e., one that does not distort the shape of your area too much, and apply a standard binary search tree on these no-wrap-around cartesian map coordinates.
| 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 should at least confirm the user the cgi is running as
| 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 /var/www) and attempt to write the file some kind of error occurs because I get the "Internal Server Error" page.
The server is not mine and so I do not actually have sudo privileges. But from putty, I can manually run the executable, and it indeed writes the file.
My guess is I have to somehow run the executable from the python script with some amount of permission, but I'm not sure. I would appreciate any suggestions!
EDIT:
@gnibbler: Interesting, I was able to write the file to the /tmp directory with no problem.
So I think your suggestions are correct and the server simply won't allow me to write when calling the script from the browser.
Also, I cannot access the directory with the error logs, so I will have try to get permission for that.
|
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 multiple times, which is the correct behaviour.
How can I make it so, all new python process share this data, so it is only loaded a single time into memory?
|
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 that requires his attention. For example, if a user's credit card is about to expire, we need to show a nag saying "Your credit card is about to expire, click here to enter a new one". If a recent credit card charge failed, we need to show a nag. If he hasn't verified his email address, we need to show a nag.
Why not use the built-in messages framework? Because these nags are a bit different than messages. Messages are shown one time, and then they're cleared, while nags should show every time on every page on the website that the user visits. Nags should have a "close" button which will actually function as a "snooze" button, causing the message not to be shown for a specified time period, like 24 hours.
Did anyone implement something like this? A framework in which I can create these nags, specify their conditions for appearing, their snooze abilities, and possibly more features?
|
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-existent method calls on the fly.
I know that I didn't really understand why they call Python a dynamic language until I had fully come to terms with those possibilities.
| 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 and from that create a class which will have methods and attributes. So I have NO knowledge up front of what the class name, functions, arguments or anything will be until I parse the string.
Any ideas?
|
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 Clojure part consisted of (roughly) a controller, number crunching nodes, and a server implementing a JSON-over-HTTP API which was the interface to the Rails web app. The Clojure nodes used RabbitMQ to talk to each other. Because we defined clear APIs between different parts of the application, it was easy to later rewrite the frontend in Clojure (because that better suited our needs).
If you're working on a distributed project with a long life span and continuous development effort, it could make sense to design the application as a number of separate modules that communicate through well defined APIs (json, bson, ... over AMQP, HTTP, ... or a database). That means you can get started quickly using a language you're comfortable with, and rewrite parts in another language at a later stage if necessary.
| 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 this a good idea to do all the web-based api work with Python and let Clojure take care of most of the concurrent AI work?
Edit:
Let me explain the interaction in detail. Python would be doing most of the dirty work (scraping, image processing, improving the database and all that.) Clojure, if possible, would either deal with the data base or get the data from Python. I except something CPython sort of linking with Python and Clojure.
Edit2:
Might be a foolish question to ask, but this being a rather long term project which will evolve quite a bit and go under several iterations, is Clojure a language here to stay? Is it portable enough?
|
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 fun to write it in Clojure all the way through. ;)
If this is a long term project than building clean Functional (as in takes and returns values) interfaces that exchange Data becomes even more important because it will give you the ability to evolve the components independently.
| 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 this a good idea to do all the web-based api work with Python and let Clojure take care of most of the concurrent AI work?
Edit:
Let me explain the interaction in detail. Python would be doing most of the dirty work (scraping, image processing, improving the database and all that.) Clojure, if possible, would either deal with the data base or get the data from Python. I except something CPython sort of linking with Python and Clojure.
Edit2:
Might be a foolish question to ask, but this being a rather long term project which will evolve quite a bit and go under several iterations, is Clojure a language here to stay? Is it portable enough?
|
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 languages) on which these subsystems will run. Ex: JVM, Python VM, NodeJs, CLR(Mono), other VMs. Try to select few platforms or if possible just one as that does make life easier down the road in terms of complexity.
Choose the language to program those platforms. This is very subjective but for JVM you can go with Clojure or Jython (in case you like Dynamic languages as I do).
As far as Clojure future is concerned, this is a language developed by "community of amazing programmers" and not by some corporation. I hope that clears your doubt about the "long term" concern of Clojure. By the way Clojure is LISP, so you can modify the language the way you want it and fix things yourself even if someone don't do that for you.
| 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 this a good idea to do all the web-based api work with Python and let Clojure take care of most of the concurrent AI work?
Edit:
Let me explain the interaction in detail. Python would be doing most of the dirty work (scraping, image processing, improving the database and all that.) Clojure, if possible, would either deal with the data base or get the data from Python. I except something CPython sort of linking with Python and Clojure.
Edit2:
Might be a foolish question to ask, but this being a rather long term project which will evolve quite a bit and go under several iterations, is Clojure a language here to stay? Is it portable enough?
|
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 *. Since every object knows its type, the list doesn't have to be declared as having members of a specific type.
¹ Also note: Python does not have “variables” in the usual sense (C, BASIC, Pascal etc), where a typed variable contains a value; it has namespaces and names (actually, dictionaries mapping strings to objects; a namespace is a dictionary, its keys are the names, its values are the pointers to the objects pointed to by each name).
| 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 overloading) by using from future. So once coverted you code should still work on older versions. Though it seems most if not using 3.x are using 2.7 so you might not need from future
| 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 them for a day or so and I can't seem to get it to work.
|
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 them for a day or so and I can't seem to get it to work.
|
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 returns a list of status codes of the directs. I need to be able to access the particular redirects for those list of 301s. There doesn't seem to be a way to do this - to access and trace what my URLS are redirecting to. I want to be able to access the redirected URLS (status code 301)
Can anyone offer any advice?
Thanks
|
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-time, instead of release-time. Can somebody help me how could I do that? Thank you
|
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 on the sprite sheet x, y size and the actual sprite size too.
| 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 alternatively, should I instead be running a regular python terminal and importing the necessary django components? Either way, I would greatly appreciate some pointers.
|
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 unknown "depth", what is the most pythonc way to iterate through all of them. [if the "depth" would be known, it would be a really simple for loop). Ideas greatly appriciated.
|
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.
i.e. It seems ridiculous to suppose you could distribute a big blob of code and say "some of this is covered by the GPL, some is public domain, and some is covered by a proprietary license" without saying which is which. If you did, someone could then use some of your proprietary code as if it were public domain, and make the argument that they believed in good faith that it was public domain based on your information.
| 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 would be the best way to organize the licences? At the moment I'd include every licence in a file named Licence.txt. Would this be enough, or would I need to specify the exact path where the used code can be found?
This is my first project for a client and I'm kind of clueless ;)
I've tried to find the answer somewhere on the internet but I didn't find anything.
Thanks!
Best regards,
Daniel
|
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 is no ticket showing the error.
How can I debug web2py when working with GAE and specifically in this case?
|
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 greatly appreciated.
|
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.
The good news is you can manually select to install IronPython support. First un-install, then start the installer and on the very first screen there's an Advanced button. Click on that and when the feature tree comes up change IronPython support to be installed.
We've changed this for 1.5 so we'll always install IronPython support by default, so in the future this won't be an issue.
| 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 reinstalled IronPython in system and still nothing
So I thought to add this entry manual but I don't know what should I enter there. I can still create project in IronPython and IntelliSense properly suggest me assembles.
Could you show me how to force PTVS to rescan to look for IronPython or what should I enter to add this entry manually.
|
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 transparent eventhough the implementation of list makes repeated next calls on the string iterator.
| 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 bootstrap + other common plugins.
| 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 that pinax provides ?
I am very confused here, like I want to use the pinax phileo app in my project, so how does pinax helps me do that ?
My Effort :
I searched and found that I have to install it with pip install phileo
Then, add it to INSTALLED_APPS and use it as required.
But what did pinax do in this ?
Pinax has phileo featured on its website, but why ? Since I could have used it just like any other app on my non-pinax django project.
So, my question in a nutshell is :
What does pinax provide after a base project and default templates that come with pinax ?
Right, now it feels like pinax just provides a base project with some apps already working with some default templates. [ That's it ? ]
Then, what about other apps featured on pinax's website that do not come with base projects ?
Please, help clear up the confusion !
Update
My question is somewhat - What is the significance of pinax-ecosystem when we already have them listed somewhere like djangopackages.com ?
|
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 with pinax-project-zero).
If all you find helpful is the pinax-project-account (django-user-accounts and a few other things, already integrated with templates following bootstrap class naming) as a starting point for you site, that's great. Pinax is fundamentally about getting you started sooner and pinax-project-account is a suitable starting point for most sites with user accounts.
Once you have a project, you are free to add any Django apps you want. There's nothing that requires you to use Pinax apps. "So", you ask, "why does Pinax even bother having apps?".
Well, because apps aren't isolated. Reusability isn't just at the level of app but also groups of apps. Take, for example, a waiting list app, an invitations app, a referral code app, a points app, a badges app. Sure these can be developed and used independently.
But if they are developed with the same mind set you can make sure the waiting list app and invitations app and referral code app work well with the user account app (and don't duplicate anything). You can make sure the referral code app plays nicely with the points app and the points app plays nicely with the badges app. You can make sure your forum app doesn't try to do something your moderation app already provides. Or that each app isn't trying to solve avatars its own way.
So Pinax isn't trying to be a "directory" of apps. It's a family of apps, themes and starter projects written with each other in mind.
| 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 that pinax provides ?
I am very confused here, like I want to use the pinax phileo app in my project, so how does pinax helps me do that ?
My Effort :
I searched and found that I have to install it with pip install phileo
Then, add it to INSTALLED_APPS and use it as required.
But what did pinax do in this ?
Pinax has phileo featured on its website, but why ? Since I could have used it just like any other app on my non-pinax django project.
So, my question in a nutshell is :
What does pinax provide after a base project and default templates that come with pinax ?
Right, now it feels like pinax just provides a base project with some apps already working with some default templates. [ That's it ? ]
Then, what about other apps featured on pinax's website that do not come with base projects ?
Please, help clear up the confusion !
Update
My question is somewhat - What is the significance of pinax-ecosystem when we already have them listed somewhere like djangopackages.com ?
|
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 projects or to use only subset of certain starter projects so could pinax 0.9 provides more flexibility).
Some of the apps included in a pinax website are somehow coupled with each other so that it is easier to deploy them together,sometimes all you have to do is just installing them and the apps will communicate with each other.
| 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 that pinax provides ?
I am very confused here, like I want to use the pinax phileo app in my project, so how does pinax helps me do that ?
My Effort :
I searched and found that I have to install it with pip install phileo
Then, add it to INSTALLED_APPS and use it as required.
But what did pinax do in this ?
Pinax has phileo featured on its website, but why ? Since I could have used it just like any other app on my non-pinax django project.
So, my question in a nutshell is :
What does pinax provide after a base project and default templates that come with pinax ?
Right, now it feels like pinax just provides a base project with some apps already working with some default templates. [ That's it ? ]
Then, what about other apps featured on pinax's website that do not come with base projects ?
Please, help clear up the confusion !
Update
My question is somewhat - What is the significance of pinax-ecosystem when we already have them listed somewhere like djangopackages.com ?
|
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 player results, instead of checking only whether the player belongs to the correct user, also check whether it is in fact the player logged in as (if any).
| 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 be able to log in, but only be able to edit/add their own results. Just to be clear, the user and player would see the same results for that player, and each be able to add and edit them.
I don't believe this can be done with groups as the group would have to be user specific. Can anyone point me in the right direction please?
|
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 there is a list where I want to sort rank cards in ASCENDING order according to the numbering system, how do I do so?
For example, here is a list, [3,5,9,7,J,K,2,0], I want to sort the list into [3,5,7,9,0,J,K,2]. I also made a dictionary for the numbering system as {'A': 14, 'K': 13, 'J': 11, 'Q': 12, '0': 10, '2': 15}.
THANKS
|
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. But from what I can tell, you have to rewrite the whole xml file even sometimes you just add one entry/sub-entry like <weather content=sunny /> somewhere in the file. The xml file is growing bigger gradually, and so is the overhead.
As far as efficiency/resource is concerned, any other way to update/modify the xml file? Or you will have to switch to SQL database or similar some day when the xml file is too big to parse/modify/update?
|
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 the save action will generally be using the parameter name form.action.save:
@@page?param1=myparam1¶m2=myparam2&form.action.save=Save
Easiest way to discover the exact name of your action parameters is to just look at the output generated for your form and look for the .action. names.
| 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 a GET request like this: @@page?param1=myparam1¶m2=myparam2
This way I can't get the result to get load. It only shows the form.
Is there something missing? Does zope.formlib allow GET requests?
|
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 thing... if you have things just in a different indent (say 2 spaces), you can simply replace all 2 spaces by 4 spaces in the find instead of going through reindent...
| 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->reindent) it would modify the code in the background, so after that, it would pop up saying that the source code has been modified (duh!) would you like to to reload the file? (duh again!) So, my question is, is there a way to pipe the current selection of the source code through reindent (it uses standard input/output when given no argument) and then replace the selection with reindent standard output automatically. Thanks!
|
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 as being New Relic web application performance service. For that, as you found, only WSGI applications running on Tornado are currently supported and not the ASYNC API of Tornado. Some investigation of support for ASYNC Python web frameworks has been done but Tornado API wasn't used as test case for that and so not known when/if the ASYNC API may be supported.
As for alternatives, it depends on what you want to get out of this and is where you need to expand on the question. If you are more after tracking web traffic then you can alway using Google analytics or tools that extract details from web server logs.
If you are specifically after tools which can instrument the actual web application and tell you what is going on inside of it, including show time taken in database, web externals, etc, like New Relic does, then there isn't currently any other options that I know of for ASYNC systems and in particular Tornado ASYNC API.
| 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 lines, I've been expecting people that understand topic would have an answer.
|
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 the backend instance's entries on the admin console. But the admin console doesn't offer an option for showing the background threads.
appcfg request_logs doesn't seem to be the answer either.
Does anybody know?
|
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 follow.
| 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 kids, hide yo wife
> 1
Player: I was just curious.
Bot: Okay.
1. Do you like cheese?
2. Bye.
> 1
Player: Do you like cheese?
Bot: Yes! I LOVE cheese.
Each choice you make would branch off to other choices, A.K.A. if the user had answered '1' for the first question the bot would answer "My name is Bob. What's yours?"
My game is designed in a way where a level editor would not be an impossible prospect (every place you can visit is stored as a key in a dictionary, then a tuple containing everything in it [I have a shop class, an enemy class, a 'portal' class, and soon an NPC class]). So I'd like this created in a way so I can hold it all in a variable that my NPC class has stored (not a bunch of 'if' statements)
Just to clarify, I am NOT asking for someone to write code for me, I am just unsure about how to approach the problem.
Shortened description of exactly what I need:
Tree-like structure that begins with one string with a number of strings that 'branch off' from it
Each one of those strings has more 'branches'
The difference from this and a tuple of tuples is that there needs to be a string where they branch off rather than an immediate split.
|
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 constantly shows the old "Hello world!" I get the following in the log window:
WARNING 2012-05-13 20:54:25,536 rdbms_mysqldb.py:74] The rdbms API is not available because the MySQLdb library could not be loaded.
WARNING 2012-05-13 20:54:26,496 datastore_file_stub.py:518] Could not read datastore data from c:\users\tomek\appdata\local\temp\dev_appserver.datastore
WARNING 2012-05-13 20:54:26,555 dev_appserver.py:3401] Could not initialize images API; you are likely missing the Python "PIL" module. ImportError: No module named _imaging
Please help...
|
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 constantly shows the old "Hello world!" I get the following in the log window:
WARNING 2012-05-13 20:54:25,536 rdbms_mysqldb.py:74] The rdbms API is not available because the MySQLdb library could not be loaded.
WARNING 2012-05-13 20:54:26,496 datastore_file_stub.py:518] Could not read datastore data from c:\users\tomek\appdata\local\temp\dev_appserver.datastore
WARNING 2012-05-13 20:54:26,555 dev_appserver.py:3401] Could not initialize images API; you are likely missing the Python "PIL" module. ImportError: No module named _imaging
Please help...
|
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 constantly shows the old "Hello world!" I get the following in the log window:
WARNING 2012-05-13 20:54:25,536 rdbms_mysqldb.py:74] The rdbms API is not available because the MySQLdb library could not be loaded.
WARNING 2012-05-13 20:54:26,496 datastore_file_stub.py:518] Could not read datastore data from c:\users\tomek\appdata\local\temp\dev_appserver.datastore
WARNING 2012-05-13 20:54:26,555 dev_appserver.py:3401] Could not initialize images API; you are likely missing the Python "PIL" module. ImportError: No module named _imaging
Please help...
|
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 use the web frameworks, you need to install them in your server like you installed python in your Linux server.
| 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 make all the stuff works.
Is it possible?
Tks !
|
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:
ImportError: No module named site
Any ideas? It's been driving me crazy for the past hour.
Mac OS X Lion / Python 2.7 / MacPorts
|
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, but at this stage I just want to get it to work!
| 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:
ImportError: No module named site
Any ideas? It's been driving me crazy for the past hour.
Mac OS X Lion / Python 2.7 / MacPorts
|
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 to use is on a client side so for me it's more feasible to use flash instead to capture the video then after capturing the video you upload it to your server then your python code will do the rest of the process on the server side.
| 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 the virtual machines. For example, using Jython, I can write a plugin for a Java application, and using IronPython I can use the .NET standard library. The downside to using a different implementation to CPython is that CPython is the most used python, and therefore has the best support from libraries and developers. For example, a popular library like NumPy will only work on CPython, as it relies on CPython's C api, which neither Jython or IronPython can provide.
| 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 or active.
I can test elements on the next page. For example click a button, brings me on to next page, and I can work with elements on the 'next' page. So it the problem seems to be popup specific.
I could post code but to be honest it might confuse at this stage. I may post code in a later post, thanks
|
Selenium: Testing pop-up windows
| 0 | 0 | 1 | 7,687 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.