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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,187,610 | 2010-02-02T20:53:00.000 | 0 | 0 | 0 | 0 | python,web.py | 2,205,554 | 3 | false | 1 | 0 | A killer app isn't necessarily defined by whether it makes the framework/language famous. The Killer 'App' is an application that disrupts its industry in such a way that the rules or status quo of that industry is changed forever. E.g. the iPhone.
It is 'killer' because it 'kills' off market leaders in its industry.
... | 1 | 4 | 0 | A killer app is an app that make a library or framework famous. I think web.py is quite famous, but I don't know any big, widely used app written in web.py.
Could you point out any? I've head that the first version of youtube.com was coded using web.py but I'd like you to mention an open source one so I can see its cod... | Which is web.py killer app? | 0 | 0 | 0 | 3,386 |
2,187,821 | 2010-02-02T21:24:00.000 | 5 | 1 | 0 | 0 | php,python | 2,187,885 | 9 | false | 0 | 0 | print and pprint are great for built-in data types or classes which define a sane object representation. If you want a full dump of arbitrary objects, you'll have to roll your own. That is not that hard: simply create a recursive function with the base case being any non-container built-in data type, and the recursive ... | 1 | 87 | 0 | Or is there a better way to quickly output the contents of an array (multidimensional or what not). Thanks. | What is the equivalent of php's print_r() in python? | 0.110656 | 0 | 0 | 77,118 |
2,187,998 | 2010-02-02T21:53:00.000 | 8 | 1 | 1 | 0 | php,python,perl,integration,phpbb | 2,188,027 | 3 | false | 0 | 0 | You can always call the python or perl interpreter from within PHP! Minimalistic interchange is possible by means of passing command line arguments and capturing stdout (exec or passthru are related php functions).
However, I don't think its's a good idea - using two interpreters instead of one doubles the overall runt... | 2 | 2 | 0 | I'm going to help my friend in a improve of his phpBB board, but I want to make somethings there in Python or Perl. But it's possible to integrate these languages with PHP? | Integrating Python or Perl with PHP | 1 | 0 | 0 | 848 |
2,187,998 | 2010-02-02T21:53:00.000 | 8 | 1 | 1 | 0 | php,python,perl,integration,phpbb | 2,188,168 | 3 | false | 0 | 0 | I'd say that the only reasonable way of doing that is if you are making a separate service, that you talk to via Ajax or XML or something like that. Everything else is more trouble than it's worth. | 2 | 2 | 0 | I'm going to help my friend in a improve of his phpBB board, but I want to make somethings there in Python or Perl. But it's possible to integrate these languages with PHP? | Integrating Python or Perl with PHP | 1 | 0 | 0 | 848 |
2,188,646 | 2010-02-02T23:50:00.000 | 5 | 0 | 0 | 0 | python,opencv,computer-vision,motion-detection | 2,352,019 | 4 | false | 0 | 0 | Nick,
What you are looking for is not people detection, but motion detection. If you tell us a lot more about what you are trying to solve/do, we can answer better.
Anyway, there are many ways to do motion detection depending on what you are going to do with the results. Simplest one would be differencing followed by ... | 2 | 37 | 1 | I have a camera that will be stationary, pointed at an indoors area. People will walk past the camera, within about 5 meters of it. Using OpenCV, I want to detect individuals walking past - my ideal return is an array of detected individuals, with bounding rectangles.
I've looked at several of the built-in samples:
No... | How can I detect and track people using OpenCV? | 0.244919 | 0 | 0 | 45,934 |
2,188,646 | 2010-02-02T23:50:00.000 | 2 | 0 | 0 | 0 | python,opencv,computer-vision,motion-detection | 2,190,799 | 4 | false | 0 | 0 | This is similar to a project we did as part of a Computer Vision course, and I can tell you right now that it is a hard problem to get right.
You could use foreground/background segmentation, find all blobs and then decide that they are a person. The problem is that it will not work very well since people tend to go to... | 2 | 37 | 1 | I have a camera that will be stationary, pointed at an indoors area. People will walk past the camera, within about 5 meters of it. Using OpenCV, I want to detect individuals walking past - my ideal return is an array of detected individuals, with bounding rectangles.
I've looked at several of the built-in samples:
No... | How can I detect and track people using OpenCV? | 0.099668 | 0 | 0 | 45,934 |
2,189,600 | 2010-02-03T04:03:00.000 | 0 | 0 | 0 | 0 | python,struct,endianness,flip | 2,189,625 | 4 | false | 0 | 0 | little_endian = big_endian[1] + big_endian[0] | 2 | 0 | 0 | I would like to flip from big to little endian this string:
\x00\x40
to have it like this:
\x40\x00
I guess the proper function to use would be struct.pack, but I can't find a way to make it properly work.
A small help would be very appreciated !
Thanks | flip bytes using Python's struct module | 0 | 0 | 0 | 4,488 |
2,189,600 | 2010-02-03T04:03:00.000 | 5 | 0 | 0 | 0 | python,struct,endianness,flip | 2,189,817 | 4 | false | 0 | 0 | data[::-1] works for any number of bytes. | 2 | 0 | 0 | I would like to flip from big to little endian this string:
\x00\x40
to have it like this:
\x40\x00
I guess the proper function to use would be struct.pack, but I can't find a way to make it properly work.
A small help would be very appreciated !
Thanks | flip bytes using Python's struct module | 0.244919 | 0 | 0 | 4,488 |
2,189,800 | 2010-02-03T04:56:00.000 | 427 | 0 | 1 | 0 | python,count,integer | 2,189,814 | 28 | true | 0 | 0 | If you want the length of an integer as in the number of digits in the integer, you can always convert it to string like str(133) and find its length like len(str(123)). | 2 | 324 | 0 | In Python, how do you find the number of digits in an integer? | How to find length of digits in an integer? | 1.2 | 0 | 0 | 610,171 |
2,189,800 | 2010-02-03T04:56:00.000 | 2 | 0 | 1 | 0 | python,count,integer | 2,189,821 | 28 | false | 0 | 0 | Assuming you are asking for the largest number you can store in an integer, the value is implementation dependent. I suggest that you don't think in that way when using python. In any case, quite a large value can be stored in a python 'integer'. Remember, Python uses duck typing!
Edit:
I gave my answer before the clar... | 2 | 324 | 0 | In Python, how do you find the number of digits in an integer? | How to find length of digits in an integer? | 0.014285 | 0 | 0 | 610,171 |
2,190,075 | 2010-02-03T06:19:00.000 | 2 | 0 | 1 | 0 | python,django,multithreading,csv | 2,196,168 | 1 | true | 1 | 0 | Django is Python, so yeah you can use threads, processing etc. Look at python docs on this matter.
But, spawning threads in web environment might be not be such a good idea, try searching here for "django asynchronous" - you'll get many ideas of how to this without threading. | 1 | 0 | 0 | Is it possible to use threading when importing data from csv files to django. | django csv import threading | 1.2 | 0 | 0 | 570 |
2,190,502 | 2010-02-03T08:11:00.000 | -2 | 0 | 0 | 0 | python,screen-scraping,htmlunit,pycurl | 2,190,517 | 7 | false | 1 | 0 | I have not found anything for this. I use a combination of beautifulsoup and custom routines... | 1 | 14 | 0 | Does Python have screen scraping libraries that offer JavaScript support?
I've been using pycurl for simple HTML requests, and Java's HtmlUnit for more complicated requests requiring JavaScript support.
Ideally I would like to be able to do everything from Python, but I haven't come across any libraries that would allo... | Screen scraping with Python | -0.057081 | 0 | 1 | 10,580 |
2,190,711 | 2010-02-03T08:54:00.000 | 0 | 0 | 1 | 0 | python | 2,190,882 | 1 | false | 0 | 0 | You do it exactly the same way as you did before, but now with the FreeType-dev files installed. | 1 | 0 | 0 | Previously I got a suggedtion to Install the FreeType dev files and rebuild PIL again.
but I have no idea how to do it.
any help will be thanked for | Rebuilding PIL with FreeType | 0 | 0 | 0 | 318 |
2,191,695 | 2010-02-03T12:08:00.000 | 1 | 0 | 0 | 0 | python,rabbitmq,amqp,py-amqplib | 2,240,828 | 3 | true | 0 | 0 | It is currently impossible as the basic.return is sent asynchronously when a message is dropped in broker. When message was sent successfully no data is reported from server.
So pyAMQP can't listen for such messages.
I've read few threads about this problem. Possible solution were:
use txAMQP, twisted version of amqp ... | 1 | 2 | 0 | I'd like to make sure that my message was delivered to a queue.
To do so I'm adding the mandatory param to the basic_publish.
What else should I do to receive the basic.return message if my message wasn't successfully delivered?
I can't use channel.wait() to listen for the basic.return because when my message is succe... | How to use listen on basic.return in python client of AMQP | 1.2 | 0 | 1 | 1,192 |
2,192,344 | 2010-02-03T13:53:00.000 | 3 | 0 | 1 | 0 | python | 2,195,845 | 4 | false | 0 | 0 | Because then you would have two ways to do something. | 2 | 16 | 0 | Is there a good reason why there isn't a do while flow control statement in python?
Why do people have to write while and break explicitly? | Why isn't there a do while flow control statement in python? | 0.148885 | 0 | 0 | 2,629 |
2,192,344 | 2010-02-03T13:53:00.000 | 10 | 0 | 1 | 0 | python | 2,192,371 | 4 | false | 0 | 0 | Probably because Guido didn't think it was necessary. There are a bunch of different flow-control statements you could support, but most of them are variants of each other. Frankly, I've found the do-while statement to be one of the less useful ones. | 2 | 16 | 0 | Is there a good reason why there isn't a do while flow control statement in python?
Why do people have to write while and break explicitly? | Why isn't there a do while flow control statement in python? | 1 | 0 | 0 | 2,629 |
2,192,685 | 2010-02-03T14:40:00.000 | 2 | 0 | 0 | 0 | python,django,apache | 2,193,943 | 4 | true | 1 | 0 | Ubuntu is far and away a better platform nowadays. I'm a refugee from RHEL and Fedora. Get Ubuntu 9.10, and if you'd like, spawn it on Amazon ec2 for total flexibility (i.e. launch it in about 90 seconds, play around, do what you want, delete it, and only pay a buck). Otherwise, just use Ubuntu on the desktop.
Ubunt... | 2 | 1 | 0 | I am about to embark a major django project. If I install the latest stable release... is the a suggested setup ie. this OS, this RDBMS, this version of python etc?? I'm normally a CentOS man but their repos don't play too well with the django requirements... | Recommended Django setup? | 1.2 | 0 | 0 | 703 |
2,192,685 | 2010-02-03T14:40:00.000 | 1 | 0 | 0 | 0 | python,django,apache | 2,192,712 | 4 | false | 1 | 0 | We use Fedora 11, MySQL, Apache, mod_wsgi, Python 2.6. Works great. | 2 | 1 | 0 | I am about to embark a major django project. If I install the latest stable release... is the a suggested setup ie. this OS, this RDBMS, this version of python etc?? I'm normally a CentOS man but their repos don't play too well with the django requirements... | Recommended Django setup? | 0.049958 | 0 | 0 | 703 |
2,192,993 | 2010-02-03T15:21:00.000 | 0 | 0 | 1 | 0 | python,pyqt | 2,193,028 | 2 | false | 0 | 1 | You could create a thread to update the GUI constantly, just pass to it references to the graphical widgets that need to be updated | 1 | 1 | 0 | Often times when we're drawing a GUI, we want our GUI to update based on the data changing in our program. At the start of the program, let's say I've drawn my GUI based on my initial data. That data will be changing constantly, so how can I redraw my GUI constantly? | How to start a "drawing loop" in PyQt? | 0 | 0 | 0 | 1,096 |
2,193,231 | 2010-02-03T15:55:00.000 | 0 | 0 | 1 | 0 | python,shell | 2,193,294 | 4 | false | 0 | 0 | Unless there is a way of doing it on the activestate shell, no, there is no way to retrieve the exact code you've typed on the shell. At least on Linux, using the Python Shell provided by CPython there is no special way to achieve this. Maybe using iPython.
The func_code attribute is an object representing the function... | 2 | 14 | 0 | I am working in the Python Interactive Shell (ActiveState ActivePython 2.6.4 under Windows XP). I created a function that does what I want. However, I've cleared the screen so I can't go back and look at the function definition. It is also a multiline function so the up arrow to redisplay lines is of minimal value. Is ... | Display function definition in interactive shell | 0 | 0 | 0 | 22,508 |
2,193,231 | 2010-02-03T15:55:00.000 | 1 | 0 | 1 | 0 | python,shell | 2,193,405 | 4 | false | 0 | 0 | No, not really. You could write yourfunc.func_code.co_code (the actually compiled bytecode) to a file and then try using decompyle or unpyc to decompile them, but both projects are old and unmaintained, and have never supported decompiling very well.
It's infinitely easier to simply write your function to a file to sta... | 2 | 14 | 0 | I am working in the Python Interactive Shell (ActiveState ActivePython 2.6.4 under Windows XP). I created a function that does what I want. However, I've cleared the screen so I can't go back and look at the function definition. It is also a multiline function so the up arrow to redisplay lines is of minimal value. Is ... | Display function definition in interactive shell | 0.049958 | 0 | 0 | 22,508 |
2,193,829 | 2010-02-03T17:15:00.000 | 2 | 0 | 1 | 0 | python,performance,architecture,comparison | 2,193,927 | 4 | false | 0 | 0 | Beautiful Code book has a nice explanation about how dicts are implemented. | 2 | 0 | 0 | Does anyone know good books that discuss the underlying architectures, in-depth analysis of CPython implementation. Something like
how list / tuple / dict implemented (and performance comparison...)
OOP discussion in Python context
Sorry if it sounds like a silly question :( | Python underlying analysis books/articles? | 0.099668 | 0 | 0 | 265 |
2,193,829 | 2010-02-03T17:15:00.000 | 2 | 0 | 1 | 0 | python,performance,architecture,comparison | 2,193,928 | 4 | false | 0 | 0 | This doesn't directly answer your question but it's useful to know nevertheless:
The source code of CPython is well-written and well-documented, and there are some PEPs that shed light on parts of the implementation. You should really try just reading it. | 2 | 0 | 0 | Does anyone know good books that discuss the underlying architectures, in-depth analysis of CPython implementation. Something like
how list / tuple / dict implemented (and performance comparison...)
OOP discussion in Python context
Sorry if it sounds like a silly question :( | Python underlying analysis books/articles? | 0.099668 | 0 | 0 | 265 |
2,194,479 | 2010-02-03T18:41:00.000 | 2 | 0 | 1 | 0 | python | 2,194,652 | 2 | false | 0 | 0 | If it looks like ugly type checking, that may be because it is. If "amount" absolutely needs to be a positive integer, and the rest of the module will fail badly if it is not, then you need to do some type checking.
The python way of doing this, though, is only to check for the actual properties that you require.
In th... | 2 | 6 | 0 | Where should I write codes for checking validity of class' properties? (For examples: "amount" should be a positive integer, "email" should be a string with correct e-mail formatting) At the setter methods, At somewhere I use that (using try/catch), or others.
If I check validity at setter methods, it may be looked ugl... | Checking for properties' validity in Python classes | 0.197375 | 0 | 0 | 158 |
2,194,479 | 2010-02-03T18:41:00.000 | 4 | 0 | 1 | 0 | python | 2,194,552 | 2 | true | 0 | 0 | Definitely do it in the setter, if you need to do it at all.
First, the setter is probably called less often than the getters, so you're doing less work.
Second, you catch the problem earlier.
Third, it keeps the internal state of the object consistent. Keeping out bad data means you know that your object is "right"... | 2 | 6 | 0 | Where should I write codes for checking validity of class' properties? (For examples: "amount" should be a positive integer, "email" should be a string with correct e-mail formatting) At the setter methods, At somewhere I use that (using try/catch), or others.
If I check validity at setter methods, it may be looked ugl... | Checking for properties' validity in Python classes | 1.2 | 0 | 0 | 158 |
2,194,829 | 2010-02-03T19:31:00.000 | 0 | 0 | 0 | 0 | python,pyqt | 2,194,899 | 1 | false | 0 | 1 | To swap the scene just call your view's setScene() again with a different QGraphicsScene object. | 1 | 1 | 0 | QGraphicsView is often hooked up to a QGraphicsScene. What if I want to swap that QGraphicsScene for a new one? How can I accomplish this? Doing it right now is just drawing over the old one. | How to swap the QGraphicsScene from a QGraphicsView? | 0 | 0 | 0 | 249 |
2,195,203 | 2010-02-03T20:31:00.000 | 2 | 1 | 0 | 0 | python,ruby-on-rails,linux,email | 2,195,237 | 1 | true | 1 | 0 | Why does it need to be a simple mail server?
Can't you just use something like postfix which is very easy for simple configurations | 1 | 1 | 0 | I use python based as well as rails applications on ubuntu linux. We have functionalities like register, forgot password, reset password, email alerts etc features based on emails. Since now a days, we go on offline development, we want to run a local smtp & pop3 server to send and receive emails.
Emails shall be send ... | Linux development/minimal smtp and pop3 server | 1.2 | 0 | 0 | 839 |
2,195,441 | 2010-02-03T21:07:00.000 | 3 | 0 | 0 | 0 | python,opencv | 2,405,587 | 4 | true | 0 | 0 | After Step 1 (Installer) just copy the content of C:\OpenCV2.0\Python2.6\Lib\site-packages to C:\Python26\Lib\site-packages (standard installation path assumed).
That's all.
If you have a webcam installed you can try the camshift.demo in C:\OpenCV2.0\samples\python
The deprecated stuff (C:\OpenCV2.0\samples\swig_python... | 1 | 6 | 1 | I cannot get the example Python programs to run. When executing the Python command "from opencv import cv" I get the message "ImportError: No module named _cv". There is a stale _cv.pyd in the site-packages directory, but no _cv.py anywhere. See step 5 below.
MS Windows XP, VC++ 2008, Python 2.6, OpenCV 2.0
Here's wh... | OpenCV 2.0 and Python | 1.2 | 0 | 0 | 16,728 |
2,195,747 | 2010-02-03T21:51:00.000 | 0 | 1 | 1 | 0 | python | 22,124,386 | 5 | false | 0 | 0 | You can use Pygpgme to create a password-protected gpg file, which is compressed.
You'll need to use the equivalent of
gpg -c myFile
or
gpg --symmetric myFile
and
gpg myFile.gpg
I don't know what the equivalents are in that Python module, but I know they've existed since version 0.2. There was a bug report ... | 2 | 17 | 0 | What is the Python code to create a password encrypted zip file? I'm fine with using some apt-get'able utilities using system on the command line. | Code to create a password encrypted zip file? | 0 | 0 | 0 | 51,029 |
2,195,747 | 2010-02-03T21:51:00.000 | 5 | 1 | 1 | 0 | python | 2,196,159 | 5 | false | 0 | 0 | Extraction is pretty easy, you just use zipfile.ZipFile.setpassword() which was introduced in python 2.6, however the standard python library lacks support for creating encrypted zip files.
There are commercially available libraries for Python which supports creation of encrypted and password protected zip files. If yo... | 2 | 17 | 0 | What is the Python code to create a password encrypted zip file? I'm fine with using some apt-get'able utilities using system on the command line. | Code to create a password encrypted zip file? | 0.197375 | 0 | 0 | 51,029 |
2,195,755 | 2010-02-03T21:52:00.000 | 3 | 0 | 1 | 0 | python | 2,195,789 | 5 | false | 0 | 0 | Object attributes are always accessed via a reference, so there is no way for an object attribute to shadow a builtin. | 3 | 1 | 0 | If you have a method called "set" in a class and want to create a standard builtin "set" object somewhere else in the class, Python seems to reference the method when I do that. How can you be more specific to let Python know you mean the builtin "set", not the method "set"? More specifically, set() is being created in... | Python class has method "set", how to reference builtin set type? | 0.119427 | 0 | 0 | 582 |
2,195,755 | 2010-02-03T21:52:00.000 | 2 | 0 | 1 | 0 | python | 2,195,786 | 5 | false | 0 | 0 | Usually method names are disambiguated from global names because you have to prefix self..
So self.set() invokes your class method and set() invokes the global set.
If this doesn't help, perhaps post the code you're having trouble with. | 3 | 1 | 0 | If you have a method called "set" in a class and want to create a standard builtin "set" object somewhere else in the class, Python seems to reference the method when I do that. How can you be more specific to let Python know you mean the builtin "set", not the method "set"? More specifically, set() is being created in... | Python class has method "set", how to reference builtin set type? | 0.07983 | 0 | 0 | 582 |
2,195,755 | 2010-02-03T21:52:00.000 | 2 | 0 | 1 | 0 | python | 2,195,807 | 5 | false | 0 | 0 | You can refer to built-in set as __builtins__.set. | 3 | 1 | 0 | If you have a method called "set" in a class and want to create a standard builtin "set" object somewhere else in the class, Python seems to reference the method when I do that. How can you be more specific to let Python know you mean the builtin "set", not the method "set"? More specifically, set() is being created in... | Python class has method "set", how to reference builtin set type? | 0.07983 | 0 | 0 | 582 |
2,195,791 | 2010-02-03T21:58:00.000 | 2 | 0 | 0 | 0 | python,database,django,unit-testing | 2,195,979 | 5 | true | 1 | 0 | Don't force Django to do something unnatural.
Allow it to create the test schema. It's a good thing.
From your existing schema, do an unload to create .JSON dump files of the data. These files are your "fixtures". These fixtures are used by Django to populate the test database. This is The Greatest Testing Tool Ev... | 2 | 2 | 0 | Disclaimer:
I'm very new to Django. I must say that so far I really like it. :)
(now for the "but"...)
But, there seems to be something I'm missing related to unit testing. I'm working on a new project with an Oracle backend. When you run the unit tests, it immediately gives a permissions error when trying to creat... | DB Permissions with Django unit testing | 1.2 | 0 | 0 | 1,622 |
2,195,791 | 2010-02-03T21:58:00.000 | 2 | 0 | 0 | 0 | python,database,django,unit-testing | 2,197,772 | 5 | false | 1 | 0 | After I read David's (OP) question, I was curious about this too, but I don't see the answer I was hoping to see. So let me try to rephrase what I think at least part of what David is asking. In a production environment, I'm sure his Django models probably will not have access to create or drop tables. His DBA will p... | 2 | 2 | 0 | Disclaimer:
I'm very new to Django. I must say that so far I really like it. :)
(now for the "but"...)
But, there seems to be something I'm missing related to unit testing. I'm working on a new project with an Oracle backend. When you run the unit tests, it immediately gives a permissions error when trying to creat... | DB Permissions with Django unit testing | 0.07983 | 0 | 0 | 1,622 |
2,196,621 | 2010-02-04T00:48:00.000 | 3 | 0 | 1 | 0 | python,pdf,text,extract,google-docs | 13,056,489 | 6 | false | 0 | 0 | Acrobat Professional can do the job. In the "File" menu, choose export. Then, choose Text. | 1 | 16 | 0 | How can I extract the text content (not images) from a PDF while (roughly) maintaining the style and layout like Google Docs can? | how to extract formatted text content from PDF | 0.099668 | 0 | 0 | 24,481 |
2,197,451 | 2010-02-04T05:14:00.000 | 9 | 0 | 1 | 0 | python,string,split | 2,197,605 | 8 | false | 0 | 0 | Having x.split(y) always return a list of 1 + x.count(y) items is a precious regularity -- as @gnibbler's already pointed out it makes split and join exact inverses of each other (as they obviously should be), it also precisely maps the semantics of all kinds of delimiter-joined records (such as csv file lines [[net of... | 2 | 146 | 0 | What is the point of '/segment/segment/'.split('/') returning ['', 'segment', 'segment', '']?
Notice the empty elements. If you're splitting on a delimiter that happens to be at position one and at the very end of a string, what extra value does it give you to have the empty string returned from each end? | Why are empty strings returned in split() results? | 1 | 0 | 1 | 93,416 |
2,197,451 | 2010-02-04T05:14:00.000 | 6 | 0 | 1 | 0 | python,string,split | 2,197,494 | 8 | false | 0 | 0 | Well, it lets you know there was a delimiter there. So, seeing 4 results lets you know you had 3 delimiters. This gives you the power to do whatever you want with this information, rather than having Python drop the empty elements, and then making you manually check for starting or ending delimiters if you need to know... | 2 | 146 | 0 | What is the point of '/segment/segment/'.split('/') returning ['', 'segment', 'segment', '']?
Notice the empty elements. If you're splitting on a delimiter that happens to be at position one and at the very end of a string, what extra value does it give you to have the empty string returned from each end? | Why are empty strings returned in split() results? | 1 | 0 | 1 | 93,416 |
2,198,562 | 2010-02-04T09:35:00.000 | 3 | 0 | 1 | 0 | python,ruby,model-view-controller,oop | 2,198,673 | 2 | false | 1 | 0 | They don't require OOP, but they do require procedural code, as they are imperative languages, and not functional ones. You can use some functional techniques.
There are plenty of frameworks that use MVC for both languages, yes. | 2 | 0 | 0 | i know that these 2 languages require oop.
but inside the classes, could you have procedural code?
and for the mvc part, that pattern comes with their frameworks right?
nothing to do with the actual language itself? | no procedural code and non mvc in ruby and python? | 0.291313 | 0 | 0 | 116 |
2,198,562 | 2010-02-04T09:35:00.000 | 4 | 0 | 1 | 0 | python,ruby,model-view-controller,oop | 2,198,616 | 2 | true | 1 | 0 | Neither of these languages require OOP, especially Python. In Python you can write as many ordinary functions as you want, and there are plenty of modules which don't define any classes. In Ruby you can do the same thing, except instead of functions you have methods on a module.
You are correct that MVC is related to... | 2 | 0 | 0 | i know that these 2 languages require oop.
but inside the classes, could you have procedural code?
and for the mvc part, that pattern comes with their frameworks right?
nothing to do with the actual language itself? | no procedural code and non mvc in ruby and python? | 1.2 | 0 | 0 | 116 |
2,200,027 | 2010-02-04T13:41:00.000 | 6 | 1 | 1 | 0 | python,arrays,performance | 2,200,806 | 2 | false | 0 | 0 | If you need to alter the buffer in-place (it's not clear if you do, since you use the ambiguous term "to process"), arrays will likely be better, since strings are immutable. In Python 2.6 or better, however, bytearrays can be the best of both worlds -- mutable and rich of methods and usable with regular expressions t... | 1 | 3 | 0 | I am building a routine that processes disk buffers for forensic purposes. Am I better off using python strings or the array() type? My first thought was to use strings, but I'm trying to void unicode problems, so perhaps array('c') is better? | which is more efficient for buffer manipulations: python strings or array() | 1 | 0 | 0 | 681 |
2,200,742 | 2010-02-04T15:15:00.000 | 0 | 0 | 1 | 0 | python,image,png | 2,202,189 | 3 | false | 0 | 0 | THe suggested PIL does not support interlaced PNGs. It can be quite anoying when dealing with lots of PNGs from different origins.
It is possible to open them, but can only read headerinformation from them, all other operations fail. | 1 | 17 | 0 | I haven't found a standard way in Python to read images. Is there really none (because there are so many functions for so many custom stuff that I really wonder that there are no functions to read images)? Or what is it? (It should be available in the MacOSX standard installation and in most recent versions on Linux di... | Python: default/common way to read png images | 0 | 0 | 0 | 14,554 |
2,201,580 | 2010-02-04T17:02:00.000 | 3 | 0 | 0 | 1 | python,google-app-engine,google-cloud-datastore | 4,088,516 | 6 | false | 1 | 0 | Results of datastore count() queries
and offsets for all datastore queries
are no longer capped at 1000.
Since Version 1.3.6 | 1 | 4 | 0 | I'm building an app on GAE that needs to report on events occurring. An event has a type and I also need to report by event type.
For example, say there is an event A, B and C. They occur periodically at random. User logs in and creates a set of entities to which those events can be attributed. When the user comes back... | Need a way to count entities in GAE datastore that meet a certain condition? (over 1000 entities) | 0.099668 | 0 | 0 | 4,016 |
2,202,991 | 2010-02-04T20:34:00.000 | 0 | 0 | 1 | 0 | python,camera,s60 | 2,203,194 | 1 | true | 1 | 0 | This is just a guess. Are you maybe getting low-res images that are suitable for sending via MMS? I would look at the API. | 1 | 0 | 0 | In my project I have to use mobile camera from my own program.
I use python with S60 platform under NOKIA 6220 Classic. It has 5mp-camera.
The problem is that photos quality are very-very low. Seems that auto-focusing doesn't work.
I'd like to know maybe anyone from you made something before. I can buy new telephone if... | S60 camera focusing | 1.2 | 0 | 0 | 202 |
2,203,492 | 2010-02-04T21:49:00.000 | 0 | 0 | 1 | 1 | python | 2,203,707 | 2 | false | 0 | 0 | The usual problem with reload is that instances stay bound to the old version of the class. If you are not keeping old instances around, reload is simple and works very well. | 1 | 2 | 0 | I have an application that starts by loading a large pickled trie (173M) from disk and then uses it to do some processing. I'm making frequent changes to the processing part, which is inconvenient because loading the trie takes 15 minutes or so. I'm looking for a way to eliminate the repeated loading during testing, ... | Code Changes While Keeping Large Objects In Memory in Python | 0 | 0 | 0 | 128 |
2,204,087 | 2010-02-04T23:45:00.000 | 1 | 0 | 0 | 1 | c++,python,bash,linear-algebra | 2,204,122 | 3 | false | 0 | 0 | How about extracting the coeffs into a file, import to another machine and then use Excel/Matlab/whatever other program that does this for you? | 2 | 2 | 1 | I am running some calculations in an external machine and at the end I get X, Y pairs. I want to apply linear regression and obtain A, B, and R2. In this machine I can not install anything (it runs Linux) and has basic stuff installed on it, python, bash (of course), etc.
I wonder what would be the best approach to use... | Minimal linear regression program | 0.066568 | 0 | 0 | 2,428 |
2,204,087 | 2010-02-04T23:45:00.000 | 3 | 0 | 0 | 1 | c++,python,bash,linear-algebra | 2,204,124 | 3 | false | 0 | 0 | For a single, simple, known function (as in your case: a line) it is not hard to simply code a basic least square routine from scratch (but does require some attention to detail). It is a very common assignment in introductory numeric analysis classes.
So, look up least squares on wikipedia or mathworld or in a text bo... | 2 | 2 | 1 | I am running some calculations in an external machine and at the end I get X, Y pairs. I want to apply linear regression and obtain A, B, and R2. In this machine I can not install anything (it runs Linux) and has basic stuff installed on it, python, bash (of course), etc.
I wonder what would be the best approach to use... | Minimal linear regression program | 0.197375 | 0 | 0 | 2,428 |
2,204,223 | 2010-02-05T00:19:00.000 | 0 | 1 | 0 | 0 | php,python,ruby | 2,204,294 | 5 | false | 1 | 0 | django on Google App Engine gets you free(up to a point) and scalable hosting | 2 | 4 | 0 | I'd like to make a website, it's not a huge project, but I'm a bit out of the web design loop. The last time I made a website was probably around 2002. I figure the web frameworks and tools have come a ways since then. It's mostly the design aspect that I'd like it to make easier. I can do the backend language in a... | What's a good web framework and/or tool for a software developer? | 0 | 0 | 0 | 335 |
2,204,223 | 2010-02-05T00:19:00.000 | 0 | 1 | 0 | 0 | php,python,ruby | 2,204,292 | 5 | false | 1 | 0 | It really depends on a couple things:
What are you familiar with? You indicated that you've done some web development in the past. What did you use? If you were using classic ASP, then learning ASP.NET should be less of a jump for you.
What are you trying to create? If all you need are static HTML files with a tin... | 2 | 4 | 0 | I'd like to make a website, it's not a huge project, but I'm a bit out of the web design loop. The last time I made a website was probably around 2002. I figure the web frameworks and tools have come a ways since then. It's mostly the design aspect that I'd like it to make easier. I can do the backend language in a... | What's a good web framework and/or tool for a software developer? | 0 | 0 | 0 | 335 |
2,205,047 | 2010-02-05T04:29:00.000 | 1 | 0 | 0 | 0 | python,pylons | 2,224,250 | 1 | true | 0 | 0 | Pylons's template configures the database in config/environment.py, probably with the engine_from_config method. It finds all the config settings with a particular prefix and passes them as keyword arguments to create_engine.
You can just replace that with a few calls to sqlalchemy.create_engine() with the per-engine u... | 1 | 2 | 0 | I'm trying to implement the proper architecture for multiple databases under Python + Pylons. I can't put everything in the config files since one of the database connections requires the connection info from a previous database connection (sharding).
What's the best way to implement such an infrastructure? | Multiple database connections with Python + Pylons + SQLAlchemy | 1.2 | 1 | 0 | 988 |
2,205,832 | 2010-02-05T08:19:00.000 | 2 | 1 | 1 | 0 | c#,java,.net,python,memory | 2,205,899 | 2 | true | 1 | 0 | Since you can install all of those for free and it sounds like you already have the code implemented in both .Net and Java then I suggest you benchmark the program on all four platforms (windows/linux * java/.net).
It sounds like all the heavy lifting is done in Java/C#, so I suspect the relative performance of Jytho... | 2 | 3 | 0 | i'm doing simulation which generates thousands of result objects.
Each object size is around 1mb, and all the result objects should be on memory to be queried for various ad hoc reports. And it takes 1~2 secs to make one result object.
So it takes more than 5 minutes to get one simulation done even though i fully use m... | best (python) setup for cpu / memory intensive task | 1.2 | 0 | 0 | 839 |
2,205,832 | 2010-02-05T08:19:00.000 | 2 | 1 | 1 | 0 | c#,java,.net,python,memory | 2,205,986 | 2 | false | 1 | 0 | @Dave is spot on, if you really care benchmark each combination and see.
Personally I'd suggest you stick with the tool set that you are most comfortable with, be that Windows, Java, Linux, .Net or any random combination there of. Your level of productivity in maintaining and developing your software usually trumps any... | 2 | 3 | 0 | i'm doing simulation which generates thousands of result objects.
Each object size is around 1mb, and all the result objects should be on memory to be queried for various ad hoc reports. And it takes 1~2 secs to make one result object.
So it takes more than 5 minutes to get one simulation done even though i fully use m... | best (python) setup for cpu / memory intensive task | 0.197375 | 0 | 0 | 839 |
2,206,125 | 2010-02-05T09:20:00.000 | 1 | 0 | 0 | 0 | python | 2,206,303 | 1 | false | 0 | 0 | Probably, you've installed 32 bit library on 64 bit system. | 1 | 0 | 0 | I'm trying to use the WConio library for python, but when I import it, it gives this error:
Traceback (most recent call last):
File "WConioExample.py", line 15, in
< module>
import WConio File "d:\tools\development\python2.5\lib\site-packages\WConio.py",
line 23, in
from _WConio import * ImportError: DL... | Problems using the python WConio library | 0.197375 | 0 | 0 | 1,398 |
2,206,353 | 2010-02-05T09:57:00.000 | 1 | 0 | 0 | 0 | javascript,python,django | 2,206,464 | 3 | false | 1 | 0 | I'm not familiar with django, so this might be completely incorrect.
Can you write out the variables to hidden HTML fields on the page. This will allow you to access them from JavaScript, or utilise them in form posts should you require that. | 2 | 5 | 0 | I would like some variables from my settings.py to be available in every javascript running across my project.
What is the most elegant way of achieving this?
Right now I can think of two:
write a context processor and declare those globals in a base template. All templates must extend the base template.
declare those... | global variable from django to javascript | 0.066568 | 0 | 0 | 1,966 |
2,206,353 | 2010-02-05T09:57:00.000 | 6 | 0 | 0 | 0 | javascript,python,django | 2,206,532 | 3 | true | 1 | 0 | I would use option 1. You should use a base template in any case, and a context processor is probably the best way of getting the variables into it. | 2 | 5 | 0 | I would like some variables from my settings.py to be available in every javascript running across my project.
What is the most elegant way of achieving this?
Right now I can think of two:
write a context processor and declare those globals in a base template. All templates must extend the base template.
declare those... | global variable from django to javascript | 1.2 | 0 | 0 | 1,966 |
2,207,110 | 2010-02-05T12:23:00.000 | 3 | 0 | 0 | 0 | python,url,video-streaming,rtsp | 2,247,454 | 4 | false | 0 | 0 | If you do not want to use a library, as suggested by synack, you can open a socket connection to the given URL and send an RTSP DESCRIEBE request. That is actually quite simple since RTSP is text-based HTTP-like. You would need to parse the response for a meaningful result, e.g look for the presence of media streams. | 2 | 4 | 0 | I am trying to verify that a video service is provided from an URL in python. I am asking does anyone know of any good libraries to use or a way to do this. I have not found much info for this on the web.
Thanks | Verify RTSP service via URL | 0.148885 | 0 | 1 | 4,091 |
2,207,110 | 2010-02-05T12:23:00.000 | 0 | 0 | 0 | 0 | python,url,video-streaming,rtsp | 2,421,464 | 4 | false | 0 | 0 | I don't believe Live555 provides a python library. However, they do provide source code that can be compiled to build openRTSP. This is a simple command-line utility that will perform the entire RTSP handshake to connect to the server and begin streaming to the client. It also can provide statistic measurements (suc... | 2 | 4 | 0 | I am trying to verify that a video service is provided from an URL in python. I am asking does anyone know of any good libraries to use or a way to do this. I have not found much info for this on the web.
Thanks | Verify RTSP service via URL | 0 | 0 | 1 | 4,091 |
2,207,562 | 2010-02-05T13:44:00.000 | 0 | 0 | 0 | 0 | python,django | 2,207,718 | 2 | false | 1 | 0 | One, popular, option would be to use something like tags. So you'd have the stuff that's common to all items, like an item ID, name, description, price. Then you'd have some more generic tags or described tags in another table, associated with those items. You could have a tag that represents the season, or automobi... | 1 | 1 | 0 | what i want, is to receive advices to define a re-usefull Product model, for a shopping site app, nowadays I know that the store is going to commerce with "clothing", so the product model will have a "season or collections" relationship, but in the future I should use that app to commerce with X product, e.g: "cars" wh... | How to write dynamic Django models? | 0 | 0 | 0 | 580 |
2,208,828 | 2010-02-05T16:55:00.000 | 6 | 0 | 1 | 1 | python,windows,64-bit | 3,740,665 | 22 | false | 0 | 0 | Many of these proposed solutions, such as platform.architecture(), fail because their results depend on whether you are running 32-bit or 64-bit Python.
The only reliable method I have found is to check for the existence of os.environ['PROGRAMFILES(X86)'], which is unfortunately hackish. | 4 | 41 | 0 | Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files.
Many thanks | Detect 64bit OS (windows) in Python | 1 | 0 | 0 | 46,662 |
2,208,828 | 2010-02-05T16:55:00.000 | 38 | 0 | 1 | 1 | python,windows,64-bit | 2,208,869 | 22 | false | 0 | 0 | I guess you should look in os.environ['PROGRAMFILES'] for the program files folder. | 4 | 41 | 0 | Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files.
Many thanks | Detect 64bit OS (windows) in Python | 1 | 0 | 0 | 46,662 |
2,208,828 | 2010-02-05T16:55:00.000 | -2 | 0 | 1 | 1 | python,windows,64-bit | 2,208,946 | 22 | false | 0 | 0 | There should be a directory under Windows 64bit, a Folder called \Windows\WinSxS64 for 64 bit, under Windows 32bit, it's WinSxS. | 4 | 41 | 0 | Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files.
Many thanks | Detect 64bit OS (windows) in Python | -0.01818 | 0 | 0 | 46,662 |
2,208,828 | 2010-02-05T16:55:00.000 | 3 | 0 | 1 | 1 | python,windows,64-bit | 2,209,113 | 22 | false | 0 | 0 | You should be using environment variables to access this. The program files directory is stored in the environment variable PROGRAMFILES on x86 Windows, the 32-bit program files is directory is stored in the PROGRAMFILES(X86) environment variable, these can be accessed by using os.environ('PROGRAMFILES').
Use sys.getwi... | 4 | 41 | 0 | Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files.
Many thanks | Detect 64bit OS (windows) in Python | 0.027266 | 0 | 0 | 46,662 |
2,211,822 | 2010-02-06T02:55:00.000 | 1 | 0 | 1 | 0 | python,syntax,variable-assignment | 2,211,832 | 4 | false | 0 | 0 | Multiple assignment is implemented as a combination of tuple packing and tuple unpacking, to my knowledge, so it should have the same effect. | 2 | 8 | 0 | I'm trying to prepare for a future in computer science, so I started with ECMAScript and I am now trying to learn more about Python. Coming from ECMAScript, seeing multiple assignments such as a, b, c = 1, 2, 3 leaves me bewildered for a moment, until I realize that there are multiple assignments going on. To make thin... | Method of Multiple Assignment in Python | 0.049958 | 0 | 0 | 4,022 |
2,211,822 | 2010-02-06T02:55:00.000 | 11 | 0 | 1 | 0 | python,syntax,variable-assignment | 2,211,828 | 4 | true | 0 | 0 | It should not have any effect on performance. The parenthesis do not make it a tuple, the comma's do. So (1,2,3) is exactly the same as 1,2,3 | 2 | 8 | 0 | I'm trying to prepare for a future in computer science, so I started with ECMAScript and I am now trying to learn more about Python. Coming from ECMAScript, seeing multiple assignments such as a, b, c = 1, 2, 3 leaves me bewildered for a moment, until I realize that there are multiple assignments going on. To make thin... | Method of Multiple Assignment in Python | 1.2 | 0 | 0 | 4,022 |
2,211,967 | 2010-02-06T03:57:00.000 | 2 | 0 | 1 | 0 | python,parsing,rule-engine,expert-system | 7,619,477 | 2 | false | 0 | 0 | It looks like you search for "grammar inference" (grammar induction) library. | 1 | 8 | 0 | I am seeking direction and attempting to label this problem:
I am attempting to build a simple inference engine (is there a better name?) in Python which will take a string and -
1 - create a list of tokens by simply creating a list of white space separated values
2 - categorise these tokens, using regular expressions
... | Building an Inference Engine in Python | 0.197375 | 0 | 0 | 3,788 |
2,211,990 | 2010-02-06T04:04:00.000 | 6 | 0 | 1 | 0 | python,generator,primes | 2,212,842 | 12 | false | 0 | 0 | Do a segmented sieve, where the size of a segment is determined by available memory or the maximal size of a bitset.
For each segment represent the numbers in some interval [n; n + segment_size) as a bit set and sieve with all prime numbers below the square root of the upper bound.
Using a bit set uses less memory than... | 1 | 68 | 0 | This is not a homework, I am just curious.
INFINITE is the key word here.
I wish to use it as for p in primes(). I believe that this is a built-in function in Haskell.
So, the answer cannot be as naive as "Just do a Sieve".
First of all, you do not know how many consecutive primes will be consumed. Well, suppose you co... | How to implement an efficient infinite generator of prime numbers in Python? | 1 | 0 | 0 | 30,775 |
2,213,531 | 2010-02-06T15:09:00.000 | 9 | 0 | 1 | 0 | python | 2,213,535 | 8 | true | 0 | 0 | In python it helps to think of declaring variables as binding values to names.
Try not to misspell them, or you will have new ones (assuming you are talking about assignment statements - referencing them will cause an exception).
If you are talking about instance variables, you won't be able to use them afterwards.
For... | 3 | 10 | 0 | Usually declaring variables on assignment is considered a best practice in VBScript or JavaScript , for example, although it is allowed.
Why does Python force you to create the variable only when you use it? Since Python is case sensitive can't it cause bugs because you misspelled a variable's name?
How would you av... | What's the pythonic way of declaring variables? | 1.2 | 0 | 0 | 5,400 |
2,213,531 | 2010-02-06T15:09:00.000 | 5 | 0 | 1 | 0 | python | 2,213,543 | 8 | false | 0 | 0 | Python never forces you to create a variable only when you use it. You can always bind None to a name and then use the name elsewhere later. | 3 | 10 | 0 | Usually declaring variables on assignment is considered a best practice in VBScript or JavaScript , for example, although it is allowed.
Why does Python force you to create the variable only when you use it? Since Python is case sensitive can't it cause bugs because you misspelled a variable's name?
How would you av... | What's the pythonic way of declaring variables? | 0.124353 | 0 | 0 | 5,400 |
2,213,531 | 2010-02-06T15:09:00.000 | 15 | 0 | 1 | 0 | python | 2,213,663 | 8 | false | 0 | 0 | It's a silly artifact of Python's inspiration by "teaching languages", and it serves to make the language more accessible by removing the stumbling block of "declaration" entirely. For whatever reason (probably represented as "simplicity"), Python never gained an optional stricture like VB's "Option Explicit" to introd... | 3 | 10 | 0 | Usually declaring variables on assignment is considered a best practice in VBScript or JavaScript , for example, although it is allowed.
Why does Python force you to create the variable only when you use it? Since Python is case sensitive can't it cause bugs because you misspelled a variable's name?
How would you av... | What's the pythonic way of declaring variables? | 1 | 0 | 0 | 5,400 |
2,213,595 | 2010-02-06T15:27:00.000 | 1 | 0 | 0 | 0 | python,django-models | 2,213,602 | 3 | true | 1 | 0 | The default primary key will already be a unique monotonic integer (even in SQLite if you don't delete any records), so you can just use that for it. | 1 | 2 | 0 | I can't see any provision for this in the django docs, so how do people go about doing this.
My specific case is this.
I have a shopping cart, each cart instance has an invoice number field, however the invoice number is only generated if the cart goes to a paid status, so not all shopping cart instances will have an i... | how do people normally deal with class variables in django? | 1.2 | 0 | 0 | 680 |
2,214,705 | 2010-02-06T20:59:00.000 | 1 | 0 | 0 | 0 | python,django | 2,214,882 | 2 | false | 1 | 0 | Why would you want to do this? You don't have to use it if you don't want to.
In any case, the back-reference is only a code shortcut - it's exactly equivalent to Car.objects.filter(person_id=person.id). | 1 | 1 | 0 | I know that I can use ForeignKey's related_name argument to control what the back-reference's name will be. But is it possible to avoid creating a back-reference completely?
(e.g., I have in Car a field ForeignKey(Person), and I don't want Person to have an attribute that leads backs to Car.) | Django: Making ForeignKey not create a back-reference | 0.099668 | 0 | 0 | 1,714 |
2,215,461 | 2010-02-07T01:06:00.000 | 12 | 0 | 0 | 0 | python,visualization,graphviz,pydot | 2,215,870 | 3 | false | 0 | 0 | There are several things you can do.
You can set the maximum size of your graph, using 'size' (e.g., size = "4, 8" (inches)). This fixes the size of your final layout. Unlike most other node,edge, and graph parameters in the dot language, 'size' has no default. Also, the default orientation is 'portrait', which i beli... | 1 | 13 | 0 | I am using Graphviz in Python via pydot. The diagram I am making has many clusters of directed graphs. pydot is putting them next to each other horizontally resulting in an image that is very wide. How can I tell it to output images of a maximum width so that I can scroll vertically instead? | Placing nodes vertically in Graphviz using pydot | 1 | 0 | 0 | 11,909 |
2,216,816 | 2010-02-07T13:02:00.000 | 2 | 0 | 1 | 1 | python,swig,disassembly | 2,217,220 | 4 | false | 0 | 0 | Well, after much meddling around, I managed to compile SWIGed libdisasm!
Unfortunately, it seems to crash python on incorrect (and sometimes correct) usage.
How I did it:
I compiled libdisasm.lib using Visual Studio 6, the only thing you need for this is the source code in whichever libdisasm release you use, and std... | 1 | 7 | 0 | I'm trying to create a python script that will disassemble a binary (a Windows exe to be precise) and analyze its code.
I need the ability to take a certain buffer, and extract some sort of struct containing information about the instructions in it.
I've worked with libdisasm in C before, and I found it's interface qui... | Disassembling with python - no easy solution? | 0.099668 | 0 | 0 | 1,298 |
2,218,637 | 2010-02-07T22:30:00.000 | 1 | 0 | 0 | 0 | python,scapy,komodoedit | 2,219,126 | 2 | false | 1 | 0 | Autocomplete in Python is a hit or miss proposition. It varies widely -- some things can be analyzed by Komodo and some can't.
If it won't autocomplete, it's probably because it relies on too many metaclass techniques that seem to baffle Komodo. | 2 | 1 | 0 | I am trying to get scapy to auto complete in komodo edit with no success, has anyone successfully done this?
Thanks,
Python New Comer | Python + Komodo Edit | 0.099668 | 0 | 0 | 654 |
2,218,637 | 2010-02-07T22:30:00.000 | 1 | 0 | 0 | 0 | python,scapy,komodoedit | 2,220,978 | 2 | false | 1 | 0 | If you're in virtualenv or have some tricky python paths you have to add additional import directories in:
Preferences -> Languages -> Python ->
Additional Python Import Directories
Komodo can't understand these things out of the box.
Also make sure you have following option enabled:
Preferences -> Code Intelligen... | 2 | 1 | 0 | I am trying to get scapy to auto complete in komodo edit with no success, has anyone successfully done this?
Thanks,
Python New Comer | Python + Komodo Edit | 0.099668 | 0 | 0 | 654 |
2,219,503 | 2010-02-08T04:01:00.000 | 1 | 0 | 0 | 0 | python,matplotlib,antialiasing | 2,223,165 | 4 | true | 0 | 0 | It seems this is not possible. Some classes such as Line2D have a "set_antialiased" method, but Text lacks this. I suggest you file a feature request on the Sourceforge tracker, and send an email to the matplotlib mailing list mentioning the request. | 1 | 5 | 1 | Is there any way to turn off antialias for all text in a plot, especially the ticklabels? | Matplotlib turn off antialias for text in plot? | 1.2 | 0 | 0 | 2,659 |
2,219,514 | 2010-02-08T04:05:00.000 | 0 | 0 | 0 | 0 | python,wxpython | 2,309,469 | 1 | false | 0 | 1 | Can you put a self contained sample code and we can try to fix that.
Have you tried adding custom items which return correct height for your panel? | 1 | 0 | 0 | Is there a trick to sizing controls for wx.lib.CUstomTreeCtrl? I've been trying to create my own custom controls (just panels with sub-controls in them) and add them as items in my CustomTreeCtrl, but when the tree renders, it's as if the panels aren't expanded to the appropriate size. I can set the panel size manual... | Sizing controls for items in wx.lib.CustomTreeCtrl | 0 | 0 | 0 | 143 |
2,219,998 | 2010-02-08T06:46:00.000 | 2 | 0 | 1 | 0 | python | 2,220,969 | 3 | false | 0 | 0 | Here is another implementation that will recursively print out all subclasses, with indentation.
def findsubclass(baseclass, indent=0):
if indent == 0:
print "Subclasses of %s are:" % baseclass.__name__
indent = indent + 1
for c in baseclass.__subclasses__():
print "-"*indent*4 + ">" + c.__... | 1 | 21 | 0 | Suppose you have a base class A, and this class is reimplemented by B and C.
Suppose also there's a class method A.derived() that tells you which classes are reimplementing A, hence returns [B, C], and if you later on have class D(A): pass or class D(B): pass, now A.derived() returns [B,C,D].
How would you implement t... | How to know all the derived classes of a parent? | 0.132549 | 0 | 0 | 4,946 |
2,220,099 | 2010-02-08T07:18:00.000 | 4 | 0 | 1 | 0 | python,tuples | 2,220,107 | 1 | true | 0 | 0 | Sql query select max(rowid) would return Tuple data like records=(1000,)
You may need to do like numerator / records[0] | 1 | 1 | 0 | TypeError: unsupported operand type(s) for /: 'tuple' and 'tuple'
I'm getting above error , while I fetched a record using query "select max(rowid) from table"
and assigned it to variable and while performing / operation is throws above message.
How to resolve this. | python tuple division | 1.2 | 1 | 0 | 1,106 |
2,220,645 | 2010-02-08T09:48:00.000 | 12 | 0 | 1 | 0 | python,python-stackless | 2,221,057 | 6 | false | 0 | 0 | Stackless Python's main benefit is the support for very lightweight coroutines. CPython doesn't support coroutines natively (although I expect someone to post a generator-based hack in the comments) so Stackless is a clear improvement on CPython when you have a problem that benefits from coroutines.
I think the main a... | 3 | 44 | 0 | There are many questions related to Stackless Python. But none answering this my question, I think (correct me if wrong - please!). There's some buzz about it all the time so I curious to know. What would I use Stackless for? How is it better than CPython?
Yes it has green threads (stackless) that allow quickly create ... | What would I use Stackless Python for? | 1 | 0 | 0 | 11,493 |
2,220,645 | 2010-02-08T09:48:00.000 | 6 | 0 | 1 | 0 | python,python-stackless | 2,279,081 | 6 | false | 0 | 0 | While I've not used Stackless itself, I have used Greenlet for implementing highly-concurrent network applications. Some of the use cases Linden Lab has put it towards are: high-performance smart proxies, a fast system for distributing commands over huge numbers of machines, and an application that does a ton of datab... | 3 | 44 | 0 | There are many questions related to Stackless Python. But none answering this my question, I think (correct me if wrong - please!). There's some buzz about it all the time so I curious to know. What would I use Stackless for? How is it better than CPython?
Yes it has green threads (stackless) that allow quickly create ... | What would I use Stackless Python for? | 1 | 0 | 0 | 11,493 |
2,220,645 | 2010-02-08T09:48:00.000 | 6 | 0 | 1 | 0 | python,python-stackless | 2,220,658 | 6 | false | 0 | 0 | EVEOnline is largely programmed in Stackless Python. They have several dev blogs on the use of it. It seems it is very useful for high performance computing. | 3 | 44 | 0 | There are many questions related to Stackless Python. But none answering this my question, I think (correct me if wrong - please!). There's some buzz about it all the time so I curious to know. What would I use Stackless for? How is it better than CPython?
Yes it has green threads (stackless) that allow quickly create ... | What would I use Stackless Python for? | 1 | 0 | 0 | 11,493 |
2,220,699 | 2010-02-08T09:56:00.000 | 53 | 0 | 1 | 0 | python,dynamic,eval,exec | 14,097,282 | 3 | false | 0 | 0 | exec is for statement and does not return anything.
eval is for expression and returns value of expression.
expression means "something" while statement means "do something". | 1 | 533 | 0 | I've been looking at dynamic evaluation of Python code, and come across the eval() and compile() functions, and the exec statement.
Can someone please explain the difference between eval and exec, and how the different modes of compile() fit in? | What's the difference between eval, exec, and compile? | 1 | 0 | 0 | 254,912 |
2,222,843 | 2010-02-08T15:58:00.000 | 10 | 0 | 1 | 0 | python,syntax,keyword,statements | 2,222,867 | 5 | true | 0 | 0 | No, you cannot add new syntax within a Python program. The only way to alter the language is to edit and recompile the grammar file and supporting C code, to obtain a new altered interpreter, compiler and runtime. | 3 | 6 | 0 | Is there a way to define new statements like def, with, for of my own in Python? Of course, I don't mean to override the existing statements, only create some of my own.
If so, how do I do it? Can you point me to good docs on the subject? | Making your own statements | 1.2 | 0 | 0 | 1,414 |
2,222,843 | 2010-02-08T15:58:00.000 | 1 | 0 | 1 | 0 | python,syntax,keyword,statements | 2,223,039 | 5 | false | 0 | 0 | There are programming languages that let you do this (Tcl, for example), but Python isn't one of those languages. | 3 | 6 | 0 | Is there a way to define new statements like def, with, for of my own in Python? Of course, I don't mean to override the existing statements, only create some of my own.
If so, how do I do it? Can you point me to good docs on the subject? | Making your own statements | 0.039979 | 0 | 0 | 1,414 |
2,222,843 | 2010-02-08T15:58:00.000 | 3 | 0 | 1 | 0 | python,syntax,keyword,statements | 2,222,909 | 5 | false | 0 | 0 | You can't (re)define language keywords without rewriting a compiler/interpreter/etc. What you could do perhaps is write a something like a DSL (domain-specific language) and something that translates your keyword statements into proper python statements, which might be an easier route. | 3 | 6 | 0 | Is there a way to define new statements like def, with, for of my own in Python? Of course, I don't mean to override the existing statements, only create some of my own.
If so, how do I do it? Can you point me to good docs on the subject? | Making your own statements | 0.119427 | 0 | 0 | 1,414 |
2,223,576 | 2010-02-08T17:38:00.000 | 0 | 0 | 0 | 0 | python,design-patterns,statistics,matrix,survey | 2,224,074 | 3 | false | 0 | 0 | On the analysis, if your six questions have been posed in a way that would lead you to believe the answers will be correlated, consider conducting a factor analysis on the raw scores first. Often comparing the factors across regions or customer type has more statistical power than comparing across questions alone. ... | 1 | 1 | 1 | I'm doing an ongoing survey, every quarter. We get people to sign up (where they give extensive demographic info).
Then we get them to answer six short questions with 5 possible values much worse, worse, same, better, much better.
Of course over time we will not get the same participants,, some will drop out and some... | Design pattern for ongoing survey anayisis | 0 | 0 | 0 | 1,157 |
2,223,654 | 2010-02-08T17:49:00.000 | 1 | 0 | 1 | 0 | python,multithreading | 2,223,674 | 4 | false | 0 | 0 | You cannot. Threads can't be killed from outside. The only thing you can do is add a way to ask the thread to exit. Obviously you won't be able to do this if the thread is blocked in some systemcall. | 2 | 1 | 0 | I am creating a thread in my Python app with thread.start_new_thread.
How do I stop it if it hasn't finished in three seconds time? | Stopping a thread in python | 0.049958 | 0 | 0 | 1,913 |
2,223,654 | 2010-02-08T17:49:00.000 | 1 | 0 | 1 | 0 | python,multithreading | 2,223,854 | 4 | true | 0 | 0 | If you really need to do this (e.g. the thread calls code that may hang forever) then consider rewriting your code to spawn a process with the multiprocessing module. You can then kill the process with the Process.terminate() method. You will need 2.6 or later for this, of course. | 2 | 1 | 0 | I am creating a thread in my Python app with thread.start_new_thread.
How do I stop it if it hasn't finished in three seconds time? | Stopping a thread in python | 1.2 | 0 | 0 | 1,913 |
2,223,790 | 2010-02-08T18:12:00.000 | 0 | 0 | 0 | 0 | python,identity,verification | 2,223,896 | 4 | false | 1 | 0 | You should have a look at WS-Trust.
A implementation of that is Windows Identity Foundation. But I'm sure You'll find more. | 2 | 5 | 0 | I am building a Python web application and we will need a user identity verification solution... something to verify the users identity during account registration.
I was wondering if anyone had any experience in integrating such a solution. What vendors/products out there have worked well with you? Any tips?
I don't h... | Online identity verification solution | 0 | 0 | 1 | 747 |
2,223,790 | 2010-02-08T18:12:00.000 | 1 | 0 | 0 | 0 | python,identity,verification | 2,224,273 | 4 | false | 1 | 0 | There are many different ways to implement a verification system, the concept is quite simple but actually building can be a hassle, especially if you are doing it from scratch.
The best way to approach this is to find a framework that handles the aspect of verification. Turbogears and Pylons are both capable of this ... | 2 | 5 | 0 | I am building a Python web application and we will need a user identity verification solution... something to verify the users identity during account registration.
I was wondering if anyone had any experience in integrating such a solution. What vendors/products out there have worked well with you? Any tips?
I don't h... | Online identity verification solution | 0.049958 | 0 | 1 | 747 |
2,224,219 | 2010-02-08T19:20:00.000 | 1 | 0 | 0 | 1 | python,rss,feed | 2,253,676 | 3 | false | 1 | 0 | I found a way to work around this issue, though I am not sure if this is the optimal solution.
Instead of Minidom I have used cElementTree to parse the RSS feed. I process each "item" tag and its children in a seperate task and add these tasks to the task queue.
This has helped me avoid the DeadlineExceededError. I ge... | 1 | 4 | 0 | I am trying to build a GAE app that processes an RSS feed and stores all the data from the feed into Google Datastore. I use Minidom to extract content from the RSS feed. I also tried using Feedparser and BeautifulSoup but they did not work for me.
My app currently parses the feed and saves it in the Google datastore ... | RSS Feed aggregator using Google App Engine - Python | 0.066568 | 0 | 0 | 3,392 |
2,225,456 | 2010-02-08T22:43:00.000 | 5 | 1 | 1 | 0 | python | 2,225,477 | 6 | true | 0 | 0 | Try calling help on your class. | 1 | 1 | 0 | So, I know I can use dir() to get information about class members etc. What I'm looking for is a way to get a nicely formatted report on everything related to a class (the members, docstrings, inheritance hierarchy, etc.).
I want to be able to run this on the command-line so I can explore code and debug better. | Is there a way for me to get detailed formatted information on a Python class? | 1.2 | 0 | 0 | 122 |
2,226,853 | 2010-02-09T05:01:00.000 | 2 | 0 | 0 | 0 | python,audio,pcm | 2,226,925 | 6 | false | 1 | 0 | The duration is simply the number of frames divided by the number of frames per second. From your data this is: 96333 / 44100 = 2.18 seconds. | 2 | 7 | 0 | I'm trying to write a program to display PCM data. I've been very frustrated trying to find a library with the right level of abstraction, but I've found the python wave library and have been using that. However, I'm not sure how to interpret the data.
The wave.getparams function returns (2 channels, 2 bytes, 44100 Hz,... | Interpreting WAV Data | 0.066568 | 0 | 0 | 12,203 |
2,226,853 | 2010-02-09T05:01:00.000 | 2 | 0 | 0 | 0 | python,audio,pcm | 2,226,910 | 6 | false | 1 | 0 | Each sample is 16 bits and there 2 channels, so the frame takes 4 bytes | 2 | 7 | 0 | I'm trying to write a program to display PCM data. I've been very frustrated trying to find a library with the right level of abstraction, but I've found the python wave library and have been using that. However, I'm not sure how to interpret the data.
The wave.getparams function returns (2 channels, 2 bytes, 44100 Hz,... | Interpreting WAV Data | 0.066568 | 0 | 0 | 12,203 |
2,226,913 | 2010-02-09T05:18:00.000 | 0 | 0 | 0 | 1 | python,cross-platform,python-3.x | 2,239,928 | 3 | false | 1 | 0 | Help port Urwid to Python 3! That is most likely more work that just running 2to3 on it, though. | 1 | 0 | 0 | I would like it to run on Linux, OS X, and Windows (XP/Vista/7).
Thanks for any input. | Does anyone know of a Urwid like environment that is cross-platform for Python 3.x? | 0 | 0 | 0 | 322 |
2,226,935 | 2010-02-09T05:24:00.000 | 1 | 0 | 1 | 0 | python,string,integer,format,currency | 2,227,094 | 2 | true | 0 | 0 | Such formatting seems reasonable in some limited uses. But, should 1200000 be formatted as 1.2 million or 1.20 million? And isn't 456 more friendly as $456 (without the cents)?
Adding cents to large precise numbers is common in sweepstakes mailers (Ed McMann says you can win $12,000,000.00).
It seems a careful specif... | 1 | 3 | 0 | I would like to format integers as professional looking currency strings. For example:
1200000 -> $1.2 million
456 -> $456.00
Do you know a good library for this, ideally with localization to handle European formats. | formatting currencies with Python | 1.2 | 0 | 0 | 1,211 |
2,227,141 | 2010-02-09T06:11:00.000 | 5 | 0 | 1 | 0 | python,types,arguments | 2,227,163 | 4 | false | 0 | 0 | If you mean during a certain call of the function, the function itself can get the types of its arguments by calling type on each of them (and will certainly know the type it returns).
If you mean from outside the function, no: the function can be called with arguments of any types -- some such calls will produce error... | 1 | 8 | 0 | I'm learning python. I like to use help() or interinspect.getargspec to get information of functions in shell. But is there anyway I can get the argument/return type of function. | Get types of arguments in python | 0.244919 | 0 | 0 | 8,646 |
2,227,169 | 2010-02-09T06:17:00.000 | 6 | 0 | 1 | 0 | python,thread-safety | 2,227,210 | 4 | false | 0 | 0 | They are thread-safe as long as you don't disable the GIL in C code for the thread. | 1 | 61 | 0 | I would like to know if the Python built-in containers (list, vector, set...) are thread-safe? Or do I need to implement a locking/unlocking environment for my shared variable? | Are Python built-in containers thread-safe? | 1 | 0 | 0 | 35,828 |
2,227,537 | 2010-02-09T07:53:00.000 | 2 | 1 | 1 | 0 | python | 2,227,567 | 4 | false | 0 | 0 | First, this thread should be community wiki.
Second, iterators and generators are pretty basic Python IMHO. I agree with you on decorators and metaclasses. But I'm not a very good programmer, so I probably find this more difficult to wrap my brain around than others.
Third, I would add threading/multiprocessing to the ... | 2 | 6 | 0 | I do basic python programming and now I want to get deep into language features. I have collected/considered the following to be advanced python capabilities and learning them now.
Decorator
Iterator
Generator
Meta Class
Anything else to be added/considered to the above list? | What are features considerd as advanced python? | 0.099668 | 0 | 0 | 3,365 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.