Q_Id int64 2.93k 49.7M | CreationDate stringlengths 23 23 | Users Score int64 -10 437 | Other int64 0 1 | Python Basics and Environment int64 0 1 | System Administration and DevOps int64 0 1 | DISCREPANCY int64 0 1 | Tags stringlengths 6 90 | ERRORS int64 0 1 | A_Id int64 2.98k 72.5M | API_CHANGE int64 0 1 | AnswerCount int64 1 42 | REVIEW int64 0 1 | is_accepted bool 2
classes | Web Development int64 0 1 | GUI and Desktop Applications int64 0 1 | Answer stringlengths 15 5.1k | Available Count int64 1 17 | Q_Score int64 0 3.67k | Data Science and Machine Learning int64 0 1 | DOCUMENTATION int64 0 1 | Question stringlengths 25 6.53k | Title stringlengths 11 148 | CONCEPTUAL int64 0 1 | Score float64 -1 1.2 | API_USAGE int64 1 1 | Database and SQL int64 0 1 | Networking and APIs int64 0 1 | ViewCount int64 15 3.72M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,022,067 | 2010-01-07T17:01:00.000 | 2 | 0 | 0 | 0 | 0 | python,payment-gateway,payment | 0 | 2,023,105 | 0 | 5 | 0 | false | 1 | 0 | It sounds like you want something like Worldpay or even Google Checkout. But it all depends what your turnover is, because these sorts of providers (who host the payment page themselves), tend to take a percentage of every transaction, rather than a fixed monthly fee that you can get from elsewhere.
The other thing to ... | 3 | 9 | 0 | 0 | I'm looking for a payment gateway company so we can avoid tiresome PCI-DSS certification and its associated expenses. I'll get this out the way now, I don't want Paypal. It does what I want but it's really not a company I want to trust with any sort of money.
It needs to support the following flow:
User performs actio... | Looking for a payment gateway | 0 | 0.07983 | 1 | 0 | 1 | 3,656 |
2,022,067 | 2010-01-07T17:01:00.000 | 4 | 0 | 0 | 0 | 0 | python,payment-gateway,payment | 0 | 2,258,716 | 0 | 5 | 0 | true | 1 | 0 | You might want to take a look at Adyen (www.adyen.com). They are European and provide a whole lot of features and a very friendly interface. They don't charge a monthly or set up fee and seem to be reasonably priced per transaction.
Their hosted payments page can be completely customised which was an amazing improvemen... | 3 | 9 | 0 | 0 | I'm looking for a payment gateway company so we can avoid tiresome PCI-DSS certification and its associated expenses. I'll get this out the way now, I don't want Paypal. It does what I want but it's really not a company I want to trust with any sort of money.
It needs to support the following flow:
User performs actio... | Looking for a payment gateway | 0 | 1.2 | 1 | 0 | 1 | 3,656 |
2,022,067 | 2010-01-07T17:01:00.000 | 2 | 0 | 0 | 0 | 0 | python,payment-gateway,payment | 0 | 2,023,033 | 0 | 5 | 0 | false | 1 | 0 | I just finished something exactly like this using First Data Global Gateway (don't really want to provide a link, can find with Google). There's no Python API because their interface is nothing but http POST.
You have the choice of gathering credit card info yourself before posting the form to their server, as long as... | 3 | 9 | 0 | 0 | I'm looking for a payment gateway company so we can avoid tiresome PCI-DSS certification and its associated expenses. I'll get this out the way now, I don't want Paypal. It does what I want but it's really not a company I want to trust with any sort of money.
It needs to support the following flow:
User performs actio... | Looking for a payment gateway | 0 | 0.07983 | 1 | 0 | 1 | 3,656 |
2,022,178 | 2010-01-07T17:18:00.000 | 0 | 0 | 0 | 0 | 0 | python,django,mod-python | 0 | 2,022,368 | 1 | 3 | 0 | false | 1 | 0 | A user's login status is stored using sessions. As far as I can tell from comparing trunk to the 0.96 source, the sessions are committed to a cookie the same way, and auth stores the user ID and backend the same way, so as long as the two apps use the same session storage and are on the same domain, it should work. (Ju... | 3 | 0 | 0 | 0 | Brand new to django. We have a legacy django project using django 0.96x that does authentication, ldap, etc., and it's pretty involved so we don't want to rewrite that code.
We want to add a forum solution (off the shelf) but all of the ones I've seen so far require django 1.x
I'm trying to figure out how to get this ... | Running Different Django Versions But Sharing Authentication | 0 | 0 | 1 | 0 | 0 | 129 |
2,022,178 | 2010-01-07T17:18:00.000 | 1 | 0 | 0 | 0 | 0 | python,django,mod-python | 0 | 2,022,407 | 1 | 3 | 0 | true | 1 | 0 | It's possible, but it may be pretty painful to do option #3.
How about Option 4: bite the bullet and upgrade to Django 1.1.1. I did this with a couple of 0.97pre sites and it took less time than I thought it would. The biggest pain was dealing with admin stuff. Instead of going with separate admin.py files, we simply p... | 3 | 0 | 0 | 0 | Brand new to django. We have a legacy django project using django 0.96x that does authentication, ldap, etc., and it's pretty involved so we don't want to rewrite that code.
We want to add a forum solution (off the shelf) but all of the ones I've seen so far require django 1.x
I'm trying to figure out how to get this ... | Running Different Django Versions But Sharing Authentication | 0 | 1.2 | 1 | 0 | 0 | 129 |
2,022,178 | 2010-01-07T17:18:00.000 | 0 | 0 | 0 | 0 | 0 | python,django,mod-python | 0 | 2,029,226 | 1 | 3 | 0 | false | 1 | 0 | It's possible to expose Django 0.96 tables to 1.1 - you can use unmanaged models wrapped around database VIEWs. In other words you issue:
CREATE VIEW auth_user AS SELECT * from django096db.auth_user;
(and similar cmd for other tables)
and then you have Django 1.1 synchronized with 0.96 (assuming 0.96 tables are compati... | 3 | 0 | 0 | 0 | Brand new to django. We have a legacy django project using django 0.96x that does authentication, ldap, etc., and it's pretty involved so we don't want to rewrite that code.
We want to add a forum solution (off the shelf) but all of the ones I've seen so far require django 1.x
I'm trying to figure out how to get this ... | Running Different Django Versions But Sharing Authentication | 0 | 0 | 1 | 0 | 0 | 129 |
2,046,727 | 2010-01-12T04:28:00.000 | 2 | 0 | 0 | 0 | 0 | python,sockets | 0 | 2,046,760 | 0 | 1 | 0 | true | 0 | 0 | You should have your User class implement a fileno(self) method which returns self.thesocket.fileno() -- that's the way to make select work on your own classes (sockets only on windows, arbitrary files on Unix-like systems). Not sure what switch is supposed to me -- don't recognize it as a standard library (or built-i... | 1 | 1 | 0 | 0 | I more or less know how to use select() to take a list of sockets, and only return the ones that are ready to read/write something. The project I'm working on now has a class called 'user'. Each 'user' object contains its own socket. What I would like to do is pass a list of users to a select(), and get back a list ... | Creating waitable objects in Python | 0 | 1.2 | 1 | 0 | 1 | 547 |
2,068,473 | 2010-01-15T00:04:00.000 | 1 | 0 | 0 | 0 | 0 | python,tokyo-cabinet | 0 | 2,384,015 | 0 | 2 | 0 | true | 0 | 0 | This depend on no-sql implementation. Cassandra, for example, allows range queries, so you could model data to do queries on last name, or with full name (starting with last name, then first name).
Beyond this, many simpler key-value stores would indeed require you to store a list structure (or such) for multi-valued e... | 1 | 1 | 0 | 0 | i have been in the RDBMS world for many years now but wish to explore the whole nosql movement. so here's my first question:
is it bad practice to have the possibility of duplicate keys? for example, an address book keyed off of last name (most probably search item?) could have multiple entities. is it bad practice ... | key/value (general) and tokyo cabinet (python tc-specific) question | 0 | 1.2 | 1 | 1 | 0 | 597 |
2,069,739 | 2010-01-15T05:46:00.000 | 0 | 0 | 0 | 0 | 0 | wxpython,focus | 0 | 2,135,083 | 0 | 2 | 0 | false | 0 | 1 | You could also give the focus to another control in your event handler for the buttons. Just call the SetFocus() method on any other control. This might make your application more usable as a side effect if you for example return focus to a text field that is likely to be typed in next. | 1 | 0 | 0 | 0 | I don't know if this is a stupid question, but is there any way to not show focus in wxPython? For example, I built a simple GUI with a few buttons and I don't want the dotted rectangle to show up on the button I have just clicked.
If I remember correctly in Excel VBA you could just set TakeFocusOnClick tag to False. ... | Not showing focus in wxPython? | 1 | 0 | 1 | 0 | 0 | 197 |
2,074,074 | 2010-01-15T19:08:00.000 | 0 | 1 | 1 | 0 | 0 | python,multithreading,unit-testing,performance,multicore | 0 | 35,182,727 | 0 | 4 | 0 | false | 0 | 0 | As the @vinay-sajip suggested, a few non-core python packages like py.test and nose provided parallel execution of unit tests via multiprocessing lib right out of the box.
However, one thing to consider is that if you are testing a web app with database backend and majority of your test cases are relying on connecting... | 1 | 13 | 0 | 0 | I'm using python unittest in order to test some other external application but it takes too much time to run the test one by one.
I would like to know how can I speedup this process by using the power of multi-cores.
Can I tweak unittest to execute tests in parallel? How?
This question is not able python GIL limitatio... | How to speedup python unittest on muticore machines? | 0 | 0 | 1 | 0 | 0 | 9,389 |
2,076,838 | 2010-01-16T09:27:00.000 | 5 | 0 | 1 | 0 | 0 | python,random,numbers | 0 | 2,077,313 | 0 | 17 | 0 | false | 0 | 0 | I think you are overestimating the problems with approach 1). Unless you have hard-realtime requirements just checking by random choice terminates rather fast. The probability of needing more than a number of iterations decays exponentially. With 100M numbers outputted (10% fillfactor) you'll have one in billion chance... | 5 | 38 | 0 | 0 | Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't tell... | Generating non-repeating random numbers in Python | 0 | 0.058756 | 1 | 0 | 0 | 30,464 |
2,076,838 | 2010-01-16T09:27:00.000 | 1 | 0 | 1 | 0 | 0 | python,random,numbers | 0 | 2,083,392 | 0 | 17 | 0 | false | 0 | 0 | You can run 1) without running into the problem of too many wrong random numbers if you just decrease the random interval by one each time.
For this method to work, you will need to save the numbers already given (which you want to do anyway) and also save the quantity of numbers taken.
It is pretty obvious that, after... | 5 | 38 | 0 | 0 | Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't tell... | Generating non-repeating random numbers in Python | 0 | 0.011764 | 1 | 0 | 0 | 30,464 |
2,076,838 | 2010-01-16T09:27:00.000 | 4 | 0 | 1 | 0 | 0 | python,random,numbers | 0 | 2,077,409 | 0 | 17 | 0 | false | 0 | 0 | The standard Linear Congruential random number generator's seed sequence CANNOT repeat until the full set of numbers from the starting seed value have been generated. Then it MUST repeat precisely.
The internal seed is often large (48 or 64 bits). The generated numbers are smaller (32 bits usually) because the enti... | 5 | 38 | 0 | 0 | Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't tell... | Generating non-repeating random numbers in Python | 0 | 0.047024 | 1 | 0 | 0 | 30,464 |
2,076,838 | 2010-01-16T09:27:00.000 | 0 | 0 | 1 | 0 | 0 | python,random,numbers | 0 | 2,076,898 | 0 | 17 | 0 | false | 0 | 0 | I'd rethink the problem itself... You don't seem to be doing anything sequential with the numbers... and you've got an index on the column which has them. Do they actually need to be numbers?
Consider a sha hash... you don't actually need the entire thing. Do what git or other url shortening services do, and take first... | 5 | 38 | 0 | 0 | Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't tell... | Generating non-repeating random numbers in Python | 0 | 0 | 1 | 0 | 0 | 30,464 |
2,076,838 | 2010-01-16T09:27:00.000 | 0 | 0 | 1 | 0 | 0 | python,random,numbers | 0 | 2,077,000 | 0 | 17 | 0 | false | 0 | 0 | Do you need this to be cryptographically secure or just hard to guess? How bad are collisions? Because if it needs to be cryptographically strong and have zero collisions, it is, sadly, impossible. | 5 | 38 | 0 | 0 | Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't tell... | Generating non-repeating random numbers in Python | 0 | 0 | 1 | 0 | 0 | 30,464 |
2,077,522 | 2010-01-16T13:58:00.000 | 2 | 0 | 0 | 0 | 1 | python,mysql,database,django,performance | 0 | 2,077,536 | 0 | 2 | 1 | false | 0 | 0 | First, the most obvious answer is that you should ask them, not us, since I can tell you this, that design seems bogus deluxe.
The only reason I can come up with is that you have inexperienced DBA's that does not know how to performance-tune a database, and seems to think that a table with less rows will always vastly ... | 1 | 2 | 0 | 0 | I recently joined a new company and the development team was in the progress of a project to rebuild the database categories structure as follows:
if we have category and subcategory for items, like food category and italian food category in food category.
They were building a table for each category, instead of having... | DB a table for the category and another table for the subcategory with similar fields, why? | 1 | 0.197375 | 1 | 1 | 0 | 155 |
2,084,063 | 2010-01-18T05:30:00.000 | 0 | 0 | 0 | 1 | 0 | python,memory-management,windows-7,squish | 0 | 2,175,363 | 0 | 3 | 0 | false | 0 | 0 | Remember that Squish allows remote testing of the application. A system parameter queried via Python directly will only apply to the case of local testing.
An approach that works in either case is to call the currentApplicationContext() function that will give you a handle to the Application Under Test. It has a usedMe... | 2 | 1 | 0 | 0 | Recently I've found myself testing an aplication in Froglogic's Squish, using Python to create test scripts. Just the other day, the question of how much memory the program is using has come up, and I've found myself unable to answer it.
It seems reasonable to assume that there's a way to query the os (windows 7) API f... | How would I discover the memory used by an application through a python script? | 0 | 0 | 1 | 0 | 0 | 241 |
2,084,063 | 2010-01-18T05:30:00.000 | -1 | 0 | 0 | 1 | 0 | python,memory-management,windows-7,squish | 0 | 2,084,070 | 0 | 3 | 0 | false | 0 | 0 | In command line: tasklist /FO LIST and parse the results?
Sorry, I don't know a Pythonic way. =P | 2 | 1 | 0 | 0 | Recently I've found myself testing an aplication in Froglogic's Squish, using Python to create test scripts. Just the other day, the question of how much memory the program is using has come up, and I've found myself unable to answer it.
It seems reasonable to assume that there's a way to query the os (windows 7) API f... | How would I discover the memory used by an application through a python script? | 0 | -0.066568 | 1 | 0 | 0 | 241 |
2,085,430 | 2010-01-18T10:55:00.000 | 1 | 0 | 0 | 0 | 1 | python,xml,database,sqlite,parsing | 0 | 2,085,657 | 0 | 4 | 0 | false | 1 | 0 | If you are accustomed to DOM (tree) access to xml from other language, you may find useful these standard library modules (and their respective docs):
xml.dom
xml.dom.minidom
To save tha data to DB, you can use standard module sqlite3 or look for binding to mysql. Or you may wish to use something more abstract, like... | 1 | 7 | 0 | 0 | I have a question related to some guidances to solve a problem. I have with me an xml file, I have to populate it into a database system (whatever, it might be sqlite, mysql) using scripting language: Python.
Does anyone have any idea on how to proceed?
Which technologies I need to read further?
Which environments I h... | populating data from xml file to a sqlite database using python | 1 | 0.049958 | 1 | 1 | 0 | 15,042 |
2,086,961 | 2010-01-18T15:17:00.000 | 1 | 1 | 0 | 1 | 0 | python,unix,terminal,cron | 0 | 2,087,056 | 0 | 6 | 0 | false | 0 | 0 | An easier workaround would be to pass a flag to the script only from the crontab, like --crontab, and then just check for that flag. | 4 | 5 | 0 | 0 | I would like to know how can I determine if a python script is executed from crontab?
I don't want a solution that will require adding a parameter because I want to be able to detect this even from an imported module (not the main script). | How can I determine if a python script is executed from crontab? | 0 | 0.033321 | 1 | 0 | 0 | 4,167 |
2,086,961 | 2010-01-18T15:17:00.000 | 0 | 1 | 0 | 1 | 0 | python,unix,terminal,cron | 0 | 2,087,816 | 0 | 6 | 0 | false | 0 | 0 | If you want to detect this from an imported module, I would have the main program set a global variable in the module, which would output different things depending on the value of this global variable (and have the main program decide how to set the variable through a flag that you would use in your crontab). This is... | 4 | 5 | 0 | 0 | I would like to know how can I determine if a python script is executed from crontab?
I don't want a solution that will require adding a parameter because I want to be able to detect this even from an imported module (not the main script). | How can I determine if a python script is executed from crontab? | 0 | 0 | 1 | 0 | 0 | 4,167 |
2,086,961 | 2010-01-18T15:17:00.000 | 21 | 1 | 0 | 1 | 0 | python,unix,terminal,cron | 0 | 2,087,031 | 0 | 6 | 0 | true | 0 | 0 | Not quite what you asked, but maybe what you want is os.isatty(sys.stdout.fileno()), which tells if stdout is connected to (roughly speaking) a terminal. It will be false if you pipe the output to a file or another process, or if the process is run from cron. | 4 | 5 | 0 | 0 | I would like to know how can I determine if a python script is executed from crontab?
I don't want a solution that will require adding a parameter because I want to be able to detect this even from an imported module (not the main script). | How can I determine if a python script is executed from crontab? | 0 | 1.2 | 1 | 0 | 0 | 4,167 |
2,086,961 | 2010-01-18T15:17:00.000 | 5 | 1 | 0 | 1 | 0 | python,unix,terminal,cron | 0 | 2,087,053 | 0 | 6 | 0 | false | 0 | 0 | Set an environment variable at the cron command invocation. That works even within a module, as you can just check os.getenv(). | 4 | 5 | 0 | 0 | I would like to know how can I determine if a python script is executed from crontab?
I don't want a solution that will require adding a parameter because I want to be able to detect this even from an imported module (not the main script). | How can I determine if a python script is executed from crontab? | 0 | 0.16514 | 1 | 0 | 0 | 4,167 |
2,089,998 | 2010-01-18T23:31:00.000 | 6 | 1 | 0 | 0 | 0 | ironpython | 0 | 2,090,745 | 0 | 3 | 0 | false | 1 | 1 | You can provide a custom Stream or TextWriter which will be used for all output. You can provide those by using one of the ScriptRuntime.IO.SetOutput overloads. Your implementation of Stream or TextWriter should receive the strings and then output them to your editor window (potentially marshalling back onto the UI t... | 1 | 4 | 0 | 0 | We embed ironpython in our app sob that scripts can be executed in the context of our application.
I use Python.CreateEngine() and ScriptScope.Execute() to execute python scripts.
We have out own editor(written in C#) that can load ironpython scripts and run it.
There are 2 problems I need to solve.
If I have a print ... | Streaming Ironpython output to my editor | 0 | 1 | 1 | 0 | 0 | 4,586 |
2,091,097 | 2010-01-19T04:35:00.000 | 1 | 0 | 0 | 0 | 0 | python,sockets,network-programming | 0 | 2,091,157 | 0 | 3 | 0 | false | 0 | 0 | I don't think there's any Python-specific limits. UDP packets have a theoretical limit of circa 65kb and TCP no upper limit, but you'll have flow control problems if you use packets much more than a few kilobytes. | 1 | 6 | 0 | 0 | i am new to network programming in python. I wanted to know that what is the maximum size packet we can transmit or receive on python socket? and how to find out it? | What is the maximum packet size a python socket can handle? | 1 | 0.066568 | 1 | 0 | 1 | 7,528 |
2,106,823 | 2010-01-21T03:58:00.000 | 11 | 0 | 0 | 0 | 0 | python,python-3.x,django,django-models,django-admin | 0 | 2,106,836 | 0 | 7 | 0 | true | 1 | 0 | An easy way is to use the setting's name as the primary key in the settings table. There can't be more than one record with the same primary key, so that will allow both Django and the database to guarantee integrity. | 1 | 7 | 0 | 0 | I want use a model to save the system setting for a django app, So I want to limit the model can only have one record, how to do the limit? | Limit a single record in model for django app? | 1 | 1.2 | 1 | 0 | 0 | 9,457 |
2,121,617 | 2010-01-23T01:06:00.000 | 1 | 0 | 1 | 0 | 0 | java,c++,python,perl,multithreading | 0 | 2,121,635 | 0 | 10 | 0 | false | 0 | 0 | Threads don't speed up applications. Algorithms speed up applications. Threads can be used in algorithms, if appropriate. | 5 | 12 | 0 | 0 | I have been considering adding threaded procedures to my application to speed up execution, but the problem is that I honestly have no idea how to use threads, or what is considered "thread safe". For example, how does a game engine utilize threads in its rendering processes, or in what contexts would threads only be c... | Can Someone Explain Threads to Me? | 0 | 0.019997 | 1 | 0 | 0 | 3,288 |
2,121,617 | 2010-01-23T01:06:00.000 | 1 | 0 | 1 | 0 | 0 | java,c++,python,perl,multithreading | 0 | 2,121,649 | 0 | 10 | 0 | false | 0 | 0 | Threads are simply a way of executing multiple things simultaneously (assuming that the platform on which they are being run is capable of parallel execution). Thread safety is simply (well, nothing with threads is truly simple) making sure that the threads don't affect each other in harmful ways.
In general, you are ... | 5 | 12 | 0 | 0 | I have been considering adding threaded procedures to my application to speed up execution, but the problem is that I honestly have no idea how to use threads, or what is considered "thread safe". For example, how does a game engine utilize threads in its rendering processes, or in what contexts would threads only be c... | Can Someone Explain Threads to Me? | 0 | 0.019997 | 1 | 0 | 0 | 3,288 |
2,121,617 | 2010-01-23T01:06:00.000 | 1 | 0 | 1 | 0 | 0 | java,c++,python,perl,multithreading | 0 | 2,121,639 | 0 | 10 | 0 | false | 0 | 0 | Well someone will probably answer this better, but threads are for the purpose of having background processing that won't freeze the user interface. You don't want to stop accepting keyboard input or mouse input, and tell the user, "just a moment, I want to finish this computation, it will only be a few more seconds.... | 5 | 12 | 0 | 0 | I have been considering adding threaded procedures to my application to speed up execution, but the problem is that I honestly have no idea how to use threads, or what is considered "thread safe". For example, how does a game engine utilize threads in its rendering processes, or in what contexts would threads only be c... | Can Someone Explain Threads to Me? | 0 | 0.019997 | 1 | 0 | 0 | 3,288 |
2,121,617 | 2010-01-23T01:06:00.000 | 32 | 0 | 1 | 0 | 0 | java,c++,python,perl,multithreading | 0 | 2,121,638 | 0 | 10 | 0 | true | 0 | 0 | This is a very broad topic. But here are the things I would want to know if I knew nothing about threads:
They are units of execution within a single process that happen "in parallel" - what this means is that the current unit of execution in the processor switches rapidly. This can be achieved via different means. ... | 5 | 12 | 0 | 0 | I have been considering adding threaded procedures to my application to speed up execution, but the problem is that I honestly have no idea how to use threads, or what is considered "thread safe". For example, how does a game engine utilize threads in its rendering processes, or in what contexts would threads only be c... | Can Someone Explain Threads to Me? | 0 | 1.2 | 1 | 0 | 0 | 3,288 |
2,121,617 | 2010-01-23T01:06:00.000 | 2 | 0 | 1 | 0 | 0 | java,c++,python,perl,multithreading | 0 | 2,121,691 | 0 | 10 | 0 | false | 0 | 0 | There are four things you should know about threads.
Threads are like processes, but they share memory.
Threads often have hardware, OS, and language support, which might make them better than processes.
There are lots of fussy little things that threads need to support (like locks and semaphores) so they don't get t... | 5 | 12 | 0 | 0 | I have been considering adding threaded procedures to my application to speed up execution, but the problem is that I honestly have no idea how to use threads, or what is considered "thread safe". For example, how does a game engine utilize threads in its rendering processes, or in what contexts would threads only be c... | Can Someone Explain Threads to Me? | 0 | 0.039979 | 1 | 0 | 0 | 3,288 |
2,123,269 | 2010-01-23T13:27:00.000 | 2 | 0 | 1 | 0 | 0 | python,multithreading,multiprocess | 0 | 2,123,513 | 0 | 2 | 0 | false | 0 | 0 | The GIL is really only something to care about if you want to do multiprocessing, that is spread the load over several cores/processors. If that is the case, and it kinda sounds like it from your description, use multiprocessing.
If you just need to do three things "simultaneously" in that way that you need to wait in ... | 1 | 4 | 0 | 0 | I'm making a python script that needs to do 3 things simultaneously.
What is a good way to achieve this as do to what i've heard about the GIL i'm not so lean into using threads anymore.
2 of the things that the script needs to do will be heavily active, they will have lots of work to do and then i need to have the thi... | python threading/fork? | 1 | 0.197375 | 1 | 0 | 0 | 8,102 |
2,124,347 | 2010-01-23T19:12:00.000 | 1 | 0 | 1 | 0 | 0 | python,permutation | 0 | 2,124,356 | 0 | 6 | 0 | false | 0 | 0 | You may want the itertools.permutations() function. Gotta love that itertools module!
NOTE: New in 2.6 | 1 | 30 | 1 | 0 | i have an array of 27 elements,and i don't want to generate all permutations of array (27!)
i need 5000 randomly choosed permutations,any tip will be useful... | how to generate permutations of array in python? | 0 | 0.033321 | 1 | 0 | 0 | 38,205 |
2,127,956 | 2010-01-24T17:17:00.000 | 2 | 0 | 0 | 0 | 0 | python,django,textmate | 0 | 2,133,642 | 0 | 2 | 0 | false | 1 | 0 | It's possible - the Rails bundle does this for ERB (<% automatically gets closing %> tags).
So that's a place you could go look. | 2 | 3 | 0 | 0 | I have installed a TextMate bundle that I believe enables the ability for automatic closing of the "{{" markup (so that it will automatically close the markup with "}}"), but this does not seem to be possible with the other markup that uses "{%" and "%}".
So, I was wondering if anyone out there knows how to get TextMat... | TextMate and Django Integration - Supporting {% %} markup | 1 | 0.197375 | 1 | 0 | 0 | 796 |
2,127,956 | 2010-01-24T17:17:00.000 | 1 | 0 | 0 | 0 | 0 | python,django,textmate | 0 | 2,128,058 | 0 | 2 | 0 | false | 1 | 0 | I don't think that's possible, but the Django bundle for TextMate does allow you to insert the opening and closing tags in one go, placing the cursor in the middle, with ctrl-% (ctrl-shift-5).
Click the Bundles -> Python Django Templates menu to see all the shortcuts that are available. | 2 | 3 | 0 | 0 | I have installed a TextMate bundle that I believe enables the ability for automatic closing of the "{{" markup (so that it will automatically close the markup with "}}"), but this does not seem to be possible with the other markup that uses "{%" and "%}".
So, I was wondering if anyone out there knows how to get TextMat... | TextMate and Django Integration - Supporting {% %} markup | 1 | 0.099668 | 1 | 0 | 0 | 796 |
2,141,589 | 2010-01-26T18:19:00.000 | 9 | 0 | 0 | 0 | 0 | python,postgresql,stored-procedures,plpgsql | 0 | 2,142,128 | 0 | 1 | 0 | true | 0 | 0 | Depends on what operations you're doing.
Well, combine that with a general Python documentation, and that's about what you have.
No. Again, depends on what you're doing. If you're only going to run a query once, no point in preparing it separately.
If you are using persistent connections, it might. But they get cleared... | 1 | 11 | 0 | 0 | we are still pretty new to Postgres and came from Microsoft Sql Server.
We are wanting to write some stored procedures now. Well, after struggling to get something more complicated than a hello world to work in pl/pgsql, we decided it's better if we are going to learn a new language we might as well learn Python becaus... | Stored Procedures in Python for PostgreSQL | 0 | 1.2 | 1 | 1 | 0 | 5,869 |
2,152,471 | 2010-01-28T05:19:00.000 | 4 | 1 | 0 | 0 | 0 | python,linux,datetime,timezone | 0 | 2,152,511 | 0 | 3 | 0 | true | 0 | 0 | You can use time.gmtime() to get time GMT (UTC) from any machine no matter the timezone, then you can apply your offset. | 1 | 5 | 0 | 0 | I need to know the current time at CDT when my Python script is run. However this script will be run in multiple different timezones so a simple offset won't work.
I only need a solution for Linux, but a cross platform solution would be ideal. | how to find time at particular timezone from anywhere | 0 | 1.2 | 1 | 0 | 0 | 1,946 |
2,168,793 | 2010-01-30T17:48:00.000 | 0 | 0 | 1 | 0 | 0 | python,nlp,nltk | 0 | 2,226,080 | 0 | 3 | 0 | false | 0 | 0 | Alex is right, start with the docs, and figure out which corpus reader will work for your corpus. The simple instantiate it, given the path to your corpus file(s). As you'll see in the docs, the builtin corpora are simply instances of particular corpus reader classes. Look thru the code in the nltk.corpus package shoul... | 2 | 4 | 0 | 0 | I have recently expanded the names corpus in nltk and would like to know how I can turn the two files I have (male.txt, female.txt) in to a corpus so I can access them using the existing nltk.corpus methods. Does anyone have any suggestions?
Many thanks,
James. | How can I create my own corpus in the Python Natural Language Toolkit? | 0 | 0 | 1 | 0 | 0 | 6,842 |
2,168,793 | 2010-01-30T17:48:00.000 | 1 | 0 | 1 | 0 | 0 | python,nlp,nltk | 0 | 2,355,858 | 0 | 3 | 0 | false | 0 | 0 | Came to understand how corpus reading works by looking at the source code in nltk.corpus and then looking at the corpora (located in /home/[user]/nltk_data/corpora/names - this will probably be in My Documents for XP and somewhere in User for Win7 users).
The structure of the corpus and its related function will give a... | 2 | 4 | 0 | 0 | I have recently expanded the names corpus in nltk and would like to know how I can turn the two files I have (male.txt, female.txt) in to a corpus so I can access them using the existing nltk.corpus methods. Does anyone have any suggestions?
Many thanks,
James. | How can I create my own corpus in the Python Natural Language Toolkit? | 0 | 0.066568 | 1 | 0 | 0 | 6,842 |
2,173,212 | 2010-01-31T20:37:00.000 | 1 | 1 | 0 | 0 | 0 | eclipse,unit-testing,pydev,python-unittest | 0 | 2,220,154 | 0 | 3 | 0 | false | 0 | 0 | Go to the preferences and type in keys to get to the keyboard shortcut definition page (I think it's called keys... sorry not on my dev machine right now). In this dialog you can search for commands. See if there is a run all tests command (it might help to find the run tests you are currently using first). If there... | 1 | 7 | 0 | 0 | I know Ctrl + F9 runs a single file.
How to run them all?
If there is no such thing, how to bind one keyboard shortcut to it? | What is the keyboard shortcut to run all unit tests in the current project in PyDev + Eclipse? | 0 | 0.066568 | 1 | 0 | 0 | 5,179 |
2,179,395 | 2010-02-01T19:19:00.000 | 2 | 0 | 1 | 0 | 0 | python,jython | 0 | 2,191,492 | 0 | 3 | 0 | false | 1 | 0 | I use Jython in testing and rapid-development.
From my point of view it is stable. | 2 | 5 | 0 | 0 | I am planning to use Jython with Django. I want to know how stable the Jython project is, how easy to use it is, and how large its developer community is. | Using Jython with Django? | 0 | 0.132549 | 1 | 0 | 0 | 462 |
2,179,395 | 2010-02-01T19:19:00.000 | 3 | 0 | 1 | 0 | 0 | python,jython | 0 | 2,181,008 | 0 | 3 | 0 | false | 1 | 0 | I have not used Django with Jython, so I can't speak to that specific issue, but I've used Jython for other things and I've found it quite stable of late, and just as easy as plain Python. I believe the "core committers" in Jython are substantially fewer than in C-Python (maybe 1/3 the number or less), if that's what ... | 2 | 5 | 0 | 0 | I am planning to use Jython with Django. I want to know how stable the Jython project is, how easy to use it is, and how large its developer community is. | Using Jython with Django? | 0 | 0.197375 | 1 | 0 | 0 | 462 |
2,189,800 | 2010-02-03T04:56:00.000 | 427 | 0 | 1 | 0 | 0 | python,count,integer | 0 | 2,189,814 | 0 | 28 | 0 | true | 0 | 0 | If you want the length of an integer as in the number of digits in the integer, you can always convert it to string like str(133) and find its length like len(str(123)). | 2 | 324 | 0 | 0 | In Python, how do you find the number of digits in an integer? | How to find length of digits in an integer? | 0 | 1.2 | 1 | 0 | 0 | 610,171 |
2,189,800 | 2010-02-03T04:56:00.000 | 2 | 0 | 1 | 0 | 0 | python,count,integer | 0 | 2,189,821 | 0 | 28 | 0 | false | 0 | 0 | Assuming you are asking for the largest number you can store in an integer, the value is implementation dependent. I suggest that you don't think in that way when using python. In any case, quite a large value can be stored in a python 'integer'. Remember, Python uses duck typing!
Edit:
I gave my answer before the clar... | 2 | 324 | 0 | 0 | In Python, how do you find the number of digits in an integer? | How to find length of digits in an integer? | 0 | 0.014285 | 1 | 0 | 0 | 610,171 |
2,190,711 | 2010-02-03T08:54:00.000 | 0 | 0 | 1 | 0 | 0 | python | 0 | 2,190,882 | 0 | 1 | 0 | false | 0 | 0 | You do it exactly the same way as you did before, but now with the FreeType-dev files installed. | 1 | 0 | 0 | 0 | Previously I got a suggedtion to Install the FreeType dev files and rebuild PIL again.
but I have no idea how to do it.
any help will be thanked for | Rebuilding PIL with FreeType | 0 | 0 | 1 | 0 | 0 | 318 |
2,195,755 | 2010-02-03T21:52:00.000 | 3 | 0 | 1 | 0 | 0 | python | 0 | 2,195,789 | 0 | 5 | 0 | false | 0 | 0 | Object attributes are always accessed via a reference, so there is no way for an object attribute to shadow a builtin. | 3 | 1 | 0 | 0 | If you have a method called "set" in a class and want to create a standard builtin "set" object somewhere else in the class, Python seems to reference the method when I do that. How can you be more specific to let Python know you mean the builtin "set", not the method "set"? More specifically, set() is being created in... | Python class has method "set", how to reference builtin set type? | 0 | 0.119427 | 1 | 0 | 0 | 582 |
2,195,755 | 2010-02-03T21:52:00.000 | 2 | 0 | 1 | 0 | 0 | python | 0 | 2,195,786 | 0 | 5 | 0 | false | 0 | 0 | Usually method names are disambiguated from global names because you have to prefix self..
So self.set() invokes your class method and set() invokes the global set.
If this doesn't help, perhaps post the code you're having trouble with. | 3 | 1 | 0 | 0 | If you have a method called "set" in a class and want to create a standard builtin "set" object somewhere else in the class, Python seems to reference the method when I do that. How can you be more specific to let Python know you mean the builtin "set", not the method "set"? More specifically, set() is being created in... | Python class has method "set", how to reference builtin set type? | 0 | 0.07983 | 1 | 0 | 0 | 582 |
2,195,755 | 2010-02-03T21:52:00.000 | 2 | 0 | 1 | 0 | 0 | python | 0 | 2,195,807 | 0 | 5 | 0 | false | 0 | 0 | You can refer to built-in set as __builtins__.set. | 3 | 1 | 0 | 0 | If you have a method called "set" in a class and want to create a standard builtin "set" object somewhere else in the class, Python seems to reference the method when I do that. How can you be more specific to let Python know you mean the builtin "set", not the method "set"? More specifically, set() is being created in... | Python class has method "set", how to reference builtin set type? | 0 | 0.07983 | 1 | 0 | 0 | 582 |
2,201,580 | 2010-02-04T17:02:00.000 | 3 | 0 | 0 | 1 | 0 | python,google-app-engine,google-cloud-datastore | 0 | 4,088,516 | 0 | 6 | 0 | false | 1 | 0 | Results of datastore count() queries
and offsets for all datastore queries
are no longer capped at 1000.
Since Version 1.3.6 | 1 | 4 | 0 | 0 | I'm building an app on GAE that needs to report on events occurring. An event has a type and I also need to report by event type.
For example, say there is an event A, B and C. They occur periodically at random. User logs in and creates a set of entities to which those events can be attributed. When the user comes back... | Need a way to count entities in GAE datastore that meet a certain condition? (over 1000 entities) | 0 | 0.099668 | 1 | 0 | 0 | 4,016 |
2,207,562 | 2010-02-05T13:44:00.000 | 0 | 0 | 0 | 0 | 0 | python,django | 0 | 2,207,718 | 0 | 2 | 0 | false | 1 | 0 | One, popular, option would be to use something like tags. So you'd have the stuff that's common to all items, like an item ID, name, description, price. Then you'd have some more generic tags or described tags in another table, associated with those items. You could have a tag that represents the season, or automobi... | 1 | 1 | 0 | 0 | what i want, is to receive advices to define a re-usefull Product model, for a shopping site app, nowadays I know that the store is going to commerce with "clothing", so the product model will have a "season or collections" relationship, but in the future I should use that app to commerce with X product, e.g: "cars" wh... | How to write dynamic Django models? | 0 | 0 | 1 | 0 | 0 | 580 |
2,208,828 | 2010-02-05T16:55:00.000 | 6 | 0 | 1 | 1 | 0 | python,windows,64-bit | 0 | 3,740,665 | 0 | 22 | 0 | false | 0 | 0 | Many of these proposed solutions, such as platform.architecture(), fail because their results depend on whether you are running 32-bit or 64-bit Python.
The only reliable method I have found is to check for the existence of os.environ['PROGRAMFILES(X86)'], which is unfortunately hackish. | 4 | 41 | 0 | 0 | Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files.
Many thanks | Detect 64bit OS (windows) in Python | 1 | 1 | 1 | 0 | 0 | 46,662 |
2,208,828 | 2010-02-05T16:55:00.000 | 38 | 0 | 1 | 1 | 0 | python,windows,64-bit | 0 | 2,208,869 | 0 | 22 | 0 | false | 0 | 0 | I guess you should look in os.environ['PROGRAMFILES'] for the program files folder. | 4 | 41 | 0 | 0 | Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files.
Many thanks | Detect 64bit OS (windows) in Python | 1 | 1 | 1 | 0 | 0 | 46,662 |
2,208,828 | 2010-02-05T16:55:00.000 | -2 | 0 | 1 | 1 | 0 | python,windows,64-bit | 0 | 2,208,946 | 0 | 22 | 0 | false | 0 | 0 | There should be a directory under Windows 64bit, a Folder called \Windows\WinSxS64 for 64 bit, under Windows 32bit, it's WinSxS. | 4 | 41 | 0 | 0 | Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files.
Many thanks | Detect 64bit OS (windows) in Python | 1 | -0.01818 | 1 | 0 | 0 | 46,662 |
2,208,828 | 2010-02-05T16:55:00.000 | 3 | 0 | 1 | 1 | 0 | python,windows,64-bit | 0 | 2,209,113 | 0 | 22 | 0 | false | 0 | 0 | You should be using environment variables to access this. The program files directory is stored in the environment variable PROGRAMFILES on x86 Windows, the 32-bit program files is directory is stored in the PROGRAMFILES(X86) environment variable, these can be accessed by using os.environ('PROGRAMFILES').
Use sys.getwi... | 4 | 41 | 0 | 0 | Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files.
Many thanks | Detect 64bit OS (windows) in Python | 1 | 0.027266 | 1 | 0 | 0 | 46,662 |
2,211,967 | 2010-02-06T03:57:00.000 | 2 | 0 | 1 | 0 | 0 | python,parsing,rule-engine,expert-system | 0 | 7,619,477 | 0 | 2 | 0 | false | 0 | 0 | It looks like you search for "grammar inference" (grammar induction) library. | 1 | 8 | 0 | 0 | I am seeking direction and attempting to label this problem:
I am attempting to build a simple inference engine (is there a better name?) in Python which will take a string and -
1 - create a list of tokens by simply creating a list of white space separated values
2 - categorise these tokens, using regular expressions
... | Building an Inference Engine in Python | 0 | 0.197375 | 1 | 0 | 0 | 3,788 |
2,211,990 | 2010-02-06T04:04:00.000 | 6 | 0 | 1 | 0 | 0 | python,generator,primes | 0 | 2,212,842 | 0 | 12 | 0 | false | 0 | 0 | Do a segmented sieve, where the size of a segment is determined by available memory or the maximal size of a bitset.
For each segment represent the numbers in some interval [n; n + segment_size) as a bit set and sieve with all prime numbers below the square root of the upper bound.
Using a bit set uses less memory than... | 1 | 68 | 0 | 0 | This is not a homework, I am just curious.
INFINITE is the key word here.
I wish to use it as for p in primes(). I believe that this is a built-in function in Haskell.
So, the answer cannot be as naive as "Just do a Sieve".
First of all, you do not know how many consecutive primes will be consumed. Well, suppose you co... | How to implement an efficient infinite generator of prime numbers in Python? | 0 | 1 | 1 | 0 | 0 | 30,775 |
2,213,595 | 2010-02-06T15:27:00.000 | 1 | 0 | 0 | 0 | 0 | python,django-models | 0 | 2,213,602 | 0 | 3 | 0 | true | 1 | 0 | The default primary key will already be a unique monotonic integer (even in SQLite if you don't delete any records), so you can just use that for it. | 1 | 2 | 0 | 0 | I can't see any provision for this in the django docs, so how do people go about doing this.
My specific case is this.
I have a shopping cart, each cart instance has an invoice number field, however the invoice number is only generated if the cart goes to a paid status, so not all shopping cart instances will have an i... | how do people normally deal with class variables in django? | 0 | 1.2 | 1 | 0 | 0 | 680 |
2,222,843 | 2010-02-08T15:58:00.000 | 10 | 0 | 1 | 0 | 0 | python,syntax,keyword,statements | 0 | 2,222,867 | 0 | 5 | 0 | true | 0 | 0 | No, you cannot add new syntax within a Python program. The only way to alter the language is to edit and recompile the grammar file and supporting C code, to obtain a new altered interpreter, compiler and runtime. | 3 | 6 | 0 | 0 | Is there a way to define new statements like def, with, for of my own in Python? Of course, I don't mean to override the existing statements, only create some of my own.
If so, how do I do it? Can you point me to good docs on the subject? | Making your own statements | 0 | 1.2 | 1 | 0 | 0 | 1,414 |
2,222,843 | 2010-02-08T15:58:00.000 | 1 | 0 | 1 | 0 | 0 | python,syntax,keyword,statements | 0 | 2,223,039 | 0 | 5 | 0 | false | 0 | 0 | There are programming languages that let you do this (Tcl, for example), but Python isn't one of those languages. | 3 | 6 | 0 | 0 | Is there a way to define new statements like def, with, for of my own in Python? Of course, I don't mean to override the existing statements, only create some of my own.
If so, how do I do it? Can you point me to good docs on the subject? | Making your own statements | 0 | 0.039979 | 1 | 0 | 0 | 1,414 |
2,222,843 | 2010-02-08T15:58:00.000 | 3 | 0 | 1 | 0 | 0 | python,syntax,keyword,statements | 0 | 2,222,909 | 0 | 5 | 0 | false | 0 | 0 | You can't (re)define language keywords without rewriting a compiler/interpreter/etc. What you could do perhaps is write a something like a DSL (domain-specific language) and something that translates your keyword statements into proper python statements, which might be an easier route. | 3 | 6 | 0 | 0 | Is there a way to define new statements like def, with, for of my own in Python? Of course, I don't mean to override the existing statements, only create some of my own.
If so, how do I do it? Can you point me to good docs on the subject? | Making your own statements | 0 | 0.119427 | 1 | 0 | 0 | 1,414 |
2,227,770 | 2010-02-09T08:48:00.000 | 2 | 0 | 0 | 0 | 0 | python,cross-platform,pyqt,pygtk,html-rendering | 0 | 2,227,957 | 0 | 2 | 0 | true | 0 | 1 | In my experience, having developed cross-platform applications with both PyQt and PyGTK, you should consider moving to PyQt. It comes with a browser widget by default which runs fine on all platforms, and support for non-Linux platforms is outstanding compared to PyGTK. For PyGTK, you will have to be prepared building ... | 1 | 0 | 0 | 0 | I'm trying to write a small gui app in pygtk which needs an html-rendering widget. I'd like to be able to use it in a windows environment.
Currently I'm using pywebkitgtk on my GNU/Linux system, and it works extremely well, but it seems it's not possible to use this on Windows at this time.
Can anyone give me any sugg... | cross-platform html widget for pygtk | 1 | 1.2 | 1 | 0 | 0 | 1,076 |
2,229,640 | 2010-02-09T14:13:00.000 | 1 | 0 | 0 | 0 | 0 | python,django | 0 | 2,229,654 | 0 | 2 | 0 | true | 1 | 0 | Create MAIN_PAGE setting inside settings.py with primary key. Then create view main_page nad retrieve the main_page object from the database using the setting.
EDIT:
You can also do it like this: add a model, which will reference a SimplePage and point to the main page. In main page view, you will retrieve the wanted S... | 1 | 0 | 0 | 0 | I'm a newbie at Django and I want to do something that I'm not sure how to do.
I have a model SimplePage, which simply stands for a webpage that is visible on the website and whose contents can be edited in the admin. (I think this is similar to FlatPage.)
So I have a bunch of SimplePages for my site, and I want one of... | Django: Setting one page as the main page | 1 | 1.2 | 1 | 0 | 0 | 327 |
2,234,056 | 2010-02-10T02:38:00.000 | 0 | 0 | 1 | 0 | 0 | python,glib | 0 | 2,234,282 | 0 | 1 | 0 | true | 0 | 0 | How is glib exposed to Python in your application? Via SWIG, ctypes or something else?
You should basically use glib's own functions to iterate over a list. Something like g_slist_foreach. Just pass it the pointer and its other parameters to do the job. Again, this heavily depends on how you access glib in your Python... | 1 | 0 | 0 | 0 | Let's say I get a glib gpointer to a glib gslist and would like to iterate over the latter, how would I do it?
I don't even know how to get to the gslist with the gpointer for starters!
Update: I found a workaround - the python bindings in this instance wasn't complete so I had to find another solution. | how do I iterate over a "gslist" in Python? | 0 | 1.2 | 1 | 0 | 0 | 647 |
2,236,864 | 2010-02-10T12:54:00.000 | 1 | 1 | 0 | 0 | 0 | php,python,xml,apache,curl | 0 | 2,236,930 | 0 | 1 | 0 | false | 0 | 0 | Run Wireshark and see how far the request goes. Could be a firewall issue, a DNS resolution problem, among other things.
Also, try bumping your curl timeout to something much higher, like 300s, and see how it goes. | 1 | 0 | 0 | 0 | We have a script which pulls some XML from a remote server. If this script is running on any server other than production, it works.
Upload it to production however, and it fails. It is using cURL for the request but it doesn't matter how we do it - fopen, file_get_contents, sockets - it just times out. This also happe... | PHP / cURL problem opening remote file | 0 | 0.197375 | 1 | 0 | 1 | 606 |
2,247,197 | 2010-02-11T19:39:00.000 | 2 | 0 | 1 | 0 | 0 | python,data-structures,matrix,d,associative-array | 0 | 2,247,284 | 0 | 3 | 0 | true | 0 | 0 | Why not just use a standard matrix, but then have two dictionaries - one that converts the row keys to row indices and one that converts the columns keys to columns indices. You could make your own structure that would work this way fairly easily I think. You just make a class that contains the matrix and the two dicti... | 1 | 6 | 1 | 0 | I'm working on a project where I need to store a matrix of numbers indexed by two string keys. The matrix is not jagged, i.e. if a column key exists for any row then it should exist for all rows. Similarly, if a row key exists for any column then it should exist for all columns.
The obvious way to express this is wit... | Associative Matrices? | 1 | 1.2 | 1 | 0 | 0 | 566 |
2,249,530 | 2010-02-12T03:40:00.000 | 1 | 0 | 0 | 1 | 0 | python,google-app-engine,logging | 0 | 2,249,540 | 0 | 1 | 0 | true | 1 | 0 | You can increase the per-request batch size of logs. In the latest SDK (1.3.1), check out google_appengine/google/appengine/tools/appcfg.py around like 861 (RequestLogLines method of LogsRequester class). You can modify the "limit" parameter.
I am using 1000 and it works pretty well. | 1 | 1 | 0 | 0 | Downloading logs from App Engine is nontrivial. Requests are batched; appcfg.py does not use normal file IO but rather a temporary file (in reverse chronological order) which it ultimately appends to the local log file; when appending, the need to find the "sentinel" makes log rotation difficult since one must leave en... | How to improve the throughput of request_logs on Google App Engine | 0 | 1.2 | 1 | 0 | 0 | 499 |
2,255,942 | 2010-02-13T00:12:00.000 | 1 | 1 | 0 | 1 | 0 | python,matlab,ctypes | 0 | 2,257,221 | 0 | 4 | 0 | false | 0 | 0 | Regarding OS compatibility, if you use the matlab version for Linux, the scripts written in windows should work without any changes.
If possible, you may also consider the possibility of doing everything with python. Scipy/numpy with Matplotlib provide a complete Matlab replacement. | 1 | 24 | 0 | 0 | A friend asked me about creating a small web interface that accepts some inputs, sends them to MATLAB for number crunching and outputs the results. I'm a Python/Django developer by trade, so I can handle the web interface, but I am clueless when it comes to MATLAB. Specifically:
I'd really like to avoid hosting this o... | How do I interact with MATLAB from Python? | 1 | 0.049958 | 1 | 0 | 0 | 23,758 |
2,256,987 | 2010-02-13T08:47:00.000 | 4 | 0 | 0 | 1 | 0 | python,linux,django,deployment,webserver | 0 | 2,257,323 | 0 | 4 | 1 | false | 1 | 0 | Update your question to remove the choices that don't work. If it has Python 2.4, and an installation is a headache, just take it off the list, and update the question to list the real candidates. Only list the ones that actually fit your requirements. (You don't say what your requirements are, but minimal upgrades ... | 3 | 9 | 0 | 0 | Short version: How do you deploy your Django servers? What application server, front-end (if any, and by front-end I mean reverse proxy), and OS do you run it on? Any input would be greatly appreciated, I'm quite a novice when it comes to Python and even more as a server administrator.
Long version:
I'm migrating betwe... | Recommended Django Deployment | 0 | 0.197375 | 1 | 0 | 0 | 3,882 |
2,256,987 | 2010-02-13T08:47:00.000 | 3 | 0 | 0 | 1 | 0 | python,linux,django,deployment,webserver | 0 | 2,257,450 | 0 | 4 | 1 | false | 1 | 0 | At the place I rent server, they have shaved down the Ubuntu images to bare minimum. Presumably because they had to make a special image anyway with just the right drivers and such in it, but I don't know exactly.
They have even removed wget and nano. So you get all the apt-get goodness and not a whole lot of "cookie-c... | 3 | 9 | 0 | 0 | Short version: How do you deploy your Django servers? What application server, front-end (if any, and by front-end I mean reverse proxy), and OS do you run it on? Any input would be greatly appreciated, I'm quite a novice when it comes to Python and even more as a server administrator.
Long version:
I'm migrating betwe... | Recommended Django Deployment | 0 | 0.148885 | 1 | 0 | 0 | 3,882 |
2,256,987 | 2010-02-13T08:47:00.000 | 0 | 0 | 0 | 1 | 0 | python,linux,django,deployment,webserver | 0 | 2,259,882 | 0 | 4 | 1 | false | 1 | 0 | Personally I find one of the BSD systems far superior to Linux distros for server related tasks. Give OpenBSD or perhaps FreeBSD a chance. Once you do you´ll never go back. | 3 | 9 | 0 | 0 | Short version: How do you deploy your Django servers? What application server, front-end (if any, and by front-end I mean reverse proxy), and OS do you run it on? Any input would be greatly appreciated, I'm quite a novice when it comes to Python and even more as a server administrator.
Long version:
I'm migrating betwe... | Recommended Django Deployment | 0 | 0 | 1 | 0 | 0 | 3,882 |
2,264,991 | 2010-02-15T09:42:00.000 | 3 | 0 | 0 | 1 | 0 | python,pipe,stdin,command-line-interface | 0 | 2,265,010 | 0 | 6 | 0 | false | 0 | 0 | There is no reliable way to detect if sys.stdin is connected to anything, nor is it appropriate do so (e.g., the user wants to paste the data in). Detect the presence of a filename as an argument, and use stdin if none is found. | 1 | 20 | 0 | 0 | I have a CLI script and want it to read data from a file. It should be able to read it in two ways :
cat data.txt | ./my_script.py
./my_script.py data.txt
—a bit like grep, for example.
What I know:
sys.argv and optparse let me read any args and options easily.
sys.stdin let me read data piped in
fileinput make the ... | How to read from stdin or from a file if no data is piped in Python? | 0 | 0.099668 | 1 | 0 | 0 | 10,274 |
2,268,315 | 2010-02-15T19:11:00.000 | 0 | 0 | 0 | 0 | 0 | python,animation,wxpython,mouseevent | 0 | 44,916,099 | 0 | 3 | 0 | false | 0 | 1 | I think you could easily just make a window that is the same size as the desktop then do some while looping for an inactivity variable based on mouse position, then thread off a timer for loop for the 4 inactivity variables. I'd personally design it so that when they reach 0 from 15, they change size and position to be... | 2 | 1 | 0 | 0 | I would like to create an application that has 3-4 frames (or windows) where each frame is attached/positioned to a side of the screen (like a task bar). When a frame is inactive I would like it to auto hide (just like the Windows task bar does; or the dock in OSX). When I move my mouse pointer to the position on the e... | Can you auto hide frames/dialogs using wxPython? | 0 | 0 | 1 | 0 | 0 | 877 |
2,268,315 | 2010-02-15T19:11:00.000 | 0 | 0 | 0 | 0 | 0 | python,animation,wxpython,mouseevent | 0 | 9,066,380 | 0 | 3 | 0 | false | 0 | 1 | Personally, I would combine the EVT_ENTER_WINDOW and EVT_LEAVE_WINDOW that FogleBird mentioned with a wx.Timer. Then whenever it the frame or dialog is inactive for x seconds, you would just call its Hide() method. | 2 | 1 | 0 | 0 | I would like to create an application that has 3-4 frames (or windows) where each frame is attached/positioned to a side of the screen (like a task bar). When a frame is inactive I would like it to auto hide (just like the Windows task bar does; or the dock in OSX). When I move my mouse pointer to the position on the e... | Can you auto hide frames/dialogs using wxPython? | 0 | 0 | 1 | 0 | 0 | 877 |
2,270,556 | 2010-02-16T04:06:00.000 | 0 | 0 | 0 | 0 | 0 | python,django,sms,payment-gateway | 0 | 2,277,634 | 0 | 2 | 0 | false | 1 | 0 | I'd like to comment on the SMS alert part.
First, I have to admit that I'm not familiar with Django, but I assume it to be just like most other web frameworks: request based. This might be your first problem, as the alert service needs to run independently of requests. You could of course hack together something to e... | 1 | 3 | 0 | 0 | Firstly pardon me if i've yet again failed to title my question correctly.
I am required to build an app to manage magazine subscriptions. The client wants to enter subscriber data and then receive alerts at pre-set intervals such as when the subscription of a subscriber is about to expire and also the option to view a... | Subscription web/desktop app [PYTHON] | 0 | 0 | 1 | 0 | 0 | 795 |
2,276,000 | 2010-02-16T20:15:00.000 | 4 | 1 | 0 | 0 | 0 | python | 0 | 2,276,041 | 0 | 6 | 0 | false | 1 | 0 | One of the lightest-weight frameworks is mod_wsgi. Anything less is going to be a huge amount of work parsing HTTP requests to find headers and URI's and methods and parsing the GET or POST query/data association, handling file uploads, cookies, etc.
As it is, mod_wsgi will only handle the basics of request parsing an... | 1 | 43 | 0 | 0 | I am just starting Python and I was wondering how I would go about programming web applications without the need of a framework. I am an experienced PHP developer but I have an urge to try out Python and I usually like to write from scratch without the restriction of a framework like flask or django to name a few. | Program web applications in python without a framework? | 0 | 0.132549 | 1 | 0 | 0 | 35,567 |
2,282,360 | 2010-02-17T16:20:00.000 | 1 | 0 | 0 | 0 | 0 | java,python | 0 | 2,282,470 | 0 | 5 | 1 | false | 1 | 0 | The largest issue I can think of is the need to install an interpreter.
With Java, a lot of people will already have that interpreter installed, although you won't necessarily know which version. It may be wise to include the installer for Java with the program.
With Python, you're going to have to install the interpr... | 2 | 0 | 0 | 0 | I'm going to write my first non-Access project, and I need advice on choosing the platform. I will be installing it on multiple friends' and family's computers, so (since I'm sure many, many platforms would suffice just fine for my app), my highest priority has two parts: 1) ease of install for the non-technical user a... | Help for novice choosing between Java and Python for app with sql db | 0 | 0.039979 | 1 | 1 | 0 | 594 |
2,282,360 | 2010-02-17T16:20:00.000 | 1 | 0 | 0 | 0 | 0 | java,python | 0 | 2,283,347 | 0 | 5 | 1 | true | 1 | 0 | If you're going to install only (or mostly) on Windows, I'd go with .Net.
If you have experience with C++, then C# would be natural to you, but if you're comfortable with VBA, you can try VB.NET, but if you prefer Python, then there is IronPython or can give a try to IronRuby, but the best of all is you can mix them a... | 2 | 0 | 0 | 0 | I'm going to write my first non-Access project, and I need advice on choosing the platform. I will be installing it on multiple friends' and family's computers, so (since I'm sure many, many platforms would suffice just fine for my app), my highest priority has two parts: 1) ease of install for the non-technical user a... | Help for novice choosing between Java and Python for app with sql db | 0 | 1.2 | 1 | 1 | 0 | 594 |
2,294,956 | 2010-02-19T08:41:00.000 | 1 | 0 | 0 | 0 | 0 | python,qt,pyqt,qt-designer | 0 | 2,296,460 | 0 | 2 | 0 | false | 0 | 1 | Try finding pyuic3 or rather pyuic4. Since you are using PyQt all your qt tools have py in front (like pyrcc4 or pyuicc4).
I am not sure, that there are pyqt3 binaries for windows. Are you sure that Phil Thompson did PyQt3 also for windows at the time? If so, they would be on riverbank site, I guess, but I can't find t... | 1 | 0 | 0 | 0 | I've a PyQt 4 installed (I can't find PyQt 3 for Windows) and I would like to open a QtDesigner ui file which has been created with QtDesigner 3.3.
When I open this file I've the following message:
Please use uic3 -convert to convert to Qt4
Unfortunately, I don't see the uic3 tool in the bin folder of my install.
Does ... | How to open a Pyqt 3.3 ui file with QtDesigner 4? | 0 | 0.099668 | 1 | 0 | 0 | 900 |
2,296,550 | 2010-02-19T13:28:00.000 | 3 | 0 | 1 | 0 | 0 | python,scope,global-variables | 0 | 2,298,388 | 0 | 3 | 0 | false | 0 | 0 | Python does not support globals shared between several modules: this is a feature. Code that implicitly modifies variables used far away is confusing and unmaintainable. The real solution is to encapsulate all state within a class and pass its instance to anything that has to modify it. This can make code clearer, more... | 2 | 2 | 0 | 0 | I investigated that scope of global variables in python is limited to the module. But I need the scope to be global among different modules. Is there such a thing? I played around __builtin__ but no luck.
thanks in advance! | how to have global variables among different modules in Python | 1 | 0.197375 | 1 | 0 | 0 | 3,316 |
2,296,550 | 2010-02-19T13:28:00.000 | 0 | 0 | 1 | 0 | 0 | python,scope,global-variables | 0 | 2,296,580 | 0 | 3 | 0 | false | 0 | 0 | Scopes beyond the local must be written to via a reference to the scope, or after a global or nonlocal (3.x+) directive. | 2 | 2 | 0 | 0 | I investigated that scope of global variables in python is limited to the module. But I need the scope to be global among different modules. Is there such a thing? I played around __builtin__ but no luck.
thanks in advance! | how to have global variables among different modules in Python | 1 | 0 | 1 | 0 | 0 | 3,316 |
2,297,889 | 2010-02-19T16:31:00.000 | 1 | 1 | 1 | 0 | 0 | python,ruby,scripting,dsl,trading | 0 | 2,297,992 | 0 | 11 | 0 | false | 0 | 0 | Custom-made modules are going to be needed, no matter what you choose, that define your firm's high level constructs.
Here are some of the needs I envision -- you may have some of these covered already: a way to get current positions, current and historical quotes, previous performance data, etc... into the applicati... | 5 | 14 | 0 | 0 | I'm currently working on a component of a trading product that will allow a quant or strategy developer to write their own custom strategies. I obviously can't have them write these strategies in natively compiled languages (or even a language that compiles to a bytecode to run on a vm) since their dev/test cycles hav... | Scripting language for trading strategy development | 1 | 0.01818 | 1 | 0 | 0 | 3,358 |
2,297,889 | 2010-02-19T16:31:00.000 | 0 | 1 | 1 | 0 | 0 | python,ruby,scripting,dsl,trading | 0 | 2,298,038 | 0 | 11 | 0 | false | 0 | 0 | Existing languages are "a little "low level" for my target users."
Yet, all you need is "a minimum of support for looping, simple arithmatic, logical expression evaluation"
I don't get the problem. You only want a few features. What's wrong with the list of languages you provided? They actually offer those features?... | 5 | 14 | 0 | 0 | I'm currently working on a component of a trading product that will allow a quant or strategy developer to write their own custom strategies. I obviously can't have them write these strategies in natively compiled languages (or even a language that compiles to a bytecode to run on a vm) since their dev/test cycles hav... | Scripting language for trading strategy development | 1 | 0 | 1 | 0 | 0 | 3,358 |
2,297,889 | 2010-02-19T16:31:00.000 | 0 | 1 | 1 | 0 | 0 | python,ruby,scripting,dsl,trading | 0 | 2,298,183 | 0 | 11 | 0 | false | 0 | 0 | I would use Common Lisp, which supports rapid development (you have a running image and can compile/recompile individual functions) and tailoring the language to your domain. You would provide functions and macros as building blocks to express strategies, and the whole language would be available to the user for combi... | 5 | 14 | 0 | 0 | I'm currently working on a component of a trading product that will allow a quant or strategy developer to write their own custom strategies. I obviously can't have them write these strategies in natively compiled languages (or even a language that compiles to a bytecode to run on a vm) since their dev/test cycles hav... | Scripting language for trading strategy development | 1 | 0 | 1 | 0 | 0 | 3,358 |
2,297,889 | 2010-02-19T16:31:00.000 | 0 | 1 | 1 | 0 | 0 | python,ruby,scripting,dsl,trading | 0 | 2,298,573 | 0 | 11 | 0 | false | 0 | 0 | Define the language first -- if possible, use the pseudo-language called EBN, it's very simple (see the Wikipedia entry).
Then once you have that, pick the language. Almost certainly you will want to use a DSL. Ruby and Lua are both really good at that, IMO.
Once you start working on it, you may find that you go back... | 5 | 14 | 0 | 0 | I'm currently working on a component of a trading product that will allow a quant or strategy developer to write their own custom strategies. I obviously can't have them write these strategies in natively compiled languages (or even a language that compiles to a bytecode to run on a vm) since their dev/test cycles hav... | Scripting language for trading strategy development | 1 | 0 | 1 | 0 | 0 | 3,358 |
2,297,889 | 2010-02-19T16:31:00.000 | 0 | 1 | 1 | 0 | 0 | python,ruby,scripting,dsl,trading | 0 | 2,298,008 | 0 | 11 | 0 | false | 0 | 0 | This might be a bit simplistic, but a lot of quant users are used to working with Excel & VBA macros. Would something like VBSCript be usable, as they may have some experience in this area. | 5 | 14 | 0 | 0 | I'm currently working on a component of a trading product that will allow a quant or strategy developer to write their own custom strategies. I obviously can't have them write these strategies in natively compiled languages (or even a language that compiles to a bytecode to run on a vm) since their dev/test cycles hav... | Scripting language for trading strategy development | 1 | 0 | 1 | 0 | 0 | 3,358 |
2,299,454 | 2010-02-19T20:51:00.000 | 0 | 0 | 1 | 0 | 0 | python,dictionary,csv,large-files | 0 | 3,279,041 | 0 | 6 | 0 | false | 0 | 0 | my idea is to use python zodb module to store dictionaty type data and then create new csv file using that data structure. do all your operation at that time. | 2 | 4 | 1 | 0 | I'm reading a 6 million entry .csv file with Python, and I want to be able to search through this file for a particular entry.
Are there any tricks to search the entire file? Should you read the whole thing into a dictionary or should you perform a search every time? I tried loading it into a dictionary but that took a... | How do quickly search through a .csv file in Python | 1 | 0 | 1 | 0 | 0 | 20,439 |
2,299,454 | 2010-02-19T20:51:00.000 | 1 | 0 | 1 | 0 | 0 | python,dictionary,csv,large-files | 0 | 2,443,606 | 0 | 6 | 0 | false | 0 | 0 | You can't go directly to a specific line in the file because lines are variable-length, so the only way to know when line #n starts is to search for the first n newlines. And it's not enough to just look for '\n' characters because CSV allows newlines in table cells, so you really do have to parse the file anyway. | 2 | 4 | 1 | 0 | I'm reading a 6 million entry .csv file with Python, and I want to be able to search through this file for a particular entry.
Are there any tricks to search the entire file? Should you read the whole thing into a dictionary or should you perform a search every time? I tried loading it into a dictionary but that took a... | How do quickly search through a .csv file in Python | 1 | 0.033321 | 1 | 0 | 0 | 20,439 |
2,299,697 | 2010-02-19T21:23:00.000 | 1 | 0 | 0 | 0 | 0 | python,django,django-models,wiki | 0 | 2,299,776 | 0 | 3 | 0 | false | 1 | 0 | Assuming that there will be a community of users you can provide good tools for them to spot problems and easily undo damage. The most important of these is to provide a Recent Changes page that summarizes recent edits. Then each page that can be edited should retain prior versions of the page that can be used to repla... | 2 | 0 | 0 | 0 | I'm building this app in Python with Django.
I would like to give parts of the site wiki like functionality,
but I don't know how to go on about reliability and security.
Make sure that good content is not ruined
Check for quality
Prevent spam from invading the site
The items requiring wiki like functionality are jus... | Building a wiki application? | 0 | 0.066568 | 1 | 0 | 0 | 1,412 |
2,299,697 | 2010-02-19T21:23:00.000 | 1 | 0 | 0 | 0 | 0 | python,django,django-models,wiki | 0 | 2,299,849 | 0 | 3 | 0 | false | 1 | 0 | Make sure that good content is not ruined = version each edit and allow roll-backs.
Check for quality = get people to help with that
Prevent spam from invading the site = get people to help with that, require login, add a captcha if need be, use nofollow for all links | 2 | 0 | 0 | 0 | I'm building this app in Python with Django.
I would like to give parts of the site wiki like functionality,
but I don't know how to go on about reliability and security.
Make sure that good content is not ruined
Check for quality
Prevent spam from invading the site
The items requiring wiki like functionality are jus... | Building a wiki application? | 0 | 0.066568 | 1 | 0 | 0 | 1,412 |
2,299,751 | 2010-02-19T21:32:00.000 | 0 | 0 | 0 | 0 | 1 | python,ping,icmp | 0 | 2,299,927 | 0 | 1 | 0 | true | 0 | 0 | A problem you might be having is due to the fact that ICMP is layer 3 of the OSI model and does not use a port for communication. In short, ICMP isn't really designed for this. The desired behavior is still possible but perhaps the IP Stack you are using is getting in the way and if this is on a Windows system then 10... | 1 | 1 | 0 | 0 | I'm writing service in python that async ping domains. So it must be able to ping many ip's at the same time. I wrote it on epoll ioloop, but have problem with packets loss.
When there are many simultaneous ICMP requests much part of replies on them didn't reach my servise. What may cause this situation and how i can m... | Problem with asyn icmp ping | 0 | 1.2 | 1 | 0 | 1 | 788 |
2,303,956 | 2010-02-20T22:12:00.000 | 8 | 0 | 0 | 1 | 0 | python,emacs,virtualenv | 0 | 2,307,435 | 0 | 2 | 0 | true | 0 | 0 | So it seems that python-shell does the right thing by picking up the environment settings, whereas py-shell does not. python-shell is provided by python.el and py-shell is provided by python-mode.el , There's bug reports etc related to this, so I'm just not going to use py-shell for now. Figured I'd close the loop on t... | 1 | 12 | 0 | 0 | Today I've been trying to bring more of the Python related modes into
my Emacs configuration but I haven't had much luck.
First what I've noticed is that depending on how Emacs is
launched (terminal vs from the desktop), the interpreter it decides to
use is different.
launched from KDE menu: M-! which python gives /us... | Specifying python interpreter from virtualenv in emacs | 0 | 1.2 | 1 | 0 | 0 | 6,786 |
2,306,984 | 2010-02-21T18:50:00.000 | 1 | 0 | 0 | 0 | 0 | python,oauth,google-api | 0 | 3,110,939 | 0 | 1 | 0 | true | 1 | 0 | When you're exchanging for the access token, the oauth_verifier parameter is required. If you don't provide that parameter, then google will tell you that the token is invalid. | 1 | 2 | 0 | 0 | I am having trouble exchanging my Oauth request token for an Access Token. My Python application successfully asks for a Request Token and then redirects to the Google login page asking to grant access to my website. When I grant access I retrieve a 200 status code but exchanging this authorized request token for an ac... | Exchange Oauth Request Token for Access Token fails Google API | 0 | 1.2 | 1 | 0 | 1 | 1,332 |
2,311,094 | 2010-02-22T13:27:00.000 | 0 | 0 | 0 | 0 | 0 | python,django,user-management | 0 | 2,311,740 | 0 | 2 | 0 | false | 1 | 0 | If I'm understanding you correctly, it seems like you want to have two different groups have access to all the same views, but they will see different numbers. You can achieve this effect by making separate templates for the different groups, and then loading the appropriate template for each view depending on the grou... | 1 | 2 | 0 | 0 | Background information:
I have created an internal site for a company. Most of the work has gone into making calculation tools that their sale persons can use to make offers for clients. Create pdf offers and contracts that can be downloaded, compare prices etc. All of this is working fine.
Now their sale persons have ... | How to handle user mangement in Django for groups that has same access but different rules? | 1 | 0 | 1 | 0 | 0 | 439 |
2,311,223 | 2010-02-22T13:49:00.000 | 2 | 0 | 1 | 0 | 0 | python,database,string,list,dictionary | 0 | 2,312,727 | 0 | 5 | 0 | false | 0 | 0 | There are any number of serialization methods out there, JSON is readable, reasonably compact, supported natively, and portable. I prefer it over pickle, since the latter can execute arbitrary code and potentially introduce security holes, and because of its portability.
Depending on your data's layout, you may also b... | 3 | 1 | 0 | 0 | If I have a dictionary full of nested stuff, how do I store that in a database, as a string? and then, convert it back to a dictionary when I'm ready to parse?
Edit: I just want to convert it to a string...and then back to a dictionary. | How do I store a dict/list in a database? | 0 | 0.07983 | 1 | 0 | 0 | 2,541 |
2,311,223 | 2010-02-22T13:49:00.000 | 4 | 0 | 1 | 0 | 0 | python,database,string,list,dictionary | 0 | 2,311,245 | 0 | 5 | 0 | false | 0 | 0 | Options:
1) Pickling
2) XML
3) JSON
others I am sure. It has a lot to do on how much portability means to you. | 3 | 1 | 0 | 0 | If I have a dictionary full of nested stuff, how do I store that in a database, as a string? and then, convert it back to a dictionary when I'm ready to parse?
Edit: I just want to convert it to a string...and then back to a dictionary. | How do I store a dict/list in a database? | 0 | 0.158649 | 1 | 0 | 0 | 2,541 |
2,311,223 | 2010-02-22T13:49:00.000 | 1 | 0 | 1 | 0 | 0 | python,database,string,list,dictionary | 0 | 2,312,726 | 0 | 5 | 0 | false | 0 | 0 | You have two options
use a standard serialization format (json, xml, yaml, ...)
pros: you can access with a any language that can parse those formats (on the worst case you can write your own parser)
cons: could be slower to save and load the data (this depends of the implementation mostly)
use cPickle:
pros: easy ... | 3 | 1 | 0 | 0 | If I have a dictionary full of nested stuff, how do I store that in a database, as a string? and then, convert it back to a dictionary when I'm ready to parse?
Edit: I just want to convert it to a string...and then back to a dictionary. | How do I store a dict/list in a database? | 0 | 0.039979 | 1 | 0 | 0 | 2,541 |
2,313,053 | 2010-02-22T18:17:00.000 | 2 | 0 | 0 | 1 | 1 | python,linux,path | 0 | 2,313,168 | 0 | 4 | 0 | false | 0 | 0 | It's important to remember:
use of the tilde ~ expands the home directory as per Poke's answer
use of the forward slash / is the separator for linux / *nix directories
by default, *nix systems such as linux for example has a wild card globbing in the shell, for instance echo *.* will return back all files that match t... | 1 | 3 | 0 | 0 | Using Python, how does one parse/access files with Linux-specific features, like "~/.mozilla/firefox/*.default"? I've tried this, but it doesn't work.
Thanks | Python: How to Access Linux Paths | 0 | 0.099668 | 1 | 0 | 1 | 7,357 |
2,314,307 | 2010-02-22T21:22:00.000 | 2 | 0 | 0 | 0 | 0 | python,database,logging | 0 | 46,617,613 | 0 | 5 | 0 | false | 0 | 0 | Old question, but dropping this for others. If you want to use python logging, you can add two handlers. One for writing to file, a rotating file handler. This is robust, and can be done regardless if the dB is up or not.
The other one can write to another service/module, like a pymongo integration.
Look up logging.c... | 1 | 48 | 0 | 0 | I'm seeking a way to let the python logger module to log to database and falls back to file system when the db is down.
So basically 2 things: How to let the logger log to database and how to make it fall to file logging when the db is down. | python logging to database | 0 | 0.07983 | 1 | 1 | 0 | 48,780 |
2,315,032 | 2010-02-22T23:18:00.000 | 1 | 0 | 1 | 0 | 1 | python | 0 | 2,315,052 | 0 | 9 | 0 | false | 0 | 0 | Put the dates in a set and then iterate from the first date to the last using datetime.timedelta(), checking for containment in the set each time. | 1 | 23 | 0 | 0 | In Python how do I find all the missing days in a sorted list of dates? | How do I find missing dates in a list of sorted dates? | 0 | 0.022219 | 1 | 0 | 0 | 16,151 |
2,317,921 | 2010-02-23T12:08:00.000 | 2 | 1 | 0 | 0 | 0 | php,python,object,ipython | 0 | 2,317,942 | 0 | 4 | 0 | false | 0 | 0 | dir(object) will give you all its attribute names. | 1 | 1 | 0 | 0 | Is there a way to get PHP-like print_r(object) funcionality in iPython?
I know I can use '?' to get info about an object, but how do I view the values of the object? | print_r functionality in iPython | 0 | 0.099668 | 1 | 0 | 0 | 497 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.