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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,007,801 | 2010-10-24T10:06:00.000 | 5 | 0 | 1 | 1 | python,macos | 4,008,331 | 3 | false | 0 | 0 | Yes, but the Python version may be different. OS X 10.5 shipped with Python 2.5, OS X 10.6 with Python 2.6. | 3 | 2 | 0 | Do all Mac OS X versions (above 10.4) have python preinstalled? | Do all Mac OS X versions (above 10.4) have python preinstalled? | 0.321513 | 0 | 0 | 687 |
4,007,847 | 2010-10-24T10:22:00.000 | 1 | 0 | 0 | 0 | python,click,screenshot | 4,007,877 | 3 | false | 0 | 1 | You can try to use Selenium RC + python driver for Selenium. There are means of making browser screenshot, and there is ClickAt method which takes coordinates. | 2 | 2 | 0 | Yes, that's what I need to achieve, don't ask why:)
So, since this is mainly OS dependent stuff I will be using Windows or Linux (whatever is simpler)
Every second my program will:
1. do a screenshot, analyze the board and other stuff (this I can do)
2. then move the mouse to some XY and do a left-click
that's all
My ... | python program that plays flash games for me | 0.066568 | 0 | 0 | 784 |
4,007,847 | 2010-10-24T10:22:00.000 | 3 | 0 | 0 | 0 | python,click,screenshot | 4,700,444 | 3 | false | 0 | 1 | I've done this very thing before - use PIL to get the screenshots, and pywinauto to generate the mouse clicks. | 2 | 2 | 0 | Yes, that's what I need to achieve, don't ask why:)
So, since this is mainly OS dependent stuff I will be using Windows or Linux (whatever is simpler)
Every second my program will:
1. do a screenshot, analyze the board and other stuff (this I can do)
2. then move the mouse to some XY and do a left-click
that's all
My ... | python program that plays flash games for me | 0.197375 | 0 | 0 | 784 |
4,008,546 | 2010-10-24T14:01:00.000 | 24 | 0 | 1 | 0 | python,string | 4,008,567 | 6 | false | 0 | 0 | It looks like you're only looking for pointers, not a complete solution. So here's one:
You can multiply strings in python:
>>> "A" * 4
'AAAA'
Additionally I would use better names, instead of s I'd use text, which is much clearer. Even if your current professor (I suppose you're learning Python in university.) uses ... | 1 | 40 | 0 | I should define a function pad_with_n_chars(s, n, c) that takes a
string 's', an integer 'n', and a character 'c' and returns
a string consisting of 's' padded with 'c' to create a
string with a centered 's' of length 'n'. For example,
pad_with_n_chars(”dog”, 5, ”x”) should return the
string "xdogx". | How to pad with n characters in Python | 1 | 0 | 0 | 45,810 |
4,009,130 | 2010-10-24T16:28:00.000 | 0 | 0 | 1 | 1 | python,windows | 4,009,744 | 3 | false | 0 | 0 | easy crossplatform/crosslanguage way of handling partial file saving:
save to a temporary filename like "file.ext.part"
after you're done saving, rename to "file.ext" | 1 | 0 | 0 | I'm working on a project for school where e-mails will be pulled from an inbox and downloaded to different locations depending on how things are parsed. The language I'm writing in is Python, and the environment it will be run on is Windows XP. The idea is that the program will run in the background with no interaction... | process closing while saving a file - Python - Windows XP | 0 | 0 | 0 | 124 |
4,009,251 | 2010-10-24T16:50:00.000 | 2 | 0 | 1 | 0 | python,string,list,comparison,sequence | 4,009,282 | 4 | false | 0 | 0 | This sounds very much like homework. Try thinking about it for a bit. Would it suffice to traverse the list of correct words once, and check if the corresponding word in the second list is equal to the word in the correct list?
I would probably zip the lists in python and compare the pairs for equality. | 1 | 0 | 0 | I was wondering what the most computationally efficient Python way of cracking this problem would be.
Say you have two strings (or lists from splitting those strings--doesn't matter), "this is the right string" vs. "this is right the string."
We're assuming that the first string is always right, and a score will be ass... | Python - Most efficient way to compare # of words sequenced in "right" order across two strings/lists | 0.099668 | 0 | 0 | 457 |
4,009,781 | 2010-10-24T18:44:00.000 | 1 | 1 | 1 | 0 | python | 4,009,829 | 4 | false | 0 | 0 | yes, and zip egg files are decompressed on the fly when you reference them making them slower than when you install it. | 1 | 1 | 0 | It seems like just adding a package path to your PYTHONPATH gives you access to all of its modules and functions, similar to installing an egg. Is the difference just that the egg is zip compressed? | How is a python egg different from a regular package? | 0.049958 | 0 | 0 | 1,047 |
4,010,108 | 2010-10-24T19:52:00.000 | 0 | 0 | 0 | 1 | python,windows,permissions,registry,winreg | 4,010,127 | 4 | false | 0 | 0 | You'll either need admin permissions to write to HKLM, or settle for non-global reg keys. Behavior is going to vary somewhat between different versions of windows. | 4 | 0 | 0 | I wrote an application that stores several things in the registry. When I first started, I added them to HKEY_LOCAL_MACHINE, but kept getting permission errors writing to the. So, it was suggested that I use HKEY_CURRENT_USER, that worked until I realized that I am not able to access them from another account. How can ... | Registry Entries for all users in Python | 0 | 0 | 0 | 1,512 |
4,010,108 | 2010-10-24T19:52:00.000 | 0 | 0 | 0 | 1 | python,windows,permissions,registry,winreg | 4,010,134 | 4 | false | 0 | 0 | If you want to write to the registry so that all users can read it, you will need to run your program with administrator privileges.
You might be happier storing your information in a file instead, which will be easier to manage. | 4 | 0 | 0 | I wrote an application that stores several things in the registry. When I first started, I added them to HKEY_LOCAL_MACHINE, but kept getting permission errors writing to the. So, it was suggested that I use HKEY_CURRENT_USER, that worked until I realized that I am not able to access them from another account. How can ... | Registry Entries for all users in Python | 0 | 0 | 0 | 1,512 |
4,010,108 | 2010-10-24T19:52:00.000 | 2 | 0 | 0 | 1 | python,windows,permissions,registry,winreg | 4,010,153 | 4 | true | 0 | 0 | HKEY_LOCAL_MACHINE/Software/YourSoftware, needs Admin permissions and is for install-time data, or HKEY_CURRENT_USER/Software/YourSoftware, which is for data pertinent to this environment only (this user, this profile etc.)
EDIT: An alternative would be storing a config file and setting the right permissions at install... | 4 | 0 | 0 | I wrote an application that stores several things in the registry. When I first started, I added them to HKEY_LOCAL_MACHINE, but kept getting permission errors writing to the. So, it was suggested that I use HKEY_CURRENT_USER, that worked until I realized that I am not able to access them from another account. How can ... | Registry Entries for all users in Python | 1.2 | 0 | 0 | 1,512 |
4,010,108 | 2010-10-24T19:52:00.000 | 0 | 0 | 0 | 1 | python,windows,permissions,registry,winreg | 5,973,100 | 4 | false | 0 | 0 | One other possibility would be changing the security on your HKLM keys to R/W for anyone. Although the idea that this is somehow security against modification seems a bit of a stretch.
Regedt32 has the ability to set the keys, so the underlying API must have it too.
All that said, this is a screwed up way to run an ap... | 4 | 0 | 0 | I wrote an application that stores several things in the registry. When I first started, I added them to HKEY_LOCAL_MACHINE, but kept getting permission errors writing to the. So, it was suggested that I use HKEY_CURRENT_USER, that worked until I realized that I am not able to access them from another account. How can ... | Registry Entries for all users in Python | 0 | 0 | 0 | 1,512 |
4,010,349 | 2010-10-24T20:40:00.000 | 0 | 0 | 0 | 1 | python,django,google-app-engine | 4,010,690 | 3 | false | 1 | 0 | Another thing to consider is how you install. I'd be sure to install django from SVN, because it makes updating it MUCH easier.
I have been using the dev version for a while on my site, and haven't encountered a single bug yet, aside from one that affected the admin site in a minor way (which a svn up fixed).
I don't... | 1 | 2 | 0 | I am about to start ramping up on Django and develop a web app that I want to deploy on Google App Engine. I learn that Google has Django 0.96 already installed on the APP engine, but the latest "official" version of Django I see is at 1.2.3 and its a bit of an effort to install it there.
I am curious which version of ... | Django development version vs stable release | 0 | 0 | 0 | 1,216 |
4,010,507 | 2010-10-24T21:17:00.000 | 0 | 0 | 0 | 0 | python,django | 4,013,095 | 1 | false | 1 | 0 | If, after you've cleaned your form with is_valid(), you render that cleaned form with your view, rather than redirect to a new page, you'll see the cleaned data in your page.
(If you wanted the user to see this cleaned data and then properly submit it, you could use a hidden field to track whether the form data has al... | 1 | 3 | 0 | How can I clean the data in a form and have the cleaned data redisplayed instead of the submitted data?
There are several fields in my form, and every time the user submits it, it should be redisplayed with the values the user entered. However, some of the fields I would like to clean and update for the user. More spe... | How do I forcefully clean a field and redisplay it in Django? | 0 | 0 | 0 | 220 |
4,011,245 | 2010-10-25T00:54:00.000 | 0 | 0 | 0 | 0 | python,windows,passwords,runas | 4,011,527 | 2 | false | 0 | 0 | Have the user add whatever it is as a scheduled task with a specific name but no schedule, so it can only be invoked manually. They will need to enter the account credentials when creating the task, but only once. Then you can simply tell schtasks (Windows command line tool) to run it. | 1 | 2 | 0 | I need to run a file as another user without it prompting for a password, from my script. How is this done? | Pass Password to runas from Python | 0 | 0 | 0 | 4,986 |
4,011,446 | 2010-10-25T02:07:00.000 | 1 | 0 | 1 | 0 | python,list | 4,011,481 | 4 | false | 0 | 0 | I'm pretty sure its as simple as "alist.pop()" | 1 | 0 | 0 | I'm having some trouble with a couple of hmwk questions and i can't find th answer-
How would you write an expression that removes the first or last element of a list?
i.e. One of my questions reads "Given a list named 'alist' , write an expression that removes the last element of 'alist'" | A question about lists in Python | 0.049958 | 0 | 0 | 1,098 |
4,011,855 | 2010-10-25T04:10:00.000 | 0 | 0 | 1 | 0 | python,regex | 6,064,682 | 8 | false | 0 | 0 | I think people are taking this too far I suggest you first do this:
ips = re.findall('(?:[\d]{1,3}).(?:[\d]{1,3}).(?:[\d]{1,3}).(?:[\d]{1,3})', page)
then split the 4 numbers where there is a '.' and check and see if they are smaller than 256 | 1 | 1 | 0 | I'm wondering if it's possible to compare values in regexps with the regexp system in Python. Matching the pattern of an IP is easy, but each 1-3 digits cannot be above 255 and that's where I'm a bit stumped. | Regexp to check if an IP is valid | 0 | 0 | 0 | 5,875 |
4,012,340 | 2010-10-25T06:42:00.000 | 10 | 0 | 1 | 0 | python | 22,001,004 | 3 | false | 0 | 0 | a[len(a):] - This gets you the length of a to the end. It selects a range. If you reverse a[:len(a)] it will get you the beginning to whatever is len(a). | 1 | 154 | 0 | I'm new to Python. I see : used in list indices especially when it's associated with function calls.
Python 2.7 documentation suggests that lists.append translates to a[len(a):] = [x]. Why does one need to suffix len(a) with a colon?
I understand that : is used to identify keys in dictionary. | Colon (:) in Python list index | 1 | 0 | 0 | 304,307 |
4,012,571 | 2010-10-25T07:23:00.000 | 0 | 0 | 1 | 1 | python,encoding,argv,sys | 41,064,642 | 7 | false | 0 | 0 | sys.getfilesystemencoding() works for me, at least on Windows.
On Windows it is actually 'mbcs', and 'utf-8' on *nix. | 2 | 24 | 0 | In what encoding are the elements of sys.argv, in Python? are they encoded with the sys.getdefaultencoding() encoding?
sys.getdefaultencoding(): Return the name of the current default string encoding used by the Unicode implementation.
PS: As pointed out in some of the answers, sys.stdin.encoding would indeed be a b... | Python: Which encoding is used for processing sys.argv? | 0 | 0 | 0 | 4,228 |
4,012,571 | 2010-10-25T07:23:00.000 | 6 | 0 | 1 | 1 | python,encoding,argv,sys | 4,013,349 | 7 | false | 0 | 0 | A few observations:
(1) It's certainly not sys.getdefaultencoding.
(2) sys.stdin.encoding appears to be a much better bet.
(3) On Windows, the actual value of sys.stdin.encoding will vary, depending on what software is providing the stdio. IDLE will use the system "ANSI" code page, e.g. cp1252 in most of Western Europe... | 2 | 24 | 0 | In what encoding are the elements of sys.argv, in Python? are they encoded with the sys.getdefaultencoding() encoding?
sys.getdefaultencoding(): Return the name of the current default string encoding used by the Unicode implementation.
PS: As pointed out in some of the answers, sys.stdin.encoding would indeed be a b... | Python: Which encoding is used for processing sys.argv? | 1 | 0 | 0 | 4,228 |
4,013,046 | 2010-10-25T08:49:00.000 | 2 | 1 | 0 | 0 | c#,c++,python,algorithm,performance | 4,013,104 | 2 | false | 0 | 0 | Compress the difference between successive images. Add some checksum. Provide some way for the receiver to request full image data for the case where things get out of synch.
There are probably a host of protocols doing that already.
So, search for live video stream protocols.
Cheers & hth., | 2 | 0 | 0 | I am solving a problem of transferring images from a camera in a loop from a client (a robot with camera) to a server (PC).
I am trying to come up with ideas how to maximize the transfer speed so I can get the best possible FPS (that is because I want to create a live video stream out of the transferred images). Disreg... | How to speed up transfer of images from client to server | 0.197375 | 0 | 1 | 375 |
4,013,046 | 2010-10-25T08:49:00.000 | 4 | 1 | 0 | 0 | c#,c++,python,algorithm,performance | 4,013,112 | 2 | true | 0 | 0 | This might be quite a bit of work but if your client can handle the computations in real time you could use the same method that video encoders use. Send a key frame every say 5 frames and in between only send the information that changed not the whole frame. I don't know the details of how this is done, but try Googli... | 2 | 0 | 0 | I am solving a problem of transferring images from a camera in a loop from a client (a robot with camera) to a server (PC).
I am trying to come up with ideas how to maximize the transfer speed so I can get the best possible FPS (that is because I want to create a live video stream out of the transferred images). Disreg... | How to speed up transfer of images from client to server | 1.2 | 0 | 1 | 375 |
4,013,733 | 2010-10-25T10:38:00.000 | 0 | 0 | 0 | 0 | python,django,django-models,django-admin | 4,030,636 | 1 | false | 1 | 0 | say you have a product model
class Product(models.Model):
name=models.CharField(max_length=20)
cost=models.DecimalField(max_length=10)
you can subclass the admin's Modeladmin to show a list display for the products or you can do a custom modelform for the product which you can call in the product's admin
f... | 1 | 0 | 0 | Our product model can have multiple campaigns. Our customers change these campaigns frequently and generally on multiple products. So what we need right now seems that we need to show a multiple select widget on a change-list of Product model where our customers can easily change the campaigns.
Any idea on this? Maybe... | django multiple select in admin change-list | 0 | 0 | 0 | 559 |
4,014,242 | 2010-10-25T11:51:00.000 | 0 | 0 | 1 | 0 | python,overlap,intervals | 4,422,033 | 3 | false | 0 | 0 | Maybe storing of all intersection intervals can help.
You need:
boundaries of union of all intervals,
for each intersection left boundary and list of intervals from which intersection is made.
Intersection intervals can be stored in a tree, because they are represented only with left boundary. Methods insert and dele... | 1 | 4 | 0 | I am looking for some python code to efficiently compute interval overlaps.
I've used the interval tree of the bx-python package before, but now need to delete intervals from the tree (or better yet, modify them).
It seems the bx-python tree doesn't support this.
Any pointers? | Python: Dynamic interval data structure | 0 | 0 | 0 | 3,581 |
4,014,670 | 2010-10-25T12:48:00.000 | 1 | 1 | 0 | 1 | java,php,javascript,python | 4,014,696 | 6 | false | 0 | 0 | You can write a WEB APPLICATION. The encryption part is solved by simple HTTPS usage. On the server side (your home computer with USB devices attached to it) you should use Python (since you're quite experienced with it) and a Python Web Framework you want (I.E. Django). | 3 | 3 | 0 | I wish to control my computer (and usb devices attached to the computer) at home with any computer that is connected to the internet. The computer at home must have a program installed that receives commands from any other computer that is connected to the internet. I thought it would be best if I do this with a web in... | Send commands between two computers over the internet | 0.033321 | 0 | 1 | 1,907 |
4,014,670 | 2010-10-25T12:48:00.000 | 0 | 1 | 0 | 1 | java,php,javascript,python | 4,014,765 | 6 | false | 0 | 0 | Well, I think that java can work well, in fact you have to deal with system calls to manage usb devices and things like that (and as far as I know, PHP is not the best language to do this). Also shouldn't be so hard to create a basic server/client program, just use good encryption mechanism to not show commands around ... | 3 | 3 | 0 | I wish to control my computer (and usb devices attached to the computer) at home with any computer that is connected to the internet. The computer at home must have a program installed that receives commands from any other computer that is connected to the internet. I thought it would be best if I do this with a web in... | Send commands between two computers over the internet | 0 | 0 | 1 | 1,907 |
4,014,670 | 2010-10-25T12:48:00.000 | 0 | 1 | 0 | 1 | java,php,javascript,python | 4,015,151 | 6 | false | 0 | 0 | I you are looking for solution you could use from any computer anywhere in the worls without the need to install any software on client pc, try logmein.com (http://secure.logmein.com).
It is free, reliable, works in any modern browser, you don't have to remmeber IPs and hope they won't change, ...
Or if this is a "for ... | 3 | 3 | 0 | I wish to control my computer (and usb devices attached to the computer) at home with any computer that is connected to the internet. The computer at home must have a program installed that receives commands from any other computer that is connected to the internet. I thought it would be best if I do this with a web in... | Send commands between two computers over the internet | 0 | 0 | 1 | 1,907 |
4,014,706 | 2010-10-25T12:53:00.000 | 0 | 0 | 1 | 0 | python | 4,014,896 | 2 | false | 0 | 0 | second problem: as the traceback says, aBuf is an int but it's expecting a string. You need to find out why.
uhhhh ... just worked it out; you are feeding it a single byte, expressed as an integer (0xab) instead of a string ('\xab'). In any case, chardet requires much more than 1 byte to be able to guess an encoding. F... | 1 | 0 | 0 | I am testing chardet in one of my scripts. I wanted to identify the encoding type of a result variable and chardet seems to do fine here.
So this is what I am doing:
myvar1 <-- gets its value from other functions
myvar2 = chardet.detect(myvar1) <-- to detect
the encoding type of myvar1
Now when I do a print myvar2, I... | Splitting results from chardet output to collect encoding type | 0 | 0 | 0 | 319 |
4,014,722 | 2010-10-25T12:56:00.000 | 0 | 0 | 1 | 0 | python,introspection | 4,014,972 | 4 | false | 0 | 0 | A function object contains only compiled bytecode, the source text is not kept. The only way to retrieve source code is to read the script file it came from.
There's nothing special about lambdas though: they still have a f.func_code.co_firstline and co_filename property which you can use to retrieve the source file, a... | 1 | 13 | 0 | Let's say I'm working in the Python shell and I'm given a function f. How can I access the string containing its source code? (From the shell, not by manually opening the code file.)
I want this to work even for lambda functions defined inside other functions. | Viewing the code of a Python function | 0 | 0 | 0 | 8,389 |
4,015,227 | 2010-10-25T13:53:00.000 | 0 | 0 | 0 | 0 | python,streaming,p2p,vlc,instant-messaging | 4,200,613 | 1 | false | 0 | 0 | I think they were suggesting you run your program on a LAN which has no ports blocked. | 1 | 0 | 0 | I've have asked these questions before with no proper answer. I hope I'll get some response here.
I'm developing an instant messenger in python and I'd like to handle video/audio streaming with VLC. Tha basic idea right now is that in each IM client I'm running one VLC instance that acts as a server that streams to al... | Problems with VLC and instant messaging | 0 | 0 | 1 | 224 |
4,016,151 | 2010-10-25T15:31:00.000 | 1 | 1 | 0 | 1 | python,windows,easy-install | 4,016,275 | 5 | false | 0 | 0 | For one thing, it says you already have that module installed. If you need to upgrade it, you should do something like this:
easy_install -U packageName
Of course, easy_install doesn't work very well if the package has some C headers that need to be compiled and you don't have the right version of Visual Studio install... | 1 | 63 | 0 | After installing Python 2.7 on Windows XP, then manually setting the %PATH% to python.exe (why won't the python installer do this?), then installing setuptools 0.6c11 (why doesn't the python installer do this?), then manually setting the %PATH% to easy_install.exe (why doesn't the installer do this?), I finally tried t... | How to use Python's "easy_install" on Windows ... it's not so easy | 0.039979 | 0 | 0 | 152,491 |
4,016,855 | 2010-10-25T16:44:00.000 | 7 | 0 | 1 | 0 | python | 4,016,865 | 4 | true | 0 | 0 | It's where it's always been, under Tools/ in the source distribution. | 2 | 10 | 0 | Anyone know where freeze.py is installed for 2.6.5? I can't seem to find it anywhere. Did it get pulled out and replaced with something else? | Python: Where is freeze.py? | 1.2 | 0 | 0 | 11,493 |
4,016,855 | 2010-10-25T16:44:00.000 | 0 | 0 | 1 | 0 | python | 4,020,422 | 4 | false | 0 | 0 | Are you getting the error: "needed directory /usr/local/lib/python/lib not found"?
You need to configure Freeze before you use it. Run "make libainstall" in your Python build tree. | 2 | 10 | 0 | Anyone know where freeze.py is installed for 2.6.5? I can't seem to find it anywhere. Did it get pulled out and replaced with something else? | Python: Where is freeze.py? | 0 | 0 | 0 | 11,493 |
4,017,129 | 2010-10-25T17:19:00.000 | 2 | 0 | 0 | 0 | python,linux,tkinter,option | 4,018,335 | 3 | true | 0 | 1 | Linux doesn't have those drive letters C:, D:, etc. In linux all filesystems of different drives are mounted on separate folders in the same tree structure, so you only have a single tree.
Most distros use /media to mount pendrives etc, but hard drives can be configured to mount on any folder. So there's no such thing ... | 3 | 0 | 0 | I'm using "tkFileDialog.askopenfilename" to get a file name variable. I know that I can set the "initialdir" option, but not everyone who uses the program will have the target file on the same drive. For example: the file could be located on the C:, D:, E: etc... I don't see a way to view available drives with the dial... | tkFileDialog.askopenfilename How to specify a different drive? | 1.2 | 0 | 0 | 1,219 |
4,017,129 | 2010-10-25T17:19:00.000 | 0 | 0 | 0 | 0 | python,linux,tkinter,option | 4,028,422 | 3 | false | 0 | 1 | If you simply point to "/" it contains all mounted devices... | 3 | 0 | 0 | I'm using "tkFileDialog.askopenfilename" to get a file name variable. I know that I can set the "initialdir" option, but not everyone who uses the program will have the target file on the same drive. For example: the file could be located on the C:, D:, E: etc... I don't see a way to view available drives with the dial... | tkFileDialog.askopenfilename How to specify a different drive? | 0 | 0 | 0 | 1,219 |
4,017,129 | 2010-10-25T17:19:00.000 | 1 | 0 | 0 | 0 | python,linux,tkinter,option | 4,028,563 | 3 | false | 0 | 1 | As nosklo sais, in Linux you don't have drive letters. Everything are paths.
If the file can be in any path, I would expect that the user will known the path, but I would consider the next options:
Default to the user's home path. You
can directly use the ´~´and tk will
convert it to the Linux home folder
or the Windo... | 3 | 0 | 0 | I'm using "tkFileDialog.askopenfilename" to get a file name variable. I know that I can set the "initialdir" option, but not everyone who uses the program will have the target file on the same drive. For example: the file could be located on the C:, D:, E: etc... I don't see a way to view available drives with the dial... | tkFileDialog.askopenfilename How to specify a different drive? | 0.066568 | 0 | 0 | 1,219 |
4,017,164 | 2010-10-25T17:23:00.000 | 0 | 0 | 0 | 0 | sqlalchemy,python-elixir | 4,025,154 | 1 | true | 0 | 0 | After a day or so of deliberation, I'm attempting to load the new business module in IronPython. Although I don't really want to introduce to python interpreters into my environment, I think that this will be the glue I need to get this done efficiently. | 1 | 0 | 0 | A new requirement has come down from the top: implement 'proprietary business tech' with the awesome, resilient Elixir database I have set up. I've tried a lot of different things, such as creating an implib from the provided interop DLL (which apparently doesn't work like COM dlls) which didn't work at all. CPython do... | Loading Elixir/SQLAlchemy models in .NET? | 1.2 | 1 | 0 | 502 |
4,019,571 | 2010-10-25T23:04:00.000 | 2 | 0 | 0 | 0 | python,video,video-streaming | 4,020,278 | 1 | true | 0 | 1 | Or would that be just lame?
No. It wouldn't work at all.
There's a trick to getting video to work. Apple's QuickTime implements that trick. So does a bunch of Microsoft product. Plus some open source video playback tools.
There are several closely-related tricks, all of which are a huge pain in the neck.
Compress... | 1 | 3 | 0 | I have a camera that is taking pictures one by one (about 10 pictures per second) and sending them to PC. I need to show this incoming sequence of images as a live video in PC.
Is it enough just to use some Python GUI framework, create a control that will hold a single image and just change the image in the control ver... | The simplest video streaming? | 1.2 | 0 | 0 | 5,351 |
4,019,611 | 2010-10-25T23:11:00.000 | 0 | 0 | 0 | 0 | python,geospatial,kml,latitude-longitude | 4,026,507 | 1 | true | 0 | 1 | The overlay image referenced by the kml file was in standard geographic projection.
This means that the latitudes and longitudes vary linearly within the image.
Calculating the latitude and longitude of each pixel became a trivial case of interpolation given that we already known the lat/lon bounds of the image provid... | 1 | 0 | 0 | I am using .kml file which points to an overlay image (presumably in UTM projection?).
The KML file provides the latitudes and longitudes of the bounding box using the "LatLonBox" tag.
I need to calculate the latitudes and longitudes of each pixel in this image.
Are there any pre-existing libraries in Python that wo... | How can I calculate the latitude and longitude of each pixel of an image in a kml file using Python? | 1.2 | 0 | 0 | 744 |
4,022,049 | 2010-10-26T08:53:00.000 | 5 | 0 | 0 | 0 | python,pyqt,qtableview | 4,022,111 | 1 | true | 0 | 1 | As you dont state what you canged in your model, ill assume the simplest form of change (changed data).
For me model.select() works to update the data in the model and force the View to update itself. | 1 | 1 | 0 | I have a QTableView which displays data from a QSqlTableModel. I want my model to check for changes when a user hits a "refresh" button but I can't find a way to update the data.
I tried the reset() and update() methods on the model without any result.
Is it possible to "re-read" from the database and update the model?... | Force Update QTableView + QSqlTableModel in PyQt | 1.2 | 0 | 0 | 3,260 |
4,022,887 | 2010-10-26T10:42:00.000 | 0 | 0 | 0 | 0 | python,csv,pytables | 4,023,046 | 6 | false | 0 | 0 | These are not "exclusive" choices.
You need both.
CSV is just a data exchange format. If you use pytables, you still need to import and export in CSV format. | 3 | 8 | 1 | I recently came across Pytables and find it to be very cool. It is clear that they are superior to a csv format for very large data sets. I am running some simulations using python. The output is not so large, say 200 columns and 2000 rows.
If someone has experience with both, can you suggest which format would be mor... | Pytables vs. CSV for files that are not very large | 0 | 0 | 0 | 3,418 |
4,022,887 | 2010-10-26T10:42:00.000 | 2 | 0 | 0 | 0 | python,csv,pytables | 7,753,331 | 6 | false | 0 | 0 | One big plus for PyTables is the storage of metadata, like variables etc.
If you run the simulations more often with different parameters you the store the results as an array entry in the h5 file.
We use it to store measurement data + experiment scripts to get the data so it is all self contained.
BTW: If you need to ... | 3 | 8 | 1 | I recently came across Pytables and find it to be very cool. It is clear that they are superior to a csv format for very large data sets. I am running some simulations using python. The output is not so large, say 200 columns and 2000 rows.
If someone has experience with both, can you suggest which format would be mor... | Pytables vs. CSV for files that are not very large | 0.066568 | 0 | 0 | 3,418 |
4,022,887 | 2010-10-26T10:42:00.000 | 1 | 0 | 0 | 0 | python,csv,pytables | 4,024,016 | 6 | false | 0 | 0 | i think its very hard to comapre pytables and csv.. pyTable is a datastructure ehile CSV is an exchange format for data. | 3 | 8 | 1 | I recently came across Pytables and find it to be very cool. It is clear that they are superior to a csv format for very large data sets. I am running some simulations using python. The output is not so large, say 200 columns and 2000 rows.
If someone has experience with both, can you suggest which format would be mor... | Pytables vs. CSV for files that are not very large | 0.033321 | 0 | 0 | 3,418 |
4,025,412 | 2010-10-26T15:49:00.000 | 0 | 1 | 0 | 1 | buildout,python-egg-cache | 4,026,496 | 2 | true | 0 | 0 | I'm not sure what you mean. Three options that you normally have:
Buildout, by default, stores the eggs in a directory called eggs/ inside your buildout directory.
You can set the eggs-dir variable inside your buildout.cfg's [buildout] section to some directory. Just tell it where to place them.
You can also set tha... | 1 | 1 | 0 | We're having problems when trying to deploy a number of projects which use zc.buildout - specifically we're finding that they want to put their PYTHON_EGG_CACHE directories all over the show. We'd like to somehow set this directory to one at the same level as the built-out project, where eggs can be found.
There is som... | Specify a custom PYTHON_EGG_CACHE dir with zc.buildout? | 1.2 | 0 | 0 | 1,434 |
4,026,026 | 2010-10-26T17:02:00.000 | 0 | 1 | 0 | 0 | python,user-interface,sqlalchemy,cross-platform,python-elixir | 9,863,280 | 2 | false | 0 | 1 | In my opinion the best option for this would be to make a CGI program to run through a browser so that you do not have to worry about platform issues. Granted it might take a little bit more work, it may be better suited for cross platform deployment. :) | 2 | 3 | 0 | My needs :
I need to develop an GUI application that is cross platform
the chosen solution must be the fastest to implement
it should be easy to extend
The application is just a database front-end, mainly for CRUD operations, listing, filtering, exporting, charts and graphs etc.
After reading about some solutions (Py... | Feedback for Camelot | 0 | 0 | 0 | 593 |
4,026,026 | 2010-10-26T17:02:00.000 | 1 | 1 | 0 | 0 | python,user-interface,sqlalchemy,cross-platform,python-elixir | 14,327,581 | 2 | false | 0 | 1 | Disclaimer: I am a Camelot committer.
If the question has been raised on the Programmers Stack Exchange, please link to it.
This question is kind of old, but for any reference, i'll chime in.
Camelot was and is developed for exactly the reasons you stated. It has matured a lot since this questions was asked and is abou... | 2 | 3 | 0 | My needs :
I need to develop an GUI application that is cross platform
the chosen solution must be the fastest to implement
it should be easy to extend
The application is just a database front-end, mainly for CRUD operations, listing, filtering, exporting, charts and graphs etc.
After reading about some solutions (Py... | Feedback for Camelot | 0.099668 | 0 | 0 | 593 |
4,027,508 | 2010-10-26T20:02:00.000 | 1 | 0 | 0 | 0 | javascript,python,ajax,django | 4,027,614 | 3 | false | 1 | 0 | The reason to update all of the comments is to take in account other comments that other people may have also submitted in the meantime. to keep the site truly dynamic, you can do either that, or even, when the page is loaded, load up a variable with the newest submitted comment ID, and set a timer that goes back to ch... | 3 | 2 | 0 | This is a situation I've run into several times, not sure what the best approach is.
Let's say I have some kind of dynamic content that users can add to via Ajax. For example, take Stack Overflow's comments - people can add comments directly on to the page using Ajax.
The question is, how do I implement the addition it... | Loading New Content with Ajax | 0.066568 | 0 | 0 | 261 |
4,027,508 | 2010-10-26T20:02:00.000 | 1 | 0 | 0 | 0 | javascript,python,ajax,django | 4,027,641 | 3 | false | 1 | 0 | I am not proficient neither with Django nor Python but I suppose the basic logic is similar for all server-side languages.
When weighing the pros and cons of either approach things depend on what you want to optimize. If bandwidth is important then obviously using pure JSON in communication reduces latency when compare... | 3 | 2 | 0 | This is a situation I've run into several times, not sure what the best approach is.
Let's say I have some kind of dynamic content that users can add to via Ajax. For example, take Stack Overflow's comments - people can add comments directly on to the page using Ajax.
The question is, how do I implement the addition it... | Loading New Content with Ajax | 0.066568 | 0 | 0 | 261 |
4,027,508 | 2010-10-26T20:02:00.000 | 4 | 0 | 0 | 0 | javascript,python,ajax,django | 4,029,103 | 3 | true | 1 | 0 | If the content is simple, I would get JSON and build the HTML in jQuery. If it's complex, I would create a template and call render() on it on the server and return the HTML (which jQuery could either append to other content or replace existing content). | 3 | 2 | 0 | This is a situation I've run into several times, not sure what the best approach is.
Let's say I have some kind of dynamic content that users can add to via Ajax. For example, take Stack Overflow's comments - people can add comments directly on to the page using Ajax.
The question is, how do I implement the addition it... | Loading New Content with Ajax | 1.2 | 0 | 0 | 261 |
4,027,975 | 2010-10-26T20:59:00.000 | -1 | 0 | 1 | 0 | php,python,math | 4,028,047 | 6 | false | 0 | 0 | ($people * $breadSticksPerPerson) / $holders isn't correct?
EDIT: Sorry, misread your question, posted the correct solution in comments | 1 | 1 | 0 | Feeling pretty brain-dead right now. I can, of course, brute-force this, but I feel like there has to be a simple function to return this number. Concerning native functions, I'm using PHP and/or Python.
For example: there exists containers that hold X (5) breadsticks each, and
I need to feed Y (25) people Z (3) brea... | Return minimum X (that can contain Y items) for arbitrary number of items | -0.033321 | 0 | 0 | 121 |
4,029,807 | 2010-10-27T03:42:00.000 | 0 | 0 | 0 | 0 | python,django,polling | 4,029,976 | 2 | false | 1 | 0 | Hmm. You could do it two ways that I can think of off the bat - there are surely more.
You can add a field called "already_retrieved" and set it to True for those fields that have already been retrieved, and then only grab Whatever.objects.filter(already_retrieved=False).
Also, if they are in order by a pk, you could ... | 1 | 0 | 0 | In ajax I am polling a django url to retrieve the latest records. I do not want to display any records I have retrieved previously and I only want to retrieve 1 record for each poll request.
What would be the best way to do this? | Django Poll for new records | 0 | 0 | 0 | 92 |
4,029,946 | 2010-10-27T04:21:00.000 | 40 | 0 | 1 | 0 | python,configuration | 4,057,933 | 2 | true | 0 | 0 | After getting around to testing it, ConfigParser overwrites the keys with each successive file, the order in which the files are read is determined by the order of the file names in the list passed to ConfigParser.read | 1 | 44 | 0 | When calling ConfigParser.read you are allowed to pass a list of strings corresponding to potential locations for configuration files and the function returns a list of those files that were successfully read.
What is the default behaviour when multiple configuration files are loaded that have overlapping sections/key... | Multiple configuration files with Python ConfigParser | 1.2 | 0 | 0 | 20,141 |
4,030,026 | 2010-10-27T04:44:00.000 | 3 | 0 | 0 | 0 | php,python,django,frameworks | 4,030,033 | 5 | false | 1 | 0 | I'd try Symfony.
What you're referring to sounds like "scaffolding" | 2 | 0 | 0 | I am using python with django. There I can simply make form from models and also it had builtin Admin.
I am eager to know corresponding framework for PHP with all this facilities.
I have encountered lot some similar questions like this, but they had not compared the frameworks with django. Experts Please Suggest. | Any framework for PHP, as effective as Django for Python? | 0.119427 | 0 | 0 | 3,514 |
4,030,026 | 2010-10-27T04:44:00.000 | 2 | 0 | 0 | 0 | php,python,django,frameworks | 4,030,038 | 5 | false | 1 | 0 | I've had good success with Zend in the past. It has a lot of functionality in its libraries and it is all completely decoupled, so you can use whichever parts best fit your task, leaving out other things all together. | 2 | 0 | 0 | I am using python with django. There I can simply make form from models and also it had builtin Admin.
I am eager to know corresponding framework for PHP with all this facilities.
I have encountered lot some similar questions like this, but they had not compared the frameworks with django. Experts Please Suggest. | Any framework for PHP, as effective as Django for Python? | 0.07983 | 0 | 0 | 3,514 |
4,030,277 | 2010-10-27T05:40:00.000 | 1 | 0 | 1 | 1 | python,multiprocess | 4,385,534 | 1 | false | 1 | 0 | Main proc is waiting for all child procs to be terminated before exits itself so there's a blocking call (i.e. wait4) registered as at_exit handles. The signal you sent interrupts that blocking call thus the stack trace.
The thing I'm not clear about is that if the signal sent to child would be redirected to the parent... | 1 | 0 | 0 | I have one multprocess demo here, and I met some problems with it. Researched for a night, I cannot resolve the reason.
Any one can help me?
I want to have one parent process acts as producer, when there are tasks come, the parent can fork some children to consume these tasks. The parent monitors the child, if any one ... | One python multiprocess errors | 0.197375 | 0 | 0 | 1,864 |
4,030,296 | 2010-10-27T05:44:00.000 | 0 | 0 | 1 | 0 | python,signals,alarm,pyserial | 4,030,308 | 2 | false | 0 | 0 | The problem is that your alarm will interrupt the read from the serial port, which isn't at all what you want.
It sounds like you probably want to break this into two threads that do work separately. | 1 | 1 | 0 | so i have a motion sensor connected to an avr micro that is communicating with my python app via usb. im using pyserial to do the comm. during my script i have an infinate loop checking for data from the avr micro. before this loop i start a timer with signal.alarm() that will call a function to end a subprocess. when ... | signal.alarm() handler causing problem with pyserial | 0 | 0 | 0 | 732 |
4,031,402 | 2010-10-27T08:52:00.000 | 13 | 0 | 0 | 1 | python,asynchronous,twisted | 4,033,221 | 4 | true | 0 | 0 | In a comment on another answer, you say "Every library is supposed to have ...". "Supposed" by whom? Having use-cases is certainly a nice way to nail down your requirements, but it's not the only way. It also doesn't make sense to talk about the use-cases for all of Twisted at once. There is no use case that justif... | 1 | 12 | 0 | I have been playing around with the twisted framework for about a week now(more because of curiosity rather than having to use it) and its been a lot of fun doing event driven asynchronous network programming.
However, there is something that I fail to understand. The twisted documentation starts off with
Twisted is ... | Why is there a need for Twisted? | 1.2 | 0 | 0 | 3,010 |
4,031,453 | 2010-10-27T09:00:00.000 | 0 | 0 | 1 | 0 | python,class,serialization | 4,031,637 | 2 | false | 0 | 0 | Use a dict instead of a class. | 1 | 0 | 0 | I have instance of the my class. I want to save implementation of class with instance's pickle copy in file. After, I want to use this instance to another computer where there is no implementation of the my class. I don't want to save text of implementation manually.
How can I do this? | How save implement class in python? | 0 | 0 | 0 | 294 |
4,032,925 | 2010-10-27T12:01:00.000 | 5 | 0 | 1 | 0 | python,python-3.x | 4,033,509 | 3 | true | 0 | 0 | The capitalization of the class names is irrelevant, it doesn't signify anything. Except that Python has sometimes grown organically and the standard library doesn't have the same homogenous feel as other large libraries such as the Win32 API or the Java standard library. | 1 | 5 | 0 | Why do collection.defaultdict and collection.OrderedDict have different capitalizations?
Is there some subtle difference that I should be aware of?
(P3K) | capitalization of library class names | 1.2 | 0 | 0 | 1,596 |
4,033,325 | 2010-10-27T12:45:00.000 | 1 | 0 | 0 | 0 | javascript,python,html,ruby | 4,036,760 | 2 | true | 1 | 0 | If you meant "embed" rather than "extend" and you just want people to drop a little box on a page and that's it, then an iframe should be fine.
However, if you want two-way communication or mashupability — rather than "opaque blob of HTML and hope for the best" communication — then a JavaScript or REST API might be a b... | 2 | 1 | 0 | I am about to build a web application and I want to allow other developers extend it with their own applications.
Should I do this with iFrames like Facebook?
Is this a good practice?
Are there other alternatives that let other developers extend my application (that is for the user it looks like it's from my applicatio... | 3rd party applications inside iFrames? | 1.2 | 0 | 0 | 321 |
4,033,325 | 2010-10-27T12:45:00.000 | 0 | 0 | 0 | 0 | javascript,python,html,ruby | 4,033,372 | 2 | false | 1 | 0 | It depends on what you mean by "extend". When you use iFrames with 3rd parties, presumably vended from different domains than the host page, then you are constrained by cross-domain issues and cannot interact with the contents of those iFrames. If that's not an issue for you, then you can go ahead and try that strategy... | 2 | 1 | 0 | I am about to build a web application and I want to allow other developers extend it with their own applications.
Should I do this with iFrames like Facebook?
Is this a good practice?
Are there other alternatives that let other developers extend my application (that is for the user it looks like it's from my applicatio... | 3rd party applications inside iFrames? | 0 | 0 | 0 | 321 |
4,033,492 | 2010-10-27T13:02:00.000 | 1 | 0 | 0 | 0 | php,python,django | 4,039,483 | 1 | true | 1 | 0 | You should probably bundle Django with your project - or the parts of it that are needed. Users of your product will need to have python and the necessary libs installed. That is not something that you can do via PHP. Well, you could, but that would be like Webmin. When making a product for sale or for users to install... | 1 | 0 | 0 | A simple question:
Is this possible?
Is it worth the time looking into it? | PHP front-end for installing Django | 1.2 | 0 | 0 | 208 |
4,033,669 | 2010-10-27T13:19:00.000 | 2 | 0 | 1 | 0 | python | 4,033,706 | 1 | true | 0 | 0 | The file is not run in a separate thread or process, it runs synchronously with the caller. | 1 | 2 | 0 | does the file which is sent as an argument to execfile runs as an independent process / thread or is the code imported and then executed ? . Also i wanted to know how efficient is it compared to running threads / process . | how does execfile() work in python? | 1.2 | 0 | 0 | 793 |
4,033,735 | 2010-10-27T13:26:00.000 | 1 | 1 | 0 | 0 | php,.net,python,ruby-on-rails | 4,034,000 | 2 | false | 1 | 0 | Write in assembler if you're comfortable with that. :)
Some questions you should ask yourself:
Are there hosting restrictions? No point in coding ASP.net when you have a PHP-only host/server.
Are there technical restrictions? E.g. if you want to use SQL Server as a back-end, going with ASP.net may make your life easi... | 2 | 1 | 0 | I am developing a social networking website in the facebook/foursquare-ish space. I have gotten such varied feedback on what platform I should develop in. Of course it will be heavily influenced by who I hire, but i was hoping for a little additional feedback from the larger community. Thanks. | What do i build my alpha platform on, PHP, Ruby, Python, .NET, etc? | 0.099668 | 0 | 0 | 156 |
4,033,735 | 2010-10-27T13:26:00.000 | 7 | 1 | 0 | 0 | php,.net,python,ruby-on-rails | 4,033,788 | 2 | false | 1 | 0 | It doesn't matter.
StackOverflow was written in ASP .NET MVC and it's awesome.
Twitter was written in Rails and it's super popular.
Facebook was written in PHP and half a billion people use it.
It's not the technology, it's the community. That's the hard part.
Just pick one and go. Your best bet might actually be t... | 2 | 1 | 0 | I am developing a social networking website in the facebook/foursquare-ish space. I have gotten such varied feedback on what platform I should develop in. Of course it will be heavily influenced by who I hire, but i was hoping for a little additional feedback from the larger community. Thanks. | What do i build my alpha platform on, PHP, Ruby, Python, .NET, etc? | 1 | 0 | 0 | 156 |
4,034,169 | 2010-10-27T14:09:00.000 | 0 | 0 | 0 | 0 | python,webkit | 17,223,197 | 10 | false | 1 | 0 | If you are thinking about real desktop applications that are multi-threaded and/or use multiple system component - forget about JavaScript. That requires a very good SDK (like PyQt4), and not a basic wrapper like Appcelerator Titanium. Note that developing such applications takes a lot of time.
Second option is to drop... | 2 | 22 | 0 | I have been experimenting with Appcelerator Titanum yesterday and I think it's cool when it comes to Javascript.
Python features on Appcelerator Titanum are so limited (can't use some modules for example).
My question is How can I use html & javascript as a GUI tool for a real python application ?
I am running win... | How can I use HTML + Javascript to build a python GUI? | 0 | 0 | 0 | 24,264 |
4,034,169 | 2010-10-27T14:09:00.000 | 0 | 0 | 0 | 0 | python,webkit | 4,064,133 | 10 | false | 1 | 0 | I assume you are mobilizing a web-application for cross platform access.
If so have you considered abstracting the cross platform access at the web-app presentation layer ?
Appcelerator / Webkit does not provide true native look-and-feel on mobile devices but this is where a new technology can help. | 2 | 22 | 0 | I have been experimenting with Appcelerator Titanum yesterday and I think it's cool when it comes to Javascript.
Python features on Appcelerator Titanum are so limited (can't use some modules for example).
My question is How can I use html & javascript as a GUI tool for a real python application ?
I am running win... | How can I use HTML + Javascript to build a python GUI? | 0 | 0 | 0 | 24,264 |
4,034,251 | 2010-10-27T14:18:00.000 | 7 | 0 | 0 | 1 | python | 4,036,149 | 1 | true | 0 | 0 | Twisted's DNS library is cross platform. Whether or not it's the "fastest" is debateable but Twisted performs very well on the whole. I'd be surprised if it couldn't saturate your I/O link.
One point of note though: Twisted uses asynchronous I/O rather than multi-tasking to achieve concurrency. Async I/O is a very good... | 1 | 1 | 0 | What library is the fastest to make hundreds of DNS queries in multi-tasking.
I've googled round DNS libraries for python. I found that adns is said to be fastest.
But it's not Windows-compatible. Are there any cross-platform compatible DNS libraries for python? | Fastest DNS library for python | 1.2 | 0 | 0 | 769 |
4,035,195 | 2010-10-27T16:00:00.000 | 0 | 0 | 0 | 0 | python,django,geolocation | 4,037,302 | 2 | false | 1 | 0 | Geocoding datasets from yahoo and google can be a good starting poing, Also take a look at geopy library in django. | 1 | 2 | 0 | I would like to be able to associate various models (Venues, places, landmarks) with a City/Country.
But I am not sure what some good ways of implementing this would be.
I'm following a simple route, I have implemented a Country and City model.
Whenever a new city or country is mentioned it is automatically created.
U... | A good way to make Django geolocation aware? - Django/Geolocation | 0 | 0 | 0 | 1,229 |
4,035,298 | 2010-10-27T16:12:00.000 | 0 | 0 | 0 | 0 | python,django-models | 4,045,209 | 2 | false | 1 | 0 | What I have done is to inherit from a base class on all my models that will be related to tasks. Task models points to that base class on the ForeignKey with unique=True, and it seems like all subclasses inherit the relationship. Thanks. | 1 | 0 | 0 | I want to design a Task model that can be associated to Project Models, another X model, and other Task models. The obvious choice is a foreign key, but I want any particular instance of that Task model to only be associated to only one of those model types, that is, if a Task model has a relationship with a Project mo... | Advice on designing django model with "exclusive" foreign key relationships | 0 | 0 | 0 | 141 |
4,037,481 | 2010-10-27T20:36:00.000 | -3 | 1 | 1 | 0 | python,memoization | 4,037,504 | 11 | false | 0 | 0 | The most simple way of doing this would probably be to just write a method (instead of using an attribute) that wraps around the attribute (getter method). On the first call, this methods calculates, saves and returns the value; later it just returns the saved value. | 1 | 114 | 0 | I'm writing a class in python and I have an attribute that will take a relatively long time to compute, so I only want to do it once. Also, it will not be needed by every instance of the class, so I don't want to do it by default in __init__.
I'm new to Python, but not to programming. I can come up with a way to do... | Caching class attributes in Python | -0.054491 | 0 | 0 | 54,820 |
4,038,517 | 2010-10-27T23:21:00.000 | 2 | 0 | 0 | 0 | python,tkinter | 4,039,444 | 2 | true | 0 | 1 | There is nothing specifically built-in to Tkinter to solve this. It's really a simple problem to solve though: remove the callback, set the value, add the callback. Or, set a global flag and check for that flag in the callback.
There are ways to solve the problem -- subclass the widget, for example -- but that doesn't ... | 1 | 4 | 0 | I have a Tkinter GUI where there is a Scale object. I have a callback assigned (by the command constructor parameter) to perform an action when the user changes the scale position. However, there is also a case where the value represented by the scale is modified externally, and so I set the scale position using Scal... | Tkinter: Set a 'scale' value without triggering callback? | 1.2 | 0 | 0 | 2,247 |
4,039,278 | 2010-10-28T02:30:00.000 | 4 | 0 | 0 | 0 | python,django | 4,039,366 | 3 | false | 1 | 0 | HTTP is a stateless protocol: you can't know at the server if the user has simply closed their browser without informing you. | 2 | 0 | 0 | Django, Python: How do I know if users have closed their browser without click logout?
Really seriously question, because I need to analyse the user activities. | Django, Python: How do I know if users have closed their browser without click logout? | 0.26052 | 0 | 0 | 982 |
4,039,278 | 2010-10-28T02:30:00.000 | 0 | 0 | 0 | 0 | python,django | 4,039,425 | 3 | false | 1 | 0 | It's not pretty, but you could fire off ajax requests with the user's session info (or some cookie, or any way of identifying the user) every x seconds with javascript and if you haven't received anything from that user in 2*x seconds, then they're likely to have left the page/site. | 2 | 0 | 0 | Django, Python: How do I know if users have closed their browser without click logout?
Really seriously question, because I need to analyse the user activities. | Django, Python: How do I know if users have closed their browser without click logout? | 0 | 0 | 0 | 982 |
4,039,354 | 2010-10-28T02:44:00.000 | 4 | 0 | 1 | 0 | python | 4,039,361 | 1 | true | 0 | 0 | Mixed-case is less common than underscores: is_verbose, and actually, the is- prefix isn't all that common. I guess there isn't a strong convention one way or the other. | 1 | 1 | 0 | Is it standard practice or convention in Python to prepend boolean instance variables with is?
For example:
"options.isVerbose" | Are boolean instance variables prepended with "is" in Python? | 1.2 | 0 | 0 | 248 |
4,040,656 | 2010-10-28T07:21:00.000 | 1 | 0 | 0 | 0 | python,django,django-models | 4,040,743 | 2 | false | 1 | 0 | fullhistory seems to do most of what you want - what part of the requirement does it not fulfil? It might be easier to enhance fullhistory.
Another option is to do it at the database level, if your database supports logging at that level. | 1 | 2 | 0 | I have to implement an application in django which will track all the changes in the database with the previous values,current value,action,date,time, user(who performed the changes) etc.
Is there any application/module available in python or django which can perform these actions with may be after some changes. I hav... | Django: tracking all the database changes with values | 0.099668 | 0 | 0 | 1,840 |
4,040,825 | 2010-10-28T07:51:00.000 | 0 | 0 | 1 | 0 | c#,asp.net-mvc,clr,ironpython,razor | 4,040,871 | 2 | false | 1 | 0 | Not test, try use assembly.FullName instead of assembly.Location. | 1 | 2 | 0 | In my AppDomain there are few dynamic assembly, when I try
codeDom.CompileAssemblyFromSource
to Compile another new assembly, I can't figure out a way to add those dynamic assemble to ReferencedAssemblies.
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
compilerParameters.ReferencedAssembl... | How to add reference to a dynamic assembly for compiling another dynamic assembly? | 0 | 0 | 0 | 2,123 |
4,041,543 | 2010-10-28T09:35:00.000 | 0 | 0 | 0 | 0 | python,django | 4,042,630 | 1 | true | 1 | 0 | It seems that proxy objects don't have local_fields set, which would be logical. I've just found something in the existing code (exploiting the django python serializer) that works around the lack of local_fields...
I think my question is void :-/ | 1 | 0 | 0 | [python 2.6 - django 1.1.1]
Hello.
I'm writing a custom serializer for my django application.
All the objects that I use are proxy objects derived from django model classes and implement special members that I must serialize (hence the custom serializer).
So I've begun to implement a new abstract serializer that inheri... | Django : ORM objects come with nothing in _meta.local_fields | 1.2 | 0 | 0 | 280 |
4,042,286 | 2010-10-28T11:11:00.000 | 0 | 0 | 0 | 0 | python,django,django-models,django-admin | 4,042,305 | 2 | false | 1 | 0 | Django doen't follow convention over configuration philosophy. you have to explicitly create the backing model for the table and in the meta tell it about the table name... | 2 | 0 | 0 | Django: If I added new tables to database, how can I query them?
Do I need to create the relevant models first? Or django creates it by itself?
More specifically, I installed another django app, it created several database tables in database, and now I want to get some specific data from them? What are the correct app... | Django: If I added new tables to database, how can I query them? | 0 | 1 | 0 | 78 |
4,042,286 | 2010-10-28T11:11:00.000 | 1 | 0 | 0 | 0 | python,django,django-models,django-admin | 4,042,337 | 2 | true | 1 | 0 | I suppose another django app has all model files needed to access those tables, you should just try importing those packages and use this app's models. | 2 | 0 | 0 | Django: If I added new tables to database, how can I query them?
Do I need to create the relevant models first? Or django creates it by itself?
More specifically, I installed another django app, it created several database tables in database, and now I want to get some specific data from them? What are the correct app... | Django: If I added new tables to database, how can I query them? | 1.2 | 1 | 0 | 78 |
4,042,407 | 2010-10-28T11:27:00.000 | 3 | 0 | 1 | 0 | python,django,constants | 4,042,429 | 7 | false | 1 | 0 | Consider putting it into settings.py of your application. Of course, in order to use it in template you will need to make it available to template as any other usual variable. | 1 | 23 | 0 | I want to have some constants in a Django Projects. For example, let's say a constant called MIN_TIME_TEST.
I would like to be able to access this constant in two places: from within my Python code, and from within any Templates.
What's the best way to go about doing this?
EDIT:
To clarify, I know about Template Contex... | Defining Constants in Django | 0.085505 | 0 | 0 | 31,657 |
4,042,905 | 2010-10-28T12:28:00.000 | 17 | 0 | 1 | 0 | python | 4,042,951 | 6 | false | 0 | 0 | If your script is a directory or ZIP file rather than a single python file, __main__.py will be executed when the "script" is passed as an argument to the python interpreter. | 1 | 458 | 0 | What is the __main__.py file for, what sort of code should I put into it, and when should I have one? | What is __main__.py? | 1 | 0 | 0 | 221,918 |
4,044,994 | 2010-10-28T16:24:00.000 | 0 | 0 | 0 | 0 | python,widget,pyqt4 | 67,350,685 | 6 | false | 0 | 1 | Just initialise your main window like this self.setWindowFlags(Qt.ToolTip) | 1 | 12 | 0 | I'm a beginner in PyQt. I was trying to create a simple app to try some of the toolkit's many features. My question is, how can I hide the app icon from the taskbar?
I don't want the user to be able to see the icon in taskbar and to minimize it using this icon. Is there any window flags that I can use to achieve this? | Hide PyQt app from taskbar | 0 | 0 | 0 | 7,171 |
4,045,189 | 2010-10-28T16:48:00.000 | 2 | 0 | 0 | 0 | user-interface,python-3.x,widget,ncurses | 4,993,662 | 1 | true | 0 | 1 | Cython supports Python 3, and I was able to make Cython accept the pyx file by changing all __new__ to __cinit__.
Note that the examples still needs some porting to Python 3 at that point. I get "TypeError: expected bytes, str found" when trying to run the examples. Switching all the strings to bytes worked.
Possibly ... | 1 | 2 | 0 | I'm looking for a terminal UI library providing widgets like buttons, checkboxes and so on, that is compatible with python3.
I've tried:
pycdk (pyrex does not work with python3, and porting it is a mess)
urwid (does not work with python3, it has a port but not working well with new curses interface).
Does anyone know... | Is there a terminal widget library compatible with Python 3? | 1.2 | 0 | 0 | 537 |
4,046,021 | 2010-10-28T18:27:00.000 | 2 | 0 | 1 | 0 | python,windows,windows-7,python-3.x,python-idle | 8,859,539 | 3 | false | 0 | 1 | This IDLE bug (3 series only) was fixed 30Jan11. The fix is in 3.1.4 and 3.2. | 2 | 0 | 0 | I am running Python 3.1.2 with IDLE 3.1.2 on Windows 7. When I try to use the Stack Viewer, blue text and a new window briefly appear before all open IDLE windows exit (I don't have time to read the text or new window). This is the first time I have used Stack Viewer.
Is this normal behavior? How can I get the Stack Vi... | (Python, IDLE, Windows) Pressing Stack Viewer exits all IDLE windows | 0.132549 | 0 | 0 | 1,247 |
4,046,021 | 2010-10-28T18:27:00.000 | 0 | 0 | 1 | 0 | python,windows,windows-7,python-3.x,python-idle | 4,047,313 | 3 | false | 0 | 1 | I don't have Windows so I can't help you with hands-on experience, but I would do the following:
see what is the exact command that runs when you click on the menu item for Idle (I think you can right-click and see its properties, or at least you could on earlier versions of Windows)
open a command prompt, and run the... | 2 | 0 | 0 | I am running Python 3.1.2 with IDLE 3.1.2 on Windows 7. When I try to use the Stack Viewer, blue text and a new window briefly appear before all open IDLE windows exit (I don't have time to read the text or new window). This is the first time I have used Stack Viewer.
Is this normal behavior? How can I get the Stack Vi... | (Python, IDLE, Windows) Pressing Stack Viewer exits all IDLE windows | 0 | 0 | 0 | 1,247 |
4,046,242 | 2010-10-28T18:54:00.000 | 1 | 0 | 0 | 0 | java,javascript,python,image | 4,046,258 | 4 | false | 1 | 0 | Data urls will definitely reduce the number of requests to the server, since the browser doesn't have to ask for the pixels in a separate request. But they are not supported in all browsers. You'll have to make the tradeoff. | 1 | 3 | 0 | Right now I'm base 64 encoding them and using data uris. The idea was that this will somehow lower the number of requests the browser needs to make. Does this bucket hold any water?
What is the best way of serving images in general? DB, from FS, S3?
I am most interested in python and java based answers, but all are wel... | What is the best way to serve small static images? | 0.049958 | 0 | 1 | 547 |
4,046,351 | 2010-10-28T19:09:00.000 | 1 | 1 | 0 | 0 | python,immutability,stackless,python-stackless | 9,828,193 | 1 | true | 0 | 0 | Stackless sends a reference to the python object over the channel, so any changes the producer makes to the object will be "seen" by the consumer. No copying going on. | 1 | 2 | 0 | I have a typical producer, consumer pattern. If the producer sends an object over a channel, the producer is blocked until the consumer accepts the object. After the consumer accepts the object, the producer alters the object in some way. Does the consumer see the object get altered? Or was there an implicit copy when ... | In stackless python, is data sent over a channel immutable? | 1.2 | 0 | 0 | 135 |
4,046,853 | 2010-10-28T20:20:00.000 | 1 | 0 | 1 | 0 | python,automated-tests,static-analysis,enforcement | 4,047,303 | 3 | true | 0 | 0 | You can't enforce that all strings are Unicode; even with from __future__ import unicode_literals in a module, byte strings can be written as b'...', as they can in Python 3.
There was an option that could be used to get the same effect as unicode_literals globally: the command-line option -U. However it was abandoned ... | 1 | 5 | 0 | How can I automate a test to enforce that a body of Python 2.x code contains no string instances (only unicode instances)?
Eg.
Can I do it from within the code?
Is there a static analysis tool that has this feature?
Edit:
I wanted this for an application in Python 2.5, but it turns out this is not really possible becau... | Python 2.x: how to automate enforcing unicode instead of string? | 1.2 | 0 | 0 | 213 |
4,047,049 | 2010-10-28T20:46:00.000 | 0 | 1 | 0 | 0 | python,date,automated-tests,regression-testing | 4,121,205 | 2 | false | 1 | 0 | Answering my own question:
Our current plan is to test on virtual machines and change the date/time on the VMs. This is a more complete solution as it gets the database and worker threads all at once.
I'll post an update with some real world experience when we come to actual do it. | 1 | 0 | 0 | Hey,
I am helping to set up a regression testing suite for our python web application. Many of our tests are scheduling style tests where the current date is important. For example: create a recurring event that runs every week for a month starting on Feb 1.
In order to test this, what I really want to do is override t... | Date sensitive regression testing using python | 0 | 0 | 0 | 317 |
4,047,897 | 2010-10-28T23:16:00.000 | 9 | 1 | 0 | 0 | python,sockets,testing,gevent | 4,048,286 | 3 | false | 0 | 0 | Mocking and stubbing are great, but sometimes you need to take it up to the next level of integration. Since spawning a server, even a fakeish one, can take some time, consider a separate test suite (call them integration tests) might be in order.
"Test it like you are going to use it" is my guideline, and if you mock... | 1 | 20 | 0 | I'm writing a Python client+server that uses gevent.socket for communication. Are there any good ways of testing the socket-level operation of the code (for example, verifying that SSL connections with an invalid certificate will be rejected)? Or is it simplest to just spawn a real server?
Edit: I don't believe that "n... | Python: unit testing socket-based code? | 1 | 0 | 1 | 14,758 |
4,047,899 | 2010-10-28T23:16:00.000 | 2 | 0 | 0 | 0 | python,mysql,file-upload,apache2,fastcgi | 4,047,955 | 1 | true | 1 | 0 | If the web server/gateway layer were truncating incoming form submissions I'd expect an error from FieldStorage, since the truncation would not just interrupt the file upload but also the whole multipart/form-data structure. Even if cgi.py tolerated this, it would be very unlikely to have truncated the multipart at jus... | 1 | 3 | 0 | I'm having a problem with file uploading. I'm using FastCGI on Apache2 (unix) to run a WSGI-compliant application. File uploads, in the form of images, are begin saved in a MySQL database. However, larger images are being truncated at 65535 bytes. As far as I can tell, nothing should be limiting the size of the files a... | Does FastCGI or Apache2 limit upload sizes? | 1.2 | 1 | 0 | 1,279 |
4,048,821 | 2010-10-29T03:42:00.000 | 1 | 1 | 0 | 1 | java,python | 4,048,850 | 1 | false | 0 | 0 | I would bet dollars for donuts that under some conditions you are not restarting the JVM between tests.
The other obvious thought is that the class is not being copied to the target system as expected, or not to the correct location. Or, of course, the program is not being run from where you expect (i.e. there is anot... | 1 | 0 | 0 | I'm developing a Java program through Eclipse locally, and debugging on a remote machine. Whenever I make a change to my program, I copy the corresponding class file to the bin directory on the remote machine. I run my program (a simulator) through a python script via the OS.system command.
The problem is that my prog... | Java: updated class files not used | 0.197375 | 0 | 0 | 88 |
4,048,973 | 2010-10-29T04:26:00.000 | 8 | 0 | 0 | 0 | python,django | 4,048,987 | 8 | false | 1 | 0 | Build something. Anything. Keep it relatively simple and short, but start building it and make sure you finish building it. The project you have in mind right there might be perfect.
Reading documentation and books is extremely helpful, of course, but like any programming the only way to really learn Django is to pr... | 2 | 54 | 0 | I really want to build a web application; something simple, maybe a database of Pokémon cards for instance?
I've heard excellent things about Django. Where would be the best place to start? | What's the best way to start learning django? | 1 | 0 | 0 | 77,794 |
4,048,973 | 2010-10-29T04:26:00.000 | 7 | 0 | 0 | 0 | python,django | 4,050,115 | 8 | false | 1 | 0 | If you don't know Python, start your learning with that. People tend to get very frustrated when they try to learn a framework without knowing at least something about its programming language. | 2 | 54 | 0 | I really want to build a web application; something simple, maybe a database of Pokémon cards for instance?
I've heard excellent things about Django. Where would be the best place to start? | What's the best way to start learning django? | 1 | 0 | 0 | 77,794 |
4,049,825 | 2010-10-29T07:24:00.000 | 0 | 0 | 1 | 0 | python,datetime,timedelta | 63,546,916 | 6 | false | 0 | 0 | If you have a list of timedelta objects, you could try:
datetime.timedelta(seconds=sum(td.total_seconds() for td in list_of_deltas)) | 1 | 28 | 0 | Python: How to get the sum of timedelta?
Eg. I just got a lot of timedelta object, and now I want the sum. That's it! | How to get the sum of timedelta in Python? | 0 | 0 | 0 | 33,149 |
4,050,257 | 2010-10-29T08:36:00.000 | 1 | 0 | 0 | 0 | python,mysql | 4,051,531 | 1 | true | 0 | 0 | You need to put max_allowed_packet into the [client] section of my.cnf on the machine where the client runs. If you want to, you can specify a different file or group in mysqldb.connect. | 1 | 3 | 0 | It seems as if MySQLdb is restricting the maximum transfer size for SQL statements. I have set the max_allowed_packet to 128M for mysqld. MySQL documentation says that this needs to be done for the client as well. | How do I set max_allowed_packet or equivalent for MySQLdb in python? | 1.2 | 1 | 0 | 1,923 |
4,051,010 | 2010-10-29T10:32:00.000 | 1 | 0 | 0 | 0 | python,django | 4,051,518 | 2 | false | 1 | 0 | use signals and dispatchers
in your app create files..
-litseners.py
-signals.py
and then implement signals for your models and forms (views not so much)
use the django plugins pattern
ducktyping for your classes | 1 | 0 | 0 | What are your best practises for making your django application easily extendable for other developers?
What are your approaches for enabling other to overwrite your
views
forms
templates
models
classes
In a way that enables a healthy environment for extensions to work well together? | Django Apps extendability - How to make your django apps easily extendable? | 0.099668 | 0 | 0 | 238 |
4,052,691 | 2010-10-29T14:19:00.000 | 1 | 1 | 0 | 1 | java,c++,python,jython,performance | 4,053,156 | 4 | false | 0 | 0 | These are difficult to do well.
In many cases the operating system will cache files so the second time they are executed they suddenly perform much better.
The other problem is you're comparing interpreted languages against compiled. The interpreted languages require an interpreter loaded into memory somewhere or they ... | 3 | 0 | 0 | I want to perform a comparison of multiple implementations of basically the same algorithm, written in Java, C++ and Python, the latter executed using Pypy, Jython and CPython on a Mac OS X 10.6.4 Macbook Pro with normal (non-SSD) HDD.
It's a "decode a stream of data from a file" type of algorithm, where the relevant m... | Performing unbiased program/script performance comparison | 0.049958 | 0 | 0 | 183 |
4,052,691 | 2010-10-29T14:19:00.000 | 0 | 1 | 0 | 1 | java,c++,python,jython,performance | 4,053,208 | 4 | true | 0 | 0 | I would recommend that you simply run each program many times (like 20 or so) and take the lowest measurement of each set. This will make it so it is highly likely that the program will use the HD cache and other things like that. If they all do that, then it isn't biased. | 3 | 0 | 0 | I want to perform a comparison of multiple implementations of basically the same algorithm, written in Java, C++ and Python, the latter executed using Pypy, Jython and CPython on a Mac OS X 10.6.4 Macbook Pro with normal (non-SSD) HDD.
It's a "decode a stream of data from a file" type of algorithm, where the relevant m... | Performing unbiased program/script performance comparison | 1.2 | 0 | 0 | 183 |
4,052,691 | 2010-10-29T14:19:00.000 | 0 | 1 | 0 | 1 | java,c++,python,jython,performance | 4,053,230 | 4 | false | 0 | 0 | To get totally unbiased is impossible, you can do various stuff like running minimum processes etc but IMO best way is to run scripts in random order over a long period of time over different days and get average which will be as near to unbias as possible.
Because ultimately code will run in such environment in random... | 3 | 0 | 0 | I want to perform a comparison of multiple implementations of basically the same algorithm, written in Java, C++ and Python, the latter executed using Pypy, Jython and CPython on a Mac OS X 10.6.4 Macbook Pro with normal (non-SSD) HDD.
It's a "decode a stream of data from a file" type of algorithm, where the relevant m... | Performing unbiased program/script performance comparison | 0 | 0 | 0 | 183 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.