Q_Score int64 0 6.79k | GUI and Desktop Applications int64 0 1 | ViewCount int64 8 6.81M | Database and SQL int64 0 1 | A_Id int64 518 72.5M | Other int64 0 1 | Available Count int64 1 31 | is_accepted bool 2
classes | Score float64 -1 1.2 | Users Score int64 -42 1.15k | Q_Id int64 337 49.3M | System Administration and DevOps int64 0 1 | Web Development int64 0 1 | Networking and APIs int64 0 1 | Data Science and Machine Learning int64 0 1 | Answer stringlengths 6 11.6k | Title stringlengths 11 150 | Python Basics and Environment int64 0 1 | AnswerCount int64 1 64 | Question stringlengths 15 29k | CreationDate stringlengths 23 23 | Tags stringlengths 6 105 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
82 | 0 | 9,979 | 0 | 635 | 0 | 6 | false | 1 | 6 | 337 | 0 | 0 | 1 | 0 | I write a SOAP server that receives XML requests and creates XML responses. (Unfortunately, it's not my project, so it's closed source, but that's another problem).
It turned out for me that creating (SOAP) XML documents is fairly simple if you have a data structure that "fits" the schema.
I keep the envelope since th... | XML Processing in Python | 0 | 12 | I am about to build a piece of a project that will need to construct and post an XML document to a web service and I'd like to do it in Python, as a means to expand my skills in it.
Unfortunately, whilst I know the XML model fairly well in .NET, I'm uncertain what the pros and cons are of the XML models in Python.
... | 2008-08-02T03:35:00.000 | python,xml |
82 | 0 | 9,979 | 0 | 123,307 | 0 | 6 | false | 1 | 8 | 337 | 0 | 0 | 1 | 0 | I've used ElementTree for several projects and recommend it.
It's pythonic, comes 'in the box' with Python 2.5, including the c version cElementTree (xml.etree.cElementTree) which is 20 times faster than the pure Python version, and is very easy to use.
lxml has some perfomance advantages, but they are uneven and you ... | XML Processing in Python | 0 | 12 | I am about to build a piece of a project that will need to construct and post an XML document to a web service and I'd like to do it in Python, as a means to expand my skills in it.
Unfortunately, whilst I know the XML model fairly well in .NET, I'm uncertain what the pros and cons are of the XML models in Python.
... | 2008-08-02T03:35:00.000 | python,xml |
82 | 0 | 9,979 | 0 | 202,259 | 0 | 6 | false | 1 | 8 | 337 | 0 | 0 | 1 | 0 | It depends a bit on how complicated the document needs to be.
I've used minidom a lot for writing XML, but that's usually been just reading documents, making some simple transformations, and writing them back out. That worked well enough until I needed the ability to order element attributes (to satisfy an ancient appl... | XML Processing in Python | 0 | 12 | I am about to build a piece of a project that will need to construct and post an XML document to a web service and I'd like to do it in Python, as a means to expand my skills in it.
Unfortunately, whilst I know the XML model fairly well in .NET, I'm uncertain what the pros and cons are of the XML models in Python.
... | 2008-08-02T03:35:00.000 | python,xml |
82 | 0 | 9,979 | 0 | 69,772 | 0 | 6 | false | 0.033321 | 2 | 337 | 0 | 0 | 1 | 0 | I assume that the .NET way of processing XML builds on some version of MSXML and in that case I assume that using, for example, minidom would make you feel somewhat at home. However, if it is simple processing you are doing, any library will probably do.
I also prefer working with ElementTree when dealing with XML in P... | XML Processing in Python | 0 | 12 | I am about to build a piece of a project that will need to construct and post an XML document to a web service and I'd like to do it in Python, as a means to expand my skills in it.
Unfortunately, whilst I know the XML model fairly well in .NET, I'm uncertain what the pros and cons are of the XML models in Python.
... | 2008-08-02T03:35:00.000 | python,xml |
82 | 0 | 9,979 | 0 | 13,832,269 | 0 | 6 | false | 0.049958 | 3 | 337 | 0 | 0 | 1 | 0 | I strongly recommend SAX - Simple API for XML - implementation in the Python libraries. They are fairly easy to setup and process large XML by even driven API, as discussed by previous posters here, and have low memory footprint unlike validating DOM style XML parsers. | XML Processing in Python | 0 | 12 | I am about to build a piece of a project that will need to construct and post an XML document to a web service and I'd like to do it in Python, as a means to expand my skills in it.
Unfortunately, whilst I know the XML model fairly well in .NET, I'm uncertain what the pros and cons are of the XML models in Python.
... | 2008-08-02T03:35:00.000 | python,xml |
82 | 0 | 9,979 | 0 | 69,410 | 0 | 6 | false | 1 | 8 | 337 | 0 | 0 | 1 | 0 | There are 3 major ways of dealing with XML, in general: dom, sax, and xpath. The dom model is good if you can afford to load your entire xml file into memory at once, and you don't mind dealing with data structures, and you are looking at much/most of the model. The sax model is great if you only care about a few tags,... | XML Processing in Python | 0 | 12 | I am about to build a piece of a project that will need to construct and post an XML document to a web service and I'd like to do it in Python, as a means to expand my skills in it.
Unfortunately, whilst I know the XML model fairly well in .NET, I'm uncertain what the pros and cons are of the XML models in Python.
... | 2008-08-02T03:35:00.000 | python,xml |
47 | 0 | 4,225 | 0 | 518 | 1 | 2 | false | 1 | 6 | 469 | 0 | 1 | 0 | 0 | I haven't been able to find anything that does this directly. I think you'll have to iterate through the various font folders on the system: /System/Library/Fonts, /Library/Fonts, and there can probably be a user-level directory as well ~/Library/Fonts. | How can I find the full path to a font from its display name on a Mac? | 0 | 4 | I am using the Photoshop's javascript API to find the fonts in a given PSD.
Given a font name returned by the API, I want to find the actual physical font file that font name corresponds to on the disc.
This is all happening in a python program running on OSX so I guess I'm looking for one of:
Some Photoshop javascrip... | 2008-08-02T15:11:00.000 | python,macos,fonts,photoshop |
47 | 0 | 4,225 | 0 | 3,040 | 1 | 2 | true | 1.2 | 21 | 469 | 0 | 1 | 0 | 0 | Unfortunately the only API that isn't deprecated is located in the ApplicationServices framework, which doesn't have a bridge support file, and thus isn't available in the bridge. If you're wanting to use ctypes, you can use ATSFontGetFileReference after looking up the ATSFontRef.
Cocoa doesn't have any native support,... | How can I find the full path to a font from its display name on a Mac? | 0 | 4 | I am using the Photoshop's javascript API to find the fonts in a given PSD.
Given a font name returned by the API, I want to find the actual physical font file that font name corresponds to on the disc.
This is all happening in a python program running on OSX so I guess I'm looking for one of:
Some Photoshop javascrip... | 2008-08-02T15:11:00.000 | python,macos,fonts,photoshop |
838 | 0 | 422,064 | 0 | 48,244,490 | 0 | 1 | false | 0.015383 | 2 | 1,854 | 1 | 0 | 0 | 0 | If you are running macOS X and run platform.system() you get darwin
because macOS X is built on Apple's Darwin OS. Darwin is the kernel of macOS X and is essentially macOS X without the GUI. | Python: What OS am I running on? | 0 | 26 | What do I need to look at to see whether I'm on Windows or Unix, etc? | 2008-08-05T03:23:00.000 | python,cross-platform,platform-specific,platform-agnostic |
58 | 0 | 12,477 | 0 | 49,586,164 | 0 | 14 | false | 0.022219 | 2 | 1,983 | 0 | 0 | 0 | 0 | (1,2,3) and [1,2,3] can be used interchangeably in rare conditions.
So (1,2,3) is a tuple and is immutable. Any changes you wish to make need to overwrite the object.
[1,2,3] is a list and elements can be appended and removed.
List has more features than a tuple. | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
58 | 0 | 12,477 | 0 | 44,083,156 | 0 | 14 | false | 0.033321 | 3 | 1,983 | 0 | 0 | 0 | 0 | A tuple might represent a key in dictionary, because it's
immutable.
Use lists if you have a collection of data that doesn't
need random access. | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
58 | 0 | 12,477 | 0 | 62,503,886 | 0 | 14 | false | 0 | 0 | 1,983 | 0 | 0 | 0 | 0 | a = (1,2,3) is a tuple which is immutable meaning you can't add anything into a
b = [1,2,3] is a list in python which is immutable meaning you can make changes into 'b' either delete or add numbers into it. | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
58 | 0 | 12,477 | 0 | 63,479,906 | 0 | 14 | false | 0 | 0 | 1,983 | 0 | 0 | 0 | 0 | In simple words, lists are mutable whereas tuples are not. Hence, if you want to modify the elements in your program i.e., adding, deleting or altering elements, go for a list. But, if you don't want tat to happen i.e., may be for setting sequence in for loop, etc. go for a tuple | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
58 | 0 | 12,477 | 0 | 38,062,967 | 0 | 14 | false | 0 | 0 | 1,983 | 0 | 0 | 0 | 0 | (1,2,3) is a tuple and [1,2,3] is a list. You either of the two represent sequences of numbers but note that tuples are immutable and list are mutable Python objects. | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
58 | 0 | 12,477 | 0 | 69,499,270 | 0 | 14 | false | 0 | 0 | 1,983 | 0 | 0 | 0 | 0 | (1,2,3) is immutable, so you can't add to it or change one of the items. In contrast, [1,2,3] is mutable, so you can add to it or change the items. | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
58 | 0 | 12,477 | 0 | 35,496,153 | 0 | 14 | false | 0 | 0 | 1,983 | 0 | 0 | 0 | 0 | (1,2,3) is a tuple while [1,2,3] is a list. A tuple is an immutable object while a list is mutable. | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
58 | 0 | 12,477 | 0 | 54,570,759 | 0 | 14 | false | 0 | 0 | 1,983 | 0 | 0 | 0 | 0 | (1,2,3)-tuple
[1,2,3]-list
lists are mutable on which various operations can be performed whereas tuples are immutable which cannot be extended.we cannot add,delete or update any element from a tuple once it is created. | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
58 | 0 | 12,477 | 0 | 6,477,369 | 0 | 14 | false | 0.055498 | 5 | 1,983 | 0 | 0 | 0 | 0 | [1, 2, 3] is a list in which one can add or delete items.
(1, 2, 3) is a tuple in which once defined, modification cannot be done. | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
58 | 0 | 12,477 | 0 | 1,987 | 0 | 14 | false | 1 | 23 | 1,983 | 0 | 0 | 0 | 0 | The list [1,2,3] is dynamic and flexible but that flexibility comes at a speed cost.
The tuple (1,2,3) is fixed (immutable) and therefore faster. | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
58 | 0 | 12,477 | 0 | 5,719 | 0 | 14 | false | 0.033321 | 3 | 1,983 | 0 | 0 | 0 | 0 | As others have mentioned, Lists and tuples are both containers which can be used to store python objects. Lists are extensible and their contents can change by assignment, on the other hand tuples are immutable.
Also, lists cannot be used as keys in a dictionary whereas tuples can. | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
58 | 0 | 12,477 | 0 | 12,454 | 0 | 14 | false | 0.044415 | 4 | 1,983 | 0 | 0 | 0 | 0 | Whenever I need to pass in a collection of items to a function, if I want the function to not change the values passed in - I use tuples.
Else if I want to have the function to alter the values, I use list.
Always if you are using external libraries and need to pass in a list of values to a function and are unsure ab... | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
58 | 0 | 12,477 | 0 | 5,746 | 0 | 14 | false | 0.022219 | 2 | 1,983 | 0 | 0 | 0 | 0 | If you can find a solution that works with tuples, use them, as it forces immutability which kind of drives you down a more functional path. You almost never regret going down the functional/immutable path. | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
58 | 0 | 12,477 | 0 | 26,250,158 | 0 | 14 | false | 0.022219 | 2 | 1,983 | 0 | 0 | 0 | 0 | [1,2,3] is a list.
(1,2,3) is a tuple and immutable. | Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each? | 1 | 18 | In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why? | 2008-08-05T07:18:00.000 | python,list,tuples |
300 | 0 | 199,251 | 0 | 12,167 | 0 | 2 | false | 0.061461 | 4 | 2,933 | 1 | 0 | 0 | 0 | I'm not sure that this is the best way to do it, but when I'm deploying Ruby GUI apps (not Python, but has the same "problem" as far as .exe's are concerned) on Windows, I just write a short launcher in C# that calls on my main script. It compiles to an executable, and I then have an application executable. | Create a directly-executable cross-platform GUI app using Python | 0 | 13 | Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux.
The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some light on this and point me in the ... | 2008-08-05T22:26:00.000 | python,user-interface,deployment,tkinter,release-management |
300 | 0 | 199,251 | 0 | 2,980 | 0 | 2 | false | 1 | 6 | 2,933 | 1 | 0 | 0 | 0 | Since python is installed on nearly every non-Windows OS by default now, the only thing you really need to make sure of is that all of the non-standard libraries you use are installed.
Having said that, it is possible to build executables that include the python interpreter, and any libraries you use. This is likely t... | Create a directly-executable cross-platform GUI app using Python | 0 | 13 | Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux.
The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some light on this and point me in the ... | 2008-08-05T22:26:00.000 | python,user-interface,deployment,tkinter,release-management |
14 | 0 | 1,421 | 0 | 4,958 | 1 | 6 | false | 0.07486 | 3 | 4,942 | 0 | 0 | 0 | 0 | Focus on the shorter time needed for development/prototype and possibly easier maintenance (none of this may apply against Ruby). | How to sell Python to a client/boss/person | 0 | 8 | When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it? | 2008-08-07T16:43:00.000 | php,python,ruby-on-rails,ruby |
14 | 0 | 1,421 | 0 | 5,014 | 1 | 6 | false | 0.07486 | 3 | 4,942 | 0 | 0 | 0 | 0 | I would consider that using python on a new project is completely dependent on what problem you are trying to solve with python. If you want someone to agree with you that you should use python, then show them how python's features apply specifically to that problem.
In the case of web development with python, talk ab... | How to sell Python to a client/boss/person | 0 | 8 | When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it? | 2008-08-07T16:43:00.000 | php,python,ruby-on-rails,ruby |
14 | 0 | 1,421 | 0 | 4,978 | 1 | 6 | true | 1.2 | 13 | 4,942 | 0 | 0 | 0 | 0 | This is one of those cases that really boil down to personal preference or situational details. If you're more comfortable and experienced with Python, then say so. Are they asking you to justify it because they're more comfortable with one of the other environments? After you're done, will the system be passed off to ... | How to sell Python to a client/boss/person | 0 | 8 | When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it? | 2008-08-07T16:43:00.000 | php,python,ruby-on-rails,ruby |
14 | 0 | 1,421 | 0 | 15,296 | 1 | 6 | false | 0.124353 | 5 | 4,942 | 0 | 0 | 0 | 0 | It's one of the preferred languages over at Google - It's several years ahead of Ruby in terms of "maturity" (what ever that really means - but managers like that). Since it's prefered by Google you can also run it on the Google App Engine.
Mircosoft is also embracing Python, and will have a v2.0 of IronPython coming o... | How to sell Python to a client/boss/person | 0 | 8 | When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it? | 2008-08-07T16:43:00.000 | php,python,ruby-on-rails,ruby |
14 | 0 | 1,421 | 0 | 9,420,311 | 1 | 6 | false | 0.024995 | 1 | 4,942 | 0 | 0 | 0 | 0 | Give them a snippet of code in each (no more than a page) that performs some cool function that they will like. (e.g show outliers in a data set).
Show them each page. One in PHP, Ruby and Python.
Ask them which they find easiest to understand/read.
Tell them thats why you want to use Python. It's easier to read if you... | How to sell Python to a client/boss/person | 0 | 8 | When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it? | 2008-08-07T16:43:00.000 | php,python,ruby-on-rails,ruby |
14 | 0 | 1,421 | 0 | 15,291 | 1 | 6 | false | 0 | 0 | 4,942 | 0 | 0 | 0 | 0 | I agree with mreggen. Tell them by working in Python you can get things done faster. Getting things done faster possibly means money saved by the client. In the least it means that you are working with a language you a more comfortable in, meaning faster development, debugging, and refactoring time. There will be less ... | How to sell Python to a client/boss/person | 0 | 8 | When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it? | 2008-08-07T16:43:00.000 | php,python,ruby-on-rails,ruby |
23 | 0 | 32,774 | 0 | 14,791,003 | 1 | 1 | false | 0 | 0 | 5,102 | 1 | 0 | 0 | 0 | The problem for me wasn't in Apache set up, but in understanding how mod_apache actually uses the .py files. Module-level statements (including those in a if __name__=='__main__' section) are not executed--I assumed that the stdout from running the script at the commandline would be what the server would output, but th... | How do you set up Python scripts to work in Apache 2.0? | 0 | 4 | I tried to follow a couple of googled up tutorials on setting up mod_python, but failed every time. Do you have a good, step-by step, rock-solid howto?
My dev box is OS X, production - Centos. | 2008-08-07T18:24:00.000 | python,apache,apache2 |
14 | 1 | 2,313 | 0 | 1,659,332 | 0 | 3 | false | 0.244919 | 5 | 5,136 | 0 | 0 | 0 | 1 | One thing to remember is that the Matlab compiler does not actually compile the Matlab code into native machine instructions. It simply wraps it into a standalone executable or a library with its own runtime engine that runs it. You would be able to run your code without Matlab installed, and you would be able to int... | Does anyone have experience creating a shared library in MATLAB? | 0 | 4 | A researcher has created a small simulation in MATLAB and we want to make it accessible to others. My plan is to take the simulation, clean up a few things and turn it into a set of functions. Then I plan to compile it into a C library and use SWIG to create a Python wrapper. At that point, I should be able to call the... | 2008-08-07T18:47:00.000 | python,c,matlab |
14 | 1 | 2,313 | 0 | 138,534 | 0 | 3 | false | 0.099668 | 2 | 5,136 | 0 | 0 | 0 | 1 | I'd also try ctypes first.
Use the Matlab compiler to compile the code into C.
Compile the C code into a DLL.
Use ctypes to load and call code from this DLL
The hardest step is probably 1, but if you already know Matlab and have used the Matlab compiler, you should not have serious problems with it. | Does anyone have experience creating a shared library in MATLAB? | 0 | 4 | A researcher has created a small simulation in MATLAB and we want to make it accessible to others. My plan is to take the simulation, clean up a few things and turn it into a set of functions. Then I plan to compile it into a C library and use SWIG to create a Python wrapper. At that point, I should be able to call the... | 2008-08-07T18:47:00.000 | python,c,matlab |
14 | 1 | 2,313 | 0 | 5,302 | 0 | 3 | true | 1.2 | 3 | 5,136 | 0 | 0 | 0 | 1 | I won't help much but I remember that I was able to wrap a MATLAB simulation into DLL and then call it from a Delphi app. It worked really well. | Does anyone have experience creating a shared library in MATLAB? | 0 | 4 | A researcher has created a small simulation in MATLAB and we want to make it accessible to others. My plan is to take the simulation, clean up a few things and turn it into a set of functions. Then I plan to compile it into a C library and use SWIG to create a Python wrapper. At that point, I should be able to call the... | 2008-08-07T18:47:00.000 | python,c,matlab |
245 | 0 | 338,237 | 0 | 1,732,475 | 0 | 1 | false | 1 | 40 | 8,692 | 0 | 0 | 1 | 0 | Use LXML. LXML uses the full power of libxml2 and libxslt, but wraps them in more "Pythonic" bindings than the Python bindings that are native to those libraries. As such, it gets the full XPath 1.0 implementation. Native ElemenTree supports a limited subset of XPath, although it may be good enough for your needs. | How to use XPath in Python? | 0 | 11 | What are the libraries that support XPath? Is there a full implementation? How is the library used? Where is its website? | 2008-08-12T11:28:00.000 | python,xml,dom,xpath,python-2.x |
142 | 0 | 140,384 | 0 | 31,373,513 | 1 | 1 | false | 0.012499 | 1 | 8,948 | 0 | 0 | 0 | 0 | After some initial research I thought songdetails might fit my use case, but it doesn't handle .m4b files. Mutagen does. Note that while some have (reasonably) taken issue with Mutagen's surfacing of format-native keys, that vary from format to format (TIT2 for mp3, title for ogg, \xa9nam for mp4, Title for WMA etc.)... | Accessing MP3 metadata with Python | 0 | 16 | Is there a maintained package I can use to retrieve and set MP3 ID3 metadata using Python? | 2008-08-12T15:16:00.000 | python,mp3,metadata |
29 | 1 | 7,527 | 0 | 3,331,503 | 1 | 5 | false | 0 | 0 | 11,060 | 0 | 0 | 0 | 0 | My recommendation would be to figure out a set of known input-output results, such as some simpler cases that you already have in place, and unit test the code that is produced. It's entirely possible that as you change the generator that the exact string that is produced may be slightly different... but what you reall... | How should I unit test a code-generator? | 0 | 8 | This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions.
I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed... | 2008-08-14T13:59:00.000 | c++,python,unit-testing,code-generation,swig |
29 | 1 | 7,527 | 0 | 11,443 | 1 | 5 | false | 0.124353 | 5 | 11,060 | 0 | 0 | 0 | 0 | Recall that "unit testing" is only one kind of testing. You should be able to unit test the internal pieces of your code generator. What you're really looking at here is system level testing (a.k.a. regression testing). It's not just semantics... there are different mindsets, approaches, expectations, etc. It's cer... | How should I unit test a code-generator? | 0 | 8 | This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions.
I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed... | 2008-08-14T13:59:00.000 | c++,python,unit-testing,code-generation,swig |
29 | 1 | 7,527 | 0 | 11,128 | 1 | 5 | false | 0 | 0 | 11,060 | 0 | 0 | 0 | 0 | Yes, results are the ONLY thing that matters. The real chore is writing a framework that allows your generated code to run independently... spend your time there. | How should I unit test a code-generator? | 0 | 8 | This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions.
I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed... | 2008-08-14T13:59:00.000 | c++,python,unit-testing,code-generation,swig |
29 | 1 | 7,527 | 0 | 11,074 | 1 | 5 | true | 1.2 | 14 | 11,060 | 0 | 0 | 0 | 0 | I started writing up a summary of my experience with my own code generator, then went back and re-read your question and found you had already touched upon the same issues yourself, focus on the execution results instead of the code layout/look.
Problem is, this is hard to test, the generated code might not be suited t... | How should I unit test a code-generator? | 0 | 8 | This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions.
I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed... | 2008-08-14T13:59:00.000 | c++,python,unit-testing,code-generation,swig |
29 | 1 | 7,527 | 0 | 11,235 | 1 | 5 | false | 0 | 0 | 11,060 | 0 | 0 | 0 | 0 | If you are running on *nux you might consider dumping the unittest framework in favor of a bash script or makefile. on windows you might consider building a shell app/function that runs the generator and then uses the code (as another process) and unittest that.
A third option would be to generate the code and then bui... | How should I unit test a code-generator? | 0 | 8 | This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions.
I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed... | 2008-08-14T13:59:00.000 | c++,python,unit-testing,code-generation,swig |
7 | 0 | 634 | 0 | 21,149 | 0 | 1 | false | 0 | 0 | 12,692 | 0 | 1 | 0 | 0 | Keep a look out for ASP.NET MVC
The IronRuby guys have got some internal builds of MVC to work with IronRuby, and IronPython 2 and IronRuby have a lot of code in common with the DLR.
I'm not sure if they'll support IronPython/IronRuby when MVC is released, but it's definitely worth keeping your eye on anyway - The old ... | IronPython and ASP.NET | 0 | 3 | Has anyone built a website with IronPython and ASP.NET. What were your experiences and is the combination ready for prime-time? | 2008-08-15T20:17:00.000 | asp.net,ironpython |
95 | 0 | 15,413 | 0 | 473,491 | 0 | 2 | false | 0.046121 | 3 | 13,857 | 0 | 0 | 0 | 0 | Here's a typical use case for closures - callbacks for GUI elements (this would be an alternative to subclassing the button class). For example, you can construct a function that will be called in response to a button press, and "close" over the relevant variables in the parent scope that are necessary for processing t... | Can you explain closures (as they relate to Python)? | 1 | 13 | I've been reading a lot about closures and I think I understand them, but without clouding the picture for myself and others, I am hoping someone can explain closures as succinctly and clearly as possible. I'm looking for a simple explanation that might help me understand where and why I would want to use them. | 2008-08-17T19:14:00.000 | python,functional-programming,closures |
95 | 0 | 15,413 | 0 | 94,543 | 0 | 2 | false | -0.03076 | -2 | 13,857 | 0 | 0 | 0 | 0 | The best explanation I ever saw of a closure was to explain the mechanism. It went something like this:
Imagine your program stack as a degenerate tree where each node has only one child and the single leaf node is the context of your currently executing procedure.
Now relax the constraint that each node can have only... | Can you explain closures (as they relate to Python)? | 1 | 13 | I've been reading a lot about closures and I think I understand them, but without clouding the picture for myself and others, I am hoping someone can explain closures as succinctly and clearly as possible. I'm looking for a simple explanation that might help me understand where and why I would want to use them. | 2008-08-17T19:14:00.000 | python,functional-programming,closures |
7 | 0 | 2,774 | 0 | 14,304 | 0 | 2 | false | 0 | 0 | 14,281 | 0 | 0 | 0 | 0 | You could loop through the zip files, reading individual files using the zipfile module and running your regex on those, eliminating to unzip all the files at once.
I'm fairly certain that you can't run a regex over the zipped data, at least not meaningfully. | Is there a python module for regex matching in zip files | 1 | 4 | I have over a million text files compressed into 40 zip files. I also have a list of about 500 model names of phones. I want to find out the number of times a particular model was mentioned in the text files.
Is there any python module which can do a regex match on the files without unzipping it. Is there a simple way... | 2008-08-18T07:41:00.000 | python,regex,zip,text-processing |
7 | 0 | 2,774 | 0 | 41,822 | 0 | 2 | false | 0 | 0 | 14,281 | 0 | 0 | 0 | 0 | Isn't it (at least theoretically) possible, to read in the ZIP's Huffman coding and then translate the regexp into the Huffman code? Might this be more efficient than first de-compressing the data, then running the regexp?
(Note: I know it wouldn't be quite that simple: you'd also have to deal with other aspects of the... | Is there a python module for regex matching in zip files | 1 | 4 | I have over a million text files compressed into 40 zip files. I also have a list of about 500 model names of phones. I want to find out the number of times a particular model was mentioned in the text files.
Is there any python module which can do a regex match on the files without unzipping it. Is there a simple way... | 2008-08-18T07:41:00.000 | python,regex,zip,text-processing |
6 | 0 | 651 | 0 | 19,700 | 0 | 8 | false | 0.024995 | 1 | 19,654 | 0 | 1 | 0 | 0 | I think the language itself is not an issue here, as python is really nice high level language with good and easy to find, thorough documentation.
From what I've seen, the Django framework is also a great tooklit for web development, giving much the same developer performance boost Rails is touted to give.
The real iss... | Introducing Python | 1 | 8 | The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development.
But, currently, one of the developers has seen the light of Django (the company has only developed in PHP to d... | 2008-08-21T11:48:00.000 | php,python |
6 | 0 | 651 | 0 | 19,715 | 0 | 8 | true | 1.2 | 14 | 19,654 | 0 | 1 | 0 | 0 | I recently introduced Python to my company, which does consulting work for the Post Office. I did this by waiting until there was a project for which I would be the only programmer, then getting permission to do this new project in Python. I then did another small project in Python with similarly impressive results. ... | Introducing Python | 1 | 8 | The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development.
But, currently, one of the developers has seen the light of Django (the company has only developed in PHP to d... | 2008-08-21T11:48:00.000 | php,python |
6 | 0 | 651 | 0 | 19,943 | 0 | 8 | false | 0 | 0 | 19,654 | 0 | 1 | 0 | 0 | I love Python and Django, and use both to develop the our core webapps.
That said, it's hard to make a business case for switching at this point. Specifically:
Any new platform is risky compared to staying with the tried and true
You'll have the developer fragmentation you mentioned
It's far easier to find PHP program... | Introducing Python | 1 | 8 | The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development.
But, currently, one of the developers has seen the light of Django (the company has only developed in PHP to d... | 2008-08-21T11:48:00.000 | php,python |
6 | 0 | 651 | 0 | 19,968 | 0 | 8 | false | 0.024995 | 1 | 19,654 | 0 | 1 | 0 | 0 | It's really all about schedules. To me the break should be with a specific project. If you decide your direction is Django then start new projects with that. Before you start a new project with a new language/framework, either make sure that you have scheduled time to get up to speed in this new direction, or get up... | Introducing Python | 1 | 8 | The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development.
But, currently, one of the developers has seen the light of Django (the company has only developed in PHP to d... | 2008-08-21T11:48:00.000 | php,python |
6 | 0 | 651 | 0 | 19,685 | 0 | 8 | false | 0 | 0 | 19,654 | 0 | 1 | 0 | 0 | I don't think it's a matter of a programming language as such.
What is the proficiency level of PHP in the team you're talking about? Are they doing spaghetti code or using some structured framework like Zend? If this is the first case then I absolutely understand the guy's interest in Python and Django. It this is th... | Introducing Python | 1 | 8 | The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development.
But, currently, one of the developers has seen the light of Django (the company has only developed in PHP to d... | 2008-08-21T11:48:00.000 | php,python |
6 | 0 | 651 | 0 | 19,692 | 0 | 8 | false | 0.049958 | 2 | 19,654 | 0 | 1 | 0 | 0 | @darkdog:
Using a new language in production code is about more than easy syntax and high-level capability. You want to be familiar with core APIs and feel like you can fix something through logic instead of having to comb through the documentation.
I'm not saying transitioning to Python would be a bad idea for this co... | Introducing Python | 1 | 8 | The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development.
But, currently, one of the developers has seen the light of Django (the company has only developed in PHP to d... | 2008-08-21T11:48:00.000 | php,python |
6 | 0 | 651 | 0 | 19,668 | 0 | 8 | false | 0.099668 | 4 | 19,654 | 0 | 1 | 0 | 0 | If the mandate of the new lead is to put the house in order, the current situation should likely be simplified as much as possible prior. If I had to bring things to order, I wouldn't want to have to manage an ongoing language conversion project on top of everything else, or at least I'd like some choice when initiati... | Introducing Python | 1 | 8 | The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development.
But, currently, one of the developers has seen the light of Django (the company has only developed in PHP to d... | 2008-08-21T11:48:00.000 | php,python |
6 | 0 | 651 | 0 | 19,665 | 0 | 8 | false | 0 | 0 | 19,654 | 0 | 1 | 0 | 0 | Well, python is a high level language.. its not hard to learn and if the guys already have programming knowledge it should be much easier to learn.. i like django.. i think it should be a nice try to use django .. | Introducing Python | 1 | 8 | The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development.
But, currently, one of the developers has seen the light of Django (the company has only developed in PHP to d... | 2008-08-21T11:48:00.000 | php,python |
30 | 0 | 25,846 | 0 | 20,843 | 0 | 1 | false | 0.099668 | 4 | 20,794 | 1 | 0 | 0 | 0 | Can I mention testing for hardlinks without python? /bin/test has the FILE1 -ef FILE2 condition that is true when files share an inode.
Therefore, something like find . -type f -exec test \{} -ef /path/to/file \; -print works for hard link testing to a specific file.
Which brings me to reading man test and the mentions... | Find broken symlinks with Python | 0 | 8 | If I call os.stat() on a broken symlink, python throws an OSError exception. This makes it useful for finding them. However, there are a few other reasons that os.stat() might throw a similar exception. Is there a more precise way of detecting broken symlinks with Python under Linux? | 2008-08-21T19:00:00.000 | python,linux,symlink |
65 | 0 | 20,044 | 0 | 7,826,363 | 0 | 4 | false | 1 | 7 | 21,934 | 0 | 1 | 0 | 0 | One big disadvantage of Java's tracing GC is that from time to time it will "stop the world" and freeze the application for a relatively long time to do a full GC. If the heap is big and the the object tree complex, it will freeze for a few seconds. Also each full GC visits the whole object tree over and over again, s... | Why Java and Python garbage collection methods are different? | 1 | 9 | Python uses the reference count method to handle object life time. So an object that has no more use will be immediately destroyed.
But, in Java, the GC(garbage collector) destroys objects which are no longer used at a specific time.
Why does Java choose this strategy and what is the benefit from this?
Is this better t... | 2008-08-22T07:35:00.000 | java,python,garbage-collection |
65 | 0 | 20,044 | 0 | 74,327 | 0 | 4 | false | 1 | 6 | 21,934 | 0 | 1 | 0 | 0 | Garbage collection is faster (more time efficient) than reference counting, if you have enough memory. For example, a copying gc traverses the "live" objects and copies them to a new space, and can reclaim all the "dead" objects in one step by marking a whole memory region. This is very efficient, if you have enough me... | Why Java and Python garbage collection methods are different? | 1 | 9 | Python uses the reference count method to handle object life time. So an object that has no more use will be immediately destroyed.
But, in Java, the GC(garbage collector) destroys objects which are no longer used at a specific time.
Why does Java choose this strategy and what is the benefit from this?
Is this better t... | 2008-08-22T07:35:00.000 | java,python,garbage-collection |
65 | 0 | 20,044 | 0 | 21,964 | 0 | 4 | true | 1.2 | 54 | 21,934 | 0 | 1 | 0 | 0 | There are drawbacks of using reference counting. One of the most mentioned is circular references: Suppose A references B, B references C and C references B. If A were to drop its reference to B, both B and C will still have a reference count of 1 and won't be deleted with traditional reference counting. CPython (refer... | Why Java and Python garbage collection methods are different? | 1 | 9 | Python uses the reference count method to handle object life time. So an object that has no more use will be immediately destroyed.
But, in Java, the GC(garbage collector) destroys objects which are no longer used at a specific time.
Why does Java choose this strategy and what is the benefit from this?
Is this better t... | 2008-08-22T07:35:00.000 | java,python,garbage-collection |
65 | 0 | 20,044 | 0 | 46,780 | 0 | 4 | false | 0.088656 | 4 | 21,934 | 0 | 1 | 0 | 0 | Reference counting is particularly difficult to do efficiently in a multi-threaded environment. I don't know how you'd even start to do it without getting into hardware assisted transactions or similar (currently) unusual atomic instructions.
Reference counting is easy to implement. JVMs have had a lot of money sunk in... | Why Java and Python garbage collection methods are different? | 1 | 9 | Python uses the reference count method to handle object life time. So an object that has no more use will be immediately destroyed.
But, in Java, the GC(garbage collector) destroys objects which are no longer used at a specific time.
Why does Java choose this strategy and what is the benefit from this?
Is this better t... | 2008-08-22T07:35:00.000 | java,python,garbage-collection |
5 | 0 | 2,346 | 0 | 23,041 | 0 | 1 | false | 0 | 0 | 22,059 | 0 | 1 | 0 | 0 | Open Calais probably use language parsing technology and language statics to guess which words or phrases are Names, Places, Companies, etc. Then, it is just another step to do some kind of search for those entities and return meta data.
Zementa probably does something similar, but matches the phrases against meta-data... | How do content discovery engines, like Zemanta and Open Calais work? | 0 | 3 | I was wondering how as semantic service like Open Calais figures out the names of companies, or people, tech concepts, keywords, etc. from a piece of text. Is it because they have a large database that they match the text against?
How would a service like Zemanta know what images to suggest to a piece of text for inst... | 2008-08-22T10:51:00.000 | python,ruby,semantics,zemanta |
1,032 | 0 | 1,341,778 | 0 | 39,573,536 | 0 | 1 | false | 1 | 20 | 22,676 | 0 | 0 | 1 | 0 | Following are the most commonly used calls for downloading files in python:
urllib.urlretrieve ('url_to_file', file_name)
urllib2.urlopen('url_to_file')
requests.get(url)
wget.download('url', file_name)
Note: urlopen and urlretrieve are found to perform relatively bad with downloading large files (size > 500 MB). req... | How to download a file over HTTP? | 0 | 27 | I have a small utility that I use to download an MP3 file from a website on a schedule and then builds/updates a podcast XML file which I've added to iTunes.
The text processing that creates/updates the XML file is written in Python. However, I use wget inside a Windows .bat file to download the actual MP3 file. I woul... | 2008-08-22T15:34:00.000 | python,http,urllib |
23 | 0 | 31,865 | 0 | 52,191 | 0 | 1 | false | 0.085505 | 3 | 23,397 | 1 | 0 | 0 | 0 | The Threading example from Eli will run the thread, but not do any of the work after that line.
I'm going to look into the processing module and the subprocess module. I think the com method I'm running needs to be in another process, not just in another thread. | What's the best way to duplicate fork() in windows? | 0 | 7 | How do I implement some logic that will allow me to reproduce on Windows the functionality that I have on Linux with the fork() system call, using Python?
I'm specifically trying to execute a method on the SAPI Com component, while continuing the other logic in the main thread without blocking or waiting. | 2008-08-22T20:27:00.000 | python,windows,process,subprocess,fork |
4 | 0 | 1,825 | 0 | 24,199 | 0 | 2 | false | 0.07983 | 2 | 24,193 | 0 | 0 | 0 | 0 | I recall that in previous versions of VS, there was a way to add custom build steps to the build process. I used that a lot to do exactly the kind of automated code generation you describe.
I imagine the custom build step feature is still there in 2008. | Python code generator for Visual Studio? | 1 | 5 | I had an idea, if I add a python .py file to my C# project, and tag the file with a custom generator that would execute the python file, and treat the output as the result of the code generation, ie. put it into a C# file, that would allow me to do quite a lot of code generation as part of the build process.
Does anyon... | 2008-08-23T12:41:00.000 | python,visual-studio-2008,code-generation |
4 | 0 | 1,825 | 0 | 24,236 | 0 | 2 | false | 0.039979 | 1 | 24,193 | 0 | 0 | 0 | 0 | I don't understand what you are trying to do here. Are you trying to execute a Python script that generates a C# file and then compile that with the project? Or are you trying to compile a Python script to C#? | Python code generator for Visual Studio? | 1 | 5 | I had an idea, if I add a python .py file to my C# project, and tag the file with a custom generator that would execute the python file, and treat the output as the result of the code generation, ie. put it into a C# file, that would allow me to do quite a lot of code generation as part of the build process.
Does anyon... | 2008-08-23T12:41:00.000 | python,visual-studio-2008,code-generation |
9 | 1 | 4,838 | 0 | 88,457 | 0 | 2 | false | 0 | 0 | 25,661 | 0 | 0 | 0 | 0 | I tried doing this myself a while ago, and I never got it to work perfectly. Actually I never got it to work at all under Windows, as it kept crashing the entire OS and I ran out of patience. I continued to use it though as it was only important it ran on Linux, and was only a small project. I'd strongly recommend you ... | pyGame within a pyGTK application | 0 | 7 | What is the best way to use PyGame (SDL) within a PyGTK application?
I'm searching for a method that allows me to have a drawing area in the GTK window and at the same time being able to manage both GTK and SDL events. | 2008-08-25T04:36:00.000 | python,gtk,pygtk,sdl,pygame |
9 | 1 | 4,838 | 0 | 199,288 | 0 | 2 | false | 0 | 0 | 25,661 | 0 | 0 | 0 | 0 | There's a simple solution that might work for you.
Write the PyGTK stuff and PyGame stuff as separate applications. Then from the PyGTK application call the PyGame application, using os.system to call the PyGame application. If you need to share data between the two then either use a database, pipes or IPC. | pyGame within a pyGTK application | 0 | 7 | What is the best way to use PyGame (SDL) within a PyGTK application?
I'm searching for a method that allows me to have a drawing area in the GTK window and at the same time being able to manage both GTK and SDL events. | 2008-08-25T04:36:00.000 | python,gtk,pygtk,sdl,pygame |
47 | 0 | 24,076 | 0 | 5,942,466 | 0 | 3 | false | 0.03076 | 2 | 26,025 | 0 | 1 | 0 | 0 | In my opinion best/fastest stack is varnish-nginx-uwsgi-django.
And I'm successfully using it. | Cleanest & Fastest server setup for Django | 0 | 13 | I'm about to deploy a mediumsized site powered by Django. I have a dedicated Ubuntu Server.
I'm really confused over which serversoftware to use. So i thought to myself: why not ask stackoverflow.
What i'm looking for is:
Easy to set up
Fast and easy on resources
Can serve mediafiles
Able to serve multiple djangosite... | 2008-08-25T13:28:00.000 | python,django,apache,hosting |
47 | 0 | 24,076 | 0 | 26,185 | 0 | 3 | false | 0.015383 | 1 | 26,025 | 0 | 1 | 0 | 0 | If you're using lighthttpd, you can also use FastCGI for serving Django. I'm not sure how the speed compares to mod_wsgi, but if memory serves correctly, you get a couple of the benefits that you would get with mod_wsgi that you wouldn't get with mod_python. The main one being that you can give each application its o... | Cleanest & Fastest server setup for Django | 0 | 13 | I'm about to deploy a mediumsized site powered by Django. I have a dedicated Ubuntu Server.
I'm really confused over which serversoftware to use. So i thought to myself: why not ask stackoverflow.
What i'm looking for is:
Easy to set up
Fast and easy on resources
Can serve mediafiles
Able to serve multiple djangosite... | 2008-08-25T13:28:00.000 | python,django,apache,hosting |
47 | 0 | 24,076 | 0 | 29,748 | 0 | 3 | true | 1.2 | 27 | 26,025 | 0 | 1 | 0 | 0 | Since I was looking for some more in-depth answers, I decided to research the issue myself in depth. Please let me know if I've misunderstood anything.
Some general recommendation are to use a separate webserver for handling media. By separate, I mean a webserver which is not running Django. This server can be for inst... | Cleanest & Fastest server setup for Django | 0 | 13 | I'm about to deploy a mediumsized site powered by Django. I have a dedicated Ubuntu Server.
I'm really confused over which serversoftware to use. So i thought to myself: why not ask stackoverflow.
What i'm looking for is:
Easy to set up
Fast and easy on resources
Can serve mediafiles
Able to serve multiple djangosite... | 2008-08-25T13:28:00.000 | python,django,apache,hosting |
6 | 1 | 584 | 0 | 139,047 | 0 | 2 | false | 0.099668 | 1 | 26,706 | 0 | 0 | 0 | 0 | There is no way to see dragged data in OnEnter and OnDragOver methods.
The only solution I found is to store the dragged item in some instance variable that is then readable inside these methods. | wxpython: How do I examine dragged data in OnDragOver? | 0 | 2 | I'm a bit perplexed by drag and drop in wxPython (but perhaps this questions pertains to drag and drop in other GUI frameworks as well). The frameworks provides a couple of callbacks (OnEnter and OnDragOver) that purportedly allow me to inform the system whether the current mouse position is a valid place to drop whate... | 2008-08-25T19:43:00.000 | python,user-interface,drag-and-drop,wxpython,wxwidgets |
6 | 1 | 584 | 0 | 26,707 | 0 | 2 | true | 1.2 | 1 | 26,706 | 0 | 0 | 0 | 0 | One solution, which is a hack of limited usefulness, is when a drag is initiated, store the dragged data in a global or static reference somewhere. This way, in the OnEnter and OnDragOver handlers, it is possible to get a reference to the data being dragged. This is of course only useful for drags within the same appli... | wxpython: How do I examine dragged data in OnDragOver? | 0 | 2 | I'm a bit perplexed by drag and drop in wxPython (but perhaps this questions pertains to drag and drop in other GUI frameworks as well). The frameworks provides a couple of callbacks (OnEnter and OnDragOver) that purportedly allow me to inform the system whether the current mouse position is a valid place to drop whate... | 2008-08-25T19:43:00.000 | python,user-interface,drag-and-drop,wxpython,wxwidgets |
11 | 0 | 1,284 | 0 | 1,041,655 | 1 | 2 | false | 0.119427 | 3 | 27,567 | 0 | 0 | 0 | 0 | PyPy translator is in general, not intended for more public use. We use it for translating
our own python interpreter (including JIT and GCs, both written in RPython, this restricted
subset of Python). The idea is that with good JIT and GC, you'll be able to speedups even
without knowing or using PyPy's translation too... | Where can I learn more about PyPy's translation function? | 0 | 5 | I've been having a hard time trying to understand PyPy's translation. It looks like something absolutely revolutionary from simply reading the description, however I'm hard-pressed to find good documentation on actually translating a real world piece of code to something such as LLVM. Does such a thing exist? The of... | 2008-08-26T08:40:00.000 | python,translation,pypy |
11 | 0 | 1,284 | 0 | 1,041,857 | 1 | 2 | false | 0.039979 | 1 | 27,567 | 0 | 0 | 0 | 0 | It looks like something absolutely revolutionary from simply reading the description,
As far as I know, PyPy is novel in the sense that it is the first system expressly designed for implementing languages. Other tools exist to help with much of the very front end, such as parser generators, or for the very back end, ... | Where can I learn more about PyPy's translation function? | 0 | 5 | I've been having a hard time trying to understand PyPy's translation. It looks like something absolutely revolutionary from simply reading the description, however I'm hard-pressed to find good documentation on actually translating a real world piece of code to something such as LLVM. Does such a thing exist? The of... | 2008-08-26T08:40:00.000 | python,translation,pypy |
74 | 0 | 39,816 | 0 | 14,046,877 | 0 | 3 | false | -0.057081 | -2 | 28,796 | 0 | 0 | 0 | 0 | You can use sed to perform this. The trick is to recall that regular expressions can recognize word boundaries. This works on all platforms provided you get the tools, which on Windows is Cygwin, Mac OS may require installing the dev tools, I'm not sure, and Linux has this out of the box. So grep, xargs, and sed should... | What refactoring tools do you use for Python? | 1 | 7 | I have a bunch of classes I want to rename. Some of them have names that are small and that name is reused in other class names, where I don't want that name changed. Most of this lives in Python code, but we also have some XML code that references class names.
Simple search and replace only gets me so far. In my ca... | 2008-08-26T18:26:00.000 | python,refactoring |
74 | 0 | 39,816 | 0 | 1,813,244 | 0 | 3 | false | 0.113791 | 4 | 28,796 | 0 | 0 | 0 | 0 | Your IDE can support refactorings !!
Check it Eric, Eclipse, WingIDE have build in tools for refactorings (Rename including). And that are very safe refactorings - if something can go wrong IDE wont do ref.
Also consider adding few unit test to ensure your code did not suffer during refactorings. | What refactoring tools do you use for Python? | 1 | 7 | I have a bunch of classes I want to rename. Some of them have names that are small and that name is reused in other class names, where I don't want that name changed. Most of this lives in Python code, but we also have some XML code that references class names.
Simple search and replace only gets me so far. In my ca... | 2008-08-26T18:26:00.000 | python,refactoring |
74 | 0 | 39,816 | 0 | 4,882,243 | 0 | 3 | false | 0.141893 | 5 | 28,796 | 0 | 0 | 0 | 0 | WingIDE 4.0 (WingIDE is my python IDE of choice) will support a few refactorings, but I just tried out the latest beta, beta6, and... there's still work to be done. Retract Method works nicely, but Rename Symbol does not.
Update: The 4.0 release has fixed all of the refactoring tools. They work great now. | What refactoring tools do you use for Python? | 1 | 7 | I have a bunch of classes I want to rename. Some of them have names that are small and that name is reused in other class names, where I don't want that name changed. Most of this lives in Python code, but we also have some XML code that references class names.
Simple search and replace only gets me so far. In my ca... | 2008-08-26T18:26:00.000 | python,refactoring |
8 | 0 | 1,090 | 0 | 31,926 | 1 | 1 | false | 0.197375 | 3 | 28,961 | 0 | 0 | 0 | 0 | If I have to expose APIs, I prefer doing it as JSON. Python has excellent support for JSON objects (JSON Objects are infact python dictionaries) | What's the best way to use web services in python? | 0 | 3 | I have a medium sized application that runs as a .net web-service which I do not control,
and I want to create a loose pythonic API above it to enable easy scripting.
I wanted to know what is the best/most practical solution for using web-services in python.
Edit:
I need to consume a complex soap WS
and I have no contr... | 2008-08-26T19:49:00.000 | python,web-services,soap |
4 | 0 | 653 | 0 | 31,384 | 0 | 4 | true | 1.2 | 1 | 29,856 | 1 | 1 | 0 | 0 | Personally, I wouldn't worry about it until you see a problem. Messing with the default python install on a *Nix system can cause more trouble than it's worth. I can say from personal experience that you never truly understand what python has done for the nix world until you have a problem with it.
You can also add a... | Install Python to match directory layout in OS X 10.5 | 0 | 5 | The default Python install on OS X 10.5 is 2.5.1 with a FAT 32 bit (Intel and PPC) client. I want to setup apache and mysql to run django. In the past, I have run Apache and MySQL to match this install in 32 bit mode (even stripping out the 64 bit stuff from Apache to make it work).
I want to upgrade Python to 64 bit. ... | 2008-08-27T10:22:00.000 | python,macos,64-bit |
4 | 0 | 653 | 0 | 31,331 | 0 | 4 | false | 0 | 0 | 29,856 | 1 | 1 | 0 | 0 | Essentially, yes. I was not sure you could do it like that (current version does not do it like that). When using the python install script, however, there is no option (that I can find) to specify where to put directories and files (eg --prefix). I was hoping to match the current layout of python related files so as t... | Install Python to match directory layout in OS X 10.5 | 0 | 5 | The default Python install on OS X 10.5 is 2.5.1 with a FAT 32 bit (Intel and PPC) client. I want to setup apache and mysql to run django. In the past, I have run Apache and MySQL to match this install in 32 bit mode (even stripping out the 64 bit stuff from Apache to make it work).
I want to upgrade Python to 64 bit. ... | 2008-08-27T10:22:00.000 | python,macos,64-bit |
4 | 0 | 653 | 0 | 30,591 | 0 | 4 | false | 0.039979 | 1 | 29,856 | 1 | 1 | 0 | 0 | Not sure I entirely understand your question, but can't you simply build and install a 64 bit version and then create symbolic links so that /Library/Python/2.5 and below point to your freshly built version of python? | Install Python to match directory layout in OS X 10.5 | 0 | 5 | The default Python install on OS X 10.5 is 2.5.1 with a FAT 32 bit (Intel and PPC) client. I want to setup apache and mysql to run django. In the past, I have run Apache and MySQL to match this install in 32 bit mode (even stripping out the 64 bit stuff from Apache to make it work).
I want to upgrade Python to 64 bit. ... | 2008-08-27T10:22:00.000 | python,macos,64-bit |
4 | 0 | 653 | 0 | 31,425 | 0 | 4 | false | 0 | 0 | 29,856 | 1 | 1 | 0 | 0 | The short answer is because I can. The long answer, expanding on what the OP said, is to be more compatible with apache and mysql/postgresql. They are all 64bit (apache is a fat binary with ppc, ppc64 x86 and x86 and x86_64, the others just straight 64bit). Mysqldb and mod_python wont compile unless they are all runnin... | Install Python to match directory layout in OS X 10.5 | 0 | 5 | The default Python install on OS X 10.5 is 2.5.1 with a FAT 32 bit (Intel and PPC) client. I want to setup apache and mysql to run django. In the past, I have run Apache and MySQL to match this install in 32 bit mode (even stripping out the 64 bit stuff from Apache to make it work).
I want to upgrade Python to 64 bit. ... | 2008-08-27T10:22:00.000 | python,macos,64-bit |
89 | 0 | 43,779 | 0 | 1,197,151 | 0 | 1 | false | 0.057081 | 2 | 31,340 | 0 | 0 | 0 | 0 | Try to remember that the GIL is set to poll around every so often in order to do show the appearance of multiple tasks. This setting can be fine tuned, but I offer the suggestion that there should be work that the threads are doing or lots of context switches are going to cause problems.
I would go so far as to suggest... | How do threads work in Python, and what are common Python-threading specific pitfalls? | 1 | 7 | I've been trying to wrap my head around how threads work in Python, and it's hard to find good information on how they operate. I may just be missing a link or something, but it seems like the official documentation isn't very thorough on the subject, and I haven't been able to find a good write-up.
From what I can tel... | 2008-08-27T23:44:00.000 | python,multithreading |
9 | 0 | 1,904 | 0 | 33,325 | 1 | 1 | false | 0 | 0 | 32,385 | 0 | 0 | 0 | 0 | I had the same issue and I simply opened the file and did some replace: then reload the file in the Python interpreter. This works fine and is easy to do.
Otherwise AFAIK you have to use some conf objects. | Programmatically editing Python source | 0 | 3 | This is something that I think would be very useful. Basically, I'd like there to be a way to edit Python source programmatically without requiring human intervention. There are a couple of things I would like to do with this:
Edit the configuration of Python apps that use source modules for configuration.
Set up a ... | 2008-08-28T14:23:00.000 | python,file-io |
267 | 0 | 222,118 | 0 | 24,495,011 | 0 | 1 | false | 0.07983 | 2 | 33,978 | 0 | 0 | 0 | 0 | For big objects you may use a somewhat crude but effective method:
check how much memory your Python process occupies in the system, then delete the object and compare.
This method has many drawbacks but it will give you a very fast estimate for very big objects. | Find out how much memory is being used by an object in Python | 1 | 5 | How would you go about finding out how much memory is being used by an object? I know it is possible to find out how much is used by a block of code, but not by an instantiated object (anytime during its life), which is what I want. | 2008-08-29T04:59:00.000 | python,performance,memory-profiling |
28 | 0 | 12,462 | 0 | 576,667 | 0 | 3 | false | 0.066568 | 2 | 34,020 | 0 | 0 | 0 | 0 | If you want to code in python and get great threading support, you might want to check out IronPython or Jython. Since the python code in IronPython and Jython run on the .NET CLR and Java VM respectively, they enjoy the great threading support built into those libraries. In addition to that, IronPython doesn't have th... | Are Python threads buggy? | 1 | 6 | A reliable coder friend told me that Python's current multi-threading implementation is seriously buggy - enough to avoid using altogether. What can said about this rumor? | 2008-08-29T05:43:00.000 | python,multithreading |
28 | 0 | 12,462 | 0 | 34,024 | 0 | 3 | false | -0.066568 | -2 | 34,020 | 0 | 0 | 0 | 0 | I've used it in several applications and have never had nor heard of threading being anything other than 100% reliable, as long as you know its limits. You can't spawn 1000 threads at the same time and expect your program to run properly on Windows, however you can easily write a worker pool and just feed it 1000 oper... | Are Python threads buggy? | 1 | 6 | A reliable coder friend told me that Python's current multi-threading implementation is seriously buggy - enough to avoid using altogether. What can said about this rumor? | 2008-08-29T05:43:00.000 | python,multithreading |
28 | 0 | 12,462 | 0 | 34,078 | 0 | 3 | false | 1 | 9 | 34,020 | 0 | 0 | 0 | 0 | The GIL (Global Interpreter Lock) might be a problem, but the API is quite OK. Try out the excellent processing module, which implements the Threading API for separate processes. I am using that right now (albeit on OS X, have yet to do some testing on Windows) and am really impressed. The Queue class is really saving ... | Are Python threads buggy? | 1 | 6 | A reliable coder friend told me that Python's current multi-threading implementation is seriously buggy - enough to avoid using altogether. What can said about this rumor? | 2008-08-29T05:43:00.000 | python,multithreading |
58 | 0 | 95,434 | 0 | 3,942,980 | 0 | 1 | false | 1 | 15 | 34,079 | 0 | 0 | 1 | 0 | Setting an environment var named http_proxy like this: http://username:password@proxy_url:port | How to specify an authenticated proxy for a python http connection? | 0 | 6 | What's the best way to specify a proxy with username and password for an http connection in python? | 2008-08-29T06:55:00.000 | python,http,proxy |
10 | 0 | 888 | 0 | 34,266 | 1 | 1 | true | 1.2 | 4 | 34,243 | 0 | 0 | 0 | 0 | I've not heard of a direct equivalent either. You could probably achieve the same effect with macros, especially in a language like Lisp which has extremely powerful macros.
I wouldn't be at all surprised if other languages start to incorporate something similar because it is so powerful. | Python descriptor protocol analog in other languages? | 1 | 2 | Is there something like the Python descriptor protocol implemented in other languages? It seems like a nice way to increase modularity/encapsulation without bloating your containing class' implementation, but I've never heard of a similar thing in any other languages. Is it likely absent from other languages because of... | 2008-08-29T09:24:00.000 | python,language-features,encapsulation |
592 | 0 | 564,030 | 0 | 20,100,900 | 1 | 1 | false | 1 | 132 | 34,439 | 0 | 0 | 0 | 0 | The simplest method is to use dir(objectname). It will display all the methods available for that object. | Finding what methods a Python object has | 1 | 22 | Given a Python object of any kind, is there an easy way to get the list of all methods that this object has?
Or,
if this is not possible, is there at least an easy way to check if it has a particular method other than simply checking if an error occurs when the method is called? | 2008-08-29T15:05:00.000 | python,introspection |
9 | 0 | 473 | 0 | 39,062 | 0 | 1 | false | 0.197375 | 2 | 35,634 | 0 | 0 | 0 | 0 | You could also use __id__. This gives you the objects internal ID number, which is always unique. To check if to objects are the same, try
a.__id__ = b.__id__
This is how Ruby's standard library does it as far as I can tell (see group_by and others). | Ruby "is" equivalent | 1 | 2 | Is there a Ruby equivalent for Python's "is"? It tests whether two objects are identical (i.e. have the same memory location). | 2008-08-30T03:04:00.000 | python,ruby |
29 | 0 | 29,152 | 0 | 35,777 | 1 | 8 | false | 1 | 23 | 35,753 | 0 | 0 | 0 | 0 | You'll find mostly two answers to that – the religous one (Yes! Of course! It's the best language ever!) and the other religious one (you gotta be kidding me! Python? No... it's not mature enough). I will maybe skip the last religion (Python?! Use Ruby!). The truth, as always, is far from obvious.
Pros: it's easy, rea... | Is Python good for big software projects (not web based)? | 1 | 13 | Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity).
Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it i... | 2008-08-30T07:08:00.000 | python,ide |
29 | 0 | 29,152 | 0 | 277,490 | 1 | 8 | false | 0 | 0 | 35,753 | 0 | 0 | 0 | 0 | I had only one python experience, my trash-cli project.
I know that probably some or all problems depends of my inexperience with python.
I found frustrating these things:
the difficult of finding a good IDE for free
the limited support to automatic refactoring
Moreover:
the need of introduce two level of grouping ... | Is Python good for big software projects (not web based)? | 1 | 13 | Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity).
Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it i... | 2008-08-30T07:08:00.000 | python,ide |
29 | 0 | 29,152 | 0 | 35,759 | 1 | 8 | false | 1 | 13 | 35,753 | 0 | 0 | 0 | 0 | I really like python, it's usually my language of choice these days for small (non-gui) stuff that I do on my own.
However, for some larger Python projects I've tackled, I'm finding that it's not quite the same as programming in say, C++. I was working on a language parser, and needed to represent an AST in Python. Thi... | Is Python good for big software projects (not web based)? | 1 | 13 | Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity).
Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it i... | 2008-08-30T07:08:00.000 | python,ide |
29 | 0 | 29,152 | 0 | 35,838 | 1 | 8 | false | 0 | 0 | 35,753 | 0 | 0 | 0 | 0 | I know I'm probably stating the obvious, but don't forget that the quality of the development team and their familiarity with the technology will have a major impact on your ability to deliver.
If you have a strong team, then it's probably not an issue if they're familiar. But if you have people who are more 9 to 5'rs... | Is Python good for big software projects (not web based)? | 1 | 13 | Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity).
Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it i... | 2008-08-30T07:08:00.000 | python,ide |
29 | 0 | 29,152 | 0 | 286,449 | 1 | 8 | false | 0.015383 | 1 | 35,753 | 0 | 0 | 0 | 0 | And as far as I know they use a lot of python inside google too.
Well i'd hope so, the maker of python still works at google if i'm not mistaken?
As for the use of Python, i think it's a great language for stand-alone apps. It's heavily used in a lot of Linux programs, and there are a few nice widget sets out there t... | Is Python good for big software projects (not web based)? | 1 | 13 | Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity).
Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it i... | 2008-08-30T07:08:00.000 | python,ide |
29 | 0 | 29,152 | 0 | 286,491 | 1 | 8 | false | 0.015383 | 1 | 35,753 | 0 | 0 | 0 | 0 | Python is a delight to use. I use it routinely and also write a lot of code for work in C#. There are two drawbacks to writing UI code in Python. one is that there is not a single ui framework that is accepted by the majority of the community. when you write in c# the .NET runtime and class libraries are all meant to w... | Is Python good for big software projects (not web based)? | 1 | 13 | Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity).
Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it i... | 2008-08-30T07:08:00.000 | python,ide |
29 | 0 | 29,152 | 0 | 3,445,481 | 1 | 8 | false | 0 | 0 | 35,753 | 0 | 0 | 0 | 0 | Try Django or Pylons, write a simple app with both of them and then decide which one suits you best. There are others (like Turbogears or Werkzeug) but those are the most used. | Is Python good for big software projects (not web based)? | 1 | 13 | Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity).
Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it i... | 2008-08-30T07:08:00.000 | python,ide |
29 | 0 | 29,152 | 0 | 35,841 | 1 | 8 | false | 0.046121 | 3 | 35,753 | 0 | 0 | 0 | 0 | Refactoring is inevitable on larger codebases and the lack of static typing makes this much harder in python than in statically typed languages. | Is Python good for big software projects (not web based)? | 1 | 13 | Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity).
Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it i... | 2008-08-30T07:08:00.000 | python,ide |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 16