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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,853,113 | 2010-05-17T21:50:00.000 | 1 | 0 | 1 | 0 | python | 2,853,156 | 4 | false | 0 | 0 | Why not convert your keys to strings? Numeric keys should be pretty easy to do this with. | 3 | 0 | 0 | The python shelf module only seems to be allow string keys. Is there a way to use arbitrary typed (e.g. numeric) keys? May be an sqlite-backed dictionary?
Thanks! | Database-backed dictionary with arbitrary keys | 0.049958 | 0 | 0 | 257 |
2,853,113 | 2010-05-17T21:50:00.000 | 0 | 0 | 1 | 0 | python | 2,853,190 | 4 | false | 0 | 0 | I think you want to overload the [] operator. You can do it by defining the __getitem__ method. | 3 | 0 | 0 | The python shelf module only seems to be allow string keys. Is there a way to use arbitrary typed (e.g. numeric) keys? May be an sqlite-backed dictionary?
Thanks! | Database-backed dictionary with arbitrary keys | 0 | 0 | 0 | 257 |
2,853,113 | 2010-05-17T21:50:00.000 | 1 | 0 | 1 | 0 | python | 2,854,741 | 4 | false | 0 | 0 | You can serialize on the fly (via pickle or cPickle, like shelve.py does) every key, as well as every value. It's not really worth subclassing shelve.Shelf since you'd have to subclass almost every method -- for once, I'd instead recommend copying shelve.py into your own module and editing it to suit. That's basicall... | 3 | 0 | 0 | The python shelf module only seems to be allow string keys. Is there a way to use arbitrary typed (e.g. numeric) keys? May be an sqlite-backed dictionary?
Thanks! | Database-backed dictionary with arbitrary keys | 0.049958 | 0 | 0 | 257 |
2,853,553 | 2010-05-17T23:09:00.000 | 0 | 0 | 1 | 0 | python | 2,983,016 | 5 | false | 0 | 0 | As far as I know, this doesn't exist. I'm hoping to start working on something similar later this year. | 2 | 3 | 0 | I'm not sure if there is even anything out there to do this. Is there any libraries out there that can reword sentences to any degree of accuracy? It doesnt have to be too intelligent. | Rewording/rephrasing english in python | 0 | 0 | 0 | 2,523 |
2,853,553 | 2010-05-17T23:09:00.000 | 0 | 0 | 1 | 0 | python | 2,855,551 | 5 | false | 0 | 0 | You can use the wordnet package to find synonyms with the same 'sense' for nouns and verbs.
But this will be a lot dumber than you want. You're looking for like, machine translation from casual english to formal english. Tough question and cool. Props to you. | 2 | 3 | 0 | I'm not sure if there is even anything out there to do this. Is there any libraries out there that can reword sentences to any degree of accuracy? It doesnt have to be too intelligent. | Rewording/rephrasing english in python | 0 | 0 | 0 | 2,523 |
2,853,708 | 2010-05-17T23:42:00.000 | 0 | 0 | 1 | 0 | python,tkinter | 2,853,858 | 1 | true | 0 | 1 | You can add buttons dynamically just fine, nothing is forcing you into the listbox. That said, I don't know why you care so much about "prettiness" since you're using Tkinter, which is very ugly by default. | 1 | 1 | 0 | I was working on a program,that I need to support new additions. Hmmm. Let me give you some background on the program.
It is an educational software program that has quizzes for the user to take, just to gain odd knowledge. Now, It currently supports 6 subjects, all organized with directores on the HDD ( i.e. the Scien... | Automatically support new changes with Python | 1.2 | 0 | 0 | 72 |
2,853,933 | 2010-05-18T00:40:00.000 | 0 | 0 | 0 | 0 | python,windows,random,tkinter,button | 2,864,899 | 2 | false | 0 | 1 | There are several options to choose from. For example, you could design on a grid where you have six buttons per row. Then it's just a matter of starting at row 0, incrementing the column for each button. When you get to the last column, reset the column to 0 and increment the row by one.
Another option is to use a tex... | 1 | 0 | 0 | How do I randomly add buttons to a Tkinter GUI? I need it to be able to create a button, then put it anywhere on the window, is this possible? I am using Python 2.6 on Windows. | Randomly add buttons to Tkinter GUI? | 0 | 0 | 0 | 1,244 |
2,855,326 | 2010-05-18T07:44:00.000 | 13 | 1 | 0 | 0 | python,encryption,rsa | 2,856,628 | 1 | true | 0 | 0 | Chaining mode such as ECB makes no sense for RSA, unless you are doing it wrong.
ECB is for block ciphers: the input data is split into equal-size blocks, and each block is encrypted separately. This induces some weaknesses so ECB mode is best avoided for block ciphers.
RSA is not a block cipher. In particular, RSA nec... | 1 | 6 | 0 | I am struggling to find any method of using RSA in ECB mode with PKCS1 padding in python. I've looked into pyCrypto, but they don't have PKCS1 padding in the master branch (but do in a patch). Nevertheless I found RSA with PKCS1 in the M2Crypto package, but I'm not sure if I can choose ECB mode... | How can I create a key using RSA/ECB/PKCS1Padding in python? | 1.2 | 0 | 0 | 9,374 |
2,855,378 | 2010-05-18T07:52:00.000 | 10 | 1 | 1 | 0 | python,emacs,ide,autocomplete | 2,858,148 | 4 | false | 0 | 0 | You can set the root folder with rope-open-project . Once you've set the root project a .ropeproject dir will be created.
Inside it, a config.py file has hooks where you can run (python) code once the project is set. The project_opened(project): function is a good place to run code. I usually activate the virtual envi... | 1 | 78 | 0 | There are many sites with instructions on installing ropemacs, but so far I couldn't find any with instructions on how to use it after it's already installed. I have it installed, or at least it seems so, Emacs has "Rope" menu in it's top menu bar. Now what? So far I could use only "Show documentation" (C-c d by defaul... | ropemacs USAGE tutorial | 1 | 0 | 0 | 18,010 |
2,855,650 | 2010-05-18T08:34:00.000 | 1 | 1 | 0 | 0 | python,fabric | 2,857,218 | 1 | false | 1 | 0 | This is what ssh-copy-id is for. It deploys your public key onto a machine for you. Key management isn't something I'd suggest putting into code/VCS. Each user needs to setup their keys so that the local ssh client knows to use them. We use Fabric as well, but it only uses the key that the ssh config is already telling... | 1 | 0 | 0 | How do you guys deploy your code on your servers? I am using Fabric and Python and I would like a more automated way of pulling code from the repository through the use of public keys, but without any ops or manual intervention to set up the public keys.
Are you storing them in the code as text or in a database and gen... | deployment public keys | 0.197375 | 0 | 0 | 212 |
2,856,356 | 2010-05-18T10:30:00.000 | 1 | 0 | 0 | 0 | python,django,telnet,telnetlib | 2,856,596 | 1 | true | 0 | 0 | The usual way would be to have a process running in the background that keeps hold of the persistent telnet connections and commands queued to go down them.
Then have the front-end scripts connect to it (eg. via a unix socket) to queue commands and get the results asynchronously.
But this might be overkill. How many pe... | 1 | 0 | 0 | I am programming web interface which communicates with cisco switches via telnet. I want to make such system which will be storing one telnet connection per switch and every script (web interface, cron jobs, etc.) will have access to it. This is needed to make a single query queue for each device and prevent huge cisco... | Python (Django). Store telnet connection | 1.2 | 0 | 1 | 1,334 |
2,856,403 | 2010-05-18T10:40:00.000 | 1 | 0 | 0 | 0 | python,django,mod-wsgi | 2,856,435 | 1 | true | 1 | 0 | In embedded mode, the Django app is part of the httpd worker. In daemon mode, the Django app is a separate process and the httpd worker communicates with it over a socket. In either case, the WSGI interface is the same. | 1 | 1 | 0 | When you use Django with mod_wsgi, what exactly happens when a user makes a request to the server from a browser? Does apache load up your Django app when it starts and have it running in a separate process? Does it create a new Python process for every HTTP request? | Using Django with mod_wsgi | 1.2 | 0 | 0 | 189 |
2,857,273 | 2010-05-18T12:40:00.000 | 2 | 1 | 0 | 0 | python,ssl,wsgi,gevent | 2,857,301 | 3 | false | 1 | 0 | I would let the http server deal with the ssl transport. | 1 | 5 | 0 | I have a WSGI app that I would like to place behind SSL. My WSGI server is gevent.
What would a good way to serve the app through SSL in this case be? | SSL and WSGI apps - Python | 0.132549 | 0 | 0 | 7,474 |
2,857,634 | 2010-05-18T13:24:00.000 | 0 | 0 | 0 | 0 | python,xml,user-interface,gtk,glade | 2,857,711 | 4 | false | 0 | 1 | I don't recommend doing a GUI in XML. All the XML does is give you a mini language for describing a layout. Why use a mini language when you can have the full power of python?
As for detecting GTK, I wouldn't suggest that. Instead, add a command line argument to determine whether to create a GUI or not (eg: myprogram -... | 1 | 2 | 0 | I am trying to write an app in python to control a motor using serial. This all works in a CLI situation fine and is generally stable. but I was wondering how simple it was to add a GUI on top of this code base?
I assume there will be more code, but is there a simple way of detecting something like GTK, so it only appl... | How can I create a GUI on top of a Python APP so it can do either GUI or CLI? | 0 | 0 | 0 | 1,570 |
2,858,040 | 2010-05-18T14:14:00.000 | 2 | 0 | 0 | 0 | python,django,permissions,inlines | 3,090,090 | 1 | true | 1 | 0 | If I want a read-only version of what's in the admin, I just write some normal Django views and keep them out of the admin.
I don't think the kind of thing you're talking about (allowing changes to an object but not its inlines) is really supported by the admin. Don't get me wrong: the admin is very flexible and usefu... | 1 | 9 | 0 | I'm not sure if this is a bug or I'm just missing something (although I have already parsed the documentation about inlines), but:
Let's say I have a model A. Model A is an inline of model B. User U has full access to model B, but only change permissions to model A (so, no add, nor delete).
However, when editing model ... | Django Inlines user permissions + view only - permissions issues | 1.2 | 0 | 0 | 1,938 |
2,859,413 | 2010-05-18T17:06:00.000 | 8 | 0 | 0 | 0 | python,packaging,zipapp | 2,861,524 | 1 | true | 0 | 1 | I figured out by myself, It's sufficient to use pkgutil.get_data to access the data inside a package. | 1 | 4 | 0 | I'm doing a little program and I want to distribute it using this recipe:
single directory with __main__.py in it
zip this directory and adding a shebang on it #!/usr/bin/env python
making it executable
The problem is that in this package I have also extra files (I'm using pygtk toolkit and I need images and ui xml f... | Distributing an executable zip file with __main__.py, how to access extra data? | 1.2 | 0 | 0 | 2,816 |
2,860,106 | 2010-05-18T18:50:00.000 | 2 | 0 | 1 | 0 | python,oop | 2,860,167 | 4 | false | 0 | 0 | Of course. There is no need to create a base class or an interface in this case either, as everything is dynamic. | 2 | 6 | 0 | Would it be possible to create a class interface in python and various implementations of the interface.
Example: I want to create a class for pop3 access (and all methods etc.). If I go with a commercial component, I want to wrap it to adhere to a contract.
In the future, if I want to use another component or code m... | Creating an interface and swappable implementations in python | 0.099668 | 0 | 0 | 985 |
2,860,106 | 2010-05-18T18:50:00.000 | 0 | 0 | 1 | 0 | python,oop | 2,860,130 | 4 | false | 0 | 0 | Yes, this is possible. There are typically no impediments to doing so: just keep a stable API and change how you implement it. | 2 | 6 | 0 | Would it be possible to create a class interface in python and various implementations of the interface.
Example: I want to create a class for pop3 access (and all methods etc.). If I go with a commercial component, I want to wrap it to adhere to a contract.
In the future, if I want to use another component or code m... | Creating an interface and swappable implementations in python | 0 | 0 | 0 | 985 |
2,860,339 | 2010-05-18T19:17:00.000 | 4 | 0 | 1 | 0 | python,random,set,shuffle | 2,860,358 | 5 | false | 0 | 0 | No, you can not rely on it for any real statistical purpose. The implementation of sets in Python is in terms of a hash table, and can cause the element distribution to display some very non-random properties. There's a large gap between "not having a guaranteed order" and "guaranteed to be unordered in a uniform-rando... | 3 | 18 | 0 | I'd like to know if the absence of element ordering of the Python's built-in set structure is "random enough". For instance, taking the iterator of a set, can it be considered a shuffled view of its elements?
(If it matters, I'm running Python 2.6.5 on a Windows host.) | Can Python's set absence of ordering be considered random order? | 0.158649 | 0 | 0 | 4,167 |
2,860,339 | 2010-05-18T19:17:00.000 | 4 | 0 | 1 | 0 | python,random,set,shuffle | 2,860,554 | 5 | false | 0 | 0 | Arbitrariness is central when designing programs, each of these freedoms that you reserve is like a joker card that you can use when you implement, develop, or rewrite your program. The more of these free-cards you collect, the more efficiency can you deliver from your code (probably), since you have more freedom to ch... | 3 | 18 | 0 | I'd like to know if the absence of element ordering of the Python's built-in set structure is "random enough". For instance, taking the iterator of a set, can it be considered a shuffled view of its elements?
(If it matters, I'm running Python 2.6.5 on a Windows host.) | Can Python's set absence of ordering be considered random order? | 0.158649 | 0 | 0 | 4,167 |
2,860,339 | 2010-05-18T19:17:00.000 | 34 | 0 | 1 | 0 | python,random,set,shuffle | 2,860,350 | 5 | true | 0 | 0 | No, it is not random. It is "arbitrarily ordered", which means that you cannot depend on it being either ordered or random. | 3 | 18 | 0 | I'd like to know if the absence of element ordering of the Python's built-in set structure is "random enough". For instance, taking the iterator of a set, can it be considered a shuffled view of its elements?
(If it matters, I'm running Python 2.6.5 on a Windows host.) | Can Python's set absence of ordering be considered random order? | 1.2 | 0 | 0 | 4,167 |
2,860,386 | 2010-05-18T19:25:00.000 | 2 | 0 | 0 | 1 | python,emacs | 2,884,416 | 3 | false | 0 | 0 | You should look into the other shell modes. TERM-MODE and ANSI-MODE. I believe they can support interactive command line programs. | 2 | 5 | 0 | If I use M-x shell and run the interactive Python interpreter, Emacs on Windows does not return any IO.
When I discovered M-x python-shell, I regained hope. However, instead of running the interactive Python shell, I want to run a specific Python script that features an interactive CLI. (See Python's cmd module for d... | How do I run an interactive command line Python app inside of Emacs on Win32? | 0.132549 | 0 | 0 | 820 |
2,860,386 | 2010-05-18T19:25:00.000 | -1 | 0 | 0 | 1 | python,emacs | 21,938,935 | 3 | false | 0 | 0 | You can run python in interactive mode by typing python.exe -i
Alternatively, you can download ipython and just run ipython.exe | 2 | 5 | 0 | If I use M-x shell and run the interactive Python interpreter, Emacs on Windows does not return any IO.
When I discovered M-x python-shell, I regained hope. However, instead of running the interactive Python shell, I want to run a specific Python script that features an interactive CLI. (See Python's cmd module for d... | How do I run an interactive command line Python app inside of Emacs on Win32? | -0.066568 | 0 | 0 | 820 |
2,860,650 | 2010-05-18T19:58:00.000 | 0 | 0 | 0 | 0 | python,qt,pyqt,process,jython | 2,861,467 | 2 | false | 1 | 1 | If the criteria is not reinventing the wheel, there is the SimpleXMLRPCServer and xmlrpclib modules available in the standard library. They should work in Jython too. | 1 | 3 | 0 | I am about to begin a project where I will likely use PyQt or Pyside.
I will need to interface with a buggy 3rd party piece of server software that provides C++ and Java APIs. The Java APIs are a lot easier to use because you get Exceptions where with the C++ libraries you get segfaults. Also, the Python bindings to ... | Integrating Jython Cpython | 0 | 0 | 0 | 1,047 |
2,861,183 | 2010-05-18T21:10:00.000 | 59 | 0 | 1 | 0 | python,virtualenv,pip | 2,880,884 | 3 | false | 0 | 0 | I just tried on my virtualenv project and pip install -U --no-deps mypackage seems to work just fine. It just download mypackage and nothing else. What's your set up like? | 1 | 64 | 0 | I'm using pip and virtualenv for my python application. I would like to upgrade to a new version of the application without touching the dependencies. When I use pip install -U, it tries to upgrade all the packages, and even uninstalls and re-installs the same version of a dependency package when there isn't a new vers... | Upgrade package without upgrading dependencies using pip? | 1 | 0 | 0 | 42,784 |
2,861,575 | 2010-05-18T22:24:00.000 | 0 | 0 | 1 | 0 | python | 2,861,718 | 5 | false | 0 | 0 | It might be useful to get some information on Object Oriented programming (just what is the whole class thing about, and how do you tell if your classes are good/poor/indifferent). Mark Lutz' book Learning Python has an entire Part (several chapters) on OO. If this stuff is new to you, it might be helpful to take a l... | 1 | 3 | 0 | I've started to learn Python and programming from scratch. I have not programmed before so it's a new experience. I do seem to grasp most of the concepts, from variables to definitions and modules. I still need to learn a lot more about what the different libraries and modules do and also I lack knowledge on OOP and cl... | How do I get an overview and a methodology for programming in Python | 0 | 0 | 0 | 178 |
2,861,583 | 2010-05-18T22:26:00.000 | 3 | 0 | 1 | 0 | python,datetime,unicode | 2,861,641 | 3 | false | 0 | 0 | Converting with unicode() or string.decode() like in your example should work. The only problem should be that in your example you use the default locale's encoding even though you set the locale to something different before. If you use locale.getlocale()[1] instead of locale.getdefaultlocale()[1] you should get the c... | 1 | 2 | 0 | I would like to convert datetime.ctime() values to Unicode.
Using Python 2.6.4 running under Windows I can set my locale to Spanish like below:
>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'esp' )
Then I can pass %a, %A, %b, and %B to ctime() to get day and month names and abbreviations.
>>> import datetime... | Converting datetime.ctime() values to Unicode | 0.197375 | 0 | 0 | 2,315 |
2,861,858 | 2010-05-18T23:22:00.000 | -2 | 0 | 0 | 1 | python,asynchronous,twisted | 2,899,163 | 2 | false | 0 | 0 | You might also like the txRDQ (Resizable Dispatch Queue) I wrote. Google it, it's in the tx collection on LaunchPad. Sorry I don't have more time to reply - about to go onstage.
Terry | 1 | 11 | 0 | The strength of Twisted (for python) is its asynchronous framework (I think). I've written an image processing server that takes requests via Perspective Broker. It works great as long as I feed it less than a couple hundred images at a time. However, sometimes it gets spiked with hundreds of images at virtually the sa... | Queue remote calls to a Python Twisted perspective broker? | -0.197375 | 0 | 0 | 6,156 |
2,862,659 | 2010-05-19T03:30:00.000 | 0 | 0 | 0 | 0 | python,image-manipulation,python-imaging-library | 2,862,756 | 3 | false | 0 | 0 | One obvious way is to use Image.getpixel and Image.putpixel, for RGB, each should be a tuple of three integers. You can get (255-r, 255-g, 255-b), then put it back.
Or use pix = Image.load(), which seems faster.
Or if you look into ImageOps.py, it's using a lookup table (lut list) to map an image to an inverted one.
O... | 1 | 1 | 0 | I'm interested in learning how to invert (make a negative of) an image using the python image libary module.
I cannot however, use the ImageOps function 'invert.' I need another solution, using the RGB values. I've searched and tried to no avail. | Inverting image using the Python Image Library module | 0 | 0 | 0 | 3,836 |
2,863,618 | 2010-05-19T07:36:00.000 | 1 | 1 | 0 | 0 | apache,mod-python,mod-php | 2,863,923 | 2 | false | 0 | 0 | I wanted to know the differences between the two mod_php and mod_python...
PHP is more widely available on Internet hosts than Python.
I've noticed on one of my Python web sites that if I'm the first user to use Python, on that Internet host, the start up time of the Python services can be measured in minutes. Most p... | 2 | 3 | 0 | I've been using for more than 12 years PHP with Apache (a.k.a mod_php) for my web
development work. I've recenlty discovered python and its real power (I still don't understand why this is not always the best product that becomes the most famous).
I've just discovered mod_python for Apache. I've already googled but wit... | Web programming: Apache modules: mod_python vs mod_php | 0.099668 | 0 | 0 | 1,262 |
2,863,618 | 2010-05-19T07:36:00.000 | 2 | 1 | 0 | 0 | apache,mod-python,mod-php | 2,869,850 | 2 | true | 0 | 0 | My understanding is that PHP was designed with Internet/Web in mind, but Python is for a more general purpose.
Now most people are leaving mod_python for mod_wsgi, which is more robust and flexible.
To answer other questions:
speed: python is faster. (PHP is slower than both ruby and python)
productivity: at least the... | 2 | 3 | 0 | I've been using for more than 12 years PHP with Apache (a.k.a mod_php) for my web
development work. I've recenlty discovered python and its real power (I still don't understand why this is not always the best product that becomes the most famous).
I've just discovered mod_python for Apache. I've already googled but wit... | Web programming: Apache modules: mod_python vs mod_php | 1.2 | 0 | 0 | 1,262 |
2,863,748 | 2010-05-19T07:59:00.000 | 1 | 0 | 0 | 0 | python,sqlalchemy | 2,863,830 | 1 | false | 1 | 0 | Sorting is done by the database. If you database doesn't support natural sorting your are out of luck and have to sort your rows manually after retrieving them via sqlalchemy. | 1 | 1 | 0 | Currently, i am querying with this code: meta.Session.query(Label).order_by(Label.name).all()
and it returns me objects sorted by Label.name in this manner ['1','7','1a','5c']. Is there a way i can have the objects returned in the order with their Label.name sorted like this ['1','1a','5c','7']
Thanks! | sqlalchemy natural sorting | 0.197375 | 1 | 0 | 1,746 |
2,864,277 | 2010-05-19T09:32:00.000 | 3 | 0 | 1 | 1 | python,linux,unix | 2,864,298 | 1 | false | 0 | 0 | Use Popen from subprocess like this
process = Popen("cmd", shell=True, bufsize=bufsize, stdout=PIPE)
Then use process.stdout to read from program's stdout (like reading from any other file like object). | 1 | 0 | 0 | i'm looking for a way in python to run an external binary and watch it's output for: "up to date" If "up to date" isn't returned i want to run the original command again, once "up to date" is displayed i would like to be able to run another script. So far I've figured out how to run the binary with options using subpro... | call external program in python, watch output for specific text then take action | 0.53705 | 0 | 0 | 720 |
2,864,366 | 2010-05-19T09:47:00.000 | 7 | 0 | 1 | 0 | python,class,naming-conventions | 2,864,397 | 2 | false | 0 | 0 | No, you can define multiple classes (and functions, etc.) in a single file. A file is also called a module.
To use the classes/functions defined in the module/file, you will need to import the module/file. | 1 | 54 | 0 | Much like Java (or php), I'm use to seperating the classes to files.
Is it the same deal in Python? plus, how should I name the file?
Lowercase like classname.py or the same like ClassName.py?
Do I need to do something special if I want to create an object from this class or does the fact that it's in the same "proj... | Are classes in Python in different files? | 1 | 0 | 0 | 91,527 |
2,864,663 | 2010-05-19T10:33:00.000 | 1 | 1 | 0 | 1 | python,twisted,telnet | 2,864,683 | 2 | false | 0 | 0 | It sounds like you've got two separate tasks here:
Port the code from C to Python.
Rewrite the whole program to use Twisted.
Since you're new to Python, I would be inclined to do the first one first, before trying to make the program structure work in Twisted. If the program is old, there isn't likely to be any perfo... | 1 | 4 | 0 | I have a project which is essentially a game server where users connect and send text commands via telnet.
The code is in C and really old and unmodular and has several bugs and missing features. The main function alone is half the code.
I came to the conclusion that rewriting it in Python, with Twisted, could actually... | Twisted Matrix and telnet server implementation | 0.099668 | 0 | 0 | 2,482 |
2,865,003 | 2010-05-19T11:25:00.000 | 0 | 0 | 0 | 0 | python,pygame | 2,897,004 | 7 | false | 0 | 1 | No one has mentioned this yet as a source of games written in pygame, but check out www.pyweek.org - it's a week-long programming competition featuring games built in python. In many cases they use pygame, though there are other libs such as pyglet and opengl that are used. | 1 | 13 | 0 | Just curious if anyone knows of good sites for learning and understanding PyGame.
I've programmed a bunch in Python, so I'm well-equipped with that. Just curious if anyone knows a good site or more for learning PyGame.
Thanks for any help! | Best resources for learning PyGame? | 0 | 0 | 0 | 7,938 |
2,865,679 | 2010-05-19T13:01:00.000 | 5 | 0 | 1 | 0 | python,c | 2,865,722 | 2 | true | 0 | 0 | You can't make a statically linked extension module because Python needs to load it dynamically at runtime and because (as you reasoned) the module needs to dynamically link against libpython.
You could compile your own custom version of Python with your extension statically linked into the interpreter. That's usually... | 1 | 6 | 0 | I'm an extension noob. What I want to do is create an extension that doesn't require other libraries to be installed. Is this impossible because the extension has to link against a specific version of libpython at runtime? | Why are python extensions shared libraries? Is it possible to make a static-linked library? | 1.2 | 0 | 0 | 2,127 |
2,870,092 | 2010-05-19T23:17:00.000 | 0 | 0 | 1 | 0 | python,matplotlib,macports,enthought | 14,721,335 | 2 | false | 0 | 0 | I've used EPD on Windows 7. It works great. Only stalled on me a couple of times with rather large data set.
I also use OSX, and was about to install EPD but hesitating a bit.
I think python 2.7.3 that comes with EPD (early 2013) will become the default python. Normally, upgrading to 2.7 from 2.6 should not be much of... | 2 | 2 | 0 | I've been using MacPorts Python 2.6 on OS X 10.6.
I am considering also installing the Enthought Python Distribution (EPD) on the same machine because it comes preconfigured with matplotlib and other nice data analysis and visualization packages.
Can the two Python distributions co-exist peacefully on the same machine... | Can EPD Python and MacPorts Python coexist on OS X (matplotlib)? | 0 | 0 | 0 | 763 |
2,870,092 | 2010-05-19T23:17:00.000 | 3 | 0 | 1 | 0 | python,matplotlib,macports,enthought | 2,874,199 | 2 | true | 0 | 0 | I'm not an OSX user, so I can't say for certain, but you should be fine.
EPD bundles its own python interpreter and all required libraries. The installer basically just extracts a tarball into a stand-alone folder.
The linux installer doesn't modify any environment variables (not even $PATH), so I assume the mac in... | 2 | 2 | 0 | I've been using MacPorts Python 2.6 on OS X 10.6.
I am considering also installing the Enthought Python Distribution (EPD) on the same machine because it comes preconfigured with matplotlib and other nice data analysis and visualization packages.
Can the two Python distributions co-exist peacefully on the same machine... | Can EPD Python and MacPorts Python coexist on OS X (matplotlib)? | 1.2 | 0 | 0 | 763 |
2,870,292 | 2010-05-20T00:13:00.000 | 0 | 0 | 1 | 0 | java,python,conventions,readability | 2,870,528 | 6 | false | 0 | 0 | "Everything is a class" is a Java idiom that's specifically not a Python idiom. (Almost) everything can be a class in Python, and if that's more comfortable for you then go for it, but Python doesn't require such a thing. Python is not a purely object-oriented language, and in my (limited) experience it's good to take ... | 1 | 9 | 0 | I'm a java programmer, but now entering the "realm of python" for some stuff for which Python works better. I'm quite sure a good portion of my code would look weird for a Python programmer (e.g. using parenthesis on every if).
I know each language has its own conventions and set of "habits". So, from a readability sta... | Python readability hints for a Java programmer | 0 | 0 | 0 | 899 |
2,870,379 | 2010-05-20T00:47:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine,sqlite | 2,873,946 | 4 | false | 1 | 0 | I have not had any trouble importing pysqlite2, reading data, then transforming it and writing it to AppEngine using the remote_api.
What error are you seeing? | 1 | 5 | 0 | I have a relatively extensive sqlite database that I'd like to import into my Google App Engine python app.
I've created my models using the appengine API which are close, but not quite identical to the existing schema. I've written an import script to load the data from sqlite and create/save new appengine objects, bu... | Importing Sqlite data into Google App Engine | 0 | 1 | 0 | 2,231 |
2,870,815 | 2010-05-20T03:24:00.000 | 2 | 0 | 0 | 0 | python,sql,database | 2,870,821 | 3 | false | 0 | 0 | No, I think you just stick to dictionaries or tuples if you only have rows around 100 | 3 | 1 | 0 | I am working on a personal project where I need to manipulate values in a database-like format.
Up until now I have been using dictionaries, tuples, and lists to store and consult those values.
I am thinking about starting to use SQL to manipulate those values, but I don't know if it's worth the effort, because I don't... | Python and database | 0.132549 | 1 | 0 | 291 |
2,870,815 | 2010-05-20T03:24:00.000 | 7 | 0 | 0 | 0 | python,sql,database | 2,870,832 | 3 | true | 0 | 0 | SQL is nice and practical for many kinds of problems, is not that hard to learn at a simple "surface" level, and can be very handy to use in Python with its embedded sqlite. But if you don't know SQL, have no intrinsic motivation to learn it right now, and are already doing all you need to do to/with your data without... | 3 | 1 | 0 | I am working on a personal project where I need to manipulate values in a database-like format.
Up until now I have been using dictionaries, tuples, and lists to store and consult those values.
I am thinking about starting to use SQL to manipulate those values, but I don't know if it's worth the effort, because I don't... | Python and database | 1.2 | 1 | 0 | 291 |
2,870,815 | 2010-05-20T03:24:00.000 | 2 | 0 | 0 | 0 | python,sql,database | 2,871,090 | 3 | false | 0 | 0 | SQL is useful in many applications. But it is an overkill in this case. You can easily store your data in CSV, pickle or JSON format. Get this job done in 5 minutes and then learn SQL when you have time. | 3 | 1 | 0 | I am working on a personal project where I need to manipulate values in a database-like format.
Up until now I have been using dictionaries, tuples, and lists to store and consult those values.
I am thinking about starting to use SQL to manipulate those values, but I don't know if it's worth the effort, because I don't... | Python and database | 0.132549 | 1 | 0 | 291 |
2,872,041 | 2010-05-20T08:20:00.000 | 1 | 1 | 0 | 1 | python,perl,bash,scripting,comparison | 3,203,607 | 18 | false | 0 | 0 | What I don't get is why people say bash when they mean any bourne-shell compatible shell.
When writing shell scripts: always try to use constructs that also work in older bourne shell interpreters as well. It will save you lots of trouble some day.
And yes, there is plenty of use for shell scripts today, as the shell a... | 10 | 76 | 0 | I just finished my second year as a university CS student, so my "real-world" knowledge is lacking. I learned Java my first year, continued with Java and picked up C and simple Bash
scripting my second. This summer I'm trying to learn Perl (God help me). I've dabbled with Python a bit in the past.
My question is, n... | Is there any use for Bash scripting anymore? | 0.011111 | 0 | 0 | 50,948 |
2,872,041 | 2010-05-20T08:20:00.000 | 1 | 1 | 0 | 1 | python,perl,bash,scripting,comparison | 3,147,413 | 18 | false | 0 | 0 | As mentioned, the GNU tools are great, and are easiest to use within the shell. It is especially nice if your data is already in a linear or tabular form of plain text. Just as an example, the other day I was able to build a script to create an XHTML word cloud of any text file in 8 lines of Bourne Shell, which is even... | 10 | 76 | 0 | I just finished my second year as a university CS student, so my "real-world" knowledge is lacking. I learned Java my first year, continued with Java and picked up C and simple Bash
scripting my second. This summer I'm trying to learn Perl (God help me). I've dabbled with Python a bit in the past.
My question is, n... | Is there any use for Bash scripting anymore? | 0.011111 | 0 | 0 | 50,948 |
2,872,041 | 2010-05-20T08:20:00.000 | 2 | 1 | 0 | 1 | python,perl,bash,scripting,comparison | 2,877,257 | 18 | false | 0 | 0 | I'm a perl guy, but the number of the bash (or ksh) functions I use and create on a daily basis is quite significant. For anything involved, I'll write a perl script, but for navigating the directory structure, and specifically for manipulating environment variables bash/ksh/... are indispensable.
Again, especially fo... | 10 | 76 | 0 | I just finished my second year as a university CS student, so my "real-world" knowledge is lacking. I learned Java my first year, continued with Java and picked up C and simple Bash
scripting my second. This summer I'm trying to learn Perl (God help me). I've dabbled with Python a bit in the past.
My question is, n... | Is there any use for Bash scripting anymore? | 0.022219 | 0 | 0 | 50,948 |
2,872,041 | 2010-05-20T08:20:00.000 | 1 | 1 | 0 | 1 | python,perl,bash,scripting,comparison | 2,875,733 | 18 | false | 0 | 0 | In my experience, Perl meets something like 99% of any need that might require a shell script. As a bonus, it is possible to write code that runs on Windows sans Cygwin. If I won't have a Perl install on a Windows box I want to target, I can use PAR::Packer or PerlApp to produce an executable. Python, Ruby and other... | 10 | 76 | 0 | I just finished my second year as a university CS student, so my "real-world" knowledge is lacking. I learned Java my first year, continued with Java and picked up C and simple Bash
scripting my second. This summer I'm trying to learn Perl (God help me). I've dabbled with Python a bit in the past.
My question is, n... | Is there any use for Bash scripting anymore? | 0.011111 | 0 | 0 | 50,948 |
2,872,041 | 2010-05-20T08:20:00.000 | 2 | 1 | 0 | 1 | python,perl,bash,scripting,comparison | 2,872,083 | 18 | false | 0 | 0 | Easier, probably not. I actually prefer perl to bash scripting in many cases. Bash does have one advantage, though, especially on Linux systems: it's all but guaranteed to be installed. And if it's not, its largely-compatible father (sh) will be, cause almost all system scripts are written for sh. Even perl isn't t... | 10 | 76 | 0 | I just finished my second year as a university CS student, so my "real-world" knowledge is lacking. I learned Java my first year, continued with Java and picked up C and simple Bash
scripting my second. This summer I'm trying to learn Perl (God help me). I've dabbled with Python a bit in the past.
My question is, n... | Is there any use for Bash scripting anymore? | 0.022219 | 0 | 0 | 50,948 |
2,872,041 | 2010-05-20T08:20:00.000 | 8 | 1 | 0 | 1 | python,perl,bash,scripting,comparison | 2,872,064 | 18 | false | 0 | 0 | Well, when writing with bash, you can directly use every possible tool you have on the command line for your script. With any other language you would first have to execute that command and get some result etc. A simple script that (for example) gets a list of processes, runs through grep and gets some result would be ... | 10 | 76 | 0 | I just finished my second year as a university CS student, so my "real-world" knowledge is lacking. I learned Java my first year, continued with Java and picked up C and simple Bash
scripting my second. This summer I'm trying to learn Perl (God help me). I've dabbled with Python a bit in the past.
My question is, n... | Is there any use for Bash scripting anymore? | 1 | 0 | 0 | 50,948 |
2,872,041 | 2010-05-20T08:20:00.000 | 2 | 1 | 0 | 1 | python,perl,bash,scripting,comparison | 2,874,267 | 18 | false | 0 | 0 | If you do lots of GUI stuff, you'll probably only meet bash whenever you're doing some sort of customization on your own machine. Various hacks and stuff. If you use the command line to do stuff, bash is just indispensable. In fact, being good on the command line requires bash or some other shell familiarity.
I get mil... | 10 | 76 | 0 | I just finished my second year as a university CS student, so my "real-world" knowledge is lacking. I learned Java my first year, continued with Java and picked up C and simple Bash
scripting my second. This summer I'm trying to learn Perl (God help me). I've dabbled with Python a bit in the past.
My question is, n... | Is there any use for Bash scripting anymore? | 0.022219 | 0 | 0 | 50,948 |
2,872,041 | 2010-05-20T08:20:00.000 | 4 | 1 | 0 | 1 | python,perl,bash,scripting,comparison | 2,875,677 | 18 | false | 0 | 0 | Apart from what others have said, I'd like to point out what's in my opinion the main reason to learn Bash: it's the (almost) standard Linux shell.
Other scripting languages are surely useful, and maybe a lot more powerful, but what you'll be dealing with when you have a terminal in front of you is... Bash.
Being able ... | 10 | 76 | 0 | I just finished my second year as a university CS student, so my "real-world" knowledge is lacking. I learned Java my first year, continued with Java and picked up C and simple Bash
scripting my second. This summer I'm trying to learn Perl (God help me). I've dabbled with Python a bit in the past.
My question is, n... | Is there any use for Bash scripting anymore? | 0.044415 | 0 | 0 | 50,948 |
2,872,041 | 2010-05-20T08:20:00.000 | 2 | 1 | 0 | 1 | python,perl,bash,scripting,comparison | 2,872,085 | 18 | false | 0 | 0 | Bash (and the original Bourne sh and myriad derivatives) is - from one perspective - an incredibly high-level language. Where many languages use simple primitives, shell primitives are entire programs.
That it might not be the best language to express your tasks, doesn't mean it is dead, dying, or even moribund. | 10 | 76 | 0 | I just finished my second year as a university CS student, so my "real-world" knowledge is lacking. I learned Java my first year, continued with Java and picked up C and simple Bash
scripting my second. This summer I'm trying to learn Perl (God help me). I've dabbled with Python a bit in the past.
My question is, n... | Is there any use for Bash scripting anymore? | 0.022219 | 0 | 0 | 50,948 |
2,872,041 | 2010-05-20T08:20:00.000 | 26 | 1 | 0 | 1 | python,perl,bash,scripting,comparison | 2,872,171 | 18 | false | 0 | 0 | The real difference between bash and python is that python is a general purpose scripting language, while bash is simply a way to run a myriad of small (and often very fast) programs in a series. Python can do this, but it is not optimized for it. The programs (sort, find, uniq, scp) might do very complex tasks very si... | 10 | 76 | 0 | I just finished my second year as a university CS student, so my "real-world" knowledge is lacking. I learned Java my first year, continued with Java and picked up C and simple Bash
scripting my second. This summer I'm trying to learn Perl (God help me). I've dabbled with Python a bit in the past.
My question is, n... | Is there any use for Bash scripting anymore? | 1 | 0 | 0 | 50,948 |
2,874,431 | 2010-05-20T14:02:00.000 | 5 | 1 | 1 | 0 | python,configuration,import,config | 2,874,547 | 3 | true | 0 | 0 | Use the __import__ builtin function. But like nosklo, I prefer to store it in simpler data format like JSON of INI config file. | 2 | 1 | 0 | My config file is really just a big python dict, but I have many config files to run different experiments and I want to 'import' a different one based on a command line option. Instinctively I want to do import ConfigFileName where ConfigFileName is a string with the config file's python package name in it... but tha... | What's the best way to use python-syntax config files (in python of course)? | 1.2 | 0 | 0 | 564 |
2,874,431 | 2010-05-20T14:02:00.000 | 1 | 1 | 1 | 0 | python,configuration,import,config | 2,877,557 | 3 | false | 0 | 0 | You might consider ConfigParser, also included with python. It offers simple sectioned name/value items, default settings, and some substitution capabilities. If that's flexible enough for your needs, it would be a nice alternative. | 2 | 1 | 0 | My config file is really just a big python dict, but I have many config files to run different experiments and I want to 'import' a different one based on a command line option. Instinctively I want to do import ConfigFileName where ConfigFileName is a string with the config file's python package name in it... but tha... | What's the best way to use python-syntax config files (in python of course)? | 0.066568 | 0 | 0 | 564 |
2,875,530 | 2010-05-20T15:55:00.000 | 6 | 0 | 1 | 0 | python,cx-freeze | 2,875,948 | 1 | true | 0 | 1 | Disclaimer: I haven't used cx_Freeze in awhile......
.PYD files are DLL machine-code files that contain specific python-required functions.
.PYC files are .py files that have been compiled into bytecode.
so PYDs are machine code and PYCs are bytecode
Now as for why the PYDs aren't in the .zip....I'd imagine it's becau... | 1 | 3 | 0 | I'm using cx_Freeze to freeze my python program. On running cx_Freeze, a bunch of PYD files are created, a whole bunch of PYC files are put into a archive named library.zip and a few DLL files are there too.
Could someone tell me the difference between the PYC and the PYD files?
What's the reason for the PYD files not ... | cx_Freeze and PYC/PYD files | 1.2 | 0 | 0 | 3,772 |
2,876,181 | 2010-05-20T17:17:00.000 | 0 | 0 | 0 | 1 | python,asynchronous,file-upload | 19,850,039 | 2 | false | 0 | 0 | See if you can push the files straight from the user's browser to a static file store, like Amazon S3 or rackspace's cloudfiles service.
Then you can handle a ton of parallel users. | 1 | 3 | 0 | We have a web application that takes file uploads for some parts. The file uploads aren't terribly big (mostly word documents and such), but they're much larger than your typical web request and they tend to tie up our threaded servers (zope 2 servers running behind an Apache proxy).
I'm mostly in the brainstorming p... | What's the most scalable way to handle somewhat large file uploads in a Python webapp? | 0 | 0 | 0 | 672 |
2,876,337 | 2010-05-20T17:36:00.000 | 1 | 0 | 1 | 0 | python,django | 2,888,075 | 10 | false | 1 | 0 | If it is your basics in OOPS that you wish to strengthen, Java is a good option(provided you know c++ or any other non-web-based language which supports OOPS). However, if you are looking towards web-development, Python should be your best option.
Yes, Python is a good option
Yes, Django is a very good web application ... | 1 | 11 | 0 | I am currently learning PHP and want to learn about OOP.
I know Python is a well-organized and is all OOP, so would learning Python be a wise choose to learn OOP?
The thing is I am more towards web development then just general programming, and I know Python is just a general purpose language, but there is Django.
... | How should I go about learning Python? | 0.019997 | 0 | 0 | 2,771 |
2,877,101 | 2010-05-20T19:27:00.000 | 3 | 0 | 0 | 0 | python,django,web-services,pylons | 2,877,686 | 3 | false | 1 | 0 | Yes, we use it directly. We have view functions that respond to some URI's with serialized JSON or XML objects instead of pretty HTML pages. | 2 | 2 | 0 | My friend said, "Pylons is so much better for web services."
My other friend said, "You can modify Django in a way to do exactly whatever you like."
In Django, what is necessary to be modified (urls.py? models classes? settings?) in order to do "web services" with APIs and REST and versioning, etc etc.? | Can Django be used for web services? | 0.197375 | 0 | 0 | 2,678 |
2,877,101 | 2010-05-20T19:27:00.000 | 2 | 0 | 0 | 0 | python,django,web-services,pylons | 30,111,944 | 3 | false | 1 | 0 | Absolutely.
Django is in fact made to be used on server side. But first you need to understand that it is a framework.
A framework is a set of tools which get the common activities done in web development (e.g Login or Sign up module). | 2 | 2 | 0 | My friend said, "Pylons is so much better for web services."
My other friend said, "You can modify Django in a way to do exactly whatever you like."
In Django, what is necessary to be modified (urls.py? models classes? settings?) in order to do "web services" with APIs and REST and versioning, etc etc.? | Can Django be used for web services? | 0.132549 | 0 | 0 | 2,678 |
2,877,617 | 2010-05-20T20:38:00.000 | 4 | 0 | 1 | 0 | python | 2,877,637 | 2 | true | 1 | 0 | Instead of using a list, why not use a dictionary and use small integers as the keys? Adding and removing items from the dictionary will not change the indices into the dictionary. You will want to keep one value in the dictionary that lets you know what the next assigned index will be. | 2 | 2 | 0 | I'm using python for my shopping cart class which has a list of items. When a customer wants to edit an item, I need to pass the JavaScript front-end some way to refer to the item so that it can call AJAX methods to manipulate it.
Basically, I need a simple way to point to a particular item that isn't its index, and is... | Referring to objects inside a list without using references or indices | 1.2 | 0 | 0 | 190 |
2,877,617 | 2010-05-20T20:38:00.000 | 2 | 0 | 1 | 0 | python | 2,877,644 | 2 | false | 1 | 0 | A UUID seems perfect for this. Why don't you want to do that?
Do the items have any sort of product_id? Can the shopping cart have more than one of the same product_id, or does it store a quantity? What I'm getting at is: If product_id's in the cart are unique, you can just use that. | 2 | 2 | 0 | I'm using python for my shopping cart class which has a list of items. When a customer wants to edit an item, I need to pass the JavaScript front-end some way to refer to the item so that it can call AJAX methods to manipulate it.
Basically, I need a simple way to point to a particular item that isn't its index, and is... | Referring to objects inside a list without using references or indices | 0.197375 | 0 | 0 | 190 |
2,878,081 | 2010-05-20T21:43:00.000 | 0 | 0 | 1 | 0 | python,chat,chatroom | 2,878,815 | 2 | false | 0 | 0 | Google AppEngine supports python provides scalable framework. Probably you'll save lots of time if you use it. | 1 | 1 | 0 | Hey guys, I have an idea that I'd like to start implementing that at the crux of it, will basically be a chat website, and will need to support multiple rooms. Quite frankly, I'm not too sure where to begin with regards to setting up a very sturdy/scalable chat system in python (or another language if you guys believe ... | Scalable chat site in python | 0 | 0 | 0 | 365 |
2,878,474 | 2010-05-20T22:59:00.000 | 1 | 0 | 1 | 0 | python | 2,878,609 | 1 | false | 0 | 0 | If your function is looping through a lot of things, you could check the elapsed time during each iteration of the loop... but if it's blocked on something for the long period, then you need to have some other thread which can be handling the timing stuff while the thread you're timing is blocked. | 1 | 2 | 0 | Is there a way to have a function raise an error if it takes longer than a certain amount of time to return? I want to do this without using signal (because I am not in the main thread) or by spawning more threads, which is cumbersome. | Python: set a function timeout without using signal or threads? | 0.197375 | 0 | 0 | 702 |
2,879,008 | 2010-05-21T01:18:00.000 | 0 | 1 | 0 | 1 | python,ide | 11,520,785 | 2 | false | 0 | 0 | You did not mention these so I'm not sure if you've tried them but there are:
- Aptana (aptana.com)
- The Eric Python IDE (http://eric-ide.python-projects.org/)
- WingWare Python IDE (wingware.com)
I haven't used any of them so I don't know if they will match your needs, but I'd expected them to be pretty close as they... | 1 | 3 | 0 | I'm trying to find a decent IDE that supports Python 3.x, and offers code completion/in-built Pydocs viewer, Mercurial integration, and SSH/SFTP support.
Anyhow, I'm trying Pydev, and I open up a .py file, it's in the Pydev perspective and the Run As doesn't offer any options. It does when you start a Pydev project, bu... | Python 3.0 IDE - Komodo and Eclipse both flaky? | 0 | 0 | 0 | 584 |
2,879,246 | 2010-05-21T02:34:00.000 | 1 | 0 | 0 | 0 | python,django,postgresql,psycopg2 | 14,780,956 | 4 | false | 0 | 0 | In my case, I had to reinstall libpq5. | 2 | 0 | 0 | I am trying to install postgrepsql to cygwin on a windows 7 machine and want it to work with django.
After built and installed postgrepsql in cygwin, I built and installed psycopg2 in cygwin as well and got no error, but when use it in python with cygwin, I got the "no such process" error:
import psycopg2
Tra... | psycopg2 on cygwin: no such process | 0.049958 | 1 | 0 | 1,204 |
2,879,246 | 2010-05-21T02:34:00.000 | 0 | 0 | 0 | 0 | python,django,postgresql,psycopg2 | 2,885,759 | 4 | false | 0 | 0 | Why? There is native psycopg2 for Win. | 2 | 0 | 0 | I am trying to install postgrepsql to cygwin on a windows 7 machine and want it to work with django.
After built and installed postgrepsql in cygwin, I built and installed psycopg2 in cygwin as well and got no error, but when use it in python with cygwin, I got the "no such process" error:
import psycopg2
Tra... | psycopg2 on cygwin: no such process | 0 | 1 | 0 | 1,204 |
2,879,251 | 2010-05-21T02:36:00.000 | 3 | 0 | 0 | 0 | asp.net,python,asp.net-mvc,django | 2,879,295 | 2 | false | 1 | 0 | ASP.NET MVC is pretty cool if you already know C# and/or ASP... but if you're starting from scratch, Django is (IMO) a better bet. You probably have more hosting options for Django, for one thing. | 1 | 7 | 0 | I am fairly new at web development scene, and I was wondering if you can help me break up the pros and cons of using python django vs asp.net mvc besides the maturity level of its framework.
I have intermediate experience with Java. As of right now, I am leaning towards Python, but I just wanted to make sure, I am maki... | Python Django vs ASP.NET MVC | 0.291313 | 0 | 0 | 9,471 |
2,880,316 | 2010-05-21T07:37:00.000 | 3 | 0 | 0 | 1 | python,wxpython,cx-freeze | 2,881,979 | 4 | false | 0 | 1 | If you're using Windows, you could rename your "main" script's extension (that launches the app) to .pyw | 1 | 31 | 0 | I'm developing a Python application using wxPython and freezing it using cxFreeze. All seems to be going fine apart from this following bit:
When I run the executable created by cxFreeze, a blank console window pops up. I don't want to show it. Is there any way I could hide it?
It doesn't seem to be documented on the ... | How can I hide the console window when freezing wxPython applications with cxFreeze? | 0.148885 | 0 | 0 | 18,074 |
2,881,526 | 2010-05-21T11:15:00.000 | 2 | 0 | 1 | 0 | java,python,late-binding,compiled | 2,883,449 | 5 | false | 0 | 0 | I think the common misconception that Python is interpreted while Java is compiled arises because Java has an explicit compilation step - you have to run javac to convert your .java source file into a .class bytecode file that can be run.
As you rightly point out Python similarly compiles source files into bytecode b... | 3 | 13 | 0 | Python is compiled into an intermediate bytecode(pyc) and then executed. So, there is a compilation followed by interpretation. However, long-time Python users say that Python is a "late-binding" language and that it should`nt be referred to as an interpreted language.
How would Python be different from another interp... | Interpreted vs. Compiled vs. Late-Binding | 0.07983 | 0 | 0 | 1,865 |
2,881,526 | 2010-05-21T11:15:00.000 | 3 | 0 | 1 | 0 | java,python,late-binding,compiled | 2,881,732 | 5 | false | 0 | 0 | There's a connection between what we call the binding time and the concept of interpretation/compilation.
The binding time is the time when a symbolic expression is bound to its concrete value. That's more related to the definition of programming language, e.g. dynamic vs. static scoping of variables. Or static method ... | 3 | 13 | 0 | Python is compiled into an intermediate bytecode(pyc) and then executed. So, there is a compilation followed by interpretation. However, long-time Python users say that Python is a "late-binding" language and that it should`nt be referred to as an interpreted language.
How would Python be different from another interp... | Interpreted vs. Compiled vs. Late-Binding | 0.119427 | 0 | 0 | 1,865 |
2,881,526 | 2010-05-21T11:15:00.000 | 7 | 0 | 1 | 0 | java,python,late-binding,compiled | 2,881,574 | 5 | true | 0 | 0 | Late binding is a very different concept to interpretation.
Strictly speaking, an interpreted language is executed directly from source. It doesn't go through a byte-code compilation stage. The confusion arises because the python program is an interpreter, but it interprets the byte-code, so it is Python's byte-code la... | 3 | 13 | 0 | Python is compiled into an intermediate bytecode(pyc) and then executed. So, there is a compilation followed by interpretation. However, long-time Python users say that Python is a "late-binding" language and that it should`nt be referred to as an interpreted language.
How would Python be different from another interp... | Interpreted vs. Compiled vs. Late-Binding | 1.2 | 0 | 0 | 1,865 |
2,881,825 | 2010-05-21T12:02:00.000 | 1 | 0 | 0 | 0 | java,php,python,django,symfony1 | 2,881,839 | 3 | false | 1 | 0 | I suppose the closest thing in Javaland is the venerable Web Application Archive (war file). | 1 | 3 | 0 | in symfony 2.0 and django there are bundles that contain everything for a feature (html, css, js, img, php/python).
so if you want to delete one feature, you basically just delete that bundle and unregister it from "main".
are there java frameworks for this too? or is it different in java cause java is a compiling lang... | bundles in java? | 0.066568 | 0 | 0 | 110 |
2,882,060 | 2010-05-21T12:38:00.000 | 0 | 0 | 0 | 0 | python,user-interface,tkinter,frame,sliding | 2,896,537 | 1 | true | 0 | 1 | How you do it depends on the geometry manager, but the basic idea is simply to set the width of the frame to smaller and smaller values until it has a width of zero. You don't need a loop though -- the code is already running in the event loop, so take advantage of that. Use 'after' to schedule a job that changes the w... | 1 | 0 | 0 | I am trying really hard to make a sliding frame containing widgets in tkinter in python. There is this frame inside a big window with different widgets. And as soon as i click on the next button on that frame the frame should slowly slide towards the left and vanish ultimately. As soon as it vanishes, i want new frame ... | Creating a sliding frame containing widgets in tkinter in python | 1.2 | 0 | 0 | 1,113 |
2,882,448 | 2010-05-21T13:29:00.000 | 1 | 0 | 0 | 0 | python,console,chat,interrupt | 2,882,475 | 2 | true | 0 | 0 | Using select.select() on sys.stdin will allow you to check if a key has been pressed at the terminal. | 1 | 0 | 0 | I am writing python chatbot that displays output through console. Every half second it asks server for updates, and responds to message. In the console I can see chat log.
This is sufficient in most cases, however, sometimes I want to interrupt normal workflow and write custom chat answer myself. I would love to be abl... | Python - react to custom keyboard interrupt | 1.2 | 0 | 0 | 1,772 |
2,882,549 | 2010-05-21T13:44:00.000 | 0 | 0 | 0 | 0 | python,html,rss | 2,883,114 | 2 | true | 1 | 0 | Filetypes should generally be determined out-of-band. eg. if you are fetching the file from a web server, the place to look would be the Content-Type header of the HTTP response. If you're fetching a local file, the filesystem would have a way of determining filetype—on Windows that'd be looking at the file extension.
... | 2 | 1 | 0 | Is there a function or method I could call in Python
That would tell me if the data is RSS or HTML? | Identifying if a data is RSS or HTML on python | 1.2 | 0 | 1 | 81 |
2,882,549 | 2010-05-21T13:44:00.000 | 2 | 0 | 0 | 0 | python,html,rss | 2,882,574 | 2 | false | 1 | 0 | You could always analyze it yourself to search for an xml tag (for RSS) or html tag (for HTML). | 2 | 1 | 0 | Is there a function or method I could call in Python
That would tell me if the data is RSS or HTML? | Identifying if a data is RSS or HTML on python | 0.197375 | 0 | 1 | 81 |
2,884,579 | 2010-05-21T18:29:00.000 | 3 | 0 | 0 | 1 | python,google-app-engine,httpwebrequest,scheduled-tasks | 2,889,352 | 3 | false | 1 | 0 | A task is removed from the queue when it executes if and only if it returns an HTTP 200 response. For any other response, it will be retried until it successfully executes.
As David's answer indicates, they can also be manually removed. | 1 | 3 | 0 | How can I remove a task from a task queue? Is Google App Engine Task Queue removes the task from the queue after it is executed? | Google App Engine, Task Queues | 0.197375 | 0 | 0 | 1,032 |
2,885,057 | 2010-05-21T19:38:00.000 | -1 | 0 | 1 | 1 | python,image,google-app-engine | 2,885,231 | 5 | false | 1 | 0 | How did you install PIL? If I remember correctly, I had to install it via MacPorts to get the App Engine SDK to recognize that it was installed.
You should probably install Python 2.5 and use that, while you're at it, since that is the Python version that App Engine uses and developing against 2.6 locally could potent... | 4 | 3 | 0 | I am using OS X 1.6 snow leopard and I successfully got PIL installed. I am able to open terminal and type import Image without any errors.
However, When using app engine I get Image error still saying that PIL is not installed. I am wondering if any of you have an thoughts as to how I can resolve this issue.
-Matthew | Python 2.6 + PIL + Google App Engine issue | -0.039979 | 0 | 0 | 1,343 |
2,885,057 | 2010-05-21T19:38:00.000 | 0 | 0 | 1 | 1 | python,image,google-app-engine | 2,889,386 | 5 | false | 1 | 0 | You cannot use PIL with Appengine; it uses C extensions and won't run in the sandbox environment. You do need to have PIL installed on your local machine to use the images API in dev_appserver, because the SDK version of the images API itself uses PIL, but this doesn't mean you can use all of PIL through the images AP... | 4 | 3 | 0 | I am using OS X 1.6 snow leopard and I successfully got PIL installed. I am able to open terminal and type import Image without any errors.
However, When using app engine I get Image error still saying that PIL is not installed. I am wondering if any of you have an thoughts as to how I can resolve this issue.
-Matthew | Python 2.6 + PIL + Google App Engine issue | 0 | 0 | 0 | 1,343 |
2,885,057 | 2010-05-21T19:38:00.000 | 1 | 0 | 1 | 1 | python,image,google-app-engine | 4,180,349 | 5 | false | 1 | 0 | I had this same problem and found in GoogleAppEngineLauncher | Preferences that I needed to set the Python Path to /usr/local/bin/python2.5
After I did that it started working. | 4 | 3 | 0 | I am using OS X 1.6 snow leopard and I successfully got PIL installed. I am able to open terminal and type import Image without any errors.
However, When using app engine I get Image error still saying that PIL is not installed. I am wondering if any of you have an thoughts as to how I can resolve this issue.
-Matthew | Python 2.6 + PIL + Google App Engine issue | 0.039979 | 0 | 0 | 1,343 |
2,885,057 | 2010-05-21T19:38:00.000 | 0 | 0 | 1 | 1 | python,image,google-app-engine | 28,392,607 | 5 | false | 1 | 0 | What David Scott said is actually correct.
I had the errors blow running and couldn't for the heck of me couldn't resolve the issue no matter what patches I tried. What worked for me apparently, was simply changing the Python directory found on C:\python27_x64 and target the pythonw.exe file using the Google App Engine... | 4 | 3 | 0 | I am using OS X 1.6 snow leopard and I successfully got PIL installed. I am able to open terminal and type import Image without any errors.
However, When using app engine I get Image error still saying that PIL is not installed. I am wondering if any of you have an thoughts as to how I can resolve this issue.
-Matthew | Python 2.6 + PIL + Google App Engine issue | 0 | 0 | 0 | 1,343 |
2,885,822 | 2010-05-21T21:49:00.000 | 1 | 1 | 0 | 1 | java,c++,python,logging | 2,926,570 | 3 | false | 1 | 0 | I'd use Apache log4cxx or Apache log4j.
It's Efficient. It has Logger hierarchies to modularize your logs. It's proven tecnology for a while now.
Currently, appenders exist for the console , files , GUI components, remote socket servers, NT Event Loggers , and remote UNIX Syslog daemons. It is also possible to log asy... | 1 | 11 | 0 | I have a system where a central Java controller launches analysis processes, which may be written in C++, Java, or Python (mostly they are C++). All these processes currently run on the same server. What are you suggestions to
Create a central log to which all processes can write to
What if in the future I push some p... | Which logging library to use for cross-language (Java, C++, Python) system | 0.066568 | 0 | 0 | 2,806 |
2,886,048 | 2010-05-21T22:37:00.000 | 1 | 0 | 1 | 0 | python,coding-style,methods | 2,886,277 | 6 | false | 0 | 0 | You should use the same name when it means the same thing. For example, if you have a database of "cars", you might want to use the name "car" to refer to a single car in every method or function that accepts a car as an argument or works with car objects internally. Doing this, someone reading the code will begin to s... | 5 | 2 | 0 | I'm thinking that the answer is probably 'no' if the program is small and there are a lot of methods, but what about in a larger program? If I am going to be using one variable in multiple methods throughout the program, is it smarter to:
Come up with a different phrasing for each method (to eliminate naming conflicts)... | Python: When passing variables between methods, is it necessary to assign it a new name? | 0.033321 | 0 | 0 | 700 |
2,886,048 | 2010-05-21T22:37:00.000 | 1 | 0 | 1 | 0 | python,coding-style,methods | 2,887,417 | 6 | false | 0 | 0 | There's no such requirement to give variables different names in different methods or function arguments. In fact, it would greatly hurt readability and go against common sense -- when two things are the same, one tries to give them the same name, not different ones. | 5 | 2 | 0 | I'm thinking that the answer is probably 'no' if the program is small and there are a lot of methods, but what about in a larger program? If I am going to be using one variable in multiple methods throughout the program, is it smarter to:
Come up with a different phrasing for each method (to eliminate naming conflicts)... | Python: When passing variables between methods, is it necessary to assign it a new name? | 0.033321 | 0 | 0 | 700 |
2,886,048 | 2010-05-21T22:37:00.000 | 1 | 0 | 1 | 0 | python,coding-style,methods | 2,886,240 | 6 | false | 0 | 0 | Don't go inventing ways of indicating which method the name belongs to. If you are coding correctly you will won't be treating other methods variables as local. If you have a hanle on method foobar and want its foo value use foobar.foo.
Variable names should indicate contents of the variable and aid in understanding... | 5 | 2 | 0 | I'm thinking that the answer is probably 'no' if the program is small and there are a lot of methods, but what about in a larger program? If I am going to be using one variable in multiple methods throughout the program, is it smarter to:
Come up with a different phrasing for each method (to eliminate naming conflicts)... | Python: When passing variables between methods, is it necessary to assign it a new name? | 0.033321 | 0 | 0 | 700 |
2,886,048 | 2010-05-21T22:37:00.000 | 2 | 0 | 1 | 0 | python,coding-style,methods | 2,886,210 | 6 | false | 0 | 0 | Python's scoping rules pretty much free you from the need to use different or identical names for variables just to satisfy language needs.
Variable name choice should be driven primarily by readability and maintainability concerns. In general, it is good to use just one name to identify a particular kind of thing thr... | 5 | 2 | 0 | I'm thinking that the answer is probably 'no' if the program is small and there are a lot of methods, but what about in a larger program? If I am going to be using one variable in multiple methods throughout the program, is it smarter to:
Come up with a different phrasing for each method (to eliminate naming conflicts)... | Python: When passing variables between methods, is it necessary to assign it a new name? | 0.066568 | 0 | 0 | 700 |
2,886,048 | 2010-05-21T22:37:00.000 | 3 | 0 | 1 | 0 | python,coding-style,methods | 2,886,109 | 6 | false | 0 | 0 | I tend to reuse variable names in local functions a lot, as long as they are mid-process. Usually 'result' for a db lookup or a calculation that is used intermediary and is needed to generate or construct the end-result of the method.
Only rarely have I used global variables, in fact only if I must. | 5 | 2 | 0 | I'm thinking that the answer is probably 'no' if the program is small and there are a lot of methods, but what about in a larger program? If I am going to be using one variable in multiple methods throughout the program, is it smarter to:
Come up with a different phrasing for each method (to eliminate naming conflicts)... | Python: When passing variables between methods, is it necessary to assign it a new name? | 0.099668 | 0 | 0 | 700 |
2,886,466 | 2010-05-22T00:47:00.000 | 0 | 0 | 0 | 0 | python,django,cgi,web-frameworks | 2,886,479 | 4 | false | 1 | 0 | A web application framework is independent of the actual HTTP server in use. The server passes an application written using it the requests, and it cranks some gears and spits out a response, which is sent back to the HTTP server.
Django has 3 popular connectors to the HTTP server: WSGI, FastCGI, and mod_python. These ... | 3 | 3 | 0 | I'm getting into python for cgi and came across Django. I'm not quite sure I understand it very much. Is it something I have to install inside apache or is it just something I can use with my cgi?
Wanted to know because I'd love to learn it but my server I'm using doesn't give me a lot of privileges.
thanks | What exactly is a web application framework? | 0 | 0 | 0 | 474 |
2,886,466 | 2010-05-22T00:47:00.000 | 0 | 0 | 0 | 0 | python,django,cgi,web-frameworks | 2,888,049 | 4 | false | 1 | 0 | Basically the functions of any framework are:-
make sure that you do not have to do the repetitive tasks.
make it easy for you to re-use and modularize
they provide a layer of abstraction(which in most cases, makes you more productive)
So, Django is a web application framework; naturally it satisfies all three condit... | 3 | 3 | 0 | I'm getting into python for cgi and came across Django. I'm not quite sure I understand it very much. Is it something I have to install inside apache or is it just something I can use with my cgi?
Wanted to know because I'd love to learn it but my server I'm using doesn't give me a lot of privileges.
thanks | What exactly is a web application framework? | 0 | 0 | 0 | 474 |
2,886,466 | 2010-05-22T00:47:00.000 | 0 | 0 | 0 | 0 | python,django,cgi,web-frameworks | 2,886,475 | 4 | false | 1 | 0 | A web application framework like Django replaces CGI by spawning its own processes and handling requests from a web server. They also provide tools for simplifying html by creating templates, partial templates, helpers etc.
If you don't have full control over your server, your host will need to install it for you. | 3 | 3 | 0 | I'm getting into python for cgi and came across Django. I'm not quite sure I understand it very much. Is it something I have to install inside apache or is it just something I can use with my cgi?
Wanted to know because I'd love to learn it but my server I'm using doesn't give me a lot of privileges.
thanks | What exactly is a web application framework? | 0 | 0 | 0 | 474 |
2,887,045 | 2010-05-22T05:20:00.000 | 9 | 0 | 0 | 0 | django,vb6,python | 2,887,309 | 1 | true | 1 | 0 | If your definition of barcode functionality is the ability to read and write barcodes, you should keep in mind two things.
Barcodes are actually read by barcode readers, and from the computers' point of view they are just input devices, just like keyboards. When the reader reads a barcode, it just "types" it in, chara... | 1 | 5 | 0 | I am in process of converting Visual Basic app into Python Django. Currently, it has barcode functionality to process sales at a store. Can this be achieved with python django. | Django Barcode for store sales | 1.2 | 0 | 0 | 2,820 |
2,888,035 | 2010-05-22T12:18:00.000 | 4 | 1 | 1 | 0 | python | 2,888,059 | 4 | false | 0 | 0 | Data encapsulation in Python is enforced by convention and peer review. Surprisingly, having every attribute effectively be public hasn't caused a problem for the majority of Python programmers. | 3 | 0 | 0 | in python tutorial added that python cannot hide its attributes from other classes. some thing such as private data in C++ or java..But also i know that we can use _ or __ to set some variables as privated one but it is not enogh. I think it is a weak if it is not any thing to do it. | information hiding in python | 0.197375 | 0 | 0 | 5,646 |
2,888,035 | 2010-05-22T12:18:00.000 | 4 | 1 | 1 | 0 | python | 2,888,071 | 4 | false | 0 | 0 | Using an underscore at the start of the name for an element or a method signals to the reader that what they're looking at is "internal implementation details". If they want to use that, they can, but it is very likely that a new version of the class will not preserve the API for internal-only method or elements (eh, "... | 3 | 0 | 0 | in python tutorial added that python cannot hide its attributes from other classes. some thing such as private data in C++ or java..But also i know that we can use _ or __ to set some variables as privated one but it is not enogh. I think it is a weak if it is not any thing to do it. | information hiding in python | 0.197375 | 0 | 0 | 5,646 |
2,888,035 | 2010-05-22T12:18:00.000 | 2 | 1 | 1 | 0 | python | 2,888,448 | 4 | false | 0 | 0 | You are right that the _foo convention isn't sufficient to make data private; it's not supposed to be! Information hiding is not part of the design of Python. When writing programs in Python, you depend on the caller's good manners to leave your internals alone based on the naming convention and your documentation. Don... | 3 | 0 | 0 | in python tutorial added that python cannot hide its attributes from other classes. some thing such as private data in C++ or java..But also i know that we can use _ or __ to set some variables as privated one but it is not enogh. I think it is a weak if it is not any thing to do it. | information hiding in python | 0.099668 | 0 | 0 | 5,646 |
2,888,468 | 2010-05-22T14:36:00.000 | 6 | 1 | 0 | 0 | java,python,huffman-code | 2,888,480 | 3 | false | 1 | 0 | Huffman code doesn't care about characters, it cares about symbols. Generally, it is used to encode the alphabet / other single characters, but can very easily be generalized to encode strings of characters. Basically, you would just take an existing implementation and allow symbols to be strings rather than characte... | 2 | 3 | 0 | I need huffman code(best in python or in java), which could encode text not by one character (a = 10, b = 11), but by two (ab = 11, ag = 10). Is it possible and if yes, where could i find it, maybe it's somewhere in the internet and i just can'd find it? | Huffman coding two characters as one | 1 | 0 | 0 | 1,395 |
2,888,468 | 2010-05-22T14:36:00.000 | 0 | 1 | 0 | 0 | java,python,huffman-code | 2,888,494 | 3 | false | 1 | 0 | There is probably some code somewhere. But this sounds like a parsing and tokenising question. One of the first questions I would be answering is how many unique pairs are you dealing with. Huffman encoding works best with small numbers of tokens. For example, the 101 characters on your keyboard. But if your two charac... | 2 | 3 | 0 | I need huffman code(best in python or in java), which could encode text not by one character (a = 10, b = 11), but by two (ab = 11, ag = 10). Is it possible and if yes, where could i find it, maybe it's somewhere in the internet and i just can'd find it? | Huffman coding two characters as one | 0 | 0 | 0 | 1,395 |
2,889,255 | 2010-05-22T18:27:00.000 | 0 | 0 | 0 | 0 | python,wxpython | 2,893,253 | 8 | false | 0 | 1 | I don't think a wxFrame can return a value since it is not modal. If you don't need to use a wxFrame, then a modal dialog could work for you. If you really need a frame, I'd consider using a custom event.
It would go something like this:
(1) User clicks to close the wxFrame
(2) You override OnClose (or something li... | 1 | 7 | 0 | Could someone show me how I could return a value from a wxPython Frame? When the use clicks close, I popup a message dialog asking him a question. I would like to return the return code of this message dialog to my calling function.
Thanks | Return value from wxPython Frame | 0 | 0 | 0 | 7,486 |
2,889,490 | 2010-05-22T19:32:00.000 | 1 | 0 | 0 | 1 | python,nfs | 10,356,817 | 2 | false | 0 | 0 | you cat parse /proc/mount file. Notice, that on different platforms and kernel versions file format may be different. | 1 | 2 | 0 | I wrote a python script that depends on a certain NFS share to be available. If the NFS share is not mounted it will happily copy the files to the local path where it should be mounted, but fail later when it tries to copy some files back that were created on the NFS server.
I'd like to catch this error specifically s... | Check if NFS share is mounted in python script | 0.099668 | 0 | 0 | 4,930 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.