Re: [Tutor] Which non SQL Database ?

2010-12-04 Thread Brett Ritter
On Sat, Dec 4, 2010 at 5:42 PM, Jorge Biquez jbiq...@icsmx.com wrote:
 Newbie question. Sorry.

If it isn't you're on the wrong list :)

 training so no pressure on performance). One application will run as a
 desktop one,under Windows, Linux, Macintosh, being able to update data, not
 much, not complex, not many records.

The important details here are: simple data, low-volume.  I'm assuming
this is single-user (as in, each instance of your application has it's
own DB)

 The second application, running behind
  web pages, will do the same,

Is this multiple users, each accessing the same DB?  That really
changes what you are looking for.

If you are dealing with single-user, or only a few users, I'd say look
into SQLite - It uses SQL syntax but doesn't run as a server and
stores the database as a single file.  It's great to use in small
projects because the syntax is the same as larger projects, and you
can replace with a full-blown multi-user SQL DB if you ever need to
without having to rework everything.  It's also very simple to use.  I
believe SQLite (sqlite3) is part of the core library in recent Python
versions, or available as a package for older pythons.

Berkeley DB is pretty much interchangeable with SQLite in terms of
functionality.  I much prefer SQLite.  If your web application intends
to have multiple users interacting with the same data, neither is
probably a good fit.

-- 
Brett Ritter / SwiftOne
swift...@swiftone.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What Python looks like

2008-08-05 Thread Brett Ritter
On Aug 4, 3:43 pm, Gary Herron [EMAIL PROTECTED] wrote:
 A page of Python code looks *clean*,  with not a lot of
 punctuation/special symbols and (in particular) no useless lines

I am actually going to buck the trend.

My first impression of Python was that it was visually hard to parse.

When seeing sample code from languages I don't know (.NET, Smalltalk,
etc) I can decipher the intent fairly easily (on simple code).
Python, on the other hand, used shorthand notation for everything.
Each word wasn't bad, but as a whole it tended to wash out informative
clues.  The lack of special symbols likewise removed visual parsing
clues.

Put another way, imagine math went from:
2 + 2 = 4
to:
two plus two equals four
and then someone decided to abbreviate:
two pl two eq four

When I ran into list comprehensions (Aah!  Now we have punctuation,
but it's not providing visual parsing clues, it's more like Lisp
parens!) or lambda definitions or self being added a lot, it grew
more dense.

This is NOT a rip on Python.  Please put the flamethrowers away.  I
appreciate that Python operates with a fairly dense use of information
and operations.  (Believe me, having done enough Java, I can
appreciate not having excessive syntax).  My point is that not
everyone new to Python is going to have a clean and clear first
impression, particularly based on their previous language experience.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Module clarification

2008-07-28 Thread Brett Ritter
On Jul 28, 4:54 am, Hussein B [EMAIL PROTECTED] wrote:
 Hi.
 I'm a Java guy and I'm playing around Python these days...
 In Java, we organize our classes into packages and then jarring the
 packages into JAR files.
 What are modules in Python?
 What is the equivalent of modules in Java?

I'm new myself, coming from Perl and Java.  Take my comments with the
appropriate salt.

Here's my understanding:

1) JARs are a bit of a Java oddity.  The other languages I've worked
with don't really combine their packaging method for transport with
their packaging method of access.  Put another way, you may get a
zipfile or tarball of library files, but they aren't USED in that
format, they are just transported in that format.  You unzip them and
use the compiled libraries directly.  Java appears to be unusual
there.  I could be wrong (it's a big world), but such is my experience
in the C and Perl worlds.

2) Java also dictates a single class per file (basically).  Other
languages do not have that restriction which leads to different
collections.  A file in Python (a module) may have several classes, or
just one, or none.  A package in Python is a directory containing
modules (and possibly other packages) as well as a __init__.py file.
This means that you cannot have the Java case of two packages offering
the same fully qualified resource, because the namespace is tied to
the filesystem (note you can alter this when importing the packages).

3) Java uses import to create a shortcut to the namespace, a
convenience for the programmer that has little to no bearing on the
execution of the code.  Namespace is determined by the classloader.
Python uses import to declare how a namespace is used by the code
itself, which can be very significant, (For example, Java can access
any fully qualified package without an import statement.  Python
cannot access any package until it has been made available by import.)

Hope that helps and is remotely accurate.  I'm sure someone will
correct me if I'm wrong.
--
http://mail.python.org/mailman/listinfo/python-list


Simple Path issues

2008-07-26 Thread Brett Ritter
New to Python, and I have some questions on how to best set up a basic
development environment, particular relating to path issues.

Note: I am not root on my development box (which is some flavor of
BSD)

Where should I develop my own modules so as to refer to them in the
standard way.  I.E. I want:
import proj

to work regardless of my current working directory, and to function as
if proj were a core or third-party module.

I saw that I can set PYTHONPATH, but that seems sub-prime.  I noted
that in installing pysqlite (the local installation of python is 2.4)
that I had it install in a lib under my home dir...should I use that
locale?

What is the command to tell me what directories python is checking in?

While I'm at it, what is the best (read: standard) locale to stick my
test cases?  same dir as my project?  A subdir?

Thanks in advance
--
http://mail.python.org/mailman/listinfo/python-list


Re: Simple Path issues

2008-07-26 Thread Brett Ritter
On Jul 26, 2:57 pm, Gary Josack [EMAIL PROTECTED] wrote:
 sys.path is a list that will tell you where python is looking. You can
 append to this in your scripts to have python look in a specific
 directory for your own modules.

I can, but that is almost certainly not the standard way to develop a
module.

I see nothing in sys.path that I have write permissions to.

Is altering my PYTHONPATH the normal way to develop (under the
assumption that later users will install in their conventional python
search path)?

--
http://mail.python.org/mailman/listinfo/python-list


New to Python, familiar with Perl - Seeking info sources

2008-07-24 Thread Brett Ritter
After many years happily coding Perl, I'm looking to expand my
horizons. [no flames please, I'm pretty aware of Perl's strengths and
weaknesses and I'm just here to learn more, not to enter religious
debates].

I've gone through some of the online tutorials and I'll be browsing
the reference before starting the code a lot phase.

My question is: What are the best sources to learn best practices or
get the answers to questions?  Are there any good sources to tell me
what Perl habits are good/bad in the Python paradigm?  What about
common packages that will change my life?  (I do a lot of web work,
but also a lot of DB reporting)  I'm also working as a Java developer
primarily, so I'm glad to see that Jython has been resurrected, but
I'm focusing on vanilla Python for the moment.

As examples: PerlMonks has been my info source.  The Perl Best
Practices and Higher Order Perl books have been my tutors into better
coding practices.  CPAN has my life easy, giving me access to the DBI,
Class::DBI (and its successors), HTML::FillInForm,
Data::FormValidator, CGI::Application, and Text::CSV::Simple modules
that are staples of my coding.   The (occasionally complete) Perl
Advent calendars have proven to be a good source to learn about
helpful modules that I might not otherwise stumble across.

(I've encountered Django, but I'm getting my fill of frameworks from
Java for the moment, so I'm looking for lightweight pieces at the
moment)

My (admittedly brief) searches here and on google didn't lead me to
any particular spots of concentrated Python info, and most of the Perl/
Python stuff is either a smug attack by one camp on the other or a
rant about the behavior of an obscure feature between the two.

Any recommendations?  Thanks in advance.



--
http://mail.python.org/mailman/listinfo/python-list