Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Saturday, June 5, 2010

Another cool NetBeans theme

I really like a dark background in my IDE. I previously mentioned the Aloha theme for NetBeans. I've been using if for a while.

Yesterday I found a version of Twilight for NetBeans. This one is set up for PHP, but works pretty well for Python. It is tweakable of course too.

Thursday, May 13, 2010

Gql and object inheritance

I am working on an AppEngine project using the Kay Framework.
I was testing my queries in Kay Framework's shell. If you are familiar with Django's shell it is essentially the same.

Running the following query :
query = db.GqlQuery("select * from MyUserObject where user_name = :1 and password = :2")
I got this error :
raise KindError('No implementation for kind \'%s\'' % kind)
I had imported the object. My object inherits from the framework's DatatstoreUser.


Changing to the following :
query = MyUserObject.gql("where user_name = :1", "testuser@testuser.com")
provided exactly what I needed.

Tuesday, April 28, 2009

Where is the site-packages directory on Mac OSX?

/Library/Python/2.5/site-packages

Running :
 python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"

As suggested in the Django documentation displays the directory.

Tuesday, April 8, 2008

Google AppEngine

New Google AppEngine!

Sweet, couldn't wait to use it. I started the tutorial during lunch. I downloaded and installed Python and the AppEngine. Then I created a work directory, "C:\google_workspace" and a helloworld folder, "C:\google_workspace\helloworld" just like the tutorial said to do, created the files "helloworld.py" and "app.yaml" just like in the tutorial, and fired up the dev_appserver with, "C:\google_workspace\helloworld>dev_appserver.py helloworld\". Instead of "Hello, world!" I got :

C:\google_workspace\helloworld>dev_appserver.py helloworld/
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\dev_appserver.py", line 50, in
<module>
execfile(script_path, globals())
File "C:\Program Files\Google\google_appengine\google/appengine/tools/dev_apps
erver_main.py", line 338, in <module>
sys.exit(main(sys.argv))
File "C:\Program Files\Google\google_appengine\google/appengine/tools/dev_apps
erver_main.py", line 287, in main
config, matcher = dev_appserver.LoadAppConfig(root_path, {})
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_apps
erver.py", line 2415, in LoadAppConfig
raise AppConfigNotFoundError
google.appengine.tools.dev_appserver.AppConfigNotFoundError

Hmm. I ran through a mental checklist before diving into the code (I knew I was being lazy. I was also really looking forward to diving into the code, but I wanted to at least get the thing running first.)
  • Perhaps I should've installed somewhere other than "C:\Program Files" I don't usually put anything in there.
  • Apparently I had Tomcat running which would be blocking 80 (I usually set Tomcat to 80 and JBoss to 8080).
Neither of those made a difference. "I, d, ten, t" error - I was running the wrong file.

Running, "C:\google_workspace\helloworld>dev_appserver.py ./" started the server.

The first line was a prompt, "Allow dev_appserver to check for updates on startup? (Y/n):"
Naturally I said "Y", and I liked name of the config file which was conveniently printed out on the next line, "dev_appserver will check for updates on startup. To change this setting, edit C
:\Documents and Settings\jdavis/.appcfg_nag"

I saw "Hello, world!"

I can't wait to start using this. Now I can finally build a completely scalable side project to make myself rich without spending any money out of pocket! Actually, I can finally stop putting off learning Python.
Blogged with the Flock Browser