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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,816,203 | 2012-08-05T11:56:00.000 | 1 | 0 | 1 | 0 | python,image-processing,image-comparison | 11,817,479 | 4 | false | 0 | 0 | I can't give a ready to use answer, but I will point you in (I think) the right direction.
A simple way of comparing two images is by making a hash of their binary representations and then see if those hashes are the same. One problem with this is with the hash function you want to use and you must look for one that ha... | 1 | 12 | 0 | I need to compare two images that are screenshots of a software. I want to check if the two images are identical, including the numbers and letters displayed in the images. How can this be accomplished? | Compare Images in Python | 0.049958 | 0 | 0 | 32,588 |
11,817,673 | 2012-08-05T15:30:00.000 | 2 | 0 | 1 | 0 | python,serialization,nltk,corpus | 11,834,156 | 2 | true | 0 | 0 | In the terminology of the NLTK, a "corpus" is the whole collection, and can consist of multiple files. Sounds like you can store each forum session (what you call a "corpus") into a separate file, using a structured format that allows you to store metadata in the beginning of the file.
The NLTK generally uses XML for t... | 1 | 2 | 0 | I have a huge database of forum data. I need to extract corpora from the database for NLP purposes. The extracting step has parameters (for example FTS queries), and I'd like to save the corpus with the parameter metadata on the file system.
Some corpora will be dozens of megabytes large. What is the best way of saving... | Serializing corpora with python | 1.2 | 0 | 0 | 256 |
11,820,258 | 2012-08-05T21:34:00.000 | 0 | 0 | 0 | 0 | python,opencv,wxpython,pygame | 11,833,097 | 1 | false | 0 | 1 | I don't know why you'd want to embed a gaming library into wxPython in the hopes of gaining a performance boost. Personally, I don't think that will happen. You should take a look at the currently supported drawing canvases that wxPython provides instead or explain what you're trying to do. People have done in games in... | 1 | 1 | 0 | My goal is to capture frames from a webcam as efficiently as possible using OpenCV. At the moment I'm able to capture 30FPS 6408*480 drawing directly onto a wxPython panel using the standard drawing context (BufferedPaintDC), with about 15% CPU usage (older Core Duo processor). What I'm curious is what sort of performa... | wxPython, or PyGame canvas within wxPython -> which is faster? | 0 | 0 | 0 | 528 |
11,820,366 | 2012-08-05T21:52:00.000 | 2 | 0 | 0 | 0 | python,urlparse | 11,820,400 | 2 | false | 0 | 0 | The function urllib.urlencode is appropriate. | 1 | 5 | 0 | In Python's urlparse, you can use urlparse to parse the URL, and then parse_qsl to parse the query.
I want to remove a query (name, value) pair, and then reconstruct the URL.
There is a urlunparse method, but no unparse_qsl method.
What is the correct way to reconstruct the query from the qsl list? | Python urlparse.unparse_qsl? | 0.197375 | 0 | 1 | 782 |
11,820,566 | 2012-08-05T22:23:00.000 | 0 | 0 | 0 | 0 | python,django,amazon-s3,boto,django-storage | 57,364,827 | 5 | false | 1 | 0 | Simple workaround for me was to generate a new access key with only alphanumeric characters (ie no special characters such as "/", "+", etc. which AWS sometimes adds to the keys). | 1 | 3 | 0 | I have 2 files compiled by django-pipeline along with s3boto: master.css and master.js. They are set to "Public" in my buckets. However, when I access them, sometimes master.css is served, sometimes it errs with SignatureDoesNotMatch. The same with master.js. This doesn't happen on Chrome. What could I be missing?
EDIT... | Inconsistent SignatureDoesNotMatch Amazon S3 with django-pipeline, s3boto and storages | 0 | 0 | 0 | 5,584 |
11,821,116 | 2012-08-05T23:52:00.000 | 6 | 0 | 0 | 0 | python,django,twitter-bootstrap | 11,821,278 | 4 | false | 1 | 0 | I've been using django-crispy-forms with bootstrap for the last couple of months and it has been quite useful. Forms render exactly as they're meant to. If you do any custom form rendering though, be prepared to define your forms in code rather than in template, using helpers. | 1 | 70 | 0 | I want to start using Twitter's Bootstrap for a recently started Django app. I have quite a bit of experience with Django, but I'm totally new to Bootstrap.
What's the best way to proceed? Are there any particular Boostrap apps for Django you would recommend or have experience with?
I understand that I could use Bootst... | Django and Bootstrap: What app is recommended? | 1 | 0 | 0 | 50,626 |
11,821,322 | 2012-08-06T00:28:00.000 | 0 | 0 | 1 | 0 | python,database,json,dictionary | 11,821,761 | 8 | false | 0 | 0 | on the JSON direction there is also something called simpleJSON. My first time using json in python the json library didnt work for me/ i couldnt figure it out. simpleJSON was...easier to use | 2 | 28 | 0 | Currently expensively parsing a file, which generates a dictionary of ~400 key, value pairs, which is seldomly updated. Previously had a function which parsed the file, wrote it to a text file in dictionary syntax (ie. dict = {'Adam': 'Room 430', 'Bob': 'Room 404'}) etc, and copied and pasted it into another function w... | Elegant way to store dictionary permanently with Python? | 0 | 0 | 0 | 50,650 |
11,821,322 | 2012-08-06T00:28:00.000 | 3 | 0 | 1 | 0 | python,database,json,dictionary | 11,821,401 | 8 | false | 0 | 0 | If storage efficiency matters, use Pickle or CPickle(for execution performance gain). As Amber pointed out, you can also dump/load via Json. It will be human-readable, but takes more disk. | 2 | 28 | 0 | Currently expensively parsing a file, which generates a dictionary of ~400 key, value pairs, which is seldomly updated. Previously had a function which parsed the file, wrote it to a text file in dictionary syntax (ie. dict = {'Adam': 'Room 430', 'Bob': 'Room 404'}) etc, and copied and pasted it into another function w... | Elegant way to store dictionary permanently with Python? | 0.07486 | 0 | 0 | 50,650 |
11,822,111 | 2012-08-06T03:10:00.000 | 2 | 0 | 1 | 0 | python,file | 11,822,131 | 1 | false | 0 | 0 | Opening a file in a+ positions the pointer at the end of the file; truncation from there results in no change to the file. | 1 | 0 | 0 | python file object how to remove byte from current seed postion to end
f = open(filename, "a+")
truncate_pos = f.tell()
f.truncate(truncate_pos)
seems not work,how could i do? | python file object how to remove byte from current seed postion to end | 0.379949 | 0 | 0 | 138 |
11,822,790 | 2012-08-06T05:05:00.000 | 1 | 1 | 1 | 0 | python,unit-testing | 11,823,239 | 2 | false | 0 | 0 | The Python unittest is fine, but it may be difficult to add unit testing to a large project. The reason is that unit testing is related to the testing of the functionality of the tiniest blocks.
Unit testing means to use a lot of small tests that are separated each from the other. They should be independent on anything... | 1 | 2 | 0 | I am working on a project in Python, using Git for version control, and I've decided it's time to add a couple of unit tests. However, I'm not sure about the best way to go about this.
I have two main questions: which framework should I use and how should I arrange my tests? For the first, I'm planning to use unittest ... | How to arrange and set up unit testing in Python | 0.099668 | 0 | 0 | 489 |
11,823,586 | 2012-08-06T06:42:00.000 | 0 | 0 | 1 | 0 | python,django,multiprocessing | 11,823,901 | 2 | false | 1 | 0 | You can try celery as it's django friendly.
But if to be honest i'm not fond of it (bugs :)
We are going to switch to Gearman.
Writing your own job producers and consumers (workers) are a kind of a fun! | 1 | 1 | 0 | I'm trying to write a Web app in Python, which is to consist of two parts:
A Django-based user interface, which allows each user to set up certain tasks
Worker processes (one per user), which, when started by the user, perform the tasks in the background without freezing the UI.
Since any object I create in a view is... | Python multiprocessing and Django - I'm confused | 0 | 0 | 0 | 685 |
11,824,589 | 2012-08-06T08:06:00.000 | 4 | 0 | 1 | 1 | python,visual-studio-2010,ptvs | 11,826,101 | 4 | true | 0 | 0 | I found that if :
main.py is set as Startup File,
in the Properties of the project -> Debug tab -> Interpreter Path field, I put the path C:...\env\Scripts\python.exe (i.e. the python executable of the virtualenv)
It works ! | 1 | 6 | 0 | I don't know how to run the activate.bat in a Python Tools for Visual Studio Project. I have a directory environment in my project with my virtualenv. But, I don't know how I can run ./env/Scripts/activate.bat before the project run my main python script. | How to run a python script with Python Tools for Visual Studio in a virtualenv? | 1.2 | 0 | 0 | 30,422 |
11,824,697 | 2012-08-06T08:15:00.000 | 0 | 0 | 0 | 0 | python,opencv | 11,826,057 | 2 | false | 0 | 0 | Have you run 'make install' or 'sudo make install'? While not absolutely necessary, it copies the generated binaries to your system paths. | 2 | 0 | 1 | I downloaded opencv 2.4 source code from svn, and then I used the command 'cmake -D BUILD_TESTS=OFF' to generate makefile and make and install. I found that the python module was successfully made. But when I import cv2 in python, no module cv2 exists. Is there anything else I should configure? Thanks for your help. | Python For OpenCV2.4 | 0 | 0 | 0 | 329 |
11,824,697 | 2012-08-06T08:15:00.000 | 2 | 0 | 0 | 0 | python,opencv | 11,824,855 | 2 | true | 0 | 0 | You should either copy the cv2 library to a location in your PYTHONPATH or add your current directory to the PYTHONPATH. | 2 | 0 | 1 | I downloaded opencv 2.4 source code from svn, and then I used the command 'cmake -D BUILD_TESTS=OFF' to generate makefile and make and install. I found that the python module was successfully made. But when I import cv2 in python, no module cv2 exists. Is there anything else I should configure? Thanks for your help. | Python For OpenCV2.4 | 1.2 | 0 | 0 | 329 |
11,829,360 | 2012-08-06T13:34:00.000 | 1 | 1 | 0 | 1 | python,seo,indexing,robots.txt,googlebot | 11,829,421 | 2 | true | 1 | 0 | No. The search engine should not care what script generates the pages. Just so long as the pages generated by the webapps are indexed you should be fine.
Second question:
You should create a separate robots.txt per subdomain. That is when robots.txt is fetched from a particular subdomain, return a robots.txt file that ... | 1 | 0 | 0 | I am working on Web application, which allows users to create their own webapp in turn. For each new webapp created by my application I Assign a new Subdomain.
e.g. subdomain1.xyzdomain.com, subdomain2.xyzdomain.com etc.
All these Webapps are stored in Database and are served by a python script (say
default_script.py)... | Selectively indexing subdomains | 1.2 | 0 | 0 | 134 |
11,833,542 | 2012-08-06T18:05:00.000 | 1 | 0 | 1 | 0 | python-2.7 | 11,857,668 | 1 | true | 0 | 0 | What is the import error you get? pyspeech also needs pywin32.
Is that package installed? Also check if Microsoft speech kit is installed.
If everything is fine, add sys.path.append(site package path) at the top of your code. | 1 | 0 | 0 | I want to make and explore the speech to text using the python. So I searched on the google about the python speech to text api I have found pyspeech at the first and found it much easy to use but even after installing it I got some problems.
1) I have installed pyspeech using command prompt easy_install speech at the ... | pyspeech not working in python 2.7 | 1.2 | 0 | 0 | 731 |
11,837,330 | 2012-08-06T23:24:00.000 | 2 | 0 | 0 | 1 | python,buildbot | 12,306,901 | 1 | true | 0 | 0 | If you don't care about the name of the directory, just the name of the builder, you can set the builddir attribute of the builder to be whatever it currently is, then name you builder however you want.
The data stored in the builder directory is in pickles. Looking at the code, I think the only data could cause issues... | 1 | 22 | 0 | Is there a way to rename a build in buildbot without losing all of the logs?
For instance I have several windows slaves which all might build: "Windows 2008+ DEBUG" but I want to rename this build to: "Windows 2008R2+ DEBUG".
How do I set compare_attr (if that's even what I need to do) so that all of the logs/etc... ar... | rename a build in buildbot | 1.2 | 0 | 0 | 812 |
11,841,451 | 2012-08-07T07:50:00.000 | 1 | 0 | 1 | 0 | python,ide | 11,841,755 | 1 | true | 0 | 0 | I haven't used Editra in a while, but I think it's just the py2exe binary that's flagged the antivirus (which is subject to false positives). You can run the Editra source (IIRC, Editra comes with wxPython) directly. As per Editra vs IDLE, I'm sure Editra has some more functionality than IDLE.
Just my 2 cents. | 1 | 1 | 0 | I have been using this particular IDE (Editra) for about a year, previously it was version 0.6.77, the latest is version 0.7.08, after updating to the the newer version I built the exe with py2exe. The ide works fine, but Norton's Avirus flagged and quarantined it. The primary reason I use it is because it can be confi... | Is with Editra 0.7.08 a reliable IDE? | 1.2 | 0 | 0 | 155 |
11,843,817 | 2012-08-07T10:18:00.000 | 3 | 0 | 0 | 0 | python,django | 11,843,883 | 1 | false | 1 | 0 | You can create a "Run Configuration" in Eclipse to invoke manage.py. There is an "Arguments" tab that allows you to provide command line arguments. | 1 | 1 | 0 | I am doing project on django, and every time we have to run project we have to give commands in command prompt. Can we pass arguments to manage.py in eclipse(IDE) itself or at the runconfig.
Please throw some light on this. | python: how to pass parameters to application in eclipse without using command prompt | 0.53705 | 0 | 0 | 94 |
11,844,628 | 2012-08-07T11:08:00.000 | 3 | 0 | 1 | 0 | python,c,matplotlib | 13,551,794 | 1 | true | 0 | 0 | Finally resolved this - so going to explain what occurred for the sake of Googlers!
This only happened when using third-party libraries like numpy or matplotlib, but actually related to an error elsewhere in my code. As part of the software I wrote, I was extending the Python interpreter following the same basic patte... | 1 | 1 | 1 | I'm puzzling over an embedded Python 2.7.2 interpreter issue. I've embedded the interpreter in a Visual C++ 2010 application and it essentially just calls user-written scripts.
My end-users want to use matplotlib - I've already resolved a number of issues relating to its dependence on numpy - but when they call savefi... | Matplotlib with TkAgg error: PyEval_RestoreThread: null tstate on save_fig() - do I need threads enabled? | 1.2 | 0 | 0 | 2,495 |
11,845,803 | 2012-08-07T12:18:00.000 | 3 | 0 | 1 | 0 | python,datetime,time,timezone | 11,845,865 | 6 | false | 0 | 0 | time.time() returns the number of seconds since the UNIX epoch began at 0:00 UTC, Jan 1, 1970. Assuming the machines have their clocks set correctly, it returns the same value on every machine. | 2 | 42 | 0 | Apologies for asking too basic question but I couldn't get it cleared after reading docs. It just seems that I am missing or have misunderstood something too basic here.
Does calling time.time() from different timezones, at the same time produce different results? This maybe comes down to definition of epoch, which on ... | Is Python's time.time() timezone specific? | 0.099668 | 0 | 0 | 15,434 |
11,845,803 | 2012-08-07T12:18:00.000 | 4 | 0 | 1 | 0 | python,datetime,time,timezone | 11,845,891 | 6 | false | 0 | 0 | The return value should be the same, since it's the offset in seconds to the UNIX Epoch.
That being said, if you convert it to a Date using different timezones, the values will, of course, differ.
If, from those Dates, you convert each of them to UTC, then the result has to be the same. | 2 | 42 | 0 | Apologies for asking too basic question but I couldn't get it cleared after reading docs. It just seems that I am missing or have misunderstood something too basic here.
Does calling time.time() from different timezones, at the same time produce different results? This maybe comes down to definition of epoch, which on ... | Is Python's time.time() timezone specific? | 0.132549 | 0 | 0 | 15,434 |
11,848,650 | 2012-08-07T14:55:00.000 | 4 | 0 | 1 | 1 | python,ubuntu,compilation,nautilus | 11,848,690 | 3 | false | 0 | 0 | You should make the .py files executable and click on them. The .pyc files cannot be run directly. | 2 | 6 | 0 | Sorry, for the vague question, don't know actually how to ask this nor the rightful terminologies for it.
How to run a python script/bytecode/.pyc (any compiled python code) without going through the terminal. Basically on Nautilus: "on double click of the python script, it'll run" or "on select then [Enter], it'll r... | How to run Python script with one icon click? | 0.26052 | 0 | 0 | 15,947 |
11,848,650 | 2012-08-07T14:55:00.000 | 1 | 0 | 1 | 1 | python,ubuntu,compilation,nautilus | 12,015,527 | 3 | true | 0 | 0 | Adding " #!/usr/bin/env python " at the top of the .py file works! Hmm, although don't appreciate the pop-up, but nevermind. :P
From PHPUG:
You do not invoke the pyc file. It's the .py file that's invoked. Python is an interpreted language.
A simpler way to make a python exectuable (explained):
1) Add #!/usr/bin/env ... | 2 | 6 | 0 | Sorry, for the vague question, don't know actually how to ask this nor the rightful terminologies for it.
How to run a python script/bytecode/.pyc (any compiled python code) without going through the terminal. Basically on Nautilus: "on double click of the python script, it'll run" or "on select then [Enter], it'll r... | How to run Python script with one icon click? | 1.2 | 0 | 0 | 15,947 |
11,853,818 | 2012-08-07T20:42:00.000 | 0 | 0 | 0 | 1 | python,macos,terminal | 11,854,667 | 3 | false | 0 | 0 | Automator would be your best bet actually, creating Macintosh .app bundles by hand can be annoying.
It's been a long time since I've used automator, but here goes, use the Run Shell Script command from Terminal, and make the script be python ~/Desktop/script.py or maybe use the full path like python /Users/<username>/D... | 3 | 3 | 0 | I have a simple python script I can run through terminal. Is there a way to put a shortcut on my mac desktop to open terminal and run like "cd ~/Desktop/script.py"? I have tried automator but i couldn't get it to work | Can I make a script to open terminal and run .py? | 0 | 0 | 0 | 4,323 |
11,853,818 | 2012-08-07T20:42:00.000 | -1 | 0 | 0 | 1 | python,macos,terminal | 11,853,877 | 3 | false | 0 | 0 | you have to create a samplename.sh file and put the below line and run it ./samplename.sh
~/Desktop/script.py
create symbolic link to that .sh file and place it on desktop. | 3 | 3 | 0 | I have a simple python script I can run through terminal. Is there a way to put a shortcut on my mac desktop to open terminal and run like "cd ~/Desktop/script.py"? I have tried automator but i couldn't get it to work | Can I make a script to open terminal and run .py? | -0.066568 | 0 | 0 | 4,323 |
11,853,818 | 2012-08-07T20:42:00.000 | 6 | 0 | 0 | 1 | python,macos,terminal | 11,854,938 | 3 | true | 0 | 0 | Create a file called anyname.command with python ~/Desktop/script.py in it. Then make it executable by running chmod 555 ~/Desktop/anyname.command in terminal. Then when you double-click on anyname.command it should run the python script. | 3 | 3 | 0 | I have a simple python script I can run through terminal. Is there a way to put a shortcut on my mac desktop to open terminal and run like "cd ~/Desktop/script.py"? I have tried automator but i couldn't get it to work | Can I make a script to open terminal and run .py? | 1.2 | 0 | 0 | 4,323 |
11,854,137 | 2012-08-07T21:04:00.000 | 9 | 0 | 0 | 1 | python,google-app-engine,google-cloud-datastore | 11,855,209 | 1 | true | 1 | 0 | The only way to change the ancestor of an entity is to delete the old one and create a new one with a new key. This must be done for all child (and grand child, etc) entities in the ancestor path. If this isn't possible, then your listed solution works.
This is required because the ancestor path of an entity is part of... | 1 | 5 | 0 | In the High-Replication Datastore (I'm using NDB), the consistency is eventual. In order to get a guaranteed complete set, ancestor queries can be used. Ancestor queries also provide a great way to get all the "children" of a particular ancestor with kindless queries. In short, being able to leverage the ancestor model... | How to change ancestor of an NDB record? | 1.2 | 1 | 0 | 1,422 |
11,854,528 | 2012-08-07T21:41:00.000 | 0 | 0 | 0 | 0 | python,opencv | 25,125,143 | 1 | false | 0 | 0 | I do something similar with C++ in OpenCV. There are a couple of ways to go about this.
I use TCP/IP protocols - make sure I don't have packet loss.
Next, To test quality, I send and receive a Video file (that I recorded from the camera) instead of stream "new" video from the camera. Now, I can check the quality by che... | 1 | 0 | 0 | I am new to python and programming in general. I was wondering if there is a way to validate that you are getting a video feed and not just a black screen from an incoming call. I have automated a script in Python that makes a call and answers the call, but some of the issues we are testing is how often we get black ... | Checking the quality of an Incoming Video with python | 0 | 0 | 0 | 1,107 |
11,857,535 | 2012-08-08T04:06:00.000 | 4 | 0 | 1 | 0 | python,python-bindings | 11,857,573 | 3 | false | 0 | 0 | Although I cannot say this with full authority because it is preference-based, developing Python bindings for C makes development process easier for those who find Python syntax more productive and easier to work with.
(for example, Python CUDA, 3D, Kinect, etc. libraries) | 2 | 2 | 0 | What is the motive behind developing Python bindings for existing code in other languages? I see many programmers developing Python bindings for their existing C code. Why? How does it help? | Why are Python bindings developed for existing code in other languages such as C? | 0.26052 | 0 | 0 | 430 |
11,857,535 | 2012-08-08T04:06:00.000 | 1 | 0 | 1 | 0 | python,python-bindings | 15,140,667 | 3 | false | 0 | 0 | Because there are many very high quality libraries in C with many many years of testing, bugfixing, etc., and it is crazy to try to reimplement everything in Python (e.g., I would never use cryptographic libraries in Python, one should use bindings to well tested and paranoid-developed C libraries like openssl, NSS, or... | 2 | 2 | 0 | What is the motive behind developing Python bindings for existing code in other languages? I see many programmers developing Python bindings for their existing C code. Why? How does it help? | Why are Python bindings developed for existing code in other languages such as C? | 0.066568 | 0 | 0 | 430 |
11,859,234 | 2012-08-08T06:58:00.000 | 0 | 0 | 1 | 0 | python | 11,859,397 | 2 | false | 0 | 0 | Just to clarify what @lazyr already said: the documentation refers to file-like objects. Actual file objects will always have the closed attribute and you can use it to see if the file is closed. | 1 | 2 | 0 | The Python File Type documentation gives file.closed as a
bool indicating the current state of the file object. This is a read-only attribute; the close() method changes the value. It may not be available on all file-like objects.
Given that it's not guaranteed to be available on all file-like objects, is there anoth... | Check if file is open for any file type | 0 | 0 | 0 | 2,199 |
11,860,036 | 2012-08-08T07:51:00.000 | 0 | 1 | 0 | 0 | php,python,load,cron | 11,860,120 | 1 | true | 0 | 0 | Using multiple files to fetch smaller parts probably won't make a difference in server load (well, in fact it'd make the load x times bigger for x times shorter period of time, but the overall result is the same), but it should fetch the data faster (thanks to multithreading and paralleling the requests) therefore redu... | 1 | 1 | 0 | I'm running a python file every minute using a cron job. It queries a site and gather's information, but it has to load through 4-5 pages before it gets to the data I need.
The execution time is around 5-10s per query.
I'm wondering if there's a difference in server load if the file is being run congruently multiple ti... | Server load comparison | 1.2 | 0 | 0 | 57 |
11,860,280 | 2012-08-08T08:07:00.000 | 5 | 0 | 0 | 1 | python,swing,ui-automation,pywinauto | 12,048,644 | 1 | true | 1 | 0 | Pywinauto uses standard windows API calls. Unfortunately many UI libraries (like Swing/QT/GTK) do not respond in a typical way to the API calls used - so unfortunately pywinauto usually cannot get the control information. (I am the Author of pywinauto).
I can't give you a way to access the properties of the Swing contr... | 1 | 0 | 0 | I am using swapy(desktop automation tool which uses pywinauto python package) to automate desktop UI activities, but swapy does not recognize the properties of a swing based java application, but it can recognize the properties of other applications like notepad windows media player etc..
can anybody please the reason ... | Swapy could not be used to access swing properties of swing based java application.How to access swing properties of a java application | 1.2 | 0 | 0 | 1,126 |
11,868,582 | 2012-08-08T16:03:00.000 | 1 | 0 | 0 | 0 | python,mysql,postgresql | 11,870,176 | 3 | false | 0 | 0 | Use SQL-Alchemy. It will work with most database types, and certainly does work with postgres and MySQL. | 1 | 3 | 0 | I am looking for a pure-python SQL library that would give access to both MySQL and PostgreSQL.
The only requirement is to run on Python 2.5+ and be pure-python, so it can be included with the script and still run on most platforms (no-install).
In fact I am looking for a simple solution that would allow me to write SQ... | Pure python SQL solution that works with PostgreSQL and MySQL? | 0.066568 | 1 | 0 | 2,182 |
11,868,963 | 2012-08-08T16:27:00.000 | 0 | 0 | 1 | 0 | python,python-imaging-library,tiff | 11,877,012 | 1 | true | 0 | 1 | It appears that TiffImagePlugin does not easily allow me to hook in additional decompressors. Replacing TiffImageFile._decoder with a dictionary of decoders might work, but you would have to examine and test each release of PIL to ensure it hasn't broken. This level of maintenance is just as bad as a custom PIL. I a... | 1 | 1 | 0 | I wrote a pure python TIFF G4 decompress for use with tifffile.py. I know there are ways to add libtiff to a custom PIL, but I never could get that working very well in a mixed virtualenv. I want to manipulate the image in PIL. I am looking for pointers in hooking my decompressor to stock PIL for TiffImagePlugin.py.
A... | Using TIFF G4 image in PIL | 1.2 | 0 | 0 | 973 |
11,870,785 | 2012-08-08T18:24:00.000 | 0 | 0 | 0 | 0 | python,c,algorithm,binary-search | 11,871,291 | 4 | false | 0 | 0 | Hmmm... you're basically looking for some kind of space-filling curve of sorts. I'm almost certain that you can do that with clever bit-twiddling. You might like to take a look at the way indices are computed for the Morton Z-order or Ahnentafel indexing that's used in some cache-oblivious stencil algorithms. I had a l... | 2 | 9 | 0 | I have been working on what seems to be a simple task that is driving me nuts. So if you fancy a programming challenge ... read on.
I want to be able to take a number range e.g. [1:20] and print the values using a mechanism similar to a binary serach algorithm. So, print first the lowest value (in this case 1) and then... | Binary selection process | 0 | 0 | 0 | 842 |
11,870,785 | 2012-08-08T18:24:00.000 | 0 | 0 | 0 | 0 | python,c,algorithm,binary-search | 11,872,613 | 4 | false | 0 | 0 | It's easy for 1/2, right?
So why not do it recursively, so that 1/4 is 1/2 of 1/2, and 1/8 is 1/2 of 1/4? | 2 | 9 | 0 | I have been working on what seems to be a simple task that is driving me nuts. So if you fancy a programming challenge ... read on.
I want to be able to take a number range e.g. [1:20] and print the values using a mechanism similar to a binary serach algorithm. So, print first the lowest value (in this case 1) and then... | Binary selection process | 0 | 0 | 0 | 842 |
11,876,545 | 2012-08-09T03:52:00.000 | 1 | 0 | 1 | 0 | windows,python-2.7 | 11,876,572 | 3 | true | 0 | 0 | Run your program from a Windows command prompt. That will not automatically close when the program finishes.
If you run your program by double-clicking on the .py file icon, then Windows will close the window when your program finishes (whether it was successful or not). | 1 | 1 | 0 | I'm making a application in python from Windows. When I run it in the console, it stops, shows an error, and closes. I can't see the error becase its too fast, and I can't read it. I'm editing the code with IDLE (the program that came with python when I instaled it), and when I run it with the python shell, there are n... | how to make my console in python not to close? | 1.2 | 0 | 0 | 7,808 |
11,877,666 | 2012-08-09T06:11:00.000 | 1 | 0 | 1 | 0 | python,form-submit | 11,879,610 | 1 | true | 1 | 0 | @Serafeim, your approach is very good for the situation. Here are some ideas of extending it:
Make sure that the secret_word (in hashing terms it is called salt) is long enough.
Make the end function a bit more complex, e.g.
hash = h(h(username) + month + year + h(salt))
Use a bit more complex hash function, e.g. SHA... | 1 | 0 | 0 | There is a requirement that our users should complete and submit a form once a month. So, each month we should have a form that will contain data for the triplet (username, month, year). I want our users to be able to certify that they did actually submit the form for that particular month by creating a receipt for the... | Create a receipt for a user form submission | 1.2 | 0 | 0 | 504 |
11,878,454 | 2012-08-09T07:14:00.000 | 1 | 0 | 0 | 0 | python,database,django,configuration | 11,878,547 | 3 | false | 1 | 0 | You can just use a different settings.py in your production environment.
Or - which is a bit cleaner - you might want to create a file settings_local.py next to settings.py where you define a couple of settings that are specific for the current machine (like DEBUG, DATABASES, MEDIA_ROOT etc.) and do a from settings_loc... | 1 | 0 | 0 | I am relatively new to Django and one thing that has been on my mind is changing the database that will be used when running the project.
By default, the DATABASES 'default' is used to run my test project. But in the future, I want to be able to define a 'production' DATABASES configuration and have it use that instead... | How do I make Django use a different database besides the 'default'? | 0.066568 | 1 | 0 | 304 |
11,878,554 | 2012-08-09T07:21:00.000 | 0 | 1 | 1 | 0 | python,nameerror | 11,878,657 | 4 | false | 0 | 0 | You could get an IDE which helps a bit with autocompletion of names, though not in all situations. PyDev is one such IDE with autocompletion; PyCharm is another (not free).
Using autocomplete is probably your best bet to solve your problem in the long term. Even if you find a tool which attempts to correct such spellin... | 1 | 1 | 0 | I am not a native English speaker. When I code with Python, I often make spelling mistakes and get 'NameError' Exceptions. Unit test can solve some problems but not all. Because one can hardly construct test cases which cover all logic. So I think a tool that detect such errors would help me a lot but I searched Google... | Does there a tool exists which can help programmer avoid Python NameError? | 0 | 0 | 0 | 130 |
11,881,165 | 2012-08-09T10:15:00.000 | 0 | 0 | 0 | 0 | python,pandas,slice | 71,602,253 | 3 | false | 0 | 0 | If you just need to get the top rows; you can use df.head(10) | 1 | 46 | 1 | I am working with survey data loaded from an h5-file as hdf = pandas.HDFStore('Survey.h5') through the pandas package. Within this DataFrame, all rows are the results of a single survey, whereas the columns are the answers for all questions within a single survey.
I am aiming to reduce this dataset to a smaller DataFr... | Slice Pandas DataFrame by Row | 0 | 0 | 0 | 92,185 |
11,881,900 | 2012-08-09T10:58:00.000 | 1 | 0 | 0 | 0 | python,django | 11,882,269 | 2 | false | 1 | 0 | You can use the original file's name as part of the file name when storing in the disk, and you probably can use the file's creation/modification date for the upload date. IMO, you should just store it explicitly in the database. | 1 | 4 | 0 | Is there any way to get the uploaded file date and name which we have stored into the database using forms ?
Right now I am just creating two more database tuples for name and date and storing them like this file_name = request.FILES['file'].name for file_name and storing date using upload_date = datetime.datetime.now... | Django:Any way to get date and name of uploaded file later? | 0.099668 | 0 | 0 | 1,226 |
11,882,484 | 2012-08-09T11:33:00.000 | 0 | 0 | 1 | 0 | python,dll,32bit-64bit,printers,python-2.2 | 11,883,191 | 1 | true | 0 | 0 | In a word, no.
ctypes using LoadLibrary is used to connect to an external DLL, but if you are a 32-bit process then you will be using 32-bit addresses, so a 64-bit binary could not be mapped against your address space. | 1 | 0 | 0 | I am using Python 2.2, a 32-bit process, but I need to load a 64bit dll from a printer. It might seem strange, but is this possible? | Load 64-bits Dll on Python2.2(32-bits) | 1.2 | 0 | 0 | 528 |
11,885,062 | 2012-08-09T13:55:00.000 | 1 | 0 | 0 | 0 | python,web-applications,ftp,download | 11,886,438 | 1 | true | 0 | 0 | The only way to grant access in the manner that you want to is to pass it through your server , write a frontend on the FTP server, or provide a limited download of the file on the FTP (Temporary account). The latter option is not secure and wouldn't recommend it although it would be easy to do. So, that leaves either... | 1 | 0 | 0 | I have a site A where is installed a web portal written in python.
Then, I have a site X (that is not static but change dinamically), where are stored some file. The site A and site X communicate through ftp.
How can i allow a registered user of the portal to download a file like the file was in the site A. Is there ... | Make accessible a remote file to a registered user | 1.2 | 0 | 1 | 57 |
11,889,104 | 2012-08-09T17:48:00.000 | 1 | 0 | 0 | 0 | python,postgresql,web-applications,flask,psycopg2 | 11,889,137 | 5 | false | 1 | 0 | I think connection pooling is the best thing to do if this application is to serve multiple clients and concurrently. | 3 | 8 | 0 | I'm building a web app in Python (using Flask). I do not intend to use SQLAlchemy or similar ORM system, rather I'm going to use Psycopg2 directly.
Should I open a new database connection (and subsequently close it) for each new request? Or should I use something to pool these connections? | Should PostgreSQL connections be pooled in a Python web app, or create a new connection per request? | 0.039979 | 1 | 0 | 9,082 |
11,889,104 | 2012-08-09T17:48:00.000 | 3 | 0 | 0 | 0 | python,postgresql,web-applications,flask,psycopg2 | 11,889,659 | 5 | false | 1 | 0 | The answer depends on how many such requests will happen and how many concurrently in your web app ? Connection pooling is usually a better idea if you expect your web app to be busy with 100s or even 1000s of user concurrently logged in. If you are only doing this as a side project and expect less than few hundred use... | 3 | 8 | 0 | I'm building a web app in Python (using Flask). I do not intend to use SQLAlchemy or similar ORM system, rather I'm going to use Psycopg2 directly.
Should I open a new database connection (and subsequently close it) for each new request? Or should I use something to pool these connections? | Should PostgreSQL connections be pooled in a Python web app, or create a new connection per request? | 0.119427 | 1 | 0 | 9,082 |
11,889,104 | 2012-08-09T17:48:00.000 | 0 | 0 | 0 | 0 | python,postgresql,web-applications,flask,psycopg2 | 61,078,209 | 5 | false | 1 | 0 | Pooling seems to be totally impossible in context of Flask, FastAPI and everything relying on wsgi/asgi dedicated servers with multiple workers.
Reason for this behaviour is simple: you have no control about the pooling and master thread/process.
A pooling instance is only usable for a single thread serving a set of cl... | 3 | 8 | 0 | I'm building a web app in Python (using Flask). I do not intend to use SQLAlchemy or similar ORM system, rather I'm going to use Psycopg2 directly.
Should I open a new database connection (and subsequently close it) for each new request? Or should I use something to pool these connections? | Should PostgreSQL connections be pooled in a Python web app, or create a new connection per request? | 0 | 1 | 0 | 9,082 |
11,889,932 | 2012-08-09T18:43:00.000 | 3 | 0 | 1 | 0 | python,virtualenv,pip | 11,890,145 | 5 | false | 1 | 0 | it would be really convenient not to have to tell every new person
joining the team how to set up their virtualenv
Just add it to the normal set of instructions you give new members when the join; right in the same place when you tell them about the internal documentation wiki, the password to the wifi and the phone... | 1 | 27 | 0 | I'm using virtualenv to develop a django application with a team. The server we're deploying on is running python 2.6, but the default for our machines is 2.7.3. Is there any way to specify python version in the requirements.txt file, or something similar, within the code base?
I know requirements.txt is a pip thing, ... | Specify Python Version for Virtualenv in Requirements.txt | 0.119427 | 0 | 0 | 20,644 |
11,890,437 | 2012-08-09T19:17:00.000 | 15 | 0 | 0 | 0 | python,matlab | 11,890,470 | 3 | false | 0 | 0 | Yes, there is the : operator. The command -10:5:11 would produce the vector [-10, -5, 0, 5, 10]; | 1 | 10 | 1 | Is there an equivalent MATLAB function for the range() function in Python?
I'd really like to be able to type something like range(-10, 11, 5) and get back [-10, -5, 0, 5, 10] instead of having to write out the entire range by hand. | Is there an equivalent of the Python range function in MATLAB? | 1 | 0 | 0 | 21,375 |
11,892,497 | 2012-08-09T21:51:00.000 | 0 | 0 | 1 | 0 | python,ipython | 55,928,585 | 8 | false | 0 | 0 | For me the solution was to rename my script from zmq.py to anything else.
This happens because using the name zmq.py crates a name conflict with the package as python tries to include the script itself rather than the library as scripts have priority in the include hierarchy. | 3 | 14 | 0 | I am trying to get ipython notebook run.
I already installed pyzmq.
Do you know why it's still giving this error? | Already installed pyzmq but still getting "ImportError: No module named zmq" | 0 | 0 | 0 | 37,531 |
11,892,497 | 2012-08-09T21:51:00.000 | 0 | 0 | 1 | 0 | python,ipython | 46,959,438 | 8 | false | 0 | 0 | you should add Phython path to windows local variable PATH before install zmq | 3 | 14 | 0 | I am trying to get ipython notebook run.
I already installed pyzmq.
Do you know why it's still giving this error? | Already installed pyzmq but still getting "ImportError: No module named zmq" | 0 | 0 | 0 | 37,531 |
11,892,497 | 2012-08-09T21:51:00.000 | 0 | 0 | 1 | 0 | python,ipython | 71,136,487 | 8 | false | 0 | 0 | I had a file that was trying to import zmq that was throwing:
ModuleNotFoundError: No module named 'zmq'
But pip install zmq or pip install pyzmq kept telling me I had a version already installed, and thus Requirement already satisfied at Library/blahblah/Python/3.6 ...
I've already aliased pip3 to pip, but trying pip3... | 3 | 14 | 0 | I am trying to get ipython notebook run.
I already installed pyzmq.
Do you know why it's still giving this error? | Already installed pyzmq but still getting "ImportError: No module named zmq" | 0 | 0 | 0 | 37,531 |
11,892,953 | 2012-08-09T22:31:00.000 | 1 | 0 | 0 | 0 | search-engine,sitemap,pythonanywhere | 11,899,675 | 1 | true | 0 | 0 | At the moment it is certainly possible. But would only realistically happen if you have people linking to your .pythonanywhere.com. We are currently working on a major upgrade that will give each webapp it's own wsgi server and the potential for this to occur will go away completely | 1 | 1 | 0 | I am currently using my own domain name for my Pythonanywhere app. The original username.pythonanywhere.com still serves the same content as www.my-domain.com, and I wanted to know if there would be duplicate search engine results from this.
My sitemap.xml file is written for www.my-domain.com in case that changes anyt... | Duplicate Search Engine results on Pythonanywhere | 1.2 | 0 | 1 | 79 |
11,893,311 | 2012-08-09T23:11:00.000 | 0 | 1 | 0 | 1 | python,module | 31,068,954 | 5 | false | 0 | 0 | To install nay python package in ubuntu, first run
sudo apt-get update
Then type "sudo apt-get install python-" and press tab twice repeatedly.
press y or yes and it will display all the packages available for python. Then again type
sudo apt-get install python-package
It will install the package from the internet. | 2 | 13 | 0 | I'm guessing my question is pretty basic, but after 15-20 minutes on Google and YouTube, I am still a little fuzzy. I am relatively new to both Linux and Python, so I am having some difficulty comprehending the file system tree (coming from Windows).
From what I've found digging around the directories in Ubuntu (which ... | Installing 3rd party Python modules on an Ubuntu Linux machine? | 0 | 0 | 0 | 63,583 |
11,893,311 | 2012-08-09T23:11:00.000 | 11 | 1 | 0 | 1 | python,module | 11,893,356 | 5 | false | 0 | 0 | You aren't supposed to manually install anything.
There are three ways to install Python libraries:
Use apt-get, aptitude or similar utilities.
Use easy_install or pip (install pip first, its not available by default)
If you download some .tar.gz file, unzip it and then type sudo python setup.py install
Manually mess... | 2 | 13 | 0 | I'm guessing my question is pretty basic, but after 15-20 minutes on Google and YouTube, I am still a little fuzzy. I am relatively new to both Linux and Python, so I am having some difficulty comprehending the file system tree (coming from Windows).
From what I've found digging around the directories in Ubuntu (which ... | Installing 3rd party Python modules on an Ubuntu Linux machine? | 1 | 0 | 0 | 63,583 |
11,894,210 | 2012-08-10T01:18:00.000 | 3 | 1 | 0 | 0 | python,pyramid,production | 11,898,284 | 1 | true | 1 | 0 | Well the big difference between python setup.py develop and python setup.py install. Is that install will install the package in your site-packages directory. While develop will install an egg-link that point to the directory for development.
So yeah you can technically use both method. But depending on how you did yo... | 1 | 3 | 0 | So as I near the production phase of my web project, I've been wondering how exactly to deploy a pyramid app. In the docs, it says to use ../bin/python setup.py develop to put the app in development mode. Is there another mode that is designed for production. Or do I just use ../bin/python setup.py install. | Preparing a pyramid app for production | 1.2 | 0 | 0 | 2,476 |
11,894,333 | 2012-08-10T01:37:00.000 | 1 | 1 | 1 | 0 | python,memory,virtualenv,web-frameworks | 12,218,779 | 3 | false | 1 | 0 | It depends on how you're going to run the application in your environment. There are many different ways to run Python web apps. Recently popular methods seem to be Gunicorn and uWSGI. So you'd be best off running the application as you would in your environment and you could simply use a process monitor to see how muc... | 1 | 1 | 0 | I'm creating an app in several different python web frameworks to see which has the better balance of being comfortable for me to program in and performance. Is there a way of reporting the memory usage of a particular app that is being run in virtualenv?
If not, how can I find the average, maximum and minimum memory u... | Testing memory usage of python frameworks in Virtualenv | 0.066568 | 0 | 0 | 1,578 |
11,895,298 | 2012-08-10T04:00:00.000 | 3 | 1 | 0 | 1 | python,networking,file-transfer | 11,895,345 | 1 | true | 0 | 0 | I think your best bet is to use scp or rsync from within screen. That way you can detach the screen session and logout and the transfer will keep going.
man screen | 1 | 1 | 0 | I am working on a task to back up (copy) about 100 Gb of data (including a thousand files and sub folders in a directory) to another server. Normally, for the smaller scale, I can use scp or rsync instead. However, as the other server is not on the same LAN network, it could easily take hours, even days, to complete th... | How can we transfer large amounts of data over a network, using Python? | 1.2 | 0 | 0 | 723 |
11,898,451 | 2012-08-10T09:03:00.000 | 0 | 0 | 1 | 0 | python,loops,cron,infinite-loop | 11,898,609 | 3 | false | 0 | 0 | I guess one way to work around the issue is having a script for one loop run, that would:
check no other instance of the script is running
look into the queue and process everything found there
Now, then you can run this script from cron every minute between 8 a.m. and 8 p.m. The only downside is that new items may s... | 1 | 3 | 0 | I'm working on a Python script that will constantly scrape data, but it will take quite a long time. Is there a safe way to stop a long running python script? The loop will run for more than 10 minutes and I need a way to stop it if I want, after it's already running.
If I execute it from a cron job, then I'm assuming ... | Stop python script in infinite loop | 0 | 0 | 0 | 10,068 |
11,901,273 | 2012-08-10T12:03:00.000 | 4 | 0 | 0 | 0 | python,boto,amazon-sqs | 12,972,060 | 5 | false | 0 | 0 | Other way could be you can put an extra identifier at the end of the message in your SQS queue. This identifier can keep the count of the number of times the message has been read.
Also if you want that your service should not poll these message again and again then you can create one more queue say "Dead Message Queu... | 2 | 8 | 0 | I am using boto library in Python to get Amazon SQS messages. In exceptional cases I don't delete messages from queue in order to give a couple of more changes to recover temporary failures. But I don't want to keep receiving failed messages constantly. What I would like to do is either delete messages after receiving ... | How to get messages receive count in Amazon SQS using boto library in Python? | 0.158649 | 0 | 1 | 21,434 |
11,901,273 | 2012-08-10T12:03:00.000 | 1 | 0 | 0 | 0 | python,boto,amazon-sqs | 11,960,623 | 5 | false | 0 | 0 | It should be done in few steps.
create SQS connection :-
sqsconnrec = SQSConnection(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
create queue object :-
request_q = sqsconnrec.create_queue("queue_Name")
load the queue messages :-
messages= request_q.get_messages()
now you get the array of message objects and to find the t... | 2 | 8 | 0 | I am using boto library in Python to get Amazon SQS messages. In exceptional cases I don't delete messages from queue in order to give a couple of more changes to recover temporary failures. But I don't want to keep receiving failed messages constantly. What I would like to do is either delete messages after receiving ... | How to get messages receive count in Amazon SQS using boto library in Python? | 0.039979 | 0 | 1 | 21,434 |
11,902,954 | 2012-08-10T13:41:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine,queue | 11,903,487 | 2 | false | 1 | 0 | There is a task queue link on your appengine console where you can look at the pending tasks, statistics and see what's going on. | 1 | 6 | 0 | I am firing up a queue to complete some tasks in Python Appengine application. Is there a way to get the status of the queue? I would like to check whether it is still running or has incomplete tasks. | How can I check programmatically the status of my task queue in Google Appengine? | 0 | 0 | 0 | 585 |
11,903,083 | 2012-08-10T13:50:00.000 | -1 | 0 | 1 | 0 | python,numpy,set-difference | 11,903,766 | 3 | false | 0 | 0 | I'm not sure what you are going for, but this will get you a boolean array of where 2 arrays are not equal, and will be numpy fast:
import numpy as np
a = np.random.randn(5, 5)
b = np.random.randn(5, 5)
a[0,0] = 10.0
b[0,0] = 10.0
a[1,1] = 5.0
b[1,1] = 5.0
c = ~(a-b==0)
print c
[[False True True True True]
[ Tru... | 1 | 18 | 1 | I have two large 2-d arrays and I'd like to find their set difference taking their rows as elements. In Matlab, the code for this would be setdiff(A,B,'rows'). The arrays are large enough that the obvious looping methods I could think of take too long. | Find the set difference between two large arrays (matrices) in Python | -0.066568 | 0 | 0 | 13,283 |
11,903,310 | 2012-08-10T14:02:00.000 | 3 | 1 | 0 | 0 | python,unit-testing,tdd | 11,903,386 | 1 | true | 0 | 0 | Bit old on Python.
But this is how I would approach it.
Grab the image doing a manual test. Compute a check sum (MD5 perhaps). Then the automated tests need to compare it by computing the MD5 (in this example) with the one done on the manual test.
Hope this helps. | 1 | 1 | 0 | I have an array of pixels which I wish to save to an image file. Python appears to have a few libraries which can do this for me, so I'm going to use one of them, passing in my pixel array and using functions I didn't write to write the image headers and data to disk.
How do I do unit testing for this situation?
I ca... | Unittest binary file output | 1.2 | 0 | 0 | 641 |
11,903,674 | 2012-08-10T14:22:00.000 | 2 | 0 | 1 | 0 | python,pyscripter | 11,903,990 | 1 | true | 0 | 0 | You can use reload(imported_module_name) in the interactive shell to reload the module before re-running your script. PyScripter does everything in a single Python instance, which makes debugging easier, but also, as you discovered, makes fixing imported files a bit trickier.
You can also completely reinitialize the Re... | 1 | 2 | 0 | I am using portable python 1.1 with python 2.6.2. The PyScriptor is 1.9.9.6. I open all the files I am working on with PyScriptor. So, I run my main file and an error shows up with code in one of my imported files. I fix it and run the main file again, but the same error shows up. It is as if the imported file is still... | PyScripter won't update my imports | 1.2 | 0 | 0 | 881 |
11,906,505 | 2012-08-10T17:28:00.000 | 1 | 0 | 0 | 0 | python,tkinter,py2app | 11,906,589 | 1 | true | 0 | 1 | It's probably continuing to work because it's using your frameworks to load Tkinter instead of the bundled ones. If you moved it to another computer without Tkinter, it might not launch or could just crash right away. | 1 | 0 | 0 | I'm making a few Python applications for MacOSX (10.6 in this case, though I don't imagine it matters) using Tkinter to code the interface, and py2app to create the bundle.
As many of you know, these stand-alone apps tend to be a fairly large size, about 70-80 MB, mostly because I am using numpy. As expected, 23 MB of... | Saving space in tkinter application | 1.2 | 0 | 0 | 151 |
11,907,027 | 2012-08-10T18:09:00.000 | 3 | 1 | 0 | 0 | python,user-interface,raspberry-pi | 11,907,139 | 3 | false | 0 | 1 | You could use Python for this easily with just the standard library (python 2.7.3).
For the GUI you can use Tkinter or Pygame (not standard library) which both support images and text placement (and full screen). It is notable that Tkinter is not thread safe, so that may be a problem if your planning on threading this ... | 1 | 3 | 0 | I started a project where you can "log in" on a terminal (basically a Raspberry Pi with a touchscreen attached) with a wireless token (for time tracking).
What will be the best and fastest solution to display the status (basically a background picture and 2-3 texts changing depending on the status of the token) on the ... | fast gui on raspberry | 0.197375 | 0 | 0 | 3,021 |
11,907,410 | 2012-08-10T18:39:00.000 | 1 | 0 | 1 | 0 | python,hashmap,interpreter,rhino,v8 | 11,908,073 | 3 | false | 0 | 0 | CPython uses namespaces extensively for function/method dispatch, which means a hash type, AKA "dictionary".
Pypy, Jython, IronPython, etcetera may have their own thoughts about how best to do this. Python != CPython. | 2 | 3 | 0 | When it comes to script interpreters, like Rhino, Google V8, Python, etc. - is there any general approach to determining the underlying native methods, given only a string of scripting language?
At some point, do these interpreters use hash maps with strings for keys? Or is there a lot of string equality testing and br... | How do scripting language interpreters reference their underlying functions? | 0.066568 | 0 | 0 | 213 |
11,907,410 | 2012-08-10T18:39:00.000 | 1 | 0 | 1 | 0 | python,hashmap,interpreter,rhino,v8 | 11,908,106 | 3 | false | 0 | 0 | For Python, when the source code is processed by the Python, all definitions (of classes and their methods, of normal functions, etc.) are compiled. The result of compilation of the parts of the code is stored as objects that capture the code. The name is stored inside only for introspection purpose -- from user point ... | 2 | 3 | 0 | When it comes to script interpreters, like Rhino, Google V8, Python, etc. - is there any general approach to determining the underlying native methods, given only a string of scripting language?
At some point, do these interpreters use hash maps with strings for keys? Or is there a lot of string equality testing and br... | How do scripting language interpreters reference their underlying functions? | 0.066568 | 0 | 0 | 213 |
11,907,468 | 2012-08-10T18:43:00.000 | 0 | 0 | 0 | 0 | python,wxpython,network-drive | 11,908,070 | 1 | true | 0 | 0 | It works fine for me in the wxPython demo on Windows 7, wxPython 2.8.12.1. What version of wxPython are you using? Which OS? There are two other directory controls that you can try too: GenericDirCtrl and MultiDirDialog.
I would recommend creating a little demo app that we can play with too. | 1 | 0 | 0 | I am using a DirDialog in wxpython. It works fine for the local drive.
But, it is not able to list the folders in the network drive.
Is there any way to do it ?
I want to select a folder from the network drive. | Directory listing of a network drive by DirDialog in wxpython | 1.2 | 0 | 0 | 251 |
11,909,078 | 2012-08-10T20:52:00.000 | 5 | 1 | 1 | 0 | c++,python,compilation,interpreter,execution | 11,909,155 | 4 | false | 0 | 0 | The problem with efficiency in high-level languages (or, at least, the dynamic ones) stems from the fact that it's usually not known WHAT operations needs to be performed until the actual types of objects are resolved in runtime. As a consequence, these languages don't compile to straightforward machine code and have t... | 2 | 4 | 0 | It seems to me that languages that are quite simple to use (i.e. Python) often have slower execution times than languages that are deemed more complex to learn (i.e. C++ or Java). Why? I understand that part of the problem arises from the fact that Python is interpreted rather than compiled, but what prevents Python ... | Why does there seem to be tension between the simplicity of a language and execution time? | 0.244919 | 0 | 0 | 375 |
11,909,078 | 2012-08-10T20:52:00.000 | 5 | 1 | 1 | 0 | c++,python,compilation,interpreter,execution | 11,909,183 | 4 | true | 0 | 0 | Lets compare C and Python. By most accounts C is more "complex" to program in than say, Python. This is because Python automates a lot of work which C doesn't. For example, garbage collection is automated in Python, but is the programmer's responsibility in C.
The price of this automation is that these "high level fea... | 2 | 4 | 0 | It seems to me that languages that are quite simple to use (i.e. Python) often have slower execution times than languages that are deemed more complex to learn (i.e. C++ or Java). Why? I understand that part of the problem arises from the fact that Python is interpreted rather than compiled, but what prevents Python ... | Why does there seem to be tension between the simplicity of a language and execution time? | 1.2 | 0 | 0 | 375 |
11,909,396 | 2012-08-10T21:18:00.000 | 0 | 0 | 1 | 0 | python | 11,910,009 | 2 | false | 0 | 0 | pickle is the usual solution to such things, but if you see any value in being able to edit the saved data, and if the dictionary uses only simple types such as strings and numbers (nested dictionaries or lists are also OK), you can simply write the repr() of the dictionary to a text file, then parse it back into a Pyt... | 1 | 0 | 0 | a couple of my python programs aim to
format into a hash table (hence, I'm a dict() addict ;-) ) some informations in a "source" text file, and
to use that table to modify a "target" file. My concern is that the "source" files I usually process can be very large (several GB) so it makes more than 10sec to parse, and I... | How to make a python instanced object reusable? | 0 | 0 | 0 | 176 |
11,909,800 | 2012-08-10T21:57:00.000 | 0 | 0 | 0 | 0 | python,django,authentication,django-registration | 11,909,991 | 2 | true | 1 | 0 | To limit registrations to people already in the database, you will need some way to identify them.
Require the club administrator to enter an email address for each member entered.
Require the user to supply that address when registering.
Send the registration link to that address, including the primary key of the us... | 2 | 1 | 0 | I have a site catering to multiple clubs, and each club has administrators who maintain a database of club members. I want to limit site registration only to members who have explicitly been added to the club's database. How do I go about auto-generating and sending out registration links to members as they are added... | Selective user registration using django_registration? | 1.2 | 0 | 0 | 82 |
11,909,800 | 2012-08-10T21:57:00.000 | 0 | 0 | 0 | 0 | python,django,authentication,django-registration | 11,909,979 | 2 | false | 1 | 0 | You said you have a database of club members already, so you must have a primary key or a tuple which is unique for that database like a club registration number
which club members should know already
Tell Users to give there primary key value(club registration number) at the time of registration.
Make that club regi... | 2 | 1 | 0 | I have a site catering to multiple clubs, and each club has administrators who maintain a database of club members. I want to limit site registration only to members who have explicitly been added to the club's database. How do I go about auto-generating and sending out registration links to members as they are added... | Selective user registration using django_registration? | 0 | 0 | 0 | 82 |
11,910,295 | 2012-08-10T23:00:00.000 | 2 | 0 | 0 | 1 | python,host,fabric | 11,918,085 | 1 | false | 1 | 0 | It's just python so do what you need to do to keep them seperate. You can define the dir differences in a dictionary or some yaml file that's read into the script. There isn't anything made in fabric to make you do it one way nor provide any specific way to do this.
But essentially just keep in mind that it's not a DSL... | 1 | 3 | 0 | I have many application servers running on the same host. Every application server is installed in a different directory.
How should I tackle deployments on the servers, using Fabric? I would like to be able to perform deployments on each server separately, and on subsets of servers. Clearly the env.hosts parameter has... | How to deal with deployments to a single host with multiple application servers using Fabric? | 0.379949 | 0 | 0 | 202 |
11,910,481 | 2012-08-10T23:24:00.000 | 0 | 0 | 1 | 0 | python,python-3.x,machine-learning,scikit-learn | 58,766,819 | 3 | false | 0 | 0 | Old question, Scikit-Learn is supported by Python3 now. | 1 | 19 | 1 | I was bummed out to see that scikit-learn does not support Python 3...Is there a comparable package anyone can recommend for Python 3? | Best Machine Learning package for Python 3x? | 0 | 0 | 0 | 3,322 |
11,912,049 | 2012-08-11T05:01:00.000 | 1 | 0 | 1 | 1 | python,opencv | 11,912,085 | 1 | false | 0 | 0 | When you configure your interpreter in eclipe (either the first time, or by going to the preferences menu) you need to select an interpreter (don't use the auto-configuration).
Eclipe will use that interpreter, and libraries relative to it. If you install new libraries, just go back to prefrences>pydev>interpreter, an... | 1 | 1 | 0 | QUESTION1:I have 3 versions of pythons installed in my mac.
1.Apple supplied one (2.7.1) (/usr/local/bin)
2.Macports installed one (2.7.3) (/opt/local/bin)
3.and one from python.org (2.7.3) (/Library/Frameworks/Python.framework/Versions/2.7/bin)
I would like to add external modules like opencv,pygame.I have no... | keeping libraries at correct place when multiple pythons are installed | 0.197375 | 0 | 0 | 65 |
11,914,338 | 2012-08-11T11:34:00.000 | 1 | 0 | 1 | 0 | python,performance,string.format | 11,918,336 | 4 | false | 0 | 0 | If the float conversion is still a bottleneck, you might try to farm the formatting out to a multiprocessing.Pool, and use multiprocessing.map_async or multiprocessing.imap to print the resulting string. This will use all the cores on your machine to do the formatting. Although it could be that the overhead from passin... | 1 | 2 | 0 | I'm writing a program that needs to do a lot of string formatting and I have noticed that .format() is taking a small but significant amount of cpu time. Here's how I'm using it:
str = 'vn {0:.15f} {1:.15f} {2:.15f}\n'.format(normal_array[i].x, normal_array[i].y, normal_array[i].z)
Does anyone know if there is even a s... | faster way to do .format() | 0.049958 | 0 | 0 | 263 |
11,914,614 | 2012-08-11T12:15:00.000 | 1 | 1 | 0 | 0 | java,c++,python,qt,plugins | 13,563,225 | 1 | false | 0 | 1 | C++ mangles its symbols, and has special magic to define classes, which is sort of hacked on top of standard (C) object files. You don't want your files from other languages to understand that magic. So I would certainly follow your own suggestion, to do everything in pure C.
However, that doesn't mean you can't use C+... | 1 | 3 | 0 | I am writing an application in Qt that I want to extend with plugins.
My application also has a library that the plugins will use. So, I need a 2 way communication. Basically, the plugins can call the library, and my application which loads the plugins will call them.
Right now, I have my library written in C++, so it ... | How to write Qt plugin system with bindings in other languages? | 0.197375 | 0 | 0 | 308 |
11,917,869 | 2012-08-11T21:37:00.000 | 2 | 1 | 0 | 1 | python,google-app-engine,cron | 11,918,536 | 1 | false | 1 | 0 | There is no "launch" the app in production as such. You deploy the app for the first time and crontab is now present and crontab scheduling is started. So I assume you really mean you would like to run the cron job every time you deploy a new version of your application in addition to the cron schedule.
The cron handl... | 1 | 0 | 0 | I am successfully running a cron job every hour on Google Appengine. However I would like it to start when I launch the app. Now it does the first cron job 1 hour after the start.
I am using Python. | Cron job on Appengine - first time on start? | 0.379949 | 0 | 0 | 211 |
11,919,437 | 2012-08-12T03:11:00.000 | 0 | 1 | 0 | 1 | aptana,ubuntu-10.04,pythonpath | 12,043,683 | 1 | true | 0 | 0 | I just changed the workspace and it works fine now. After doing so it asked for some paths for interpreter and I gave that and it works fine now. | 1 | 0 | 0 | I was working on a project using windows in Aptana. I changed my OS and installed ubuntu on unpartitioned space. I again downloaded Aptana for ubuntu and run it. I specified same workspace that I was using during windows as my that project partition is still there.
The problem I am having is that I am unable to use Ap... | Aptana getting path of Windows python interpreter instead of linux | 1.2 | 0 | 0 | 124 |
11,919,615 | 2012-08-12T03:59:00.000 | 0 | 0 | 1 | 1 | python,ide,path,spyder | 53,098,634 | 4 | false | 0 | 0 | Execute the following command: %cd"P:\Python" | 3 | 25 | 0 | I'm using Debian. I installed Python 3.2.3. The path of Python 3 is /usr/bin/python3.
How do I change it in Spyder? | How to change the path of Python in Spyder? | 0 | 0 | 0 | 92,641 |
11,919,615 | 2012-08-12T03:59:00.000 | 36 | 0 | 1 | 1 | python,ide,path,spyder | 12,355,200 | 4 | true | 0 | 0 | Press CTRL+SHIFT+ALT+P to open the Preferences window. Within this window, select the Console item on the left, then the Advanced Settings tab. The path to the Python executable will be right there. | 3 | 25 | 0 | I'm using Debian. I installed Python 3.2.3. The path of Python 3 is /usr/bin/python3.
How do I change it in Spyder? | How to change the path of Python in Spyder? | 1.2 | 0 | 0 | 92,641 |
11,919,615 | 2012-08-12T03:59:00.000 | 0 | 0 | 1 | 1 | python,ide,path,spyder | 49,143,964 | 4 | false | 0 | 0 | simple if your not able to change the working directory .Press CTRL+SHIFT+ALT+P to open the Preferences window then go to RUN then see the working directory options and finally press the option THE CURRENT WORKING DIRECTORY. | 3 | 25 | 0 | I'm using Debian. I installed Python 3.2.3. The path of Python 3 is /usr/bin/python3.
How do I change it in Spyder? | How to change the path of Python in Spyder? | 0 | 0 | 0 | 92,641 |
11,920,330 | 2012-08-12T07:00:00.000 | 1 | 1 | 0 | 0 | python,email,anonymous,smtplib | 11,920,368 | 1 | true | 0 | 0 | You don't have to have an account (ie. authenticate to your SMTP server) if your company's server is configured to accept mail from certain trusted networks.
Typically SMTP servers consider the internal network as trusted and may accept mail from it
without authentication. | 1 | 0 | 0 | First of all, this question has no malicious purposes. I had asked the same question yesterday in stackoverflow but it was removed. I would like to learn if I have to log into an account when sending emails with attachments using python smtplib module. The reason I don't want to log in to an account is that because the... | Do I have to log into an email account when sending emails using python smtplib? | 1.2 | 0 | 1 | 95 |
11,925,782 | 2012-08-12T20:48:00.000 | 1 | 0 | 0 | 0 | python,opencv | 11,926,117 | 3 | false | 0 | 0 | Please go through the book Learning OpenCV: Computer Vision with the OpenCV Library
It has theory as well as example codes. | 1 | 0 | 1 | I am looking for some methods for detecting movement. I've tried two of them. One method is to have background frame that has been set on program start and other frames are compared (threshold) to that background frame. Other method is to compare current frame (let's call that frame A) with frame-1 (frame before A). No... | What are some good methods for detecting movement using a camera? (opencv) | 0.066568 | 0 | 0 | 637 |
11,926,023 | 2012-08-12T21:28:00.000 | 0 | 0 | 1 | 0 | python | 11,926,214 | 3 | false | 0 | 0 | The TSV file has already lost all the type information.
If the pickle module had been used to write out the file, you would have been able to easily unpickle it, however it looks like you just get to read the damaged file, so pickle is no use to you here
The best you can do is attempt to convert each field to int and h... | 1 | 0 | 0 | I have a TSV file that consists of integers along with some false data that could be anything such as floats or characters etc.
The idea is to read the contents of the file and find out which ones are bad (containing data other than integers)
Each line can be read using the readline method once the file has been open... | Read a file of mixed items and retain their data types | 0 | 0 | 0 | 374 |
11,927,409 | 2012-08-13T02:04:00.000 | 1 | 1 | 0 | 0 | python,smtp,rabbitmq,postfix-mta,amqp | 11,927,486 | 3 | false | 0 | 0 | Making an AMQP connection over plain TCP is pretty quick. Perhaps if you're using SSL then it's another story but you sure that enqueueing the raw message onto the AMQP exchange is going to be the bottleneck? My guess would be that actually delivering the message via SMTP is going to be much slower so how fast you ca... | 1 | 4 | 0 | I'm looking for a way to take gads of inbound SMTP messages and drop them onto an AMQP broker for further routing and processing. The messages won't actually end up in a mailbox, but instead SMTP is used as a message gateway.
I've written a Postfix After-Queue Content Filter in Python that drops the inbound SMTP messag... | Sending raw SMTP messages to an AMQP broker | 0.066568 | 0 | 1 | 1,843 |
11,927,604 | 2012-08-13T02:40:00.000 | 3 | 0 | 1 | 0 | javascript,python,google-apps-script | 11,927,684 | 1 | true | 1 | 0 | From what I can tell, the JavaScript-like language is the only one offered for Google Apps Script.
You seem to have confused it with Google App Engine, which is a platform-as-a-service that you can use to write your own applications, and offers Java, Python, and Go runtime environments. It is not a scripting language f... | 1 | 2 | 0 | I've inherited a fairly complex Googledoc spreadsheet with some scripted functionality implemented in the Google App Engine. The original coder used the JavaScript environment. Personally, I'm more comfortable with Python and I'm running into all kinds of weird errors on the JavaScript environment.
I'd like to just scr... | Migrate from JavaScript to Python on Google Apps | 1.2 | 0 | 0 | 157 |
11,927,848 | 2012-08-13T03:27:00.000 | 5 | 0 | 0 | 0 | python,sockets | 11,927,873 | 1 | false | 0 | 0 | EWOULDBLOCK means that the socket send buffer is full when sending, or that the socket receive buffer is empty when receiving. You are supposed to use select() to detect when these conditions become false. | 1 | 3 | 0 | I use socket in non-blocking mode, Client send data continuously to Server, although I set buffer for socket is big enough to save all data from client but Ewouldblock always threw, I don't know why, could you explain to me in detail about this Ewouldblock. | EWOULDBLOCK Error in socket programming | 0.761594 | 0 | 1 | 12,052 |
11,929,073 | 2012-08-13T06:20:00.000 | 1 | 0 | 0 | 0 | python,openerp,accounting | 11,929,906 | 2 | true | 1 | 0 | You can override "pay_and_reconcile" function to write in account field, this function is called at time of Pay.
action_date_assign()
action_move_create()
action_number()
this 3 function are called at time of validating invoice.
You can override any one from this or you can add your own function . in workflow for the ... | 1 | 1 | 0 | I'm new to OpenERP and python and I need some help saving an amount into a particular account.
I have created a field in the invoice form that calculates a specific amount based on some code and displays that amount in the field. What I want to do is to associate an account with this field, so when the invoice is valid... | OpenERP : Saving field value (amount) into an account | 1.2 | 0 | 0 | 226 |
11,931,804 | 2012-08-13T09:48:00.000 | -1 | 0 | 1 | 0 | python,coding-style | 13,382,603 | 3 | true | 0 | 0 | There is no better way to do it, it should work fine | 1 | 0 | 0 | Is there better way of getting the single value in the dictionary, if my dictionary only has one element?
I'm currently doing if len(a) == 1: print a.values()[0], is this the pythonic way to do it? | Get only value in dictionary if len == 1 | 1.2 | 0 | 0 | 1,170 |
11,939,286 | 2012-08-13T17:28:00.000 | 1 | 0 | 1 | 0 | python,utf-8,python-3.x,yaml,urldecode | 11,940,331 | 4 | false | 0 | 0 | The urllib.parse.unquote returned a correct UTF-8 string and writing that straight to the file returned did the expected result. The problem was with yaml. By default it doesn't encode with UTF-8.
My solution was to do:
yaml.dump("pe%20to%C5%A3i%20mai",encoding="utf-8").decode("unicode-escape")
Thanks to J.F. Sebastia... | 1 | 0 | 0 | I have a string like "pe%20to%C5%A3i%20mai". When I apply urllib.parse.unquote to it, I get "pe to\u0163i mai". If I try to write this to a file, I get those exact simbols, not the expected glyph.
How can I transform the string to utf-8 so in the file I have the proper glyph instead?
Edit: I'm using Python 3.2
Edit2: ... | Decoding UTF-8 URL in Python | 0.049958 | 0 | 1 | 4,404 |
11,942,094 | 2012-08-13T20:49:00.000 | 1 | 0 | 0 | 1 | python,django,google-app-engine,amazon-ec2,urllib | 11,960,819 | 3 | false | 1 | 0 | For server to server communication, traditional security advice would recommend some sort of IP range restriction at the web server level for the URLs in addition to whatever default security is in place. However, since you are making the call from a cloud provider to another cloud provider, your ability to permanently... | 2 | 3 | 0 | I have a website which uses Amazon EC2 with Django and Google App Engine for its powerful Image API and image serving infrastructure. When a user uploads an image the browser makes an AJAX request to my EC2 server for the Blobstore upload url. I'm fetching this through my Django server so I can check whether the user i... | Secured communication between two web servers (Amazon EC2 with Django and Google App Engine) | 0.066568 | 0 | 0 | 705 |
11,942,094 | 2012-08-13T20:49:00.000 | 2 | 0 | 0 | 1 | python,django,google-app-engine,amazon-ec2,urllib | 11,960,193 | 3 | true | 1 | 0 | apart from the Https call ( which you should be making to transfer info to django ), you can go with AES encryption ( use Pycrypto/ any other lib). It takes a secret key to encrypt your message. | 2 | 3 | 0 | I have a website which uses Amazon EC2 with Django and Google App Engine for its powerful Image API and image serving infrastructure. When a user uploads an image the browser makes an AJAX request to my EC2 server for the Blobstore upload url. I'm fetching this through my Django server so I can check whether the user i... | Secured communication between two web servers (Amazon EC2 with Django and Google App Engine) | 1.2 | 0 | 0 | 705 |
11,944,796 | 2012-08-14T02:02:00.000 | 1 | 0 | 0 | 0 | python,opencv,cluster-analysis,k-means | 12,489,308 | 1 | true | 0 | 0 | Since k-means is a randomized approach, you will probably encounter this problem even when analyzing the same frame multiple times.
Try to use the previous frames cluster centers as initial centers for k-means. This may make the ordering stable enough for you, and it may even significantly speed up k-means (assuming th... | 1 | 2 | 1 | So I have a video with 3 green spots on it. These spots have a bunch of "good features to track" around their perimeter.
The spots are very far away from each other so using KMeans I am easily able to identify them as separate clusters.
The problem comes in that the ordering of the clusters changes from frame to frame.... | cv.KMeans2 clustering indices inconsistent | 1.2 | 0 | 0 | 232 |
11,945,183 | 2012-08-14T02:56:00.000 | 0 | 0 | 1 | 0 | python,pyqt,pyqt4 | 66,418,264 | 4 | false | 0 | 1 | Emitting signals instead of synchronic UI control was the key to avoid problems for me during implementation of logic circuit simulator | 1 | 39 | 0 | I love both python and Qt, but it's pretty obvious to me that Qt was not designed with python in mind. There are numerous ways to crash a PyQt / PySide application, many of which are extraordinarily difficult to debug, even with the proper tools.
I would like to know: what are good practices for avoiding crashes and lo... | What are good practices for avoiding crashes / hangs in PyQt? | 0 | 0 | 0 | 14,012 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.