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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5,355,239 | 2011-03-18T16:50:00.000 | 4 | 0 | 1 | 0 | python,methods,code-organization | 5,355,414 | 4 | false | 0 | 0 | I like to organize them like this:
First: Constructor (__init__)
Second: Any other __ methods
Third: Regular methods that roughly can be categorized under "get"
Fourth: Regular methods that roughly can be categorized under "set"
Fifth: Everything else (with any methods that produce anything other than a return value--i... | 4 | 5 | 0 | How should (or is a clean way) of organising methods in Python?
I always put the __init__ method first, followed by any other __foo__ (What do you call them?) methods. But then it leads into a jumble. | How should I arrange methods in a class in Python? | 0.197375 | 0 | 0 | 1,744 |
5,355,574 | 2011-03-18T17:18:00.000 | 2 | 0 | 1 | 0 | python,hash | 5,355,687 | 2 | false | 0 | 0 | Also worth considering is SHA1 which is far more secure, but it really depend on why they may have been modified. CRC is good against random errors such as corruption in transit. MD5 and SHA1 are o do with intentional changes. SHA1 is better, but MD5 may be quicker. | 1 | 1 | 0 | I'd like to verify that a bunch of files (ten files or so) are unchanged.
I thought it create a CRC/MD5 hash lists for these files and compare them with realtime hashes.
What's more recommended? CRC or MD5?
What is the right way to do it with Python?
Thanks. | Verify that files aren't modified | 0.197375 | 0 | 0 | 163 |
5,356,773 | 2011-03-18T19:15:00.000 | 4 | 0 | 1 | 0 | python,string,pyobject | 5,356,832 | 7 | false | 0 | 0 | Try PyObject_Repr (to mimic Python's repr) or PyObject_Str (to mimic Python's str).
Docs:
Compute a string representation of
object o. Returns the string
representation on success, NULL on
failure. This is the equivalent of the
Python expression repr(o). Called by
the repr() built-in function. | 2 | 49 | 0 | I've got a C python extension, and I would like to print out some diagnostics.
I'm receiving a string as a PyObject*.
What's the canonical way to obtain a string representation of this object, such that it usable as a const char *?
update: clarified to emphasize access as const char *. | Python: get string representation of PyObject? | 0.113791 | 0 | 0 | 33,074 |
5,356,773 | 2011-03-18T19:15:00.000 | 1 | 0 | 1 | 0 | python,string,pyobject | 61,116,407 | 7 | false | 0 | 0 | PyObject *module_name;
PyUnicode_AsUTF8(module_name) | 2 | 49 | 0 | I've got a C python extension, and I would like to print out some diagnostics.
I'm receiving a string as a PyObject*.
What's the canonical way to obtain a string representation of this object, such that it usable as a const char *?
update: clarified to emphasize access as const char *. | Python: get string representation of PyObject? | 0.028564 | 0 | 0 | 33,074 |
5,357,103 | 2011-03-18T19:49:00.000 | 3 | 1 | 0 | 0 | python,network-programming | 5,357,120 | 5 | false | 0 | 0 | If you want to develop wed apps, than you should rather focus on web frameworks like Django or Pylons. | 5 | 1 | 0 | I was looking at a book on python network programming and i wanted to know what would be the benefits to learning python network programming comprehensively? This would be in the context of being able to develop some really cool, ground breaking web apps. I am a python newbe so all opinions woul be appreciated.
Kind Re... | benefits of learning python network programming? | 0.119427 | 0 | 1 | 2,411 |
5,357,103 | 2011-03-18T19:49:00.000 | 0 | 1 | 0 | 0 | python,network-programming | 31,816,130 | 5 | false | 0 | 0 | The network is and always will be the sexiest arena for a hacker. An attacker can do almost anything with simple network access, such as scan for hosts, inject packets, sniff data, remotely exploit hosts, and much more. But if you are an attacker who has worked your way into the deepest depths of an enterprise target, ... | 5 | 1 | 0 | I was looking at a book on python network programming and i wanted to know what would be the benefits to learning python network programming comprehensively? This would be in the context of being able to develop some really cool, ground breaking web apps. I am a python newbe so all opinions woul be appreciated.
Kind Re... | benefits of learning python network programming? | 0 | 0 | 1 | 2,411 |
5,357,103 | 2011-03-18T19:49:00.000 | 2 | 1 | 0 | 0 | python,network-programming | 5,357,140 | 5 | true | 0 | 0 | "Network programming" isn't about "cool web apps". It's more about creating servers, and creating clients that talk to servers. It's about sockets, tcp/ip communication, XMLRPC, http protocols and all the technologies that let two computers talk to each other.
If all you're interested in is web apps, learning network p... | 5 | 1 | 0 | I was looking at a book on python network programming and i wanted to know what would be the benefits to learning python network programming comprehensively? This would be in the context of being able to develop some really cool, ground breaking web apps. I am a python newbe so all opinions woul be appreciated.
Kind Re... | benefits of learning python network programming? | 1.2 | 0 | 1 | 2,411 |
5,357,103 | 2011-03-18T19:49:00.000 | 1 | 1 | 0 | 0 | python,network-programming | 5,359,594 | 5 | false | 0 | 0 | "python network programming" isn't any special kind of network programming. It sounds like if you had a better grasp on network programming you would be able to see where python would fit in to your overall design. And instead of reading a generic book about it, you would dig through the python API's and go from there.... | 5 | 1 | 0 | I was looking at a book on python network programming and i wanted to know what would be the benefits to learning python network programming comprehensively? This would be in the context of being able to develop some really cool, ground breaking web apps. I am a python newbe so all opinions woul be appreciated.
Kind Re... | benefits of learning python network programming? | 0.039979 | 0 | 1 | 2,411 |
5,357,103 | 2011-03-18T19:49:00.000 | 0 | 1 | 0 | 0 | python,network-programming | 62,314,047 | 5 | false | 0 | 0 | Python's stronger web tool is definitely Django.
Said that the biggest benefit of learning it is to achieve a pretty robust backend on your web project. | 5 | 1 | 0 | I was looking at a book on python network programming and i wanted to know what would be the benefits to learning python network programming comprehensively? This would be in the context of being able to develop some really cool, ground breaking web apps. I am a python newbe so all opinions woul be appreciated.
Kind Re... | benefits of learning python network programming? | 0 | 0 | 1 | 2,411 |
5,357,171 | 2011-03-18T19:55:00.000 | 6 | 0 | 0 | 0 | python,arrays,matlab,matrix | 5,357,196 | 11 | false | 0 | 0 | Generating Every possible matrix of 1's and 0's for 14*10 would generate 2**140 matrixes. I don't believe you would have enough lifetime for this. I don't know, if the sun would still shine before you finish that. This is why it is impossible to generate all those matrices. You must look for some other solution, this l... | 3 | 1 | 1 | I'm working on a problem and one solution would require an input of every 14x10 matrix that is possible to be made up of 1's and 0's... how can I generate these so that I can input every possible 14x10 matrix into another function? Thank you!
Added March 21: It looks like I didn't word my post appropriately. Sorry. Wh... | how to generate all possible combinations of a 14x10 matrix containing only 1's and 0's | 1 | 0 | 0 | 3,156 |
5,357,171 | 2011-03-18T19:55:00.000 | 0 | 0 | 0 | 0 | python,arrays,matlab,matrix | 5,357,340 | 11 | false | 0 | 0 | Instead of just suggesting the this is unfeasible, I would suggest considering a scheme that samples the important subset of all possible combinations instead of applying a brute force approach. As one of your replies suggested, you are doing minimization. There are numerical techniques to do this such as simulated ann... | 3 | 1 | 1 | I'm working on a problem and one solution would require an input of every 14x10 matrix that is possible to be made up of 1's and 0's... how can I generate these so that I can input every possible 14x10 matrix into another function? Thank you!
Added March 21: It looks like I didn't word my post appropriately. Sorry. Wh... | how to generate all possible combinations of a 14x10 matrix containing only 1's and 0's | 0 | 0 | 0 | 3,156 |
5,357,171 | 2011-03-18T19:55:00.000 | 0 | 0 | 0 | 0 | python,arrays,matlab,matrix | 5,357,209 | 11 | false | 0 | 0 | Are you saying that you have a table with 140 cells and each value can be 1 or 0 and you'd like to generate every possible output? If so, you would have 2^140 possible combinations...which is quite a large number. | 3 | 1 | 1 | I'm working on a problem and one solution would require an input of every 14x10 matrix that is possible to be made up of 1's and 0's... how can I generate these so that I can input every possible 14x10 matrix into another function? Thank you!
Added March 21: It looks like I didn't word my post appropriately. Sorry. Wh... | how to generate all possible combinations of a 14x10 matrix containing only 1's and 0's | 0 | 0 | 0 | 3,156 |
5,359,454 | 2011-03-19T01:44:00.000 | 2 | 0 | 1 | 0 | python,unicode,editor,text-editor,ansi | 5,359,684 | 1 | true | 0 | 0 | I'd recommend the Unicode version, you can always write your code in plain ANSI, but the features of Unicode are there if you need them. | 1 | 1 | 0 | I want to start programming in python and I read on the internet that PyPE is a good editor. When I went to the website There is the option to download an ansi or unicode version.
Witch one should I use? | PyPE ansi or unicode? | 1.2 | 0 | 0 | 219 |
5,360,050 | 2011-03-19T04:22:00.000 | 2 | 0 | 0 | 1 | python,linux,asynchronous,multiprocessing,gevent | 6,671,124 | 2 | false | 0 | 0 | I'd consider custom socket IPC or using ZeroMQ. | 1 | 2 | 0 | Scenario
I have a server process implemented in Python and gevent, which is connecting to a backend service over TCP/IP and serving many Web clients (~1000 per process) with fast changing dynamic content based on the changes delivered by the backend service. The service is running on Ubuntu 10.04 and won't run on Windo... | What is the best way to implement a pool of worker processes compatible with gevent? | 0.197375 | 0 | 0 | 1,761 |
5,360,603 | 2011-03-19T06:38:00.000 | 2 | 0 | 0 | 0 | http,memory-management,timeout,python-idle | 5,398,935 | 2 | false | 0 | 0 | How about allowing idle HTTP connections to remain open unless another communication request comes in? If a connection is open and no one else is trying to communicate, the open connection won't hurt anything. If someone else does try to communicate, send a FIN+ACK to the first connection and open the second. Many h... | 2 | 1 | 0 | In an embedded device, What is a practical amount time to allow idle HTTP connections to stay open?
I know back in the olden days of the net circa 1999 internet chat rooms would sometimes just hold the connection open and send replies as they came in. Idle timeouts and session length of HTTP connections needed to be lo... | In-practice ideal timeout length for idle HTTP connections | 0.197375 | 0 | 1 | 3,087 |
5,360,603 | 2011-03-19T06:38:00.000 | 2 | 0 | 0 | 0 | http,memory-management,timeout,python-idle | 5,381,626 | 2 | true | 0 | 0 | In the old days (about 2000), an idle timeout was up to 5 minutes standard. These days it tends to be 5 seconds to 50 seconds. Apache's default is 5 seconds. With some special apps defaulting to 120 seconds.
So my assumption is, that with AJAX, long held-open HTTP connections are no longer needed. | 2 | 1 | 0 | In an embedded device, What is a practical amount time to allow idle HTTP connections to stay open?
I know back in the olden days of the net circa 1999 internet chat rooms would sometimes just hold the connection open and send replies as they came in. Idle timeouts and session length of HTTP connections needed to be lo... | In-practice ideal timeout length for idle HTTP connections | 1.2 | 0 | 1 | 3,087 |
5,362,425 | 2011-03-19T13:40:00.000 | 2 | 0 | 1 | 0 | python | 5,362,636 | 3 | false | 0 | 0 | There's no reason ever to use it really. It's archaic usage from back before exceptions had to be class instances, and it's gone in Python 3. | 1 | 4 | 0 | If you have an exception instance, why would you need to specify its class?
What's the advantage over simply raise instance? | When is "raise Class, instance" useful? | 0.132549 | 0 | 0 | 779 |
5,363,633 | 2011-03-19T17:31:00.000 | 1 | 0 | 1 | 0 | python,virtualenv,pip | 5,363,777 | 2 | false | 0 | 0 | No, virtualenv's are not activated based on your current working directory. To activate a virtualenv, run the source ../bin/activate command from the folder of the specific virtualenv you wish to activate. | 1 | 2 | 0 | Does python's pip with virutalenv automatically detect the virtualenv based on the folder you are on (similar to how ruby and rvm does)?
i.e. I may have many virtual environments, and as I just through projects it will automatically change the environment? | Virtualenv and pip on a mac, does it pickup the environment automatically? | 0.099668 | 0 | 0 | 338 |
5,363,912 | 2011-03-19T18:18:00.000 | -3 | 1 | 0 | 0 | php,python | 5,365,686 | 8 | false | 0 | 0 | I think that since go-lang has gone into a release, weekly, tip release cycle, it's starting to show serious stability and it might be worth adding to this conversation. web.go, it's db connections, it's built-in http server, goinstall, ubuntu has packages already. It's website runs on it's include godoc server. | 5 | 4 | 0 | What is the role of python for writing dynamic web pages? Does it play an equivalent role to php?
If so, can it do all the same things as php (MySql, file manipulation, sending emails, ...) | What is the role of python on the internet? | -0.07486 | 0 | 0 | 963 |
5,363,912 | 2011-03-19T18:18:00.000 | 5 | 1 | 0 | 0 | php,python | 5,364,337 | 8 | true | 0 | 0 | Everything that is possible in PHP is possible in Python. I'm not sure the opposite is true. And if it is, it would require jumping hoops you don't want to jump through.
Most of the things that are laughingly easy to do in PHP for the web are not so straigtforward to do in Python (by just using the standard library).
A... | 5 | 4 | 0 | What is the role of python for writing dynamic web pages? Does it play an equivalent role to php?
If so, can it do all the same things as php (MySql, file manipulation, sending emails, ...) | What is the role of python on the internet? | 1.2 | 0 | 0 | 963 |
5,363,912 | 2011-03-19T18:18:00.000 | -2 | 1 | 0 | 0 | php,python | 31,680,575 | 8 | false | 0 | 0 | Looks like you don't know the most basic web development uses in Python. Some web frameworks that use Python are:
Django
Flask
Pyramid
Some of the most popular websites also use these frameworks such as Pinterest (which uses Django). EVE was made in stackless python, a form a python used on the web. In conclusion, Py... | 5 | 4 | 0 | What is the role of python for writing dynamic web pages? Does it play an equivalent role to php?
If so, can it do all the same things as php (MySql, file manipulation, sending emails, ...) | What is the role of python on the internet? | -0.049958 | 0 | 0 | 963 |
5,363,912 | 2011-03-19T18:18:00.000 | -1 | 1 | 0 | 0 | php,python | 5,366,919 | 8 | false | 0 | 0 | Python's main (only?) limitation compared to PHP is its syntax. Although in most situations it doesn't matter whether you're delimiting statements and blocks with semi-colons and braces (PHP) or line breaks and indentation (Python), this does become a bit of an issue when doing templating. Templating typically requir... | 5 | 4 | 0 | What is the role of python for writing dynamic web pages? Does it play an equivalent role to php?
If so, can it do all the same things as php (MySql, file manipulation, sending emails, ...) | What is the role of python on the internet? | -0.024995 | 0 | 0 | 963 |
5,363,912 | 2011-03-19T18:18:00.000 | -2 | 1 | 0 | 0 | php,python | 5,364,008 | 8 | false | 0 | 0 | Python is a multi purpose language and not limited to the web like PHP.
Numerous web frameworks like Zope, Django or Pylons are build with Python. Apart from that: Php and php-based apps have very bad security record e.g. compared to Zope-based apps. | 5 | 4 | 0 | What is the role of python for writing dynamic web pages? Does it play an equivalent role to php?
If so, can it do all the same things as php (MySql, file manipulation, sending emails, ...) | What is the role of python on the internet? | -0.049958 | 0 | 0 | 963 |
5,364,050 | 2011-03-19T18:39:00.000 | 1 | 0 | 1 | 0 | python,ipython | 58,834,043 | 14 | false | 0 | 0 | Note that the above mentioned autoreload only works in IntelliJ if you manually save the changed file (e.g. using ctrl+s or cmd+s). It doesn't seem to work with auto-saving. | 2 | 475 | 1 | Currently I am working on a python project that contains sub modules and uses numpy/scipy. Ipython is used as interactive console. Unfortunately I am not very happy with workflow that I am using right now, I would appreciate some advice.
In IPython, the framework is loaded by a simple import command. However, it is oft... | Reloading submodules in IPython | 0.014285 | 0 | 0 | 217,455 |
5,364,050 | 2011-03-19T18:39:00.000 | 0 | 0 | 1 | 0 | python,ipython | 57,911,718 | 14 | false | 0 | 0 | Any subobjects will not be reloaded by this, I believe you have to use IPython's deepreload for that. | 2 | 475 | 1 | Currently I am working on a python project that contains sub modules and uses numpy/scipy. Ipython is used as interactive console. Unfortunately I am not very happy with workflow that I am using right now, I would appreciate some advice.
In IPython, the framework is loaded by a simple import command. However, it is oft... | Reloading submodules in IPython | 0 | 0 | 0 | 217,455 |
5,365,665 | 2011-03-19T23:32:00.000 | -1 | 0 | 1 | 0 | python-3.x | 5,367,325 | 5 | false | 0 | 0 | You will need to know what the formula does, and understand both the C implementation and how to implement it in Python. But unless you are doing integer maths it should be quite similar, and if you are doing integer maths, the question is why. :)
Integer maths are either done because of some specific purpose, often r... | 1 | 23 | 0 | I need to port quite a few formulas from C to Python and vice versa. What is the best way to make sure that nothing breaks in the process?
I am primarily worried about automatic int/int = float conversions. | Python 3 integer division. How to make math operators consistent with C | -0.039979 | 0 | 0 | 22,277 |
5,365,765 | 2011-03-19T23:49:00.000 | 1 | 0 | 1 | 0 | python,ipython,pdb | 5,365,808 | 2 | false | 0 | 0 | Depending on your ipython config it automatically goes into PDB if an exception is raised. | 2 | 0 | 0 | I have a python function that I'm calling from inside an iPython session.
In a very specific situation, in which a conditional in a certain line comes out as True, the script consistently drops into a pdb debug mode.
There is no trace or any other indication of a problem with the code, and as soon as I type c to contin... | Python script drops into pdb without reason | 0.099668 | 0 | 0 | 88 |
5,365,765 | 2011-03-19T23:49:00.000 | 0 | 0 | 1 | 0 | python,ipython,pdb | 5,367,678 | 2 | false | 0 | 0 | Seems like there was a import pdb; pdb.set_trace() line in the code after all, which I missed due to source control issues. | 2 | 0 | 0 | I have a python function that I'm calling from inside an iPython session.
In a very specific situation, in which a conditional in a certain line comes out as True, the script consistently drops into a pdb debug mode.
There is no trace or any other indication of a problem with the code, and as soon as I type c to contin... | Python script drops into pdb without reason | 0 | 0 | 0 | 88 |
5,365,981 | 2011-03-20T00:44:00.000 | 1 | 0 | 1 | 0 | python | 5,366,027 | 3 | false | 0 | 0 | A couple of possibilities:
1) dict.get(key, None) returns None if there is no entry for key.
2) dict = defaultdict( lambda: None ) creates a dict that automatically returns None if there is no entry for a given key. | 2 | 0 | 0 | What first pops into my head is a dictionary with keys acting as list values and dictionary values defaulting to None, but this feels sub-optimal to me. Can anyone propose a single-structure (i.e. no separate 'options' dict) alternative where dict[key] on an item with no flags set returns None and otherwise returns a l... | Pythonic representation of a list of values with optional flags | 0.066568 | 0 | 0 | 104 |
5,365,981 | 2011-03-20T00:44:00.000 | 0 | 0 | 1 | 0 | python | 5,366,092 | 3 | false | 0 | 0 | As you may have gathered from my comments above, I'm not sure exactly what your real requirements are. But my guess is that they're a little different from what's implied by the suggestions of a defaultdict. It sounds to me as if you want a list of items (ordered, perhaps with repetitions allowed), each associated with... | 2 | 0 | 0 | What first pops into my head is a dictionary with keys acting as list values and dictionary values defaulting to None, but this feels sub-optimal to me. Can anyone propose a single-structure (i.e. no separate 'options' dict) alternative where dict[key] on an item with no flags set returns None and otherwise returns a l... | Pythonic representation of a list of values with optional flags | 0 | 0 | 0 | 104 |
5,366,100 | 2011-03-20T01:12:00.000 | 0 | 0 | 1 | 0 | python,installation,pyqt4,pyinstaller | 6,085,674 | 4 | false | 0 | 1 | I think the embedded interpreter in the executable will still search for .py files in the same directory and/or PYTHONPATH, py2exe uses a zip file for native python components, iirc pyinstaller embeds all of them in the executable, maybe there is an option to keep a zip like in py2exe (or not add them in the spec), the... | 1 | 8 | 0 | I've managed to package my PyQt4 app as a "standalone" application on windows, it works.
However this application can upgrade itself, which is done by replacing the actual code written by me (.py files) with new versions, downloaded via the internet.
How can I tell PyInstaller do its job (putting together the DLLs, gen... | PyInstaller but keeping .py files upgradeable | 0 | 0 | 0 | 1,782 |
5,366,136 | 2011-03-20T01:21:00.000 | 3 | 0 | 1 | 1 | python,puppet | 5,368,736 | 3 | false | 0 | 0 | Consider using Python, with in-house rules limiting what can appear in a config file.
The advantages are that no one has to learn another language, it's really, really cheap to implement, and you don't have to worry about maintenance of the config parser. The disadvantages are that it's not a custom-designed language f... | 1 | 4 | 0 | Anyone know of any good ways to do puppet like pp files for python. Almost like config files that can inherit other configs files and also have limited logic in them like if statements and variables?
Thanks! | Puppet like syntax for python | 0.197375 | 0 | 0 | 2,468 |
5,366,298 | 2011-03-20T02:02:00.000 | 0 | 1 | 0 | 1 | python,nfs | 10,356,745 | 2 | false | 0 | 0 | There is a python suite to test NFS server functionality.
git://git.linux-nfs.org/projects/bfields/pynfs.git
While it's for NFSv4 you can simply adopt it for v3 as well. | 1 | 0 | 0 | Folks,
I believe there are two questions I have: one python specific and the other NFS.
The basic point is that my program gets the 'username', 'uid', NFS server IP and exported_path as input from the user. It now has to verify that the NFS exported path is readable/writable by this user/uid.
My program is running as r... | Python: Verifying NFS authentication | 0 | 0 | 0 | 798 |
5,367,695 | 2011-03-20T09:34:00.000 | 3 | 0 | 0 | 0 | python,django | 5,367,975 | 1 | true | 1 | 0 | If you are debugging - it is a good idea to have "--noreload" option for the dev-server.
AFAIK PyCharm has a checkbox "No reload" in the run options for the project. | 1 | 3 | 0 | I'm trying to debug django using PyCharm, and notice that it spawns a new process to which PyCharm is not attached. My breakpoints aren't hit in this new process.
How do I debug it then? (See autoreload.restart_with_reloader()) | How to debug django, it spawns a new process to which I'm not attached? | 1.2 | 0 | 0 | 708 |
5,369,031 | 2011-03-20T14:22:00.000 | 0 | 0 | 1 | 1 | linux,python-3.x,ubuntu-10.10 | 5,369,526 | 4 | false | 0 | 0 | Blender is not run with or through Python at all. It's a native compiled executable and runs directly. It does however embed Python and use it as a scripting language. Blender 2.5 uses Python 3, and for this to work you need Python 3 installed on your system in the path, so blender can find it.
That's all, afaik. | 2 | 4 | 0 | I use ubuntu 10.10, and I have both Python 2.x and Python 3.x. I have a program that needs to run with python 3.x (blender 2.5x).
How do I run a program with python 3.x? | How to run a program with python 3.x | 0 | 0 | 0 | 6,836 |
5,369,031 | 2011-03-20T14:22:00.000 | 0 | 0 | 1 | 1 | linux,python-3.x,ubuntu-10.10 | 5,369,057 | 4 | false | 0 | 0 | Do you have a separate python executable for python 2.x and for python 3.x? On my system I have /usr/bin/python2.5 and /usr/bin/python2.6. I also have a /usr/bin/python2, which is a symbolic link to /usr/bin/python2.6. I presume that you have a /usr/bin/python3 too. In which case, you simply run the program using /... | 2 | 4 | 0 | I use ubuntu 10.10, and I have both Python 2.x and Python 3.x. I have a program that needs to run with python 3.x (blender 2.5x).
How do I run a program with python 3.x? | How to run a program with python 3.x | 0 | 0 | 0 | 6,836 |
5,369,290 | 2011-03-20T15:08:00.000 | 1 | 0 | 0 | 0 | python,linux,qt,user-interface,x11 | 5,420,016 | 1 | false | 0 | 1 | As @utdmr suggested, that solved the problem.
I've thought that show() was also responsible for the signal/slot mechanism and other Qt and X11 functions. But apparently, the application works normally, just doesn't show the GUI.
And that was exactly what I needed since it is a fully developed application and the effor... | 1 | 2 | 0 | I need to run a Qt application in Batch mode, so basically I need to run it without GUI.
I've already tried using QCoreApplication but my application relies on the existence of X11 window. So I need the GUI to open regularly, but I need to "hide" it from the user.
I know that I have the ability to create a virtual VNC... | How to suppress a Qt GUI application? | 0.197375 | 0 | 0 | 454 |
5,370,762 | 2011-03-20T19:10:00.000 | 4 | 0 | 0 | 0 | python,selenium,firefox,webdriver | 5,371,496 | 14 | false | 0 | 0 | If you're using Selenium RC or Remote WebDriver then you can run the browser instance on a remote, or virtual machine. This means that you shouldn't have to worry about hiding the browser windows as they won't be launching on your local machine. | 3 | 51 | 0 | When I execute multiple test simultaneously, i don't want to keep Firefox browser window visible.. I can minimize it using selenium.minimizeWindow() but I don't want to do it.
Is there any way to hide Firefox window? I am using FireFox WebDriver. | How to hide Firefox window (Selenium WebDriver)? | 0.057081 | 0 | 1 | 103,080 |
5,370,762 | 2011-03-20T19:10:00.000 | 3 | 0 | 0 | 0 | python,selenium,firefox,webdriver | 13,800,788 | 14 | false | 0 | 0 | If you are using KDE Desktop, you can make Firefox Windows to be initially opened being minimized. That made my day to me regarding this problem. Just do the following:
Open Firefox
Click on the Firefox icon on the top left corner of the menu bar -> Advanced -> Special Application Settings...
Go to the "Size & Positio... | 3 | 51 | 0 | When I execute multiple test simultaneously, i don't want to keep Firefox browser window visible.. I can minimize it using selenium.minimizeWindow() but I don't want to do it.
Is there any way to hide Firefox window? I am using FireFox WebDriver. | How to hide Firefox window (Selenium WebDriver)? | 0.042831 | 0 | 1 | 103,080 |
5,370,762 | 2011-03-20T19:10:00.000 | 1 | 0 | 0 | 0 | python,selenium,firefox,webdriver | 54,567,508 | 14 | false | 0 | 0 | in options (Firefox options, chrome options )
set boolean headless to true by calling set_headless method. | 3 | 51 | 0 | When I execute multiple test simultaneously, i don't want to keep Firefox browser window visible.. I can minimize it using selenium.minimizeWindow() but I don't want to do it.
Is there any way to hide Firefox window? I am using FireFox WebDriver. | How to hide Firefox window (Selenium WebDriver)? | 0.014285 | 0 | 1 | 103,080 |
5,370,778 | 2011-03-20T19:12:00.000 | 0 | 0 | 0 | 0 | python,tcp,network-programming | 5,370,827 | 2 | false | 0 | 0 | In a thread that "serves" client use some global count that is increased when client connects and decreased when disconnects.
If you want to count from OS level then use nestat -an with proper grep filter and wc -l (on Windows uses ports of grep and wc) | 1 | 4 | 0 | I'm using Pythons SocketServer.ThreadingTCPServer. Now I want to know how many clients are connected at a certain moment.
How to solve this? | How to count connected clients in TCPServer? | 0 | 0 | 1 | 4,268 |
5,371,632 | 2011-03-20T21:27:00.000 | 1 | 1 | 1 | 0 | python,encoding,wxpython | 5,371,727 | 3 | true | 0 | 0 | If you want a really simply version, use python's base64 module. The file won't be recognizable opening in notepad anymore, but it'll be easy to decode if you know what you are doing.
If you actually want to prevent any other program from being able to encode it: don't. You can spend a lot of effort and the only thing ... | 1 | 0 | 0 | This one is a little tricky to explain. I would like to create a file, lets say, a .test file. Now, this is ridiculously easy to create and write, but I would like to encode the information so I could only interpret the information with the Test Program.
So, this Test Program would be able to create and read the .test ... | Encoding a file | 1.2 | 0 | 0 | 165 |
5,371,808 | 2011-03-20T21:59:00.000 | 0 | 0 | 0 | 0 | python,windows,internet-explorer,automation,pamie | 5,372,020 | 1 | false | 0 | 0 | It is ie.listBoxSelect, using the source code as documentation. | 1 | 0 | 0 | How do I interact with a select box using PAMIE? | how to interact with a `select` input with PAMIE? | 0 | 0 | 0 | 132 |
5,373,558 | 2011-03-21T03:30:00.000 | 0 | 1 | 0 | 1 | python,windows,windows-xp,msvcrt,cx-freeze | 5,373,639 | 1 | true | 0 | 0 | AFAIK if you have a Visual Studio licence, you have the right to bundle the appropriate msvcrXY.dll with your application. That will make it run without having to install the runtime files.
If you don't have a Visual Studio licence, I can think of two solutions:
One is to bundle the VS runtime installer with your appli... | 1 | 1 | 0 | I have been plagued with this problem ever since I started with Python, I want to write a Python script, and then export it as an EXE that I can run on any Windows XP (and up) machine.
cx_Freeze covers all of this perfectly, the only problem is that it required Visual C++ Runtime to be installed on the client computer ... | Using cx_Freeze (Python 2.7) on a Windows box OOTB | 1.2 | 0 | 0 | 746 |
5,374,818 | 2011-03-21T07:18:00.000 | 9 | 1 | 0 | 0 | python,django | 5,375,529 | 4 | false | 1 | 0 | There is no way to check that a mail has actually been received. This is not because of a failing in Django, but a consequence of the way email works.
If you need some form of definite delivery confirmation, you need to use something other than email. | 1 | 3 | 0 | I need know that if a email is sent correctly for to do several operations but the function always return True.
Any idea?
Thanks you. | How can I know if a email is sent correctly with Django/Python? | 1 | 0 | 0 | 7,759 |
5,377,123 | 2011-03-21T11:42:00.000 | 4 | 1 | 1 | 0 | python,c | 5,377,151 | 2 | false | 0 | 0 | It's always useful to learn another language. If you're familiar with C then I'd invest some time in learning C++ and this is likely to be more immediately useful and will build on your existing skillset, but if you've got the time then learning Python is a great idea! | 1 | 8 | 0 | I am being told that Python is far superior to C in the ease of programming. I am an average( dont want to praise myself) user of C. Will it be helpful if I learn Python to implement my codes in future? | Which is better C Vs Python? | 0.379949 | 0 | 0 | 23,885 |
5,377,347 | 2011-03-21T12:07:00.000 | 0 | 0 | 0 | 0 | python,stocks | 5,377,789 | 2 | false | 0 | 0 | You could think about using a method that calculates the concave hull of your data. There are probably existing python implementations you could find. This will give you the boundary that encloses your timeseries. If there are outliers in your dataset that you wish to exclude, you could apply some sort of filter or smo... | 1 | 0 | 1 | I have read the topic: How do I calculate a trendline for a graph?
What I am looking for though is how to find the line that touches the outer extreme points of a graph. The intended use is calculation of support, resistance lines for stock charts. So it is not a merely simple regression but it should also limit the n... | how to calculate trendline for stock charts | 0 | 0 | 0 | 2,927 |
5,377,980 | 2011-03-21T13:06:00.000 | 1 | 0 | 0 | 0 | python,xml,memory | 5,378,220 | 4 | false | 0 | 0 | If you're reading in XML dialect1, and have to write XML dialect2, wouldn't it be a good idea to write down the conversion process using xslt? You may not even need any source code that way. | 2 | 3 | 0 | There are many ways to read XML, both all-at-once (DOM) and one-bit-at-a-time (SAX). I have used SAX or lxml to iteratively read large XML files (e.g. wikipedia dump which is 6.5GB compressed).
However after doing some iterative processing (in python using ElementTree) of that XML file, I want to write out the (new) XM... | Iteratively write XML nodes in python | 0.049958 | 0 | 1 | 1,840 |
5,377,980 | 2011-03-21T13:06:00.000 | 1 | 0 | 0 | 0 | python,xml,memory | 5,378,261 | 4 | false | 0 | 0 | If you don't find anything else, what I'd prefer here is to inherit from ElementTree and create a "iteractiveElementTree", adding to it a "file" attribute. I'd subclasse the nodes to have a "start_tag_comitted" attribute and a "commit" method. Upon being called, this "commit" method would call the render method for a s... | 2 | 3 | 0 | There are many ways to read XML, both all-at-once (DOM) and one-bit-at-a-time (SAX). I have used SAX or lxml to iteratively read large XML files (e.g. wikipedia dump which is 6.5GB compressed).
However after doing some iterative processing (in python using ElementTree) of that XML file, I want to write out the (new) XM... | Iteratively write XML nodes in python | 0.049958 | 0 | 1 | 1,840 |
5,381,208 | 2011-03-21T17:17:00.000 | 2 | 0 | 0 | 0 | python,flask | 5,381,900 | 5 | false | 1 | 0 | I can't see how there could be any way of stopping this from working. Flask and Bottle, like Django, are just Python underneath, and Python allows you to break up files into modules. As long as you importing the relevant functions into the main script, they will just work exactly as if they were defined there. | 2 | 11 | 0 | I've been looking into microframeworks for Python, and have come across two interesting options, Flask and Bottle. each have some similar features. One thing I noticed is that all the example sites show all the application code located inside a single Python file. Obviously, for even moderately sized sites, this would ... | Flask/Bottle project organization | 0.07983 | 0 | 0 | 7,590 |
5,381,208 | 2011-03-21T17:17:00.000 | 0 | 0 | 0 | 0 | python,flask | 26,026,153 | 5 | false | 1 | 0 | It really depends what you are trying to achieve, for micro service/applications/websites bottle is very straight forward and light weight. If you plan your application to grow by the time then Flask might be good option for you coz it has lot of extensions. We have about 40 to 50 micro services written in bottle and n... | 2 | 11 | 0 | I've been looking into microframeworks for Python, and have come across two interesting options, Flask and Bottle. each have some similar features. One thing I noticed is that all the example sites show all the application code located inside a single Python file. Obviously, for even moderately sized sites, this would ... | Flask/Bottle project organization | 0 | 0 | 0 | 7,590 |
5,381,296 | 2011-03-21T17:25:00.000 | 0 | 0 | 0 | 0 | python,xml,elementtree | 5,381,347 | 4 | false | 0 | 0 | XML does not define any ordering of attributes of a node. So the behavior is fine.
If you make assumptions about the ordering of attributes then your assumptions are wrong.
There is no ordering and you must not expect any kind of attribute ordering. So your question is invalid. | 2 | 2 | 0 | When parsing an xml file into a Python ElementTree the attributes' order is mixed up because Python stores the attributes in a dictionary.
How can I change the order of the attributes in the dictionary? | How to order xml element attributes in Python? | 0 | 0 | 1 | 4,248 |
5,381,296 | 2011-03-21T17:25:00.000 | 0 | 0 | 0 | 0 | python,xml,elementtree | 5,399,912 | 4 | false | 0 | 0 | You can not change the order of attributes internally in the dictionary. This is impossible unless you do some fancy hacking.
The solution therefore, is to manually access the attributes in the order you want them, or create a list of the keys/items and sort that the way you want. | 2 | 2 | 0 | When parsing an xml file into a Python ElementTree the attributes' order is mixed up because Python stores the attributes in a dictionary.
How can I change the order of the attributes in the dictionary? | How to order xml element attributes in Python? | 0 | 0 | 1 | 4,248 |
5,382,014 | 2011-03-21T18:33:00.000 | 2 | 0 | 1 | 0 | python | 5,382,748 | 2 | false | 0 | 0 | All three of these are equivalent.
The first two are exactly equivalent, in fact. Putting brackets around something does not make it a tuple: putting a comma after it does that. So the second one evaluates to the first.
The third is also valid: using a tuple is the normal way of doing string substitution, but as a spec... | 1 | 1 | 0 | Which of these Python string interpolations is proper (not a trick question)?
'%s' % my_string
'%s' % (my_string)
'%s' % (my_string, )
If it varies by version, please summarize. | Python string interpolation and tuples | 0.197375 | 0 | 0 | 764 |
5,382,305 | 2011-03-21T19:00:00.000 | 0 | 1 | 0 | 0 | python,gstreamer | 8,164,493 | 1 | false | 0 | 0 | If you're creating a source element, you probably want to subclass gst.BaseSrc. Then, IIRC, the main thing you need to do is implement the do_create() virtual method. Don't forget to gobject.type_register() your class; you may also need to set the time format using set_format().
I second the recommendation to look at t... | 1 | 0 | 0 | i have quite a lot of experience with python and gst-python, but no experience with plain gstreamer.
does anyone know (well, someone on earth probably does but...) how to create a custom element? i got as far as
class MyElement(Element):
by intuition, but i have no idea what next...
simply what i was hoping for was a "... | How to make a custom element im gst-python | 0 | 0 | 1 | 1,272 |
5,383,145 | 2011-03-21T20:19:00.000 | 7 | 1 | 1 | 0 | python,lua | 5,383,274 | 2 | true | 0 | 0 | Both are fine languages. Neither should take you years to learn. An easy way to make the decision is to look at what modules are out there already.
For example, you mentioned that your application is related to GPS. Take a look at what libraries are already written to hook Python and Lua into your particular GPS hardwa... | 1 | 4 | 0 | I have started using Python in a real-time application (serial communication with to gps modules at once), but have found out recently about Lua. Which language would be more suited to the application?
My definition of real-time in this context is the fastest possible time to receive, process and output the data. (Feed... | Python or Lua - Realtime application | 1.2 | 0 | 0 | 2,435 |
5,384,599 | 2011-03-21T22:40:00.000 | 2 | 1 | 0 | 0 | c++,python,c,ms-word | 5,384,992 | 4 | false | 0 | 0 | There are various Word to HTML converters - commercial and open source converters. The most common converter (open source) is likely "wv". You can also using Open-Office e.g. using the PyUNO bridge (requires a running OpenOffice server). If you are on Windows there are various commercial solutions available re-using a... | 1 | 0 | 0 | I'm getting a bunch of .docs emailed to me which I'm writing a python script to extract the body and any .doc or .pdf as well as any message they may have sent and depending on the answer it may do more, and then I want to send it to my web server and have a php script format it for display.
I want to do any converting... | Need an easy way to display a word document in html | 0.099668 | 0 | 0 | 916 |
5,386,194 | 2011-03-22T02:51:00.000 | 3 | 1 | 1 | 0 | python,testing,module,import,dependencies | 5,386,248 | 2 | false | 0 | 0 | Change your Python Path.
The order of directories in sys.path shows the order of a search.
You can change sys.path in a test to alter the search order. | 1 | 4 | 0 | What's the best way to temporarily hide an installed module from a python script to test how it handles environments that don't have the module installed?
I'd like to avoid having to uninstall the module just to test. | Simulating lack of a dependency when testing a python script | 0.291313 | 0 | 0 | 88 |
5,387,895 | 2011-03-22T07:09:00.000 | 2 | 0 | 1 | 0 | python,character-encoding | 58,780,738 | 7 | false | 0 | 0 | I had exactly this issue in a recent project which really is a pain in the rear. I finally found it's because the Python we used in Docker has encoding "ansi_x3.4-1968" instead of "utf-8". So if anyone out there using Docker and got this error, following these steps may thoroughly solve your problem.
create a file and... | 2 | 78 | 0 | I am parsing an XSL file using xlrd. Most of the things are working fine. I have a dictionary where keys are strings and values are lists of strings. All the keys and values are Unicode. I can print most of the keys and values using str() method. But some values have the Unicode character \u2013 for which I get the abo... | UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 3 2: ordinal not in range(128) | 0.057081 | 0 | 0 | 137,788 |
5,387,895 | 2011-03-22T07:09:00.000 | 0 | 0 | 1 | 0 | python,character-encoding | 47,410,460 | 7 | false | 0 | 0 | for me this works
unicode(data).encode('utf-8') | 2 | 78 | 0 | I am parsing an XSL file using xlrd. Most of the things are working fine. I have a dictionary where keys are strings and values are lists of strings. All the keys and values are Unicode. I can print most of the keys and values using str() method. But some values have the Unicode character \u2013 for which I get the abo... | UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 3 2: ordinal not in range(128) | 0 | 0 | 0 | 137,788 |
5,389,111 | 2011-03-22T09:28:00.000 | 5 | 0 | 0 | 0 | python,web.py | 5,402,971 | 1 | false | 1 | 0 | I solved the question I originally raised by looking into web.py source code, and exposed the WSGIServer in web/httpserver.py to web/application.py, so that i can call WSGIServer.stop() in application.stop(), which is added by myself.
It's a quick hack and not that neat, but it removed the blocker quickly. | 1 | 3 | 0 | I'm trying to run web.application in a Windows Service and I cannot find a way to programmatically stop it after application.run().
I tried sys.exit and it didn't work well with Windows Service. | Is there a way to programmatically stop web.py? | 0.761594 | 0 | 0 | 1,314 |
5,392,551 | 2011-03-22T14:08:00.000 | -2 | 0 | 1 | 0 | python,haskell,functional-programming,numpy,scipy | 5,392,702 | 4 | false | 0 | 0 | I can't imagine trying to use numpy through haskell or scheme will be easier than just writing functional python. Try using itertools and functools if you want a more functional flavored python. | 1 | 5 | 1 | My primary language is Python. Often when I need to do some cpu heavy task on a numpy array I use scipy.weave.inline to hook up c++ with great results.
I suspect many of the algorithms (machine learning stuff) can however be written simpler in a functional language (scheme, haskell...).
I was thinking. Is it possible t... | access numpy array from a functional language | -0.099668 | 0 | 0 | 887 |
5,393,185 | 2011-03-22T14:58:00.000 | -1 | 0 | 0 | 0 | python,window,pygtk,gtk | 5,441,492 | 4 | false | 0 | 1 | You can also use gtk.Dialog.run (if it's a Dialog) aditional to gtk.Window.present | 1 | 3 | 0 | I have a gtk.Window. How do I set it to be the active window? I can call is_active() to see whether it already is, but I don't see where to make it active.
Bonus points: given a gtk.Widget, how do I make the window it is a part of the active window? | gtk: set active window | -0.049958 | 0 | 0 | 4,336 |
5,395,588 | 2011-03-22T17:44:00.000 | 2 | 1 | 0 | 0 | python,objective-c,security,api,rsa | 5,395,647 | 3 | false | 1 | 0 | The easiest solution would be IP whitelisting if you expect the API consumer to be requesting from the same IP all the time.
If you want to support the ability to 'authenticate' from anywhere, then you're on the right track; it would be a lot easier to share an encryption method and then requesting users send a reques... | 1 | 2 | 0 | I have a webapp with some functionality that I'd like to be made accessible via an API or webservice. My problem is that I want to control where my API can be accessed from, that is, I only want the apps that I create or approve to have access to my API. The API would be a web-based REST service. My users do not log... | Security measures for controlling access to web-services/API | 0.132549 | 0 | 0 | 334 |
5,395,782 | 2011-03-22T18:03:00.000 | 1 | 0 | 0 | 1 | python,performance,json,google-app-engine,google-cloud-datastore | 5,400,785 | 3 | false | 1 | 0 | For superior app performance, as Chris and others pointed out, python dict is the best.
But if you are ok with the minimal performance hit caused by datastore queries, I think that is the way to go purely from a design and maintenance perspective. Simplicity takes precedence over performance if you are not approaching... | 2 | 1 | 0 | In a python/google app engine app, I've got a choice between storing some static data (couple KB in size) in a local json/xml file or putting it into the datastore and querying it from there. The data is created by me, so there's no issues with badly formed data. In specific terms such as saving quota, less resource ... | Python/Google app engine data storage performance | 0.066568 | 0 | 0 | 496 |
5,395,782 | 2011-03-22T18:03:00.000 | 5 | 0 | 0 | 1 | python,performance,json,google-app-engine,google-cloud-datastore | 5,395,833 | 3 | true | 1 | 0 | If your data is small, static and infrequently changed, you'll get the best performance by just writing your data as a dict in it's own module and just import it where you need it. This would take advantage of the fact that Python will cache your modules on import. | 2 | 1 | 0 | In a python/google app engine app, I've got a choice between storing some static data (couple KB in size) in a local json/xml file or putting it into the datastore and querying it from there. The data is created by me, so there's no issues with badly formed data. In specific terms such as saving quota, less resource ... | Python/Google app engine data storage performance | 1.2 | 0 | 0 | 496 |
5,397,528 | 2011-03-22T20:37:00.000 | 0 | 0 | 0 | 0 | python,django,mercurial,apache2,mod-python | 5,397,870 | 1 | true | 1 | 0 | I thought about this, good idea for development.
Use mercurial in common way. And of course you need deploy mercurial server before.
If you update your django project, it will be compiled on the fly.
My workflow:
Set up mercurial server or use bitbucket
Init repo locally
Push repo to central repo
On server pull repo... | 1 | 0 | 0 | I'm creating a server with Apache2 + mod_python + Django for development and would like to know how to use Mercurial to manage application development.
My idea is to make the folder where the Mercurial stores the project be the same folder to deploy Django.
Thank you for your attention! | How to use Mercurial to deploy Django applications? | 1.2 | 1 | 0 | 627 |
5,397,809 | 2011-03-22T21:04:00.000 | 1 | 0 | 1 | 0 | python,data-structures,vector,matrix,large-data-volumes | 5,397,912 | 3 | false | 0 | 0 | Use a sparse matrix assuming most entries are 0. | 1 | 3 | 1 | I need to create about 2 million vectors w/ 1000 slots in each (each slot merely contains an integer).
What would be the best data structure for working with this amount of data? It could be that I'm over-estimating the amount of processing/memory involved.
I need to iterate over a collection of files (about 34.5GB in ... | Python - Best data structure for incredibly large matrix | 0.066568 | 0 | 0 | 1,730 |
5,399,827 | 2011-03-23T01:18:00.000 | 1 | 1 | 1 | 0 | python | 5,399,984 | 1 | false | 0 | 0 | I'm going to make a wild guess here: is your filename the same as the package that you're trying to import (my_package in your example)?
I was able to reproduce behavior similar to what you describe by creating a file, django.py, that contained the import statement from django.db import models. When I ran python djang... | 1 | 0 | 0 | My python file has "from .. import" statement to package under C:\Python27\Lib\site-packages.
If my file name does not have any extension (e.g. foo ) then "python foo" works.
If I rename file from foo to foo.py then the "from .. import" statement to that package fails in foo.py:
try:
from my_package.System.prefi... | python file without extension works, but with .py extension fails to import my module | 0.197375 | 0 | 0 | 578 |
5,399,853 | 2011-03-23T01:22:00.000 | 1 | 0 | 0 | 0 | python,django,plugins,web,directory | 5,423,598 | 1 | false | 1 | 0 | You will not find something like that, because using django means you can do that with just a few lines of code by yourself. Django is not a CMS, but a framework, which means you are one level deeper. A lot of the things where you would use a plugin in a CMS are common tasks for django programmers, so there really is n... | 1 | 0 | 0 | Is there any Django plugin or reusable app available that we can use to add online directory feature to our Django based website? | Django directory plugin | 0.197375 | 0 | 0 | 930 |
5,401,070 | 2011-03-23T05:03:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine,google-cloud-datastore | 5,413,209 | 2 | false | 1 | 0 | You could work around this by splitting the blob into multiple pieces and storing them in separate entities. What you should do, though, is use the Blobstore as @Thilo suggests. | 1 | 2 | 0 | As if for now, we are using datastore blob to store profile images of our site. And there is restriction in Datastore for storing more than 1mb file as a blob in datastore. Is there any work around for this. | Overcoming 1mb file restriction in GAE Datastore | 0 | 0 | 0 | 349 |
5,402,463 | 2011-03-23T08:16:00.000 | 0 | 0 | 0 | 0 | python,ms-access | 5,402,549 | 3 | false | 0 | 0 | Create an ODBC DSN wit hthis MDB. Python can access ODBC data sources. | 1 | 2 | 0 | I have my database in msacess 2000 .mdb format which I downloaded from the net and now I want to access that database from my program which is a python script.
Can I call tables from my programs??
it would be very grateful if anyone of you please suggest me what to do | How do I access a .mdb file from python? | 0 | 1 | 0 | 5,861 |
5,402,847 | 2011-03-23T09:02:00.000 | 0 | 0 | 0 | 0 | python,django | 5,403,151 | 2 | true | 1 | 0 | Django doesn't really offer you place where things that are commonly used all over the project can live. I think the most common approach to solve this is to create a 'project'-app, which holds such project-relevant things like models, templatetags or widgets for example... | 2 | 0 | 0 | I'm trying to start with Django.
I'm developing an App. This App is called "Directory" and will store
info about websites.
I must to create a database table called "Genders", but this is a
generic database table and could be used in other App.
My question... how to deal with this kind of situation in Django? And
in wic... | Where to put generic Database Tables on Django? | 1.2 | 0 | 0 | 208 |
5,402,847 | 2011-03-23T09:02:00.000 | 1 | 0 | 0 | 0 | python,django | 5,403,490 | 2 | false | 1 | 0 | In django, you don't (generally) create database tables. You create models, and let the django ORM create tables for you.
To prevent having two tables in your database called gender, django will prefix the model name with the name of the app. Thus, if your app was called foo, your model class was Gender, you would have... | 2 | 0 | 0 | I'm trying to start with Django.
I'm developing an App. This App is called "Directory" and will store
info about websites.
I must to create a database table called "Genders", but this is a
generic database table and could be used in other App.
My question... how to deal with this kind of situation in Django? And
in wic... | Where to put generic Database Tables on Django? | 0.099668 | 0 | 0 | 208 |
5,403,781 | 2011-03-23T10:24:00.000 | 6 | 0 | 0 | 0 | python,xlrd | 5,404,018 | 2 | false | 0 | 0 | The open_workbook calls the release_resources ( which closes the mmaped file ) before returning. | 1 | 23 | 0 | I am using the function open_workbook() to open an excel file. But I cannot find any function to close the file later in the xlrd module. Is there a way to close the xls file using xlrd?
Or is not required at all? | Is there a way to close a workbook using xlrd | 1 | 1 | 0 | 22,147 |
5,407,286 | 2011-03-23T15:04:00.000 | 0 | 0 | 1 | 0 | java,c++,python,ruby,numbers | 5,407,633 | 7 | false | 0 | 0 | The fundamental numeric type in Matlab is a matrix of complex floats. Specifically, if you type x = 1, what you really assign to x is a a 1x1 matrix with its [0,0] element equal 1+0i. | 1 | 11 | 0 | Does anyone know of an irrational number representation type/object/class/whatever in any programming language?
All suggestions welcome.
Simply put, if I have two irrational objects, both representing the square root of five, and I multiply those objects, I want to get back the integer five, not float 4 point lots o' 9... | Irrational number representation in any programming language? | 0 | 0 | 0 | 5,173 |
5,407,664 | 2011-03-23T15:30:00.000 | 0 | 0 | 1 | 0 | python,netbeans,ide,tabstop | 5,512,865 | 1 | true | 0 | 0 | ...Netbeans want to switch from spaces
to tabs, not the other way around...
ergh – Rafe Kettler Mar 23 at 15:36
I use netbeans meanwhile and like it.
Yes I converted all spaces to tabs and retab it to 4 in php and python
regards | 1 | 0 | 0 | For a python project I am trying an IDE, coming from vim but I have troube how my code is shown resp. indentation. Many lines should be indented because they are inside if-then-else statements.
In SPE and netbeans there are many lines where the indention-space (four) are collapsed.
But I checked the files with tabnan... | Tab/spaces indention issues in IDE's vs vim | 1.2 | 0 | 0 | 310 |
5,410,244 | 2011-03-23T19:01:00.000 | 0 | 0 | 0 | 0 | python,r,vba,user-interface | 5,412,251 | 3 | false | 0 | 0 | Look at scan() for keyboard input in R. And you didn't ask about mouse input, but consider locator() for that.
Put it a loop if you want the output immediately. | 1 | 4 | 0 | I know that this is a vague question, but I was hoping to get some help. I know VBA pretty well, and have been able to accomplish some simple tasks in python as well as the statistical programming language in R.
What I am looking to do is create a simple application that lets me capture data, some of which is captured... | Simple UI to capture data | 0 | 0 | 0 | 1,032 |
5,411,291 | 2011-03-23T20:34:00.000 | 7 | 0 | 0 | 1 | python,google-app-engine,asynchronous,urlfetch | 5,412,695 | 2 | true | 1 | 0 | A task queue task is your best option here. The message you're seeing in the log indicates that the request is waiting for your URLFetch to complete before returning, so this doesn't help. You say a task is 'overkill', but really, they're very lightweight, and definitely the best way to do this. Deferred will even allo... | 1 | 6 | 0 | In some code I'm writing for GAE I need to periodically perform a GET on a URL on another system, in essence 'pinging' it and I'm not terribly concerned if the request fails, times out or succeeds.
As I basically want to 'fire and forget' and not slow down my own code by waiting for the request, I'm using an asynchrono... | Asynchronous URLfetch when we don't care about the result? [Python] | 1.2 | 0 | 0 | 3,248 |
5,415,342 | 2011-03-24T05:58:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine | 5,415,555 | 2 | false | 1 | 0 | The standard solution to this problem is denormalization. Try storing a copy of price and profit in Entity1 and then you can answer your question with a single, simple query on Entity1. | 1 | 1 | 0 | Scenario
Entity1 (id,itmname)
Entity2 (id,itmname,price)
Entity3 (id,itmname,profit)
profit and price are both IntegerProperty
I want to count all the item with price more then 500 and profit more then 10.
I know its join operation and is not supported by google. I tried my best to find out the way other then executi... | Optimizing join query performance in google app engine | 0 | 1 | 0 | 372 |
5,415,600 | 2011-03-24T06:37:00.000 | 7 | 0 | 0 | 0 | python,django | 29,631,137 | 3 | false | 1 | 0 | Most the time, loading the page in a new tab can be a real pain in the ar** for the user. Nevertheless it can still be necessary sometimes. If you really need to render your POST results in a new tab, use the target="_blank" as an attribute of your <form>. | 1 | 13 | 0 | i have to open the result page using render_to_response on a new tab | how to open url in new tab from django? | 1 | 0 | 0 | 28,137 |
5,415,720 | 2011-03-24T06:51:00.000 | 2 | 0 | 1 | 0 | python | 5,415,834 | 2 | false | 0 | 0 | Bad idea. Use another thread which is sole responsible for writing/reading into the file. Or read the file into memory if it is not too big. | 1 | 1 | 0 | I'm multithreading data (both reading and writing) into/from a single text file.
I need to be able to replace or remove text from this file without replacing the actual file.
I cannot simply .read() into a string, then .write() a new file with the same name, because other threads are still using that file. I cannot .wr... | How can I modify a file while other threads read from it? | 0.197375 | 0 | 0 | 351 |
5,416,987 | 2011-03-24T09:19:00.000 | 1 | 0 | 1 | 0 | java,python,performance,debugging,debuggervisualizer | 5,419,956 | 3 | false | 0 | 1 | The methods you're describing, and many of the comments, seem to me to be relatively weak probabilistic attempts to understand the performance impact. Profilers do work perfectly well for GUIs and other idle-thread programs, though it takes a little practice to read them. I think your best bet is there, though -- lea... | 2 | 6 | 0 | Debugging performance problems using a standard debugger is almost hopeless since the level of detail is too high. Other ways are using a profiler, but they seldom give me good information, especially when there is GUI and background threads involved, as I never know whether the user was actually waiting for the comput... | Debugging visually using >>, >, >|, ||, |<, <, << | 0.066568 | 0 | 0 | 182 |
5,416,987 | 2011-03-24T09:19:00.000 | 4 | 0 | 1 | 0 | java,python,performance,debugging,debuggervisualizer | 5,417,219 | 3 | false | 0 | 1 | The "Fast Forward to critical spot" function already exists in any debugger, it's called a "breakpoint". There are indeed debuggers that can slow down execution, but that will not help you debug performance problems, because it doesn't slow down the computer. The processor and disk and memory is still exactly as slow a... | 2 | 6 | 0 | Debugging performance problems using a standard debugger is almost hopeless since the level of detail is too high. Other ways are using a profiler, but they seldom give me good information, especially when there is GUI and background threads involved, as I never know whether the user was actually waiting for the comput... | Debugging visually using >>, >, >|, ||, |<, <, << | 0.26052 | 0 | 0 | 182 |
5,417,372 | 2011-03-24T09:56:00.000 | 1 | 0 | 0 | 1 | java,python,gwt,architecture,web-frameworks | 5,421,810 | 1 | true | 1 | 0 | We had the same dilemma in the past.
I was involved in designing and building a system that had a GWT frontend and Java (Spring, Hibernate) backend. Some of our other (related) systems were built in Python and Ruby, so the expertise was there, and a question just like yours came up.
We decided on Java mainly so we cou... | 1 | 4 | 0 | I have to re-design an existing application which uses Pylons (Python) on the backend and GWT on the frontend.
In the course of this re-design I can also change the backend system.
I tried to read up on the advantages and disadvantages of various backend systems (Java, Python, etc) but I would be thankful for some feed... | Feedback on different backends for GWT | 1.2 | 1 | 0 | 1,559 |
5,418,947 | 2011-03-24T12:17:00.000 | 2 | 0 | 1 | 0 | python,installation,virtualenv | 5,419,172 | 2 | true | 0 | 0 | Inside the uncompressed virtualenv directory run
python setup.py install
You should also learn about easy_install and pip for Python package installation. | 1 | 0 | 0 | I'm new to Python. I need to install "Virtualenv" but I don't can't figure out how it works and how to install it.
I have downloaded and uncompress virtualenv-1.5.2. What sould be my next step?
Best Regards, | How to install Python Virtualenv? | 1.2 | 0 | 0 | 1,050 |
5,420,885 | 2011-03-24T14:40:00.000 | 3 | 0 | 1 | 0 | python,tkinter,main | 5,420,910 | 3 | true | 0 | 0 | No. The main loop of a GUI framework must always run in the foreground. | 2 | 2 | 0 | Is there a way I can run mainloop() in the background? I don't want to add the complexity of threads. Thanks in advance. | Python: Is there a way I can run mainloop() in the background? | 1.2 | 0 | 0 | 1,061 |
5,420,885 | 2011-03-24T14:40:00.000 | 2 | 0 | 1 | 0 | python,tkinter,main | 5,420,913 | 3 | false | 0 | 0 | No, you can't do this. The message loop runs in its thread and processes your message queue.
There isn't really any official distinction between background and foreground threads. The thread that processes your message is typically called the foreground but it's not really any different from any other thread. It's o... | 2 | 2 | 0 | Is there a way I can run mainloop() in the background? I don't want to add the complexity of threads. Thanks in advance. | Python: Is there a way I can run mainloop() in the background? | 0.132549 | 0 | 0 | 1,061 |
5,422,714 | 2011-03-24T16:57:00.000 | 0 | 0 | 0 | 0 | python,sockets,ftp | 5,423,202 | 1 | false | 0 | 0 | Look for shdeskin supported library modules in
/usr/lib/python2.6/site-packages/shedskin/lib/.
My Fedora installation of shdeskin 0.7 does not include ftplib. | 1 | 0 | 0 | Greetings!
So I'm creating a Python script that will when finished be compiled with Shedskin. Currently we do a little FTP work in this script so we import the ftplib module. When I attempt to compile it with Shedskin we get the error back saying that there is no '_socket' file in our Python2.6 installation on Ubuntu. ... | Python: _socket.so | 0 | 0 | 1 | 501 |
5,423,404 | 2011-03-24T17:57:00.000 | 1 | 0 | 0 | 0 | python,linux,qt | 5,423,456 | 3 | true | 1 | 1 | I would say: nobody cares...if you are fine with Windows, use Windows. If you are commandline guy, go with a Unix system...the distro unlikely matters... | 3 | 1 | 0 | My stack for web developing includes Django/Python and Qt/C++ for non-web developing.
What is most comfortable OS for a developer with such a stack ? | Which OS recommended for Programmers? | 1.2 | 0 | 0 | 237 |
5,423,404 | 2011-03-24T17:57:00.000 | 1 | 0 | 0 | 0 | python,linux,qt | 5,423,449 | 3 | false | 1 | 1 | Once you go linux, you'll never go back (though you might go crazy and move onto bsd). Ubuntu is probably the easiest OS to start with, if only because of the truckloads of documentation, forum assistance, etc. Good luck! | 3 | 1 | 0 | My stack for web developing includes Django/Python and Qt/C++ for non-web developing.
What is most comfortable OS for a developer with such a stack ? | Which OS recommended for Programmers? | 0.066568 | 0 | 0 | 237 |
5,423,404 | 2011-03-24T17:57:00.000 | 1 | 0 | 0 | 0 | python,linux,qt | 5,423,454 | 3 | false | 1 | 1 | If you don't want to use an language that has special requirements (like .net), the question should be which os does the programmer recommend.
That's really a personal decision. | 3 | 1 | 0 | My stack for web developing includes Django/Python and Qt/C++ for non-web developing.
What is most comfortable OS for a developer with such a stack ? | Which OS recommended for Programmers? | 0.066568 | 0 | 0 | 237 |
5,424,339 | 2011-03-24T19:15:00.000 | 0 | 0 | 0 | 0 | python,google-app-engine,oauth,datastore,foursquare | 5,424,689 | 2 | false | 1 | 0 | You can create a parent association so that SiteUser is the parent of FoursquareAuth and HunchAuth.
When the user first logs in with Foursquare you create the SiteUser model and then create the FoursquareAuth model with parent=just_created_user. Then when you send the user off to authenticate through hunch you include... | 2 | 3 | 0 | I am currently using Oauth to allow a user to sign in through Foursquare, I then create a new session for this user. If the user is new to the system they are asked to sign in through Hunch, this can then generate a user profile based on information from both systems. I have them both signing in to each application sep... | Connecting methods Python | 0 | 0 | 0 | 183 |
5,424,339 | 2011-03-24T19:15:00.000 | 0 | 0 | 0 | 0 | python,google-app-engine,oauth,datastore,foursquare | 5,427,530 | 2 | true | 1 | 0 | The easiest way to do this would be something like the following:
Send the user to foursquare to sign in
When the user returns, create a record in the datastore for them.
Send the user to Hunch to sign in, but include the ID of the record you created in step 2 in the continue URL.
When the user returns, use the ID emb... | 2 | 3 | 0 | I am currently using Oauth to allow a user to sign in through Foursquare, I then create a new session for this user. If the user is new to the system they are asked to sign in through Hunch, this can then generate a user profile based on information from both systems. I have them both signing in to each application sep... | Connecting methods Python | 1.2 | 0 | 0 | 183 |
5,424,456 | 2011-03-24T19:29:00.000 | 2 | 0 | 1 | 0 | python,serialization,prototyping | 5,424,531 | 3 | false | 0 | 0 | Flatten out the structure beforehand with a depth-first search that records which items it has seen. Assign each object an id and replace object references with id references.
(In essence, turn it into a graph.) | 2 | 1 | 0 | I am trying to implement a serializer in python which tries to do something like this.
If there is an object Foo, having a forward reference to Bar, the serializer would dump all the data in Foo, and the reference would be converted into a data dump of Bar. Things would be done recursively like this for any arbitrary d... | Conceptual question on serializing data with circular references | 0.132549 | 0 | 0 | 783 |
5,424,456 | 2011-03-24T19:29:00.000 | 1 | 0 | 1 | 0 | python,serialization,prototyping | 5,433,251 | 3 | true | 0 | 0 | Keep a list of objects you've already serialized. Every object you attempt to serialize should be checked against this list. A similar approach is to toggle a boolean within each object as to whether it's been serialized already, and thus not to continue for this object. | 2 | 1 | 0 | I am trying to implement a serializer in python which tries to do something like this.
If there is an object Foo, having a forward reference to Bar, the serializer would dump all the data in Foo, and the reference would be converted into a data dump of Bar. Things would be done recursively like this for any arbitrary d... | Conceptual question on serializing data with circular references | 1.2 | 0 | 0 | 783 |
5,425,289 | 2011-03-24T20:44:00.000 | 0 | 1 | 0 | 1 | python,mysql,amazon-ec2,mysql-management | 5,426,527 | 2 | false | 0 | 0 | You didn't really specify whether it was writes or reads. My guess is that you can do it all in a mysql instance in a ramdisc (tmpfs under Linux).
Operations such as ALTER TABLE and copying big data around end up creating a lot of IO requests because they move a lot of data. This is not the same as if you've just got a... | 1 | 2 | 0 | Is there a way to reduce the I/O's associated with either mysql or a python script? I am thinking of using EC2 and the costs seem okay except I can't really predict my I/O usage and I am worried it might blindside me with costs.
I basically develop a python script to parse data and upload it into mysql. Once its in... | reducing I/O on application and database | 0 | 1 | 0 | 202 |
5,426,482 | 2011-03-24T22:47:00.000 | 5 | 0 | 1 | 0 | python,computer-vision,python-imaging-library,imaging,image-scanner | 5,430,643 | 3 | false | 0 | 0 | Just as a first try, sort your image folder by file size. If all scans from one document have the same resolution the blank pages will certainly result in smaller files than the non-blank ones.
I don't know how many pages you are scanning, but if the number is low enough this could be a simple quick fix. | 2 | 6 | 0 | So I often run huge double-sided scan jobs on an unintelligent Canon multifunction, which leaves me with a huge folder of JPEGs. Am I insane to consider using PIL to analyze a folder of images to detect scans of blank pages and flag them for deletion?
Leaving the folder-crawling and flagging parts out, I imagine this w... | Using PIL to detect a scan of a blank page | 0.321513 | 0 | 0 | 3,552 |
5,426,482 | 2011-03-24T22:47:00.000 | 3 | 0 | 1 | 0 | python,computer-vision,python-imaging-library,imaging,image-scanner | 5,426,721 | 3 | false | 0 | 0 | A few non-PIL-specific suggestions to consider:
Scans of printed or written material will have lots of high-contrast sharp edges; something like a median filter (to reduce noise) followed by some kind of simple edge detection might do a good job of discriminating real content from blank pages.
Testing fragments at a ti... | 2 | 6 | 0 | So I often run huge double-sided scan jobs on an unintelligent Canon multifunction, which leaves me with a huge folder of JPEGs. Am I insane to consider using PIL to analyze a folder of images to detect scans of blank pages and flag them for deletion?
Leaving the folder-crawling and flagging parts out, I imagine this w... | Using PIL to detect a scan of a blank page | 0.197375 | 0 | 0 | 3,552 |
5,426,967 | 2011-03-24T23:46:00.000 | 0 | 0 | 0 | 0 | python,google-apps,gdata-api,gdata | 6,580,459 | 1 | false | 1 | 0 | The initial site URL is determined by the site name, using a simple stripping algorithm (all lowercase, no spaces or special chars except - I believe)
Change this into a two-step process:
create the site using a munged name that corresponds to the URL you want
update the site title, which retains the URL but updates t... | 1 | 0 | 0 | Using Google Appengine running the Python GDATA setup. I'm a member of the volunteer programming team for DPAU, which runs on Google Apps Education and has a Google Appengine running Python with help from the GDATA library.
I'm using the create_site function in the SitesClient class. I know there is an input called uri... | Can a create a site with a custom URI in Google Sites with Python? | 0 | 0 | 1 | 132 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.