Q_Id
int64
337
49.3M
CreationDate
stringlengths
23
23
Users Score
int64
-42
1.15k
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
Tags
stringlengths
6
105
A_Id
int64
518
72.5M
AnswerCount
int64
1
64
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
6
11.6k
Available Count
int64
1
31
Q_Score
int64
0
6.79k
Data Science and Machine Learning
int64
0
1
Question
stringlengths
15
29k
Title
stringlengths
11
150
Score
float64
-1
1.2
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
8
6.81M
1,705,955
2009-11-10T06:16:00.000
3
0
0
0
python,django,packaging,pinax,external-dependencies
1,706,213
4
true
0
0
I meant to mention that the solution I had considered before asking was to put up a Pinax PyPI and make development releases on it. We could put up an instance of chishop. We are already using pip's --find-links to point at pypi.pinaxproject.com for packages we've had to release ourselves.
3
6
0
One issue that comes up during Pinax development is dealing with development versions of external apps. I am trying to come up with a solution that doesn't involve bringing in the version control systems. Reason being I'd rather not have to install all the possible version control systems on my system (or force that up...
How might I handle development versions of Python packages without relying on SCM?
1.2
0
0
347
1,706,309
2009-11-10T08:05:00.000
3
0
0
0
python,django,zope,zodb,acquisition
1,707,165
6
false
1
0
ZODB is a OO-style database that doesn't need a schema definition. You can simply create (nearly) all kinds of objects, and persist them. The TTW is sometimes annoying, but you can mount the ZOPE-object-tree using webdav. Then you can edit the templates and scripts using your favorite editor. ZOPE is especially powerfu...
1
8
0
I am a newbie to zope and I previously worked on Django for about 2.5 years. So when I first jumped into Zope(v2) (only because my new company is using it since 7 years), I faced these questions. Please help me in understanding them. What is the "real" purpose of zodb as such? I know what it does, but tell me one grea...
Understanding Zope internals, from Django eyes
0.099668
0
0
3,052
1,706,644
2009-11-10T09:29:00.000
1
0
0
0
python,authentication,urllib2,digest
1,717,241
1
false
0
0
Although it's not available out of the box, urllib2 is flexible enough to add it yourself. Subclass HTTPDigestAuthHandler, hack it (retry_http_digest_auth method I think) to remember authentication information and define an http_request(self, request) method to use it for all subsequent requests (add WWW-Authenticate h...
1
1
0
I am trying to use Python to write a client that connects to a custom http server that uses digest authentication. I can connect and pull the first request without problem. Using TCPDUMP (I am on MAC OS X--I am both a MAC and a Python noob) I can see the first request is actually two http requests, as you would expec...
Client Digest Authentication Python with URLLIB2 will not remember Authorization Header Information
0.197375
0
1
1,902
1,706,945
2009-11-10T10:24:00.000
11
0
1
0
python
11,110,661
3
false
0
0
Try loading the readline module (import readline). That will make things work for you.
1
8
0
When I do a raw_input() and enter values, I am not able to use my arrow-keys to change stuff... is there any way for doing that? Thanx readline module helps in line editing features. How to use the readline module? Just importing the readline module works!
How to get interactive input from user and to be able to use arrowkeys while entering input?
1
0
0
21,299
1,707,065
2009-11-10T10:48:00.000
2
0
1
0
python,extended-ascii
1,707,510
5
true
0
0
I would like to say that I've found a solution in Unix systems, exporting a environment var, with this: export LC_CTYPE="es:ES.UTF-8" This way, all files are in utf-8, so I can make prints or whatever and it works fine
2
6
0
I have a problem when I'm printing (or writing to a file) the non-ASCII characters in Python. I've resolved it by overriding the str method in my own objects, and making "x.encode('utf-8')" inside it, where x is a property inside the object. But, if I receive a third-party object, and I make "str(object)", and this obj...
How to print non-ASCII characters in Python
1.2
0
0
25,810
1,707,065
2009-11-10T10:48:00.000
3
0
1
0
python,extended-ascii
1,707,088
5
false
0
0
How about you use unicode(object) and define __unicode__ method on your classes? Then you know its unicode and you can encode it anyway you want into to a file.
2
6
0
I have a problem when I'm printing (or writing to a file) the non-ASCII characters in Python. I've resolved it by overriding the str method in my own objects, and making "x.encode('utf-8')" inside it, where x is a property inside the object. But, if I receive a third-party object, and I make "str(object)", and this obj...
How to print non-ASCII characters in Python
0.119427
0
0
25,810
1,707,390
2009-11-10T11:46:00.000
0
0
1
0
asp.net,visual-studio,visual-studio-2008,ironpython
1,728,528
2
false
1
0
I had to uninstall IronPython and install ASP.NET future releases to solve it
1
1
0
I'm trying IronPython for asp.net, I got a simple CRUD screen to work. I've read IntelliSense doesnt work for IronPython, but is there any way to get rid of Visual Studio underlining all the lines' starting tokens with blue and a message of "expected declaration"?
IronPython asp.net IntelliSense
0
0
0
198
1,707,780
2009-11-10T12:57:00.000
3
0
0
0
python,matlab,language-interoperability
50,057,490
13
false
0
0
Like Daniel said you can run python commands directly from Matlab using the py. command. To run any of the libraries you just have to make sure Malab is running the python environment where you installed the libraries: On a Mac: Open a new terminal window; type: which python (to find out where the default version of ...
1
76
1
I need to call a Python function from MATLAB. how can I do this?
Call Python function from MATLAB
0.046121
0
0
132,733
1,708,103
2009-11-10T13:49:00.000
10
1
1
0
python,ironpython
1,708,382
13
false
0
1
Rewrite any small C# app in IronPython, and show them how many lines of code it took you. If that's not impressing, I don't know what is. I'm referring to one of your internal apps.
2
10
0
I need an IronPython\Python example that would show C#/VB.NET developers how awesome this language really is. I'm looking for an easy to understand code snippet or application I can use to demo Python's capabilities. Any thoughts?
How to impress developers with IronPython/Python
1
0
0
1,848
1,708,103
2009-11-10T13:49:00.000
3
1
1
0
python,ironpython
1,711,358
13
false
0
1
I have to agree Geo. Show a C# or VB app next to the same app written in IronPython. When I've done my IronPython talks, I've had a lot of success morphing C# code into Python. It makes for a very dramatic presentation. I'm also a big fan of showing off how duck typing makes your code more testable.
2
10
0
I need an IronPython\Python example that would show C#/VB.NET developers how awesome this language really is. I'm looking for an easy to understand code snippet or application I can use to demo Python's capabilities. Any thoughts?
How to impress developers with IronPython/Python
0.046121
0
0
1,848
1,708,392
2009-11-10T14:32:00.000
0
0
1
0
python,set
1,708,407
5
false
0
0
If you are using python 3.0, you can subclass collections.Set
2
4
0
I'm trying to write some Python code that includes union/intersection of sets that potentially can be very large. Much of the time, these sets will be essentially set(xrange(1<<32)) or something of the kind, but often there will be ranges of values that do not belong in the set (say, 'bit 5 cannot be clear'), or extra ...
Is there code out there to subclass set in Python for big xranges?
0
0
0
191
1,708,392
2009-11-10T14:32:00.000
1
0
1
0
python,set
1,708,575
5
false
0
0
You are trying to make a set containing all the integer values in from 0 to 4,294,967,295. A byte is 8 bits, which gets you to 255. 99.9999940628% of your values are over one byte in size. A crude minimum size for your set, even if you are able to overcome the syntactic issues, is 4 billion bytes, or 4 GB. You are...
2
4
0
I'm trying to write some Python code that includes union/intersection of sets that potentially can be very large. Much of the time, these sets will be essentially set(xrange(1<<32)) or something of the kind, but often there will be ranges of values that do not belong in the set (say, 'bit 5 cannot be clear'), or extra ...
Is there code out there to subclass set in Python for big xranges?
0.039979
0
0
191
1,709,201
2009-11-10T16:22:00.000
0
0
0
0
python,django,django-cms
1,709,285
2
false
1
0
You may need to {% load %} the template tag library at the top of your file.
2
1
0
I am getting started with django-cms and I am facing an exception when I try to edit a page in the admin inteface. A TemplateSyntaxError exception is raised due to the {% page_submit_row %} templatetag. TemplateSyntaxError at /admin/cms/page/1/ Caught an exception while rendering: admin/page_submit_line.html Reques...
getting started with django-cms: error on page_submit_row
0
0
0
462
1,709,201
2009-11-10T16:22:00.000
0
0
0
0
python,django,django-cms
1,709,611
2
true
1
0
It seems that the problem comes from the django-cms installer. It was with RC2 and RC3 is out now. Moreover, It is recommended to use easy_install for the installation easy_instaling RC3 fixed the problem Best
2
1
0
I am getting started with django-cms and I am facing an exception when I try to edit a page in the admin inteface. A TemplateSyntaxError exception is raised due to the {% page_submit_row %} templatetag. TemplateSyntaxError at /admin/cms/page/1/ Caught an exception while rendering: admin/page_submit_line.html Reques...
getting started with django-cms: error on page_submit_row
1.2
0
0
462
1,709,528
2009-11-10T17:03:00.000
0
0
0
0
python,qt,pyqt,translation,button
4,627,449
4
false
0
1
If you want to have Yes/No translated into the current language, usually setting the system language should be enough. Otherwise try with Natim's suggestion. If you want custom texts: The static methods like question() etc. don't allow custom button texts. That's unfortunate, as "Yes"/"No" dialogs are considered bad s...
2
4
0
How can I easily translate standard buttons (Yes, No) from QMessageBox? I can't use self.tr on those arguments, so I would like to achieve it in some other simple way. Do I have to use whole translation system?
PyQt: translating standard buttons
0
0
0
5,231
1,709,528
2009-11-10T17:03:00.000
3
0
0
0
python,qt,pyqt,translation,button
1,709,930
4
false
0
1
Are you sure you have to translate them yourself? In other toolkits, standard buttons are automatically translated to the language that the user is using.
2
4
0
How can I easily translate standard buttons (Yes, No) from QMessageBox? I can't use self.tr on those arguments, so I would like to achieve it in some other simple way. Do I have to use whole translation system?
PyQt: translating standard buttons
0.148885
0
0
5,231
1,710,363
2009-11-10T19:01:00.000
16
0
1
0
python
1,710,405
29
false
0
0
Don't have variable names that are types. For example, don't name a variable "file" or "dict"
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
1
0
0
6,846
1,710,363
2009-11-10T19:01:00.000
13
0
1
0
python
1,710,498
29
false
0
0
Decorators. Writing your own is not something you might want to do right away, but knowing that @staticmethod and @classmethod are available from the beginning (and the difference between what they do) is a real plus.
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
1
0
0
6,846
1,710,363
2009-11-10T19:01:00.000
20
0
1
0
python
1,711,824
29
false
0
0
What enumerate is for. That seq = seq.append(item) and seq = seq.sort() both set seq to None. Using set to remove duplicates. Pretty much everything in the itertools and collections modules. How the * and ** prefixes for function arguments work. How default arguments to functions work internally (i.e. what f.func_defau...
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
1
0
0
6,846
1,710,363
2009-11-10T19:01:00.000
7
0
1
0
python
1,711,839
29
false
0
0
using help() in the shell on any object, class or path you can run import code; code.interact(local=locals()) anywhere in your code and it will start a python shell at that exact point you can run python -i yourscript.py to start a shell at the end of yourscript.py
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
1
0
0
6,846
1,710,363
2009-11-10T19:01:00.000
0
0
1
0
python
6,389,037
29
false
0
0
Functional programming tools, like all and any
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
0
0
0
6,846
1,710,363
2009-11-10T19:01:00.000
2
0
1
0
python
1,742,631
29
false
0
0
Maybe a touch more advanced, but I wish I'd known that you don't use threads to take advantage of multiple cores in (C)python. You use the multiprocessing library.
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
0.013792
0
0
6,846
1,710,363
2009-11-10T19:01:00.000
57
0
1
0
python
1,710,411
29
true
0
0
I learned Python back before the 1.5.2 release, so the things that were key for me back then may not be the key things today. That being said, a crucial thing that took me a little bit to realize, but I now consider crucial: much functionality that other languages would make intrinsic is actually made available by the ...
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
1.2
0
0
6,846
1,710,363
2009-11-10T19:01:00.000
4
0
1
0
python
1,711,463
29
false
0
0
I implemented plenty of recursive directory walks by hand before I learned about os.walk()
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
0.027579
0
0
6,846
1,710,363
2009-11-10T19:01:00.000
1
0
1
0
python
1,711,444
29
false
0
0
I wish I knew well a functional language. After playing a bit with Clojure, I realized that lots of Python's functional ideas are borrowed from Lisp or other functional langs
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
0.006896
0
0
6,846
1,710,363
2009-11-10T19:01:00.000
0
0
1
0
python
1,711,023
29
false
0
0
What I really liked: List comprehensions, closures (and high-order functions), tuples, lambda functions, painless bignumbers. What I wish I had known about sooner: The fact that using Python idioms in code (e.g. list comprehensions instead of loops over lists) was faster.
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
0
0
0
6,846
1,710,363
2009-11-10T19:01:00.000
4
0
1
0
python
1,710,428
29
false
0
0
Closures. Clean and concise, without having to resort to using a Strategy Pattern unlike languages such as Java
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
0.027579
0
0
6,846
1,710,363
2009-11-10T19:01:00.000
0
0
1
0
python
1,710,389
29
false
0
0
I really like list comprehension and all other semifunctional constructs. I wish I had known those when I was in my first Python project.
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
0
0
0
6,846
1,710,363
2009-11-10T19:01:00.000
33
0
1
0
python
1,710,378
29
false
0
0
I wished I didn't know Java. More functional programming. (see itertools module, list comprehension, map(), reduce() or filter())
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
1
0
0
6,846
1,710,363
2009-11-10T19:01:00.000
0
0
1
0
python
1,711,478
29
false
0
0
That multi-core was the future. Still love Python. It's writes a fair bit of my code for me.
14
47
0
I've decided to learn Python 3. For those that have gone before, what did you find most useful along the way and wish you'd known about sooner?
What do you wish you'd known about when you started learning Python?
0
0
0
6,846
1,711,200
2009-11-10T21:08:00.000
0
0
1
1
python,linux,debian
1,711,271
4
false
0
0
Your safest bet is to put Python 2.6 in /opt (./configure --prefix=/opt), and modify /etc/profile so that /opt/bin is searched first.
2
0
0
I am building python2.6 from source on Debian Lenny. ( ./configure make make altinstall ) I don't want it to conflict with anything existing, but I want it to be in the default search path for bash. Suggestions? (ps, I'm using a vm, so I can trash it and rebuild.)
Python 2.6 on Debian Lenny. Where should the executable go?
0
0
0
6,560
1,711,200
2009-11-10T21:08:00.000
3
0
1
1
python,linux,debian
1,711,264
4
false
0
0
I strongly recommend you do one of these two options. Build a .deb package, and then install the .deb package; the installed then go in the usual places (/usr/bin/python26 for the main interpreter). Build from source, and install from source into /usr/local/bin. I think it is a very bad idea to start putting files in...
2
0
0
I am building python2.6 from source on Debian Lenny. ( ./configure make make altinstall ) I don't want it to conflict with anything existing, but I want it to be in the default search path for bash. Suggestions? (ps, I'm using a vm, so I can trash it and rebuild.)
Python 2.6 on Debian Lenny. Where should the executable go?
0.148885
0
0
6,560
1,711,483
2009-11-10T21:50:00.000
7
1
1
0
python,web-hosting
1,711,705
3
false
0
0
Python is a compiled language; the compiled byte code is cached by the Python process for later use, to improve performance. PHP, by default, is interpreted. It's a tradeoff between usability and speed. If you're using a standard WSGI module, such as Apache's mod_wsgi, then you don't have to restart the server -- just ...
1
6
0
We currently run a small shared hosting service for a couple of hundred small PHP sites on our servers. We'd like to offer Python support too, but from our initial research at least, a server restart seems to be required after each source code change. Is this really the case? If so, we're just not going to be able to...
Python web hosting: Why are server restarts necessary?
1
0
0
1,525
1,712,768
2009-11-11T03:11:00.000
0
0
0
0
python,symbian,xmpp,pys60
1,716,884
1
true
1
0
It's fairly easy to add native extensions to Python and there are lots of C/C++ libraries for XMPP that would port easily. The previous pyexpat module is just bindings for native expat on Symbian, which is ported to S60 3rd Edition, so you should be able to get pyexpat working too. Of course you need some ability with...
1
2
0
I'm interested in developing a XMPP client on the mobile S60 Symbian platform using the Python interpreter PyS60. I've done a search on Google for possible libraries, but turned up empty. I'm hoping that by asking this on SO, I can get a definite answer on whether there is actually an existing library that I just hadn...
What Jabber/XMPP libraries are available for PyS60 (Python for Symbian S60) interpreter?
1.2
0
0
912
1,712,883
2009-11-11T03:50:00.000
2
1
0
0
python,apache,deployment,apache2,pylons
1,712,913
1
true
1
0
mod_wsgi. It's more efficient. FastCGI can be troublesome to setup, whereas I've never known anyone to have a problem using mod_wsgi with a supported version of Python (2.5, 2.6, 3.1 included). WSGI exists for Python (by Python, &c.) and so it makes for a more "Pythonic" experience. Prior to WSGI I used to serve sm...
1
0
0
I'm a beginner with Pylons and I've mostly developed on my localhost using the built-in web server. I think it's time to start deployment for my personal blog, I have a Debian Lenny server with apache2-mpm-prefork module and mod_wsgi - I've never really used mod_wsgi or fastcgi and I hear either of these are the way to...
Pylons deployment questions
1.2
0
0
450
1,713,398
2009-11-11T06:20:00.000
4
0
1
0
python,linux,unix
1,713,411
5
true
0
0
Then it fails. You can't import a python 2.5 library while you're running python 2.4. It won't work. Why can't you run python 2.5+?
1
0
0
Then how do I import that? I run everything in python 2.4, but one of my scripts import xml.etree.ElementTree...which is only Python 2.5
What if one of my programs runs in python 2.4, but IMPORTS something that requires python 2.5?
1.2
0
1
1,923
1,714,624
2009-11-11T11:33:00.000
6
0
0
0
java,python,serialization
1,714,644
7
false
1
0
Java binary serialization is really designed to be used with Java. To do it in Python you'd have to have all the relevant Java classes available for inspection, and create Python objects appropriately - it would be pretty hideous and fragile. You're better off using a cross-platform serialization format such as Thrift,...
2
13
0
Is there any library to deserialize with python which is serialized with java?
Is there any library to deserialize with python which is serialized with java
1
0
1
8,371
1,714,624
2009-11-11T11:33:00.000
0
0
0
0
java,python,serialization
1,714,862
7
false
1
0
If you are using Java classes, then I don't even know what it would mean to deserialize a Java class in a Python environment. If you are only using simple primitives (ints, floats, strings), then it probably wouldn't be too hard to build a Python library that could deserialize the Java format. But as others have said,...
2
13
0
Is there any library to deserialize with python which is serialized with java?
Is there any library to deserialize with python which is serialized with java
0
0
1
8,371
1,715,098
2009-11-11T13:12:00.000
1
0
0
0
python,pyqt,pyqt4
1,715,113
2
false
0
1
You can run the algorithm in a separate thread, placing the data into a Queue when finished. The main thread (GUI) will periodically sample the queue and display the data when it arrives.
1
1
0
I have a couple of questions. I have an algorithm that will generate a couple of pictures in python that must be displayed on a form. I am using PyGt for this. My question is: where should I run my code? Right from the initializer? In that case from what I tested, the form won't show up. Should I set up a timer in th...
Couple of questions regarding PyQt
0.099668
0
0
155
1,716,247
2009-11-11T16:15:00.000
1
0
0
0
python,django,forms,wizard,preview
2,152,059
2
false
1
0
I do a similar thing at my first Django project. Using session-based FormWizard, I customized it so user can stop subbmiting data at any form. At that point you can use FormPreview probably to show information or just dynamically generate form and show it to user. Data stays in the session.
1
9
0
I have a large Django model (73 fields) that will will be connected to a ModelForm. I'd like to use a combination of the functionality found the Form Wizard and Form Preview contrib apps. I.e., the form fields would be split over multiple pages, and the user would have a chance to review/preview the data before the mo...
Django Form Wizard and Preview with ModelForm
0.099668
0
0
2,727
1,718,343
2009-11-11T21:56:00.000
6
0
0
0
python,django,upload,file-upload
1,718,362
5
true
1
0
You are probably using the development version of Django, which includes quite a lot of extra CRSF security. However it's not released yet so external products probably aren't compatible. You should use the 1.1 version of Django instead.
2
10
0
I have installed filebrowser for Django (not filebrowser3) and when I try to upload a file I recieve the following error: 403 Forbidden CSRF verification failed. Request aborted. More information is available with DEBUG=True. The same error occurs when I try to create a new folder which shows that the problem is ...
"CSRF verification failed" when attempting to upload a file or create a folder with filebrowser for Django
1.2
0
0
16,007
1,718,343
2009-11-11T21:56:00.000
4
0
0
0
python,django,upload,file-upload
4,137,086
5
false
1
0
Add to you settings.py this 2 lines: ‘django.middleware.csrf.CsrfViewMiddleware’, ‘django.middleware.csrf.CsrfResponseMiddleware’,
2
10
0
I have installed filebrowser for Django (not filebrowser3) and when I try to upload a file I recieve the following error: 403 Forbidden CSRF verification failed. Request aborted. More information is available with DEBUG=True. The same error occurs when I try to create a new folder which shows that the problem is ...
"CSRF verification failed" when attempting to upload a file or create a folder with filebrowser for Django
0.158649
0
0
16,007
1,718,681
2009-11-11T22:55:00.000
3
0
1
0
python,fibonacci
1,718,688
2
true
0
0
To invoke your function, you have to use parens: appendNextFib(). It looks like you simply used appendNextFib, which would show you its value, which is that function object.
1
1
0
My apologies in advance should I butcher any Python vocabulary, this is my first programming class and we are not permitted to post or share our code. I will do my best to explain the problem. I am defining my function as variable one and variable two. I then gave values to both variables. I used a for statement with...
Understanding an error message while writing code for a Fibonacci program
1.2
0
0
159
1,718,784
2009-11-11T23:18:00.000
3
0
0
0
javascript,python,ajax,django
1,718,808
3
true
1
0
I think option 2 is best. It's incremental (only renders one more comment when a comment is added), and re-uses the rendering. If you don't like returning just HTML from an Ajax request, then have the response be a JSON structure which includes the HTML as just one component. Then you can also carry status (or whate...
2
10
0
Let's say you have a view called "View Story" which is just a web page rendered on the backend via Python/Django. On that page there's a list of comments at the bottom rendered as part of the "View Story" template using Django's templating system (in a loop). This page also allows you to add a comment to the list. T...
Render page initially and update via AJAX using the same template HTML
1.2
0
0
2,693
1,718,784
2009-11-11T23:18:00.000
1
0
0
0
javascript,python,ajax,django
3,067,371
3
false
1
0
There is also option 4: Copy an existing element in the list and change its values. This is of course less flexible than templates. You can copy a hidden element instead to handle the case where the list is empty. You could also try option 2b: Generate the HTML on the server like option 2, but instead of directly acce...
2
10
0
Let's say you have a view called "View Story" which is just a web page rendered on the backend via Python/Django. On that page there's a list of comments at the bottom rendered as part of the "View Story" template using Django's templating system (in a loop). This page also allows you to add a comment to the list. T...
Render page initially and update via AJAX using the same template HTML
0.066568
0
0
2,693
1,719,127
2009-11-12T00:44:00.000
1
0
1
0
python,dreamweaver
1,719,141
3
false
1
0
Assuming that any functionality needs to remain intact… no.
3
0
0
I am comfortable in Adobe Dreamweaver CS3. Is there a way to convert a website written in the Python language into Dreamweaver for those who aren't familiar with writing in code?
Python website convert into Adobe Dreamweaver CS3
0.066568
0
0
458
1,719,127
2009-11-12T00:44:00.000
0
0
1
0
python,dreamweaver
1,719,178
3
false
1
0
Well, you can simply copy the HTML that Python generates to make a static copy of the website, but you'll lose any interactivity. In other words, you won't be able to use the website's administrative panel to modify anything. It will let you modify the style of the website, however.
3
0
0
I am comfortable in Adobe Dreamweaver CS3. Is there a way to convert a website written in the Python language into Dreamweaver for those who aren't familiar with writing in code?
Python website convert into Adobe Dreamweaver CS3
0
0
0
458
1,719,127
2009-11-12T00:44:00.000
1
0
1
0
python,dreamweaver
1,719,759
3
false
1
0
If you mean a tool which can convert a python site into dreamweaver, not possible yet, such intelligent machines are not yet invented, but evolution has produced you, so what you can do is see the site page by page, and make it again in dreamweaver. If you have specs and designs of python site handy that would speed up...
3
0
0
I am comfortable in Adobe Dreamweaver CS3. Is there a way to convert a website written in the Python language into Dreamweaver for those who aren't familiar with writing in code?
Python website convert into Adobe Dreamweaver CS3
0.066568
0
0
458
1,719,279
2009-11-12T01:27:00.000
4
1
0
0
python,database,testing,sqlalchemy
1,719,347
1
true
0
0
Follow the design pattern that Django uses. Create a disposable copy of the database. Use SQLite3 in-memory, for example. Create the database using the SQLAlchemy table and index definitions. This should be a fairly trivial exercise. Load the test data fixture into the database. Run your unit test case in a databa...
1
4
0
Are there database testing tools for python (like sqlunit)? I want to test the DAL that is built using sqlalchemy
Are there database testing tools for python (like sqlunit)?
1.2
1
0
601
1,719,742
2009-11-12T03:42:00.000
2
0
1
0
python,dictionary,grouping
1,719,762
4
false
0
0
First off, the data, needn't be be replicated. You can well have 3 dictionaries each using a different key, but having the same reference as its value. Doing so you only need to change the value object once and this will be reflected in all dictionaries (or more precisely since the the dictionaries only store a refere...
1
3
0
I am trying to create a small server type application and have a question regarding organizing data with dicts. Right now I am grouping the data using the connection socket (mainly to verify where it's coming from and for sending data back out). Something like this: connected[socket] = account_data. Basically, each con...
Python organizing data with multiple dictionaries
0.099668
0
0
1,572
1,719,898
2009-11-12T04:33:00.000
2
0
0
0
python,command-line,windows-vista,pylint,errorlevel
1,720,007
3
true
0
0
I just tried this on XP: t.bat: exit Running this closes the window! Maybe the command line for pylint uses a batch file which contains an exit?
1
0
0
Pylint is doing something odd on my Windows box - something that shouldn't be possible. This isn't a question about fixing pylint, so much as fixing my understanding. I have a typical install of the latest version of pylint, Python 2.6 and Windows Vista. If I open a Command Prompt, and run pylint from the command line,...
How does pylint quit the Windows command box it is running in?
1.2
0
0
635
1,720,816
2009-11-12T08:47:00.000
2
0
0
1
python,twisted
44,355,634
5
false
0
0
The fdesc module might be useful for asynchronously talking to a socket or pipe, but when given an fd that refers to an ordinary filesystem file, it does blocking io (and via a rather odd interface at that). For disk io, fdesc is effectively snake oil; don't use it. As of May 2017, the only reasonable way to get async ...
2
27
0
I'm trying to figure out if there is a defacto pattern for file access using twisted. Lots of examples I've looked at (twisted.python.log, twisted.persisted.dirdbm, twisted.web.static) actually don't seem to worry about blocking for file access. It seems like there should be some obvious interface, probably inheriting...
Non-blocking file access with Twisted
0.07983
0
0
8,205
1,720,816
2009-11-12T08:47:00.000
-8
0
0
1
python,twisted
1,720,836
5
false
0
0
I'm not sure what you want to achieve. When you do logging, then Python will make sure (by the global interpreter log) that log messages from several threads go into the file one after the other. If you're concerned about blocking IO, then the OS adds default buffers for your files (usually 4KB), and you can pass a buf...
2
27
0
I'm trying to figure out if there is a defacto pattern for file access using twisted. Lots of examples I've looked at (twisted.python.log, twisted.persisted.dirdbm, twisted.web.static) actually don't seem to worry about blocking for file access. It seems like there should be some obvious interface, probably inheriting...
Non-blocking file access with Twisted
-1
0
0
8,205
1,720,867
2009-11-12T09:01:00.000
2
0
0
0
python,linux,unix,installation
1,720,904
3
true
0
0
Have you installed python-mysqldb? If not install it using apt-get install python-mysqldb. And how are you importing mysql.Is it import MySQLdb? Python is case sensitive.
1
1
0
But, they were unable to be found!? How do I install both of them?
I just installed a Ubuntu Hardy server. In Python, I tried to import _mysql and MySQLdb
1.2
1
0
730
1,720,893
2009-11-12T09:07:00.000
0
0
1
0
python,dll,compilation,py2exe
1,721,713
4
false
0
0
From what I understand, it is possible to statically link python into an executable, but then you lose your ability to load other dynamic modules (.pyd files) like os and zlib and math. Unless you are able to statically compile those as well into your main program. And as far as I know, the only compiler that can do th...
2
0
0
It's my understanding that py2exe can only dynamically link a python2x.dll file. Are there any Python "compilers" out there that can package it all into one standalone .exe file for easier portability? If so or if not, which is the best compiler z0mg!
Any python "compiler" that can statically link the python2x.dll dependency?
0
0
0
875
1,720,893
2009-11-12T09:07:00.000
0
0
1
0
python,dll,compilation,py2exe
1,720,966
4
false
0
0
py2exe can package it all in single executable, without needing any python installation on target system, it may include python2x.dll with it, but for the end user how does it matter
2
0
0
It's my understanding that py2exe can only dynamically link a python2x.dll file. Are there any Python "compilers" out there that can package it all into one standalone .exe file for easier portability? If so or if not, which is the best compiler z0mg!
Any python "compiler" that can statically link the python2x.dll dependency?
0
0
0
875
1,721,037
2009-11-12T09:35:00.000
1
0
0
0
python,django,django-admin
51,260,433
12
false
1
0
I'm using Django 2.x and I think I found best solution, at least for my case. The HTML file to the "Save and Add Another" button is on your_python_installation\Lib\site-packages\django\contrib\admin\templates\admin\subtmit_line.html. Copy that html file and paste to your project like so your_project\templates\admin\su...
1
35
0
Whenever I'm editing object A with a foreign key to object B, a plus option "add another" is available next to the choices of object B. How do I remove that option? I configured a user without rights to add object B. The plus sign is still available, but when I click on it, it says "Permission denied". It's ugly. I'm u...
Remove "add another" in Django admin screen
0.016665
0
0
24,607
1,721,699
2009-11-12T11:55:00.000
6
1
0
1
python,console,twisted
1,721,715
2
false
0
0
Take a look at twisted.manhole
1
5
0
I am developing a twisted server. I need to control the memory usage. It is not a good idea to modify code, insert some memory logging command and restart the server. I think it is better to use a "remote console", so that I can type heapy command and see the response from the server directly. All I need is a remote co...
Is there any "remote console" for twisted server?
1
0
0
1,027
1,721,761
2009-11-12T12:09:00.000
1
0
1
0
asp.net,vb.net,ironpython
1,747,832
2
true
1
0
The code between <script /> tags is compiled dynamically when the page is first run. This enables you to mix languages. However, the classes in your code-behind files are statically compiled into an assembly by VS.NET ... and a VS.NET project can only support one language at a time. One solution is to put your VB.NET c...
1
0
0
I tried to bring a previously done webform made in vb.net to an IronPython asp.net website with no luck. After seeing it didnt work, I tried to write the simplest codebehind vb.net webform to see if there was a problem with vb.net in an IronPython website and I got the following usual error "be sure that the defined c...
VB webform in IronPython asp.net website
1.2
0
0
312
1,722,901
2009-11-12T15:12:00.000
1
0
1
1
python,pythonpath,sys.path
1,722,943
2
false
0
0
You can get the current directory with os.getcwd().
1
1
0
I had always assumed that the first entry in sys.path by default was the current working directory. But as it turns out, on my system the first entry is the path on which the script resides. So if I'm executing a script that's in /usr/bin from /some/directory, the first entry in sys.path is /usr/bin. Is something mi...
Is the first entry in sys.path supposed to represent the current working directory?
0.099668
0
0
550
1,722,993
2009-11-12T15:22:00.000
1
0
0
1
python,udp,communication,daemon,ports
1,723,643
2
false
0
0
I'm pretty sure this is possible on Linux; I don't know about other UNIXes. There are two ways to propagate a file descriptor from one process to another: When a process fork()s, the child inherits all the file descriptors of the parent. A process can send a file descriptor to another process over a "UNIX Domain Socke...
2
0
0
I currently have a small Python script that I'm using to spawn multiple executables, (voice chat servers), and in the next version of the software, the servers have the ability to receive heartbeat signals on the UDP port. (There will be possibly thousands of servers on one machine, ranging from ports 7878 and up) My p...
Multiple programs using the same UDP port? Possible?
0.099668
0
1
5,210
1,722,993
2009-11-12T15:22:00.000
2
0
0
1
python,udp,communication,daemon,ports
1,723,017
2
true
0
0
This isn't possible. What you'll have to do is have one UDP master program that handles all UDP communication over the one port, and communicates with your servers in another way (UDP on different ports, named pipes, ...)
2
0
0
I currently have a small Python script that I'm using to spawn multiple executables, (voice chat servers), and in the next version of the software, the servers have the ability to receive heartbeat signals on the UDP port. (There will be possibly thousands of servers on one machine, ranging from ports 7878 and up) My p...
Multiple programs using the same UDP port? Possible?
1.2
0
1
5,210
1,725,758
2009-11-12T22:07:00.000
0
0
1
0
python
1,725,784
3
false
0
0
Clearly, you must sleep according to real, elapsed time. The alternative (sleeping according to some other clock that "somehow" started and stopped) would be unmanageable. How would your application (which is sleeping) be notified of all this starting and stopping activity? Right, it would have to be woken up to be t...
1
2
0
For example, if I do time.sleep(100) and immediately hibernate my computer for 99 seconds, will the next statement be executed in 1 second or 100 seconds after waking up? If the answer is 1 second, how do you "sleep" 100 seconds, regardless of the length of hibernate/standby?
time.sleep and suspend (ie. standby and hibernate)
0
0
0
2,094
1,727,564
2009-11-13T06:46:00.000
0
0
0
0
python,django,profile,django-forms
1,876,244
7
false
1
0
Why not have two model forms on the back-end and just present them as a single form in your template? Drop the name fields from your UserProfileForm and create a second model form for the user object?
2
25
0
If think my question is pretty obvious and almost every developer working with UserProfile should be able to answer it. However, I could not find any help on the django documentation or in the Django Book. When you want to do a UserProfile form in with Django Forms, you'd like to modify the profile fields as well as so...
How to create a UserProfile form in Django with first_name, last_name modifications?
0
0
0
25,783
1,727,564
2009-11-13T06:46:00.000
0
0
0
0
python,django,profile,django-forms
1,727,895
7
false
1
0
I take it normal that you don't find any information in the docs as you merge two models into a single form. Alternatively and maybe very obviously you can: Create two modelforms, one for the user and the other for the userprofile. Set the userprofile modelform to display only firstname and lastname. Put both forms in...
2
25
0
If think my question is pretty obvious and almost every developer working with UserProfile should be able to answer it. However, I could not find any help on the django documentation or in the Django Book. When you want to do a UserProfile form in with Django Forms, you'd like to modify the profile fields as well as so...
How to create a UserProfile form in Django with first_name, last_name modifications?
0
0
0
25,783
1,727,594
2009-11-13T06:56:00.000
0
1
0
0
c++,python,embedded,playstation
1,727,732
4
false
0
1
Consider storing your data as BLOBs in a SQLite DB. SQLite is extremely portable and lighweight, ANSI C, has both C++ and Python interfaces. This will take care of large files, no fragmentation, variable-length records with fast access, and so on. The rest is just serialization of structs to these BLOBs.
3
3
0
I need to load large models and other structured binary data on an older CD-based game console as efficiently as possible. What's the best way to do it? The data will be exported from a Python application. This is a pretty elaborate hobby project. Requierements: no reliance on fully standard compliant STL - i might us...
Optimal datafile format loading on a game console
0
0
0
270
1,727,594
2009-11-13T06:56:00.000
3
1
0
0
c++,python,embedded,playstation
1,728,074
4
false
0
1
I note that nowhere in your description do you ask for "ease of programming". :-) Thus, here's what comes to mind for me as a way of creating this: The data should be in the same on-disk format as it would be in the target's memory, such that it can simply pull blobs from disk into memory with no reformatting it. De...
3
3
0
I need to load large models and other structured binary data on an older CD-based game console as efficiently as possible. What's the best way to do it? The data will be exported from a Python application. This is a pretty elaborate hobby project. Requierements: no reliance on fully standard compliant STL - i might us...
Optimal datafile format loading on a game console
0.148885
0
0
270
1,727,594
2009-11-13T06:56:00.000
4
1
0
0
c++,python,embedded,playstation
1,728,071
4
false
0
1
On platforms like the Nintendo GameCube and DS, 3D models are usually stored in a very simple custom format: A brief header, containing a magic number identifying the file, the number of vertices, normals, etc., and optionally a checksum of the data following the header (Adler-32, CRC-16, etc). A possibly compressed l...
3
3
0
I need to load large models and other structured binary data on an older CD-based game console as efficiently as possible. What's the best way to do it? The data will be exported from a Python application. This is a pretty elaborate hobby project. Requierements: no reliance on fully standard compliant STL - i might us...
Optimal datafile format loading on a game console
0.197375
0
0
270
1,727,950
2009-11-13T08:43:00.000
1
0
0
0
python,c,numpy,gesture-recognition
1,730,684
3
false
0
0
I think the answer depends on three things: how well you code in Matlab, how well you code in Python/Numpy, and your algorithm. Both Matlab and Python can be fast for number crunching if you're diligent about vectorizing everything and using library calls. If your Matlab code is already very good I would be surprised ...
1
2
1
i 'm just finish labs meeting with my advisor, previous code is written in matlab and it run offline mode not realtime mode, so i decide to convert to python+numpy (in offline version) but after labs meeting, my advisor raise issue about speed of realtime recognition, so i have doubt about speed of python+numpy to do t...
Just Curious about Python+Numpy to Realtime Gesture Recognition
0.066568
0
0
914
1,728,266
2009-11-13T09:55:00.000
0
0
0
0
java,python,sockets
1,728,302
4
false
0
0
High-level on one side and raw binary sockets on the other won't work. Sorry, but you'll need to go low-level on the server side too. EDIT: in response to the OP's comment. I am not aware of any "high level" interface of the nature that you are talking about for Java. And frankly I don't think it makes a lot of sens...
1
10
0
In short I'm creating a Flash based multiplayer game and I'm now starting to work on the server-side code. Well I'm the sole developer of the project so I'm seeking a high-level socket library that works well with games to speed up my development time. I was trying to use the Twisted Framework (for Python) but I'm hav...
Seeking a High-Level Library for Socket Programming (Java or Python)
0
0
1
8,269
1,728,330
2009-11-13T10:13:00.000
0
0
0
1
python,linux,process,subprocess
1,728,361
7
false
0
0
I do not think you can do this portably in the general case. You need to get this information from the process list (e.g. through the ps command), which is obtained in a system-specific way.
1
7
0
How can i get process id of the current process's parent? In general given a process id how can I get its parent process id? e.g. os.getpid() can be used to get the proccess id, and os.getppid() for the parent, how do I get grandparent, My target is linux(ubuntu) so platform specific answers are ok.
How to get process's grandparent id
0
0
0
14,912
1,728,350
2009-11-13T10:18:00.000
1
0
0
0
python,linux,performance,postgresql,out-of-memory
1,729,623
2
false
0
0
This sounds a bit like your DB server might have some problems, especially if your database server literally crashes. I'd start by trying to figure out from logs what is the root cause of the problems. It could be something like running out of memory, but it could also happen because of faulty hardware. If you're openi...
1
2
0
I'm writing an application in Python with Postgresql 8.3 which runs on several machines on a local network. All machines 1) fetch huge amount of data from the database server ( lets say database gets 100 different queries from a machine with in 2 seconds time) and there are about 10 or 11 machines doing that. 2) After ...
Optimal / best pratice to maintain continuos connection between Python and Postgresql using Psycopg2
0.099668
1
0
1,607
1,729,791
2009-11-13T15:09:00.000
1
1
1
0
c#,.net,unit-testing,ironpython
1,731,244
10
false
0
0
I agree with the other answers that there are disadvantages, but I'm surprised that so few have talked about advantages. TDD'ing across languages is a great way to learn new languages: write the tests in a language you know well, and the implementation in the language you are learning. As you are learning, you will di...
9
10
0
Unit tests have different requirements than production code. For example, unit tests may not have to be as performant as the production code. Perhaps it sometimes makes sense to write your unit tests in a language that is better suited to writing unit tests? The specific example I have in mind is writing an application...
What are the (dis)advantages of writing unit tests in a different language to the code?
0.019997
0
0
1,494
1,729,791
2009-11-13T15:09:00.000
2
1
1
0
c#,.net,unit-testing,ironpython
1,730,103
10
false
0
0
I think that this is an excellent question and an idea worthy of consideration - particularly in an environment like Visual Studio/.NET where this is easily supported The plus side - as you suggest - is that you can choose to use a language/tool to create tests that is more suited to creating tests than perhaps the cod...
9
10
0
Unit tests have different requirements than production code. For example, unit tests may not have to be as performant as the production code. Perhaps it sometimes makes sense to write your unit tests in a language that is better suited to writing unit tests? The specific example I have in mind is writing an application...
What are the (dis)advantages of writing unit tests in a different language to the code?
0.039979
0
0
1,494
1,729,791
2009-11-13T15:09:00.000
1
1
1
0
c#,.net,unit-testing,ironpython
1,729,896
10
false
0
0
The biggest disadvantage is that you are also testing compiler dependencies in your unit tests. In a sense, this also makes them integration tests. That might make them preferable if you expect your code to be usable from multiple languages, but it's adding one level of complexity that you may not need if your code w...
9
10
0
Unit tests have different requirements than production code. For example, unit tests may not have to be as performant as the production code. Perhaps it sometimes makes sense to write your unit tests in a language that is better suited to writing unit tests? The specific example I have in mind is writing an application...
What are the (dis)advantages of writing unit tests in a different language to the code?
0.019997
0
0
1,494
1,729,791
2009-11-13T15:09:00.000
1
1
1
0
c#,.net,unit-testing,ironpython
1,729,874
10
false
0
0
When building an API or library, I often deliver unit tests as a form of documentation on how best to use the API or library. Most of the time I build a C# library, I'm delivering to a client who will be writing C# code to use the library. For documentation sake, at least some of my tests will always be written in the...
9
10
0
Unit tests have different requirements than production code. For example, unit tests may not have to be as performant as the production code. Perhaps it sometimes makes sense to write your unit tests in a language that is better suited to writing unit tests? The specific example I have in mind is writing an application...
What are the (dis)advantages of writing unit tests in a different language to the code?
0.019997
0
0
1,494
1,729,791
2009-11-13T15:09:00.000
1
1
1
0
c#,.net,unit-testing,ironpython
1,729,838
10
false
0
0
The biggest tradeoff would be if someone was looking at using Unit Tests to figure out how a certain action may be performed, writing it in a different language would make it harder to use. Also you would have to make your C# code CLS compliant.
9
10
0
Unit tests have different requirements than production code. For example, unit tests may not have to be as performant as the production code. Perhaps it sometimes makes sense to write your unit tests in a language that is better suited to writing unit tests? The specific example I have in mind is writing an application...
What are the (dis)advantages of writing unit tests in a different language to the code?
0.019997
0
0
1,494
1,729,791
2009-11-13T15:09:00.000
0
1
1
0
c#,.net,unit-testing,ironpython
9,560,983
10
false
0
0
Experience 1 In the past year I worked on a project that had two main pieces: A Grails web application and a Java Swing application we wrote our Java unit tests using Groovy and it worked out well. Unit testing with groovy took a lot less time verbosity wise and also made it possible to fake static methods and so for...
9
10
0
Unit tests have different requirements than production code. For example, unit tests may not have to be as performant as the production code. Perhaps it sometimes makes sense to write your unit tests in a language that is better suited to writing unit tests? The specific example I have in mind is writing an application...
What are the (dis)advantages of writing unit tests in a different language to the code?
0
0
0
1,494
1,729,791
2009-11-13T15:09:00.000
7
1
1
0
c#,.net,unit-testing,ironpython
1,729,848
10
false
0
0
One obvious potential problem is a confusing debugging experience. I haven't personally tried to debug across languages in .NET - what happens if you step into C# code from IronPython? The other problem is that anyone wanting to develop on your code base has to know both languages.
9
10
0
Unit tests have different requirements than production code. For example, unit tests may not have to be as performant as the production code. Perhaps it sometimes makes sense to write your unit tests in a language that is better suited to writing unit tests? The specific example I have in mind is writing an application...
What are the (dis)advantages of writing unit tests in a different language to the code?
1
0
0
1,494
1,729,791
2009-11-13T15:09:00.000
11
1
1
0
c#,.net,unit-testing,ironpython
1,729,849
10
true
0
0
Disadvantages that come to my mind: Depending on the language, you need another development environment (additional dependency of the project, additional effort to setup a development machine, additional licenses, additional training ...) Refactoring is sometimes supported by the IDE - but most probably not for this o...
9
10
0
Unit tests have different requirements than production code. For example, unit tests may not have to be as performant as the production code. Perhaps it sometimes makes sense to write your unit tests in a language that is better suited to writing unit tests? The specific example I have in mind is writing an application...
What are the (dis)advantages of writing unit tests in a different language to the code?
1.2
0
0
1,494
1,729,791
2009-11-13T15:09:00.000
2
1
1
0
c#,.net,unit-testing,ironpython
1,729,845
10
false
0
0
Main disadvantage as I see it is maintainablity. If you code in C#, your development team are competent in that language, as will new hires be. You need a multi-functional dev team. I think that it's also worth noting that you probably don't want people writing their tests in a language that is maybe not their strong...
9
10
0
Unit tests have different requirements than production code. For example, unit tests may not have to be as performant as the production code. Perhaps it sometimes makes sense to write your unit tests in a language that is better suited to writing unit tests? The specific example I have in mind is writing an application...
What are the (dis)advantages of writing unit tests in a different language to the code?
0.039979
0
0
1,494
1,731,025
2009-11-13T18:30:00.000
6
0
1
0
python
1,731,044
6
false
0
0
I'm not american, but this works with russian phone numbers... maybe it applies to american ones too? Discard all non-number characters Validate amount of the numbers left Insert several dashes in appropriate places
1
0
0
I'm reading in lots of user entered data that represent phone numbers from files. They are all slightly entered in differently: 5555555555 555-555-5555 555-555/5555 1555-555-5555 etc... How could I easily parse in all of these phone numbers in Python and produce a canonical output like: 555-555-5555?
Python code to accept many different formats of US phone numbers?
1
0
0
1,409
1,731,102
2009-11-13T18:47:00.000
0
0
1
0
python,string
1,731,133
6
false
0
0
12340 is not any data (in sense that there are much bigger data to process on the market). Even better approach would use build in sqlite module. If not use some simple format like CSV for example. This is a structure organized. If not use threads, you could process two files simultaneously.
1
4
0
I have information about 12340 cars. This info is stored sequentially in two different files: car_names.txt, which contains one line for the name of each car car_descriptions.txt, which contains the descriptions of each car. So 40 lines for each one, where the 6th line reads @CAR_NAME I would like to do in python: to...
Process two files at the same time in Python
0
0
0
9,121
1,731,986
2009-11-13T21:18:00.000
0
0
1
0
python,tkinter
1,731,994
2
false
0
0
Can you be more specific? This could be done in pygame, but you'd need to open a graphical window.
1
0
0
First thought of implementing this using threads but python doesnt have a way for killing threads. I have read the other topic on killing threads. Is there any proper platform independent way of doing this?
How to play sound till the user hits a key?
0
0
0
234
1,732,452
2009-11-13T23:03:00.000
2
0
0
0
python,django,rest
1,791,400
6
false
1
0
Regarding your comment about not liking 3rd party code - that's too bad because the pluggable apps are one of django's greatest features. Like others answered, piston will do most of the work for you.
2
10
0
I'm looking for an excuse to learn Django for a new project that has come up. Typically I like to build RESTful server-side interfaces where a URL maps to resources that spits out data in some platform independent context, such as XML or JSON. This is rather straightforward to do without the use of frameworks, but som...
Django ease of building a RESTful interface
0.066568
0
0
6,277
1,732,452
2009-11-13T23:03:00.000
1
0
0
0
python,django,rest
1,732,636
6
false
1
0
A little over a year ago, I wrote a REST web service in Django for a large Seattle company that does streaming media on the Internet. Django was excellent for the purpose. As "a paid nerd" observed, the Django URL config is wonderful: you can set up your URLs just the way you want them, and have it serve up the approp...
2
10
0
I'm looking for an excuse to learn Django for a new project that has come up. Typically I like to build RESTful server-side interfaces where a URL maps to resources that spits out data in some platform independent context, such as XML or JSON. This is rather straightforward to do without the use of frameworks, but som...
Django ease of building a RESTful interface
0.033321
0
0
6,277
1,732,761
2009-11-14T00:30:00.000
2
1
1
0
python,png
1,732,962
2
true
0
1
Getting data out of a PNG requires unpacking data and decompressing it. These are likely going to be too slow in Python for your application. One possibility is to start with PyPNG and get rid of anything in it that you don't need. For example, it is probably storing all of the data it reads from the PNG, and some o...
1
1
0
I am having an issue with an embedded 64bit Python instance not liking PIL. Before i start exhausting more methods to get a compiled image editor to read the pixels for me (such as ImageMagick) i am hoping perhaps anyone here can think of a purely Python solution that will be comparable in speeds to the compiled counte...
Reading Alpha of a PNG Pixel. Fast way via pure Python?
1.2
0
0
955
1,732,935
2009-11-14T01:36:00.000
9
0
0
0
python,pyqt,screenshot,fullscreen
1,733,241
2
true
0
1
Passing QtCore.Qt.FramelessWindowHint to the QWidget constructor in symphony with self.showFullScreen() in the image widget's code achieves this.
1
4
0
I'm using PyQt to capture my screen with QPixmap.grabWindow(QApplication.desktop().winId()) and I was wondering if there was a way I could display my screengrab fullscreen (no window borders, etc.) I'm trying to find a way to desaturate my display with PyQt
PyQt display fullscreen image
1.2
0
0
3,562
1,732,957
2009-11-14T01:49:00.000
5
0
0
1
python,networking,udp,twisted,multiplayer
1,732,990
2
true
0
0
It's almost certainly a reasonable protocol to start with. Remember the cardinal rule of optimization: don't do it. Working with any TCP-based protocol is going to be considerably easier than working with any UDP-based protocol. This is initially much more important to the success of your project than whether it tak...
1
2
0
Do you think that Twisted Spread may be suitable (in terms of performance) for a multiplayer racing simulator? The rest of the application is based on Python-Ogre. Can Perspective Broker run upon (reliable?) UDP?
Twisted Spread suitable for multiplayer racing sim?
1.2
0
0
708
1,733,364
2009-11-14T05:23:00.000
1
0
1
1
python,ubuntu,installation
1,733,409
4
false
0
0
Sounds like they're an accident from some package(s) you have installed. The Python version in use determines the locations searched to find installed Python packages/modules, and the "system version" of Python in Ubuntu 9.10 is 2.6, so that's what practically everything should be using. If you were to install the pyt...
1
3
0
In ubuntu 9.10, in usr/lib/ there are the directories python2.4, python2.5, python2.6 and python3.0 Only python 2.6 is actually working. python2.4 has only a lib-dynload directory, python2.5 has only lib-dynload and site-packages, python3.0 has only a dist-packages directory. Now i'm wondering what is the idea behin...
ubuntu9.10 : how to use python's lib-dynload and site-packages directories?
0.049958
0
0
10,075
1,733,619
2009-11-14T07:42:00.000
24
0
1
0
python,key-value-store
1,733,720
7
false
0
0
It all depends on the level of complexity you want to dive into. Starting with a simple Python dict serialized to a file in a myriad of possible ways (of which pickle is probably the simplest), you can go as far as implementing a complete database system. Look up redis - it's a key/value store written in C and operatin...
1
13
0
I am looking to write a Key/value store (probably in python) mostly just for experience, and because it's something I think that is a very useful product. I have a couple of questions. How, in general, are key/value pairs normally stored in memory and on disk? How would one go about loading the things stored on disk, b...
Writing a key-value store
1
0
0
6,016
1,734,373
2009-11-14T14:30:00.000
5
0
1
0
python,distribution,setuptools,distribute
1,738,049
2
true
0
0
I've change that behavior in Distutils (in Python trunk (2.7/3.2) ) Now all files mentioned in package_data will be included by default without having to write a MANIFEST.in file, and without having to use the magic behavior based on DVCS. Until then, I would recommend using an explicit MANIFEST.in and stick with pla...
1
2
0
I'm trying to use Distribute for my project's setup.py. I want it to include all the files in the package folder, which are text and image files, but not .pyc files of course. I read that the files should either be tracked by CVS and SVN, or there should be a MAINFEST.in. So: I use neither CVS nor SVN, I use git. I kn...
Including package data with Distribute
1.2
0
0
415
1,734,575
2009-11-14T15:34:00.000
2
0
0
0
python,screen,buffer
1,737,577
2
false
0
1
Instead of "graying out" the desktop, try to overlay a gray, semi-transparent image over the entire screen and then make sure your window is on top of that. You may face a couple of minor limitations; for example, I don't know off the top of my head if it's possible to overlay the mac menubar (and I'm not sure you'd wa...
1
1
0
I know this is a long shot, but I was wondering if Python had a way to manipulate the screen buffer. Specifically, I want to be able to gray-out my desktop and highlight my windows when I press a key combination. Is this in the realm of possibility?
Manipulate screen buffer in python
0.197375
0
0
1,923
1,734,918
2009-11-14T17:22:00.000
1
0
0
0
python,mysql,django,macos,xampp
1,734,939
1
true
1
0
You could change the listening port of one of the installations and they shouldn't conflict anymore with each other. Update: You need to find the mysql configuration file my.cnf of the server which should get a new port (the one from xampp should be somewhere in the xampp folder). Find the line port=3306 in the [mysqld...
1
0
0
i recently switched to mac. first and foremost i installed xampp. then for django-python-mysql connectivity, i "somehow" ended up installing a seperate MySQL. now the seperate mysql installation is active all the time and the Xampp one doesnt switch on unless i kill the other one. what i wanted to know is it possible t...
2 mysql instances in MAC
1.2
1
0
150
1,735,109
2009-11-14T18:18:00.000
7
0
1
1
python,eclipse,macos
1,735,193
4
false
0
0
Running $which python should help locate your Python installation.
2
10
0
How do I direct Eclipse to the Python interpreter on my Mac? I've looked in Library which contains the directory 'Python' then '2.3' and '2.5', however they contain nothing except 'Site-packages' - Which is weird considering I can go into the terminal and type python. I then installed the latest 2.6 version with packag...
Setting Python Interpreter in Eclipse (Mac)
1
0
0
20,985
1,735,109
2009-11-14T18:18:00.000
7
0
1
1
python,eclipse,macos
1,735,148
4
true
0
0
An alias to the python interpreter was likely installed into /usr/local/bin. So, to invoke python2.6, type /usr/local/bin/python2.6 or, most likely, just python2.6. If you want python to invoke python2.6, try rearranging your $PATH so that /usr/local/bin precedes /usr/bin.
2
10
0
How do I direct Eclipse to the Python interpreter on my Mac? I've looked in Library which contains the directory 'Python' then '2.3' and '2.5', however they contain nothing except 'Site-packages' - Which is weird considering I can go into the terminal and type python. I then installed the latest 2.6 version with packag...
Setting Python Interpreter in Eclipse (Mac)
1.2
0
0
20,985
1,735,561
2009-11-14T20:52:00.000
5
0
1
0
python,code-golf,shuffle
1,735,584
11
false
0
0
After shuffling the list of numbers, let the [i]th person write a poem (and buy a present!) for the [i+1]th person in the list: that way, there can never be someone who draws him- or herself. Of course, the last one should point to the first...
1
2
0
It's that time of year again that programmers want to shuffle a list such that no element resides on its original position (at least in the Netherlands, we celebrate Sinterklaas and pick straws for deciding who writes who a poem). Does anyone have a nice Python single statement for that? So, input example: range(10) Ou...
oneliner scramble program
0.090659
0
0
936
1,736,348
2009-11-15T02:20:00.000
1
0
1
0
python,diff
1,736,587
3
false
0
0
Also, the SequenceMatcher class (from the Python standard library) can be helpful. Check out the other contents of the difflib module as well.
1
4
0
I'm trying to use bsdiff (or any binary diff implementation you come up with) to compute and apply diff onto random binary data. I would like to use it on data from a database, so it would be better not to have to write those onto disk and pass them to bsdiff.exe. Is there any wrapper library or way in python to do tha...
Python binary diff
0.066568
0
0
6,993
1,736,451
2009-11-15T03:19:00.000
0
0
1
1
python,macos,ide,editor,python-idle
4,642,775
12
false
0
0
going to vote for Fraise. handles almost anything, has indentations, and uses color! its free too.
6
2
0
I'm currently using IDLE, its decent, but I'd like to know if there're better lightweight IDEs built especially for Mac — free or commercial.
Native Python Editor for Mac?
0
0
0
9,940
1,736,451
2009-11-15T03:19:00.000
0
0
1
1
python,macos,ide,editor,python-idle
1,736,831
12
false
0
0
vim, emacs, BBEdit, WingIDE, or my favorite - eclipse (although, I don't think this is very lightweight)
6
2
0
I'm currently using IDLE, its decent, but I'd like to know if there're better lightweight IDEs built especially for Mac — free or commercial.
Native Python Editor for Mac?
0
0
0
9,940