I ask this because there seems to be a few more jobs available (at least by telecommute) in RoR. If an employer sees significant Python/Django experience on a resume, would it be plausible to believe that the developer would be able quickly learn Rails?
...
For practice, I'm trying to do some stuff in Python. I've decided to make a simple hangman game - I'm not making a GUI. The game would start with a simple input(). Now, I'd like next line to, beside asking for input, to delete the hidden word. I've tried using \b (backspace character), but it's not working. Something like:
word = input(...
Right now, Django defaults to MYISAM...but I want to change it so that everytime I create a new table it is innodb.
...
I have Python 2.6 & 3.1 installed on Leopard via mac ports with no problems. I want to install Django 1.2 via mac ports for Python 2.6, but a google search of how to do it seems to point me in the wrong direction. Can anyone point me in the right direction? Thanks again.....
...
I have an implicit function, for example:
f(x,y) = x**y + y**y - 3*x
I want to solve the root on a meshgrid. So f(x,y) = 0
Drawing the solution is easy:
x = linspace(-2,2,11)
y = linspace(-2,2,11)
(X,Y) = meshgrid(x,y)
A = X**Y + Y**Y - 3*X
contour(X,Y,A,0)
This works great, I have a drawing of the curve I need, however I would l...
Hi!
I got this list looking something like this
words = ['how', 'much', 'is[br]', 'the', 'fish[br]', 'no', 'really']
What I would like is to replace the [br] with some fantastic value similar to <br /> and thus getting a new list looking like this
words = ['how', 'much', 'is<br />', 'the', 'fish<br />', 'no', 'really']
I've labora...
Hello,
I would like to do the following:
import StringIO, uu
my_data = StringIO.StringIO() # this is a file-like object
uu.encode(in_file, my_data)
# do stuff with my data (send over network)
uu.decode(my_data, out_file) # here I finally write to disk
The above code works. However, if I implement the previous step as a property in an...
All the stuff I am seeing points me towards writing clients.
...
I have one y variable, which I am trying to plot against two related x axes, on the top and bottom of the figure (e.g. y="number of things in cube", x1="side length of cube", x2="volume of cube"). I have y, x1, x2 in numpy arrays. The relationship between my x1 and x2 is one-to-one and monotonic, but not simple, and they increase in diff...
Currently I am using this:
def _get_mac_ver():
import subprocess
p = subprocess.Popen(['sw_vers', '-productVersion'], stdout=subprocess.PIPE)
stdout, stderr = p.communicate()
return stdout.strip()
Is there a better version (eg: by using built-in Python API)?
>>> print _get_mac_ver()
10.6.3
Note: I tried os.uname()[2...
I want to pass all the arguments passed to a function(func1) as arguments to another function(func2) inside func1
This can be done with *args, *kwargs in the called func1 and passing them down to func2, but is there another way,
Orignially
def func1(*args, **kwargs):
func2(*args, **kwargs)
but if my func1 signature is
def func1...
I have a wxPython application which allows the users to select items from menus that then change what is visible on the screen. This often requires a recalculation of the layout of panels. I'd like to be able to call the layout of all the children of a panel (and the children of those children) in reverse order. That is, the items wit...
My Case:
I'm working on a system that will need to create various X12 files for health care (insurance) transactions and inquiries (Specifically 270 Eligibility and 837 Claim).
I know there are good tools out there (pyx12 specifically) for converting between XML and X12, and actually I've gone as far as importing some components from ...
I have a list of users that only administrators can see (= few reads). This list also displays a count of the number of users in the datastore. Because the list could grow larger than 1000 my first thought was to avoid a normal count() and instead use a sharded counter.
However, the problem is that the admins also have access to various...
While trying to send form with image field in it I'm getting :
Exception Type: OSError at /user/register/
Exception Value: (13, 'Permission denied')
Of course first thing I've checked were the permissions to my folders, and just in case set them to 777 on the whole path from '/'. Still nothing. So I've tried adding parameters to setting...
I am trying to develop my first python web project. It have multiple tabs (like apple.com have Store, iPhone, iPad etc tabs) and when user click on any tab, the page is served from server.
I want to make sure that the selected tab will have different background color when page is loaded.
Which is a best way to do it? JavaScript/CSS/Direc...
This tutorial on using GObject in Python only covers using a property of type gobject.TYPE_FLOAT.
I've adapted it to use an enumerated type:
import pygtk
pygtk.require('2.0')
import gobject
FUEL_NONE = 0
FUEL_SOME = 1
FUEL_FULL = 2
class Car(gobject.GObject):
__gproperties__ = {
'fuel' : (gobject.TYPE_ENUM, ...
Take the following example:
>>> for item in [i * 2 for i in range(1, 10)]:
print item
2
4
6
8
10
12
14
16
18
Is [i * 2 for i in range(1, 10)] computed every time through the loop, or just once and stored? (Also, what is the proper name for that part of the expression?)
One reason I would want to do this is that I only want the ...
What I would like to do, is create a folder, where people can put in a file for testing, and have pyunit automatically expand in order to run the test as a separate test. Currently, what I'm doing is:
class TestName(unittest.testcase):
def setUp(self):
for file in os.listdir(DIRECTORY):
# Setup Tests
def te...
I am loading a data file with dated data into a csv.DictReader
The data looks like this:
date, weight, blood_pressure, sugar_level
1/1/01, 120.1, 100.1, 25.2
2/1/01, 130.1, 102.1, 26.2
3/1/01, 110.1, 120.1, 24.2
4/1/01, 130.1, 130.1, 28.2
5/1/01, 160.1, 104.1, 27.0
6/1/01, 150.5, 100...