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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,264,076 | 2010-11-24T06:35:00.000 | 2 | 0 | 0 | 0 | 0 | javascript,python,parsing,url,dynamically-generated | 0 | 4,264,239 | 0 | 2 | 0 | true | 1 | 0 | I've done this by doing a POST of document.body.innerHTML, after the page is loaded, to a CGI script in Python.
For the parsing, BeautifulSoup is a good choice. | 2 | 2 | 0 | 0 | I have some url to parse, and they used some javascript to create it dynamicly. So if i want to parse the result generated page with python... how can i do that ?
Firefox do that well with web developer... so i think it possible ... but i don't know where to start...
Thx for help
lo | How to see generated source from an URL page with python script and not anly source? | 0 | 1.2 | 1 | 0 | 1 | 212 |
4,268,374 | 2010-11-24T15:19:00.000 | 2 | 1 | 0 | 1 | 0 | python | 0 | 4,268,840 | 0 | 1 | 0 | true | 0 | 0 | Cron job. It's more likely to be "in line" with actual time, since it's a more stable and time-tested choice. It's also less demanding on resources than using a loop in Python since it doesn't require a constant Python interpreter process, and is probably better optimized than pyGTK (choice is mature, stable software v... | 1 | 2 | 0 | 0 | Well, I have created a python script, which checks the number of uncompleted tasks of tasque and displays it using pynotify periodically. My question is how do I implement this timer. I can think of two things. A Cron job to execute a python script periodically or using a python script which uses a gtk loop to call the... | Gtk loop or Cron for timer | 0 | 1.2 | 1 | 0 | 0 | 383 |
4,299,432 | 2010-11-28T22:15:00.000 | 2 | 0 | 0 | 0 | 0 | python,tkinter | 0 | 64,151,502 | 0 | 6 | 0 | false | 0 | 1 | My solution is root.focus() it will remove widget focus. | 2 | 11 | 0 | 0 | I'd like to remove focus from a widget manually. | In Tkinter how do i remove focus from a widget? | 0 | 0.066568 | 1 | 0 | 0 | 16,266 |
4,299,432 | 2010-11-28T22:15:00.000 | 5 | 0 | 0 | 0 | 0 | python,tkinter | 0 | 47,823,400 | 0 | 6 | 0 | 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 | 0 | I'd like to remove focus from a widget manually. | In Tkinter how do i remove focus from a widget? | 0 | 0.16514 | 1 | 0 | 0 | 16,266 |
4,303,851 | 2010-11-29T12:49:00.000 | 0 | 0 | 1 | 0 | 0 | c++,python,3d | 0 | 4,303,972 | 0 | 8 | 0 | 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 | 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 | 1 | 0 | 0 | 56,291 |
4,303,851 | 2010-11-29T12:49:00.000 | 2 | 0 | 1 | 0 | 0 | c++,python,3d | 0 | 4,303,913 | 0 | 8 | 0 | 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 | 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.049958 | 1 | 0 | 0 | 56,291 |
4,303,851 | 2010-11-29T12:49:00.000 | 2 | 0 | 1 | 0 | 0 | c++,python,3d | 0 | 4,304,000 | 0 | 8 | 0 | 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 | 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.049958 | 1 | 0 | 0 | 56,291 |
4,303,897 | 2010-11-29T12:54:00.000 | 3 | 0 | 0 | 0 | 0 | python,django | 0 | 4,303,960 | 0 | 2 | 0 | 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 | 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 | 0.291313 | 1 | 0 | 0 | 7,107 |
4,322,559 | 2010-12-01T08:45:00.000 | 29 | 0 | 0 | 0 | 0 | python,r,hadoop,bigdata | 0 | 4,323,638 | 0 | 2 | 0 | true | 0 | 0 | Using the Python Disco project for example.
Good. Play with that.
Using the RHIPE package and finding toy datasets and problem areas.
Fine. Play with that, too.
Don't sweat finding "big" datasets. Even small datasets present very interesting problems. Indeed, any dataset is a starting-off point.
I once built a s... | 1 | 41 | 1 | 0 | I've been a long time user of R and have recently started working with Python. Using conventional RDBMS systems for data warehousing, and R/Python for number-crunching, I feel the need now to get my hands dirty with Big Data Analysis.
I'd like to know how to get started with Big Data crunching.
- How to start simple wi... | How to get started with Big Data Analysis | 0 | 1.2 | 1 | 0 | 0 | 18,227 |
4,325,194 | 2010-12-01T14:10:00.000 | 1 | 0 | 1 | 0 | 0 | python,regex,mongodb,datetime,database | 0 | 4,325,260 | 0 | 4 | 0 | false | 0 | 0 | I agree with the other poster. Though this doesn't solve your immediate problem, if you have any control over the database, you should seriously consider creating a time/column, with either a DATE or TIMESTAMP datatype. That would make your system much more robust, & completely avoid the problem of trying to parse date... | 1 | 3 | 0 | 1 | I have a database full of data, including a date and time string, e.g. Tue, 21 Sep 2010 14:16:17 +0000
What I would like to be able to do is extract various documents (records) from the database based on the time contained within the date string, Tue, 21 Sep 2010 14:16:17 +0000.
From the above date string, how would I ... | Extracting Date and Time info from a string. | 0 | 0.049958 | 1 | 1 | 0 | 563 |
4,329,330 | 2010-12-01T21:28:00.000 | 2 | 0 | 1 | 1 | 0 | python,windows,installation | 0 | 4,329,365 | 0 | 1 | 0 | false | 0 | 0 | My first question would be, do you have administration rights when you try to run setup.py? | 1 | 0 | 0 | 0 | I would like to install a python package to windows. I have tried to run setup.py install on command prompt but it returned an error:
could not create 'C:\Program Files\Python...': access is denied.
Please, help.
Špela | how to install a python package to windows? | 0 | 0.379949 | 1 | 0 | 0 | 240 |
4,330,580 | 2010-12-02T00:31:00.000 | 2 | 0 | 1 | 0 | 0 | python,unicode | 0 | 4,330,599 | 0 | 3 | 0 | false | 0 | 0 | The key to understanding unicode in python is that unicode means UNICODE. A unicode object is an idealized representation to the characters, not actual bytes. | 2 | 1 | 0 | 0 | I'm trying to figure out how to use the unicode support in python;
I would like to convert this string to unicode :
"ABCDE"
-->
"\x00A\x00B\x00C\x00D\x00E"
Any built-in functionnality can do that, or shall i use join() ?
Thanks ! | python unicode support | 0 | 0.132549 | 1 | 0 | 0 | 759 |
4,330,580 | 2010-12-02T00:31:00.000 | 0 | 0 | 1 | 0 | 0 | python,unicode | 0 | 9,630,913 | 0 | 3 | 0 | false | 0 | 0 | the str object should be firstly converted to unicode object by decode method.
then convert the unicode object to str object using encode method with character-encoding you want. | 2 | 1 | 0 | 0 | I'm trying to figure out how to use the unicode support in python;
I would like to convert this string to unicode :
"ABCDE"
-->
"\x00A\x00B\x00C\x00D\x00E"
Any built-in functionnality can do that, or shall i use join() ?
Thanks ! | python unicode support | 0 | 0 | 1 | 0 | 0 | 759 |
4,332,293 | 2010-12-02T06:26:00.000 | 0 | 1 | 0 | 1 | 1 | python,windows,apache,cgi,mime | 0 | 5,335,384 | 0 | 2 | 0 | true | 1 | 0 | Now I know how to solve this problem:
For windows+IIS:
While adding the application mapping(IIS), write C:\Python20\python.exe -u %s %s. I used to write like this c:\Python26\python.exe %s %s, that will create wrong mime data. And "-u" means unbuffered binary stdout and stderr.
For windows+Apache:
Add #!E:/program f... | 1 | 0 | 0 | 0 | I met a problem while using python(2.6) cgi to show a mime data in windows(apache).
For example, to show a image, here is my code:
image.py
#!E:/program files/Python26/python.exe
# -*- coding: UTF-8 -*-
data = open('logo.png','rb').read()
print 'Content-Type:image/png;Content-Disposition:attachment;filename=logo.png\n... | how to show mime data using python cgi in windows+apache | 0 | 1.2 | 1 | 0 | 0 | 381 |
4,333,711 | 2010-12-02T10:05:00.000 | 2 | 0 | 0 | 0 | 0 | python,registration | 0 | 4,333,979 | 0 | 2 | 0 | true | 1 | 0 | I've found it useful to put a verification code in the database and use it as you've suggested. The same field can do double duty for e.g. password reset requests.
I also use an expiry timeout field, where registrations or password resets need to be dealt with by the user in a timely fashion. | 1 | 1 | 0 | 0 | I am going to let new users register on my service. Here is the way I think it should go:
1. User enters his email in a field and clicks Register button.
2. User receives a confirmation email with a link containing a verification code.
3. User goes by that link from the email message where he sees a message that his ac... | What is the best practice for registering a new user in my case? | 0 | 1.2 | 1 | 0 | 0 | 150 |
4,337,736 | 2010-12-02T17:11:00.000 | 0 | 0 | 1 | 0 | 0 | python,data-structures,types | 0 | 4,338,035 | 0 | 4 | 0 | false | 0 | 0 | Include an example somewhere in your code, or in your tests. | 2 | 3 | 0 | 0 | I am quite new to python programming (C/C++ background).
I'm writing code where I need to use complex data structures like dictionaries of dictionaries of lists.
The issue is that when I must use these objects I barely remember their structure and so how to access them.
This makes it difficult to resume working on code... | Declaring types for complex data structures in python | 1 | 0 | 1 | 0 | 0 | 716 |
4,337,736 | 2010-12-02T17:11:00.000 | 1 | 0 | 1 | 0 | 0 | python,data-structures,types | 0 | 4,337,932 | 0 | 4 | 0 | false | 0 | 0 | I believe you should take a good look some of your complex structures, what you are doing with them, and ask... Is This Pythonic? Ask here on SO. I think you will find some cases where the complexity is an artifact of C/C++. | 2 | 3 | 0 | 0 | I am quite new to python programming (C/C++ background).
I'm writing code where I need to use complex data structures like dictionaries of dictionaries of lists.
The issue is that when I must use these objects I barely remember their structure and so how to access them.
This makes it difficult to resume working on code... | Declaring types for complex data structures in python | 1 | 0.049958 | 1 | 0 | 0 | 716 |
4,339,745 | 2010-12-02T20:53:00.000 | 2 | 0 | 1 | 0 | 1 | python,scapy | 0 | 4,339,911 | 0 | 1 | 0 | true | 0 | 0 | got it , from the version v.2 onward the it should be used as from scapy.all import * | 1 | 1 | 0 | 0 | i am trying to use scapy in python
while i try to import the scapy import scapy
its just fine but the line scapy.ARP() causes a
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'ARP'
a dir(scapy) produces
'['__builtins__', '__doc__', '__file__', '__name__... | ARP missing from the module scapy | 0 | 1.2 | 1 | 0 | 0 | 1,937 |
4,345,337 | 2010-12-03T12:04:00.000 | 3 | 0 | 0 | 0 | 0 | python,python-imaging-library,imaging | 0 | 4,345,485 | 0 | 1 | 0 | true | 0 | 0 | You might want to look into converting your image to a numpy array, performing your quantisation, then converting back to PIL.
There are modules in numpy to convert to/from PIL images. | 1 | 4 | 1 | 0 | I would like to quantize a 24bit image to 16bit color depth using Python Imaging.
PIL used to provide a method im.quantize(colors, **options) however this has been deprecated for out = im.convert("P", palette=Image.ADAPTIVE, colors=256)
Unfortunately 256 is the MAXIMUM number of colors that im.convert() will quantize t... | Python Imaging, how to quantize an image to 16bit depth? | 0 | 1.2 | 1 | 0 | 0 | 4,447 |
4,348,061 | 2010-12-03T17:15:00.000 | 21 | 0 | 1 | 0 | 0 | python,json,urllib2 | 0 | 7,469,725 | 0 | 4 | 0 | false | 0 | 0 | For Python 3.x
Note the following
In Python 3.x the urllib and urllib2 modules have been combined. The module is named urllib. So, remember that urllib in Python 2.x and urllib in Python 3.x are DIFFERENT modules.
The POST data for urllib.request.Request in Python 3 does NOT accept a string (str) -- you have to pass a... | 1 | 16 | 0 | 0 | I want to use python urllib2 to simulate a login action, I use Fiddler to catch the packets and got that the login action is just an ajax request and the username and password is sent as json data, but I have no idea how to use urllib2 to send json data, help... | How to use python urllib2 to send json data for login | 0 | 1 | 1 | 0 | 1 | 32,746 |
4,348,658 | 2010-12-03T18:30:00.000 | 0 | 0 | 0 | 0 | 0 | python,sqlite | 0 | 4,348,768 | 0 | 3 | 0 | false | 0 | 0 | Just execute sqlite3 foo.db? This will permanently store everything you do afterwards in this file. (No need for .backup.) | 1 | 0 | 0 | 0 | I just downloaded sqlite3.exe. It opens up as a command prompt. I created a table test & inserted a few entries in it. I used .backup test just in case. After I exit the program using .exit and reopened it I don't find the table listed under .tables nor can I run any query on it.
I need to quickly run an open source py... | How to create tables in sqlite 3? | 0 | 0 | 1 | 1 | 0 | 2,598 |
4,349,714 | 2010-12-03T20:46:00.000 | 0 | 0 | 1 | 0 | 0 | python,class | 0 | 4,349,752 | 0 | 5 | 0 | false | 0 | 0 | You can organize it in whatever way makes the most sense for your application. I don't exactly know what you're doing so I can't be certain what the best organization would be for you, but you can pretty much split it up as you see fit and just import what you need.
You can define classes in any file, and you can defin... | 1 | 1 | 0 | 0 | I am doing some heavy commandline stuff (not really web based) and am new to Python, so I was wondering how to set up my files/folders/etc. Are there "header" files where I can keep all the DB connection stuff?
How/where do I define classes and objects? | How is a Python project set up? | 0 | 0 | 1 | 0 | 0 | 1,866 |
4,353,019 | 2010-12-04T10:08:00.000 | 1 | 0 | 1 | 0 | 0 | python,image,compression,python-imaging-library | 0 | 4,353,063 | 0 | 4 | 0 | false | 0 | 0 | a) change the size: Image.resize(size, filter) b) explicitly convert it to JPEG (if it is not) and set the desired quality. c) use a combination of a) and b)
Whatever you do, there is a trade-off between size and quality. | 1 | 8 | 0 | 0 | I want to degrade the quality of the image to a few kilobytes.
What's the best way to do this?
Thanks! | In Python's PIL, how do I change the quality of an image? | 0 | 0.049958 | 1 | 0 | 0 | 11,769 |
4,356,234 | 2010-12-04T22:43:00.000 | 1 | 0 | 0 | 1 | 0 | python,django,user-interface,login | 0 | 4,361,550 | 0 | 2 | 0 | false | 1 | 0 | Django auth also provide generic views for login/logout etc. You can use build-in templates or expand it.
See in documentation for generic views: django.contrib.auth.views.login, django.contrib.auth.views.logout | 1 | 0 | 0 | 0 | i love gae(google app engine),because it is easy to create a user interface for user login and signup,
but now , my boss want me to create a site use django ,
so the first is to create a site that someone can be login ,
which is the esaist way to create a user interface ?
thanks | how to create a user interface that a user can signup and login using django | 0 | 0.099668 | 1 | 0 | 0 | 888 |
4,362,902 | 2010-12-06T03:20:00.000 | 2 | 0 | 1 | 0 | 1 | python,django,django-templates | 0 | 4,366,241 | 0 | 4 | 0 | false | 1 | 0 | Don't forget that you aren't limited to Django's template language. You're free to use whatever templating system you like in your view functions. However you want to create the HTML to return from your view function is fine. There are many templating implementations in the Python world: choose one that suits you be... | 3 | 9 | 0 | 0 | I mean I understand that these templates are aimed at designers and other less code-savvy people, but for developers I feel the template language is just a hassle. I need to re-learn how to do very simple things like iterate through dictionaries or lists that I pass into the template, and it doesn't even seem to work v... | Why don't django templates just use python code? | 1 | 0.099668 | 1 | 0 | 0 | 594 |
4,362,902 | 2010-12-06T03:20:00.000 | 1 | 0 | 1 | 0 | 1 | python,django,django-templates | 0 | 50,607,955 | 0 | 4 | 0 | false | 1 | 0 | Django templates don’t just use Python code for the same reason Django uses the MVC paradigm:
No particular reason.
(ie: The same reason anyone utilizes MVC at all, and that reason is just that certain people prefer this rigid philosophical pattern.)
In general I’d suggest you avoid Django if you don’t like thi... | 3 | 9 | 0 | 0 | I mean I understand that these templates are aimed at designers and other less code-savvy people, but for developers I feel the template language is just a hassle. I need to re-learn how to do very simple things like iterate through dictionaries or lists that I pass into the template, and it doesn't even seem to work v... | Why don't django templates just use python code? | 1 | 0.049958 | 1 | 0 | 0 | 594 |
4,362,902 | 2010-12-06T03:20:00.000 | 1 | 0 | 1 | 0 | 1 | python,django,django-templates | 0 | 4,366,273 | 0 | 4 | 0 | false | 1 | 0 | Seperation of concerns.
Designer does design. Developer does development. Templates are written by the designers.
Design and development are independent and different areas of work typically handled by different people.
I guess having template code in python would work very well if one is a developer and their spouse i... | 3 | 9 | 0 | 0 | I mean I understand that these templates are aimed at designers and other less code-savvy people, but for developers I feel the template language is just a hassle. I need to re-learn how to do very simple things like iterate through dictionaries or lists that I pass into the template, and it doesn't even seem to work v... | Why don't django templates just use python code? | 1 | 0.049958 | 1 | 0 | 0 | 594 |
4,379,160 | 2010-12-07T16:42:00.000 | 2 | 0 | 1 | 0 | 0 | python,urllib2,connection,chunks | 0 | 4,379,274 | 0 | 2 | 0 | false | 0 | 0 | You need to write chunks it different temporary files and then join them in the original order. If you open one file for all the threads, you should make the access to it sequential to preserve to correct order of data, which discards thread usage since a thread should wait for the previous one. BTW, you should open fi... | 2 | 0 | 0 | 0 | so i am developing my own download manager for educational purpose. I have multiple connections/threads downloading a file, each connection works on a particular range of the file. Now after they have all fetched their chunks, i dont exact know how to i bring this chunks together to re-make the original file.
What i ... | Download Manager: How to re-construct chunks fetched by multiple connections | 0 | 0.197375 | 1 | 0 | 1 | 542 |
4,379,160 | 2010-12-07T16:42:00.000 | 1 | 0 | 1 | 0 | 0 | python,urllib2,connection,chunks | 0 | 4,379,227 | 0 | 2 | 0 | true | 0 | 0 | You were doing it just fine: seek() and write(). That should work!
Now, if you want a cleaner structure, without so many threads moving their hands all over a file, you might want to consider having downloader threads and a disk-writing thread. This last one may just sleep until woken by one of the others, write some k... | 2 | 0 | 0 | 0 | so i am developing my own download manager for educational purpose. I have multiple connections/threads downloading a file, each connection works on a particular range of the file. Now after they have all fetched their chunks, i dont exact know how to i bring this chunks together to re-make the original file.
What i ... | Download Manager: How to re-construct chunks fetched by multiple connections | 0 | 1.2 | 1 | 0 | 1 | 542 |
4,379,200 | 2010-12-07T16:46:00.000 | 0 | 0 | 0 | 1 | 0 | python,google-app-engine,task-queue | 0 | 4,379,300 | 0 | 2 | 0 | false | 1 | 0 | This won't work directly as you describe it.
Once a background task is started, it's a background task for its entire existence. If you want to return some information from the background task to the user, you'll have to add it to the datastore, and have a foreground handler check the datastore for that information.
Y... | 1 | 2 | 0 | 0 | Currently I have tasks running in background. After the tasks are done executing I need to show output. How do I do this in Google App Engine?
Once the tasks are done the only thing I can do is create another task which is supposed to show output or is there any other way? | how to bring a background task to foreground in google app engine? | 1 | 0 | 1 | 0 | 0 | 282 |
4,383,614 | 2010-12-08T02:15:00.000 | 0 | 0 | 0 | 0 | 0 | python,gtk,drawing,pygtk | 0 | 4,383,675 | 0 | 2 | 0 | false | 0 | 1 | I found a solution that uses the queue_draw() method (callable from the Gtk.DrawingArea but seems like a method every gtk widget must have), but there are probably alternatives since this one implies it might get delayed, even though in my tests it didn't happen. | 1 | 2 | 0 | 0 | Currently I'm drawing some things in a subclass of DrawingArea, where I get a cairo context inside an expose-event and call a draw method from there. (according to some PyGTK tutorial I found)
I'm used to doing a repaint() with java, but how can I get the same effect here? | (Py)GTK: How can I force my window to be repainted / call expose-event? | 0 | 0 | 1 | 0 | 0 | 3,673 |
4,402,536 | 2010-12-09T19:58:00.000 | 4 | 0 | 1 | 0 | 0 | python,debugging,vim | 0 | 4,402,775 | 0 | 5 | 0 | false | 0 | 0 | In case of my own projects, the source code is always in version control. Before committing, I always check the graphical diff so that I can see what has changed, what the commit message should be and whether I can split up into smaller commits. That way, I almost always recognize temporary garbage like print statement... | 3 | 4 | 0 | 0 | Sometimes when developing using open source software, you need to read it's source code (specially zope/plone). A lot of times I need to write print statements, or debug calls (import pdb), or comment try/except clauses, you name it.
Sometimes I have a lot of files opened when trying to find an issue, and sometimes I f... | How do you avoid leaving debugger print/pdb statements in python open source apps when you're debugging them and just finish? | 0 | 0.158649 | 1 | 0 | 0 | 991 |
4,402,536 | 2010-12-09T19:58:00.000 | 2 | 0 | 1 | 0 | 0 | python,debugging,vim | 0 | 4,402,792 | 0 | 5 | 0 | false | 0 | 0 | Well +1 for starting this discussion. Yes sometime this happen to me. I left those pdb and commit the code to the central code base, git. I use 'emacs'. So, Before commit the code I usually search for pdb in the file. But it is hectic checking each file.So, Before committing the code I usually check the diff very caref... | 3 | 4 | 0 | 0 | Sometimes when developing using open source software, you need to read it's source code (specially zope/plone). A lot of times I need to write print statements, or debug calls (import pdb), or comment try/except clauses, you name it.
Sometimes I have a lot of files opened when trying to find an issue, and sometimes I f... | How do you avoid leaving debugger print/pdb statements in python open source apps when you're debugging them and just finish? | 0 | 0.07983 | 1 | 0 | 0 | 991 |
4,402,536 | 2010-12-09T19:58:00.000 | 1 | 0 | 1 | 0 | 0 | python,debugging,vim | 0 | 4,402,892 | 0 | 5 | 0 | false | 0 | 0 | I also develop Python with Vim. I have never had to substantially modify the source code for debugging. I do sometimes put debugging print statements, and I have the habit of putting "# XXX" after every one. Then when I want to remove them (before a commit), and just search for the XXX and delete those lines.
For exce... | 3 | 4 | 0 | 0 | Sometimes when developing using open source software, you need to read it's source code (specially zope/plone). A lot of times I need to write print statements, or debug calls (import pdb), or comment try/except clauses, you name it.
Sometimes I have a lot of files opened when trying to find an issue, and sometimes I f... | How do you avoid leaving debugger print/pdb statements in python open source apps when you're debugging them and just finish? | 0 | 0.039979 | 1 | 0 | 0 | 991 |
4,414,611 | 2010-12-11T01:07:00.000 | 1 | 0 | 0 | 0 | 1 | python,blocking,websocket,httpserver | 0 | 15,036,544 | 0 | 1 | 0 | false | 0 | 0 | WebSockets aren't HTTP, so you can't really handle them with an HTTP request handler.
However, using BaseHTTPRequestHandler with HTTP, you would normally be reading only the exact amount of data you expect (for instance, as specified in the Content-length header.) | 1 | 0 | 0 | 0 | I'm using Python's BaseHTTPRequestHandler class to build a web server. I want to add an endpoint for WebSockets. This means that I need to read whatever is available from the handler's rfile, so that I can process messages one by one, as I'm receiving them (instead of having to read the while input).
I tried using di... | Python, BaseHTTPRequestHandler: how to read what's available on file from socket? | 1 | 0.197375 | 1 | 0 | 1 | 1,273 |
4,416,642 | 2010-12-11T12:17:00.000 | -1 | 0 | 1 | 0 | 0 | python,shell | 0 | 67,948,618 | 0 | 5 | 0 | false | 0 | 0 | You can,,go to options then configure IDE, then on the settings window select highlights, on the rightside press the button below a builtin theme, then choose your choice theme | 3 | 4 | 0 | 0 | Is it possible to change background color of the Python Shell from white to black for example. I did find how to change text color, but can't figure out how to change background color. I'm running it under the Windows. Any suggestions? | Change background color of python shell | 1 | -0.039979 | 1 | 0 | 0 | 86,168 |
4,416,642 | 2010-12-11T12:17:00.000 | 2 | 0 | 1 | 0 | 0 | python,shell | 0 | 4,417,082 | 0 | 5 | 0 | false | 0 | 0 | If you are reffering to the window idle for example for version 2.6 there is now way to change the background color from withe to another one. But you can change the background color of your text if you go to options.
Another thing you can do is to use other gui for python which could be more elaborated such as eclipse... | 3 | 4 | 0 | 0 | Is it possible to change background color of the Python Shell from white to black for example. I did find how to change text color, but can't figure out how to change background color. I'm running it under the Windows. Any suggestions? | Change background color of python shell | 1 | 0.07983 | 1 | 0 | 0 | 86,168 |
4,416,642 | 2010-12-11T12:17:00.000 | 2 | 0 | 1 | 0 | 0 | python,shell | 0 | 17,314,925 | 0 | 5 | 0 | false | 0 | 0 | just go through simple steps
- go to options
- configure IDLE
- highlighting
- then select background and click on choose color for:
- you can change the color to any color but becareful if u change only the background color the foreground color may not be visible because they both might be black
Enjoy | 3 | 4 | 0 | 0 | Is it possible to change background color of the Python Shell from white to black for example. I did find how to change text color, but can't figure out how to change background color. I'm running it under the Windows. Any suggestions? | Change background color of python shell | 1 | 0.07983 | 1 | 0 | 0 | 86,168 |
4,418,252 | 2010-12-11T18:30:00.000 | 1 | 0 | 0 | 1 | 0 | python,syntax,batch-file,equivalent | 0 | 4,418,349 | 0 | 5 | 0 | false | 0 | 0 | Python is not a system shell, Python is a multi-paradigm programming language.
If you want to compare .bat with anything, compare it with sh or bash. (You can have those on various platforms too - for example, sh for windows is in the MinGW package). | 2 | 1 | 0 | 0 | Ok i have these commands used in batch and i wanted to know the commands in python that would have a similar affect, just to be clear i dont want to just use os.system("command here") for each of them. For example in batch if you wanted a list of commands you would type help but in python you would type help() and then... | comparing batch to python commands? | 0 | 0.039979 | 1 | 0 | 0 | 2,645 |
4,418,252 | 2010-12-11T18:30:00.000 | 0 | 0 | 0 | 1 | 0 | python,syntax,batch-file,equivalent | 0 | 17,412,938 | 0 | 5 | 0 | false | 0 | 0 | I am pretty much facing the same problem as you, daniel11. As a solution, I am learning BATCH commands and their meaning. After I understand those, I am going to write a program in Python that does the same or accomplishes the same task.
Thanks to Adam V. and katrielatex for their insight and suggestions. | 2 | 1 | 0 | 0 | Ok i have these commands used in batch and i wanted to know the commands in python that would have a similar affect, just to be clear i dont want to just use os.system("command here") for each of them. For example in batch if you wanted a list of commands you would type help but in python you would type help() and then... | comparing batch to python commands? | 0 | 0 | 1 | 0 | 0 | 2,645 |
4,418,461 | 2010-12-11T19:17:00.000 | 2 | 0 | 0 | 0 | 0 | python,django,database-design | 0 | 4,418,851 | 0 | 2 | 0 | true | 1 | 0 | Editors often solve this problem with a Piece Table. The table is a list of objects that point to spans of characters that are a) contiguous in memory, and b) share common attributes. The order of the pieces in the table is used for mapping character-in-document addresses to memory and vice versa. By reordering the pie... | 1 | 1 | 0 | 0 | I'm having trouble figuring out how to best implement a document (paragraph-) revision system in Django.
I want to save a revision history of a document, paragraph-by-paragraph. In other words, there will be a class Document, which has a ManyToManyField to Paragraph. To maintain the order of the paragraphs, a third cla... | How to maintain order of paragraphs in a Django document revision system? | 1 | 1.2 | 1 | 0 | 0 | 304 |
4,418,839 | 2010-12-11T20:40:00.000 | 1 | 0 | 0 | 0 | 0 | python,wing-ide | 0 | 4,431,943 | 0 | 1 | 0 | true | 0 | 1 | I've contacted Wingware support and they have confirmed that there is no way to set the brace matching colour. | 1 | 3 | 0 | 0 | Has anyone figured out a way to change the brace matching colours in WingIDE? I have managed to manually port my favourite colour scheme across from my text editor and the default green just doesn't do it for me. I've been unable to find instructions on how to do this in the UI, user manual and mailing lists. | WingIDE brace matching colours | 0 | 1.2 | 1 | 0 | 0 | 135 |
4,422,948 | 2010-12-12T17:35:00.000 | -1 | 0 | 1 | 0 | 0 | python,irc | 0 | 4,422,957 | 0 | 5 | 0 | false | 0 | 0 | if "Greg" in greet:
doSomething("Hi Greg")
the key is that strings take the in operator | 1 | 2 | 0 | 0 | I was wondering how to go about finding a string you don't know what is, in a string. I am writing an IRC bot and i need this function. I want to be able to write:
!greet Greg
and then my bot is supposed to say "Hi, Greg!". So what comes after greet is variable. And if i wrote !greet Matthew it would say "Hi, Matthew!"... | How to find x in a string in Python | 0 | -0.039979 | 1 | 0 | 1 | 361 |
4,430,227 | 2010-12-13T15:10:00.000 | 0 | 1 | 0 | 1 | 0 | python,winapi,api,performancecounter | 0 | 4,430,461 | 0 | 2 | 0 | false | 0 | 0 | You could just call the C# StopWatch class directly from Python couldn't you? Maybe a small wrapper is needed (don't know Python/C# interop details - sorry) - if you are already using C# for data acquisition, doing the same for timings via Stopwatch should be simpler than anything else you can do. | 1 | 4 | 0 | 0 | I have a python script that calls a USB-based data-acquisition C# dotnet executable. The main python script does many other things, e.g. it controls a stepper motor. We would like to check the relative timing of various operations, for that purpose the dotnet exe generates a log with timestamps from C# Stopwatch.GetTi... | python on win32: how to get absolute timing / CPU cycle-count | 0 | 0 | 1 | 0 | 0 | 1,794 |
4,430,408 | 2010-12-13T15:26:00.000 | 1 | 1 | 0 | 1 | 0 | python,linux,ubuntu,ssh | 0 | 4,430,456 | 0 | 2 | 0 | false | 0 | 0 | A very quick alternative is to pipe the output of your python program to a file, and then simply using tail with the second user to see the output as it's being written to the file. However, with a program like you have there, the file will very quickly become massive. | 1 | 2 | 0 | 0 | I have a script, called test.py, that does the following:
while (1):
....print "hello world"
(this script simply prints 'hello world' continuously).
Now, I am using two machines (machine A and machine B). Same user is used for both machines. I would like to do the following:
(1) [working with machine A] run test.p... | View Script Output Over SSH? | 0 | 0.099668 | 1 | 0 | 0 | 1,034 |
4,441,933 | 2010-12-14T17:06:00.000 | 0 | 1 | 0 | 0 | 0 | php,python,design-patterns,cron,screen-scraping | 0 | 4,441,983 | 0 | 3 | 0 | false | 1 | 0 | Do you need to run the script 50 times per user, or only when the user has logged into your service to check on things? | 2 | 0 | 0 | 0 | On the front-end, I have a PHP webapp that allows users to create a list of their websites (5 max).
On the back-end, a Python script runs daily (and has ~10 iterations) for each website that the user registers. Each script per website takes about 10 seconds to run through all iterations and finish its scraping. It then... | Best practice for running a daily Python screen-scraping script 50 times (8.3 minutes total) per user? | 0 | 0 | 1 | 0 | 0 | 772 |
4,441,933 | 2010-12-14T17:06:00.000 | 0 | 1 | 0 | 0 | 0 | php,python,design-patterns,cron,screen-scraping | 0 | 4,441,994 | 0 | 3 | 0 | false | 1 | 0 | Assuming you're using a database to store the users' web sites, you can have just 1 script that runs as a daily cron job and queries the database for the list of sites to process. | 2 | 0 | 0 | 0 | On the front-end, I have a PHP webapp that allows users to create a list of their websites (5 max).
On the back-end, a Python script runs daily (and has ~10 iterations) for each website that the user registers. Each script per website takes about 10 seconds to run through all iterations and finish its scraping. It then... | Best practice for running a daily Python screen-scraping script 50 times (8.3 minutes total) per user? | 0 | 0 | 1 | 0 | 0 | 772 |
4,451,166 | 2010-12-15T14:50:00.000 | 1 | 0 | 0 | 0 | 0 | python,windows,wxpython | 0 | 4,465,221 | 0 | 3 | 0 | false | 0 | 1 | The simple answer is that the wx.ListBox doesn't support that. Try using a one column wx.ListCtrl (in Report mode) instead. | 2 | 2 | 0 | 0 | I'm using a wxPython listbox on Windows to get a choice from the user, and I would like them to be able to select an item using the ENTER key, as if they had double-clicked. I know how to do this in C or C++ using the Windows API directly, but can't seem to find how to do it using wxPython. Anyone know how? It seems li... | Keyboard interface to wxPython listbox | 0 | 0.066568 | 1 | 0 | 0 | 721 |
4,451,166 | 2010-12-15T14:50:00.000 | 1 | 0 | 0 | 0 | 0 | python,windows,wxpython | 0 | 4,451,586 | 0 | 3 | 0 | false | 0 | 1 | Maybe I'm missing some nuance, there wasn't much info to go on, but it sounds like you could accomplish this by catching the keydown event, matching for enter and then calling your on_doubleclick function. Unless there's an implicit double-click handling you should be good to go. | 2 | 2 | 0 | 0 | I'm using a wxPython listbox on Windows to get a choice from the user, and I would like them to be able to select an item using the ENTER key, as if they had double-clicked. I know how to do this in C or C++ using the Windows API directly, but can't seem to find how to do it using wxPython. Anyone know how? It seems li... | Keyboard interface to wxPython listbox | 0 | 0.066568 | 1 | 0 | 0 | 721 |
4,456,591 | 2010-12-16T01:14:00.000 | 0 | 0 | 0 | 0 | 0 | python,django,django-forms,media | 0 | 4,462,233 | 0 | 2 | 0 | false | 1 | 0 | What happens if you just use {{ form.media }} for each form, and link up the media in the form's Meta? I seem to remember that making sure that it didn't insert anything twice, but it's been a while.
Have you tried that yet? | 1 | 2 | 0 | 0 | I send several forms to a template, and I want to put all required media in the <head> tag. Some forms might require the same media (for instance, the same JS file), so I would like to unify all medias before putting them in the <head>. Question is, how do I do that? I know you can unify two medias by doing m1 + m2, bu... | Django: correct way to group a bunch of media's | 0 | 0 | 1 | 0 | 0 | 135 |
4,458,701 | 2010-12-16T08:24:00.000 | 8 | 0 | 1 | 0 | 0 | python,memory,python-idle | 0 | 62,961,863 | 0 | 4 | 0 | false | 0 | 0 | How about dir() which will output instantiated objects as a list? I just used this just now:
[x for x in dir() if x.lower().startswith('y')] | 1 | 53 | 0 | 0 | Say that in the python shell (IDLE) I have defined some classes, functions, variables. Also created objects of the classes. Then I deleted some of the objects and created some others. At a later point in time, how can I get to know what are the currently active objects, variables, and methods definitions active in the ... | How to get the list of all initialized objects and function definitions alive in python? | 0 | 1 | 1 | 0 | 0 | 51,812 |
4,462,119 | 2010-12-16T15:00:00.000 | 2 | 0 | 1 | 0 | 1 | python,hash,lookup,lookup-tables | 0 | 4,462,498 | 0 | 4 | 0 | false | 0 | 0 | A simple solution seems to be to do lookup[id(myobj)] = myotherobj instead of lookup[myobj] = myotherobj. Any commente on this approach? | 1 | 6 | 0 | 0 | I need to create a mapping from objects of my own custom class (derived from dict) to objects of another custom class. As I see it there are two ways of doing this:
I can make the objects hashable. I'm not sure how I would do this. I know I can implement __hash__() but I'm unsure how to actually calculate the hash (wh... | Lookup table for unhashable in Python | 1 | 0.099668 | 1 | 0 | 0 | 682 |
4,470,246 | 2010-12-17T12:02:00.000 | 2 | 0 | 0 | 0 | 0 | python,opencl | 0 | 4,478,655 | 0 | 1 | 0 | true | 0 | 1 | This awfully looks like you are using __constant memory. The solution is to use __global memory instead, but you have to be careful about how you access it for best performance.
__constant memory is a special address space for often used constant values, but is restricted in size on current GPUs. | 1 | 0 | 0 | 0 | I am currently in the process of discovering OpenCL via the Python binding Clyther. So
far I am messing with a very simple script to get the sin or cos of a buffer of 65536.
Apparently 65536 is the limit for buffers on my card but say I'd have 16 million numbers in my buffer how would I go about it without constantly ... | Processing buffers bigger than 65536 in Clyther/OpenCL | 0 | 1.2 | 1 | 0 | 0 | 156 |
4,476,430 | 2010-12-18T03:19:00.000 | 1 | 0 | 0 | 0 | 0 | python,django,validation,forms,ip | 0 | 4,477,440 | 0 | 3 | 0 | false | 1 | 0 | You can pass the request object to the form/model code that is being called: this will then provide access to request.META['REMOTE_ADDR']. Alternatively, just pass that in. | 2 | 0 | 0 | 0 | I know how to get it in views.py....
request.META['REMOTE_ADDR']
However, how do I get it in models.py when one of my forms is being validateD? | Inside Django's models.py, if I am validating a form, how do I get the user's IP? | 0 | 0.066568 | 1 | 0 | 0 | 179 |
4,476,430 | 2010-12-18T03:19:00.000 | 0 | 0 | 0 | 0 | 0 | python,django,validation,forms,ip | 0 | 4,476,456 | 0 | 3 | 0 | false | 1 | 0 | If you are validating at form level or at model level, both instances know nothing about the HTTP request (where the client IP info is stored).
I can think of two options:
Validate at the view level where you can insert errors into the form error list.
You can put the user IP (may be encrypted) in a hidden field at yo... | 2 | 0 | 0 | 0 | I know how to get it in views.py....
request.META['REMOTE_ADDR']
However, how do I get it in models.py when one of my forms is being validateD? | Inside Django's models.py, if I am validating a form, how do I get the user's IP? | 0 | 0 | 1 | 0 | 0 | 179 |
4,488,783 | 2010-12-20T10:32:00.000 | 0 | 0 | 0 | 0 | 0 | python,algorithm,social-networking,traversal,breadth-first-search | 0 | 6,335,027 | 0 | 2 | 0 | false | 0 | 0 | I have around 300 friends in facebook and some of my friends also have 300 friends on an average. If you gonna build a graph out of it , it's gonna be huge . Correct me , if I am wrong ? . A BFS will be quit lot demanding in this scenario ?
Thanks
J | 1 | 2 | 1 | 0 | I've been reading a lot of stackoverflow questions about how to use the breadth-first search, dfs, A*, etc, the question is what is the optimal usage and how to implement it in reality verse simulated graphs. E.g.
Consider you have a social graph of Twitter/Facebook/Some social networking site, to me it seems a search ... | Python usage of breadth-first search on social graph | 0 | 0 | 1 | 0 | 0 | 1,271 |
4,493,871 | 2010-12-20T20:55:00.000 | 0 | 0 | 1 | 0 | 0 | python,windows,setuptools,distribute | 0 | 4,498,345 | 0 | 2 | 0 | false | 0 | 0 | A punk/goth approach to programming probably has the right to be..
To get the C-compliation part to work on windows you either need (1) to have Visual Studio of the same version that was used to compile the python version you are using, or (2) mingw which is a bit trickier to set up. | 1 | 0 | 0 | 0 | I need to install in python 2.6 or 2.7 for windows the library PyWeka0.3dev, It says it requires setuptools, which I installed but then they told me it was a deprecated instalation library and I installed distribute, then I downloaded the PyWeka compressed package and each time I try to install it neither with setup.py... | Has anybody been able to install PyWeka? | 0 | 0 | 1 | 0 | 0 | 1,152 |
4,505,097 | 2010-12-22T00:01:00.000 | 2 | 0 | 0 | 0 | 0 | python,wxpython,wxwidgets | 0 | 4,510,733 | 0 | 4 | 0 | false | 0 | 1 | In addition to what these fellows are saying, you might also want to try EVT_ENTER_WINDOW and EVT_LEAVE_WINDOW. I think these are fired when you move the mouse into and out of the frame widget, although I don't think the frame has to be in focus for those events to fire.
@ Hugh - thanks for the readership! | 3 | 1 | 0 | 0 | With wxPython, how does one trigger an event whenever the whole window goes into/out of focus?
To elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the f... | wxPython Whole Window Focus Event | 0 | 0.099668 | 1 | 0 | 0 | 2,304 |
4,505,097 | 2010-12-22T00:01:00.000 | 2 | 0 | 0 | 0 | 0 | python,wxpython,wxwidgets | 0 | 4,505,382 | 0 | 4 | 0 | false | 0 | 1 | as WxPerl programmer i know there is
EVT_SET_FOCUS(
EVT_KILL_FOCUS(
if you initialize this event by listening to the frame as first parameter it should work as in Perl since the API is almost the same | 3 | 1 | 0 | 0 | With wxPython, how does one trigger an event whenever the whole window goes into/out of focus?
To elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the f... | wxPython Whole Window Focus Event | 0 | 0.099668 | 1 | 0 | 0 | 2,304 |
4,505,097 | 2010-12-22T00:01:00.000 | 5 | 0 | 0 | 0 | 0 | python,wxpython,wxwidgets | 0 | 4,521,758 | 0 | 4 | 0 | true | 0 | 1 | The correct answer for this case is to use an EVT_ACTIVATE handler bound to the frame. There will be an event whenever the frame is activated (brought into the foreground relative to other windows currently open) or deactivated. You can use the event object's GetActive method to tell which just happened. | 3 | 1 | 0 | 0 | With wxPython, how does one trigger an event whenever the whole window goes into/out of focus?
To elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the f... | wxPython Whole Window Focus Event | 0 | 1.2 | 1 | 0 | 0 | 2,304 |
4,506,008 | 2010-12-22T03:47:00.000 | 1 | 0 | 1 | 0 | 1 | python | 0 | 4,506,023 | 0 | 4 | 0 | true | 0 | 0 | The common Python platforms all support directory and file names of 32 characters or more, but I personally feel that if you find yourself breaking 11 characters often that you need to rethink things. | 4 | 4 | 0 | 0 | PEP 8 says that Python package and module names should be short, since some file systems will truncate long names. And I'm trying to follow Python conventions in a new project. But I really like long, descriptive names. So I'm wondering, how short do names need to be to comply with PEP 8. And does anyone really worry a... | How important is it to use short names for Python packages and modules? | 0 | 1.2 | 1 | 0 | 0 | 356 |
4,506,008 | 2010-12-22T03:47:00.000 | 0 | 0 | 1 | 0 | 1 | python | 0 | 4,509,044 | 0 | 4 | 0 | false | 0 | 0 | Long names make it easy to make stupid typing mistakes later on. Any modern computer shouldn't have a problem with long filenames, but it's good practice to pick short, descriptive names. Abbreviations are your friend, especially when you like knowing what a function does off the bat,etc. | 4 | 4 | 0 | 0 | PEP 8 says that Python package and module names should be short, since some file systems will truncate long names. And I'm trying to follow Python conventions in a new project. But I really like long, descriptive names. So I'm wondering, how short do names need to be to comply with PEP 8. And does anyone really worry a... | How important is it to use short names for Python packages and modules? | 0 | 0 | 1 | 0 | 0 | 356 |
4,506,008 | 2010-12-22T03:47:00.000 | 1 | 0 | 1 | 0 | 1 | python | 0 | 4,506,409 | 0 | 4 | 0 | false | 0 | 0 | The issue is with old(er) file systems (used before Windows 95 and fat16) that don't support names larger than, say, 32 characters (it varies with the file system). It's only an issue if your scripts need to run on old computers. | 4 | 4 | 0 | 0 | PEP 8 says that Python package and module names should be short, since some file systems will truncate long names. And I'm trying to follow Python conventions in a new project. But I really like long, descriptive names. So I'm wondering, how short do names need to be to comply with PEP 8. And does anyone really worry a... | How important is it to use short names for Python packages and modules? | 0 | 0.049958 | 1 | 0 | 0 | 356 |
4,506,008 | 2010-12-22T03:47:00.000 | 2 | 0 | 1 | 0 | 1 | python | 0 | 4,506,026 | 0 | 4 | 0 | false | 0 | 0 | If you need to make sure your code works on DOS, use 8 characters. :p
Otherwise, it's a free world. But nobody likes to type insanely long strings. (See powershell = fail). So use your best judgement, and be reasonable. | 4 | 4 | 0 | 0 | PEP 8 says that Python package and module names should be short, since some file systems will truncate long names. And I'm trying to follow Python conventions in a new project. But I really like long, descriptive names. So I'm wondering, how short do names need to be to comply with PEP 8. And does anyone really worry a... | How important is it to use short names for Python packages and modules? | 0 | 0.099668 | 1 | 0 | 0 | 356 |
4,512,329 | 2010-12-22T18:23:00.000 | 0 | 0 | 0 | 0 | 0 | python,django,geolocation,geoip | 0 | 9,200,451 | 0 | 2 | 0 | false | 1 | 0 | Have it such that whenever you add a city to your database, a piece of code is run (off-line) that calculates the closest city to every city that you have. You can have each city point to another city as its closest city with a foreignkey.
Now that you have everything pre-calculated, whenever there is a live request, w... | 1 | 4 | 0 | 0 | I have a website with a limited number of cities in the database, and need to show the user the nearest city to his current location.
I can get the location by MaxMind API, but I want to get the nearest city in my database to user city.
For example, if I have these cities in the database: Los Angeles, San Francisco and... | Best way to get user nearest city? Python/Django | 0 | 0 | 1 | 0 | 0 | 4,549 |
4,517,397 | 2010-12-23T09:26:00.000 | 1 | 0 | 0 | 1 | 1 | python,pylons | 0 | 4,517,414 | 0 | 2 | 0 | true | 0 | 0 | Don't use print statements, use the logging module. We can't help you without knowing the setup of the server. | 2 | 1 | 0 | 0 | I am running Pylons on my local machine with paster, and on a Debian server using WSGI. I want to add some print statements to debug a problem: am not a Pylons or Python expert.
On my local machine this works fine: print statements go to the terminal. On the server, the statements don't print to the log files: instead ... | Print statements on server give IOError: failed to write data | 0 | 1.2 | 1 | 0 | 0 | 1,041 |
4,517,397 | 2010-12-23T09:26:00.000 | 3 | 0 | 0 | 1 | 1 | python,pylons | 0 | 4,517,657 | 0 | 2 | 0 | false | 0 | 0 | It's wrong for a WSGI application to use sys.stdout or sys.stderr. If you want to spit debug to a server error log, use environ['wsgi.errors'].write(). | 2 | 1 | 0 | 0 | I am running Pylons on my local machine with paster, and on a Debian server using WSGI. I want to add some print statements to debug a problem: am not a Pylons or Python expert.
On my local machine this works fine: print statements go to the terminal. On the server, the statements don't print to the log files: instead ... | Print statements on server give IOError: failed to write data | 0 | 0.291313 | 1 | 0 | 0 | 1,041 |
4,522,026 | 2010-12-23T19:56:00.000 | 3 | 0 | 1 | 1 | 0 | python,file-io,line-endings | 0 | 4,522,035 | 0 | 2 | 0 | true | 0 | 0 | It's a non-issue, Python is smart like that. It handles line endings across platforms very well. | 1 | 2 | 0 | 0 | I am writing a small script that will need to read and write to text files on Windows and Linux and perhaps Mac even. The script will be used by users on all perhaps all of these platforms (Windows for sure) and interchangeably - so a user who wrote to a file X on Windows, may read the file on Linux with the script.
Wh... | Line endings and reading and writing to text files | 0 | 1.2 | 1 | 0 | 0 | 573 |
4,522,218 | 2010-12-23T20:24:00.000 | 12 | 0 | 0 | 0 | 0 | pygtk,python | 0 | 4,522,244 | 0 | 2 | 1 | true | 0 | 0 | Define functions or classes for your business logic in one module, and define your presentation in another, using those functions to get your presentation. You should almost entirely be using functions and classes from the main module in the GUI module. You should do the same thing for your CLI. That way, you can have ... | 1 | 14 | 0 | 0 | What would be the best way of separating program logic to the GUI code?
I wanted different GUI (GTK, KDE, CLI) code using the same program logic.
I was thinking of using different python module (winecellar-common, winecellar-gtk, winecellar-cli) not sure how I would do this and if its the best way.
*EDITED*
Just to add... | Python - Separate program logic and GUI code? | 0 | 1.2 | 1 | 0 | 0 | 4,986 |
4,525,562 | 2010-12-24T09:58:00.000 | 1 | 1 | 0 | 0 | 0 | python | 0 | 4,525,588 | 0 | 3 | 0 | false | 0 | 0 | You cant' upload python files and use it on any webhosting.
You can use them if the host allows it.
Some frameworks are Django or Pylons. | 2 | 0 | 0 | 0 | I'm PHP/MySQL developper
I studied python well as a desktop programming two years ago but I don't use it on the web how can I use python to build dynamic web sites and easily uploads these sites to any hosting providers | how can I use python to build dynamic web sites? | 0 | 0.066568 | 1 | 0 | 1 | 529 |
4,525,562 | 2010-12-24T09:58:00.000 | 1 | 1 | 0 | 0 | 0 | python | 0 | 4,525,568 | 0 | 3 | 0 | true | 0 | 0 | there are many web frameworks such as Django & web2py , you should check them out | 2 | 0 | 0 | 0 | I'm PHP/MySQL developper
I studied python well as a desktop programming two years ago but I don't use it on the web how can I use python to build dynamic web sites and easily uploads these sites to any hosting providers | how can I use python to build dynamic web sites? | 0 | 1.2 | 1 | 0 | 1 | 529 |
4,527,313 | 2010-12-24T16:28:00.000 | 1 | 1 | 1 | 0 | 0 | python,parsing,objdump | 0 | 7,283,510 | 0 | 2 | 0 | false | 0 | 0 | The BEST solution would be to build objdump from source and make a python or other language swig wrapper that gets the output directly. You CAN do it with string parsing, but that's often buggy(read as implemented poorly). It is definitely possible to do the string parsing properly...I have a utility that relies on t... | 1 | 3 | 0 | 0 | I was wondering if someone here had written/uses a script which parses the output of objdump and extracts opcodes from it? I have a very very trivial implementation but I'm looking for something better.
The problem I am facing with this script is simply that it does simple string parsing; this is more of a utility scri... | parsing objdump output | 0 | 0.099668 | 1 | 0 | 0 | 4,442 |
4,533,879 | 2010-12-26T12:52:00.000 | 3 | 0 | 0 | 0 | 0 | python | 0 | 4,534,157 | 0 | 2 | 0 | false | 0 | 0 | It is unreasonable to except that someone will post a complete solution for your problem.
Here are the steps, just start by trying to complete them, post questions if you get stuck.
very generally speaking:
Get the content of the site (use the urllib2 to fetch the page)
Parse the recaptcha image link and download the ... | 1 | 3 | 0 | 0 | I'm trying to write a simple program that logs on to a site, does something and logs out. The problem is that the login form has three inputs: username, password and a recaptcha. I input all of them manually. The problem is I don't know how to display the captcha image or how to send the text.
Can someone explain how t... | Handling reCaptcha forms? | 0 | 0.291313 | 1 | 0 | 1 | 799 |
4,535,895 | 2010-12-26T23:43:00.000 | 0 | 0 | 1 | 0 | 0 | python,version,global-variables | 0 | 4,535,921 | 0 | 3 | 1 | false | 0 | 1 | Personally, I wouldn't do it manually this way. I'd save my code in Subversion and let it maintain the revision numbers for me. | 1 | 5 | 0 | 0 | I have a PyQt application that reads and writes data files. I am including a 'version number' in each file written. This is a simple number similar to: 1.2 or something (major and minor versions).
I am doing this so that I can change the format of these data files in future versions and then still correctly parse the... | Python: Best practice for including a version number in an app? | 0 | 0 | 1 | 0 | 0 | 3,932 |
4,537,434 | 2010-12-27T08:21:00.000 | 0 | 0 | 1 | 0 | 0 | python,web-services,rest,ruby-on-rails-3 | 0 | 4,537,518 | 0 | 2 | 0 | false | 0 | 0 | Via the CRUD interface, seems the obvious solution. | 2 | 0 | 0 | 0 | i have a application which use rails to do the CRUD operation,it's handy
now i want to write a crawler use python,after that i want to save the data to db,
so my question is how to python communicate with ror program? | how to communicate with ror program in python | 0 | 0 | 1 | 0 | 0 | 148 |
4,537,434 | 2010-12-27T08:21:00.000 | 1 | 0 | 1 | 0 | 0 | python,web-services,rest,ruby-on-rails-3 | 0 | 4,537,524 | 0 | 2 | 0 | false | 0 | 0 | I don't have any idea about python or rails (only grails :) but the easiest solution (if you don't want the python script to touch the DB) would be to implement a controller action for the REST PUT method in your rails application and call it from your python crawler with the crawled data.
Now, all the rails controller... | 2 | 0 | 0 | 0 | i have a application which use rails to do the CRUD operation,it's handy
now i want to write a crawler use python,after that i want to save the data to db,
so my question is how to python communicate with ror program? | how to communicate with ror program in python | 0 | 0.099668 | 1 | 0 | 0 | 148 |
4,537,975 | 2010-12-27T10:14:00.000 | 4 | 1 | 1 | 0 | 1 | python,module | 0 | 4,537,989 | 0 | 2 | 0 | true | 0 | 0 | You can add it to the search path by adding the directory to the environment variable PYTHONPATH or by adding it to sys.path in your Python script. Both work; if they don't, then you're using the wrong path. | 2 | 2 | 0 | 0 | I meet a problem when I try to install module omniORB&omniORBpy to a system, I don't have the root permission so I use --prefix to installed them to my user dir.
my question is : how can I make python load this module? I try add my user path to sys.path, but it still doesn't work.
Br,
J.K. | add a python module with out root permission | 0 | 1.2 | 1 | 0 | 0 | 1,009 |
4,537,975 | 2010-12-27T10:14:00.000 | 1 | 1 | 1 | 0 | 1 | python,module | 0 | 4,540,025 | 0 | 2 | 0 | false | 0 | 0 | I usually use the --user option instead of --prefix, since it installs it in ${HOME}/.local/lib/pythonx/site-packages and thus it does not require to add the path to sys.path.
I think this option is available only for python 2.6 + but I am not sure.
If you have to install it in an other place, then you have no choice a... | 2 | 2 | 0 | 0 | I meet a problem when I try to install module omniORB&omniORBpy to a system, I don't have the root permission so I use --prefix to installed them to my user dir.
my question is : how can I make python load this module? I try add my user path to sys.path, but it still doesn't work.
Br,
J.K. | add a python module with out root permission | 0 | 0.099668 | 1 | 0 | 0 | 1,009 |
4,541,603 | 2010-12-27T20:29:00.000 | -1 | 0 | 1 | 0 | 0 | python,distutils | 0 | 4,541,879 | 0 | 4 | 0 | true | 0 | 0 | Having subpackages for server and client code (foo.server and foo.client) seems the best approach to me,
Why? No single user (except you the developer) will ever use both sides. They're completely separate.
but then how do you handle your distutils setup if you don't want the server code to be shipped along with t... | 2 | 2 | 0 | 0 | Suppose you have a client/server application, say a webserver component and a qt gui. How do you layout your python code?
Packages foo.server and foo.client?
Packages fooserver and fooclient, with both importing from foocommon?
Everything together with no clear distinction?
Having subpackages for server and client co... | Python client/server project code layout | 0 | 1.2 | 1 | 0 | 0 | 513 |
4,541,603 | 2010-12-27T20:29:00.000 | 0 | 0 | 1 | 0 | 0 | python,distutils | 0 | 4,541,657 | 0 | 4 | 0 | false | 0 | 0 | I like namespaces, so yes. foo.client and foo.server and foo.common and foo.anythingelsethatcanbeusedseparately. But it's all a matter of taste, really.
And I'd release them as separate packages, and yes, I'd use Distribute. | 2 | 2 | 0 | 0 | Suppose you have a client/server application, say a webserver component and a qt gui. How do you layout your python code?
Packages foo.server and foo.client?
Packages fooserver and fooclient, with both importing from foocommon?
Everything together with no clear distinction?
Having subpackages for server and client co... | Python client/server project code layout | 0 | 0 | 1 | 0 | 0 | 513 |
4,541,853 | 2010-12-27T21:07:00.000 | 2 | 0 | 1 | 0 | 0 | python,asynchronous,callback,twisted,deferred | 0 | 4,541,923 | 0 | 4 | 1 | false | 0 | 0 | Sort of, but there is no concurrency in this type of event processing. No new callback will be called until the code gets back to the event loop. So the chain of callbacks is synchronous. It's only asynchronous in the event loop.
This is one caveat of this type of programming, the handlers most execute quickly, and get... | 1 | 6 | 0 | 0 | I'm trying to figure out how can i make my code more asynchronous using twisted.
A function returns a deferred object
then i add a list of callbacks
the first callback will be called after the deferred function provides some result through deferred_obj.callback
then, in the chain of callbacks, the first callback will ... | twisted deferred/callbacks and asynchronous execution | 0 | 0.099668 | 1 | 0 | 0 | 11,007 |
4,542,014 | 2010-12-27T21:38:00.000 | 0 | 0 | 1 | 1 | 0 | python | 0 | 4,542,064 | 0 | 4 | 0 | false | 0 | 0 | First, I'm not a Mac user, so I don't know a couple of specifics (default PATH, etc).
Also, a bit of clarity - when you use the installer, it lets you customize the installation to install in a specific location - do you know where that is. If you didn't select a location, it defaults to /usr/local/bin.
From Terminal,... | 2 | 2 | 0 | 0 | I have Python 2.6.1 which came on the Mac I have, but I'd recently downloaded and installed the disk image of 3.1.3 and I'd like to have it available in Terminal, how can I do this? For instance when I do $ python -V in Terminal I get 2.6.1.
Thanks for any help. | Updated Python from disk image, want to make it available in terminal | 0 | 0 | 1 | 0 | 0 | 151 |
4,542,014 | 2010-12-27T21:38:00.000 | 1 | 0 | 1 | 1 | 0 | python | 0 | 4,542,091 | 0 | 4 | 0 | false | 0 | 0 | The default Python version in Mac OS X needs to stay the default Python version, or things will break. You want to install it alongside with Python 2. This is most likely exactly what happened, but you start Python 3 with python3. | 2 | 2 | 0 | 0 | I have Python 2.6.1 which came on the Mac I have, but I'd recently downloaded and installed the disk image of 3.1.3 and I'd like to have it available in Terminal, how can I do this? For instance when I do $ python -V in Terminal I get 2.6.1.
Thanks for any help. | Updated Python from disk image, want to make it available in terminal | 0 | 0.049958 | 1 | 0 | 0 | 151 |
4,547,096 | 2010-12-28T15:24:00.000 | 1 | 0 | 1 | 0 | 0 | python,multithreading,multiprocessing | 0 | 4,547,398 | 0 | 1 | 0 | true | 0 | 0 | It really depends on the structure of your code and high level architecture of your system. If you think that whatever you are using greenlets for can be done using multiprocessing module in the Python Standard library, then you can do that. I think, if you post specific instances than you can get the specific ways to ... | 1 | 0 | 0 | 0 | I have some code which depends on Greenlets, and need to remove this dependency.
Can anyone explain to me exactly what I'll need to do?
They would preferably be replaced with threads or (better yet) processes from the multiprocessing module, but anything that relies solely on the Python standard library would be suff... | Removing code dependency on Greenlets | 0 | 1.2 | 1 | 0 | 0 | 194 |
4,557,045 | 2010-12-29T19:12:00.000 | 0 | 0 | 0 | 1 | 0 | python,hadoop,mapreduce,hbase | 0 | 4,567,653 | 0 | 1 | 0 | true | 1 | 0 | It's not precisely an answer, but it's the closest I got --
I asked in #hbase on irc.freenode.net yesterday, and one of the Cloudera employees responded.
The "Input Splits" problem I'm having with Pig is specific to Pig 0.7, and Pig 0.8 will be bundled with Cloudera CDH3 Beta 4 (no ETA on that). Therefore, what I want ... | 1 | 1 | 1 | 1 | I've been working on this for a long time, and I feel very worn out; I'm hoping for an [obvious?] insight from SO community that might get my pet project back on the move, so I can stop kicking myself. I'm using Cloudera CDH3, HBase .89 and Hadoop .20.
I have a Python/Django app that writes data to a single HBase table... | Easiest non-Java way to write HBase MapReduce on CDH3? | 0 | 1.2 | 1 | 0 | 0 | 1,322 |
4,567,031 | 2010-12-30T23:20:00.000 | 0 | 0 | 0 | 0 | 1 | python,html,django,templates | 0 | 4,567,219 | 0 | 6 | 0 | false | 1 | 0 | The readability of HTML doesn't matter. In a system like Django or Rails, HTML is an output format, not a source format. When people edit HTML by hand, they are right to be concerned about indentation and spacing, because it is a source format, and someone will have to edit it in the future. But the output of templa... | 1 | 15 | 0 | 0 | When using Django for html templating how do I create good html markup formatting.
I am trying to make use of content blocks. But the content blocks show up at different levels of indentation in different templates. How do I get the content blocks to show indented like it would be if someone was to hand write the htm... | Creating readable html with django templates | 0 | 0 | 1 | 0 | 0 | 5,075 |
4,567,692 | 2010-12-31T02:30:00.000 | 0 | 0 | 1 | 0 | 1 | java,python,multiple-inheritance | 0 | 4,567,713 | 0 | 8 | 0 | false | 1 | 0 | You can define the abilities in interfaces and implement them in your classes. | 4 | 1 | 0 | 0 | I'm porting some Python code to Java, and I am having trouble dealing with the following problem:
I have some classes which need to have abilities A, B, or C. Class 1 needs ability A, class 2 needs A, B and C, and class 3 needs B and C. Most importantly, I want to easily be able to change what class can have what abili... | Multiple inheritance in Python; how to do so in Java? | 0 | 0 | 1 | 0 | 0 | 474 |
4,567,692 | 2010-12-31T02:30:00.000 | 0 | 0 | 1 | 0 | 1 | java,python,multiple-inheritance | 0 | 4,567,774 | 0 | 8 | 0 | false | 1 | 0 | If what you need is interface inheritance, then as mentioned before, you can always implement multiple interfaces.
If you're looking for implementation inheritance, you're somewhat out of luck. The best solution is probably to use delegation — replace the extra superclasses with fields, and implement methods that just ... | 4 | 1 | 0 | 0 | I'm porting some Python code to Java, and I am having trouble dealing with the following problem:
I have some classes which need to have abilities A, B, or C. Class 1 needs ability A, class 2 needs A, B and C, and class 3 needs B and C. Most importantly, I want to easily be able to change what class can have what abili... | Multiple inheritance in Python; how to do so in Java? | 0 | 0 | 1 | 0 | 0 | 474 |
4,567,692 | 2010-12-31T02:30:00.000 | 0 | 0 | 1 | 0 | 1 | java,python,multiple-inheritance | 0 | 4,567,861 | 0 | 8 | 0 | false | 1 | 0 | This is a bit tangential, but you can have python code running in Java via Jython (http://www.jython.org/). This addresses the porting to Java part, not the solving multiple inheritance part (I think you need to determine which is relevant) | 4 | 1 | 0 | 0 | I'm porting some Python code to Java, and I am having trouble dealing with the following problem:
I have some classes which need to have abilities A, B, or C. Class 1 needs ability A, class 2 needs A, B and C, and class 3 needs B and C. Most importantly, I want to easily be able to change what class can have what abili... | Multiple inheritance in Python; how to do so in Java? | 0 | 0 | 1 | 0 | 0 | 474 |
4,567,692 | 2010-12-31T02:30:00.000 | 0 | 0 | 1 | 0 | 1 | java,python,multiple-inheritance | 0 | 4,567,720 | 0 | 8 | 0 | false | 1 | 0 | In java you don't have multiple inheritance, instead you can implement multiple interfaces.
So your class 1 will implement interface A and B. Class 2 will implement interface A, B and C. Class 3 will implement B and C. | 4 | 1 | 0 | 0 | I'm porting some Python code to Java, and I am having trouble dealing with the following problem:
I have some classes which need to have abilities A, B, or C. Class 1 needs ability A, class 2 needs A, B and C, and class 3 needs B and C. Most importantly, I want to easily be able to change what class can have what abili... | Multiple inheritance in Python; how to do so in Java? | 0 | 0 | 1 | 0 | 0 | 474 |
4,568,040 | 2010-12-31T04:17:00.000 | 0 | 0 | 0 | 0 | 0 | python,sockets | 1 | 4,568,045 | 0 | 2 | 0 | false | 0 | 0 | Stop the program or the service which is the port which you are trying to use. Alternatively, for whatever program which you are trying to write, use a PORT number which is a sufficiently high number (> 1024 for sure) and is unused. | 2 | 2 | 0 | 0 | i got this error while running my function.
"socket.error: [Errno 98] Address already in use"
how can i close the address already in use and start new connection with port in python? | python socket programming error | 0 | 0 | 1 | 0 | 1 | 2,831 |
4,568,040 | 2010-12-31T04:17:00.000 | 3 | 0 | 0 | 0 | 0 | python,sockets | 1 | 4,568,824 | 0 | 2 | 0 | false | 0 | 0 | These scenarios will raise error "[Errno 98] Address already in use" when you create a socket at certain port:
The port was't closed. When you created a socket, but forgot to close it, or annother program hold that.
You have close the socket(or kill the process), but the port stay at TIME_WAIT status in 2 MSL(about 2 ... | 2 | 2 | 0 | 0 | i got this error while running my function.
"socket.error: [Errno 98] Address already in use"
how can i close the address already in use and start new connection with port in python? | python socket programming error | 0 | 0.291313 | 1 | 0 | 1 | 2,831 |
4,571,807 | 2010-12-31T18:52:00.000 | 3 | 0 | 1 | 0 | 0 | c++,python,c,cython | 0 | 4,571,848 | 0 | 2 | 0 | true | 0 | 0 | Use C++; it has standard and highly-optimized versions of all of these. There's absolutely no reason or benefit to limit yourself to C.
(ed: In other words, yes, that's a very standard practice. Remember, there's no requirement to use any of C++'s features when using C++; by design, you can pick and choose. I often ... | 1 | 0 | 0 | 0 | I'm interested in getting into C to get close to the metal performance, but would like to write in a Pythonic style and don't want to roll my own dynamic strings, lists, and dictionaries. Cython is pretty good, but would like to know how to use dynamic variables in straight C if possible.
With C++ there is of course t... | Is there a standard set of libraries for dynamic strings, lists, and dictionaries in C? | 0 | 1.2 | 1 | 0 | 0 | 380 |
4,573,468 | 2011-01-01T07:34:00.000 | 1 | 0 | 0 | 1 | 0 | php,python,ruby-on-rails,system-administration,database-administration | 0 | 4,573,569 | 0 | 2 | 0 | false | 1 | 0 | I'm not a Unix security guru, but some basic things to think of:
Make sure your web app runs as a specific user, and make sure that user has privileged rights only to those files which it is supposed to modify.
Do not allow arbitrary inputs to be added to the files, have strict forms where each field is validated to c... | 1 | 5 | 0 | 0 | Can someone suggest some basic advice on dealing with web applications that interact with configuration files like httpd.conf, bind zone files, etc.
I understand that it's bad practice, in fact very dangerous to allow arbitrary execution of code without fully validating it and so on. But say you are tasked to write a s... | What is good practice for writing web applications that control daemons (and their config files) | 0 | 0.099668 | 1 | 0 | 0 | 332 |
4,581,441 | 2011-01-03T01:05:00.000 | 6 | 0 | 1 | 1 | 0 | python,ncurses | 0 | 8,763,488 | 0 | 4 | 0 | false | 0 | 0 | textpad.Textbox(win, insert_mode=True) provides basic insert support. Backspace needs to be added though. | 1 | 11 | 0 | 0 | Has anybody got a working example of using the curses.textpad.Textbox widget to edit existing text? This is, of course, in a Linux terminal (e.g. xterm). | Edit text using Python and curses Textbox widget? | 0 | 1 | 1 | 0 | 0 | 16,216 |
4,585,237 | 2011-01-03T14:25:00.000 | 0 | 0 | 1 | 1 | 0 | python | 0 | 4,585,382 | 0 | 2 | 0 | false | 0 | 0 | All your schedulers are part of your a single Python process, then you won't be able to count the the individual timers which are scheduled. As the python schedulers are something you write, you can choose to keep a file which would be updated periodically.
If each scheduler is a separate python process, then count the... | 1 | 1 | 0 | 0 | I have created the number of schedulers using python in windows which are running in background.
Can anyone tell me any command to check how many schedulers running on windows and also how can I remove them? | problems in Python Sched | 0 | 0 | 1 | 0 | 0 | 361 |
4,588,045 | 2011-01-03T20:24:00.000 | 3 | 0 | 1 | 0 | 0 | python,pyqt,python-2.3 | 0 | 4,588,075 | 0 | 2 | 0 | false | 0 | 1 | Python 2.3 is extremely old. You really shouldn't be using it at all. I seriously doubt there's any qt bindings for it that would even compile. Why do you think using python 2.3 will save you so much file size?
Adding pyqt will probably increase your file size by 10s of megabytes at least. Just use python at least 2.6.... | 1 | 0 | 0 | 0 | Is there a PyQt3 (Or 4) Windows binary installer for Python 2.3? I've googled around for an hour now but to no avail. Why am I using version 2.3? With my project file size is paramount. Without the interface, un-needed modules and compressing using UPX the resulting .exe size is a mear 750KB's. Just need to add the int... | PyQt & Python2.3 | 0 | 0.291313 | 1 | 0 | 0 | 209 |
4,594,522 | 2011-01-04T14:12:00.000 | 1 | 0 | 0 | 0 | 0 | python,django,garbage-collection | 0 | 4,595,172 | 0 | 5 | 1 | false | 1 | 0 | An alternative might be to disable GC altogether, and configure mod_wsgi (or whatever you're using) to kill and restart processes more frequently. | 1 | 11 | 0 | 0 | After 2 days of debug, I nailed down my time-hog: the Python garbage collector.
My application holds a lot of objects in memory. And it works well.
The GC does the usual rounds (I have not played with the default thresholds of (700, 10, 10)).
Once in a while, in the middle of an important transaction, the 2nd generatio... | Django Python Garbage Collection woes | 0 | 0.039979 | 1 | 0 | 0 | 4,978 |
4,595,197 | 2011-01-04T15:19:00.000 | -1 | 0 | 1 | 0 | 0 | python,text,file-io | 0 | 4,595,284 | 0 | 4 | 0 | false | 0 | 0 | I don't really know Python, but here's a bit of pseudocode.
int header_found=0;
[start where loop where you're looping through lines of file]
if(header_found==1)
[grab line];
header_found=0;
if(line=~/[regexp for header]/)
header_found=1;
The idea is to have a variable that keeps track of whether or not you... | 1 | 7 | 0 | 0 | I am an amateur using Python on and off for some time now. Sorry if this is a silly question, but I was wondering if anyone knew an easy way to grab a bunch of lines if the format in the input file is like this:
"
Heading 1
Line 1
Line 2
Line 3
Heading 2
Line 1
Line 2
Line 3
"
I won't know how many lines are after each... | How to grab the lines AFTER a matched line in python | 0 | -0.049958 | 1 | 0 | 0 | 16,585 |
4,605,243 | 2011-01-05T14:37:00.000 | 0 | 1 | 0 | 0 | 0 | python,web,yahoo | 0 | 4,605,453 | 0 | 6 | 0 | false | 1 | 0 | If they're different pages, they can easily be created by different software. So if a mail application written in Java offers a link to an address book, the address book can easily be Python--that's just a matter of configuring the server.
If you need an addressbook component within the mail application, that's a bit m... | 4 | 0 | 0 | 0 | I was watching the tutorials for python and the guy told that he coded the Address books and spell checker for yahoo mail in python.
Now initially i was thinking that if i build the website then i have to use one language either php or java or asp or anything.
But i am confused how can we make make separate modules in ... | Is it possible to use different technologies in one website | 1 | 0 | 1 | 0 | 0 | 99 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.