If you take out the scaffolding feature where it creates the model/controller, and CRUD pages for you, is ruby on rails still any faster to market than say, django?
It seems very similiar to be if you take away that step...(even though I believe django has similar auto-gen capabilities)
I am reading the starting guide on the rails site...
Hello,
Hope the title isn't to confusing wasn't sure how I should put it. I wonder if it's possible for the base class to know which method of the derived class called one of it's methods.
Example:
class Controller(object):
def __init__(self):
self.output = {}
def output(self, s):
method_that_called_me = #is ...
Unless I'm crazy if None not in x and if not None in x are equivalent. Is there a preferred version? I guess None not in is more english-y and therefore more pythonic, but not None in is more like other language syntax. Is there a preferred version?
...
I have a configuration file (feedbar.cfg), having the following content:
[last_session]
last_position_x=10
last_position_y=10
After I run the following python script:
#!/usr/bin/env python
import pygtk
import gtk
import ConfigParser
import os
pygtk.require('2.0')
class FeedbarConfig():
""" Configuration class for Feedbar.
Used to...
I'm trying to write a simple GTD-style todo list app with python and gtk to learn python. I want a container that can select an individual list from a lot of choices. It would be something like the list of notebooks area in tomboy. Not a combobox.
As you can probably tell I'm a beginner and the terminology is probably off.
Can you p...
Hi, my question is the inverse of this one. In particular, I've dozens of existing modules written in Perl, some are object oriented and others just export a group of functions. Now since I have to write certain scripts in python but still would like to call those Perl modules, I'm wondering
1) if it is achievable, and
2) if so, what ...
I'm trying to represent a number with leading and trailing zeros so that the total width is 7 including the decimal point. For example, I want to represent "5" as "005.000". It seems that string formatting will let me do one or the other but not both. Here's the output I get in Ipython illustrating my problem:
In [1]: '%.3f'%5
Out[1]: '...
Hey,
At my work place there is a script (kind of automation system) that loads and runs our application tests from an XML file.
In the middle of the process the script calls __import__(testModule) which loads the module from its file.
The problem starts when I tried adding a feature by dynamically adding functions to the testModule at...
I like to work with data saved in one GAE application in other GAE applications.
Basically share the datastore between multiple web applications in Google App Engine (Python) Development and Production.
Also if possible with:
http://localhost:####/_ah/admin/datastore
I like to view data in other applications not runnings and/or running...
Python 2.6.6 was released on August 24, 2010. However, there isn't a Mac OS X Installer Disk Image. Is there a Mac OS X Installer Disk Image available for Python 2.6.6?
...
Is there a way to detect that an active application obtained via shared workspace
(NSWorkspace.sharedWorkspace().activeApplication()
is a browser (without running through the list of browsers and comparing to its 'NSApplicationName' and then extract its url (current tab) in ObjC?
Alternatively, would I be more successful using Python'...
I have to extract values from a variable that may be None, with some defaults in mind. I first wrote this code:
if self.maxTiles is None:
maxX, maxY = 2, 2
else:
maxX, maxY = self.maxTiles
Then I realized I could shorten it to:
maxX, maxY = self.maxTiles if self.maxTiles is not None else (2, 2)
But then I realized this migh...
What's the state of the art in DNS resolver libraries? I am particularly interested in full (not stub) resolvers that support any or all of: making multiple queries in one request packet, complete DNSSEC validation, returning detailed information about DNSSEC validation to the application, and can handle experimental new RRs without muc...
How do I create a dictionary in python that is passed to a function so it would look like this:
def foobar(dict):
dict = tempdict # I want tempdict to not point to dict, but to be a different dict
#logic that modifies tempdict
return tempdict
How do I do this?
...
I have to develop a fast heuristic-like algorithm for a hard combinatorial problem. Therefore I think, it would be the best to learn a more expressive language than C++ first for tackling the problem, because I think a lot of different algorithm attempts are needed to solve my assignment.
Some personal views about some languages which a...
I'm learning to use the Queue module, and am a bit confused about how a queue consumer thread can be made to know that the queue is complete. Ideally I'd like to use get() from within the consumer thread and have it throw an exception if the queue has been marked "done". Is there a better way to communicate this than by appending a sen...
I am trying improve my programming skills reading other peoples code but I'd like to know what's the best source code to read?
EDIT
I have read some books:
How to Think Like a Computer Scientist.
Learning Python, Fourth Edition.
Expert Python Programming.
Core Python Programming.
I am not a newb...
Ok. I've been told by at least one really helpful individual who believes that its easy to decode and parse a GET/POST request header from within CherryPy. I've been here: http://www.cherrypy.org/wiki/BuiltinTools#tools.decode but it doesn't give you an example. Can someone direct me to a more helpful example?
...
We all know that App Engine limits you to 1 MB for most input/output requests. But with the recent BlobStore API, you are allowed to upload large files in full by POSTing to a dynamically generated URL.
According to the sample, here is what the HTML form would look like:
self.response.out.write('<html><body>')
self.response.out.write('...
What are my options if I want to create a simple XML file in python? (library wise)
The xml I want looks like:
<root>
<doc>
<field1 name="blah">some value1</field1>
<field2 name="asdfasd">some vlaue2</field2>
</doc>
</root>
...