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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,265,062 | 2010-07-16T13:02:00.000 | 0 | 1 | 0 | 0 | python,cookies,selenium,selenium-rc | 3,314,427 | 2 | false | 0 | 0 | Yes, sure. Look at getCookie, getCookieByName and createCookie methods. | 1 | 2 | 0 | I'm running complex tests that create many cookies for different sections of my web site.
Occasionally I have to restart the browser in the middle a long test and since the Selenium server doesn't modify the base Firefox profile, the cookies evaporate.
Is there any way I can save all of the cookies to a Python variable... | How to save and restore all cookies with Selenium RC? | 0 | 0 | 1 | 1,991 |
3,265,232 | 2010-07-16T13:22:00.000 | 0 | 0 | 1 | 0 | python,c,api | 3,265,387 | 2 | false | 0 | 0 | If you don't want to actively check the value of a PyObject in your C code, I think you need to export functions to modify the representation in C. I'm no expert, but I don't think there's an automatic mapping. | 1 | 2 | 0 | I have an embedded python interpreter in my program. I'd like to export a module with values defined in my program and be able to change them from a python script. e.g.
in c:
int x = 1;
in python:
import embedded
embedded.x = 2
in c:
printf("%d",x);
output:
2
Is this possible or do I have to export functions to ... | Changing C variables from python? | 0 | 0 | 0 | 220 |
3,265,357 | 2010-07-16T13:35:00.000 | 497 | 1 | 1 | 0 | java,python,compiler-construction,programming-languages,interpreter | 3,265,602 | 13 | true | 0 | 0 | A compiled language is one where the program, once compiled, is expressed in the instructions of the target machine. For example, an addition "+" operation in your source code could be translated directly to the "ADD" instruction in machine code.
An interpreted language is one where the instructions are not directly ex... | 10 | 312 | 0 | I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications.
Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand ... | Compiled vs. Interpreted Languages | 1.2 | 0 | 0 | 246,100 |
3,265,357 | 2010-07-16T13:35:00.000 | 2 | 1 | 1 | 0 | java,python,compiler-construction,programming-languages,interpreter | 3,265,475 | 13 | false | 0 | 0 | It's rather difficult to give a practical answer because the difference is about the language definition itself. It's possible to build an interpreter for every compiled language, but it's not possible to build an compiler for every interpreted language. It's very much about the formal definition of a language. So that... | 10 | 312 | 0 | I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications.
Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand ... | Compiled vs. Interpreted Languages | 0.03076 | 0 | 0 | 246,100 |
3,265,357 | 2010-07-16T13:35:00.000 | 11 | 1 | 1 | 0 | java,python,compiler-construction,programming-languages,interpreter | 23,750,310 | 13 | false | 0 | 0 | The biggest advantage of interpreted source code over compiled source code is PORTABILITY.
If your source code is compiled, you need to compile a different executable for each type of processor and/or platform that you want your program to run on (e.g. one for Windows x86, one for Windows x64, one for Linux x64, and so... | 10 | 312 | 0 | I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications.
Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand ... | Compiled vs. Interpreted Languages | 1 | 0 | 0 | 246,100 |
3,265,357 | 2010-07-16T13:35:00.000 | 5 | 1 | 1 | 0 | java,python,compiler-construction,programming-languages,interpreter | 3,265,433 | 13 | false | 0 | 0 | First, a clarification, Java is not fully static-compiled and linked in the way C++. It is compiled into bytecode, which is then interpreted by a JVM. The JVM can go and do just-in-time compilation to the native machine language, but doesn't have to do it.
More to the point: I think interactivity is the main practical ... | 10 | 312 | 0 | I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications.
Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand ... | Compiled vs. Interpreted Languages | 0.076772 | 0 | 0 | 246,100 |
3,265,357 | 2010-07-16T13:35:00.000 | 64 | 1 | 1 | 0 | java,python,compiler-construction,programming-languages,interpreter | 3,266,025 | 13 | false | 0 | 0 | Start thinking in terms of a: blast from the past
Once upon a time, long long ago, there lived in the land of computing
interpreters and compilers. All kinds of fuss ensued over the merits of
one over the other. The general opinion at that time was something along the lines of:
Interpreter: Fast to develop (edit and ... | 10 | 312 | 0 | I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications.
Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand ... | Compiled vs. Interpreted Languages | 1 | 0 | 0 | 246,100 |
3,265,357 | 2010-07-16T13:35:00.000 | 103 | 1 | 1 | 0 | java,python,compiler-construction,programming-languages,interpreter | 3,265,680 | 13 | false | 0 | 0 | A language itself is neither compiled nor interpreted, only a specific implementation of a language is. Java is a perfect example. There is a bytecode-based platform (the JVM), a native compiler (gcj) and an interpeter for a superset of Java (bsh). So what is Java now? Bytecode-compiled, native-compiled or interpret... | 10 | 312 | 0 | I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications.
Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand ... | Compiled vs. Interpreted Languages | 1 | 0 | 0 | 246,100 |
3,265,357 | 2010-07-16T13:35:00.000 | 1 | 1 | 1 | 0 | java,python,compiler-construction,programming-languages,interpreter | 45,730,878 | 13 | false | 0 | 0 | Compile is the process of creating an executable program from code written in a compiled programming language. Compiling allows the computer to run and understand the program without the need of the programming software used to create it. When a program is compiled it is often compiled for a specific platform (e.g. IBM... | 10 | 312 | 0 | I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications.
Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand ... | Compiled vs. Interpreted Languages | 0.015383 | 0 | 0 | 246,100 |
3,265,357 | 2010-07-16T13:35:00.000 | 28 | 1 | 1 | 0 | java,python,compiler-construction,programming-languages,interpreter | 3,265,505 | 13 | false | 0 | 0 | The extreme and simple cases:
A compiler will produce a binary executable in the target machine's native executable format. This binary file contains all required resources except for system libraries; it's ready to run with no further preparation and processing and it runs like lightning because the code is the nativ... | 10 | 312 | 0 | I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications.
Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand ... | Compiled vs. Interpreted Languages | 1 | 0 | 0 | 246,100 |
3,265,357 | 2010-07-16T13:35:00.000 | 8 | 1 | 1 | 0 | java,python,compiler-construction,programming-languages,interpreter | 3,265,615 | 13 | false | 0 | 0 | A compiler and an interpreter do the same job: translating a programming language to another pgoramming language, usually closer to the hardware, often direct executable machine code.
Traditionally, "compiled" means that this translation happens all in one go, is done by a developer, and the resulting executable is dis... | 10 | 312 | 0 | I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications.
Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand ... | Compiled vs. Interpreted Languages | 1 | 0 | 0 | 246,100 |
3,265,357 | 2010-07-16T13:35:00.000 | 2 | 1 | 1 | 0 | java,python,compiler-construction,programming-languages,interpreter | 39,558,017 | 13 | false | 0 | 0 | The Python Book © 2015 Imagine Publishing Ltd, simply distunguishes the difference by the following hint mentioned in page 10 as:
An interpreted language such as Python is one where the source code is converted to machine code and then executed each time the program runs. This is different from a compiled language suc... | 10 | 312 | 0 | I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications.
Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand ... | Compiled vs. Interpreted Languages | 0.03076 | 0 | 0 | 246,100 |
3,266,005 | 2010-07-16T14:41:00.000 | 4 | 0 | 1 | 1 | python,macos,installation | 3,267,460 | 3 | true | 0 | 0 | The python.org Python installer for OS X is a meta package with a set of several packages. You can see the packages by clicking on the Customize button during the installation process. The symlinks in /usr/local/bin are installed by the UNIX command-line tools package. For the 2.7 release, that package is no longer se... | 1 | 5 | 0 | The Python 2.7 installer disk image for Mac OS X (python-2.7-macosx10.5.dmg) states:
The installer puts the applications in "Python 2.7" in your Applications folder, command-line tools in /usr/local/bin and the underlying machinery in /Library/Frameworks/Python.framework.
However, after installation there are no Pyth... | Why aren't the Python 2.7 command-line tools located in `/usr/local/bin` on Mac OS X? | 1.2 | 0 | 0 | 7,190 |
3,266,180 | 2010-07-16T15:00:00.000 | 1 | 0 | 1 | 0 | python,iterator,generator | 30,341,833 | 16 | false | 0 | 0 | list(generator()) returns all remaining values for a generator and effectively resets it if it is not looped. | 3 | 159 | 0 | Can I reset an iterator / generator in Python? I am using DictReader and would like to reset it to the beginning of the file. | Can iterators be reset in Python? | 0.012499 | 0 | 0 | 123,812 |
3,266,180 | 2010-07-16T15:00:00.000 | 28 | 0 | 1 | 0 | python,iterator,generator | 3,266,353 | 16 | false | 0 | 0 | No. Python's iterator protocol is very simple, and only provides one single method (.next() or __next__()), and no method to reset an iterator in general.
The common pattern is to instead create a new iterator using the same procedure again.
If you want to "save off" an iterator so that you can go back to its beginning... | 3 | 159 | 0 | Can I reset an iterator / generator in Python? I am using DictReader and would like to reset it to the beginning of the file. | Can iterators be reset in Python? | 1 | 0 | 0 | 123,812 |
3,266,180 | 2010-07-16T15:00:00.000 | 0 | 0 | 1 | 0 | python,iterator,generator | 3,266,198 | 16 | false | 0 | 0 | Only if the underlying type provides a mechanism for doing so (e.g. fp.seek(0)). | 3 | 159 | 0 | Can I reset an iterator / generator in Python? I am using DictReader and would like to reset it to the beginning of the file. | Can iterators be reset in Python? | 0 | 0 | 0 | 123,812 |
3,266,223 | 2010-07-16T15:06:00.000 | 3 | 1 | 1 | 0 | javascript,python | 3,266,895 | 12 | false | 1 | 0 | Python’s a good second language to learn after JavaScript, as they have a reasonable number of similarities, e.g.
they’re both memory-managed
they have similar data structures — JavaScript’s objects and arrays are much like Python’s dictionaries and arrays
they’re both used quite a lot for web-related work — JavaScrip... | 9 | 25 | 0 | I recently learned JavaScript an all of the sudden I hear about Python...
Should I go learn Python or just stick with my basic JavaScript knowledge?
If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on...
Thanks :) | Python over JavaScript? (Facts, please) | 0.049958 | 0 | 0 | 65,637 |
3,266,223 | 2010-07-16T15:06:00.000 | -2 | 1 | 1 | 0 | javascript,python | 3,266,975 | 12 | false | 1 | 0 | If you need to ask, then I would say no since you don't have a need in mind for its usage. | 9 | 25 | 0 | I recently learned JavaScript an all of the sudden I hear about Python...
Should I go learn Python or just stick with my basic JavaScript knowledge?
If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on...
Thanks :) | Python over JavaScript? (Facts, please) | -0.033321 | 0 | 0 | 65,637 |
3,266,223 | 2010-07-16T15:06:00.000 | 0 | 1 | 1 | 0 | javascript,python | 3,266,781 | 12 | false | 1 | 0 | Along with Python generally being server-side and JavaScript client-side, Python was designed to not only be easy to learn, but also easy to read, and to encourage a more productive environment. | 9 | 25 | 0 | I recently learned JavaScript an all of the sudden I hear about Python...
Should I go learn Python or just stick with my basic JavaScript knowledge?
If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on...
Thanks :) | Python over JavaScript? (Facts, please) | 0 | 0 | 0 | 65,637 |
3,266,223 | 2010-07-16T15:06:00.000 | 2 | 1 | 1 | 0 | javascript,python | 3,266,281 | 12 | false | 1 | 0 | JavaScript is usually used as a client-side scripting language - that is, it gets downloaded and executed by your browser. Python, however, is usually not coupled to the web. it can be used as a server-side scripting language, and for scripts and applications of any kind. But it is not a client-side language, and is th... | 9 | 25 | 0 | I recently learned JavaScript an all of the sudden I hear about Python...
Should I go learn Python or just stick with my basic JavaScript knowledge?
If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on...
Thanks :) | Python over JavaScript? (Facts, please) | 0.033321 | 0 | 0 | 65,637 |
3,266,223 | 2010-07-16T15:06:00.000 | 0 | 1 | 1 | 0 | javascript,python | 3,266,294 | 12 | false | 1 | 0 | It depends.
Do you want to program in a language that specifically targets web browsers? Stick with Javascript
Do you want to write... well anything besides for web browsers? Learn Python.
Python is an excellent beginner language that's not just a beginner language. Google uses it, NASA uses it, and many, many other or... | 9 | 25 | 0 | I recently learned JavaScript an all of the sudden I hear about Python...
Should I go learn Python or just stick with my basic JavaScript knowledge?
If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on...
Thanks :) | Python over JavaScript? (Facts, please) | 0 | 0 | 0 | 65,637 |
3,266,223 | 2010-07-16T15:06:00.000 | 1 | 1 | 1 | 0 | javascript,python | 3,266,271 | 12 | false | 1 | 0 | IMO Python may be easier to learn (having taught both to intro classes).
Also, one major annoyance of JavaScript is that in runs in your browser. This inherently makes it much harder to debug problems.
In terms of a production-level language, Python is more of a general purpose programming language, while JavaScript i... | 9 | 25 | 0 | I recently learned JavaScript an all of the sudden I hear about Python...
Should I go learn Python or just stick with my basic JavaScript knowledge?
If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on...
Thanks :) | Python over JavaScript? (Facts, please) | 0.016665 | 0 | 0 | 65,637 |
3,266,223 | 2010-07-16T15:06:00.000 | 15 | 1 | 1 | 0 | javascript,python | 3,266,248 | 12 | false | 1 | 0 | The two are generally used quite differently. Javascript is primarily used as a client side scripting language vs python which is a server based language. So in a website you could use both. But not sure if this is what you were wondering. | 9 | 25 | 0 | I recently learned JavaScript an all of the sudden I hear about Python...
Should I go learn Python or just stick with my basic JavaScript knowledge?
If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on...
Thanks :) | Python over JavaScript? (Facts, please) | 1 | 0 | 0 | 65,637 |
3,266,223 | 2010-07-16T15:06:00.000 | 0 | 1 | 1 | 0 | javascript,python | 3,266,266 | 12 | false | 1 | 0 | JavaScript and Python are both great languages that are geared toward different problems.
JavaScript knowledge is invaluable when dealing with the web, writing web pages, and poking around in html DOM.
Python is a scripting language that is great for a host of things on any machine. | 9 | 25 | 0 | I recently learned JavaScript an all of the sudden I hear about Python...
Should I go learn Python or just stick with my basic JavaScript knowledge?
If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on...
Thanks :) | Python over JavaScript? (Facts, please) | 0 | 0 | 0 | 65,637 |
3,266,223 | 2010-07-16T15:06:00.000 | 1 | 1 | 1 | 0 | javascript,python | 3,266,275 | 12 | false | 1 | 0 | For what purpose? Javascript is king in some circles (web development, for instance).
Javascript and Python are not mutually exclusive. Why not learn both? | 9 | 25 | 0 | I recently learned JavaScript an all of the sudden I hear about Python...
Should I go learn Python or just stick with my basic JavaScript knowledge?
If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on...
Thanks :) | Python over JavaScript? (Facts, please) | 0.016665 | 0 | 0 | 65,637 |
3,267,076 | 2010-07-16T16:40:00.000 | 3 | 0 | 0 | 0 | python,ftp | 3,267,124 | 3 | true | 0 | 0 | Everything depends on the hosting provider you use for your homepage -- do they offer Python among their services, and, if so, what version, and how do you write server-side scripts to use it (is it CGI-only, or...?) -- if not, or the version / deployment options disappoint, what do they allow in terms of giving you sh... | 2 | 1 | 0 | Is it possible to make python run on your homepage? I know, this is a really stupid question but please don't pick on me for my stupidity :)
If it is possible, how? Do you have to upload/install the executing part of Python to you website using FTP? or...?
Edit: Just found out my provider does not support python and th... | Rookie Python-questions | 1.2 | 0 | 0 | 192 |
3,267,076 | 2010-07-16T16:40:00.000 | 0 | 0 | 0 | 0 | python,ftp | 44,422,629 | 3 | false | 0 | 0 | Python is a scripting language, though it is used gracefully for building back end web applications. | 2 | 1 | 0 | Is it possible to make python run on your homepage? I know, this is a really stupid question but please don't pick on me for my stupidity :)
If it is possible, how? Do you have to upload/install the executing part of Python to you website using FTP? or...?
Edit: Just found out my provider does not support python and th... | Rookie Python-questions | 0 | 0 | 0 | 192 |
3,267,081 | 2010-07-16T16:40:00.000 | 1 | 0 | 0 | 0 | python,django,events,mongodb,tracking | 3,267,422 | 3 | false | 1 | 0 | If by click, you mean a click on a link that loads a new page (or performs an AJAX request), then what you aim to do is fairly straightforward. Web servers tend to keep plain-text logs about requests - with information about the user, time/date, referrer, the page requested, etc. You could examine these logs and mine t... | 2 | 7 | 0 | I'm looking into way to track events in a django application (events would generally be clicks tied to a specific unique user id).
These events would essentially contain an event type like "click" and then each click event would be assigned to a unique id (many events can go to one id) and each event would have a data ... | Recommendation for click/event tracking mechanisms (python, django, celery, mongo etc) | 0.066568 | 0 | 0 | 3,366 |
3,267,081 | 2010-07-16T16:40:00.000 | 3 | 0 | 0 | 0 | python,django,events,mongodb,tracking | 3,267,157 | 3 | false | 1 | 0 | I am not familiar with the pre-packaged solutions you mention. Were I to design this from scratch, I'd have a simple JS collecting info on clicks and posting it back to the server via Ajax (using whatever JS framework you're already using), and on the server side I'd simply append that info to a log file for later "of... | 2 | 7 | 0 | I'm looking into way to track events in a django application (events would generally be clicks tied to a specific unique user id).
These events would essentially contain an event type like "click" and then each click event would be assigned to a unique id (many events can go to one id) and each event would have a data ... | Recommendation for click/event tracking mechanisms (python, django, celery, mongo etc) | 0.197375 | 0 | 0 | 3,366 |
3,267,580 | 2010-07-16T17:54:00.000 | 2 | 0 | 0 | 0 | python,mysql,sqlalchemy,large-query | 3,271,153 | 1 | true | 0 | 0 | I had a similar problem recently and used the - not very elegant - work-around:
First I parsed my.cnf for a value for max_allow_packets, if I can't find it, the maximum is set to a default value.
All data items are stored in a list.
Next, for each data item I count the approximate byte length (with strings, it's the l... | 1 | 1 | 0 | Due to the nature of my application, I need to support fast inserts of large volumes of data into the database. Using executemany() increases performance, but there's a caveat. For example, MySQL has a configuration parameter called max_allowed_packet, and if the total size of my insert queries exceeds its value, MySQL... | SQLAlchemy and max_allowed_packet problem | 1.2 | 1 | 0 | 2,103 |
3,267,830 | 2010-07-16T18:31:00.000 | 3 | 0 | 0 | 1 | python,google-app-engine | 3,267,906 | 3 | true | 1 | 0 | One alternative would be to have a map of symbolic names to URLs, that way you could redirect to the mapped URL - you could then update your URLs with impunity.
Or if you'd rather just execute the code from another handler, I don't know why you couldn't just make a method call - worst case, you could extract a common m... | 1 | 3 | 0 | I just started with Google App Engine using python and I was following a tutorial and writing my own little app to get familiar the webapp framework. Now I just noticed the tutorial does the following self.redirect('/'). So that got me wondering: is there a way to redirect to a handler instead of a hardcoded path? Thou... | Google App Engine: Redirect to RequestHandler | 1.2 | 0 | 0 | 1,160 |
3,267,981 | 2010-07-16T18:53:00.000 | 4 | 0 | 0 | 0 | python,gtk,svg | 3,268,630 | 2 | true | 0 | 0 | solved it in a different way:
simply created a subpixbuf with the coodinates:
cropped_buffer=pixbuf.subpixbuf(x,y,width,height) | 1 | 3 | 0 | I've got a gtk - pixbuf out of an svg and want to crop this to a specific size at specific coordinates.
Anyone has an easy possible solution for that ? | How to crop gtk pixbufs | 1.2 | 0 | 0 | 1,335 |
3,268,106 | 2010-07-16T19:14:00.000 | 0 | 0 | 1 | 0 | python,user-interface,wxpython,objectlistview | 3,268,404 | 2 | true | 0 | 1 | I seem to have fixed it by using the FastObjectListView class instead... | 1 | 0 | 0 | When I update my objectListView list it flickers/flashes white, is this normal behaviour or can it be prevented. The list gets updated around every 1-5 seconds using the AddObject method if that makes any difference. | ObjectListView Flickers/Flashes when adding a new list object | 1.2 | 0 | 0 | 463 |
3,268,600 | 2010-07-16T20:24:00.000 | 1 | 1 | 0 | 0 | python,gtk,svg,rsvg | 3,948,330 | 1 | true | 0 | 0 | I found out to simply use RSVG::Handle::get_dimensions_sub(id) | 1 | 0 | 0 | Hi I want to load the groups of a svg-file into several gtk pixbuffs/subpixbufs
therefore I need the coordinates and width and height of them
I'm currently just using rsvg and gtk
is it possible to get those information with that modules ? Or do I need another module to read out that data from the svg-file?
thanks alo... | Get the coords and height/width of a svg group into python | 1.2 | 0 | 0 | 387 |
3,269,019 | 2010-07-16T21:35:00.000 | 1 | 0 | 0 | 0 | python,user-interface,listview,wxpython,background-color | 3,269,998 | 2 | true | 0 | 1 | You could do it with a wx.Grid or you might look at the new UltimateListCtrl, which is a pure python widget. You can hack it if it doesn't do what you want it to! | 1 | 0 | 0 | Is there a wxpython list widget that displays alternating row colours even when empty the list is empty? or Is there even one that will display a background colour(other than white) when it is empty? | Is there a wxpython list widget that displays alternating row colours even when the list is empty? | 1.2 | 0 | 0 | 843 |
3,269,200 | 2010-07-16T22:10:00.000 | 1 | 1 | 1 | 0 | python,aac | 12,114,371 | 2 | false | 0 | 0 | Try using the command exiftool. Of course, if you're using linux. This command shows all the properties of audio files, video and pictures. Exiftool installed, simply use the command:
exiftoll your_file_name.extension
eg
exiftoll music.mp3 | 1 | 1 | 0 | What's the easiest Python library to use to extract properties from an AAC audio file (.m4a)?
Specifically, I'd like to extract the following properties:
Sample rate
Channel count (mono or stereo)
Length (in seconds) | Extract AAC audio properties using Python? | 0.099668 | 0 | 0 | 1,597 |
3,269,339 | 2010-07-16T22:44:00.000 | 2 | 1 | 0 | 0 | .net,ironpython,monodevelop,ubuntu-10.04 | 3,284,054 | 1 | true | 0 | 0 | I'm not aware of one. The is a Python addin for MD, but not an IronPython addin.
It wouldn't be hard to write an addin for MD - if anyone's interested, ask on the MonoDevelop mailing list and I can give some pointers to get started. | 1 | 3 | 0 | I have installed Iron Python on my Ubuntu 10.4 and Mono Develop, but there is no interaction between them. Is there any Iron Python plug-in for Monodevelop as in VS? If not, which is the best Iron-Python IDE for Ubuntu or Debian? | Is there any Iron Python plug-in for Monodevelop? | 1.2 | 0 | 0 | 1,522 |
3,269,942 | 2010-07-17T02:05:00.000 | 0 | 0 | 0 | 0 | python,pygtk | 3,271,663 | 1 | true | 0 | 1 | You can probably use gtk.TextIter.forward_to_tag_toggle(). I.e. loop over all tags you have and for each tags scan the buffer for the position where it is toggled. | 1 | 1 | 0 | So I am trying to write a rich text editor in PyGTK, and originally used the older, third party script InteractivePangoBuffer from Gourmet to do this. While it worked alright, there were still plenty of bugs with it which made it frustrating to use at times, so I decided to write my own utilizing text tags. I have got ... | Saving gtk.TextTags to file? | 1.2 | 0 | 0 | 276 |
3,270,464 | 2010-07-17T06:11:00.000 | 2 | 1 | 0 | 1 | php,python,perl,compiler-construction,scripting-language | 3,270,788 | 8 | false | 0 | 0 | There are 3 options of encrypting Perl code:
Use PAR to create executable file with PAR::Filter::Obfuscate or PAR::Filter::Crypto
Use Filter::Crypto::CryptFile (will require some modules installed on target OS)
Turn into module and encrypt into Module::Crypt.
Also you can try B::C - it was removed from core Perl dist... | 4 | 2 | 0 | I am working on a project that requires reading text files, extracting data from them, and then generating reports (text files). Since there are a lot of string parsing, I decided to do it in Perl or Python or PHP (preference in that order). But I don't want to expose the source code to my client. Is there any good com... | Good compilers for compiling perl/python/php scripts into linux executables? | 0.049958 | 0 | 0 | 2,889 |
3,270,464 | 2010-07-17T06:11:00.000 | 0 | 1 | 0 | 1 | php,python,perl,compiler-construction,scripting-language | 3,270,490 | 8 | false | 0 | 0 | For Python You can call your code and give the *.pyc file to the client. | 4 | 2 | 0 | I am working on a project that requires reading text files, extracting data from them, and then generating reports (text files). Since there are a lot of string parsing, I decided to do it in Perl or Python or PHP (preference in that order). But I don't want to expose the source code to my client. Is there any good com... | Good compilers for compiling perl/python/php scripts into linux executables? | 0 | 0 | 0 | 2,889 |
3,270,464 | 2010-07-17T06:11:00.000 | 4 | 1 | 0 | 1 | php,python,perl,compiler-construction,scripting-language | 3,270,852 | 8 | false | 0 | 0 | I'm sorry, it's simply not worth spending your time on. For any language you choose (from among the ones you listed), for any compiler/obfuscator someone chooses to come up with, I promise you I can get readable source code out of it (within an hour if it's Perl; longer if it's Python or PHP simply because I'm less acq... | 4 | 2 | 0 | I am working on a project that requires reading text files, extracting data from them, and then generating reports (text files). Since there are a lot of string parsing, I decided to do it in Perl or Python or PHP (preference in that order). But I don't want to expose the source code to my client. Is there any good com... | Good compilers for compiling perl/python/php scripts into linux executables? | 0.099668 | 0 | 0 | 2,889 |
3,270,464 | 2010-07-17T06:11:00.000 | 0 | 1 | 0 | 1 | php,python,perl,compiler-construction,scripting-language | 3,270,518 | 8 | false | 0 | 0 | For linux an executable is something which has +x set, so there's no need to compile scripts. To hide your sourcecode you could use an obfuscator. This makes your sourcecode unreadable. | 4 | 2 | 0 | I am working on a project that requires reading text files, extracting data from them, and then generating reports (text files). Since there are a lot of string parsing, I decided to do it in Perl or Python or PHP (preference in that order). But I don't want to expose the source code to my client. Is there any good com... | Good compilers for compiling perl/python/php scripts into linux executables? | 0 | 0 | 0 | 2,889 |
3,270,704 | 2010-07-17T08:01:00.000 | 0 | 0 | 0 | 0 | python,gtk,rsvg | 3,314,937 | 1 | false | 0 | 0 | There's nothing built-in but it's fairly simple to code it (walk over pixels, find the transparent ones). Unfortunately walking over pixels in python is probably slow. | 1 | 0 | 0 | I am currently using rsvg in Python to separate Svggroups.
I got it working so that rsvg loads a single group ... alas all the transparent space around that still remains.
Is there a gtk functionallity to cut away all this space?
Thanks for all the answers! | Is it possible to cut away transparent areas of Gtk-pixbuf? | 0 | 0 | 0 | 154 |
3,270,952 | 2010-07-17T09:38:00.000 | 2 | 0 | 0 | 0 | python,django,sqlite | 3,275,298 | 6 | false | 1 | 0 | You asked what the create(**dict(zip(fields, row))) line did.
I don't know how to reply directly to your comment, so I'll try to answer it here.
zip takes multiple lists as args and returns a list of their correspond elements as tuples.
zip(list1, list2) => [(list1[0], list2[0]), (list1[1], list2[1]), .... ]
dict take... | 1 | 13 | 0 | I am trying to setup a website in django which allows the user to send queries to a database containing information about their representatives in the European Parliament. I have the data in a comma seperated .txt file with the following format:
Parliament, Name, Country, Party_Group, National_Party, Position
7, Mart... | Populating a SQLite3 database from a .txt file with Python | 0.066568 | 1 | 0 | 7,034 |
3,271,590 | 2010-07-17T13:10:00.000 | 7 | 0 | 1 | 1 | python,windows,virtualenv | 3,274,878 | 7 | false | 0 | 0 | easy_install is able to install .exe packages as long as they were built using distutils' bdist_wininst target, which covers many popular packages. However, there are many others that aren't (wxPython is one that I've struggled with) | 2 | 125 | 0 | Virtualenv is great: it lets me keep a number of distinct Python installations so that different projects' dependencies aren't all thrown together into a common pile.
But if I want to install a package on Windows that's packaged as a .exe installer, how can I direct it to install into the virtualenv? For example, I ha... | Can I install Python windows packages into virtualenvs? | 1 | 0 | 0 | 32,413 |
3,271,590 | 2010-07-17T13:10:00.000 | 0 | 0 | 1 | 1 | python,windows,virtualenv | 72,302,027 | 7 | false | 0 | 0 | You should type path of your file and write 'python ' before it.
Than it will run your python script without any virtual environment.
Thanks. | 2 | 125 | 0 | Virtualenv is great: it lets me keep a number of distinct Python installations so that different projects' dependencies aren't all thrown together into a common pile.
But if I want to install a package on Windows that's packaged as a .exe installer, how can I direct it to install into the virtualenv? For example, I ha... | Can I install Python windows packages into virtualenvs? | 0 | 0 | 0 | 32,413 |
3,271,813 | 2010-07-17T14:13:00.000 | 7 | 0 | 1 | 0 | python | 3,271,829 | 3 | true | 0 | 0 | It takes time to wrap a raw integer into a Python int. | 2 | 9 | 0 | I'm learning python recently, and is doing many practice with the language.
One thing I found interesting is that, when I read from an array, it's almost half of the time slower than list. Does somebody know why?
here's my code:
from timeit import Timer
import array
t = 10000
l = range(t)
a = array.array('i', l)
def ... | In python, why is reading from an array slower than reading from list? | 1.2 | 0 | 0 | 1,763 |
3,271,813 | 2010-07-17T14:13:00.000 | 1 | 0 | 1 | 0 | python | 3,271,892 | 3 | false | 0 | 0 | The Python lists really resemble some ways normal arrays, they are not Lisp lists, but they have fast random access. | 2 | 9 | 0 | I'm learning python recently, and is doing many practice with the language.
One thing I found interesting is that, when I read from an array, it's almost half of the time slower than list. Does somebody know why?
here's my code:
from timeit import Timer
import array
t = 10000
l = range(t)
a = array.array('i', l)
def ... | In python, why is reading from an array slower than reading from list? | 0.066568 | 0 | 0 | 1,763 |
3,274,334 | 2010-07-18T04:39:00.000 | 3 | 0 | 0 | 0 | python,linux | 3,274,680 | 7 | false | 0 | 0 | Install inotify-tools and write a simple shell script to watch a file. | 1 | 14 | 0 | I would like to invoke my chrome or firefox browser when a file that I specify is modified. How could I "watch" that file to do something when it gets modified?
Programmatically it seems the steps are.. basically set a never ending interval every second or so and cache the initial modification date, then compare the da... | How can I "watch" a file for modification / change? | 0.085505 | 0 | 1 | 27,121 |
3,274,350 | 2010-07-18T04:46:00.000 | 1 | 0 | 1 | 0 | python,oop | 3,274,356 | 2 | false | 0 | 0 | If you mean the attribute, then make it a read-only property. If you mean the list itself, then use a tuple instead since they're immutable. | 1 | 3 | 0 | i have self.some_field = [] in my class
Im enquiring is there a way to make this list read-only like a property? | How to make a class field [list] read-only in python? | 0.099668 | 0 | 0 | 1,395 |
3,275,293 | 2010-07-18T11:17:00.000 | 6 | 0 | 0 | 0 | python,pyqt,pyqt4,py2exe | 3,275,651 | 4 | false | 0 | 1 | I doubt this has an effect on py2exe, but it's related to the question. To run a python GUI on windows without the terminal, use pythonw.exe instead of python.exe. This should happen automatically if you end the filename with ".pyw". | 1 | 20 | 0 | I have a Python program uses Qt (PyQt4 in fact) and when I launch it from its main.py, I get a console window and the GUI window (on Windows, of course).
Then I compile my program with py2exe and main.exe is successfully created. However, if I run main.exe (this is what users of program will do) console window of Pytho... | Hiding console window of Python GUI app with py2exe | 1 | 0 | 0 | 19,469 |
3,276,230 | 2010-07-18T16:07:00.000 | 7 | 0 | 1 | 0 | python,database,data-storage | 3,276,336 | 7 | true | 0 | 0 | It is never safe to save your database in a text format (or using pickle or whatever). There is a risk that problems while saving the data may cause corruption. Not to mention risks with your data being stolen.
As your dataset grows there may be a performance hit.
have a look at sqlite (or sqlite3) which is small and e... | 1 | 4 | 0 | I need to store basic data of customer's and cars that they bought and payment schedule of these cars. These data come from GUI, written in Python. I don't have enough experience to use a database system like sql, so I want to store my data in a file as plain text. And it doesn't have to be online.
To be able to searc... | Basic data storage with Python | 1.2 | 0 | 0 | 29,938 |
3,277,307 | 2010-07-18T21:22:00.000 | 2 | 0 | 0 | 0 | python,django | 3,278,231 | 2 | false | 1 | 0 | Store whatever variables you would want in the session. Then you can access it through the request. | 1 | 0 | 0 | Is it possible to pass more than 1 argument to a context processor in Django? In other words, in addition to the HttpRequest object, I would like to pass 1 or more additional argument? | Possible to pass more than 1 argument to a context processor in Django? | 0.197375 | 0 | 0 | 1,249 |
3,277,376 | 2010-07-18T21:42:00.000 | 0 | 1 | 0 | 0 | c++,python | 3,277,408 | 4 | false | 0 | 1 | Python will also have the advantage/disadvantage (depending on what you want) that the source code must be open. (I think delivering only the .pyc file is not really an option as the Python bytecode format is changing in every release.)
Otherwise, let's say you are selling to people who don't really know what the diffe... | 3 | 3 | 0 | I'm working on a plugin for some software that I'm planning on selling someday. The software I'm making it for has both a C++ SDK and a Python SDK.
The C++ SDK documentation appears incomplete in certain areas and isn't documented that well.
The Python SDK docs appear more complete and in general are much easier to wor... | Is Python-based software considered less-professional than C++/compiled software? | 0 | 0 | 0 | 815 |
3,277,376 | 2010-07-18T21:42:00.000 | 6 | 1 | 0 | 0 | c++,python | 3,277,400 | 4 | true | 0 | 1 | A lot of programmers out there don't even considered writing Python to be real "programming".
A lot of "programmers" out there are incompetent, too.
Do you think that potential customers might say "Why would I pay money for a measly little Python script?"?
I'm sure it depends on the type of software, but I can tell ... | 3 | 3 | 0 | I'm working on a plugin for some software that I'm planning on selling someday. The software I'm making it for has both a C++ SDK and a Python SDK.
The C++ SDK documentation appears incomplete in certain areas and isn't documented that well.
The Python SDK docs appear more complete and in general are much easier to wor... | Is Python-based software considered less-professional than C++/compiled software? | 1.2 | 0 | 0 | 815 |
3,277,376 | 2010-07-18T21:42:00.000 | 0 | 1 | 0 | 0 | c++,python | 3,277,403 | 4 | false | 0 | 1 | I think it doesn't matter. It all come down to 'use the right tool for the right job'. Your primary goal should be to make the best plugin you can. So if you feel more at ease with Python use that. It will probably take you less time to write. The client probably doesn't mind it and just want the most stable, reliable,... | 3 | 3 | 0 | I'm working on a plugin for some software that I'm planning on selling someday. The software I'm making it for has both a C++ SDK and a Python SDK.
The C++ SDK documentation appears incomplete in certain areas and isn't documented that well.
The Python SDK docs appear more complete and in general are much easier to wor... | Is Python-based software considered less-professional than C++/compiled software? | 0 | 0 | 0 | 815 |
3,277,946 | 2010-07-19T01:27:00.000 | 2 | 0 | 0 | 1 | python,macos,subprocess | 3,277,996 | 2 | false | 0 | 0 | You can try running IDLE with the "-n" option. From the IDLE help:
Running without a subprocess:
If IDLE is started with the -n command line switch it will run in a
single process and will not create the subprocess which runs the RPC
Python execution server. This can be useful if Python cannot create
... | 1 | 3 | 0 | I'm new to python programming, and want to try to edit scripts in IDLE instead of the OSX command line. However, when I try to start it, it gives me the error "Idle Subprocess didn't make a connection. Either Idle can't start a subprocess or personal firewall software is blocking the connection." I don't have a firewal... | No IDLE Subprocess connection | 0.197375 | 0 | 1 | 13,342 |
3,278,477 | 2010-07-19T04:35:00.000 | 0 | 0 | 1 | 0 | php,jquery,python,epub | 3,278,535 | 5 | false | 1 | 0 | Does it have to be ePub format?
Here in Australia the iBookstore is basically completely bare, except for books out of copyright (The illiad, Bible etc) My understanding is that they are still negotiating with the publishers.
The guy at the Apple store said to me, oh thats no problem, download the free Kindle app and j... | 1 | 10 | 0 | I purchased an iPad hoping to read books on it that've been aging on my desk for months, but it turned out that there're NO programming books available on iBookstore.
Are there any (Python, PHP, jQuery) books available in ePub format? Conversion from pdf to epub is not an option because the formatting is lost in the p... | Programming books in ePub format | 0 | 0 | 0 | 10,584 |
3,278,567 | 2010-07-19T05:05:00.000 | 2 | 1 | 1 | 0 | python,project,fuse | 3,396,712 | 5 | false | 0 | 0 | What about a versioned file-system? It has always seemed like a cool idea since I read about the implementation in Plan 9. You wouldn't have to write the versioning part as you could use an off-the-shelf version control like git. The contents of the repository could be exposed as a file hierarchy, older versions could ... | 5 | 2 | 0 | I was thinking of improving my python and just recently read an article about the python-fuse library. I'm always interested about filesystem stuff so I thought this would be a good library to hack on.
What I can't come up with is an idea of what I should implement with this. Do you guys have any suggestions or ideas ... | interesting project that I can implement with fuse-python | 0.07983 | 0 | 0 | 461 |
3,278,567 | 2010-07-19T05:05:00.000 | 0 | 1 | 1 | 0 | python,project,fuse | 3,278,603 | 5 | false | 0 | 0 | I do not know if python is appropriate, but maybe you can provide URL handlers for fuse in Firefox.
for example: sshfs://host/path would allow to explore remote ssh host via Firefox browser. | 5 | 2 | 0 | I was thinking of improving my python and just recently read an article about the python-fuse library. I'm always interested about filesystem stuff so I thought this would be a good library to hack on.
What I can't come up with is an idea of what I should implement with this. Do you guys have any suggestions or ideas ... | interesting project that I can implement with fuse-python | 0 | 0 | 0 | 461 |
3,278,567 | 2010-07-19T05:05:00.000 | 0 | 1 | 1 | 0 | python,project,fuse | 3,278,606 | 5 | false | 0 | 0 | Maybe a filesystem where files behave like directories, so you can store files in files.
Or a filesystem where you can store files with the same name in 1 directory. | 5 | 2 | 0 | I was thinking of improving my python and just recently read an article about the python-fuse library. I'm always interested about filesystem stuff so I thought this would be a good library to hack on.
What I can't come up with is an idea of what I should implement with this. Do you guys have any suggestions or ideas ... | interesting project that I can implement with fuse-python | 0 | 0 | 0 | 461 |
3,278,567 | 2010-07-19T05:05:00.000 | 1 | 1 | 1 | 0 | python,project,fuse | 3,289,412 | 5 | false | 0 | 0 | Mounting an xml file as a filesystem, where elements are directories, and their contents is stored as a plain file. The attributes are stored in an "attributes" file as newline separated name: value pairs in each directory.
This would allow XML to be modified using the common shell tools. (sed, grep, mkdir, rm, rmdir,... | 5 | 2 | 0 | I was thinking of improving my python and just recently read an article about the python-fuse library. I'm always interested about filesystem stuff so I thought this would be a good library to hack on.
What I can't come up with is an idea of what I should implement with this. Do you guys have any suggestions or ideas ... | interesting project that I can implement with fuse-python | 0.039979 | 0 | 0 | 461 |
3,278,567 | 2010-07-19T05:05:00.000 | 2 | 1 | 1 | 0 | python,project,fuse | 3,278,611 | 5 | false | 0 | 0 | The typical 'cool' things with FUSE are exposing in a filesystem interface things that aren't files, and usually are stored somewhere else.
Existing examples: Gmail filesystem, SSH filesystem.
Non existing (that I know of) examples: a Twitter filesystem, that shows tweets as files. Or a Stack Overflow filesystem, quest... | 5 | 2 | 0 | I was thinking of improving my python and just recently read an article about the python-fuse library. I'm always interested about filesystem stuff so I thought this would be a good library to hack on.
What I can't come up with is an idea of what I should implement with this. Do you guys have any suggestions or ideas ... | interesting project that I can implement with fuse-python | 0.07983 | 0 | 0 | 461 |
3,278,831 | 2010-07-19T06:19:00.000 | 0 | 0 | 1 | 0 | python,dictionary | 3,278,897 | 3 | false | 0 | 0 | dictionary.keys() returns a list of keys
you can then use if (3,4) in d.keys() | 1 | 1 | 0 | I need to check if a particular key is present in some dictionary. I can use has_key ?? Is there any other method to compare the items of the list to the key of dictionary.
I have a list like...[(3,4),(4,5)..]
I need to check if the (3,4) is there in the dictionary. | comparison between the elements of list with keys of dictionary | 0 | 0 | 0 | 1,819 |
3,279,436 | 2010-07-19T08:22:00.000 | 0 | 0 | 0 | 0 | python,pygame,coordinates,geometry-surface | 3,279,476 | 3 | false | 0 | 1 | There is no way to move the origin of a surface from 0,0.
Implement your own drawing class which transforms all the coordinates passed in into the space of the surface. | 1 | 2 | 0 | What would be the best way to use negative coordinates in pygame?
At the moment I have a surface that is 1.5 times the original surface then everything that needs to be drawn is shifted up by a certain amount (to ensure the negative coordinates become positive) and drawn.
Is there an easier/alternate way of doing this? | Negative coordinates in pygame | 0 | 0 | 0 | 2,454 |
3,280,391 | 2010-07-19T10:52:00.000 | 0 | 1 | 0 | 0 | python,urllib2,bandwidth | 3,280,448 | 2 | false | 0 | 0 | You could download an empty file to measure the delay. You measure more the only the network delay, but the difference should be too big I expect. | 1 | 4 | 0 | I want to make a python script that tests the bandwidth of a connection. I am thinking of downloading/uploading a file of a known size using urllib2, and measuring the time it takes to perform this task. I would also like to measure the delay to a given IP address, such as is given by pinging the IP. Is this possible u... | Bandwidth test, delay test using urllib2 | 0 | 0 | 1 | 1,534 |
3,281,107 | 2010-07-19T12:46:00.000 | 1 | 1 | 0 | 0 | python,linux,signals,kill | 3,281,123 | 4 | false | 0 | 0 | If you do not want to execute the kill command with the correct permissions, you can send any other signal to the other script. It is then the other scripts' responsibility to terminate. You cannot force it, unless you have the permissions to do so.
This can happen with a network connection, or a 'kill' file whose ex... | 3 | 3 | 0 | On a linux box I've got a python script that's always started from predefined user. It may take a while for it to finish so I want to allow other users to stop it from the web.
Using kill fails with Operation not permitted.
Can I somehow modify my long running python script so that it'll recive a signal from another u... | terminate script of another user | 0.049958 | 0 | 1 | 332 |
3,281,107 | 2010-07-19T12:46:00.000 | 1 | 1 | 0 | 0 | python,linux,signals,kill | 3,281,132 | 4 | false | 0 | 0 | Off the top of my head, one solution would be threading the script and waiting for a kill signal via some form or another. Or rather than threading, you could have a file that the script checks every N times through a loop - then you just write a kill signal to that file (which of course has write permissions by the we... | 3 | 3 | 0 | On a linux box I've got a python script that's always started from predefined user. It may take a while for it to finish so I want to allow other users to stop it from the web.
Using kill fails with Operation not permitted.
Can I somehow modify my long running python script so that it'll recive a signal from another u... | terminate script of another user | 0.049958 | 0 | 1 | 332 |
3,281,107 | 2010-07-19T12:46:00.000 | 0 | 1 | 0 | 0 | python,linux,signals,kill | 3,281,121 | 4 | false | 0 | 0 | You could use sudo to perform the kill command as root, but that is horrible practice.
How about having the long-running script check some condition every x seconds, for example the existence of a file like /tmp/stop-xyz.txt? If that file is found, the script terminates itself immediately.
(Or any other means of inte... | 3 | 3 | 0 | On a linux box I've got a python script that's always started from predefined user. It may take a while for it to finish so I want to allow other users to stop it from the web.
Using kill fails with Operation not permitted.
Can I somehow modify my long running python script so that it'll recive a signal from another u... | terminate script of another user | 0 | 0 | 1 | 332 |
3,282,053 | 2010-07-19T14:37:00.000 | 0 | 0 | 0 | 1 | python,cocoa,xcode,pyobjc | 4,708,176 | 2 | false | 0 | 0 | XCode has so called SDKs which can be used to target earlier Max OS X versions from a recent one.
Currently installed SDKs can be found in /Developer/SDKs. Additional SDKs may be installed from an XCode DVD.
In a project created with XCode, SDK can be selected the following way. Open Get info of a target, find Base SDK... | 1 | 6 | 0 | I'm trying to deploy on 10.5 a PyObjC (or Cocoa-Python) application developed on Xcode 3.2.X (Snow Leopard) which runs perfectly fine on 10.6 systems.
The application doesn't launch on 10.5;it crashes at launch giving this error message (found on Crash Report):
Dyld Error Message:
Library not loaded: /System/Libr... | Compiling a PyObjC application for 10.5 (Leopard) into xcode 10.6 (Snow Leopard) | 0 | 0 | 0 | 400 |
3,283,178 | 2010-07-19T16:58:00.000 | 2 | 0 | 1 | 0 | python,self | 3,283,196 | 6 | false | 0 | 0 | self is this, just you have to explicitly pass it and explicitly use it to refer to class methods/properties.
It isn't optional in class methods. You will get a TypeError if you try to define a classmethod without at least one argument (i.e., the self parameter).
However, you can call it something other than self, but ... | 3 | 6 | 0 | From what I read/understand, the 'self' parameter is similiar to 'this'.
Is that true?
If its optional, what would you do if self wasnt' passed into the method? | python and using 'self' in methods | 0.066568 | 0 | 0 | 1,730 |
3,283,178 | 2010-07-19T16:58:00.000 | 5 | 0 | 1 | 0 | python,self | 3,283,192 | 6 | false | 0 | 0 | Yes, it's used in similar ways. Note that it's a positional parameter and you can call it what you want; however there is a strong convention to call it self (not this or anything else). Some positional parameter must be there for a usable instance method; it is not optional. | 3 | 6 | 0 | From what I read/understand, the 'self' parameter is similiar to 'this'.
Is that true?
If its optional, what would you do if self wasnt' passed into the method? | python and using 'self' in methods | 0.16514 | 0 | 0 | 1,730 |
3,283,178 | 2010-07-19T16:58:00.000 | 0 | 0 | 1 | 0 | python,self | 3,283,198 | 6 | false | 0 | 0 | self refers to the object on which the method was called, much like this in C++. But it is important that self is merely a convention, you can name it as you like and pass instances of subclasses. | 3 | 6 | 0 | From what I read/understand, the 'self' parameter is similiar to 'this'.
Is that true?
If its optional, what would you do if self wasnt' passed into the method? | python and using 'self' in methods | 0 | 0 | 0 | 1,730 |
3,284,289 | 2010-07-19T19:24:00.000 | 0 | 0 | 0 | 0 | python,xml | 3,284,880 | 7 | false | 1 | 0 | If the document is endless why not add end tag (of main element) manually before opening it in parser? I don't know Python but why not add </endtag> to string? | 1 | 5 | 0 | I am working on a application, and my job just is to develop a sample Python interface for the application. The application can provide XML-based document, I can get the document via HTTP Get method, but the problem is the XML-based document is endless which means there will be no end element. I know that the document... | python handle endless XML | 0 | 0 | 1 | 1,933 |
3,284,779 | 2010-07-19T20:27:00.000 | 1 | 0 | 0 | 0 | python,tkinter | 3,284,846 | 2 | false | 0 | 1 | No. There is no way to do this. | 1 | 0 | 0 | Is there any way to run a python script that utilizes TKinter on a web page such that a user could run the script and interact with the TK windows without having to download the script or have the appropriate python interpreter? | Any way to run python TK scripts on web page? | 0.099668 | 0 | 0 | 944 |
3,285,166 | 2010-07-19T21:16:00.000 | 0 | 0 | 1 | 0 | python,ide | 3,286,180 | 9 | false | 0 | 0 | WingIDE if you can fork out some cash will do what you want all bundled up and with little to no configuration effort.
Otherwise Eclipse with Aptana's pydev is free, and does exactly that, plus a lot more (ctrl+click pretty much anything for redirection and a lot of other useful things like pyc removal etc.).
Navigatio... | 3 | 3 | 0 | I'm trying to use textmate, but I find it hard to navigate a project with it.
I admit I probably just don't know the the IDE well enough.
Is it possible to highlight a class or method and jump to its definition? | Python IDE that you can highlight a method/class and jump to its definition | 0 | 0 | 0 | 2,656 |
3,285,166 | 2010-07-19T21:16:00.000 | 0 | 0 | 1 | 0 | python,ide | 3,287,352 | 9 | false | 0 | 0 | I'm not sure about what functionality is available in textmate but would a simple search work? i.e. Ctrl+F with the query "def function" including the def part so you find the definition instead of a call? | 3 | 3 | 0 | I'm trying to use textmate, but I find it hard to navigate a project with it.
I admit I probably just don't know the the IDE well enough.
Is it possible to highlight a class or method and jump to its definition? | Python IDE that you can highlight a method/class and jump to its definition | 0 | 0 | 0 | 2,656 |
3,285,166 | 2010-07-19T21:16:00.000 | 0 | 0 | 1 | 0 | python,ide | 9,350,448 | 9 | false | 0 | 0 | Aptana Studio 3.0
The PyDev team is now operating under the auspices of Aptana, which makes Aptana Studio 3 - an Eclipse customisation - preferable to the 2-step process of first downloading Eclipse, and then installing the PyDev extension.
Aptana comes pre-configured for Python (and others), and in addition features c... | 3 | 3 | 0 | I'm trying to use textmate, but I find it hard to navigate a project with it.
I admit I probably just don't know the the IDE well enough.
Is it possible to highlight a class or method and jump to its definition? | Python IDE that you can highlight a method/class and jump to its definition | 0 | 0 | 0 | 2,656 |
3,285,168 | 2010-07-19T21:17:00.000 | 0 | 0 | 1 | 0 | python,data-structures,caching | 3,285,185 | 3 | false | 0 | 0 | You're looking for a Map, or an associative array. To get more specific, we'd need to know what language you're trying to use. | 2 | 2 | 0 | I'm implementing something like a cache, which works like this:
If a new value for the given key arrives from some external process, store that value, and remember the time when this value arrived.
If we are idle, find the oldest entry in the cache, fetch the new value for the key from external source and update the c... | Data structure to store key-value pairs and retrive the key for the lowest value quickly | 0 | 0 | 0 | 3,079 |
3,285,168 | 2010-07-19T21:17:00.000 | 3 | 0 | 1 | 0 | python,data-structures,caching | 3,285,262 | 3 | true | 0 | 0 | Most heap implementations will get you the lowest key in your collection in O(1) time, but there's no guarantees regarding the speed of random lookups or removal. I'd recommend pairing up two data structures: any simple heap implementation and any out-of-the-box hashtable.
Of course, any balanced binary tree can be use... | 2 | 2 | 0 | I'm implementing something like a cache, which works like this:
If a new value for the given key arrives from some external process, store that value, and remember the time when this value arrived.
If we are idle, find the oldest entry in the cache, fetch the new value for the key from external source and update the c... | Data structure to store key-value pairs and retrive the key for the lowest value quickly | 1.2 | 0 | 0 | 3,079 |
3,285,237 | 2010-07-19T21:27:00.000 | 0 | 0 | 1 | 0 | python,django,object | 3,286,206 | 3 | false | 0 | 0 | Nothing prevents you from "resetting" that attrib in the init setting it to None after you init the super (in Python classes inherited and inheriting are super and sub btw, not parent and child).
Unless that attrib is created elsewhere and its presence isn't guaranteed, only in that case walking up the inheritance tree... | 1 | 4 | 0 | How to get an attribute just from the current class and not from possible parent classes? If I use getattr it traverses class hierarchy but I would like to get None if attribute is not defined in the current class (even if it is defined in some parent class). | How to get an attribute just from the current class and not from possible parent classes? | 0 | 0 | 0 | 1,552 |
3,285,631 | 2010-07-19T22:34:00.000 | 0 | 0 | 0 | 0 | python,mysql,django | 3,285,926 | 3 | false | 0 | 0 | I tried to solve this one for days myself and finally gave up.
I switched to postgres. It works pretty well with django on snow leopard,
with one minor problem. For some reason auto_inc pk ids don't get assigned
to some models. I solved the problem by randomly assigning an id from a large
random range, and relying on... | 1 | 2 | 0 | I'm having all sorts of trouble trying to instal MySQLdb (1.2.2) on snow leopard. I am running python 2.5.1 and MySQL 5.1 32bit.
Python and MySQL are running just fine.
I've also installed django 1.2.1, although I don't think thats all that important, but wanted to give an idea of the stack i'm trying to install. I am ... | Installing MySQLdb on Snow Leopard | 0 | 1 | 0 | 461 |
3,286,525 | 2010-07-20T02:16:00.000 | 1 | 0 | 1 | 0 | python,sql,json | 55,329,857 | 14 | false | 0 | 0 | If you are using an MSSQL Server 2008 and above, you can perform your SELECT query to return json by using the FOR JSON AUTO clause E.G
SELECT name, surname FROM users FOR JSON AUTO
Will return Json as
[{"name": "Jane","surname": "Doe" }, {"name": "Foo","surname": "Samantha" }, ..., {"name": "John", "surname": "boo" }... | 1 | 54 | 0 | I'm playing around with a little web app in web.py, and am setting up a url to return a JSON object. What's the best way to convert a SQL table to JSON using python? | return SQL table as JSON in python | 0.014285 | 1 | 0 | 157,377 |
3,286,826 | 2010-07-20T03:36:00.000 | 0 | 0 | 0 | 0 | python,qt4,pyqt,signals | 8,453,598 | 3 | false | 0 | 1 | Signal handlers do NOT know the emitter (only the signal type) and emitters do NOT know what handlers are connected. Many handlers can connect to the same signal and they are executed in the order of connection. A signal can be emitted from many places. | 3 | 3 | 0 | I'm wanting a paradigm in a Qt4 (PyQt4) program where a component is able to respond to a signal without knowing anything about where it is coming from.
My intial reading suggests that I have to explicitly connect signals to slots. But what I want is for any of a number of components to be able to send a signal, and ... | How to broadcast a signal in Qt4 | 0 | 0 | 0 | 1,116 |
3,286,826 | 2010-07-20T03:36:00.000 | 1 | 0 | 0 | 0 | python,qt4,pyqt,signals | 3,292,687 | 3 | false | 0 | 1 | This isn't easily possible - you have to have something that knows about the signaling object and the receiving object to connect the two. Depending on what you need, however, you might be able to set up a class that mediates between the two (so objects with signals tell the class they exist, and have such-and-such a ... | 3 | 3 | 0 | I'm wanting a paradigm in a Qt4 (PyQt4) program where a component is able to respond to a signal without knowing anything about where it is coming from.
My intial reading suggests that I have to explicitly connect signals to slots. But what I want is for any of a number of components to be able to send a signal, and ... | How to broadcast a signal in Qt4 | 0.066568 | 0 | 0 | 1,116 |
3,286,826 | 2010-07-20T03:36:00.000 | 0 | 0 | 0 | 0 | python,qt4,pyqt,signals | 3,300,104 | 3 | false | 0 | 1 | Don't you just want a good old fashioned method invocation? The response is just the return value of the method. | 3 | 3 | 0 | I'm wanting a paradigm in a Qt4 (PyQt4) program where a component is able to respond to a signal without knowing anything about where it is coming from.
My intial reading suggests that I have to explicitly connect signals to slots. But what I want is for any of a number of components to be able to send a signal, and ... | How to broadcast a signal in Qt4 | 0 | 0 | 0 | 1,116 |
3,287,455 | 2010-07-20T06:13:00.000 | 0 | 0 | 0 | 0 | python,wxpython,tags | 3,294,064 | 2 | false | 1 | 1 | There are a couple of approaches that come to my mind. If it's like a form letter where only specific parts will be replaced, then you can just should that to the user and have some text controls for them to fill in. Something like this:
Dear #NAME,
Thank you for contacting #COMPANY, blah blah blah
And then have a text... | 1 | 2 | 0 | I am making a html window in wxpython and want to print it. Before that I need to enter user input (such as his name or such things ) in the html page. How to do that nicely?
Thanks in advance, | How to insert dynamic string in wxpython html window? (wx.html.htmlwindow) | 0 | 0 | 0 | 614 |
3,288,001 | 2010-07-20T07:58:00.000 | 5 | 0 | 0 | 0 | python,tkinter,event-binding | 3,288,050 | 3 | true | 0 | 0 | Look at table 7-1 of the docs. There are events that specify motion while the button is pressed, <B1-Motion>, <B2-Motion> etc.
If you're not talking about a press-and-move event, then you can start doing your activity on <Button-1> and stop doing it when you receive <B1-Release>. | 2 | 6 | 0 | I need a command to be executed as long as the left mouse button is being held down. | How do I bind an event to the left mouse button being held down? | 1.2 | 0 | 0 | 14,186 |
3,288,001 | 2010-07-20T07:58:00.000 | 1 | 0 | 0 | 0 | python,tkinter,event-binding | 3,288,017 | 3 | false | 0 | 0 | Use the mouse move/motion events and check the modifier flags. The mouse buttons will show up there. | 2 | 6 | 0 | I need a command to be executed as long as the left mouse button is being held down. | How do I bind an event to the left mouse button being held down? | 0.066568 | 0 | 0 | 14,186 |
3,288,047 | 2010-07-20T08:05:00.000 | 3 | 0 | 0 | 0 | python,tkinter,mouse-position | 3,288,196 | 2 | false | 0 | 1 | Get the screen coordinates of the mouse move event (x/y_root) and subtract the screen coordinates of the window (window.winfo_rootx()/y()). | 1 | 5 | 0 | I need to get the mouse position relative to the tkinter window. | How do I get mouse position relative to the parent widget in tkinter? | 0.291313 | 0 | 0 | 9,025 |
3,288,289 | 2010-07-20T08:42:00.000 | 0 | 0 | 0 | 1 | python,windows,process | 3,288,296 | 2 | false | 0 | 0 | Python has no standard way to examine the executables you can start with the process API.
How about you start the external command using cmd.exe? Or create a BAT script in %TEMP% and run that. | 2 | 0 | 0 | I'm looking for a Python function which behaves just like the Windows command interpreter cmd.exe when it comes to waiting for newly launched processes to finish. Right now I'm using os.system() but this function always blocks, even when launching GUI applications (which, in case they were written in C/C++, have a Win... | How do I launch a function and wait/don't wait on it depending on whether it's a GUI application? | 0 | 0 | 0 | 606 |
3,288,289 | 2010-07-20T08:42:00.000 | 2 | 0 | 0 | 1 | python,windows,process | 3,288,395 | 2 | true | 0 | 0 | You could write a small C wrapper/extension that checks for the subsystem (using ImageNtHeader). If all else fails, you can parse the PE headers directly. | 2 | 0 | 0 | I'm looking for a Python function which behaves just like the Windows command interpreter cmd.exe when it comes to waiting for newly launched processes to finish. Right now I'm using os.system() but this function always blocks, even when launching GUI applications (which, in case they were written in C/C++, have a Win... | How do I launch a function and wait/don't wait on it depending on whether it's a GUI application? | 1.2 | 0 | 0 | 606 |
3,289,330 | 2010-07-20T11:15:00.000 | 0 | 1 | 0 | 0 | python,cgi | 3,289,546 | 2 | false | 1 | 0 | Django and Pylons are both frameworks that solve this problem quite nicely, namely by abstracting the DB-frontend integration. They are worth considering. | 1 | 1 | 0 | I have 5 python cgi pages. I can navigate from one page to another. All pages get their data from the same database table just that they use different queries.
The problem is that the application as a whole is slow. Though they connect to the same database, each page creates a new handle every time I visit it and handl... | Improving performance of cgi | 0 | 1 | 0 | 179 |
3,289,430 | 2010-07-20T11:30:00.000 | 31 | 0 | 1 | 0 | python,recursion | 3,289,437 | 2 | true | 0 | 0 | The default is 1000 levels deep and you can change that using the setrecursionlimit function in the sys module.
Warning:
Beware that some operating systems may start running into problems if you go much higher due to limited stack space. | 1 | 27 | 0 | What's the maximum level of recursion and how do I change it in Python? | Maximum level of recursion in Python | 1.2 | 0 | 0 | 9,205 |
3,289,584 | 2010-07-20T11:50:00.000 | 0 | 0 | 0 | 0 | python | 3,289,731 | 3 | false | 1 | 0 | Your task sounds interesting. :-) A scenario that just came into mind: You continuosly scrape the resources with your home-brew scripts, and push the results into your persistent database and a caching system -- like Redis -- simultanously. Your caching system/layer serves as primary data source when serving client req... | 1 | 8 | 0 | This is my first questions here, so I hope it will be done correctly ;)
I've been assigned the task to give a web interface to some "home made" python script.
This script is used to check some web sites/applications availability, via curl commands. A very important aspect of this script is that it gives its results in ... | Web-ifing a python command line script? | 0 | 0 | 1 | 3,095 |
3,289,822 | 2010-07-20T12:22:00.000 | 5 | 0 | 1 | 0 | python,list,reference,copy | 3,289,832 | 4 | true | 0 | 0 | Use a slice notation.
newlist = oldlist
This will assign a second name to the same list
newlist = oldlist[:]
This will duplicate each element of oldlist into a complete new list called newlist | 1 | 2 | 0 | How do I copy the contents of a list and not just a reference to the list in Python? | lists in python, with references | 1.2 | 0 | 0 | 191 |
3,290,443 | 2010-07-20T13:31:00.000 | 0 | 0 | 0 | 0 | python,textures,blender | 5,252,616 | 1 | false | 0 | 0 | What you could do is (if you are using Blender 2.49b) set the image of the Texture object and the uvlayer property of the MTex object. | 1 | 0 | 0 | I'm trying to access UV Layer in Blender from Python and basically API returns UV Layer only as a string. Thing is I want to assign new Image object to current UV Layer ( I use TexFace on the side of material ) and then just bake lighting. All meshes are currently unwrapped, the only thing which is missing is an Image ... | Blender, UV Layer, Image and Python | 0 | 0 | 0 | 1,058 |
3,291,123 | 2010-07-20T14:41:00.000 | 1 | 0 | 1 | 0 | python,unicode,internationalization,urlencode,utf-8 | 3,291,276 | 6 | false | 0 | 0 | "...".encode("utf-8") transforms the in-memory representation of the string into an UTF-8 -encoded string.
url encoder likely expected a bytestring, that is, string representation where each character is represented with a single byte. | 3 | 9 | 0 | I wanted to url encode a python string and got exceptions with hebrew strings.
I couldn't fix it and started doing some guess oriented programming.
Finally, doing mystr = mystr.encode("utf8") before sending it to the url encoder saved the day.
Can somebody explain what happened? What does .encode("utf8") do? My origin... | Python: what does "...".encode("utf8") fix? | 0.033321 | 0 | 0 | 9,631 |
3,291,123 | 2010-07-20T14:41:00.000 | 13 | 0 | 1 | 0 | python,unicode,internationalization,urlencode,utf-8 | 3,291,374 | 6 | false | 0 | 0 | My original string was a unicode string anyways (i.e. prefixed by a u)
...which is the problem. It wasn't a "string", as such, but a "Unicode object". It contains a sequence of Unicode code points. These code points must, of course, have some internal representation that Python knows about, but whatever that is is abs... | 3 | 9 | 0 | I wanted to url encode a python string and got exceptions with hebrew strings.
I couldn't fix it and started doing some guess oriented programming.
Finally, doing mystr = mystr.encode("utf8") before sending it to the url encoder saved the day.
Can somebody explain what happened? What does .encode("utf8") do? My origin... | Python: what does "...".encode("utf8") fix? | 1 | 0 | 0 | 9,631 |
3,291,123 | 2010-07-20T14:41:00.000 | 0 | 0 | 1 | 0 | python,unicode,internationalization,urlencode,utf-8 | 3,291,277 | 6 | false | 0 | 0 | It returns a UTF-8 encoded version of the Unicode string, mystr. It is important to realize that UTF-8 is simply 1 way of encoding Unicode. Python can work with many other encodings (eg. mystr.encode("utf32") or even mystr.encode("ascii")). | 3 | 9 | 0 | I wanted to url encode a python string and got exceptions with hebrew strings.
I couldn't fix it and started doing some guess oriented programming.
Finally, doing mystr = mystr.encode("utf8") before sending it to the url encoder saved the day.
Can somebody explain what happened? What does .encode("utf8") do? My origin... | Python: what does "...".encode("utf8") fix? | 0 | 0 | 0 | 9,631 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.