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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1,453,952 | 2009-09-21T10:52:00.000 | 7 | 0 | 1 | 0 | python,module,standard-library | 1,456,440 | 16 | false | 0 | 0 | I'd go for a few modules which make the most sense to a typical computer user/programmer performing typical computer tasks. That way, there's the largest chance that they might actually use python on their own time.
In my opinion, the operations most people will likely perform are file operations, for example going ove... | 11 | 55 | 0 | I am teaching a graduate level Python class at the University of Paris, and the students need to be introduced to the standard library. I want to discuss with them about some of the most important standard modules.
What modules do you think are absolute musts? Even though responses probably vary depending on your fie... | Most useful Python modules from the standard library? | 1 | 0 | 0 | 24,060 |
1,453,952 | 2009-09-21T10:52:00.000 | 5 | 0 | 1 | 0 | python,module,standard-library | 1,454,053 | 16 | false | 0 | 0 | I would add urllib2 to the list. | 11 | 55 | 0 | I am teaching a graduate level Python class at the University of Paris, and the students need to be introduced to the standard library. I want to discuss with them about some of the most important standard modules.
What modules do you think are absolute musts? Even though responses probably vary depending on your fie... | Most useful Python modules from the standard library? | 0.062419 | 0 | 0 | 24,060 |
1,453,952 | 2009-09-21T10:52:00.000 | 33 | 0 | 1 | 0 | python,module,standard-library | 1,453,974 | 16 | false | 0 | 0 | I'd offer itertools and functools. These modules operate over abstractions that are found everywhere in programming, so I think they are useful to study. Among more practical things, xml modules (xml.dom, xml.sax) can be very useful. | 11 | 55 | 0 | I am teaching a graduate level Python class at the University of Paris, and the students need to be introduced to the standard library. I want to discuss with them about some of the most important standard modules.
What modules do you think are absolute musts? Even though responses probably vary depending on your fie... | Most useful Python modules from the standard library? | 1 | 0 | 0 | 24,060 |
1,455,642 | 2009-09-21T17:09:00.000 | 0 | 0 | 0 | 0 | python,sqlite,pysqlite | 1,455,663 | 4 | false | 0 | 0 | If you don't have root privileges, I would recommend installing a more recent version of Python in your home directory and then adding your local version to your PATH. It seems easier to go that direction than to try to make sqlite work with an old version of Python.
You will also be doing yourself a favor by using a r... | 2 | 0 | 0 | I would like to use pysqlite interface between Python and sdlite database. I have already Python and SQLite on my computer. But I have troubles with installation of pysqlite. During the installation I get the following error message:
error: command 'gcc' failed with exit status 1
As far as I understood the problems a... | How to build sqlite for Python 2.4? | 0 | 0 | 0 | 2,825 |
1,455,642 | 2009-09-21T17:09:00.000 | 0 | 0 | 0 | 0 | python,sqlite,pysqlite | 2,805,287 | 4 | false | 0 | 0 | I had the same trouble with gcc failing with Ubuntu Karmic. I fixed this by installing the python-dev package. In my case, I'm working with python2.4, so I installed the python2.4-dev package. The python-dev package should work for python2.6. | 2 | 0 | 0 | I would like to use pysqlite interface between Python and sdlite database. I have already Python and SQLite on my computer. But I have troubles with installation of pysqlite. During the installation I get the following error message:
error: command 'gcc' failed with exit status 1
As far as I understood the problems a... | How to build sqlite for Python 2.4? | 0 | 0 | 0 | 2,825 |
1,456,269 | 2009-09-21T19:10:00.000 | -3 | 1 | 1 | 0 | python,git | 2,180,936 | 11 | false | 0 | 0 | For the record, none of the aforementioned Git Python libraries seem to contain a "git status" equivalent, which is really the only thing I would want since dealing with the rest of the git commands via subprocess is so easy. | 3 | 177 | 0 | What are people's experiences with any of the Git modules for Python? (I know of GitPython, PyGit, and Dulwich - feel free to mention others if you know of them.)
I am writing a program which will have to interact (add, delete, commit) with a Git repository, but have no experience with Git, so one of the things I'm lo... | Python Git Module experiences? | -0.054491 | 0 | 0 | 120,684 |
1,456,269 | 2009-09-21T19:10:00.000 | 0 | 1 | 1 | 0 | python,git | 1,478,107 | 11 | false | 0 | 0 | The git interaction library part of StGit is actually pretty good. However, it isn't broken out as a separate package but if there is sufficient interest, I'm sure that can be fixed.
It has very nice abstractions for representing commits, trees etc, and for creating new commits and trees. | 3 | 177 | 0 | What are people's experiences with any of the Git modules for Python? (I know of GitPython, PyGit, and Dulwich - feel free to mention others if you know of them.)
I am writing a program which will have to interact (add, delete, commit) with a Git repository, but have no experience with Git, so one of the things I'm lo... | Python Git Module experiences? | 0 | 0 | 0 | 120,684 |
1,456,269 | 2009-09-21T19:10:00.000 | 18 | 1 | 1 | 0 | python,git | 1,458,963 | 11 | false | 0 | 0 | Maybe it helps, but Bazaar and Mercurial are both using dulwich for their Git interoperability.
Dulwich is probably different than the other in the sense that's it's a reimplementation of git in python. The other might just be a wrapper around Git's commands (so it could be simpler to use from a high level point of vie... | 3 | 177 | 0 | What are people's experiences with any of the Git modules for Python? (I know of GitPython, PyGit, and Dulwich - feel free to mention others if you know of them.)
I am writing a program which will have to interact (add, delete, commit) with a Git repository, but have no experience with Git, so one of the things I'm lo... | Python Git Module experiences? | 1 | 0 | 0 | 120,684 |
1,456,373 | 2009-09-21T19:27:00.000 | 11 | 0 | 1 | 0 | python | 1,456,390 | 15 | false | 0 | 0 | Two hash maps is actually probably the fastest-performing solution assuming you can spare the memory. I would wrap those in a single class - the burden on the programmer is in ensuring that two the hash maps sync up correctly. | 3 | 116 | 0 | I'm doing this switchboard thing in python where I need to keep track of who's talking to whom, so if Alice --> Bob, then that implies that Bob --> Alice.
Yes, I could populate two hash maps, but I'm wondering if anyone has an idea to do it with one.
Or suggest another data structure.
There are no multiple conversati... | Two way/reverse map | 1 | 0 | 0 | 62,169 |
1,456,373 | 2009-09-21T19:27:00.000 | 1 | 0 | 1 | 0 | python | 1,457,749 | 15 | false | 0 | 0 | The kjbuckets C extension module provides a "graph" data structure which I believe gives you what you want. | 3 | 116 | 0 | I'm doing this switchboard thing in python where I need to keep track of who's talking to whom, so if Alice --> Bob, then that implies that Bob --> Alice.
Yes, I could populate two hash maps, but I'm wondering if anyone has an idea to do it with one.
Or suggest another data structure.
There are no multiple conversati... | Two way/reverse map | 0.013333 | 0 | 0 | 62,169 |
1,456,373 | 2009-09-21T19:27:00.000 | 5 | 0 | 1 | 0 | python | 1,456,389 | 15 | false | 0 | 0 | No, there is really no way to do this without creating two dictionaries. How would it be possible to implement this with just one dictionary while continuing to offer comparable performance?
You are better off creating a custom type that encapsulates two dictionaries and exposes the functionality you want. | 3 | 116 | 0 | I'm doing this switchboard thing in python where I need to keep track of who's talking to whom, so if Alice --> Bob, then that implies that Bob --> Alice.
Yes, I could populate two hash maps, but I'm wondering if anyone has an idea to do it with one.
Or suggest another data structure.
There are no multiple conversati... | Two way/reverse map | 0.066568 | 0 | 0 | 62,169 |
1,457,104 | 2009-09-21T21:55:00.000 | 110 | 0 | 0 | 1 | python,nose | 1,579,787 | 7 | false | 0 | 0 | The other thing which always gets me with nose is that it won't run tests in executable files. I'm not exactly sure why that would make a difference across Mac/Ubuntu, but it's worth a shot.
Make sure that the scripts didn't somehow get chmod +x'd on the Mac… And if they did, fix them with chmod -x $(find tests/ -name ... | 2 | 54 | 0 | Is there any reason why Nose wouldn't be able to find tests in Ubuntu 9.04?
I'm using nose 0.11.1 with python 2.5.4.
I can run tests only if I explicitly specify the filename.
If I don't specify the filename it just says, 0 tests.
The same project runs tests fine on my Mac, so I'm quite stumped! | Nose unable to find tests in ubuntu | 1 | 0 | 0 | 20,517 |
1,457,104 | 2009-09-21T21:55:00.000 | 2 | 0 | 0 | 1 | python,nose | 47,909,167 | 7 | false | 0 | 0 | Use the -all-modules and it will find all the tests.
nosetests --all-modules ./tests | 2 | 54 | 0 | Is there any reason why Nose wouldn't be able to find tests in Ubuntu 9.04?
I'm using nose 0.11.1 with python 2.5.4.
I can run tests only if I explicitly specify the filename.
If I don't specify the filename it just says, 0 tests.
The same project runs tests fine on my Mac, so I'm quite stumped! | Nose unable to find tests in ubuntu | 0.057081 | 0 | 0 | 20,517 |
1,457,308 | 2009-09-21T22:56:00.000 | 2 | 0 | 1 | 0 | python,import | 1,457,700 | 4 | false | 0 | 0 | That's why you have parameters.
It's not the job of c.py to determine who imported it.
It's the job of a.py or b.py to pass the variable __name__ to the functions or classes in c.py. | 1 | 5 | 0 | How do I find the name of the file that is the "importer", within the imported file?
If a.py and b.py both import c.py, is there anyway that c.py can know the name of the file importing it? | How do I find the name of the file that is the importer, within the imported file? | 0.099668 | 0 | 0 | 714 |
1,458,087 | 2009-09-22T04:23:00.000 | 5 | 0 | 0 | 0 | python,sockets | 1,458,109 | 2 | false | 0 | 0 | SOCK_DGRAM means you want to send packets by UDP -- no order guarantee, no guarantee of reception, no guarantee of lack of repetition. SOCK_STREAM would imply TCP -- no packet boundary guarantee, but (unless the connection's dropped;-) guarantee of order, reception, and no duplication. TCP/IP, the networking model tha... | 2 | 2 | 0 | I am sending packets from one pc to other. I am using python socket socket.socket(socket.AF_INET, socket.SOCK_DGRAM ). Do we need to take care of order in which packets are received ?
In ISO-OSI model layers below transport layer handle all packets communication. Do all ISO-OSI layers present in the program ? Or some ... | Python socket programming and ISO-OSI model | 0.462117 | 0 | 1 | 2,274 |
1,458,087 | 2009-09-22T04:23:00.000 | 4 | 0 | 0 | 0 | python,sockets | 1,458,734 | 2 | true | 0 | 0 | To answer your immediate question, if you're using SOCK_STREAM, then you're actually using TCP, which is an implementation of the transport layer which does take care of packet ordering and integrity for you. So it sounds like that's what you want to use. SOCK_DGRAM is actually UDP, which doesn't take care of any integ... | 2 | 2 | 0 | I am sending packets from one pc to other. I am using python socket socket.socket(socket.AF_INET, socket.SOCK_DGRAM ). Do we need to take care of order in which packets are received ?
In ISO-OSI model layers below transport layer handle all packets communication. Do all ISO-OSI layers present in the program ? Or some ... | Python socket programming and ISO-OSI model | 1.2 | 0 | 1 | 2,274 |
1,458,690 | 2009-09-22T07:53:00.000 | 0 | 1 | 0 | 0 | c#,python,outlook,ms-word,mapi | 1,483,115 | 2 | false | 0 | 0 | OK, to answer my own question. I need to build a DLL with "MAPISendDocuments" and/or "MAPISendMail" functions defined.
This DLL can have any name, and is referenced in the registry at HKLM/Software/Clients/Mail/MyMailApp/DLLPath.
Found examples using Delphi... | 1 | 1 | 0 | Microsoft Word has "send as attachment" functionality which creates a new message in Outlook with the document attached.
I would like to replace Outlook with a custom mail agent, but I do not know how to achieve this. Now my mail agent is simply a program that runs, and takes a file name as parameter.
As far as I kno... | How to create a MAPI32.dll stub to be able to "send as attachment" from MS Word? | 0 | 0 | 0 | 3,109 |
1,458,829 | 2009-09-22T08:41:00.000 | 1 | 0 | 0 | 0 | python,django,django-urls,django-middleware | 1,460,317 | 3 | true | 1 | 0 | I think this really depends on your problem and what exactly you are trying to do.
You cannot change the URL without redirecting the user, as you cannot modify the URL on a page without a reload. Basically a redirect is a response telling the user to move on, there is no way to actually change the URL. Note that even i... | 2 | 3 | 0 | I don't know if it's possible but I'd like to add few parameters at the end of the URL using middleware. Can it be done without redirect after modyfing requested URL?
ie.
user clicks: .../some_link
and middleware rewrites it to: .../some_link?par1=1&par2=2
Other way is to modify reponse and replace every HTML link but ... | Modify address in Django middleware | 1.2 | 0 | 0 | 1,984 |
1,458,829 | 2009-09-22T08:41:00.000 | 0 | 0 | 0 | 0 | python,django,django-urls,django-middleware | 1,458,950 | 3 | false | 1 | 0 | You can do whatever you like in the middleware. You have access to the request object, you can get the URL and redirect to a new one if you want.
My question would be, why do you want to do this? If you need to keep information about the request, the proper place to do this is in the session. | 2 | 3 | 0 | I don't know if it's possible but I'd like to add few parameters at the end of the URL using middleware. Can it be done without redirect after modyfing requested URL?
ie.
user clicks: .../some_link
and middleware rewrites it to: .../some_link?par1=1&par2=2
Other way is to modify reponse and replace every HTML link but ... | Modify address in Django middleware | 0 | 0 | 0 | 1,984 |
1,462,565 | 2009-09-22T20:57:00.000 | 0 | 0 | 0 | 0 | python,header,pysqlite | 1,462,623 | 3 | false | 0 | 0 | pysqlite needs to compiled/build before you can use it. This requires C language header files (*.H) which come with the source code of sqllite itself.
i.e. sqllite and pysqlite are two different things. Did you install sqlite prior to trying and build pysqllte ? (or maybe you did, but did you do so just with the bin... | 2 | 12 | 0 | I am trying to install pysqlite and have troubles with that. I found out that the most probable reason of that is missing sqlite headers and I have to install them.
However, I have no ideas what these headers are (where I can find them, what they are doing and how to install them).
Can anybody, pleas, help me with that... | What are sqlite development headers and how to install them? | 0 | 1 | 0 | 17,278 |
1,462,565 | 2009-09-22T20:57:00.000 | 7 | 0 | 0 | 0 | python,header,pysqlite | 5,671,345 | 3 | false | 0 | 0 | For me this worked (Redhat/CentOS):
$ sudo yum install sqlite-devel | 2 | 12 | 0 | I am trying to install pysqlite and have troubles with that. I found out that the most probable reason of that is missing sqlite headers and I have to install them.
However, I have no ideas what these headers are (where I can find them, what they are doing and how to install them).
Can anybody, pleas, help me with that... | What are sqlite development headers and how to install them? | 1 | 1 | 0 | 17,278 |
1,462,986 | 2009-09-22T22:32:00.000 | 1 | 1 | 1 | 0 | python,module,variables,lazy-loading,itunes | 1,463,036 | 8 | false | 0 | 0 | If that variable lived in a class rather than a module, then you could overload getattr, or better yet, populate it in init. | 1 | 41 | 0 | I'm trying to find a way to lazily load a module-level variable.
Specifically, I've written a tiny Python library to talk to iTunes, and I want to have a DOWNLOAD_FOLDER_PATH module variable. Unfortunately, iTunes won't tell you where its download folder is, so I've written a function that grabs the filepath of a few p... | Lazy module variables--can it be done? | 0.024995 | 0 | 0 | 14,915 |
1,464,923 | 2009-09-23T09:27:00.000 | 1 | 0 | 1 | 0 | python,arrays,perl | 1,466,626 | 8 | false | 0 | 0 | @array = qw(1 2 3 4 5 6 7 8 9);
print @array[(grep { ($_ + 1) % 3 == 0 } (1..$#array))]; | 1 | 6 | 0 | How can I do a for() or foreach() loop in Python and Perl, respectively, that only prints every third index? I need to move every third index to a new array. | How can I print only every third index in Perl or Python? | 0.024995 | 0 | 0 | 5,473 |
1,464,961 | 2009-09-23T09:34:00.000 | 0 | 0 | 0 | 0 | python,amazon-s3,boto | 7,366,501 | 6 | false | 0 | 0 | Note that the 'copy' method on the Key object has a "preserve_acl" parameter (False by default) that will copy the source's ACL to the destination object. | 3 | 17 | 0 | I have a file contained in a key in my S3 bucket. I want to create a new key, which will contain the same file. Is it possible to do without downloading that file?
I'm looking for a solution in Python (and preferably boto library). | How to clone a key in Amazon S3 using Python (and boto)? | 0 | 0 | 1 | 9,405 |
1,464,961 | 2009-09-23T09:34:00.000 | 4 | 0 | 0 | 0 | python,amazon-s3,boto | 1,466,148 | 6 | false | 0 | 0 | Browsing through boto's source code I found that the Key object has a "copy" method. Thanks for your suggestion about CopyObject operation. | 3 | 17 | 0 | I have a file contained in a key in my S3 bucket. I want to create a new key, which will contain the same file. Is it possible to do without downloading that file?
I'm looking for a solution in Python (and preferably boto library). | How to clone a key in Amazon S3 using Python (and boto)? | 0.132549 | 0 | 1 | 9,405 |
1,464,961 | 2009-09-23T09:34:00.000 | 2 | 0 | 0 | 0 | python,amazon-s3,boto | 1,465,978 | 6 | false | 0 | 0 | S3 allows object by object copy.
The CopyObject operation creates a copy of an object when you specify the key and bucket of a source object and the key and bucket of a target destination.
Not sure if boto has a compact implementation. | 3 | 17 | 0 | I have a file contained in a key in my S3 bucket. I want to create a new key, which will contain the same file. Is it possible to do without downloading that file?
I'm looking for a solution in Python (and preferably boto library). | How to clone a key in Amazon S3 using Python (and boto)? | 0.066568 | 0 | 1 | 9,405 |
1,465,036 | 2009-09-23T09:53:00.000 | 25 | 0 | 1 | 1 | python,centos,rpath | 1,465,105 | 15 | false | 0 | 0 | No, that's it. You might want to make sure you have all optional library headers installed too so you don't have to recompile it later. They are listed in the documentation I think.
Also, you can install it even in the standard path if you do make altinstall. That way it won't override your current default "python". | 1 | 87 | 0 | I have a shell that runs CentOS.
For a project I'm doing, I need python 2.5+, but centOS is pretty dependent on 2.4.
From what I've read, a number of things will break if you upgrade to 2.5.
I want to install 2.5 separately from 2.4, but I'm not sure how to do it. So far I've downloaded the source tarball, untarred it,... | Install python 2.6 in CentOS | 1 | 0 | 0 | 189,056 |
1,465,302 | 2009-09-23T10:56:00.000 | 2 | 0 | 1 | 0 | python,api | 1,465,505 | 2 | false | 0 | 0 | First, look at modules on pypi. Download several that are related to what you're doing so you can see exactly what the state of the art is.
For example, look at easy_install for an example of something like what you're proposing.
After looking at other modules, write yours to look like theirs.
Then publish informati... | 1 | 4 | 0 | What steps would be necessary, and what kind of maintenance would be expected if I wanted to contribute a module to the Python standard API? For example I have a module that encapsulates automated update functionality similar to Java's JNLP. | What is involved in adding to the standard Python API? | 0.197375 | 0 | 1 | 129 |
1,465,769 | 2009-09-23T12:47:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,dns,subdomain | 1,480,797 | 5 | false | 1 | 0 | You can't do this, because you don't own no-ip.org. In order to use a domain with App Engine, you have to set up Google Apps on the domain, and in order to do that, you must own the domain.
As mentioned in the comments, buying your own domain is your best option. | 1 | 0 | 0 | I'd like to run an appengine app on a subdomain
like something.no-ip.org instead of something.appspot.com
is this doable? If so, can you please help me understand? :)
Thank you so much for your help! | appengine and no-ip.org | 0.039979 | 0 | 0 | 875 |
1,465,846 | 2009-09-23T13:01:00.000 | 7 | 0 | 0 | 0 | python,mysql,django,osx-snow-leopard | 6,537,345 | 8 | false | 1 | 0 | On MAC OS X 10.6, Install the package as usual. The dynamic import error occurs because of wrong DYLD path. Export the path and open up a python terminal.
$ sudo python setup.py clean
$ sudo python setup.py build
$ sudo python setup.py install
$ export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
$python
... | 1 | 7 | 0 | I am trying to get started on working with Python on Django I am by profession a PHP developer and have been told to set up django and python on my current apache and mysql setup however I am having trouble getting the Mysqldb module for python to work, I must of followed about 6 different set of instructions, I am run... | Install mysqldb on snow leopard | 1 | 1 | 0 | 7,786 |
1,466,917 | 2009-09-23T15:55:00.000 | 4 | 0 | 0 | 0 | python,abap,sap-basis,pyrfc | 1,467,921 | 7 | false | 0 | 0 | Sap is NOT a database server.
But with the Python SAP RFC module you can query most table quite easily. It is using some sap unsupported function ( that all the world is using). And this function has some limitation on field size and datatypes. | 2 | 36 | 0 | Can Python be used to query a SAP database? | Query SAP database from Python? | 0.113791 | 1 | 0 | 48,208 |
1,466,917 | 2009-09-23T15:55:00.000 | 1 | 0 | 0 | 0 | python,abap,sap-basis,pyrfc | 59,210,473 | 7 | false | 0 | 0 | Python is one of the most used object-oriented programming languages which is very easy to code and understand.
In order to use Python with SAP, we need to install Python SAP RFC module which is known as PyRFC. One of its available methods is RFC_READ_TABLE which can be called to read data from a table in SAP database.... | 2 | 36 | 0 | Can Python be used to query a SAP database? | Query SAP database from Python? | 0.028564 | 1 | 0 | 48,208 |
1,467,827 | 2009-09-23T18:31:00.000 | 1 | 0 | 1 | 0 | python,jython,pydev | 1,849,587 | 2 | false | 0 | 0 | If you have a machine with more than one processor you could try starting eclipse/pydev with the options -vmargs -XX:+UseParallelGC You could also try different JVMs to see if any of them give better performance. | 2 | 3 | 0 | i'm working with pydev + jython.great ide , but quite slow when i try to run a jython program.
this is probably something due to libraries load time.
What can i do to speed it up ?
Thanks ,
yaniv | How do i make Pydev + jython to startup faster when running a script? | 0.099668 | 0 | 0 | 1,594 |
1,467,827 | 2009-09-23T18:31:00.000 | 2 | 0 | 1 | 0 | python,jython,pydev | 1,902,449 | 2 | false | 0 | 0 | Jython startup time is slow ... there's a lot to bootup!
Everytime you run a Jython script from scratch, it will incur the same Jython startup time cost.
Hence, the reason Jython, Java, and Python are not great for CGI invocations. Hence, the reason for mod_python in Apache.
The key is to start-up Jython once and reuse... | 2 | 3 | 0 | i'm working with pydev + jython.great ide , but quite slow when i try to run a jython program.
this is probably something due to libraries load time.
What can i do to speed it up ?
Thanks ,
yaniv | How do i make Pydev + jython to startup faster when running a script? | 0.197375 | 0 | 0 | 1,594 |
1,468,314 | 2009-09-23T20:20:00.000 | 1 | 0 | 0 | 1 | python,documentation,cross-platform,chm | 1,809,732 | 2 | false | 1 | 0 | wxHtmlHelpController doesn't support any scripting within pages, nor does it support css. | 1 | 0 | 0 | I am looking for a help viewer like Windows CHM that basically provides support for
adding content in HTML format
define Table of Contents
decent search
It should work on Windows, Mac and Linux. Bonus points for also having support for generating a "plain HTML/javascript" version that can be viewed in any browser (a... | Cross-platform help viewer with search functionality | 0.099668 | 0 | 0 | 231 |
1,469,770 | 2009-09-24T04:26:00.000 | 1 | 1 | 0 | 0 | python,django,apache,fastcgi,lighttpd | 1,470,459 | 4 | false | 1 | 0 | Doesn't answer you question, but do you already use caching for your site? Like memcached? This might give you a better performance gain than going through the mess of switching webservers. | 1 | 3 | 0 | I am currently running a high-traffic python/django website using Apache and mod_wsgi. I'm hoping that there's a faster webserver configuration out there, and I've heard a fair number of recommendations for lighttpd and fastcgi. Is this setup faster than apache+mod_wsgi for serving dynamic django pages (I'm already con... | Better webserver performance for Python Django: Apache mod_wsgi or Lighttpd fastcgi | 0.049958 | 0 | 0 | 3,952 |
1,470,453 | 2009-09-24T08:45:00.000 | 0 | 0 | 1 | 0 | python,wxpython,cpu-usage | 1,470,720 | 4 | false | 0 | 0 | This isn't very practical at a language-agnostic level. Take away the language and all you have left is a load of machine code instructions sprinkled around with system calls. You could use strace on Linux or ProcessExplorer on Windows to try and guess what is going on from those system calls, but it would make far mor... | 1 | 0 | 0 | I have a wxPython app which has many worker threads, idle event cycles, and many other such event handling code which can consume CPU, for now when app is not being interacted with consumes about 8-10% CPU.
Question:
Is there a tool which can tell which part/threads of my app is consuming most CPU? If there are no such... | How to check which part of app is consuming CPU? | 0 | 0 | 0 | 2,070 |
1,471,707 | 2009-09-24T13:32:00.000 | 2 | 0 | 0 | 0 | python,django | 1,472,013 | 2 | false | 1 | 0 | They way Django works is pretty much how Python works. At default the folder you create when you run django-admin.py startproject name is added to your python path. That means that anything you put into there you can get to. But you have to mind that when you write the app into the installed app list. If you have an ap... | 1 | 0 | 0 | I run into this problem pretty consistently... keep in mind I am quite new to Django and a total Python amateur.
It seems that, for example, whenever I check out my Django project on a new computer after a clean install of Python and Django, it can never find the project/apps I create or copy in.
So right now I have an... | Copying modules into Django, "No module named [moduleName]" | 0.197375 | 0 | 0 | 1,933 |
1,471,994 | 2009-09-24T14:16:00.000 | 122 | 0 | 1 | 0 | python,python-3.x,setup.py,pypi,python-packaging | 1,472,439 | 10 | false | 1 | 0 | setup.py is Python's answer to a multi-platform installer and make file.
If you’re familiar with command line installations, then make && make install translates to python setup.py build && python setup.py install.
Some packages are pure Python, and are only byte compiled. Others may contain native code, which will r... | 1 | 1,389 | 0 | Can anyone please explain what setup.py is and how it can be configured or used? | What is setup.py? | 1 | 0 | 0 | 905,751 |
1,473,888 | 2009-09-24T20:13:00.000 | 9 | 0 | 0 | 0 | python,django | 1,473,979 | 2 | true | 1 | 0 | There's currently no way of performing validation in model save methods. This is however being developed, as a separate model-validation branch, and should be merged into trunk in the next few months.
In the meantime, you need to do the validation at the form level. It's quite simple to create a ModelForm subclass with... | 1 | 12 | 0 | I need to raise an exception in a model's save method. I'm hoping that an exception exists that will be caught by any django ModelForm that uses this model including the admin forms.
I tried raising django.forms.ValidationError, but this seems to be uncaught by the admin forms. The model makes a remote procedure call ... | Raising ValidationError from django model's save method? | 1.2 | 0 | 0 | 13,039 |
1,475,637 | 2009-09-25T05:55:00.000 | 12 | 0 | 0 | 0 | java,python,binding | 1,475,717 | 6 | false | 0 | 1 | Interpreters Written in C89 with Reflection, Who Knew?
I have a feeling you are looking for an explanation of the mechanism and not a link to the API or instructions on how to code it. So, as I understand it . . .
The main interpreter is typically written in C and is dynamically linked. In a dynamically linked environ... | 1 | 16 | 0 | I'm far from a python expert but I hear this one all the time, about its C/C++ bindings. How does this concept work, and how does Python (and Java) bind to C-based APIs like OpenGL? This stuff has always been a mystery to me. | How do you bind a language (python, for example) to another (say, C++)? | 1 | 0 | 0 | 3,183 |
1,477,626 | 2009-09-25T14:28:00.000 | 1 | 0 | 1 | 0 | python,video,video-library | 1,481,018 | 5 | true | 0 | 0 | If you want your code to be REAL FAST, use C++ (or parallel fortran).
However in your application, 99% of the runtime isn't going to be in YOUR code, it's going to be in GUI libraries, OS calls, waiting for user interaction, calling libraries (written in C) to open video files and make thumbnails, that kind of stuff.
S... | 4 | 0 | 0 | I am thinking of creating a video library software which keep track of all my videos and keep track of videos that I already haven't watched and stats like this. The stats will be specific to each user using the software.
My question is, is python appropriate to create this software or do I need something like c++. | Would python be an appropriate choice for a video library for home use software | 1.2 | 0 | 0 | 247 |
1,477,626 | 2009-09-25T14:28:00.000 | 6 | 0 | 1 | 0 | python,video,video-library | 1,477,754 | 5 | false | 0 | 0 | Python is perfectly appropriate for such tasks - indeed the most popular video site, YouTube, is essentially programmed in Python (using, of course, lower-level components called from Python for such tasks as web serving, relational db, video transcoding -- there are plenty of such reusable opensource components for al... | 4 | 0 | 0 | I am thinking of creating a video library software which keep track of all my videos and keep track of videos that I already haven't watched and stats like this. The stats will be specific to each user using the software.
My question is, is python appropriate to create this software or do I need something like c++. | Would python be an appropriate choice for a video library for home use software | 1 | 0 | 0 | 247 |
1,477,626 | 2009-09-25T14:28:00.000 | 1 | 0 | 1 | 0 | python,video,video-library | 1,477,733 | 5 | false | 0 | 0 | Yes. Python is much easier to use than c++ for something like this. You may want to use it as a front-end to a DB such as sqlite3 | 4 | 0 | 0 | I am thinking of creating a video library software which keep track of all my videos and keep track of videos that I already haven't watched and stats like this. The stats will be specific to each user using the software.
My question is, is python appropriate to create this software or do I need something like c++. | Would python be an appropriate choice for a video library for home use software | 0.039979 | 0 | 0 | 247 |
1,477,626 | 2009-09-25T14:28:00.000 | 1 | 0 | 1 | 0 | python,video,video-library | 1,478,325 | 5 | false | 0 | 0 | Of course you can use almost any programming language for almost any task. But after noting that, it's also obvious that different languages are also differently well adapted for different tasks.
C/C++ are languages that are very "hardware friendly". Basically, the languages are just one abstraction level above assembl... | 4 | 0 | 0 | I am thinking of creating a video library software which keep track of all my videos and keep track of videos that I already haven't watched and stats like this. The stats will be specific to each user using the software.
My question is, is python appropriate to create this software or do I need something like c++. | Would python be an appropriate choice for a video library for home use software | 0.039979 | 0 | 0 | 247 |
1,479,035 | 2009-09-25T19:02:00.000 | 4 | 0 | 1 | 0 | python,file,undo | 1,479,049 | 5 | false | 0 | 0 | Try to write to your files lazily: Don't write until you are finally certain you need to do it. | 1 | 3 | 0 | What is the best way to undo the writing to a file? If I'm going through a loop and writing one line at a time, and I want to undo the previous write and replace it with something else, how do I go about doing that? Any ideas?
Thanks in advance! | Python: undo write to file | 0.158649 | 0 | 0 | 3,715 |
1,479,454 | 2009-09-25T20:33:00.000 | 0 | 1 | 1 | 0 | python,ironpython | 1,480,581 | 5 | false | 0 | 0 | If you'd like to disable certain built-in modules I'd suggest filing a feature request over at ironpython.codeplex.com. This should be an easy enough thing to implement.
Otherwise you could simply look at either Importer.cs and disallow the import there or you could simply delete ClrModule.cs from IronPython and re-bu... | 3 | 4 | 0 | I'm setting up a web application to use IronPython for scripting various user actions and I'll be exposing various business objects ready for accessing by the script. I want to make it impossible for the user to import the CLR or other assemblies in order to keep the script's capabilities simple and restricted to the f... | IronPython - How to prevent CLR (and other modules) from being imported | 0 | 0 | 0 | 996 |
1,479,454 | 2009-09-25T20:33:00.000 | 0 | 1 | 1 | 0 | python,ironpython | 59,887,790 | 5 | false | 0 | 0 | In case anyone comes across this thread from google still (like i did)
I managed to disable 'import clr' in python scripts by commenting out the line
//[assembly: PythonModule("clr", typeof(IronPython.Runtime.ClrModule))]
in ClrModule.cs, but i'm not convinced this is a full solution to preventing unwanted access, sinc... | 3 | 4 | 0 | I'm setting up a web application to use IronPython for scripting various user actions and I'll be exposing various business objects ready for accessing by the script. I want to make it impossible for the user to import the CLR or other assemblies in order to keep the script's capabilities simple and restricted to the f... | IronPython - How to prevent CLR (and other modules) from being imported | 0 | 0 | 0 | 996 |
1,479,454 | 2009-09-25T20:33:00.000 | 1 | 1 | 1 | 0 | python,ironpython | 1,479,480 | 5 | true | 0 | 0 | You'll have to search the script for the imports you don't want them to use, and reject the script in toto if it contains any of them.
Basically, just reject the script if it contains Assembly.Load, import or AddReference. | 3 | 4 | 0 | I'm setting up a web application to use IronPython for scripting various user actions and I'll be exposing various business objects ready for accessing by the script. I want to make it impossible for the user to import the CLR or other assemblies in order to keep the script's capabilities simple and restricted to the f... | IronPython - How to prevent CLR (and other modules) from being imported | 1.2 | 0 | 0 | 996 |
1,480,431 | 2009-09-26T04:23:00.000 | 7 | 0 | 1 | 0 | python,image-processing,video-processing | 1,480,450 | 4 | true | 0 | 0 | Do you mean opencv can't connect to your webcam or can't read video files recorded by it?
Have you tried saving the video in an other format?
OpenCV is probably the best supported python image processing tool | 2 | 13 | 1 | I need to:
Open a video file
Iterate over the frames of the file as images
Do some analysis in this image frame of the video
Draw in this image of the video
Create a new video with these changes
OpenCV isn't working for my webcam, but python-gst is working. Is this possible using python-gst?
Thank you! | Most used Python module for video processing? | 1.2 | 0 | 0 | 12,979 |
1,480,431 | 2009-09-26T04:23:00.000 | 0 | 0 | 1 | 0 | python,image-processing,video-processing | 1,497,418 | 4 | false | 0 | 0 | Just build a C/C++ wrapper for your webcam and then use SWIG or SIP to access these functions from Python. Then use OpenCV in Python that's the best open sourced computer vision library in the wild.
If you worry for performance and you work under Linux, you could download free versions of Intel Performance Primitives (... | 2 | 13 | 1 | I need to:
Open a video file
Iterate over the frames of the file as images
Do some analysis in this image frame of the video
Draw in this image of the video
Create a new video with these changes
OpenCV isn't working for my webcam, but python-gst is working. Is this possible using python-gst?
Thank you! | Most used Python module for video processing? | 0 | 0 | 0 | 12,979 |
1,480,453 | 2009-09-26T04:51:00.000 | 12 | 1 | 0 | 0 | python,phpmyadmin | 1,480,549 | 4 | false | 0 | 0 | You can use phpMyAdmin for python project, because phpMyAdmin is meant for MySQL databases. If you are using MySQL, then regardless of whether you are using PHP or python, you can use phpMyAdmin. | 1 | 33 | 0 | Is there a python equivalent of phpMyAdmin?
Here's why I'm looking for a python version of phpmyadmin: While I agree that phpmyadmin really rocks, I don't want to run php on my server. I'd like to move from apache2-prefork to apache2-mpm-worker. Worker blows the doors off of prefork for performance, but php5 doesn't wo... | phpMyAdmin equivalent in python? | 1 | 1 | 0 | 23,600 |
1,480,490 | 2009-09-26T05:28:00.000 | 1 | 0 | 1 | 0 | c++,python,multithreading,python-c-api,python-embedding | 1,515,293 | 6 | false | 0 | 0 | I don't think you are the first person to want to do this, unfortunately I believe it is not possible. Are you able to run the python interperters as separate processes and use RPC? | 3 | 9 | 0 | I am working on embedding python in to c++. In some peculiar case I require two separate instances of the interpreter in same thread.
Can I wrap Python interpreter in to a c++ class and get services from two or more class instances? | Python interpreter as a c++ class | 0.033321 | 0 | 0 | 3,558 |
1,480,490 | 2009-09-26T05:28:00.000 | 4 | 0 | 1 | 0 | c++,python,multithreading,python-c-api,python-embedding | 1,480,578 | 6 | false | 0 | 0 | You can, but I'd recommend you not to re-implement a Python interpreter when there is a standard implementation. Use boost::python to interface with Python. | 3 | 9 | 0 | I am working on embedding python in to c++. In some peculiar case I require two separate instances of the interpreter in same thread.
Can I wrap Python interpreter in to a c++ class and get services from two or more class instances? | Python interpreter as a c++ class | 0.132549 | 0 | 0 | 3,558 |
1,480,490 | 2009-09-26T05:28:00.000 | 0 | 0 | 1 | 0 | c++,python,multithreading,python-c-api,python-embedding | 1,518,878 | 6 | false | 0 | 0 | You can let the python interpreter live outside of your application memory space. Just embed the interpreter in a DLL.
You can set up & save python contexts to simulate two different interpreters. | 3 | 9 | 0 | I am working on embedding python in to c++. In some peculiar case I require two separate instances of the interpreter in same thread.
Can I wrap Python interpreter in to a c++ class and get services from two or more class instances? | Python interpreter as a c++ class | 0 | 0 | 0 | 3,558 |
1,481,309 | 2009-09-26T14:17:00.000 | 0 | 0 | 1 | 0 | python,apache,windows-xp | 1,481,329 | 2 | false | 0 | 0 | If you are starting Python today, why tackle web development immediately? I'd start off with "hello world" in the console. | 1 | 2 | 0 | I am starting python today. It will be my pleasure to have your help. | how to configure apache on XP for python 2.6.2 and what do you prefer, python with framework/without? | 0 | 0 | 0 | 121 |
1,482,282 | 2009-09-26T21:55:00.000 | 15 | 0 | 0 | 0 | java,python,hadoop | 1,482,294 | 3 | true | 1 | 0 | Java is less dynamic than Python and more effort has been put into its VM, making it a faster language. Python is also held back by its Global Interpreter Lock, meaning it cannot push threads of a single process onto different core.
Whether this makes any significant difference depends on what you intend to do. I suspe... | 1 | 53 | 0 | I am working on a project using Hadoop and it seems to natively incorporate Java and provide streaming support for Python. Is there is a significant performance impact to choosing one over the other? I am early enough in the process where I can go either way if there is a significant performance difference one way or ... | Java vs Python on Hadoop | 1.2 | 0 | 0 | 40,609 |
1,482,627 | 2009-09-27T02:19:00.000 | 0 | 0 | 0 | 0 | python,sqlalchemy,pylons | 1,483,061 | 3 | false | 0 | 0 | Just import your other table's modules in your init.py, and use metadata object from models.meta in other files. Pylons default setup_app function creates all tables found in metadata object from model.meta after importing it. | 3 | 3 | 0 | I'm using SQLAlchemy and I can create tables that I have defined in /model/__init__.py but I have defined my classes, tables and their mappings in other files found in the /model directory.
For example I have a profile class and a profile table which are defined and mapped in /model/profile.py
To create the tables I r... | Creating tables with pylons and SQLAlchemy | 0 | 1 | 0 | 1,155 |
1,482,627 | 2009-09-27T02:19:00.000 | 5 | 0 | 0 | 0 | python,sqlalchemy,pylons | 1,528,312 | 3 | false | 0 | 0 | I ran into the same problem with my first real Pylons project. The solution that worked for me was this:
Define tables and classes in your profile.py file
In your __init__.py add from profile import * after your def init_model
I then added all of my mapper definitions afterwards. Keeping them all in the init file so... | 3 | 3 | 0 | I'm using SQLAlchemy and I can create tables that I have defined in /model/__init__.py but I have defined my classes, tables and their mappings in other files found in the /model directory.
For example I have a profile class and a profile table which are defined and mapped in /model/profile.py
To create the tables I r... | Creating tables with pylons and SQLAlchemy | 0.321513 | 1 | 0 | 1,155 |
1,482,627 | 2009-09-27T02:19:00.000 | 0 | 0 | 0 | 0 | python,sqlalchemy,pylons | 1,485,719 | 3 | false | 0 | 0 | If you are using declarative style, be sure to use Base.meta for tables generation. | 3 | 3 | 0 | I'm using SQLAlchemy and I can create tables that I have defined in /model/__init__.py but I have defined my classes, tables and their mappings in other files found in the /model directory.
For example I have a profile class and a profile table which are defined and mapped in /model/profile.py
To create the tables I r... | Creating tables with pylons and SQLAlchemy | 0 | 1 | 0 | 1,155 |
1,482,953 | 2009-09-27T06:50:00.000 | 3 | 0 | 0 | 0 | python,ruby,game-engine | 1,483,914 | 3 | false | 1 | 0 | I have worked a little bit with Panda3D, and it is a competent professional 3D engine. I haven't really worked with any of the other engines, though. If you are trying to start out with some 3D programming, I would recommend Blender3D because it is coupled with free 3D modeling software, which makes it easier to get mo... | 2 | 4 | 0 | Are there any 3d game engines for these ? | 3d game engines for Ruby or Python? | 0.197375 | 0 | 0 | 1,768 |
1,482,953 | 2009-09-27T06:50:00.000 | 1 | 0 | 0 | 0 | python,ruby,game-engine | 11,091,017 | 3 | false | 1 | 0 | Personally, i like to use pygame. Its easy, free and fast. | 2 | 4 | 0 | Are there any 3d game engines for these ? | 3d game engines for Ruby or Python? | 0.066568 | 0 | 0 | 1,768 |
1,483,024 | 2009-09-27T07:31:00.000 | 1 | 0 | 0 | 0 | python,mysql | 1,483,154 | 5 | false | 0 | 0 | What it needs is the client library and headers that come with the server, since it just a Python wrapper (which sits in _mysql.c; and DB-API interface to that wrapper in MySQLdb package) over original C MySQL API. | 3 | 1 | 0 | I been working on finding out how to install MySQLdb module for Python on Mac. And all pathes finally come cross to have MySQL installed since there is a mysql_config needed for the module. But I don't understand why it has to be needed?
MySQLdb suppose to be a client module for the client who wants to connect to the ... | Why MySQLdb for Mac has to have MySQL installed to install? | 0.039979 | 1 | 0 | 432 |
1,483,024 | 2009-09-27T07:31:00.000 | 1 | 0 | 0 | 0 | python,mysql | 1,483,030 | 5 | false | 0 | 0 | I'm not sure about the specifics of MySQLdb, but most likely it needs header information to compile/install. It uses the location of mysql_config to know where the appropriate headers would be. The MySQL Gem for Ruby on Rails requires the same thing, even though it simply connects to the MySQL server. | 3 | 1 | 0 | I been working on finding out how to install MySQLdb module for Python on Mac. And all pathes finally come cross to have MySQL installed since there is a mysql_config needed for the module. But I don't understand why it has to be needed?
MySQLdb suppose to be a client module for the client who wants to connect to the ... | Why MySQLdb for Mac has to have MySQL installed to install? | 0.039979 | 1 | 0 | 432 |
1,483,024 | 2009-09-27T07:31:00.000 | 1 | 0 | 0 | 0 | python,mysql | 1,483,305 | 5 | false | 0 | 0 | Just to clarify what the other answerers have said: you don't need to install a MySQL server, but you do need to install the MySQL client libraries. However, for whatever reasons, MySQL don't make a separate download available for just the client libraries, as they do for Linux. | 3 | 1 | 0 | I been working on finding out how to install MySQLdb module for Python on Mac. And all pathes finally come cross to have MySQL installed since there is a mysql_config needed for the module. But I don't understand why it has to be needed?
MySQLdb suppose to be a client module for the client who wants to connect to the ... | Why MySQLdb for Mac has to have MySQL installed to install? | 0.039979 | 1 | 0 | 432 |
1,483,685 | 2009-09-27T14:31:00.000 | 1 | 0 | 0 | 0 | python | 1,483,720 | 6 | false | 1 | 0 | Obfuscation is false security. And the only thing worse than no security is false security. Why would you obfuscate a web app anyways?
Python is compiled to bytecode and run on a virtual machine, but usually distributed as source code.
Unless you really plan to run your webapp on "pretty much every web host" that quest... | 3 | 3 | 0 | Just looking into python from a .net background.
Is python compiled like .net?
If yes, can it be obfuscated and is it more or less secure than .net compiled code that is obfuscated?
does pretty much every web host (unix) support django and python? | python _+ django, is it compiled code? | 0.033321 | 0 | 0 | 7,736 |
1,483,685 | 2009-09-27T14:31:00.000 | 2 | 0 | 0 | 0 | python | 1,483,820 | 6 | false | 1 | 0 | You shouldn't have to worry about obfuscating your code, specially since it's going to run on your server.
You are not supposed to put your code in a public directory anyway. The right thing to do with django (as oposed to PHP) is to make the code accessible by the webserver, but not by the public.
And if your server's... | 3 | 3 | 0 | Just looking into python from a .net background.
Is python compiled like .net?
If yes, can it be obfuscated and is it more or less secure than .net compiled code that is obfuscated?
does pretty much every web host (unix) support django and python? | python _+ django, is it compiled code? | 0.066568 | 0 | 0 | 7,736 |
1,483,685 | 2009-09-27T14:31:00.000 | 0 | 0 | 0 | 0 | python | 1,483,846 | 6 | false | 1 | 0 | Code obfuscation in .NET are mostly a question of changing variable names to make it harder to understand the disassembled code. Yes, you can do those techniques with CPython too.
Now, why ever you would want to is another question completely. It doesn't actually provide you with any security, and does not prevent anyb... | 3 | 3 | 0 | Just looking into python from a .net background.
Is python compiled like .net?
If yes, can it be obfuscated and is it more or less secure than .net compiled code that is obfuscated?
does pretty much every web host (unix) support django and python? | python _+ django, is it compiled code? | 0 | 0 | 0 | 7,736 |
1,484,293 | 2009-09-27T19:48:00.000 | 4 | 0 | 0 | 0 | python,django,unit-testing,nose | 1,484,428 | 1 | true | 1 | 0 | You do need DJANGO_SETTINGS_MODULE defined in order to run core.py -- why don't you just export DJANGO_SETTINGS_MODULE=whatever in your bash session before starting nose? | 1 | 2 | 0 | I'm trying to do TDD with PyMock, but I keep getting error when I use Nose and execute core.py from command line:
"ERROR: Failure: ImportError (Settings cannot be imported, because environment variable DJA
NGO_SETTINGS_MODULE is undefined.)"
If I remove "from cms.models import Entry" from the unit test module I created... | How do I use PyMock and Nose with Django models? | 1.2 | 0 | 0 | 1,276 |
1,484,658 | 2009-09-27T22:32:00.000 | 0 | 0 | 0 | 0 | python,simulation | 1,486,960 | 8 | false | 0 | 0 | Just use Stackless Python, create tasklets, connect them with channels, and everything will work. It is extremely simple. | 3 | 6 | 0 | I'm trying to simulate a real-time network where nodes are consumers and producers of different rates. How would I quickly implement a sample of this with Python? I was imagining that I'd write a simple program for each node, but I'm not sure how to connect them to each other. | How to build a mini-network of small programs feeding each other data? | 0 | 0 | 0 | 1,261 |
1,484,658 | 2009-09-27T22:32:00.000 | 0 | 0 | 0 | 0 | python,simulation | 1,484,763 | 8 | false | 0 | 0 | Two things come to mind:
1- You could write one or more daemons with Twisted Python. (Be warned, twisted can get a little overwhelming , since its an event-driven async system ). Each daemon can bind to a port and make itself available to other daemons. Alternately, you could just run everything within one daemon, an... | 3 | 6 | 0 | I'm trying to simulate a real-time network where nodes are consumers and producers of different rates. How would I quickly implement a sample of this with Python? I was imagining that I'd write a simple program for each node, but I'm not sure how to connect them to each other. | How to build a mini-network of small programs feeding each other data? | 0 | 0 | 0 | 1,261 |
1,484,658 | 2009-09-27T22:32:00.000 | 5 | 0 | 0 | 0 | python,simulation | 1,484,705 | 8 | true | 0 | 0 | Stick with traditional simulation structures, at least at first
Is it your goal to write an asynchronous system as an exercise? If so, then I guess you have to implement at least a multi-threaded if not multi-process or network system.
But if it's really a simulation, and what you want are the analysis results, impleme... | 3 | 6 | 0 | I'm trying to simulate a real-time network where nodes are consumers and producers of different rates. How would I quickly implement a sample of this with Python? I was imagining that I'd write a simple program for each node, but I'm not sure how to connect them to each other. | How to build a mini-network of small programs feeding each other data? | 1.2 | 0 | 0 | 1,261 |
1,487,450 | 2009-09-28T14:45:00.000 | 1 | 1 | 0 | 1 | python,date,scripting | 1,487,702 | 1 | true | 0 | 0 | I would suggest using Python. You'll need the following functions:
os.listdir gives you the directory contents, as a list of strings
time.strptime(name, "%d-%m-%y") will try to parse such a string, and return a time tuple. You get a ValueError exception if parsing fails.
time.mktime will convert a time tuple into seco... | 1 | 0 | 0 | I would like to write a small script that does the following (and that I can then run using my crontab):
Look into a directory that contains directories whose names are in some date format, e.g. 30-10-09.
Convert the directory name to the date it represents (of course, I could put this information as a string into a f... | Time difference between system date and string, e.g. from directory name? | 1.2 | 0 | 0 | 289 |
1,487,582 | 2009-09-28T15:08:00.000 | 2 | 0 | 0 | 0 | python,sockets,udp | 1,487,619 | 3 | false | 0 | 0 | What you receive from the udp socket is a byte string -- that's all the "type of object or class name" that's actually there. If the byte string was built as a serialized object (e.g. via pickle, or maybe marshal etc) then you can deserialize it back to an object (using e.g. pickle.loads) and then introspect to your h... | 2 | 1 | 0 | Is it possible to extract type of object or class name from message received on a udp socket in python using metaclasses/reflection ?
The scenario is like this:
Receive udp buffer on a socket.
The UDP buffer is a serialized binary string(a message). But the type of message is not known at this time. So can't de-serial... | Type of object from udp buffer in python using metaclasses/reflection | 0.132549 | 0 | 1 | 642 |
1,487,582 | 2009-09-28T15:08:00.000 | 0 | 0 | 0 | 0 | python,sockets,udp | 1,487,602 | 3 | false | 0 | 0 | Updated answer after updated question:
"But the type of message is not known at this time. So can't de-serialize into appropriate message."
What you get is a sequence of bytes. How that sequence of types should be interpreted is a question of how the protocol looks. Only you know what protocol you use. So if you don't ... | 2 | 1 | 0 | Is it possible to extract type of object or class name from message received on a udp socket in python using metaclasses/reflection ?
The scenario is like this:
Receive udp buffer on a socket.
The UDP buffer is a serialized binary string(a message). But the type of message is not known at this time. So can't de-serial... | Type of object from udp buffer in python using metaclasses/reflection | 0 | 0 | 1 | 642 |
1,488,372 | 2009-09-28T17:41:00.000 | 14 | 0 | 0 | 0 | python,c,string,fgets | 1,488,403 | 4 | false | 0 | 0 | Python strings' strip method removes both trailing and leading whitespace. The two halves of the problem are very different when working on a C "string" (array of char, \0 terminated).
For trailing whitespace: set a pointer (or equivalently index) to the existing trailing \0. Keep decrementing the pointer until it hits... | 1 | 6 | 0 | I started on a little toy project in C lately and have been scratching my head over the best way to mimic the strip() functionality that is part of the python string objects.
Reading around for fscanf or sscanf says that the string is processed upto the first whitespace that is encountered.
fgets doesn't help either a... | Mimic Python's strip() function in C | 1 | 0 | 0 | 14,808 |
1,489,355 | 2009-09-28T21:02:00.000 | 1 | 1 | 1 | 0 | python,perl,transitions | 1,489,635 | 5 | false | 0 | 0 | In python $_ does not exist except in the python shell and variables with global scope are frowned upon.
In practice this has two major effects:
In Python you can't use regular expressions as naturally as Perl, s0 matching each iterated $_ and similarly catching matches is more cumbersome
Python functions tend to be c... | 1 | 6 | 0 | Perl habits die hard. Variable declaration, scoping, global/local is different between the 2 languages. Is there a set of recommended python language idioms that will render the transition from perl coding to python coding less painful.
Subtle variable misspelling can waste an extraordinary amount of time.
I understan... | Managing Perl habits in a Python environment | 0.039979 | 0 | 0 | 539 |
1,489,599 | 2009-09-28T22:01:00.000 | 0 | 1 | 1 | 1 | python,python-module,pythonpath | 62,773,911 | 10 | false | 0 | 0 | If using conda, you can get the env prefix using os.environ["CONDA_PREFIX"]. | 1 | 447 | 0 | How do I find out which directories are listed in my system’s PYTHONPATH variable, from within a Python script (or the interactive shell)? | How do I find out my PYTHONPATH using Python? | 0 | 0 | 0 | 822,516 |
1,489,931 | 2009-09-29T00:02:00.000 | 0 | 0 | 0 | 0 | python,flash,twisted | 1,490,530 | 2 | false | 0 | 0 | I find out that the default delimiter for line, use by Twisted is '\r\n'. It can be overwrite in a your children class with:
LineOnlyReceiver.delimiter = '\n' | 2 | 1 | 0 | I've develop a chat server using Twisted framework in Python. It works fine with a Telnet client. But when I use my flash client problem appear...
(the flash client work find with my old php chat server, I rewrote the server in python to gain performance)
The connexion is establish between the flash client and the... | Chat server with Twisted framework in python can't receive data from flash client | 0 | 0 | 1 | 927 |
1,489,931 | 2009-09-29T00:02:00.000 | 1 | 0 | 0 | 0 | python,flash,twisted | 1,729,776 | 2 | true | 0 | 0 | Changing LineOnlyReceiver.delimiter is a pretty bad idea, since that changes the delivery for all instances of LineOnlyReceiver (unless they've changed it themselves on a subclass or on the instance). If you ever happen to use any such code, it will probably break.
You should change delimiter by setting it on your Lin... | 2 | 1 | 0 | I've develop a chat server using Twisted framework in Python. It works fine with a Telnet client. But when I use my flash client problem appear...
(the flash client work find with my old php chat server, I rewrote the server in python to gain performance)
The connexion is establish between the flash client and the... | Chat server with Twisted framework in python can't receive data from flash client | 1.2 | 0 | 1 | 927 |
1,489,949 | 2009-09-29T00:09:00.000 | 2 | 1 | 0 | 0 | python,xml,elementtree | 1,490,057 | 5 | false | 0 | 0 | Yeah, I don't believe it's possible, sorry. ElementTree provides a simpler interface to (non-namespaced) element-centric XML processing than DOM, but the price for that is that it doesn't support the whole XML infoset.
There is no apparent way to represent the content that lives outside the root element (comments, PIs,... | 1 | 6 | 0 | I'm trying to create XML using the ElementTree object structure in python. It all works very well except when it comes to processing instructions. I can create a PI easily using the factory function ProcessingInstruction(), but it doesn't get added into the elementtree. I can add it manually, but I can't figure out ... | ElementTree in Python 2.6.2 Processing Instructions support? | 0.07983 | 0 | 1 | 4,332 |
1,490,559 | 2009-09-29T04:23:00.000 | 6 | 0 | 0 | 0 | python,django,url,slug,collision | 1,492,882 | 4 | true | 1 | 0 | One thing I never liked about the unique slug fields/methods is that if you have a lot of clashes for a single title, you'll end up running several queries to try and determine an available slug. I know you mentioned you don't want to show the id for non-clashing slugs, but, as far as performance, I think it's the bett... | 2 | 7 | 0 | I'm currently working on a toy project in Django.
Part of my app allows users to leave reviews. I'd like to take the title of the review and slugify it to create a url.
So, if a user writes a review called "The best thing ever!", the url would be something like: www.example.com/reviews/the-best-thing-ever.
That's a... | Django slugified urls - how to handle collisions? | 1.2 | 0 | 0 | 3,203 |
1,490,559 | 2009-09-29T04:23:00.000 | 0 | 0 | 0 | 0 | python,django,url,slug,collision | 2,340,063 | 4 | false | 1 | 0 | I would (in the form validation) just check to see if the slug is used, and then add something to it, either a number "my-cool-idea_2" or the actual id | 2 | 7 | 0 | I'm currently working on a toy project in Django.
Part of my app allows users to leave reviews. I'd like to take the title of the review and slugify it to create a url.
So, if a user writes a review called "The best thing ever!", the url would be something like: www.example.com/reviews/the-best-thing-ever.
That's a... | Django slugified urls - how to handle collisions? | 0 | 0 | 0 | 3,203 |
1,490,841 | 2009-09-29T06:15:00.000 | 2 | 1 | 1 | 0 | python,ruby,performance,memory-management | 1,491,010 | 5 | false | 0 | 0 | If you are using Python for CPU intensive algorithmic tasks I suggest use Numpy/Scipy to speed up your numerical calculations and use the Psyco JIT compiler for everything else. Your speeds can approach that of much lower-level languages if you use optimized components. | 1 | 1 | 0 | I have a memory and CPU intensive problem to solve and I need to benchmark the different solutions in ruby and python on different platforms.
To do the benchmark, I need to measure the time taken and the memory occupied by objects (not the entire program, but a selected list of objects) in both python and ruby.
Please ... | Comparing performance between ruby and python code | 0.07983 | 0 | 0 | 1,564 |
1,493,550 | 2009-09-29T16:12:00.000 | 3 | 0 | 0 | 1 | python,workflow,business-process-management | 1,493,731 | 2 | true | 0 | 0 | Oh yes, tons. But most of them depend on a specific framework. DCWorkflow is integrated with Zopes CMF, for example. hurry.workflow is for Zope 3, etc. SpiffWorkflow presumes sql-alchemy, etc. This is because you need to have something to apply the workflow to, and that means you need to make some basic assumptions on ... | 1 | 7 | 0 | Let's say you are building a Python-based web app that requires some workflow management such as that in jBPM or Windows Workflow Foundation. Is there a library that offers this in the Python world? | Embeddable Workflow/BPM Library For Python? | 1.2 | 0 | 0 | 9,645 |
1,494,146 | 2009-09-29T18:22:00.000 | 5 | 0 | 1 | 0 | python | 1,494,172 | 4 | false | 0 | 0 | define a method in your class with __getitem__(key) and __setitem__(key, value) | 1 | 3 | 0 | I feel like this question has already been asked and answered, yet I couldn't find anything on-topic, so excuse me if it is so. I want to define the behaviour of [] brackets when applied to class, similar to def []=() construct in ruby, so that calling Python obj['foo'] would actually call some [](self, what) method. H... | How to define [] for class in Python? | 0.244919 | 0 | 0 | 272 |
1,494,231 | 2009-09-29T18:41:00.000 | 1 | 0 | 1 | 0 | javascript,c++,python,timestamp | 1,494,464 | 5 | false | 0 | 0 | Under WIN32, you can use SystemTimeToFileTime.
FILETIME is a 64-bit unsigned integer that counts the number of 100-nanosecond intervals since January 1, 1601 (UTC).
You can convert two timestamps to FILETIME. You can convert it to ULARGE_INTEGER (t.dwLowDateTime + t.dwHighDateTime << 32), and do regular arithmetics to ... | 2 | 3 | 0 | I'm trying to find to accurately count the number of seconds since Jan 1, 1850 to the present in a couple of languages (JavaScript, C++, and Python [don't even ask, I stopped asking these questions long ago]).
Problem is the platforms store timestamps as 32-bit signed integers, so I can't get a timestamp for dates olde... | How to get a timestamp older than 1901 | 0.039979 | 0 | 0 | 913 |
1,494,231 | 2009-09-29T18:41:00.000 | 3 | 0 | 1 | 0 | javascript,c++,python,timestamp | 1,494,286 | 5 | false | 0 | 0 | The portable, language-agnostic approach:
Step 1. Count the number of seconds between 01/01/1850 00:00 and 01/01/1901 00:00. Save this number somewhere (call it M)
Step 2. Use available language functionality to count the number of seconds between 01/01/1901 00:00 and whatever other date and time you want.
Step 3. Retu... | 2 | 3 | 0 | I'm trying to find to accurately count the number of seconds since Jan 1, 1850 to the present in a couple of languages (JavaScript, C++, and Python [don't even ask, I stopped asking these questions long ago]).
Problem is the platforms store timestamps as 32-bit signed integers, so I can't get a timestamp for dates olde... | How to get a timestamp older than 1901 | 0.119427 | 0 | 0 | 913 |
1,494,524 | 2009-09-29T19:41:00.000 | 0 | 0 | 0 | 0 | python,django,authentication | 1,494,572 | 3 | false | 1 | 0 | Modify things slightly so that users have a category prefix on their username? You haven't given us much info on what you want to do, it's possible that your needs might be met by using the sites framework, or simply two separate django installs.
If what you're trying to do is make the user login page and the admin log... | 1 | 8 | 0 | I've recently started learning/using django; I'm trying to figure out a way to have two separate authentications systems for administrators and users. Rather than create a whole new auth system, I'd like to leverage django's built-in functionality (i.e. session management, @login_required decorator, etc.).
Specificall... | Separate Admin/User authentication system in Django | 0 | 0 | 0 | 3,543 |
1,494,696 | 2009-09-29T20:17:00.000 | 13 | 0 | 1 | 0 | python,boolean,pass-by-value | 1,494,728 | 5 | true | 0 | 0 | Python variables are not "references" in the C++ sense. Rather, they are simply local names bound to an object at some arbitrary location in memory. If that object is itself mutable, changes to it will be visible in other scopes that have bound a name to the object. Many primitive types (including bool, int, str, and t... | 3 | 10 | 0 | I sent a reference to a bool object, and I modified it within a method. After the method finished its execution, the value of the bool outside the method was unchanged.
This leads me to believe that Python's bools are passed by value. Is that true? What other Python types behave that way? | Are Python's bools passed by value? | 1.2 | 0 | 0 | 6,888 |
1,494,696 | 2009-09-29T20:17:00.000 | 0 | 0 | 1 | 0 | python,boolean,pass-by-value | 1,494,730 | 5 | false | 0 | 0 | In short, there are no variables in Python; there are objects (Like True and False, the bools happen to be immutable), and names. Names are what you call variables, but names belong to a scope, you can't normally change names other than the local names. | 3 | 10 | 0 | I sent a reference to a bool object, and I modified it within a method. After the method finished its execution, the value of the bool outside the method was unchanged.
This leads me to believe that Python's bools are passed by value. Is that true? What other Python types behave that way? | Are Python's bools passed by value? | 0 | 0 | 0 | 6,888 |
1,494,696 | 2009-09-29T20:17:00.000 | 1 | 0 | 1 | 0 | python,boolean,pass-by-value | 1,495,889 | 5 | false | 0 | 0 | The thing to remember is that there is no way in Python for a function or a method to rebind a name in the calling namespace. When you write "I sent a reference to a bool object, and I modified it within a method", what you actually did (I am guessing) was to rebind the parameter name (to which the bool value was bound... | 3 | 10 | 0 | I sent a reference to a bool object, and I modified it within a method. After the method finished its execution, the value of the bool outside the method was unchanged.
This leads me to believe that Python's bools are passed by value. Is that true? What other Python types behave that way? | Are Python's bools passed by value? | 0.039979 | 0 | 0 | 6,888 |
1,496,039 | 2009-09-30T03:51:00.000 | 0 | 0 | 1 | 0 | python,wrapper,openaccess | 1,496,242 | 3 | false | 0 | 0 | Is your concept very similar to Microsoft Access? Generally programmers tend not to write such programs because they produce such horrible code that the authors themselves would never want to use their program. | 1 | 1 | 0 | With my luck this question will be closed too quickly. I see a tremendous possibility for a python application that basically is like a workbook. Imagine if you will that instead of writing code you select from a menu of choices. For example, the File menu would have an open command that lets the user navigate to a ... | How close is Python to being able to wrap it in a workbook type skin? | 0 | 0 | 0 | 160 |
1,496,067 | 2009-09-30T04:04:00.000 | 1 | 0 | 0 | 0 | python,django | 1,496,616 | 2 | false | 1 | 0 | Here is already suggestion to store data in the database, e.g. bsddb.btopen() or any RDBMS.
Take a look at heapq.merge() and bisect.insort() or use one of B-tree implementations if you'd like to merge data in memory. | 1 | 0 | 0 | Having great luck working with single-source feed parsing in Universal Feed Parser, but now I need to run multiple feeds through it and generate chronologically interleaved output (not RSS). Seems like I'll need to iterate through URLs and stuff every entry into a list of dictionaries, then sort that by the entry times... | Aggregating multiple feeds with Universal Feed Parser | 0.099668 | 0 | 1 | 1,280 |
1,496,842 | 2009-09-30T08:47:00.000 | 1 | 0 | 0 | 1 | python,windows | 1,497,789 | 4 | false | 0 | 0 | Also you can try win32 module for Python. | 1 | 2 | 0 | I'm programming in Python with a wrapper of the kernel32 dll, so I can use any functions of this dll, like GetLogicalDrives(), for instance. I'm trying to obtain the information of the physical drives, even if they are not mounted. I've seen a question similar to this, but I need the information of the not mounted driv... | how to obtain physical drives in Windows | 0.049958 | 0 | 0 | 5,364 |
1,498,009 | 2009-09-30T13:11:00.000 | 0 | 0 | 1 | 0 | python,oop | 1,498,033 | 5 | false | 0 | 0 | I see no problem with that, it happens all the time. Do you have a specific problem you're trying to solve or just asking a general question without a context? | 4 | 4 | 0 | I just started to use the object oriented programming in Python. I wander if it is OK if I create a method of a class which use objects from another class. In other words, when I call a method of the first class I give an object from the second class as one of the arguments. And then, the considered methods (of the fir... | Is it OK if objects from different classes interact with each other? | 0 | 0 | 0 | 2,279 |
1,498,009 | 2009-09-30T13:11:00.000 | 8 | 0 | 1 | 0 | python,oop | 1,498,030 | 5 | true | 0 | 0 | If you're talking about passing an instance of one object to the method of a another one, then yes of course it's allowed! And it's considered fine practice.
If you want to know more about good object oriented coding, may I offer some suggested readings:
Design Patterns: Elements of Reusable Object-Oriented Software b... | 4 | 4 | 0 | I just started to use the object oriented programming in Python. I wander if it is OK if I create a method of a class which use objects from another class. In other words, when I call a method of the first class I give an object from the second class as one of the arguments. And then, the considered methods (of the fir... | Is it OK if objects from different classes interact with each other? | 1.2 | 0 | 0 | 2,279 |
1,498,009 | 2009-09-30T13:11:00.000 | 1 | 0 | 1 | 0 | python,oop | 1,498,152 | 5 | false | 0 | 0 | The answer is that it os MORE than OK, it's in fact the whole point.
What is not "OK" is when objects start fiddling with the internals of each other. You can prevent this from happening accidentally, by calling things that are meant to be internal with a leading underscore (or two, which makes it internal also for sub... | 4 | 4 | 0 | I just started to use the object oriented programming in Python. I wander if it is OK if I create a method of a class which use objects from another class. In other words, when I call a method of the first class I give an object from the second class as one of the arguments. And then, the considered methods (of the fir... | Is it OK if objects from different classes interact with each other? | 0.039979 | 0 | 0 | 2,279 |
1,498,009 | 2009-09-30T13:11:00.000 | 1 | 0 | 1 | 0 | python,oop | 1,498,085 | 5 | false | 0 | 0 | What you're talking about is fine. In fact most data types (string, int, boolean, etc.) in Python are objects, so pretty much every method works in the way you described. | 4 | 4 | 0 | I just started to use the object oriented programming in Python. I wander if it is OK if I create a method of a class which use objects from another class. In other words, when I call a method of the first class I give an object from the second class as one of the arguments. And then, the considered methods (of the fir... | Is it OK if objects from different classes interact with each other? | 0.039979 | 0 | 0 | 2,279 |
1,498,155 | 2009-09-30T13:32:00.000 | 5 | 1 | 0 | 1 | python,c,embedded,fuzzy-logic | 1,498,739 | 6 | false | 0 | 0 | Make it work, then make it work fast. | 6 | 5 | 0 | I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries.
I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM).
The main concern is that re... | Performance of Python worth the cost? | 0.16514 | 0 | 0 | 1,593 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.