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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,270,192 | 2010-11-24T18:20:00.000 | 14 | 0 | 0 | 0 | python,django,python-3.x | 4,270,238 | 3 | true | 1 | 0 | No. Don't wait.
Why? Pretty much all django libraries are written for Python 2.x, and if you ever plan on using any of them with Python 3 with the next major release of Django then you'll be waiting not 1 but 3-4 years when everyone starts converting their code.
In this time, you could have already mastered django and... | 3 | 8 | 0 | I have a website idea that I'm very excited about, and I love Python. So, I'm interested in using Django. However, I started learning Python in version 3.1, and Django currently only supports various 2.x versions. I've searched for information about when Django will start supporting Python 3.x, and gotten mostly articl... | Should I wait for Django to start supporting Python 3? | 1.2 | 0 | 0 | 884 |
4,270,612 | 2010-11-24T19:15:00.000 | 2 | 0 | 0 | 0 | python,django,scrapy | 4,274,071 | 2 | false | 1 | 0 | for #1: Don't use rules attribute to extract links and follow, write your rule in parse function and yield or return Requests object.
for #2: Try scrapyd | 1 | 6 | 0 | I just got scrapy setup and running and it works great, but I have two (noob) questions. I should say first that I am totally new to scrapy and spidering sites.
Can you limit the number of links crawled? I have a site that doesn't use pagination and just lists a lot of links (which I crawl) on their home page. I fe... | Scrapy Django Limit links crawled | 0.197375 | 0 | 0 | 1,211 |
4,270,893 | 2010-11-24T19:48:00.000 | 2 | 0 | 0 | 0 | python,django,markdown | 4,832,196 | 2 | false | 1 | 0 | I fixed this error by removing the .py extension from markdown.py in whatever/bin. This apparently prevented it from importing itself instead of the markdown module in site-packages. | 1 | 3 | 0 | I've got a weird error where I can import markdown in Python, and I can import markdown in python inside the Django runserver, but I get the following when trying to import markdown inside of gunicorn's app server.
* ImportError: cannot import name COMMAND_LINE_LOGGING_LEVEL
This is even more confusing because I found ... | Cannot import markdown because of COMMAND_LINE_LOGGING_LEVEL | 0.197375 | 0 | 0 | 1,564 |
4,271,089 | 2010-11-24T20:12:00.000 | 0 | 0 | 0 | 0 | python,django,django-admin | 4,271,834 | 3 | false | 1 | 0 | the django admin is more of a one size fits all kind of ui which may not be intuitive for use in some cases ..
customizing its look is easy but extending it is some how hard. you are better off designing your own views in that case. | 2 | 0 | 0 | Has anyone implemented their own AdminSite? How easy/hard was the basic implementation?
I'm in the midst of building a "cms" that's going to be quite large and decently complex in some areas and I'm wondering if using something like AdminSite would save some time. I'd rather not have to make my own implementation for a... | Django AdminSite - Difficult or Easy Implementation? | 0 | 0 | 0 | 633 |
4,271,089 | 2010-11-24T20:12:00.000 | 0 | 0 | 0 | 0 | python,django,django-admin | 4,271,476 | 3 | false | 1 | 0 | Both
If you are OK with it not doing exactly what you want its pretty much done for you automatically. If you need fine grain control over certain things it can be hard to customize without knowing the internals of the admin code. | 2 | 0 | 0 | Has anyone implemented their own AdminSite? How easy/hard was the basic implementation?
I'm in the midst of building a "cms" that's going to be quite large and decently complex in some areas and I'm wondering if using something like AdminSite would save some time. I'd rather not have to make my own implementation for a... | Django AdminSite - Difficult or Easy Implementation? | 0 | 0 | 0 | 633 |
4,271,740 | 2010-11-24T21:33:00.000 | 14 | 0 | 0 | 0 | python,hostname | 4,271,771 | 12 | false | 0 | 0 | socket.gethostname() could do | 1 | 833 | 0 | I'm writing a chat program for a local network. I would like be able to identify computers and get the user-set computer name with Python. | How can I use Python to get the system hostname? | 1 | 0 | 0 | 684,126 |
4,272,091 | 2010-11-24T22:23:00.000 | 0 | 0 | 1 | 0 | python,regex | 4,272,124 | 3 | false | 0 | 0 | (?<=#TR=[)[^]]*(?=]) | 1 | 0 | 0 | How to find everything which goes after symols #TR= and it is inside [ ] using re module. For example #TR=[ dfgg dfgddfg dgfgf dgdgdg dfgfg ] | Python. Regular expression | 0 | 0 | 0 | 218 |
4,273,169 | 2010-11-25T02:03:00.000 | 2 | 0 | 0 | 0 | python,algorithm,filtering,prediction,collaborative | 5,586,430 | 2 | false | 0 | 0 | I think it might work, but I would apply log to the number of tries (you can't do log(0) so retries won't work) first. If someone found a level easy they would try it once or twice, whereas people who found it hard would generally have to do it over and over again. The difference between did it in 1 go vs 2 goes is muc... | 1 | 8 | 1 | I am planning to use SlopeOne algorithm to predict if a gamer can complete a given level in a Game or not?
Here is the scenario:
Lots of Gamers play and try to complete 100 levels in the game.
Each gamer can play a level as many times as they want until they cross the level.
The system keeps track of the level and the... | Using SlopeOne algorithm to predict if a gamer can complete a level in a Game? | 0.197375 | 0 | 0 | 431 |
4,273,466 | 2010-11-25T03:18:00.000 | 4 | 0 | 0 | 0 | python,hash | 4,273,543 | 5 | false | 0 | 0 | Why not just XOR with a nice long number?
Easy. Fast. Reversible.
Or, if this doesn't need to be terribly secure, you could convert from base 10 to some smaller base (like base 8 or base 4, depending on how long you want the numbers to be). | 2 | 50 | 1 | I need a reversible hash function (obviously the input will be much smaller in size than the output) that maps the input to the output in a random-looking way. Basically, I want a way to transform a number like "123" to a larger number like "9874362483910978", but not in a way that will preserve comparisons, so it must... | Reversible hash function? | 0.158649 | 0 | 0 | 47,252 |
4,273,466 | 2010-11-25T03:18:00.000 | 19 | 0 | 0 | 0 | python,hash | 4,274,259 | 5 | false | 0 | 0 | What you are asking for is encryption. A block cipher in its basic mode of operation, ECB, reversibly maps a input block onto an output block of the same size. The input and output blocks can be interpreted as numbers.
For example, AES is a 128 bit block cipher, so it maps an input 128 bit number onto an output 128 b... | 2 | 50 | 1 | I need a reversible hash function (obviously the input will be much smaller in size than the output) that maps the input to the output in a random-looking way. Basically, I want a way to transform a number like "123" to a larger number like "9874362483910978", but not in a way that will preserve comparisons, so it must... | Reversible hash function? | 1 | 0 | 0 | 47,252 |
4,273,729 | 2010-11-25T04:29:00.000 | 5 | 0 | 1 | 0 | python,virtualenv | 4,273,823 | 2 | true | 0 | 0 | You can also (on UNIX) symlink specific packages from the Python site-packages into your virtualenv's site-packages. | 1 | 4 | 0 | When creating a virtual environment with no -site packages do I need to install mysql & the mysqldb adapter which is in my global site packages in order to use them in my virtual project environment? | Python Virtualenv | 1.2 | 1 | 0 | 920 |
4,273,939 | 2010-11-25T05:12:00.000 | 3 | 0 | 1 | 1 | python,windows,subprocess,runas | 4,274,871 | 3 | false | 0 | 0 | Another option is to popen not the desired process but runas ... command. Note that the Run As service should be enabled and running. | 1 | 7 | 0 | What is the best manner of launching a subprocess as a different user in Python on Windows? Preferably XP and up, but if it works only on Vista and 7, I can live with that too. | Python subprocess.Popen as different user on Windows | 0.197375 | 0 | 0 | 10,165 |
4,274,207 | 2010-11-25T06:09:00.000 | -1 | 0 | 1 | 0 | python | 4,274,234 | 4 | false | 0 | 0 | I don't know python but it should be possible to convert the string into an array , then iterate thru the array to create a dictionary by alternating name & value. | 1 | 0 | 0 | I'd like to take a string containing tuples that are not well separated and convert them into a dictionary.
s = "banana 4 apple 2 orange 4"
d = {'banana':'4', 'apple':'2', 'orange':'4'}
I'm running into a problem because the space is used to separate the values as well as the pairs. What's the right trick? | How can you convert a list of poorly formed data pairs into a dict? | -0.049958 | 0 | 0 | 634 |
4,276,342 | 2010-11-25T11:10:00.000 | 1 | 0 | 0 | 0 | python,line,pygame | 4,276,397 | 3 | true | 0 | 1 | If you use screen.fill([0,0,0]) it will fill in the background (or whatever you have set to be your background).
This will erase any lines drawn on the image, essentially removing anything drawn on the background. | 1 | 0 | 0 | I'm using pygame to create a small scene. Right now, I'm working with lines.
I have an array of lines which are drawn to the screen and when a line is deleted from the array, I would like the line to disappear from the screen.
The problem I've found is that the line is drawn on the screen and remains static. I can't ... | Python (pygame): How can I delete a line? | 1.2 | 0 | 0 | 4,502 |
4,276,850 | 2010-11-25T12:05:00.000 | 4 | 0 | 0 | 0 | python,pygame,transparent | 4,535,566 | 4 | true | 0 | 1 | After checking both PyGame and SDL documentations I came to conclusion that what I asked wasn't doable in PyGame using standard functions.
SDL docs state that per-pixel alpha and per-surface alpha cannot be combined with the former always taking the precedence. The only way to achieve the effect I want is by writing a ... | 1 | 13 | 0 | Is it possible to display PyGame surfaces with controllable alpha? I would like to take a surface with its own per pixel alpha and display it with variable level of translucency without affecting the surface data and keep the transparency intact i.e. the objects on the surface would keep their shapes but their "content... | PyGame: translucent sprites with per pixel alpha | 1.2 | 0 | 0 | 7,315 |
4,278,444 | 2010-11-25T15:08:00.000 | 1 | 1 | 0 | 0 | python,file-io,cython | 8,262,264 | 1 | false | 0 | 1 | Would it be too inefficient to call os.fdopen() on the file descriptor number returned by the underlying library, and then to dispatch normal Python method calls to the resulting file object in order to do your input and output? With most I/O, I would be surprised if you could see a difference with whether you called a... | 1 | 20 | 0 | I need to expose a file-like object from a C library that i'm wrapping with a Cython module. I want to reuse python's generic io code for stuff like buffering, readline(), etc.
The new IO module seems to be just what i need, but actually using it from Cython seems to be non-trivial, I've tried several aproaches:
My co... | Exposing a file-like object from Cython | 0.197375 | 0 | 0 | 1,145 |
4,278,461 | 2010-11-25T15:10:00.000 | 1 | 0 | 0 | 0 | python,user-interface,tkinter,ffdshow | 4,278,800 | 1 | false | 0 | 1 | That is precisely the type of thing that python and Tkinter excel at. And yes, a relative newbie can easily do a task like that. | 1 | 1 | 0 | I was thinking that for a learning project for myself, I would try to make a GUI for ffdshow on linux, using tkinter. Wanted to make sure this project would be feasible first, before I get halfway through and run into something that cant be done in python.
Basic idea is to have a single GUI window with a bunch of drop ... | making a python gui for ffdshow | 0.197375 | 0 | 0 | 446 |
4,278,476 | 2010-11-25T15:11:00.000 | 0 | 0 | 0 | 0 | python,ruby-on-rails,ruby,django,deployment | 4,279,176 | 6 | false | 1 | 0 | At the moment Rails has better tools for deployment. Of course you can use Capistrano and other tools mentioned in this thread with Python/Django as well, it just mean you have to learn some bits of Ruby notation.
Fabric is great and feels more natural if you are Python person however has much less out-of-the-box funct... | 2 | 1 | 0 | I'm looking for at either Rails or Django for some opensource development..
I recently tried to install Gitorious (awesome rails app) on a server..
Gave up after about 4 days of crying at 3AM,
Which is generally the easiest to deploy?
Thanks
Daniel | Rails vs Django Deployment | 0 | 0 | 0 | 1,629 |
4,278,476 | 2010-11-25T15:11:00.000 | 1 | 0 | 0 | 0 | python,ruby-on-rails,ruby,django,deployment | 4,278,840 | 6 | false | 1 | 0 | HELLO,
You can use passenger to deploy your rails application without pain :) Capistrano and webistrano are alternatives too | 2 | 1 | 0 | I'm looking for at either Rails or Django for some opensource development..
I recently tried to install Gitorious (awesome rails app) on a server..
Gave up after about 4 days of crying at 3AM,
Which is generally the easiest to deploy?
Thanks
Daniel | Rails vs Django Deployment | 0.033321 | 0 | 0 | 1,629 |
4,279,885 | 2010-11-25T18:20:00.000 | 0 | 0 | 0 | 0 | python,django,django-models,django-views,django-testing | 4,285,854 | 6 | false | 1 | 0 | I also had this problem before,
may be you could install ipython,which has a magic function called like this:
%save.
This will save what you input into a file .
and ipython is a very charming tool ,which can take the palce of standard python prompt perfectly.. It also have other wonderful things !
And in django , if yo... | 1 | 0 | 0 | I am still in the development phase of a Django App. Before even writing my views.py, I test them out to see if my models are correctly defined. This I do it in the terminal by invoking
python manage.py shell
But oh so often I make some syntax error prompting me to abort the shell ctrl-D & retype everything. This proc... | Test out small snippets of Django code | 0 | 0 | 0 | 330 |
4,280,432 | 2010-11-25T19:50:00.000 | 1 | 0 | 0 | 1 | python,linux,multithreading,signals | 4,280,474 | 3 | false | 0 | 0 | About the only thing you can do is set a global variable from your signal handler, and have your threads check its value periodically. | 2 | 1 | 0 | hello to you all :)
i have a program that have a n number of threads(could be a lot) and they do a pretty extensive job. My problem is that sometimes some people turn off or reboot the server(the program runs all day in the company servers) i know that there is a way to make a handler for the linux signals i want to k... | receiving a linux signal and interating with threads | 0.066568 | 0 | 0 | 474 |
4,280,432 | 2010-11-25T19:50:00.000 | 3 | 0 | 0 | 1 | python,linux,multithreading,signals | 4,280,803 | 3 | true | 0 | 0 | The best way of handling this is not requiring any shutdown actions at all.
For example, your signal handler for (e.g.) SIGTERM or SIGQUIT can just call _exit and quit the process with no clean-up.
Under Linux (with non-ancient threads) when one thread calls _exit (or exit if you really want) other threads get stopped ... | 2 | 1 | 0 | hello to you all :)
i have a program that have a n number of threads(could be a lot) and they do a pretty extensive job. My problem is that sometimes some people turn off or reboot the server(the program runs all day in the company servers) i know that there is a way to make a handler for the linux signals i want to k... | receiving a linux signal and interating with threads | 1.2 | 0 | 0 | 474 |
4,280,885 | 2010-11-25T21:13:00.000 | 0 | 1 | 0 | 0 | python,openssl,m2crypto | 5,480,356 | 1 | false | 0 | 0 | I don't have 10.4.11, but I do have 10.5.8 with Python 2.6.5 and OpenSSL 0.9.8n and everything works without a problem. Please try with latest M2Crypto. If that does not work, try getting and compiling OpenSSL yourself and configuring M2Crypto to use that. Maybe something is wrong with your current OpenSSL. | 1 | 0 | 0 | Importing M2Crypto version 0.20.2 on python 2.6.5 fails when M2Crypto was compiled against a recent openssl versions (0.9.8x or higher) on MAC OS X 10.4.11:
Even though the compilation works against these openssl version, M2Crypto fails to import, because a missing symbol: _PEM_read_bio_EC_PUBKEY
Python 2.6.5 (r265:79... | Symbol not found: _PEM_read_bio_EC_PUBKEY Importing M2Crypto-0.20.2 when compiled against openssl 0.9.8x or 1.0.0x | 0 | 0 | 0 | 257 |
4,281,190 | 2010-11-25T22:13:00.000 | 0 | 1 | 1 | 0 | python,pycharm | 4,281,235 | 3 | false | 0 | 0 | Not a pro on this but I think you have to use the module name preceding the method you want to call. For example to call a function named doStuff in the settings module call settings.doStuff().
To call the methods directly you need to use "from settings import *". But I think this method is frowned upon. | 1 | 0 | 0 | Is it possible to configure PyCharm in the following way:
Request auto-completion on any letter key press
Complete on space press, instead of enter
Request completion for modules not in path
I mean, configure it in VS-way.
Also, VS-like hotkeys will be amazing option | PyCharm imports and code completion | 0 | 0 | 0 | 1,813 |
4,283,639 | 2010-11-26T08:32:00.000 | 4 | 0 | 1 | 0 | python,file,equality | 4,283,664 | 6 | false | 0 | 0 | Ok, this might need two separate answers.
If you have many files to compare, go for the checksum and cache the checksum for each file. To be sure, compare matching files byte for byte afterwards.
If you have only two files, go directly for byte comparison because you have to read the file anyway to compute the checksum... | 2 | 5 | 0 | what's the most elegant way to check to files for equality in Python?
Checksum? Bytes comparing? Think files wont' be larger than 100-200 MB | check files for equality | 0.132549 | 0 | 0 | 10,060 |
4,283,639 | 2010-11-26T08:32:00.000 | -2 | 0 | 1 | 0 | python,file,equality | 4,283,665 | 6 | false | 0 | 0 | I would do checksum with MD5 (for example) instead of byte comaprasion plus the date check and depend on you needs name check. | 2 | 5 | 0 | what's the most elegant way to check to files for equality in Python?
Checksum? Bytes comparing? Think files wont' be larger than 100-200 MB | check files for equality | -0.066568 | 0 | 0 | 10,060 |
4,285,237 | 2010-11-26T12:20:00.000 | 10 | 0 | 1 | 0 | python,assert,cython | 4,285,513 | 2 | false | 0 | 0 | Cython skips the assertions if you define the C preprocessor macro PYREX_WITHOUT_ASSERTIONS. So pass -DPYREX_WITHOUT_ASSERTIONS to the C compiler when compiling the generated C file. How to to this depends on your build process. | 1 | 6 | 0 | so, here is my problem:
I code in python, but I need to improve performance in some part of my code that are too slow. A good(and easy) solution seems to be using cython; I tried it and got good results.
The issue is that I use assert statement in my python code. Before using cython, I could compile my python code with... | How to remove python assertion when compiling in cython? | 1 | 0 | 0 | 2,337 |
4,285,388 | 2010-11-26T12:46:00.000 | 0 | 0 | 0 | 0 | python,django | 4,287,426 | 4 | false | 1 | 0 | 1) ModelAdmin, you can customize the Forms for CRUD operations with this.
2) Overload your Admin Templates
3) Admin Tools and Grappelli provide great options to extend and customize the Django Admin
sorry, i can't post links but google can help easily with 1) and 2) searchs. | 1 | 1 | 0 | How to customize the look and feel of django admin? | How to customize the look and feel of django admin | 0 | 0 | 0 | 1,478 |
4,287,941 | 2010-11-26T19:06:00.000 | 27 | 1 | 0 | 0 | python,rabbitmq,amqp | 4,288,304 | 8 | true | 0 | 0 | As far as I know, there isn't any way of doing this. That's nothing to do with Python, but because AMQP doesn't define any method of queue discovery.
In any case, in AMQP it's clients (consumers) that declare queues: publishers publish messages to an exchange with a routing key, and consumers determine which queues tho... | 2 | 42 | 0 | I need to have a python client that can discover queues on a restarted RabbitMQ server exchange, and then start up a clients to resume consuming messages from each queue. How can I discover queues from some RabbitMQ compatible python api/library? | How can I list or discover queues on a RabbitMQ exchange using python? | 1.2 | 0 | 1 | 70,261 |
4,287,941 | 2010-11-26T19:06:00.000 | 2 | 1 | 0 | 0 | python,rabbitmq,amqp | 4,289,172 | 8 | false | 0 | 0 | Management features are due in a future version of AMQP. So for now you will have to wait till for a new version that will come with that functionality. | 2 | 42 | 0 | I need to have a python client that can discover queues on a restarted RabbitMQ server exchange, and then start up a clients to resume consuming messages from each queue. How can I discover queues from some RabbitMQ compatible python api/library? | How can I list or discover queues on a RabbitMQ exchange using python? | 0.049958 | 0 | 1 | 70,261 |
4,288,731 | 2010-11-26T21:47:00.000 | 0 | 0 | 1 | 0 | python,debugging | 4,288,853 | 5 | false | 0 | 0 | What you can do is use twisted.python and write the traceback to a file, it gives you an exact traceback including the exception | 1 | 6 | 0 | I'm looking for a way to debug a python exception "retrospectively". Essentially if my program raises an exception that isn't handled, I want it to save off the program state so I can go back later and debug the problem.
I've taken a look at the pdb docs, and it seems that you can do this, but only if you can interact ... | How can I retrospectively debug a python exception | 0 | 0 | 0 | 995 |
4,289,113 | 2010-11-26T23:09:00.000 | 4 | 0 | 0 | 0 | python,django,django-admin,modeladmin | 15,231,605 | 2 | false | 1 | 0 | If you write a method and add it to ModelAdmin.readonly_fields, it will appear on the change view. | 1 | 3 | 0 | I'd like to add a derived field to a default ModelAdmin.fieldsets like I would by specifying a method and adding it to the ModelAdmin.list_display property, but there doesn't seem to be an easy way to do that (if there is ANY way to do that).
The default Django Admin list view seems to have a lot more options than the ... | Add Derived Field to Django Admin Change Form | 0.379949 | 0 | 0 | 2,379 |
4,290,359 | 2010-11-27T05:58:00.000 | 0 | 0 | 1 | 0 | python,database,dictionary,pickle | 4,290,376 | 3 | false | 0 | 0 | I would think that storing it as a dictionary in a python file and importing into every module that needs it would be the way to go. Can you construct it programmatically? Either way, the file will only be actually imported once per program execution so it shouldn't be a big deal unless you know that loading it once a... | 2 | 3 | 0 | I have what is a Python dictionary of ~1000 entries. A script is going to be called repeatedly that will want to parse a string and see if any keys in the string match. If they do, it will take some action based on the key and the value.
Which of these is faster?
1) Store the dictionary in a MySQL database, and then re... | What's the most efficient way to load a dictionary in Python? | 0 | 0 | 0 | 3,522 |
4,290,359 | 2010-11-27T05:58:00.000 | 1 | 0 | 1 | 0 | python,database,dictionary,pickle | 4,290,384 | 3 | true | 0 | 0 | You might create a .py Python file that just assigns the dictionary to a name. Save the file. Compile the file to a .pyc then load it as a module when needed by your main Python script.
You get the advantage of keeping a readable textual representation of your dict for maintenance/debug, the speed of loading a .pyc fi... | 2 | 3 | 0 | I have what is a Python dictionary of ~1000 entries. A script is going to be called repeatedly that will want to parse a string and see if any keys in the string match. If they do, it will take some action based on the key and the value.
Which of these is faster?
1) Store the dictionary in a MySQL database, and then re... | What's the most efficient way to load a dictionary in Python? | 1.2 | 0 | 0 | 3,522 |
4,291,319 | 2010-11-27T11:08:00.000 | 0 | 1 | 0 | 0 | python-twitter | 4,291,535 | 1 | true | 0 | 0 | They might have a limit of requests in a certain amount of time or they had a failure on the system. You can ask for new credentials to see if the problem was the first one and try getting the tweets with them. | 1 | 0 | 0 | My code was working correctly till yesterday and I was able to fetch tweets, from GetSearch(), but now it is returning empty list, though I check my credentials are correct
Is something changed recently??
Thank you | python-twitter GetSearch giving empty list | 1.2 | 0 | 1 | 297 |
4,291,401 | 2010-11-27T11:30:00.000 | 2 | 1 | 0 | 0 | c#,python,c | 4,291,519 | 6 | false | 0 | 0 | You always need to know enough c to port headers to your language of choice when there are no ports for a library you want to use yet. Many libraries are written in c since then they can be used from almost all platforms/languages. | 5 | 1 | 0 | I have been working as a web dev with C#, VB and PHP (now learning python)..
I have been considering learning C (as a right of passage) because i hate feeling stupid =P
Apart from making me a better programmer in general..
Is there any particualr use to C for a Web Dev in 2010?
Thanks,
Daniel | Is there any merit to a web developer learning C? | 0.066568 | 0 | 0 | 241 |
4,291,401 | 2010-11-27T11:30:00.000 | 0 | 1 | 0 | 0 | c#,python,c | 4,291,408 | 6 | false | 0 | 0 | no :)
C is not targeted for web development | 5 | 1 | 0 | I have been working as a web dev with C#, VB and PHP (now learning python)..
I have been considering learning C (as a right of passage) because i hate feeling stupid =P
Apart from making me a better programmer in general..
Is there any particualr use to C for a Web Dev in 2010?
Thanks,
Daniel | Is there any merit to a web developer learning C? | 0 | 0 | 0 | 241 |
4,291,401 | 2010-11-27T11:30:00.000 | 2 | 1 | 0 | 0 | c#,python,c | 4,293,283 | 6 | false | 0 | 0 | Learning C won't necessarily make you a better programmer; there's a superstition that because C is moderately difficult to learn (true) and doesn't have an extensive toolkit (also true), you gain a deeper insight into programming in general (not necessarily true). C's just another language, no better or worse than an... | 5 | 1 | 0 | I have been working as a web dev with C#, VB and PHP (now learning python)..
I have been considering learning C (as a right of passage) because i hate feeling stupid =P
Apart from making me a better programmer in general..
Is there any particualr use to C for a Web Dev in 2010?
Thanks,
Daniel | Is there any merit to a web developer learning C? | 0.066568 | 0 | 0 | 241 |
4,291,401 | 2010-11-27T11:30:00.000 | 1 | 1 | 0 | 0 | c#,python,c | 4,292,028 | 6 | false | 0 | 0 | Given that you have experience of object orientated programming in C#, I would recommend learning C++ as opposed to C. It will indeed make you a more rounded programmer. While you could program web sites using C or C++, it's not commonly done for small scale web sites. Facebook created HipHop for PHP for instance to im... | 5 | 1 | 0 | I have been working as a web dev with C#, VB and PHP (now learning python)..
I have been considering learning C (as a right of passage) because i hate feeling stupid =P
Apart from making me a better programmer in general..
Is there any particualr use to C for a Web Dev in 2010?
Thanks,
Daniel | Is there any merit to a web developer learning C? | 0.033321 | 0 | 0 | 241 |
4,291,401 | 2010-11-27T11:30:00.000 | 4 | 1 | 0 | 0 | c#,python,c | 4,291,457 | 6 | false | 0 | 0 | Learning C (or, for the added fun, C++) as a device of increasing your understanding of programming is a good idea IMHO. But it doesn't have anything to offer you as regards web development. | 5 | 1 | 0 | I have been working as a web dev with C#, VB and PHP (now learning python)..
I have been considering learning C (as a right of passage) because i hate feeling stupid =P
Apart from making me a better programmer in general..
Is there any particualr use to C for a Web Dev in 2010?
Thanks,
Daniel | Is there any merit to a web developer learning C? | 0.132549 | 0 | 0 | 241 |
4,291,566 | 2010-11-27T12:10:00.000 | 0 | 0 | 0 | 0 | python,architecture,3d,pyglet | 4,368,817 | 2 | false | 0 | 1 | You could put the logic into a seperate module / into seperate classes/functions.
In my 2D-Game I have a GameLogic class which simplifies registering it's methods for certain events or scheduling them (and unregistering+unscheduling them), and I created a @state_wrapper decorator which injects a simple new-style object... | 1 | 2 | 0 | This is a bit of a vague question but bear with me. I am in the process of writing a game using Python/Pyglet and openGL. I currently have it structured so that there is an object called 'world', in this are other objects with other objects inside them etc. I did it this way because for instance one part of the game is... | How to organise the structure of a 3D game? | 0 | 0 | 0 | 382 |
4,294,060 | 2010-11-27T21:41:00.000 | 0 | 0 | 0 | 0 | python,tkinter,py2app | 4,300,560 | 1 | true | 0 | 1 | Turns out it was a problem with using Snow Leopard. I tried it on a Leopard machine at school and it builds fine. | 1 | 2 | 0 | I have a Tkinter app written in python, and I want to make "native" (easy to run) mac and windows executables of it. I've successfully built a windows .exe using py2exe, but the equivalent process with py2app isn't working.
Here's my setup.py:
from setuptools import setup
import sys
MAIN_SCRIPT = "myapp.py"
WINDOWS_IC... | Help building a mac application from python using py2app? | 1.2 | 0 | 0 | 1,470 |
4,295,384 | 2010-11-28T04:32:00.000 | 1 | 0 | 1 | 0 | python,types,syntax,django-templates | 4,296,635 | 5 | false | 1 | 0 | In addition to the points already posted, consider this. Python uses special member variables and functions to provide metadata about the object. Both the interpreter and programmers make heavy use of these. For example, both dicts and lists have a __len__ member function. Now, if a dict's data were accessed by using t... | 5 | 1 | 0 | My karate instructor is fond of saying, "a block is a lock is a throw is a blow." What he means is this: When we come to a technique in a form, although it might seem to look like a block, a little creativity and examination shows that it can also be seen as some kind of joint lock, or some kind of throw, or some kin... | Python syntax reasoning (why not fall back for . the way django template syntax does?) | 0.039979 | 0 | 0 | 225 |
4,295,384 | 2010-11-28T04:32:00.000 | 1 | 0 | 1 | 0 | python,types,syntax,django-templates | 4,296,043 | 5 | false | 1 | 0 | The different methods of accessing
attributes do different things. If
you have a function foo the two lines
of code
a = foo,
a = foo()
do two
very different things. Without
distinct syntax to reference and call
functions there would be no way for
python to know whether the variable
should be a reference to foo or the
... | 5 | 1 | 0 | My karate instructor is fond of saying, "a block is a lock is a throw is a blow." What he means is this: When we come to a technique in a form, although it might seem to look like a block, a little creativity and examination shows that it can also be seen as some kind of joint lock, or some kind of throw, or some kin... | Python syntax reasoning (why not fall back for . the way django template syntax does?) | 0.039979 | 0 | 0 | 225 |
4,295,384 | 2010-11-28T04:32:00.000 | 1 | 0 | 1 | 0 | python,types,syntax,django-templates | 4,297,020 | 5 | false | 1 | 0 | In addition to the responses above, it's not practical to merge dictionary lookup and object lookup in general because of the restrictions on object members.
What if your key has whitespace? What if it's an int, or a frozenset, etc.? Dot notation can't account for these discrepancies, so while it's an acceptable tradeo... | 5 | 1 | 0 | My karate instructor is fond of saying, "a block is a lock is a throw is a blow." What he means is this: When we come to a technique in a form, although it might seem to look like a block, a little creativity and examination shows that it can also be seen as some kind of joint lock, or some kind of throw, or some kin... | Python syntax reasoning (why not fall back for . the way django template syntax does?) | 0.039979 | 0 | 0 | 225 |
4,295,384 | 2010-11-28T04:32:00.000 | 6 | 0 | 1 | 0 | python,types,syntax,django-templates | 4,295,442 | 5 | true | 1 | 0 | JUST MY correct OPINION's opinion is indeed correct. I can't say why Guido did it this way but I can say why I'm glad that he did.
I can look at code and know right away if some expression is accessing the 'b' key in a dict-like object a, the 'b' attribute on the object a, a method being called on or the b index into ... | 5 | 1 | 0 | My karate instructor is fond of saying, "a block is a lock is a throw is a blow." What he means is this: When we come to a technique in a form, although it might seem to look like a block, a little creativity and examination shows that it can also be seen as some kind of joint lock, or some kind of throw, or some kin... | Python syntax reasoning (why not fall back for . the way django template syntax does?) | 1.2 | 0 | 0 | 225 |
4,295,384 | 2010-11-28T04:32:00.000 | 7 | 0 | 1 | 0 | python,types,syntax,django-templates | 4,295,436 | 5 | false | 1 | 0 | django templates and python are two, unrelated languages. They also have different target audiences.
In django templates, the target audience is designers, who proabably don't want to learn 4 different ways of doing roughly the same thing ( a dictionary lookup ). Thus there is a single syntax in django templates th... | 5 | 1 | 0 | My karate instructor is fond of saying, "a block is a lock is a throw is a blow." What he means is this: When we come to a technique in a form, although it might seem to look like a block, a little creativity and examination shows that it can also be seen as some kind of joint lock, or some kind of throw, or some kin... | Python syntax reasoning (why not fall back for . the way django template syntax does?) | 1 | 0 | 0 | 225 |
4,295,482 | 2010-11-28T05:07:00.000 | 3 | 0 | 1 | 0 | python,multithreading | 4,296,669 | 1 | true | 0 | 0 | Can you tell which version of python you are using?
Maybe you could have posted a snippet too.
From Python 2.6, you have a timeout added in urllib2.urlopen.
Hope this will help you. It's from the python docs.
urllib2.urlopen(url[, data][,
timeout]) Open the URL url, which can
be either a string or a Request
obje... | 1 | 0 | 0 | I was trying to download images with multi-thread, which has a limited max_count in python.
Each time a download_thread is started, I leave it alone and activate another one. I hope the download process could be ended in 5s, which means downloading is failed if opening the url costs more than 5s.
But how can I know it ... | image download problem (python) | 1.2 | 0 | 0 | 350 |
4,295,823 | 2010-11-28T07:35:00.000 | 0 | 0 | 0 | 0 | c#,php,python,apache,nginx | 4,297,198 | 1 | false | 1 | 0 | Twisted network engine is about the best answer for you. What you can have is you can have the downloader serving a maximum of 100 x people then when the queue is full you will direct people to a holding loop, in the holding loop they will wait x seconds, check if queue is full, check not expired, see who else is waiti... | 1 | 1 | 0 | My goal:
I want to host a folder of photos, but if at anytime 100 files are being downloaded, I want to redirect a new downloader/request to a 'waiting page' and give them a place in line and an approximate countdown clock until its their turn to download their requested content. Then either redirect them directly to... | Controlling rate of downloads on a per request and/or per resource basis (and providing a first-come-first-serve waiting system) | 0 | 0 | 1 | 62 |
4,296,138 | 2010-11-28T09:15:00.000 | -1 | 0 | 1 | 1 | python,path,wildcard | 38,177,861 | 8 | false | 0 | 0 | iglob is better than glob here since you do not actually want the full list of rar files, but just want to check that one rar exists | 1 | 58 | 0 | I'd like to check if there are any .rar files in a directory. It doesn’t need to be recursive.
Using wildcard with os.path.isfile() was my best guess, but it doesn't work. What can I do then? | Use wildcard with os.path.isfile() | -0.024995 | 0 | 0 | 80,871 |
4,296,830 | 2010-11-28T12:56:00.000 | 2 | 0 | 0 | 1 | python,google-app-engine | 4,300,033 | 1 | true | 1 | 0 | 'Offline' requests such as Task Queue tasks and Cron jobs have no 'user' as far as systems like SDC are concerned. If your SDC connection requires a logged in user, you will not be able to access it from a cron/task queue job. | 1 | 1 | 0 | Is it possible to use the Secure Data Connector (SDC) to access internal resources in Tasks/Cron Jobs on the Google AppEngine?
The documentation speaks about the currently logged in user but does not further elaborate this scenario. | GAE - Secure data Connector and Taskqueue/Cron | 1.2 | 0 | 0 | 236 |
4,297,167 | 2010-11-28T14:20:00.000 | -2 | 0 | 1 | 0 | python,c,module,numpy,cython | 4,297,263 | 2 | false | 0 | 0 | Check your Python documentation, the section "Python/C API Reference Manual" describes in detail how to do it.
EDITED:
So what you want is porting a 2.x lib to 3.x. That's a big work to do.
If the solution your wished exists. Python 2.x should have been eliminated by now.
Sure there is a 2to3 tool. But a Python lib wri... | 1 | 6 | 0 | Is it possible to import arbitrary modules in cython, compile them to shared object files and then use them in python 3.1?
The reason for this is, that I am writing an extension for the program "blender", which has an internal python 3.1 interpreter. But i would also like to make use of some python-modules which are no... | using cython to port modules to python 3.1 | -0.197375 | 0 | 0 | 607 |
4,297,672 | 2010-11-28T16:12:00.000 | 4 | 0 | 0 | 0 | python,sqlite,full-text-search,sqlalchemy,pylons | 4,297,732 | 6 | false | 1 | 0 | "Sphinx does not have a Python API"
is not true. Download the release and look at sphinx/api/sphinxapi.py
I use it myself and I'm pretty happy with it. The documentation is for PHP only but the Python API uses the exact same names for all functions. | 3 | 7 | 0 | I'm searching for a Python full text search engine.
I took a look at PyLucense, but I think that using a Java-based library in a Python project is not good. As I understand, Sphinx does not have a Python API.
Any ideas ? | Full text search engine for Python | 0.132549 | 0 | 0 | 10,456 |
4,297,672 | 2010-11-28T16:12:00.000 | 2 | 0 | 0 | 0 | python,sqlite,full-text-search,sqlalchemy,pylons | 4,297,754 | 6 | false | 1 | 0 | I will recommend whoosh. You can easy install it ie easy_install Whoosh
It has a neat API too | 3 | 7 | 0 | I'm searching for a Python full text search engine.
I took a look at PyLucense, but I think that using a Java-based library in a Python project is not good. As I understand, Sphinx does not have a Python API.
Any ideas ? | Full text search engine for Python | 0.066568 | 0 | 0 | 10,456 |
4,297,672 | 2010-11-28T16:12:00.000 | 2 | 0 | 0 | 0 | python,sqlite,full-text-search,sqlalchemy,pylons | 4,297,894 | 6 | false | 1 | 0 | Particularly for full text search, Solr is an excellent choice. You will have a hard time finding a more widely used and more open choice. We use Solr/Lucene at my company with a PHP web application being the client and the HTTP/REST API to let you query the index. It has as much functionality as a native PHP client... | 3 | 7 | 0 | I'm searching for a Python full text search engine.
I took a look at PyLucense, but I think that using a Java-based library in a Python project is not good. As I understand, Sphinx does not have a Python API.
Any ideas ? | Full text search engine for Python | 0.066568 | 0 | 0 | 10,456 |
4,298,011 | 2010-11-28T17:28:00.000 | 0 | 0 | 0 | 0 | python,django,django-models | 4,458,226 | 1 | true | 1 | 0 | you can overwrite your model's save() by adding codes to create the object directly if it doesn't exist. | 1 | 0 | 0 | I'm using raw_id_fields in my admin.py to change the ForeignKey's select box to an input box.
When saving the form, it checks if the object that I wrote in the ForeignKey box exists, if not, it raises an error saying "Select a valid choice. That choice is not one of the available choices."
What I want to do is skipping... | force creating object when using raw_id_fields in Django | 1.2 | 0 | 0 | 187 |
4,298,073 | 2010-11-28T17:41:00.000 | 1 | 0 | 1 | 0 | python,configparser | 4,298,145 | 3 | false | 0 | 0 | Mine works fine.
And noticed "Lines beginning with '#' or ';' are ignored and may be used to provide comments.
" | 1 | 2 | 0 | I need to specify a password on the right side of the equals sign in a Python configparser file, but semicolon is the comment character.
Escaping with \ does not work.
How can I pass the string "foo;" as a value in configparser? | How do I put a semicolon in a value in Python configparser? | 0.066568 | 0 | 0 | 2,384 |
4,298,260 | 2010-11-28T18:26:00.000 | 0 | 0 | 1 | 0 | python,debugging,multiprocessing | 4,361,057 | 3 | false | 0 | 0 | Rather than starting your function or class via Process, just call it directly and debug as you normally would. | 2 | 4 | 0 | What I would like is to be able to step-debug code that runs in a separate process using the multiprocessing package.
I remember looking for a solution about a year ago and not finding one. I was told to just do a lot of logging, but of course it is an inferior method. So maybe someone came up with a solution in the me... | Is there a way to debug Python code which runs on a `multiprocessing.Process`? | 0 | 0 | 0 | 1,362 |
4,298,260 | 2010-11-28T18:26:00.000 | 1 | 0 | 1 | 0 | python,debugging,multiprocessing | 4,298,409 | 3 | false | 0 | 0 | You could start the process You need to debug manually, without using the Process interface on this process. | 2 | 4 | 0 | What I would like is to be able to step-debug code that runs in a separate process using the multiprocessing package.
I remember looking for a solution about a year ago and not finding one. I was told to just do a lot of logging, but of course it is an inferior method. So maybe someone came up with a solution in the me... | Is there a way to debug Python code which runs on a `multiprocessing.Process`? | 0.066568 | 0 | 0 | 1,362 |
4,298,622 | 2010-11-28T19:35:00.000 | 1 | 0 | 0 | 0 | python,ruby-on-rails,ruby,django | 4,298,758 | 5 | false | 1 | 0 | This is a question I still am trying to find the answer too, here is what i can tell you so far.
Preface
When it comes to scripting langauges I always prefer python, not only I feel more strong using python, but also the libraries are better and work faster. Also (and ruby devs will have something to say) I find Python... | 2 | 6 | 0 | I have around 2 Weeks of Real development time to churn out a contact database system to replace various spreadsheets and pieces of paper laying around.
Also I need to develop two websites (with dynamic content) and a small AJAXian web service.
I have no experience of rails or django, but I can learn fast.
Both claim t... | Faster Development Rails or Django? | 0.039979 | 0 | 0 | 3,565 |
4,298,622 | 2010-11-28T19:35:00.000 | 8 | 0 | 0 | 0 | python,ruby-on-rails,ruby,django | 4,298,635 | 5 | false | 1 | 0 | The Django admin will generate a CRUD application that you can customize to suit almost any need, from your model definitions. I've used the admin for the main user interface for several projects and can tell you that it is a real timesaver. You don't have to spend any time whatsoever at writing templates or Javascript... | 2 | 6 | 0 | I have around 2 Weeks of Real development time to churn out a contact database system to replace various spreadsheets and pieces of paper laying around.
Also I need to develop two websites (with dynamic content) and a small AJAXian web service.
I have no experience of rails or django, but I can learn fast.
Both claim t... | Faster Development Rails or Django? | 1 | 0 | 0 | 3,565 |
4,298,886 | 2010-11-28T20:24:00.000 | 2 | 0 | 0 | 0 | python,sqlalchemy,pylons,sqlalchemy-migrate | 4,300,116 | 1 | true | 0 | 0 | Well what format is your seed data starting out in? The migrate calls are just python methods so you're free to open some csv, create SA object instances, loop, etc. I usually have my seed data as a series of sql insert statements and just loop over them executing a migate.execute(query) for each one.
So I'll first cr... | 1 | 2 | 0 | I'm using SqlAlchemy in my Pylons application to access data and SqlAlchemy-migrate to maintain the database schema.
It works fine for managing the schema itself. However, I also want to manage seed data in a migrate-like way. E.g. when ProductCategory table is created it would make sense to seed it with categories dat... | Managing seed data with SqlAlchemy and SqlAlchemy-migrate | 1.2 | 1 | 0 | 2,454 |
4,299,293 | 2010-11-28T21:50:00.000 | 2 | 0 | 1 | 0 | python,string | 4,299,374 | 3 | false | 0 | 0 | Strictly speaking, you cannot modify strings in python at all. Strings are an immutable type. If it is sufficient for your needs to return new strings with the desired modification, then the other answers do just that. If you really need a mutable type, you can use a list of single character strings, or you can use ... | 1 | 2 | 0 | I have a string here in python '#b9d9ff'. How do I remove the hash symbol (#)? | Modifying strings in Python | 0.132549 | 0 | 0 | 3,394 |
4,299,324 | 2010-11-28T21:55:00.000 | 0 | 0 | 0 | 0 | python,cdn | 18,712,080 | 2 | false | 1 | 0 | I think you are trying to upload the static content of your website (not the user uploaded files) to CDN via FTP client or something similar.
To achieve bulk upload you may ZIP all such files on local machine and upload to your webserver. Unzip files on webserver and write a batch script which utlize the CDN API to se... | 1 | 0 | 0 | I have to upload a webpage on cdn. Say test.html, test.css, image1.jpg etc. Now I am uploading all these file one by one. I think which is not efficient. So, is it possible to keep all these files in folder and then upload this folder on the cdn? If yes, then what parameters i need to take care about that. Does zipping... | How to upload multiple files on cdn? | 0 | 0 | 1 | 1,114 |
4,299,432 | 2010-11-28T22:15:00.000 | 2 | 0 | 0 | 0 | python,tkinter | 64,151,502 | 6 | false | 0 | 1 | My solution is root.focus() it will remove widget focus. | 2 | 11 | 0 | I'd like to remove focus from a widget manually. | In Tkinter how do i remove focus from a widget? | 0.066568 | 0 | 0 | 16,266 |
4,299,432 | 2010-11-28T22:15:00.000 | 5 | 0 | 0 | 0 | python,tkinter | 47,823,400 | 6 | false | 0 | 1 | Set focus to another widget to remove focus from the target widget is a good idea. There are two methods for this: w.focus_set() and w.focus_force(). However, method w.focus_force() is impolite. It's better to wait for the window manager to give you the focus. Setting focus to parent widget or to the root window remove... | 2 | 11 | 0 | I'd like to remove focus from a widget manually. | In Tkinter how do i remove focus from a widget? | 0.16514 | 0 | 0 | 16,266 |
4,299,769 | 2010-11-28T23:31:00.000 | 0 | 0 | 0 | 0 | python,django,pinax,profiles | 5,870,229 | 3 | false | 1 | 0 | I generally like starting with the basic or account, then build up to what I need. I prefer this method to starting with complete/social and stripping out what I don't need. Just fyi. | 2 | 2 | 0 | I want a "settings" page where the
user can submit his
hometown/biography/email settings and upload his avatar
We will be building a mobile app that uses HTTP Rest API to update the user's profile, so we must be able to do manual override of these apps.
That's it! I don't want anything else. I don't care about the fri... | Which Django/Pinax app should I use? There are so many, and I just want the simplest one | 0 | 0 | 0 | 491 |
4,299,769 | 2010-11-28T23:31:00.000 | 1 | 0 | 0 | 0 | python,django,pinax,profiles | 4,510,829 | 3 | false | 1 | 0 | I actually am approaching the same problem.
I find overriding the pinax profile app is enough. The profile section is what allows the upload of avatars and your info and allows you to also edit it.
I still haven't found a good way to override the native apps yet. Right now I am copying over the app.
Thanks,
Ray | 2 | 2 | 0 | I want a "settings" page where the
user can submit his
hometown/biography/email settings and upload his avatar
We will be building a mobile app that uses HTTP Rest API to update the user's profile, so we must be able to do manual override of these apps.
That's it! I don't want anything else. I don't care about the fri... | Which Django/Pinax app should I use? There are so many, and I just want the simplest one | 0.066568 | 0 | 0 | 491 |
4,299,802 | 2010-11-28T23:37:00.000 | 23 | 0 | 1 | 0 | python,encoding | 4,299,809 | 4 | true | 0 | 0 | Instead of .encode('utf-8'), use .encode('latin-1'). | 2 | 21 | 0 | I feel stacked here trying to change encodings with Python 2.5
I have XML response, which I encode to UTF-8: response.encode('utf-8'). That is fine, but the program which uses this info doesn't like this encoding and I have to convert it to other code page. Real example is that I use ghostscript python module to embed ... | Python: convert string from UTF-8 to Latin-1 | 1.2 | 0 | 1 | 144,526 |
4,299,802 | 2010-11-28T23:37:00.000 | 0 | 0 | 1 | 0 | python,encoding | 32,096,180 | 4 | false | 0 | 0 | If the previous answers do not solve your problem, check the source of the data that won't print/convert properly.
In my case, I was using json.load on data incorrectly read from file by not using the encoding="utf-8". Trying to de-/encode the resulting string to latin-1 just does not help... | 2 | 21 | 0 | I feel stacked here trying to change encodings with Python 2.5
I have XML response, which I encode to UTF-8: response.encode('utf-8'). That is fine, but the program which uses this info doesn't like this encoding and I have to convert it to other code page. Real example is that I use ghostscript python module to embed ... | Python: convert string from UTF-8 to Latin-1 | 0 | 0 | 1 | 144,526 |
4,301,681 | 2010-11-29T07:27:00.000 | 1 | 1 | 1 | 0 | python,tox | 4,301,739 | 5 | true | 0 | 0 | You could just install a Python 2.5.2.
I have 3 different versions Python installed on my Lucid and they use different links under /bin/ so it's easy to call the specific version
python -> python3 ->python3.1
python2 -> python2.7
python2.5 | 2 | 2 | 0 | I currently have Python 2.6.2 installed on my mac. I am writing a script which MUST run on Python 2.5.2. So I want to write a python script, and test is specifically against 2.5.2 and NOT 2.6.2.
I was looking at virtualenv, but it doesn't seem to solve my problem. I ran python virtualenv.py TEST which made a TEST dir, ... | Testing a python script in a specific version | 1.2 | 0 | 0 | 4,321 |
4,301,681 | 2010-11-29T07:27:00.000 | 0 | 1 | 1 | 0 | python,tox | 4,301,698 | 5 | false | 0 | 0 | try #!/path/to/your/python/version
But make sure you execute the script from the terminal, and make it executable before hand: chmod 755 myscript.py | 2 | 2 | 0 | I currently have Python 2.6.2 installed on my mac. I am writing a script which MUST run on Python 2.5.2. So I want to write a python script, and test is specifically against 2.5.2 and NOT 2.6.2.
I was looking at virtualenv, but it doesn't seem to solve my problem. I ran python virtualenv.py TEST which made a TEST dir, ... | Testing a python script in a specific version | 0 | 0 | 0 | 4,321 |
4,303,851 | 2010-11-29T12:49:00.000 | 0 | 0 | 1 | 0 | c++,python,3d | 4,303,972 | 8 | false | 0 | 1 | I would implement the time-critical stuff as 3D and its object handling + rendering in raw C/C++ and let an embedded Python with external modules handle the game logic (object movement, object properties, scripting and so on). | 3 | 15 | 0 | So we want to program a 3d game for school, we can probably use blender for the 3d models, however we are totally clueless as to how to use them in a game/application.
Are there any recommended guides/documents we should read on general 3d game programming and perhaps python specific stuff.
We are also possibly conside... | 3d game with Python, starting from nothing | 0 | 0 | 0 | 56,291 |
4,303,851 | 2010-11-29T12:49:00.000 | 2 | 0 | 1 | 0 | c++,python,3d | 4,303,913 | 8 | false | 0 | 1 | If you want to write a 3D game you might want to start by understanding the basics of programming and computer science. Starting with the top and learning a language, then find yourself a good graphics library for example Panda, Pygame are all good choices, then there are other parts to consider like networking with tw... | 3 | 15 | 0 | So we want to program a 3d game for school, we can probably use blender for the 3d models, however we are totally clueless as to how to use them in a game/application.
Are there any recommended guides/documents we should read on general 3d game programming and perhaps python specific stuff.
We are also possibly conside... | 3d game with Python, starting from nothing | 0.049958 | 0 | 0 | 56,291 |
4,303,851 | 2010-11-29T12:49:00.000 | 2 | 0 | 1 | 0 | c++,python,3d | 4,304,000 | 8 | false | 0 | 1 | You should be aware that 3D game consists of
animated 3D models
3D environment (including NPCs and objects)
simulation of interaction between the environment and the models (game logic and game mechanics)
user interface (starting, saving and game settings)
The game logic and mechanics is going to usually the biggest ... | 3 | 15 | 0 | So we want to program a 3d game for school, we can probably use blender for the 3d models, however we are totally clueless as to how to use them in a game/application.
Are there any recommended guides/documents we should read on general 3d game programming and perhaps python specific stuff.
We are also possibly conside... | 3d game with Python, starting from nothing | 0.049958 | 0 | 0 | 56,291 |
4,303,897 | 2010-11-29T12:54:00.000 | 3 | 0 | 0 | 0 | python,django | 4,303,960 | 2 | false | 1 | 0 | There is no sane way to get the user outside of the request. If the current user matters then pass it to any functions that need it. | 1 | 6 | 0 | I'm working on a medium sized project in django and i want to be able to access the current user from within my query manager. I need to be able to design a custom manager to limit the results and querysets so that the current user only get's information related to him/her.
I've received a few suggestions, I've also s... | How can i access the current user outside a request in django | 0.291313 | 0 | 0 | 7,107 |
4,304,899 | 2010-11-29T14:57:00.000 | 0 | 0 | 0 | 0 | python,django,django-models | 4,304,999 | 1 | true | 1 | 0 | As the currency rates change, you should either do it via javascript or (I would recommend) doing it in your view function. Storing it in a database would not make much sense, as the conversion rates change from day to day, and every time they changed, you would have to update the values in the database. If data is lik... | 1 | 1 | 0 | I have a quick question, more theory then actual code. I am building a small program that will interact with activeCollab. Anyways, I want to store the value of a quote in canadian dollars but I want to also be able to view it as USD as well. My question is, should I create a field to store the american price or sho... | Currency Conversion in django | 1.2 | 0 | 0 | 732 |
4,305,070 | 2010-11-29T15:16:00.000 | 0 | 1 | 0 | 1 | php,python | 4,305,158 | 4 | false | 0 | 0 | I think you should implement a web service . I don't know how to do it with python but i suppose it would be fairly easy. | 1 | 1 | 0 | I have a Python application (command line tool running on a machine M1) that has input I1 and output O2. Also, I have a PHP application (website running on a machine M2) that feeds the Python application with input I1 and expects to read the output O1. My question is what's the best approach to solve this problem? (the... | PHP and Python interfacing | 0 | 0 | 0 | 354 |
4,305,512 | 2010-11-29T16:00:00.000 | 1 | 0 | 1 | 0 | python,setuptools,distribute | 4,315,782 | 1 | false | 0 | 0 | If you're using Python 2.4 on Windows, there aren't any advantages to using Distribute over Setuptools. Distribute only offers a comparative advantage on Python 2.6 (where it supports the new "home" directory layout) and Python 3.x (which setuptools hasn't been ported to).
Apart from that, there aren't really any "upg... | 1 | 0 | 0 | Our large python project is being upgraded from using the legacy "setuptools" project to use "distribute" as a drop-in replacement.
We've noticed one problematic difference between the two applications: In setuptools an egg which had an undefined zip-safe flag was assumed to be zip-safe and would install as a zipped f... | Is it possible to make eggs with a None zip-safe flag default to being instaleld zipped with Distribute? | 0.197375 | 0 | 0 | 870 |
4,307,433 | 2010-11-29T19:49:00.000 | 3 | 0 | 0 | 0 | python,django | 4,307,510 | 6 | false | 1 | 0 | When trying to assign a value to reserved keywords, SyntaxError is raised. | 3 | 0 | 0 | I seem to get a TypeError ('message' is an invalid keyword argument for this function) every time I try adding something in the DB via the Django admin interface. The object is added but this exception is raised. Could be this linked to the fact that I have a model named "Message"? | Is "message" a reserved word in Django or Python? | 0.099668 | 0 | 0 | 1,065 |
4,307,433 | 2010-11-29T19:49:00.000 | 1 | 0 | 0 | 0 | python,django | 4,307,715 | 6 | false | 1 | 0 | That means the function you are calling does not accept an argument named "message".
I guess that's because the model your are using doesn't have a field named "message" | 3 | 0 | 0 | I seem to get a TypeError ('message' is an invalid keyword argument for this function) every time I try adding something in the DB via the Django admin interface. The object is added but this exception is raised. Could be this linked to the fact that I have a model named "Message"? | Is "message" a reserved word in Django or Python? | 0.033321 | 0 | 0 | 1,065 |
4,307,433 | 2010-11-29T19:49:00.000 | 5 | 0 | 0 | 0 | python,django | 4,307,494 | 6 | true | 1 | 0 | No. Python's reserved words do not include message and the TypeError you've described doesn't suggest a namespace collision. Look at the function's keyword arguments and make sure that message is among them. It isn't though, so maybe you meant to type msg. | 3 | 0 | 0 | I seem to get a TypeError ('message' is an invalid keyword argument for this function) every time I try adding something in the DB via the Django admin interface. The object is added but this exception is raised. Could be this linked to the fact that I have a model named "Message"? | Is "message" a reserved word in Django or Python? | 1.2 | 0 | 0 | 1,065 |
4,308,346 | 2010-11-29T21:36:00.000 | 0 | 0 | 0 | 0 | python,pygtk,twisted,gtk | 4,310,711 | 2 | false | 0 | 1 | Threads, perhaps? The Twisted reactor joins all threads on shutdown, and if you're doing something in a callInThread that hangs, your loop may be unable to stop. (I'm not sure what the behavior would be if you're starting your own threads, either.) | 1 | 1 | 0 | Using Python 2.6, Twisted 10.1, and GTK+ 2.22, with latest pygtk installed, I'm having problems on shutdown. When I close my application and shut down the reactor (using the gtk2reactor of course), the application simply freezes.
I've poked around the twisted source and added debug messages. What ends up happening is,... | Twisted + Gtk - shutdown not working properly | 0 | 0 | 0 | 426 |
4,308,790 | 2010-11-29T22:35:00.000 | 0 | 0 | 1 | 0 | python,function | 4,308,836 | 2 | false | 0 | 0 | I don't completely understand what you're after, but does the operator module (in the standard library) help at all? It defines functions for all the standard arithmetic operators. | 1 | 6 | 0 | I'm searching for a library that will let me manipulate functions with the standard operators (*, -, *, /, etc.).
Lets suppose you have a function f(x) = x ** 2 and g(x) = x + 2. I'd like to be able to write f * g and get a new functor that is essentialy x ** 2 * (x + 2) or f(g) and get (x + 2) ** 2.
I know this is not... | Function arithmetic library for python | 0 | 0 | 0 | 733 |
4,311,347 | 2010-11-30T07:10:00.000 | 2 | 0 | 0 | 0 | python | 4,311,727 | 4 | true | 0 | 0 | If the script runs on your server, its purpose is to serve a document, not to download it (the latter would be the urllib solution).
Depending on your needs you can:
Set up static file serving with e.g. Apache
Make the script execute on a certain URL (e.g. with mod_wsgi), then the script should set the Content-Type (p... | 3 | 0 | 0 | I am writing a script which will run on my server. Its purpose is to download the document. If any person hit the particular url he/she should be able to download the document. I am using urllib.urlretrieve but it download document on the server side not on the client. How to download in python at client side? | how to download in python | 1.2 | 0 | 1 | 322 |
4,311,347 | 2010-11-30T07:10:00.000 | 1 | 0 | 0 | 0 | python | 4,311,383 | 4 | false | 0 | 0 | If the document is on your server and your intention is that the user should be able to download this file, couldn't you just serve the url to that resource as a hyperlink in your HTML code. Sorry if I have been obtuse but this seems the most logical step given your explanation. | 3 | 0 | 0 | I am writing a script which will run on my server. Its purpose is to download the document. If any person hit the particular url he/she should be able to download the document. I am using urllib.urlretrieve but it download document on the server side not on the client. How to download in python at client side? | how to download in python | 0.049958 | 0 | 1 | 322 |
4,311,347 | 2010-11-30T07:10:00.000 | 1 | 0 | 0 | 0 | python | 4,311,378 | 4 | false | 0 | 0 | Set the appropriate Content-type header, then send the file contents. | 3 | 0 | 0 | I am writing a script which will run on my server. Its purpose is to download the document. If any person hit the particular url he/she should be able to download the document. I am using urllib.urlretrieve but it download document on the server side not on the client. How to download in python at client side? | how to download in python | 0.049958 | 0 | 1 | 322 |
4,312,197 | 2010-11-30T09:29:00.000 | 11 | 0 | 1 | 0 | python,url | 4,312,223 | 3 | false | 0 | 0 | urllib.unquote is for replacing %xx escape codes in URLs with the characters they represent. It won't be useful for this.
Your "simple string replace stuff" is probably the best solution. | 1 | 4 | 0 | I have got a url in this form - http:\\/\\/en.wikipedia.org\\/wiki\\/The_Truman_Show. How can I make it normal url. I have tried using urllib.unquote without much success.
I can always use regular expressions or some simple string replace stuff. But I believe that there is a better way to handle this... | Python unescape URL | 1 | 0 | 1 | 8,233 |
4,312,966 | 2010-11-30T11:00:00.000 | 1 | 0 | 1 | 0 | .net,visual-studio-2010,ironpython | 6,151,868 | 4 | false | 0 | 0 | SharpDevelop has an IronPython - "Class Library" template for creating IronPython dlls. | 1 | 4 | 0 | I can see Console Application , WPF, WinForm, something else
But there is no Library, I need just a library .
How can I trick it ? Or there is no way to create library with Iron Python ? | How to create Library project | 0.049958 | 0 | 0 | 2,034 |
4,312,995 | 2010-11-30T11:02:00.000 | 0 | 0 | 0 | 0 | python,django | 4,313,083 | 2 | false | 1 | 0 | You might find some use in the functions activate(language) and deactivate(language) located in django.utils.translation. I'm not sure about the efficiency of this, I imagine it is slow, but it might do the job :) | 1 | 0 | 0 | I would like to notify the user in case he's viewing the site in a language that doesn't correspond to his first preference in the ACCEPT_LANGUAGE header.
For this reason I would like to present the message to the user in his first prefered language rather than the one he's currently viewing the web-site.
Is it possibl... | Django: translate in a different language than current language | 0 | 0 | 0 | 335 |
4,313,782 | 2010-11-30T12:33:00.000 | 1 | 1 | 0 | 0 | python,compilation,lxml | 4,327,797 | 2 | false | 0 | 0 | My solution is to create an egg myself and keep that egg version-controlled with my buildout. I recreate the egg each time I need to upgrade lxml. You can almost always create a binary egg of any Python project by throwing an import setuptools into the top of its setup.py and then saying python setup.py bdist_egg. And... | 1 | 1 | 0 | We use Hudson-CI for out Continuous Integration server for Python projects, all of which use Buildout to manage dependencies. Almost all our projects use lxml which, because of Buildout, must be built/installed during each test-run and because it takes so long it reduces the number of builds we can run per day.
Is ther... | How can I speed-up the build/install of lxml? | 0.099668 | 0 | 0 | 962 |
4,314,059 | 2010-11-30T13:04:00.000 | 2 | 0 | 1 | 0 | python,google-app-engine | 4,319,701 | 3 | false | 1 | 0 | This isn't directly possible. You can use multiple equality filters, and the query will only match entities that have at least those items in the list (eg, "WHERE foo = 'a' AND foo = 'b'" will only match if foo is a list containing at least 'a' and 'b'). If you do this without inequality filters or sort orders the data... | 2 | 0 | 0 | If you have a string list in the datastore that has the values:
a,b,c
How can you compare it against a list so that it only returns true if every value in the string list is present in the list?
['a', 'b'] would return false
['a', 'b', 'c'] would return true
['a', 'b', 'c', 'd', 'e'] would return true
Is this possible ... | App Engine, How to check if all values in a list are in a string list in the datastore | 0.132549 | 0 | 0 | 612 |
4,314,059 | 2010-11-30T13:04:00.000 | 1 | 0 | 1 | 0 | python,google-app-engine | 4,315,502 | 3 | false | 1 | 0 | You can serialize your list in a sorted fashion as a single StringProperty. Depending on the content of your StringListProperty this may be as trivial as comma separated values.
Optionally you can use something like an md5 checksums to reduce the length of the string being stored and filtered against. | 2 | 0 | 0 | If you have a string list in the datastore that has the values:
a,b,c
How can you compare it against a list so that it only returns true if every value in the string list is present in the list?
['a', 'b'] would return false
['a', 'b', 'c'] would return true
['a', 'b', 'c', 'd', 'e'] would return true
Is this possible ... | App Engine, How to check if all values in a list are in a string list in the datastore | 0.066568 | 0 | 0 | 612 |
4,314,912 | 2010-11-30T14:41:00.000 | 1 | 0 | 1 | 1 | python,multithreading,logging,garbage-collection,multiprocessing | 4,316,259 | 3 | true | 0 | 0 | I agree with @THC4k. This doesn't seem like a GC issue. I'll give you my reasons why, and I'm sure somebody will vote me down if I'm wrong (if so, please leave a comment pointing out my error!).
If you're using CPython, it primarily uses reference counting, and objects are destroyed immediately when the ref count goes ... | 2 | 1 | 0 | I create a couple of worker processes using Python's Multiprocessing module 2.6.
In each worker I use the standard logging module (with log rotation and file per worker)
to keep an eye on the worker. I've noticed that after a couple of hours that no more
events are written to the log. The process doesn't appear to cr... | How can I protect a logging object from the garbage collector in a multiprocessing process? | 1.2 | 0 | 0 | 534 |
4,314,912 | 2010-11-30T14:41:00.000 | 0 | 0 | 1 | 1 | python,multithreading,logging,garbage-collection,multiprocessing | 4,316,922 | 3 | false | 0 | 0 | You could run gc.collect() immediately after fork() to see if that causes the log to be closed. But it's not likely garbage collection would take effect only after a few hours. | 2 | 1 | 0 | I create a couple of worker processes using Python's Multiprocessing module 2.6.
In each worker I use the standard logging module (with log rotation and file per worker)
to keep an eye on the worker. I've noticed that after a couple of hours that no more
events are written to the log. The process doesn't appear to cr... | How can I protect a logging object from the garbage collector in a multiprocessing process? | 0 | 0 | 0 | 534 |
4,315,657 | 2010-11-30T15:54:00.000 | 4 | 0 | 1 | 1 | python,installation | 4,315,780 | 2 | true | 0 | 0 | Configure with:
./configure --prefix=/opt/Python27
In general, you can just do ./configure --help to get a list of all the options you're allowed to set for that configure script. | 2 | 3 | 0 | I want to build Python 2.7.1 additionally to the one the redhat server already has pre-installed.
What options do I need to modify/use so that Python can be built under i.e. /opt/Python27
I would appreciate any help! | How to install Python using source files to a custom directory | 1.2 | 0 | 0 | 2,364 |
4,315,657 | 2010-11-30T15:54:00.000 | 1 | 0 | 1 | 1 | python,installation | 4,319,108 | 2 | false | 0 | 0 | You also want to pass --enable-shared to configure since it is an additional installation of Python. | 2 | 3 | 0 | I want to build Python 2.7.1 additionally to the one the redhat server already has pre-installed.
What options do I need to modify/use so that Python can be built under i.e. /opt/Python27
I would appreciate any help! | How to install Python using source files to a custom directory | 0.099668 | 0 | 0 | 2,364 |
4,319,040 | 2010-11-30T21:49:00.000 | 4 | 0 | 1 | 0 | python,notifications,pynotify | 4,328,158 | 1 | true | 0 | 0 | (Per discussion:)
Setting the append hint on your notifications (set_hint_string('append', '')) tells the notification daemon that it should merge notifications from your app when they have the same titles. | 1 | 2 | 0 | How can I tell a pynotify.Notification object to merge with another that has the same title? | How to merge notifications with a common title in pynotify? | 1.2 | 0 | 0 | 292 |
4,319,392 | 2010-11-30T22:31:00.000 | 0 | 0 | 1 | 0 | python | 4,319,422 | 6 | false | 0 | 0 | The function ord('a') will return the numeric value of 'a' in the current text encoding. You could probably take that and do some simple math to convert to a 1, 2, 3 type mapping. | 1 | 1 | 0 | I need to find the number of an alphabet in the range of alphabets ie a = 1, b=2 , c =3....
So if i get a then the returning value should be 1
Is there a shorter method provided in python(inbuilt) to find it other than declaring a dictionary of 26 alphabets with their respected values.
Please help if you know of such ... | Python code for calculating number of an alphabet | 0 | 0 | 0 | 5,642 |
4,320,135 | 2010-12-01T00:25:00.000 | 2 | 0 | 0 | 0 | python,soap,wsdl,jira | 4,350,861 | 1 | true | 1 | 0 | Yes, there's an existing bug on this I've seen. Use the JIRA issue id instead of the key to locate it, as a workaround. | 1 | 3 | 0 | I am trying to do WSDL SOAP connection to our JIRA server using SOAPpy (Python SOAP Library).
All seems to be fine except when I try finding specific issues. Through the web browser looking up the bug ID actually redirects to a bug (with a different ID), however it is the bug in question just moved to a different proje... | Python JIRA SOAPpy annoying redirect on findIssue | 1.2 | 0 | 1 | 281 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.