Re: Help Required for Choosing Programming Language

2007-02-24 Thread Thomas Bartkus
On Mon, 19 Feb 2007 08:03:43 -0800, Andy Dingley wrote:


> GUI-based" is fairly unimportant as it's just how you build your
> programs, not what they do afterwards

Most user apps. require 95% of coding effort to provide a usable user
interface and 5% effort on the algorithmic meat.  The "afterwards" you
allude to. So why do we still endure so much programming effort on the
unimportant part?

Because elegent algorithms require bullet proof and intuitive user
interfaces or people won't use or buy your software.


> GUI programs are less important now than they were a few years ago,
> owing to the huge importance of the web and HTML.

Now with html the programming load rises to about 99.8% effort for the
user interface and 0.2% on the algorithmic core. All that coding
effort wasted on a user interface that looks and works like crap.

The top poster is quite correct to ask for a system like VB6 that banishes
the problem of user interface coding to the trivial role it deserves.
Why should a programmer waste even so much as 10% of his effort to throw
together a standard interface with ordinary textboxes, labels, and option
buttons?  Over and over again?

Thomas Bartkus

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


Re: Python, PostgreSQL, What next?

2006-12-02 Thread Thomas Bartkus
On Fri, 01 Dec 2006 23:04:37 -0800, vbgunz wrote:

> Hello all,
> 
> I've studied Python and studied PostgreSQL. What is the absolute next
> best step to take to merge these two finely together? I've heard of
> SQLAlchemy and some others but before I dive in, I would really like
> the opinion of those who tried it and other toolkits.
> 
> My main concern is, I would like to completely work with a database
> from Python. What would you suggest I look into?

Let me venture that the biggest problem most people seem to have is that
they endure great pain just to avoid learning SQL. SQL is a complete
programming language in and of itself with a breadth and depth that most
people miss.  And it covers much terrain missed by Python. Which is a good
thing because SQL and Python are perfect together.  With this language mix
you've got darn near everything licked.

Get SQL in your head and all you will need would be the db-api interface
with Postgres that Frederick Lundh pointed you to.  All you want to do is
throw SQL commands at Postgres and recover result sets into Python.

It's a cinch.
Thomas Bartkus



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


Re: Survival of the fittest

2006-09-26 Thread Thomas Bartkus
On Wed, 27 Sep 2006 01:51:43 +0200, baalbek wrote:


> Now, six years later, I use Python for about 70-80% of all my work (the 
> remainder being Ruby and C/C++).
> 
> I'm now having the policy: "If it's doable in Python, I'll use Python".


Okay.  How did your stated "policy" leave you still wasting 20-30% of your
programming efforts on other languages?

We would be curious to know about those things you can do in C++
but can't do in Python.
(Doubting) Thomas Bartkus


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


Re: Open file handles?

2006-08-09 Thread Thomas Bartkus

"Jon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Perhaps using os you could work with lsof
> [http://www.linuxcommand.org/man_pages/lsof8.html]
>
> Jon
>

Of course! That's perfect.
Thank you!

How silly of me not to have noticed that "lsof" means "ListOpenFiles" ;-)
Thomas Bartkus



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


Open file handles?

2006-08-08 Thread Thomas Bartkus
This may be more of a Linux question, but I'm doing this from Python. .

How can I know if anything (I don't care who or what!) is in the middle of
using a particular file?

This comes in context of needing to copy a file BUT only if I can verify
that something else doesn't have an open write handle to that file.  IOW - I
need to decline the operation if something else hasn't finished writing to
the file.

How can I know?
Thomas Bartkus


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


Re: Newbie question: what's with "self"?

2006-08-08 Thread Thomas Bartkus

"donkeyboy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This is probably a really basic question, but anyway ...
>
> I'm new to both Python and OO programming. From looking at a number of
> code examples, the word "self" is used a lot when referring to classes.
> As such, what does "self" mean and/or do? I've read things that say
> it's a naming convention, but no-one has really spelt it out (in idiot
> form!) in a way I can understand.
>
> Any help you can provide would be great: at the moment, when code
> doesn't work as expected, I'm randomly sprinkling "self"s in all over
> the place to see if that helps, but without much of an idea of what it
> really achieves.
>
> Thanks in advance!!
>

To put it simply, a class needs a way to know which instance (of itself!) to
operate on.

If you have a class "str" (and Python has that built in!), then there will
be many instances of class "str" in a typical program.  The parameter "self"
refers to the particular string the class method is being called to operate
upon.

If you have a method upper() that convert everything to uppercase, your
class definition would need the "self" parameter in order to know which
particular string to convert.

Thomas Bartkus


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


Re: using python at the bash shell?

2006-08-08 Thread Thomas Bartkus

"John Salerno" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all. I just installed Ubuntu and I'm learning how to use the bash
> shell. Aside from the normal commands you can use, I was wondering if
> it's possible to use Python from the terminal instead of the normal bash
> commands (e.g. print instead of echo). My main reason for asking is that
> I like using Python for everything, and if I don't need to learn the
> bash 'language', then I won't just yet.

The answer is yes and you are getting excellent tips from others.

I am just validating your experience by saying that coming from Python is a
barrier to my learning BASH.  The more I work with Linux/BASH, the more I
see how I might have used BASH to script something I have already done in
Python.  But the question that always comes up is why bother with BASH at
all ;-) And with Python available everywhere, 

I've just reconsiled to pick up my BASH by osmosis and concentrate on
(much!) cleaner scripting with Python.

Thomas Bartkus


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


Re: No need to close file?

2006-07-18 Thread Thomas Bartkus

"T" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Do I need to close the file in this case?  Why or why not?
>
> for line in file('foo', 'r'):
>   print line

Are you asking if you can get away without closing it?
Or are you asking if it is a good idea to not close it?

Good programming practice says that if you open it - you close it.

And stay out of trouble ;-)
Thomas Bartkus


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


Re: ideas for programs?

2006-05-31 Thread Thomas Bartkus
"Brandon McGinty" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I've been learning python for the past couple of months and writing misc
> scripts here and there, along with some web apps.
> I'm wondering if anyone has ideas of programs I might try my hand at
making?
> I'd appreciate it if they don't use images, because I'm blind.
>
> Also, I'm thinking of hiring myself out as a free-lance programmer.

Python is your tool to put your expertise on a computer.  Skill with Python,
or any computer language for that matter, counts for little.  Expertise that
you can code into a computer program however, counts for much. No matter
what the language you use to accomplish computer automation.

> Are there many individuals/companies which would aprove programs written
> in python?

Don't even ask that question.  It's irrelevant.
Companies approve programs that solve company problems!  Does anyone care
what Excel, Quickbooks, Autocad, Turbo Tax,  MySQL, whatever, are written
in?  No!

Automate something useful!  A bookeeping problem.  Or a computer networking
problem.
OR  a chemistry, cooking, gardening, truck routing, record keeping, music
problem.
What about new ways a computer might make life easier for the handicapped?
Or old ways done better.  How do the blind communicate with a computer?  I
see nothing but software opportunites yet undone.

Python plus expertise in something else.  It's the something else that hangs
people up.  You need to have or acquire that something else. I can't write a
bookeeping program if I don't understand bookeeping and my Python abilities
offer no relief from that particular deficiency.

> Most adds I've seen require the programmer have a strong grasp of c++ or
> java.

Those ads are worthless!  They are put forth by people with meaningless jobs
in human resources and no understanding of what one might do with computer
software.

Hobbies? Interests? Expertise?  What inspires you that might be put into
computer code?
You can't sell a program because it's written in Python. But you can sell a
Python program that solves a problem. Find a problem and beat it with
software.

The particular language you choose to use has nothing to do with it!

But we do like Python ;-)
Thomas Bartkus


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


Re: MySQLdb trouble

2006-05-10 Thread Thomas Bartkus

"John Salerno" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thomas Bartkus wrote:
>
> > 1) His code body will be less likely to cause migrane headaches when he
> > tries to read and interpret what he did a year from now.  If you are
trying
> > to figure out what is going on with the logic, user names and passwords
can
> > be so much chaff your brain needs to wade through in order to get to the
> > central idea.
> >
> > 2) The coder won't have to repeat himself if he needs to re-open the
> > databases.
>
> Ah, that makes sense! It seemed like an unnecessary step, but in some
> ways it might end up being more efficient.

For the machine - it *is* an unnecessary step.
For the human being who must write and maintain code, it is quite a useful
step.

And a very excellent coding habit to get into ;-)
Thomas Bartkus


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


Re: MySQLdb trouble

2006-05-10 Thread Thomas Bartkus
"John Salerno" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Nicolay A. Vasiliev wrote:
>
> > def loc_connect_db():
> >"""
> >The DB connection subroutine
> >"""
> >db = MySQLdb.connect(host = "localhost",
> >user = "root",
> >passwd="mysql",
> >db="some_db")
> >return db
>
> Hi. Sorry I can't help, but I'm interested in learning about mysqldb and
> I was wondering why you chose to wrap the 'connect' function inside your
> own function.

> Does this accomplish something that I'm not seeing?

Probably!

1) His code body will be less likely to cause migrane headaches when he
tries to read and interpret what he did a year from now.  If you are trying
to figure out what is going on with the logic, user names and passwords can
be so much chaff your brain needs to wade through in order to get to the
central idea.

2) The coder won't have to repeat himself if he needs to re-open the
databases.
He can just call his less comples loc_connect_db() function.

And know that #1 is a sufficient reason even if #2 doesn't apply!

   > Couldn't you just use the body of the loc_connect_db() function as your
   > actual code in order to get 'db'?

Yes you could!
It's really a matter of style and preference.  Some programmers (myself
included!)  prefer many, very short and simple functions over fewer function
with longer blocks of more complex code.

It's hard to make a mistake by having too many short and simple functions.

And much too easy to make them when you have too few ;-)
Thomas Bartkus

.


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


Re: python rounding problem.

2006-05-09 Thread Thomas Bartkus
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2006-05-08, Thomas Bartkus <[EMAIL PROTECTED]> wrote:
>
> >> Or you can write  0.1
> >>  3
> >>
> >> :)
> >
> > Ahhh!
> >
> > But if I need to store the value 1/10 (decimal!), what kind of
> > a precision pickle will I then find myself while working in
> > base 3?
>
> Then we're right back where we started.  No matter what base
> you choose, any fixed length floating-point representation can
> only represent 0% of all rational numbers.
>
> So, clearly what we need are floating point objects with
> configurable bases -- bases that automatically adjust to
> maintain exact representation of calculation results.  Which
> probably exactly the same as just storing rational numbers as
> numerator,denominator tuples as you suggest.
>
> > How much better for precision if we just learn our fractions
> > and stick to storing integer numerators alongside integer
> > denominators in big 128 bit double registers ?

I completely overlooked the infinite (presumably!) length integer handling
in Python.  You can do integer arithmetic on integers of large and arbitrary
lengths and if ultimate precision were indeed so important (and I can't
imagine why!) then working with numerators and denominators stored as tuples
is quite practical.

Anyone old enough to remember Forth might remember the arguments about how
unnecessary floating point is.  True enough!  Floating point is merely a
convenience for which we sacrifice some (insignificant!) arithmetic
precision to enjoy.

> > Even the Nenets might become more computationally precise by
> > such means ;-) And how does a human culture come to decide on
> > base 9 arithmetic anyway?
>
> I've no clue, whatsoever.  I just stumbled across that factoid
> when I used Wikipedia to look up which civilizations used
> base-60.  For some reason I can never remember whether it was
> one of the mesoamerican ones or one of the mesopotamian ones.

I suspect a hoax or an urban legend here.  A brief and casual googling
brings up the Nenets but no mention of base 9 arithmetic which I would find
rather astonishing.
Look up the Tasaday tribe together with the word "hoax".  A great joke on
academic anthropologists really.

On the other hand, the name "Nenet" is full of "N"s and so evocative of the
number nine ;-)

> > Even base 60 makes more sense if you like it when a lot of
> > divisions come out nice and even.
>
> Did they actually have 60 unique number symbols and use
> place-weighting in a manner similar to the arabic/indian system
> we use?

I don't know.
I do know that we have 360 degrees in a circle for the simple reason that
this is evenly divisible by so damned many integers.  A significant and
logical convenience if you have to do all your calculations on a wooden
board using the chunk of charcoal you hold in your fist.

Thomas Bartkus

> > Do the Nenets amputate the left pinky as a rite of adulthood
> > ;-)
>
> Nah, winters up there are so friggin' cold that nobody ever has
> more than nine digits by the time they reach adulthood.
>
> -- 
> Grant Edwards   grante Yow!  Hello. Just walk
>   at   along and try NOT to
think
>visi.comabout your INTESTINES
being
>almost FORTY YARDS
LONG!!


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


Re: python rounding problem.

2006-05-08 Thread Thomas Bartkus
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2006-05-08, Thomas Bartkus <[EMAIL PROTECTED]> wrote:
>
> >> does python support true rations, which means that 1/3 is a
> >> true one-third and not 0.3 rounded off at some
> >> arbitrary precision?
> >
> > At risk of being boring  ;-)
> >
> > - Python supports both rational and irrational numbers as
> >   floating point numbers the way any language on any digital
> >   computer does - imprecisely.
> >
> > A "true" (1/3) can only be expressed as a fraction.
>
> At the risk of being both boring and overly pedantic, that's
> not true.  In base 3, the value in question is precisely
> representable in floating point: 0.1
>
> > As soon as you express it as a floating point - you are in a
> > bit of trouble because that's impossible.
>
> It's not possible in base 2 or base 10.  It's perfectly
> possible in base 9 (used by the Nenets of Northern Russia) base
> 12 (popular on planets where everybody has twelve toes) or base
> 60 (used by th Sumerians).  [I don't know if any of those
> peoples used floating point in those bases -- I'm just pointing
> out that your prejudice towards base 10 notation is showing.]
>
> > You can not express (1/3) as a floating point in Python any
> > more than you can do it with pencil and paper.
>
> That's true assuming base 2 in Python and base 10 on paper. The
> base used by Python is pretty much etched in stone (silicon, to
> be precise).  There used to be articles about people working on
> base-3 logic gates, but base-3 logic never made it out of the
> lab. However, you can pick any base you want when using paper
> and pencil.
>
> > You can be precise and write "1/3" or you can surrender to
> > arithmetic convenience and settle for the imprecise by writing
> > "0.3", chopping it off at some arbitrary precision.
>
> Or you can write  0.1
>  3
>
> :)

Ahhh!
But if I need to store the value 1/10 (decimal!), what kind of a precision
pickle will I then find myself while working in base 3 ?  How much better
for precision if we just learn our fractions and stick to storing integer
numerators alongside integer denominators in big 128 bit double registers ?

Even the Nenets might become more computationally precise by such means ;-)
And how does a human culture come to decide on base 9 arithmetic anyway?
Even base 60 makes more sense if you like it when a lot of divisions come
out nice and even.

Do the Nenets amputate the left pinky as a rite of adulthood ;-)
Thomas Bartkus




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


Re: python rounding problem.

2006-05-08 Thread Thomas Bartkus
"Gary Wessle" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Erik Max Francis <[EMAIL PROTECTED]> writes:
>
> > chun ping wang wrote:
> >
> > > Hey i have a stupid question.
> > > How do i get python to print the result in only three decimal
> > > place...
> > > Example>>> round (2.9954254, 3)
> > > 2.9951
> > > but i want to get rid of all trailing 0's..how would i do that?
> >
> > Floating point arithmetic is inherently imprecise.  This is not a
> > Python problem.
>
> does python support true rations, which means that 1/3 is a true
> one-third and not 0.3 rounded off at some arbitrary precision?

At risk of being boring  ;-)

- Python supports both rational and irrational numbers as floating point
numbers the way any language on any digital computer does - imprecisely.

A "true" (1/3) can only be expressed as a fraction. As soon as you express
it as a floating point - you are in a bit of trouble because that's
impossible.  You can not express (1/3) as a floating point in Python any
more than you can do it with pencil and paper.  You can be precise and write
"1/3" or you can surrender to arithmetic convenience and settle for the
imprecise by writing "0.3", chopping it off at some arbitrary
precision.

Which is exactly what you did in your post ;-)
Thomas Bartkus


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


Re: python application ideas.

2006-04-25 Thread Thomas Bartkus
"Anthony Greene" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello, I know this isn't really a python centric question, but I'm seeking
> help from my fellow python programmers. I've been learning python for the
> past year and a half, and I still haven't written anything substantial nor
> have I found an existing project which blows my hair back. Python is my
> first language, and I plan on learning lisp within the next week but
> before I do so I'd like to write something meaningful, does anyone have
> any suggestions? Something they always needed, but never got around to
> writing it? Without an imagination you pretty much stagnate your whole
> learning process. Thanks in advance.

Just what is it, other than programming, that you have expertise in?
What kind of problems do you know how to solve?

> Without an imagination you pretty much stagnate your whole
> learning process.

So true!  Unfortunately, no one can provide you with one.
You have to develop that yourself.

Tis the conundrum of programming in general.  If all you know how to do is
write code - then you truly have nothing to do.  What *other* interests do
you have?  Hobbies? Job Skills?
What *does* "blow your hair back" ;-)

That's where your programming ideas need to come from.
Thomas Bartkus




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


Class __init__ behaviour

2006-04-20 Thread Thomas Bartkus
If I insert an __init__ method in my own class definition, it is incumbent
upon me to call the __init__ of any declared ancester to my new class object
because my __init__ will override that of any ancester I declare in the
header.  If I fail to call the ancesters __init__, then it won't happen.
The ancester object won't be initialized.

   But

If I *don't* insert my own __init__ in my new class, then any declared
ancester __init__ will automatically run because I haven't overridden the
ancesters __init__ method with my own.

Did I get that straight?
Thomas Bartkus


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


Re: nested functions

2006-04-14 Thread Thomas Bartkus
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi
> just curious , if i have a code like this?
>
> def a():
>   def b():
> print "b"
>   def c():
> print "c"
>
> how can i call c() ??

Your function 'a' is it's own little world where functions 'b' and 'c'
exist.
Your code inside 'a' can call 'b' or 'c' - neat as you please.

BUT 'b' and 'c' simply do not exist outside the 'a' world.  This is perfect
because you are in control - building worlds according to your own design.
Had it not been your intention to hide 'b' and 'c', you would not have
isolated them in this manner inside of  'a' .

I, for one, am so glad to have nested functions again ;-)
Thomas Bartkus


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


Re: Python editing with emacs/wordstar key bindings.

2006-04-13 Thread Thomas Bartkus
"Carl Banks" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thomas Bartkus wrote:
> > Does anyone use emacs together with both WordStar key bindings and
python
> > mode?  I'm afraid that Wordstar editing key commands are burned R/O into
my
> > knuckles!
>
> Old Borland C user?

Worse than that!  It starts with Wordstar itself on a terminal to cp/m.
It continued with Borland Pascal -> Delphi.

Wordstar key controls are the only key bindings that are ergonometric on a
qwerty keyboard.  If you do serious typing, you don't break stride to issue
editing commands.

> > I would like to play with emacs for Python editing but I'm having (2)
> > problems.
> >
> >1) When I load a .py file, emacs automatically overrides my
wordstar-mode
> > with python-mode, forcing all the keybindings back to emacs native keys.
> > Why?
> >
> > Why should a python-mode care what key bindings are in use?
>
> Python and wordstar are both major modes.  When python-mode is loaded,
> it replaces (not sits atop of) wordstar-mode; you can't have two major
> modes loaded at the same time.
>
> If you want just want to use wordstar mode, you can prevent Emacs from
> loading python mode by putting -*- mode: wordstar -*- on the first line
> of the Python file (or second line if it uses a #!).  Or, you could
> remove python mode from the auto-mode-alist and interpreter-mode-alists
> in your .emacs file, which I leave as an exercise.

I do notice that I can invoke wordstar-mode *after* loading the .py file and
get the whole enchilada.  The Wordstar key bindings with the syntax
highlighting.
It just strikes me as odd that key bindings should be reasserted by invoking
python-mode.

Perhaps python-mode shouldn't be an emacs "major mode".
We just want syntax highlighting and some minor formatting assist.  Key
bindings have nothing to do with the language. I need to learn how to edit
the key re-assignment out of python-mode.el  .

> >2) We get  for block indentation instead of the spaces I prefer.
>
> In your .emacs file:
>
> (setq indent-tabs-mode nil)

Thank you.  That helps

> > Is there a better python-mode script I should be using other than the
> > default that came with emacs?
>
> I doubt there's one that solves your problem.

Yes.
The *real* problem here is that I need to get down and dirty with emacs/lisp
when all I started looking for was a more robust editor for Python ;-)

> Carl Banks
>


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


Python editing with emacs/wordstar key bindings.

2006-04-11 Thread Thomas Bartkus
Does anyone use emacs together with both WordStar key bindings and python
mode?  I'm afraid that Wordstar editing key commands are burned R/O into my
knuckles!

I would like to play with emacs for Python editing but I'm having (2)
problems.

   1) When I load a .py file, emacs automatically overrides my wordstar-mode
with python-mode, forcing all the keybindings back to emacs native keys.
Why?

Why should a python-mode care what key bindings are in use?

   2) We get  for block indentation instead of the spaces I prefer.

Is there a better python-mode script I should be using other than the
default that came with emacs?

Any tips/hints appreciated.
Thomas Bartkus


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


Re: Override on terminal

2006-04-11 Thread Thomas Bartkus
"fivestars" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi there.
>
> I'm computer science student at the end of my degree. I'm new about
> python.
>
> I've a question for all of you.
>
> Do you know how to write, from python code, on a unix(linux) terminal
> on specified coordinates?

Actually, there is no unix(linux) terminal.  What you have are terminals, of
various flavors, that can be attached to a unix(linux) session.

Once you decide to stray from generic spaces and tab formatting, it is the
terminal that has fancy features such as positioning the cursor at arbitrary
coordinates. And every terminal type has a different command sequence to
achieve that. That said, there are standards such as the VT-100 terminal
that everything seems to emulate.  You would need to have the VT-100 command
set in front of you and you would code this into your python routines.

Someone else has suggested the "curses" module.  I haven't played with this
but it is probably just the ticket you are looking for. It no doubt encloses
cgoto commands, blink, highlight, clear screen, color command & yada yada
for various terminal types inside nice python functions

And I'll be surprised if it doesn't default to VT-100 ;-)

> And also: is it possible to override, from python code, something on a
> unix(linux) terminal?

I don't know what that means.
If you meant overwrite (rather than override!), then the answer would be
yes.

Thomas Bartkus

> I would have a suggestion that won't use files.
>
> I hope that i've been clear.
>
> Thanks,
>
>   Mattia
>


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


Re: Indentation/whitespace

2005-12-23 Thread Thomas Bartkus
"Joe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is Python going to support s syntax the does not use it's infamous
> whitespace rules? I recall reading that Python might include such a
> feature. Or, maybe just a brace-to-indentation preprocessor would be
> sufficient.
>
> Many people think Python's syntax makes sense. There are strong
> feelings both ways. It must depend on a person's way of thinking,
> because I find it very confusing, even after using with Python for some
> time, and trying to believe the advice that I would learn to like it.
> The most annoying thing is that multiple dedents are very unreadable. I
> still don't understand how anybody can think significant-but-invisible
> dedentation is a good thing.
>
> Note: No need to follow up with long opinions of why indentation is
> good -- they have been posted hundreds of times. It just seems that
> Python developers think the whitespace thing is only an issue for
> newbies. I think that many experienced users don't learn to like it,
> but instead just learn to live with it.

Okay - I'll take your note and not argue about "why indentation is good"

But - why should Python
   "support s syntax the does not use it's infamous whitespace rules"
It's unique to Python. That's what Python *is*.

If one doesn't like it, one needn't waste one's time with it.  No other
other language abides by those rules except Python.

So just choose a different language to work with.
Thomas Bartkus


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


Re: Python and MySQL

2005-11-03 Thread Thomas Bartkus
"Magnus Lycka" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thomas Bartkus wrote:
> > But heck!  Now I'm looking at the /usr/lib/python2.3/site-packages on a
> > Mandrake Linux box.  No [_mysql.] pyd here! Fewer files overall and
while
> > there are other file extensions, everything seems to have a
corresponding
> > [.py].
>
> I suspect you might find _mysql.so there. If you find any .pyd files I
> think you can safely remove them, since Windows DLLs work poorly in
> Linux anyway. Aren't you starting to suspect that you don't really know
> what you are talking about in this particular case?

Yes!

And thank you so much for pointing that out :-)
Thomas Bartkus

> Where is the pure
> Python code that actually communicates with the database server? Have
> you found a single line of code that actually does that? How does it
> communicate? Isn't there an 'import _mysql' somewhere? Where is the
> _mysql.py then?
>
> What's this?
> http://cvs.sourceforge.net/viewcvs.py/mysql-python/MySQLdb/_mysql.c
>
> What's this doing in setup.py?
>  'ext_modules': [
>  Extension(
>  name='_mysql',
>  sources=['_mysql.c'],
>  include_dirs=include_dirs,
>  library_dirs=library_dirs,
>  libraries=libraries,
>  extra_compile_args=extra_compile_args,
>  extra_objects=extra_objects,
>  ),
>  ],


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


Re: Python and MySQL

2005-11-03 Thread Thomas Bartkus
"Steve Holden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thomas Bartkus wrote:
> > "Steve Holden" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> >>I have a _mysql.c as a part of my distrbution of MySQLdb. Don't you?
> >>
> >
> >
> > You made me give that library a good hard stare.
> >
> > And no - everything is enunciated in clear Python (.py) code with
> > corresponding (.pyc) and (.pyo).  It appears we have Python source for
> > everything.
> >
> >FWIW:
> >
> >
> >>>>print MySQLdb.version_info
> >
> > (1, 2, 0, 'final', 1)
> >
> OK. I saw that my own version was (1, 0, 0, 'final', 1), so I assumed
> Andy's updated the package somewhat. However, downloading the source of
> 1.2 I see that _mysql.c still appears, and that the package's
> __init__.py still includes the line
>
> include _mysql
>
> My C:\Python24\Lib\site-packages directory does contain a _mylsql.pyd
> file. Would you like to check that we are talking about the same module?

Okay - I neglected to look at the [site-packages] directory itself.  Here I
do find [_mysql.pyd] full of binary code.  A MySQLdb related file that
doesn't seem to have a corresponding file with Python source code. Mea
culpa! This is on  MS Windows [C:\Python23].

But heck!  Now I'm looking at the /usr/lib/python2.3/site-packages on a
Mandrake Linux box.  No [_mysql.] pyd here! Fewer files overall and while
there are other file extensions, everything seems to have a corresponding
[.py].

print MySQLdb.version_info
(0, 9, 2, 'final', 1)

Thomas Bartkus



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


Re: Python and MySQL

2005-11-02 Thread Thomas Bartkus
"Steve Holden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thomas Bartkus wrote:
> > Well, I'm looking at the source for the ever popular MySQLdb library. It
> > appears to be nothing but straight up Python source code. I see no
reason
> > why you couldn't just take these modules and put them in your own
private
> > directory. There is nothing secret here.
> >
> I have a _mysql.c as a part of my distrbution of MySQLdb. Don't you?
>

You made me give that library a good hard stare.

And no - everything is enunciated in clear Python (.py) code with
corresponding (.pyc) and (.pyo).  It appears we have Python source for
everything.

   FWIW:

>>> print MySQLdb.version_info
(1, 2, 0, 'final', 1)

There doesn't seem to be .c code to be found anywhere.
Thomas Bartkus


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


Re: Python and MySQL

2005-11-02 Thread Thomas Bartkus
"Aquarius" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I appologize in advance for this strange (and possibly stupid)
> question.
>
> I want to know if there is a way to interface a MySQL database without
> Python-MySQL or without installing anything that has C files that need
> to be compiled. The reason for this, is that I want to develop a
> certain web application, but my hosting provider ([EMAIL PROTECTED]@#%) isn't 
> very
> eager to supply Python-MySQL (or any modules to python). Is there an
> alternative approach I could use to pass around this ridiculos lack of
> functionality?

Well, I'm looking at the source for the ever popular MySQLdb library. It
appears to be nothing but straight up Python source code. I see no reason
why you couldn't just take these modules and put them in your own private
directory. There is nothing secret here.

But

As others have already pointed out, after you go to this trouble, your
hosting provider will still suck!  I'm sure you can you can get lot's of
suggestions for a suitable replacement.

Thomas Bartkus


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


Re: Dealing with Excel

2005-10-18 Thread Thomas Bartkus
"Robert Hicks" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I need to pull data out of Oracle and stuff it into an Excel
> spreadsheet. What modules have you used to interface with Excel and
> would you recommend it?

What does one use to bind Microsoft libraries to Python?
I think it would be "win32com" and I confess to not having used it.

Best bet would be to use Microsofts ADODB library together with Excels own
CopyFromRecordset function. Using ADODB, you can easily create a connection
to an Oracle server.  You would use this to stuff an ADODB.Recordset object
with query results.  Once you have your recordset stuffed with query results
you can pass it to the Excel "CopyFromRecordset" function:

Worksheets("Whatever").Cells(1,1).CopyFromRecordset  {recordset object}

and wham!  - You have it in a table on a worksheet.

Thomas Bartkus




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


Re: Python reliability

2005-10-10 Thread Thomas Bartkus
"Ville Voipio" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> In article <[EMAIL PROTECTED]>, Paul Rubin wrote:


> I would need to make some high-reliability software
> running on Linux in an embedded system. Performance
> (or lack of it) is not an issue, reliability is.

> The software should be running continously for
> practically forever (at least a year without a reboot).
> is the Python interpreter (on Linux) stable and
> leak-free enough to achieve this?

>
> Adding the Python interpreter adds one layer on uncertainty.
> On the other hand, I am after the simplicity of programming
> offered by Python.


> I would need to make some high-reliability software
> running on Linux in an embedded system. Performance
> (or lack of it) is not an issue, reliability is.

> The software should be running continously for
> practically forever (at least a year without a reboot).
> is the Python interpreter (on Linux) stable and
> leak-free enough to achieve this?


All in all, it would seem that the reliability of the Python run time is the
least of your worries.  The best multi-tasking operating systems do a good
job of segragating different processes BUT what multitasking operating
system meets the standard you request in that last paragraph?  Assuming that
the Python interpreter itself is robust enough to meet that standard, what
about that other 99% of everything else that is competing with your Python
script for cpu, memory, and other critical resources? Under ordinary Linux,
your Python script will be interrupted frequently and regularly by processes
entirely outside of Python's control.

You may not want a multitasking OS at all but rather a single tasking OS
where nothing  happens that isn't 100% under your program control. Or if you
do need a multitasking system, you probably want something designed for the
type of rugged use you are demanding.  I would google "embedded systems".
If you want to use Python/Linux, I might suggest you search "Embedded
Linux".

And I wouldn't be surprised if some dedicated microcontrollers aren't
showing up with Python capability.  In any case, it would seem you need more
control than a Python interpreter would receive when running under Linux.

Good Luck.
Thomas Bartkus




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


Re: Python, Mysql, insert NULL

2005-10-06 Thread Thomas Bartkus
"Steve Holden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> >
> If you don't understand parameterized SQL queries you would do well to
> refrain from offering database advice :-)

Did the poster ask a question about parameterized queries or server
security?

> Presumably you always check whether StrToConcatenateIntoSqlStatement
> contains no apostrophes before you actually construct the SQL?
>
> Can we say "SQL injection exploit"?

Not every query passes along public internet wires and all the guy asked for
was how to insert a Null.

But - I really do appreciate your concern :-)
Thomas Bartkus



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


Re: Python, Mysql, insert NULL

2005-10-05 Thread Thomas Bartkus
"Python_it" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I know how to insert values in a database.
> That's not my problem!
> My problem is how i insert NULL values in de mysql-database.
> None is een object in Python and NULL not.
> None is not converted to NULL?
> Table shows None and not NULL!

MySQL accepts and understands the keyword "Null" directly.
When you list your VALUE parameters in an INSERT statement, a null is simply
the string "Null".
Don't quote the word "Null" inside your sql statement, MySQL understands it
directly. If you do quote it, MySQL will think you are talking about a
string value that happens to be spelled "N u l l"

Your sql string needs to end up looking something like this -
sql = "INSERT INTO SomeTable (This, That, TheOther) VALUES (3, 12, Null)"
   or
sql = "UPDATE sometable SET TheOther=Null WHERE something =
SomeThingOrOther"
   before you
cursor.execute(sql)

Notice that the MySQL keyword "Null" stands naked within each string.

Others here have pointed out that the Python keyword "None" is converted to
"Null" when passed to MySQL. I don't quite understand this and don't really
care.  If I have a Python variable that has a value None, and I want to
transmit this to MySQL as Null - I would:

   if somevar == None:
   StrToConcatenateIntoSqlStatement = "Null"
   else:
   StrToConcatenateIntoSqlStatement = somevar

All of which assumes, of course, that the field you are targeting will
accept a Null value.
Thomas Bartkus


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


Re: aproximate a number

2005-08-29 Thread Thomas Bartkus
On Sun, 28 Aug 2005 23:11:09 +0200, billiejoex wrote:

> Hi all. I'd need to aproximate a given float number into the next (int) 
> bigger one. Because of my bad english I try to explain it with some example:
> 
> 5.7 --> 6
> 52.987 --> 53
> 3.34 --> 4
> 2.1 --> 3
> 

The standard way to do this is thus:

def RoundToInt(x):
""" Round the float x to the nearest integer """
return int(round(x+0.5))

x = 5.7
print x, '-->', RoundToInt(x)
x = 52.987
print x, '-->', RoundToInt(x)
x = 3.34
print x, '-->', RoundToInt(x)
x = 2.1
print x, '-->', RoundToInt(x)

5.7 --> 6
52.987 --> 53
3.34 --> 4
2.1 --> 3


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


Embedding Python in other programs

2005-08-25 Thread Thomas Bartkus
Name: lib64python2.4-devel
Summary: The libraries and header files needed for Python development

Description: The Python programming language's interpreter can be extended
with dynamically loaded extensions and can be embedded in other programs.
This package contains the header files and libraries needed to do these
types of tasks.
--


*** The Python programming language's interpreter ... can be embedded in
other programs. ***

That's very intriguing!
But I can't seem to locate much information about this.

Can anyone direct me to greater enlightenment?
Thomas Bartkus

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


Re: Obfuscator for Python Code

2005-08-17 Thread Thomas Bartkus
"codecraig" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there any obfuscator out there that obfuscates the python code (byte
> code i guess)???

Hmmhh!
I know lots of obfuscators for VB, C, and Java.  For these languages, it
seems to be one of the more popular coding specialties.  Certainly, I don't
see much reason why one couldn't obfuscate Python code.  It's just that
coders with an aptitude for obfuscation don't seem to like the Python
language very much.

Perhaps if the "help wanted" ads contained more Python posting, the
obfuscators might be tempted to flock to it :-)
Thomas Bartkus



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


Re: Python as VBA replacement under Windows?

2005-08-17 Thread Thomas Bartkus

"Wolfgang Keller" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Because the MS Office suite and a few (very few!) other applications
expose
> > their object models via COM, you can manipulate these programs with
Python
> > and other languages.  No applicatoin "supports VBA as a macro language".
>
> What I meant was that quite a lot of Windows applications (not only MS
> Office) allow to execute VBA scripts just like "macros" from within the
> application. What I want now is to write a "dummy" VBA script
> "container" that consists of/executes Python sourcecode by calling the
> Pythonwin interpreter.

I *think* you may want to approach this from the other way around.  If it
were me, I would write a Python app that initates, and maintains handles to,
the target Windows app.  The controlling Python app could then drop from
sight and respond as necessary to events occurring within the Windows app.
This is the way you would do it from an external VB app.

> > Rather - VBA is bundled and integrated with MS Office in order to
manipulate
> > COM.  You can use Python to do that too!
>
> Yup, from outside. What I would like to do is do it from "inside" the
> application.

I don't *think* this is possible.  Nor do I think this is worth worrying
about.  You write VB/VBA applications to work either from the inside (in
process) or the outside (out of process) with the former being somewhat more
efficient.  Unfortunately, this is where VBA with it's integrated editor is
woven into the warp and woof  of MS Office. You are stuck running "out of
process" with Python. But again, I don't really see this as being worth
worrying about.

> > "perfectly possible"?
>
> Well, at least as far as there's a COM interface and for someone who
> refuses to learn VB(A) but still wants to script Windows applications.

I have dabbled a bit using Python to control Excel.  But just a bit.  It's
just too easy to invoke VBA behind Excel and fire away - even if the
resulting code isn't nearly so elegant! Somewhere out there, is a project to
integrate Python into Visual Studio.  Microsoft has rewritten Visual Studio
to enable the integration of 3rd party languages.  That might hold some
promise for you although I have not been following developments here very
closely.

As for me - I'm sick of the directions MS is taking.  I'm looking to
Gnumeric/Python as an open source replacement to Excel/VBA :-)
Thomas Bartkus



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


Re: GUI tookit for science and education

2005-08-17 Thread Thomas Bartkus
"Paul Rubin"  wrote in message
news:[EMAIL PROTECTED]
> Mateusz £oskot <[EMAIL PROTECTED]> writes:
> > Thank you for any piece of advice in advance.
>
> Ask yourself why you want a GUI toolkit.  Maybe you can write a web
> application instead, and use a browser as the GUI.  That's a lot
> easier to write (just use html), and makes it trivial to run the
> application and the browser on separate machines.

Wow Paul!
I just couldn't help zeroing on that comment.
> a lot easier to write (just use html),

I would have used adjectives like "clunky" and "limited" when talking about
using an html in a browser app.  Particularly if we are talking about high
powered math/graphs as we often are in the science apps indicated in the
original post.

I would take MS Excel/VBA as the premier fat client prototyping tool/GUI
toolkit for science & education.  How would one go about replicating any of
that in an HTML/browser app?  How do we get to "easier to write"?

> Ask yourself why you want a GUI toolkit.
I just did.  The answer is that I don't *think* you can do much of that with
html.

Then again - I was wrong once :-)
-Tom


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

Re: Python as VBA replacement under Windows?

2005-08-17 Thread Thomas Bartkus
"Wolfgang Keller" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> this is a potentially veeery dumb question, but:
>
> - If an application supports VBA as a macro language,
> - and if you can execute Python code from within a VBA script (how?)
> - and if the application exposes its VBA scripting interface through
> COM
>
> then it should be perfectly possible to entirely replace VBA in nearly
> all Windows applications with Python, right?
>
> TIA,
>
> sincerely,
>
> Wolfgang Keller

"perfectly possible"?  Hmmmhh!

Because the MS Office suite and a few (very few!) other applications expose
their object models via COM, you can manipulate these programs with Python
and other languages.  No applicatoin "supports VBA as a macro language".
Rather - VBA is bundled and integrated with MS Office in order to manipulate
COM.  You can use Python to do that too!

   However

It is difficult to argue with the built in integrated editor/debugger behind
Excel, Word, PowerPoint, et al with the scripts packaged seamlessly inside
the application files.  It's also difficult to argue with the myriad of
built in VBA functions that are custom designed to ease the pain of working
with Windows internals.

   On the other hand

I can think of nothing that you can do with VBA but can not do with Python.
It just takes a bit more effort and you need to know more of Windows
internals in order to pull it off.

"perfectly possible"?

I'm still thinking :-)
-Tom


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


Re: Why Tcl/Tk?

2005-07-28 Thread Thomas Bartkus

"William Park" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Jerry He <[EMAIL PROTECTED]> wrote:
> > I'm a little curious, why does most scripting
> > languges(i.e. python and ruby) use Tcl/Tk rather than
> > wx or Fox as its standard GUI? Although I did notice
> > that the Vpython IDE that uses Tkinker starts up a lot
> > faster than the DrPython IDE that uses wxpython. But
> > that makes no sense, Tk is based on Tcl, a scripting
> > language, but wx is written in C++.
>
> Old habits die hard.  Soon, these folks will die off, and we'll be left
> with GTK+ or wxWidgets.
>

Ahhh! That devilish little "or"

If we only knew which one :-)
Thomas Bartkus


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


Re: Opinions on KYLIX 3 (Delphi 4 Linux)

2005-07-21 Thread Thomas Bartkus
On Wed, 20 Jul 2005 18:37:48 +1000, David Trudgett wrote:


> My advice would be to steer clear of Kylix and choose one of the other
> environments suggested to you. If you really like Pascal, fpc may be a
> possibility as someone mentioned. ...


Well - I really like Python!

But - climbing back on the soapbox - far more important than any
linguistic quibble is a robust GUI interface that might *unburden* any
language from the tedium of creating a powerful and effective user
interface.

I would go so far as to say that, while this is the only thing an atrocity
like VB has going for it, it *trumps* most everything. This was the great
hope of the Delphi<->Kylix thing.  The Windows implemntation (Delphi)
was/is a magnificent productivity tool.  And if Kylix has failed then we
are still scratching about with TKinter, Glade, wxGlade, EasyGUI, or
{whatever} just to to bring up the rear on Linux.

Python is fun, but how do we get it to desktop primetime ?
Thomas Bartkus

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


Re: Opinions on KYLIX 3 (Delphi 4 Linux)

2005-07-18 Thread Thomas Bartkus
On Mon, 18 Jul 2005 19:56:24 -0400, Mike Meyer wrote:

> "Thomas Bartkus" <[EMAIL PROTECTED]> writes:
>>> > Re-train on a new platform,
>>> > and re-write from scratch?
>>
>> What do you do when an open source project you were using gets
>> abandoned?
> 
> cvs import -m "sources for orphaned project" 
>  
> 
>> Hard to see much difference here.
> 
> Doing support for object-only distributions is *much* harder than doing
> it for source distributions.
> 
> I have a habit of picking products based on technical superiority, not
> popularity. As a result, I have a nice collection of orphans. That's
> because technical quality has little or nothing to do with
> profitability.
> 
> On the other hand, since starting to use open source projects, I've
> never had one I depend on fail. I've had some I contributed to fail, but
> that's a different thing.

I didn't suggest that orphaned open source projects were a problem.  I
simply point out that they are no more, nor less, of a problem than an
orphaned (and paid for!) commercial product.

> I suspect that technical quality in open source projects contributes to
> their attracting people to support them.

Perhaps.  And there is no way to support a commercial product other than
by becoming an employee.

> This makes them ever so
> much more attractive than proprietary solutions, where technical quality
> seems to be irrelevant to longevity.

This last statement sounds too much like a canard. It is difficult to deny
that commercial products either put some significant value on the table or
go bust. Although people can be, and sometimes are, swindled few can
afford to simply throw their money away. IOW - technical quality is
*never* irrelivant to longevity.  And one must also consider that
technical merit, by itself, is rarely sufficient.  The open source world
is awash with much that is high on technical merit but commercially
unviable. There is much out there that one would gladly pay good $ for if
only for lack of that last (but most difficult!) 5% effort that would
bring many of these projects to fruition.

Which brings me back to the point that the difference between free and
$500 (or $1000!) amounts to virtually *nothing* when evaluating a tool.

You use what is most effective to get the job done.
Thomas Bartkus


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


Re: Opinions on KYLIX 3 (Delphi 4 Linux)

2005-07-18 Thread Thomas Bartkus
"windozbloz" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Bye Bye Billy Bob...
>
> I'm back with one more question, then I'll chill.  I have scoured the news
> and net for info about Borlands KYLIX 3 and have found little technical
> info about it.  Their screen shots are very impressive, similar to Visual
> Basic.  I have sent several emails to Borlands Sales and Pre-Sales
> departments.  Pre-Sales bounces and Sales won't answer.  I'm sitting here
> with money in hand ready to buy but not from a company that won't give me
> the time of day.
>
> Does anyone of you have experiance with KYLIX 3 and do you think I should
> consider buying it?  Thank You, I'll go oil my keyboard now.

Good question!  Wither Borland?

My impression (second hand - based on no direct experience with Kylix!) is
that Borlands wonderful Delphi product ported to Linux has been a
dissapointment.

  * * * Someone with real experience on Kylix - please jump in here!

Calling Delphi "similar to Visual Basic" is hurtful because I believe that
VB is the product of looting and pillaging the talent that came out of
Borland.  I'm guessing that Microsoft has successfully targeted this
perceived competitor with destruction.

If Kylix were of the quality of Delphi, it would be a killer Linux app.
Thomas Bartkus


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


Re: Opinions on KYLIX 3 (Delphi 4 Linux)

2005-07-18 Thread Thomas Bartkus
> Jeff Epler wrote:
>
> > I honestly don't know why anyone would spend money for a development
> > environment, no matter how fancy.  I don't knowdefinitelye would develop
> > software in a language that doesn't have at least one open
> > implementation.

It's called (ROI) Return On Investment.  If you can get that to a positive
number, then spending money on the tool is a no brainer.  Given that one
caveat, a sane person will just do it!

If I can create something that earns $10,000 or more in profit, then the
difference between a tool that costs $500 and one that is free amounts to
small beer.  IOW - it hardly matters!  The only decision one needs be
concerned with is which tool is most effective.

> > It's a great way to get screwed when Borland goes under or decides
> > they only want to sell a new, incompatible product.  What do you do with
> > your existing product when that happens?

Your existing products are not affected. The compiler tools you have will
work just as well as the day you bought it.  Your ownership of the product
does not get revoked just because Borland dissapears.

> > Re-train on a new platform,
> > and re-write from scratch?

What do you do when an open source project you were using gets abandoned?
Hard to see much difference here.
Thomas Bartkus



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


Re: Native ODBC access for python on linux?

2005-07-15 Thread Thomas Bartkus
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> All,
>
> This info was very helpful, and I'm up and running with MySQLdb on
> linux, and the native ODBC support on Windows.
>
> One last question I have:  In vbs (specifically with .asp) I can make a
> connection to an ODBC provide _without_ the need to specify a system
> DSN in the Control Panel.  It's easy to do with MySQLdb.connect(
> host,user,pass,etc), but is this possible with the ODBC module in
> Python on win32?
>

Ahhh - But that's the point!

If you are "up and running with MySQLdb on linux" then you should be up and
running with with the same code on Windows.  The exact same Python script
you run on Linux will work for you on windows!  I *think* you might be able
to attach the ODBC driver but it would be a complication and an unnecessary
one at that.  Just point MySQLdb.connect() at the servers IP address.

Go to SourceForge and download  the MySQLdb installation for win32
[MySQL-python.exe-1.2.0.win32-py2.4.exe].

Sometimes you can't believe it because it's too easy :-)
Thomas Bartkus


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


Re: Native ODBC access for python on linux?

2005-07-14 Thread Thomas Bartkus

<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm getting my feet wet with making Python talk to MySQL via ODBC.  I
> started on Windows, and it went smoothly enough due to the ODBC stuff
> that apparently is native to Python at least on windows (I've been
> following ch. 13 of Mark Hammond's py on win32 book).
>
> But now I'm trying to do equivalent stuff on linux (Fedora Core 3) with
> python 2.3.5 and mysql.  I'd like to stick with packages that are
> native to python, rather than relying on external stuff (e.g., MySQLdb
> and mxODBC).  Is this possible, or do I have to use 3rd party pieces to
> use ODBC with Python under linux?
>
>
> As an aside, I've only used ODBC to access db's, period.  I've never
> used, for example, MySQL's API for working with a MySQL db.  I'm
> curious to see what that looks like, if anyone has any examples
> (python, c, or otherwise).
>
> Thanks in advance for any help.
> -Bill

We have a Linux/Apache/MySQL server.  We use the ODBC driver to write
Windows clients using VB.  I only understand ODBC as a means to bring the
Linux/Apache/MySQL to speaking terms with the Microsoft world. ODBC serves
as the translator between these 2 alien systems.

Although I hear rumors about ODBC drivers on Linux, I confess I don't
understand the need. Certainly you can use Python with the MySQLdb module
from any Linux machine and query away at the server.  As long as the MySQL
server accepts your IP/usr/pwd, it will respond to the SQL you pass it from
Python.

IOW - who/what needs an ODBC driver here?
Thomas Bartkus


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


Re: all possible combinations

2005-07-13 Thread Thomas Bartkus
"George Sakkis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "rbt" <[EMAIL PROTECTED]> wrote:
>
> > Say I have a list that has 3 letters in it:
> >
> > ['a', 'b', 'c']
> >
> > I want to print all the possible 4 digit combinations of those 3
> > letters:
> >
> > 4^3 = 64
>
>
> It's actually 3^4 = 81 (3 candidates/choice ** 4 choices)

Yes.  You get a cigar!

Someone else (Jack Diederich) also mentioned "This is called a cartesian
product, ..."
Right again.

Now I can't help injecting that SQL is custom made for returning a cartesian
product.

Given a table called [Letters] containing a field [Letter] with (3) records
Letter = 'a', 'b', 'c'

SELECT CONCAT(t1.Letter, t2.Letter, t3.Letter, t4.Letter)
FROM Letters As t1, Letters As t2, Letters As t3, Letters As t4

Will return those 81 combinations in an eyblink.

In order to stay on topic, you are required to call your favorite SQL engine
from Python :-)
Thomas Bartkus


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


Re: Yet Another Python Web Programming Question

2005-07-12 Thread Thomas Bartkus
"Daniel Bickett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> It was his opinion that
> web programming should feel no different from desktop programming.


Should that ever become even remotely possible -

I'll be interested in web programming myself.
Thomas Bartkus


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


Re: Lisp development with macros faster than Python development?..

2005-07-11 Thread Thomas Bartkus
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> > Well, his Viaweb company was founded in about '95, right? So he probably
just
> > used Lisp because Python wasn't as well known yet. ;-)
>
> David
>
> That is what I thought too.  It makes sense but I wasn't sure.  Still
> ain't.
> The problem is that questions like 'What lang is fastest to develop
> in?'
> are hard to answer definitively.

No it's not.

The answer is always whatever language you enjoy the most and know the best.

That's a somewhat redundant statement because if you enjoy a language, you
are highly motivated to use it often and learn it well.

An intimate knowledge of any particular language is *far* more important
than the syntactic and semantic arcana that people usually argue over.

So - what the question really boils down to is which language(s) have the
best balance of approachability (easy to learn!) and capability. Bear in
mind though, that if the language sacrifices capability in favor of being
easy, then the fun runs out of it too soon :-)

Thomas Bartkus




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


Re: Legacy data parsing

2005-07-08 Thread Thomas Bartkus
"gov" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I've just started to learn programming and was told this was a good
> place to ask questions :)
>
> Where I work, we receive large quantities of data which is currently
> all printed on large, obsolete, dot matrix printers.  This is a problem
> because the replacement parts will not be available for much longer.
>
> So I'm trying to create a program which will capture the fixed width
> text file data and convert as well as sort the data (there are several
> different report types) into a different format which would allow it to
> be printed normally, or viewed on a computer.

Text file data has no concept of "fixed width".  Somewhere in your system,
text file data is being thrown at your dot matrix printer.  It would seem a
trivial exercise to simply plug in a newer and probably inexpensive
replacement printer.

  What am I missing here?

> I've been reading up on the Regular Expression module and ways in which
> to manipulate strings however it has been difficult to think of a way
> in which to extract an address.
>
> Here's an example of the raw text that I have to work with:
>


How are you intercepting this text data?
Are you replacing your old printer with a Python speaking computer?
How will you deliver this data to your Python program?

> (the # = any number, and the X's are just regular text)
> I would like to extract the address information, but the two different
> text objects on the right hand side are difficult to remove.  I think
> it would be easier if I could just extract a fixed square of
> information, but I don't have a clue as to how to go about it.

Assuming you know how your Python code will "see" this data -

You would need no more than standard Python string handling to perform these
tasks.

There is no concept of a "fixed square" here.  This is a continuous stream
of (probably ascii) characters. If you could pick the data up from a file,
you would use readline() to build a list of individual lines.  If you were
picking the data from a serial port, you might assemble the whole thing into
one big string and use split(/n)  to build your list of lines.

Once you had a full record (print page?) as a list of individual lines you
could identify each line by it's position in the list *if*, as is likely,
each item arrives at the same line position.  If not, your code can read
each line and test.  For example:
The line
"###"
Seems to immediately precede several address lines
"MRS XXX X  XXX"
"#"
":
"###-###-#"

If you can rely on this you would know that the line "###" is
immediately followed by several lines of an address - up until the empty
line.  And you can look at each of those address lines and use trim() to
remove leading and trailing blanks.

Similarly, the line that begins "  LANG:" would seem to immediately precede
another address.

None of this is particularly difficult with standard Python.
But then - if we are merely replacing an old printer -

We are already working way too hard!
Thomas Bartkus





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


pygtk does ... ?

2005-07-08 Thread Thomas Bartkus
I am experimenting (flailing around?) with glade and python.  Both under MS
Windows and Linux.

I understand why I want to "import gtk"
It gives me access to the critical gui program loop
   gtk.main() and main_quit()

I am also very grateful for
  import gtk.glade
This lets me open my xml format glade file
   gtk.glade.XML("MyGladeFile.glade")
full of defined gtk widgets and the function
   signal_autoconnect(dic)
which lets me hang my Python callback routines onto those gtk widgets.

Whew!  At least I've gotten started. It sure wasn't easy.

The question is -
   What the heck is the pygtk library for?

help(pygtk) tells me not much more than -
   "Python bindings for the GTK+ widget set"

Why would I want to "import pygtk" with it's single function
"require(version)"?
What is it supposed to do?  Where does it fit in?

Or does it fit in at all?
Thomas Bartkus





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


Re: I am a Java Programmer

2005-07-01 Thread Thomas Bartkus
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am a java programmer and I want to learn Python Please help me.
>

Well! Your condition is certainly tragic!

But what can anyone do?
Thomas Bartkus


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


Re: Boss wants me to program

2005-06-29 Thread Thomas Bartkus

"phil" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> > About teaching in the exact sciences: I think we need a more hands-on
> > applied approach, to some extent this holds for the entire school
> > system.
>
> YES! As a geometry(& trig) teacher, I am going to have them build a
> shed, a kite, a sundial. I would love some doable ideas for hands
> on which would teach more principles without being major
> construction projects.
>
Wow! How about a sextant?
Simple device really. And a great practical demonstration of trigonometry.

It would be helpful of if your class was near the seashore. You would want a
clear shot at the horizon.
Thomas Bartkus


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


Re: Boss wants me to program

2005-06-28 Thread Thomas Bartkus
"phil" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> >
> > Theres even a version of Python for .NET, called IronPython. The major
> > advantage of this is that you get to program in Python, which I can
> > tell you from experience is a lot more enjoyable and pain-free than C,
> > C++, Fortran, or Java (and, I would highly suspect, VB and C#). But
> > apparently the available GUI builders aren't as good for Python -
> > having not done a whole lot of GUI building in general, I'll leave this
> > for more experienced people to judge.
> >
>
>  From 30 years of application development experience I will tell you
> NOT HUMBLY, that Python is easily the most productive, the most
> read-write and the most elegant of any of the above.  Handsdown
> better than Java, the runner up in that group.

Agreed!

> Now let me explain somthing about "GUI buiders" or IDE's, from some
> experience, Visual Studio being the worst.
>
> The IDE takes a picture of what they think you want to do, they then ask
> you some questions about the components, and they afford you the
> opportunity to modify the properties of the objects.
> Then they store all this info in tables and build code at
> buildtime.  The tables are rarely documented well and sometimes
> have very confusing layouts.  So you usually go back to the
> IDE to make changes and if the changes are compilcated and there
> are interconnected events to consider, you better know what you are
> doing.
>
> I consider it a nightmare of hiding code from the programmer.
> The IDE is taking on the burden of a couple layers of abstraction
> and the IDE ain't that smart.

"A nightmare of hiding code from the programmer"  Hmmhh!

Well, it certainly does hide a lot of code!
More precisely, it removes the need for a lot of hand coding work that
should be automated.

Do I want to spend 95% of my coding/debugging efforts on a consistent user
interface or would I rather spend the bulk of my efforts on the business
problem that needs solving and just *have* an attractive and consistent user
interface.

> You would be wise, if you choose Python to choose Tkinter or WxWindows
> and learn the properties of a radio button and how to trigger events.
> Writing simple GUIs is not that hard.  Then after you know what is
> going on behind the scenes, a BOA Constructor will not be as
> mysterious or dangerous.

Writing simple user interfaces may not be hard but "simple" user interfaces
rarely serve well.  More to the point is that programs are much better when
they have idiot proof (and idiot easy!) user interfaces where the programmer
hasn't the need to cope with the 1001 ways a user can louse up input or need
to write an encyclopeadia of documentation on how one interacts with his
particular program.

You are quite correct to point out how much better it is to know what is
going on behind the scenes.  But heck, once you know how to extract square
roots - you need to let the computer do it!

GUI interfaces should be the same deal!
Thomas Bartkus


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


Re: Boss wants me to program

2005-06-27 Thread Thomas Bartkus
"Brian" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi Xeys,
>
> Even though I absolutely love Python...
>
> Microsoft Visual Basic (.NET) would be your best bet for this type of
> software development.  It allows you to create GUI apps that can work
> with a variety of database options, such as Access or MS SQL Server.
>
> My personal opinion is this:
> 
> 1) Python shines the best on the server realm.
> 2) VB.net shines the best on the client-computer realm.
>
I would modify that.

1) VB shines in the MS Windows/Office realm.
2) Python shines everywhere else.

Thomas Bartkus


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


Re: Office COM automatisation - calling python from VBA

2005-06-24 Thread Thomas Bartkus
"guy lateur" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> I am trying to write some code (macro's, if you like) to glue together
> our Office applications (mainly Word, Excel and Outlook). We have a lot
> of different projects going on simultaneously. The idea is to develop a
> centralized framework (starting point, common interface) for my users
> to view/control their documents/correspondence, on a per project basis.
>
> As an example, I'd like to have a control (button, menu entry) in
> Outlook that allows my users to bring up, say, an email for a certain
> contact (architect, owner, engineer, ..) on a certain project, with
> certain attachments, .. Currently, I have a 'public folder' in OL
> (Exchange) that reflects our project structure.
>
> I'll be using COM, and I could probably make an application that
> controls Outlook (externally). But I'd also like to have this
> functionality exposed in OL itself. So I guess I'll need to use VBA,
> but I don't really like VBA - relax, please, it's just an opinion.. ;)
>
> So, ideally, I'd like to program as much as possible in python (I'm
> pretty new to that, too, btw), and only use VBA if needed - say, to
> call python objects/methods (+ wxGUI, please).
>
>
> Would that be an easy, a hard, or an insane strategy? Maybe there are
> some tutorials on this (searched the list, but didn't quite find any).
> If anyone happens to have any xp/tips on this, please, fire away!

You are using Microsoft Windows.
You are trying to integrate ("glue together") Microsoft Office applications.
You want to use other Microsoft COM objects.
You want to your software to *be* a COM object ("functionality exposed in OL
itself")
You want a robust GUI interface that has the look, feel, and fits in with,
MS Office.
You want to use --- Python ???

How, pray tell, do you add  up (VBA+VBA+VBA+VBA+VBA)  and have it come out
equaling Python?

Be reasonable here.  You don't have to "like" VBA to see that this is the
only practical choice in this situation.  Imagine if Python had a robust GUI
development system that fit right into your os platform AND was the native,
built in, macro language for the top 5 high level applications you needed to
work with.  Do you think that might please a few of us here in this
particular newsgroup?  This is exactly what Microsoft has with Office/VBA.

I don't particularly like VBA as a language either.
   And
I don't like B. Gates
   And
I may well be crazy.

Just not *that* crazy!
Thomas Bartkus



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


Re: Database recommendations for Windows app

2005-06-23 Thread Thomas Bartkus

"Magnus Lycka" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thomas Bartkus wrote:
> > "Magnus Lycka" <[EMAIL PROTECTED]> wrote in message
> >   > The O.P. wanted a database for his
> >   > Python app, and Thomas Bartkus suggested Access.
> >
> > Not exactly!
>
> Sorty, I meant Jet or whatever the backend is called these days.

Hey! Even MS is confused these days.

>
> If we start with vanilla Python, we need just the tiny PySqlite module
> and DB-API compliant Python code to get a SQLite solution to work. One
> small 3rd party module which is trivial to bundle. There is no way you
> can access ADO with less 3rd party stuff bundled than that. The minimum
> is to bundle win32all or ctypes, but then you need to work much harder.
> You probably want a 3rd party python ADO library as well. Then it's
> much more stuff to bundle.

I was thinking of Win32com which I expect lets you put a wrapper around ADO
and work the ADO (or any other ActiveX) object model from within Python.

   However

I must confess that while I am quite familiar with ADO,  I haven't used it
with Python.

I do know that the ADO (or DAO) libraries are complete, SQL oriented,
database systems that are available on every WinXP desktop.  I *think* "Jet"
refers to the underlying, .mdb file based storage engine that ADO rides on
top of by default.  All WinXP platforms have this and do not need another db
platform - IOW we don't need to distribute a db platform here!

Unless one simply prefers something else ;-)
Thomas Bartkus




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


Re: Database recommendations for Windows app

2005-06-23 Thread Thomas Bartkus
"Magnus Lycka" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Cameron Laird wrote:
> > OK, I'm with you part of the way.  Typical "Access" developers
> > are *always* involved with DLL hell, right?  You're surely not
> > saying that Python worsens that frustration, are you?
>
> I think Dan was commenting on flaws in Microsoft's products,
> not in Python. As I understand it, he was suggesting to use
> something else than Access with Python, not something else
> than Python with Access. The O.P. wanted a database for his
> Python app, and Thomas Bartkus suggested Access.

Not exactly!

I suggested the built in Microsoft DAO or ADO database libraries which he
could use without need to distribute with his app.  The Access application
is simply another client app that sits on top of DAO/ADO and would be quite
unnecessary here.  Any Python/DB application you wished to distribute for MS
Windows would do best talk to the ADO library directly - end of distribution
problems.

* Everyone with WindowsXP already has the DAO and ADO libraries.

* Not everyone has (or needs) MS Access which one would have to pay for and
could not distribute freely with ones Python app.

* Python has no need of MS Access in order to create, maintain, and
manipulate databases using Microsofts built in ADO database facilities -
although a developer *might* find Access useful as an inspection/debugging
tool on his own workstation.

All of which used to confuse the hell out of me :-)
Thomas Bartkus





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


Re: Database recommendations for Windows app

2005-06-23 Thread Thomas Bartkus

"Magnus Lycka" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Cameron Laird wrote:
> > OK, I'm with you part of the way.  Typical "Access" developers
> > are *always* involved with DLL hell, right?  You're surely not
> > saying that Python worsens that frustration, are you?
>
> I think Dan was commenting on flaws in Microsoft's products,
> not in Python. As I understand it, he was suggesting to use
> something else than Access with Python, not something else
> than Python with Access.

  > The O.P. wanted a database for his
  > Python app, and Thomas Bartkus suggested Access.

Not exactly!

I suggested the built in Microsoft DAO or ADO database libraries which he
could use without need to distribute with his app.  The Access application
is simply another client app that sits on top of DAO/ADO and would be quite
unnecessary here.  Any Python/DB application you wished to distribute for MS
Windows would do best talk to the ADO library directly - end of distribution
problems.

* Everyone with WindowsXP already has the DAO and ADO libraries.

* Not everyone has (or needs) MS Access which one would have to pay for and
could not distribute freely with ones Python app.

* Python has no need of MS Access in order to create, maintain, and
manipulate databases using Microsofts built in ADO database facilities -
although a developer *might* find Access useful as an inspection/debugging
tool on his own workstation.

All of which used to confuse the hell out of me :-)
Thomas Bartkus




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


Re: Database recommendations for Windows app

2005-06-22 Thread Thomas Bartkus
"Dan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 6/22/2005 11:38 AM, Thomas Bartkus wrote:
> > Will McGugan" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
>
> And then XP Autoupdate executes, some of those Access/MSDE libraries are
> updated, and you app is broken.

Hasn't happened yet!

For the record - I wouldn't recommend automatic updates of any kind for a
Linux/MySQL system either.  For precisely the same reasons.

Thomas Bartkus



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


Re: Database recommendations for Windows app

2005-06-22 Thread Thomas Bartkus
Will McGugan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I'd like to write a windows app that accesses a locally stored database.
> There are a number of tables, the largest of which has 455,905 records.
>
> Can anyone recommend a database that runs on Windows, is fast /
> efficient and can be shipped without restrictions or extra downloads?
>
> I have googled and found plenty of information on databases, its just
> that I dont have enough experience with databases to know which one is
> best for my task!

If you are writing strictly for the MS Windows platform
   And
If the database is running single user with a "locally stored database" on a
Windows workstation.
   Then
The MS Access file based (.mdb) system is hard to argue with.
You wouldn't have to distribute the (rather expensive) Access application
since this is little more than a front for the underlying DAO/ADO database
libraries that are built into the warp and woof of MS Windows.  Your Python
application can address the DAO or ADO directly as these will libraries will
be pre-installed and/or freely available for MS Windows.  Fast, freely
available, no license restrictions, and no need for extra downloads for a
reasonably recent (Win2000, XP) operating system.

On the other hand, if operating system portability were a concern (as it
should be!), I might suggest MySQL.
A Python/MySQL application can jump between Windows to Linux (all flavors!)
to Unix to BSD without need to alter a single line of code.

You were writing a Python app, weren't you :-)
Thomas Bartkus



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


Re: Database recommendations for Windows app

2005-06-22 Thread Thomas Bartkus
"Will McGugan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I'd like to write a windows app that accesses a locally stored database.
> There are a number of tables, the largest of which has 455,905 records.
>
> Can anyone recommend a database that runs on Windows, is fast /
> efficient and can be shipped without restrictions or extra downloads?
>
> I have googled and found plenty of information on databases, its just
> that I dont have enough experience with databases to know which one is
> best for my task!

If you are writing strictly for the MS Windows platform
   And
If the database is running single user with a "locally stored database" on a
Windows workstation.
   Then
The MS Access file based (.mdb) system is hard to argue with.
You wouldn't have to distribute the (rather expensive) Access application
since this is little more than a front for the underlying DAO/ADO database
libraries that are built into the warp and woof of MS Windows.  Your Python
application can address the DAO or ADO directly as these will libraries will
be pre-installed and/or freely available for MS Windows.  Fast, freely
available, no license restrictions, and no need for extra downloads for a
reasonably recent (Win2000, XP) operating system.

On the other hand, if operating system portability were a concern (as it
should be!), I might suggest MySQL.
A Python/MySQL application can jump between Windows to Linux (all flavors!)
to Unix to BSD without need to alter a single line of code.

You were writing a Python app, weren't you :-)
Thomas Bartkus


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


Re: Dealing with marketing types...

2005-06-13 Thread Thomas Bartkus
"fuzzylollipop" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> man this is the worst advice I have ever heard, you can't "walk away
> with code" someone else paid you to write. Regardless of what your
> perceived slight is.
>
> NEVER take code you were paid to write unless you have it in writing
> that you can, you will lose that one everytime.

I'll agree here.  If you were hired as an employee for salary or an hourly
wage, you will have no standing whatsover as "owner" of the work you
produced.  If your ex employer charges you with theft, it will be a slam
dunk in court. You don't own what you produced for your employer.  Even if
you were fool enough to do much if it on your own unpaid off hours.  Even if
they reneged on some verbal promises to you in order to con you into doing
so.  It sucks but that's the way it is.

However - I certainly sympathize with the desire to fight thievery with
thievery.
Unfortunately, you can't win that way. Unless, of course, you can do it
without being caught :-)

But that only gets you revenge - not payment.
Thomas Barkus


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


Re: Dealing with marketing types...

2005-06-13 Thread Thomas Bartkus
"Steve Jorgensen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sat, 11 Jun 2005 11:51:02 -0500, tom <[EMAIL PROTECTED]> wrote:
>
> ...
> >Let me add an Item #3 -
> >If you have some entrepeneurial savvy and can keep your emotions out of
> >it tou can simply tell them you have decided strike out on your own and
> >tell them that you will be available. They will be happy to hear you are
> >leaving and happier still to hear you can be available for backup.
> >Their goals and fears are addressed at the same time.  AND there is a
very
> >high possibility that they will *need* you at a later date for which you
> >can charge them dearly.
> >
> >That last item #3 has actually worked for me with (2) prior employers.
> >I did have to eat my indignation and keep it friendly but it did pay off
> >in the end.
> >Thomas Bartkus
>
> I have to say that, although I have yet to write a line of Python code for
> money, I've found that this concept basically works.  When you realize
that
> your employer is cutting you out to save the cost of paying you, funny
enough,
> they'll be willing to -really- pay you as a consultant later when they get
> stuck, and one or more paying customers are impacted.

Yup! It's theold stupid + greedy double whammy that means they end up paying
more.
Your not feeling sorry for them, are you?

> They also win't mind
> figuring out how to have you come in after hours so it won't conflict with
> your new day job if you have one.  In my case, the work was in VB/VBA, but
the
> same principle should apply to any technology.
>
> Do make sure that your contract with any new employer allows you to do at
> least small amounts of moonlighting - they probably won't object.  They
will
> insist that any moonlighting shall not compete with their line of
business,
> and you should agree to that stipulation.

How much of *my* time are they buying with a salary?  40Hrs a week?  24/7 ?
You want to see that your contract as an employee doesn't somehow forbid you
from earning extra on your own time.  Unless, of course,  they are paying
enough to make you happy to sell them *all* your time.  Sometimes you are
hired mainly to keep your skills unavailable to their competitors.  Thats ok
as long as they pay you enough to keep you happy with this. Unless they are
paying for it, your own free time is none of their business.

Thomas Bartkus


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


Re: Dealing with marketing types...

2005-06-10 Thread Thomas Bartkus
"fuzzylollipop" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> get your resume in order and start looking . . .

I *hate* the fact that I agree with this post.

I, for one, am hoping for serious discussion to address the problem.
Thomas Bartkus


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


Re: Dealing with marketing types...

2005-06-10 Thread Thomas Bartkus

"flyingfred0" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> A small software team (developers, leads and even the manager when he's
> had time) has been using (wx)Python/PostgreSQL for over 2 years and
> developed a successful 1.0 release of a client/server product.
>
> A marketing/product manager has brought in additional management and
> "architecture" experts to propose moving the entire thing to a Java
> (application server) platform for the next release.  They want a
> "scalable, enterprise solution" (though they don't really know what that
> means) and are going crazy throwing around the Java buzzwords (not to
> mention XML).
>
> The developers (including myself) are growing uneasy; the management is
> continuing to push their requirements and ignore the engineers.  I think
> there's still hope, but I'm at a loss for ideas beyond pointing out the
> success stories of Python and Zope and language comparisons between
> Python and Java.
>
> What experiences have those in the Python community had in these kinds
> of situations?

Sigh!

> The developers (including myself) are growing uneasy; the management
is
> continuing to push their requirements and ignore the engineers.

No - they are not pushing "requirements" here.
They are trying to specify the tools that must be used in order to achieve
those requirements.  Sort of like me specifying the brand name and type of
tools the repair shop must use when they replace my alternator. Well - not
*quite* like that since I don't enjoy the power of a true employer/employee
relationship with my repair shop. But you get the picture.

It's a given that management has no way to reasonably evaluate on the
technical merits.  However, there is one legitimate reason they might want
to do this. It is a non-technical yet nevertheless reasonable consideration.
Management needs to know they have a reliable labor pool to draw upon for
replacements. If that "small software team" decides to jump ship (or asks
for more $, or already makes enough $ to be attractive targets for
replacement)  - would they be able hire the replacement expertise to carry
on?  Management is *always* looking to lose the high priced creative
geniuses who brought them to the party.  I know this from years as an
independent consultant talking to those managers.  I can't tell you how many
times they were simply looking to replace the now highly paid guru(s) with
younger/lower cost and more recently - offshored labor.

That, my friend, is the real reason behind the "Java" buzzword. If that's
what your up against, I'm sorry to say that there are simply hoards of Java
underemployeds out there ready to flood human resources with resumes.
Worse - there are hoards of underbidding (lying? scumsucking?) contractors
with dozens of "Java" experts on the bench and no one with Python
experience. I gaurantee that the likes of these are tripping over one
another to get your employers attention.

If this is the case, then management throws up blather like "scalable" and
"enterprise solution" when they really mean they would like to reduce the
cost and increase the reliability of the labor force available to develop
and maintain the system.

If *thats* what's bothering you bunky - I'm sorry to tell you that I am
short on solutions.

BUT understanding the problem is the first step on the path to a solution
:-)
Thomas Bartkus


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


Re: anygui,anydb, any opinions?

2005-06-10 Thread Thomas Bartkus
"Renato Ramonda" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thomas Bartkus ha scritto:
>
> >>Then download gtk2.6 and glade for windows and then install pygtk and
> >>code away to your satisfaction! :-D
> >>
> >
> >
> > I *will* try that.
>
> On linux you probably have everything installed or a command away, on
> windows use this:
>
> http://gladewin32.sourceforge.net/
>
> choosing the development package (that includes gtk _and_ glade), plus
>
> http://www.pcpm.ucl.ac.be/~gustin/win32_ports/pygtk.html
>
> for pygtk. Just choose the right python version, obviously.

Thank you Renato!

I'm in the thick of it right now.  The challenge is to sort it all out.
wxWidgets<>wxPython<>wxGlade<>Glade<>GTK<>pyGTK<>TKinter<>much more.
This is a complicated soup and the interelationships are not obvious or easy
to sort out.

   > On linux you probably have everything installed or a command away ...
Well! - that's the problem!
I'm not going to live long enough to evaluate everything :-)
Thomas Bartkus



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


Re: anygui,anydb, any opinions?

2005-06-09 Thread Thomas Bartkus

"Renato Ramonda" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thomas Bartkus ha scritto:
> > The attractiveness of wxPython here is that it extends the platform
> > neutrality of Python to GUI interfaces.  On a Windows platform, the work
> > looks like any other Windows program.  On Gnome/Linux, the identical
code
> > fits right into the Gnome desktop scheme.  *Big* plus.
>

> Then download gtk2.6 and glade for windows and then install pygtk and
> code away to your satisfaction! :-D
>

I *will* try that.

Thanks
Thomas Bartkus


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


Re: anygui,anydb, any opinions?

2005-06-07 Thread Thomas Bartkus
"James Tanis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Previously, on Jun 6, Thomas Bartkus said:
>
> # "James Tanis" <[EMAIL PROTECTED]> wrote in message
> # news:[EMAIL PROTECTED]
> # >
> # >
> # > My 2 cents, I'm much more productive with Python and QT Builder as I
> # > am with VB and those aren't nearly as intergrated as VB's GUI/IDE. A
> # > language's productivity, I believe, rests on how high or low-level the
> # > language and its libraries are. Not just that though, productivity is
> # > also very much affected by the breadth of the libraries available.
> #
> # When scripting, Windows or Linux, I also am much more productive with
> # Python.
> # When automating a process for another human being, I am much more
productive
> # with a RAD tool like VB.  The effort involved in creating the user front
end
> # simply overwhelms  all the considerable efficiencies of Python.
> #
> # When I code wxPython, I find I want to use VB to create/model my user
> # interface.  Once I prototype my Windows (Frames!) using VB, I can then
xlate
> # this to wxPython code.  What I couldn't do without the VB IDE was
visualize
> # and experiment with the impact of various layouts *before* I lay down
code.
> # It is simply too onerous to experiment by code manipulation and too easy
to
> # swish around visually with a mouse.
> #
> # When I use a GUI designer like wxGlade, I still find it awkward enough
to
> # merit prototyping with the VB IDE and then mimic the windows I create
with
> # wxGlade.
> #
> # > Sure, GUI RAD solutions increase development in a very real way, but
you
> # > can find an offering for just about every language out there these
days.
> #
> # Yes.  But the tools available for Python are still primitive compared to
RAD
> # tools like Delphi/Visual Studio.  I still don't know enough wxPython to
> # understand what the barriers are to creating a RAD visual design and
> # construction tool similar to the Visual Studio environment.
> # My ravings here are simply the result of a suspicion -
> #
> # - The suspicion is that the only barrier is the Python (and Linux!)
> # communities grossly underestimating the value of such an undertaking.
> # Thomas Bartkus
> #
>
> Hmm, it's not that simple though. Unfortunately efforts get spread
> among the various projects, wxPython is only one among many.

I realize that.  And I wouldn't consider it unfortunate that efforts are
spread amongs various projects.  It adds richness to the whole environment
but, yes, it does dilute efforts.

> You seem set on wxPython, ...
The attractiveness of wxPython here is that it extends the platform
neutrality of Python to GUI interfaces.  On a Windows platform, the work
looks like any other Windows program.  On Gnome/Linux, the identical code
fits right into the Gnome desktop scheme.  *Big* plus.

But stuck?  There is so much going, there is so little time, and I wallow in
ignorance.  Justification for my ravings is to coax out the experience of
others.  One can't help feeling that one is missing something important
simply because there isn't the time to evaluate everything in depth. And
much of this stuff *needs* to be examined in depth to give it a fair shot.

What neat things am I missing and should be looking at ?

> ... and its true, RAD projects based around that toolkit
> still seem to be in alpha/beta stages, but that does not go for all the
> toolkits. There are no barriers that I know of, but your comparing an
> application (vb) that has been 11+ years with one (wxglade) that has
> been around what.. maybe three years?

Yes.  And I'm sorry to sound like I was complaining (but I was :-)
I'm here because MS is well along it's declining years and I've jumped off
the .NET bandwagon.  New/wonderful things are no longer forthcoming from
that world.  They are in Linux/Python.

Thomas Bartkus


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


Re: anygui,anydb, any opinions?

2005-06-06 Thread Thomas Bartkus
"James Tanis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Previously, on Jun 6, Thomas Bartkus said:
>
> # "bruno modulix" <[EMAIL PROTECTED]> wrote in message
> # news:[EMAIL PROTECTED]
> # > You mean the "wimp gui builder + db -> ui pipeline" model ? If yes, C
> # > doesn't have it, C++ doesn't have it (in fact most languages doesn't
> # > have it) - and 
> #
> # >  the fact is that C and C++ are usually considered as much
> # > more "serious and professionnal" than VB and the likes.
> #
> # Yes but there is another fact that must be considered.
> # Systems like VB (and the likes) are much more *productive* .
> #
> # The secret of that particular success has nothing to do with the
language
> # and everything to do with the integrated GUI / IDE available to that
> # particular (VB) language.
>
> That's pretty arguable. C/C++ has no shortage of integrated GUI/IDE
> available especially if your willing to fork out the same kind of books
> that you would need to for VB.
>
> #
> # Anything that reduces the overhead involved in producing a
> # consistent/attractive/idiot proof  user interface makes a far more
> # productive environment.
> #
> # Thomas Bartkus
>
> My 2 cents, I'm much more productive with Python and QT Builder as I
> am with VB and those aren't nearly as intergrated as VB's GUI/IDE. A
> language's productivity, I believe, rests on how high or low-level the
> language and its libraries are. Not just that though, productivity is
> also very much affected by the breadth of the libraries available.

When scripting, Windows or Linux, I also am much more productive with
Python.
When automating a process for another human being, I am much more productive
with a RAD tool like VB.  The effort involved in creating the user front end
simply overwhelms  all the considerable efficiencies of Python.

When I code wxPython, I find I want to use VB to create/model my user
interface.  Once I prototype my Windows (Frames!) using VB, I can then xlate
this to wxPython code.  What I couldn't do without the VB IDE was visualize
and experiment with the impact of various layouts *before* I lay down code.
It is simply too onerous to experiment by code manipulation and too easy to
swish around visually with a mouse.

When I use a GUI designer like wxGlade, I still find it awkward enough to
merit prototyping with the VB IDE and then mimic the windows I create with
wxGlade.

> Sure, GUI RAD solutions increase development in a very real way, but you
> can find an offering for just about every language out there these days.

Yes.  But the tools available for Python are still primitive compared to RAD
tools like Delphi/Visual Studio.  I still don't know enough wxPython to
understand what the barriers are to creating a RAD visual design and
construction tool similar to the Visual Studio environment.
My ravings here are simply the result of a suspicion -

- The suspicion is that the only barrier is the Python (and Linux!)
communities grossly underestimating the value of such an undertaking.
Thomas Bartkus



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


Re: anygui,anydb, any opinions?

2005-06-06 Thread Thomas Bartkus
"bruno modulix" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> You mean the "wimp gui builder + db -> ui pipeline" model ? If yes, C
> doesn't have it, C++ doesn't have it (in fact most languages doesn't
> have it) - and 

>  the fact is that C and C++ are usually considered as much
> more "serious and professionnal" than VB and the likes.

Yes but there is another fact that must be considered.
Systems like VB (and the likes) are much more *productive* .

The secret of that particular success has nothing to do with the language
and everything to do with the integrated GUI / IDE available to that
particular (VB) language.

Anything that reduces the overhead involved in producing a
consistent/attractive/idiot proof  user interface makes a far more
productive environment.

Thomas Bartkus


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


Re: anygui,anydb, any opinions?

2005-06-06 Thread Thomas Bartkus
"bruno modulix" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thomas Bartkus wrote:
> > "rzed" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > 
> >
> >>So what do you think? What's wrong with the picture? Why isn't
> >>there a greater priority to work in this direction?
> >
> >
> >> What's wrong with the picture?
> >
> > Just one teeny little item.
> >
> > The Python world lacks the phenomenally successful development models
> > enjoyed by the now ancient Turbo Pascal, Delphi and  Visual Basic.
> > AND
> > If the likes of Visual Basic can have it, then it becomes really,
*really*
> > hard to convince the world that Python is a serious, professional
system.
>
> You mean the "wimp gui builder + db -> ui pipeline" model ? If yes, C
> doesn't have it, C++ doesn't have it (in fact most languages doesn't
> have it) - and the fact is that C and C++ are usually considered as much
> more "serious and professionnal" than VB and the likes.
>


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


Re: anygui,anydb, any opinions?

2005-06-02 Thread Thomas Bartkus
"Skip Montanaro" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> >> Are we talking about a drag-and-drop GUI builder?
> Thomas> I am!
>
> >> What about Glade?
> Thomas> Dying to try that.  Ask me again in a week.
>
> I use Glade at work on a regular basis.  Took me a few days to get
> proficient, and it has some warts, but it sure beats the heck out of
> manually creating all those widgets in my Python code.
>
> Skip

Yes.  Anything that automates/assists the creation of the user interface is
a phenomenal time saver.  The task of getting data from and delivering it to
a human operator is still the most difficult and time consuming part of
creating software. It is so onerous that it tempts one to abandon writing
software for organic beings altogether.

My reference to Visual Basic was meant to be a poke in the eye.  The
language itself stinks.  BUT - having a robust IDE with keyword tooltip
prompts, built in language documentation, robust built in debugging, and
most of all - a stable GUI , a standard suite of widgets for interacting
with those pesky, error prone humans, the ability to draw these on a form
with a mouse and have all that running in minutes! It no longer matters that
the language itself smells like 4 day old fish!  No amount of linguistic or
structural elegance can have as much impact on productivity as the IDE/GUI.

It drives me crazy when someone suggests that it might amount to no more
than a bit of fluff hardly worth bothering with because when it comes to
programming -

An excellent IDE/GUI just trumps everything.
Thomas Bartkus




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


Re: anygui,anydb, any opinions?

2005-06-01 Thread Thomas Bartkus
"Paul Rubin" <http://[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Thomas Bartkus" <[EMAIL PROTECTED]> writes:
> > > Given that for the most part nobody in the Python community has a
> > > handle on any other Python person's paycheck, it's unlikely that
> > > enough of the community can be convinced that a VB-like
> > > development environment would be a "killer app" for Python and
> > > thus motivated to go produce one.
> >
> > Judging by the message traffic alluded to by the original poster, I'm
hardly
> > the only one with this particular itch. AND there is clearly a
substantial
> > development effort in this direction. Apparently, a few in the community
are
> > convinced of the worth.
>
> Are we talking about a drag-and-drop GUI builder?
I am!

> What about Glade?
Dying to try that.  Ask me again in a week.

> Or do you mean a fancy IDE?
That too!

> There's a Python plug-in for Eclipse, but I haven't tried it yet.
Fact is, there are all kinds of interesting things in the air.

I happen to be one - and I *know* I'm not alone - who thinks that building
user interfaces is way too difficult and way too important.  It is
particularly frustrating in that we do seem to be moving backwards in this
department.

Am I the only one who notices that we are in the dark ages when it comes to
producing (new) software that people can use.  Was MS Office 2000 the be all
and end all of software development.  Why has it all come to a halt?  My
explanation is a:
  Microsoft entering senility
  a programming community unable to recognize a developing vacuum
  The great html plague
And -

Lack of interest  in GUI/IDE programming environments.
Thomas Bartkus


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


Re: anygui,anydb, any opinions?

2005-06-01 Thread Thomas Bartkus
"Skip Montanaro" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Thomas> The Python world lacks the phenomenally successful development
> Thomas> models enjoyed by the now ancient Turbo Pascal, Delphi and
> Thomas>  Visual Basic.
> Thomas> AND
> Thomas> If the likes of Visual Basic can have it, then it becomes
> Thomas> really, *really* hard to convince the world that Python is a
> Thomas> serious, professional system.
>
> Remember, in the open source community we all pretty much just scratch our
> itches.

I haven't forgotten!

> Given that for the most part nobody in the Python community has a
> handle on any other Python person's paycheck, it's unlikely that enough of
> the community can be convinced that a VB-like development environment
would
> be a "killer app" for Python and thus motivated to go produce one.

Judging by the message traffic alluded to by the original poster, I'm hardly
the only one with this particular itch. AND there is clearly a substantial
development effort in this direction. Apparently, a few in the community are
convinced of the worth.

I think we need to get over this "killer app" jazz.  How about plain old
productivity?  How do we enjoy the rapid and effective algorithm production
that Python affords us if one must pay back that productivity on an
effective and tediously acquired user interface. I rather think reducing the
code needed to produce a useful user interface frees up considerable effort
better spent on the programming problems we use Python for.

> Apparently, most Python people feel productive enough without such a tool.
As did many with Fortran. Or Cobol. Are we now so productive that there is
no longer an unmet need for new/better software?  Do we stop here?  Is
Python a comfortable place for the Luddites hang out.

I think not.
Thomas Bartkus




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


Re: anygui,anydb, any opinions?

2005-06-01 Thread Thomas Bartkus
"rzed" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> So what do you think? What's wrong with the picture? Why isn't
> there a greater priority to work in this direction?

   > What's wrong with the picture?

Just one teeny little item.

The Python world lacks the phenomenally successful development models
enjoyed by the now ancient Turbo Pascal, Delphi and  Visual Basic.
AND
If the likes of Visual Basic can have it, then it becomes really, *really*
hard to convince the world that Python is a serious, professional system.

At some point, one has to break out of theory and produce!
Or challenge the theory with some hard questions.

Thomas Bartkus


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


Re: anygui,anydb, any opinions?

2005-06-01 Thread Thomas Bartkus
"rzed" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> So what do you think? What's wrong with the picture? Why isn't
> there a greater priority to work in this direction?

   > What's wrong with the picture?

Just one teeny little item.

The Python world lacks the phenomenally successful development models
enjoyed by the now ancient Turbo Pascal, Delphi and  Visual Basic.
AND
If the likes of Visual Basic can have it, then it becomes really, *really*
hard to convince the world that Python is a serious, professional system.

At some point, one has to break out of theory and produce!
Or challenge the theory with some hard questions.

Thomas Bartkus


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


Re: Regular Expressions - Python vs Perl

2005-04-21 Thread Thomas Bartkus
"djw" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> >
> While I agree with (most of) your points, one should not overlook the
> fact that there are cases when performance does matter (huge datasets
> maybe?). Since the OP didn't indicate why performance was important to
> him/her, one cannot assume that its not a valid concern.

Yes, yes, but then - the converse would be true.  One cannot assume it *is*
a valid concern.

I could have gone further and pointed out that that RegEx module (now re !)
is probably just C code hooked to Python syntax.  IOW - the execution speed
of his RegEx module has *nothing at all* to do with the Python language,
only the efficiency of the particular code library he was using.

All in all, execution speed for any one particular task is a sucky way to
evaluate a general purpose programming language. If gonzo RegEx query
performance was of utmost importance, would anyone put either of Perl or
Python at the top of his list?

Thomas Bartkus





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


Re: Regular Expressions - Python vs Perl

2005-04-21 Thread Thomas Bartkus
"codecraig" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I found some benchmarking (perhaps simple) but search for "The Great
> Computer language shootout" look at the original shootout and the
> win32 one.
>
> Thomas:
> "I doubt the total execution time for all the RegEx queries you ever
> ran took
> as much time as you just wasted on your little experiment. " .no
> need to be angry.  I don't have some "little experiment", but thanks
> for being concerned about me wasting my time.
>
> I do understand that python is certainly easier to read, no doubt.  I
> was just doing some research to find out about speed/performance
> between the two.
>
> But thanks for pointing out, again, that Pyton is easier to read.
> (let's just not forget that python is great for other things other than
> just readability.)

Your quite welcome.
BUT I didn't say a word about readability.

I claimed it was easier to *write*.
Thomas Bartkus


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


Re: Regular Expressions - Python vs Perl

2005-04-21 Thread Thomas Bartkus
"codecraig" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> Well so far from what I have found, Perl is faster than Python for
> RegEx, although perl is harder to read.

Yawn

How about Python being easier to *write*?

It never ceases to amaze me.  It takes days, weeks, months, sometimes even
years to write significantly useful software.  And yet so many seem to think
it is worthy to bother over the seconds that might be saved at execution
time.

If one were to achieve a mere percentage point or two in improving the
"write" efficiency of software - think how much more the world gains in
software quality and quantity.  How about man hours saved?  Why does anyone
still waste so much angst over execution speed?

I doubt the total execution time for all the RegEx queries you ever ran took
as much time as you just wasted on your little experiment.
Thomas Bartkus


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


Re: Things you shouldn't do

2005-03-30 Thread Thomas Bartkus
"Steve" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> What are some of other people's favourite tips for
> avoiding bugs in the first place, as opposed to finding
> them once you know they are there?
>
Fonts with slashed zeros and serifs.

-Tom



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


Re: rounding problem

2005-02-24 Thread Thomas Bartkus
"Dan Bishop" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> tom wrote:

> > That last digit will *always* contain some arithmetic slop.
>
> Your statement is misleading, because it suggests that your processor
> stores digits.  It doesn't; it stores *bits*.

Your explanation is much clearer and more than I knew. And I am sorry you
found my statement a bit misleading. But I never implied details about how
things were stored internally.

No matter what computer, calculater, slide rule or programming language - a
floating point number will always exhibit "arithmetic slop" at the last
significant digit. This is a property inherent to floating point numbers and
has nothing to do with how it is stored on any machine.

Thomas Bartkus


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


Re: Performance Issues of MySQL with Python

2005-02-09 Thread Thomas Bartkus
"sandy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi All,
>
> I am a newbie to MySQL and Python. At the first place, I would like to
> know what are the general performance issues (if any) of using MySQL
> with Python.
>
> By performance, I wanted to know how will the speed be, what is the
> memory overhead involved, etc during database specific operations
> (retrieval, update, insert, etc) when MySQL is used with Python.
>
> Any solutions to overcome these issues (again, if any)?

There are no "general performance issues" with respect to "using MySQL with
Python".

The use of Python as a programming front end does not impact the performance
of whatever database server you might select.  The choice of MySQL as your
database server does not impact the effectiveness of whatever front end
programming language you select. The 2 functions, database server and
programming language, do not interact in ways that raise unique performance
issues.

You can choose each one without worrying about the other. They two quite
separate design choices.

Thomas Bartkus


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


Re: variable declaration

2005-02-08 Thread Thomas Bartkus
"Alexander Zatvornitskiy"
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> The worst thing is that in such calculations you often receive plausible
results.


Exactly so!

An ordinary spelling error gets promoted to a logic error that is damn
difficult to detect, let alone trace!  Before one even tries, it behooves
one to spell check his variables. An additional step that counters Python's
procedural simplicity.

"i" comes before "e" except after "c" OR whenever I make a typo!
Thomas Bartkus


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


Re: variable declaration

2005-02-01 Thread Thomas Bartkus
"Michael Tobis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> Since I'm very much a believer in Python as a beginner's language, that
> doesn't satisfy me. "Declarations are impractical" would satisfy me,
> but so far I'm not completely convinced of that.
>

As has been pointed out, it's not a big deal for a programmer who's been
there, done that. But the original posters example is a beginners trap for
certain.

*If* Python were a "beginners language", then it would be missing one of
it's training wheels.
Thomas Bartkus


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


Re: The next Xah-lee post contest

2005-02-01 Thread Thomas Bartkus
"Luis M. Gonzalez" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Have you visited his website?
> I kind of like this guy... it's like he has a few bugs in his brain,
> but other parts are surprisingly interesting.

I kind of like him too. I hope he manages to find a babe!

As human conditions go, normalcy is *highly* overrated..
Thomas Bartkus


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


Re: variable declaration

2005-02-01 Thread Thomas Bartkus
"Steve Holden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thomas Bartkus wrote:
>
> > "Carl Banks" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > 
> >
> >>How common is it for a local variable to be bound in
> >>more than one place within a function?
> >
> >
> > How common?  It shouldn't happen at all and that was the point.
>
> This seems a little excessive to me. Sample use case:
>
> for something in lst:
>if type(something) != type(()):
>  something = tuple(something)

Hhhmmh!
I presume you are going through the list and want to gaurantee that every
item you encounter is a tuple!  So if it ain't - you just re-declare
"something" to be a tuple. What was formerly a single string, integer,
whathaveyou is now a tuple *containing* a single string, integer,
whathaveyou.

Do you do it that way because you can? Or  because you must?
   And
If the former - is it a good idea?
OR did I just miss your codes intent completely?

My first inclination would be to create a new variable (type = tuple) and
accept (or typecast) each "something" into it as required. The notion that
you just morph "something" still seems rather abhorrent. It hadn't occurred
to me that iterating through a list like that means the iterater "something"
might need to constantly morph into a different type according to a lists
possibly eclectic contents.

It might explain why the interpreter is incapable of enforcing a type.  It
would forbid iterating through lists containing a mix of different types.
EXCEPT- I must note, that other languages manage to pull off exactly such a
trick with a variant type. When you need to pull off a feat such as this,
you declare a variant type where the rules are relaxed *for that situation
only* and there is no need to toss the baby out with the bathwater.

Thomas Bartkus


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


Re: variable declaration

2005-02-01 Thread Thomas Bartkus

"Carl Banks" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]


> How common is it for a local variable to be bound in
> more than one place within a function?

How common?  It shouldn't happen at all and that was the point.
The original posters code demonstrates how it can occur inadvertently as a
result of a simple typographical error.

You won't hear me claim that Python is without mitigating virtues. Clearly,
there is much about Python that encourages good design which will in turn
reduce the incidence of such errors. Nevertheless, one has to admit to this
blemish.  One also wonders if it is really necessary to endure what looks to
me like an omission.  Is there a reason why the interpreter
couldn't/shouldn't require formal declarations?

I, too, wish there were a switch like VBs "Option Explicit" that would
require you to declare "epsilon = 0" and thereafter have the interpretor
refuse assignment to an undeclared "epselon". Sane VB programmers (and yes,
there are a few!) leave it on by default and consider it abomination that
the switch is optional. The original posters example was a good one.  I had
to take a good long stare before I saw it even though the code is short,
sweet, and otherwise correct.

*Is* there a reason why the interpreter couldn't/shouldn't require formal
variable declaration?
It seems to me that lack of same may also be creating hellish barriers to
writing truly effective IDEs for Python.

Thomas Bartkus


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


Re: variable declaration

2005-01-31 Thread Thomas Bartkus
"Alexander Zatvornitskiy"
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello All!
>
> I'am novice in python, and I find one very bad thing (from my point of
view) in
> language. There is no keyword or syntax to declare variable, like 'var' in
> Pascal, or special syntax in C. It can cause very ugly errors,like this:
>
> epsilon=0
> S=0
> while epsilon<10:
>   S=S+epsilon
>   epselon=epsilon+1
> print S
>
> It will print zero, and it is not easy to find such a bug!
>
> Even Visual Basic have 'Option Explicit' keyword! May be, python also have
such
> a feature, I just don't know about it?

Exactly so!
Python *does* require that your variables be declared and initialized before
you use them. You did that with epsilon=0 and S=0 at the top.  It is
unfortunate, however, that the statement epselon=epsilon+1 also declares a
new variable in the wrong place at the wrong time. Such mispellings are a
*common* error caught instantly in languages that require a more formal
declaration procedure.

Another irksome sitiuation is that while Python does enforce strict type
checking, you can re-declare variables and morph them in the middle of
nowhere.
 S = 0   # It's an Integer!
 S = S + 'Hello' # No can do! Strong type checking forbids this.
 S = 'GoodBye' # Whoops - Now it's a string! Unfortunately
legal!
This seemingly demolishes all the good reasons one has for wanting strict
type checking.

That second example is just bad programming practice and easy to avoid.  The
problem you point out in your code, however, hurts! Was that an I, an l or a
1 in the variable name?

Hey! - I like Python a lot.
But nothings perfect
Thomas Bartkus


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


Re: python without OO

2005-01-26 Thread Thomas Bartkus

"Davor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > On the other hand, this does beggar for a reason to bother with Python
at
> > all.  It seems you could be happy doing BASH scripts for Linux or DOS
batch
> > files for Windows.  Both are "nice&simple" scripting languages free of
> > object oriented contamination.
>
> not really, what I need that Python has and bash&dos don't is:
>
> 1. portability (interpreter runs quite a bit architectures)
> 2. good basic library (already there)
> 3. modules for structuring the application (objects unnecessary)
> 4. high-level data structures (dictionaries & lists)
> 5. no strong static type checking
> 6. very nice syntax
>
> so initially I was hoping this is all what Python is about, ...

The irony here is that the OO approach woven into the warp and woof of
Python is what make 1-6 possible.

> but when I
> started looking into it it has a huge amount of additional (mainly OO)
> stuff which makes it in my view quite bloated now...

Again, there is nothing "additional" about the OO in Python.  It is the very
foundation upon which it is built.

> ... anyhow, I guess
> I'll have to constrain what can be included in the code through
> different policies rather than language limitations...
It would be reasonable to decide that Python is not what you are looking
for.
I'm not sure that castrating it in this manner would be quite so reasonable.

Thomas Bartkus


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


Re: python without OO

2005-01-25 Thread Thomas Bartkus
"Davor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is it possible to write purely procedural code in Python, ...
Of course!

> or the OO
> constructs in both language and supporting libraries have got so
> embedded that it's impossible to avoid them?

You can always *write your own* purely procedure code.
A tougher problem would be living without the wealth of supporting library
code that is written OO.

> Also, is anyone aware of
> any scripting language that could be considered as "Python minus OO
> stuff"?
Anyone aware?  Not I!

> (As you can see I'm completely new to Python and initially
> believed it's a nice&simple scripting language before seeing all this
> OO stuff that was added in over time)

Over time ???
Someone can correct me if I'm wrong but I do believe that all that dirty,
rotten OO stuff was incorporated in the language right from the start.
But
If you can live without coding OO, you can do it in Python.

I'm not sure what it is, exactly, you are trying to avoid.
Much "nice&simple scripting " simply has no need to create and use objects.
Of course, the entire structure of Python and all of it's built in data
structures are object oriented.  But, if you wish to live within the
confines of your own strictly procedural code, I don't think you need to
deal with the issue.

On the other hand, this does beggar for a reason to bother with Python at
all.  It seems you could be happy doing BASH scripts for Linux or DOS batch
files for Windows.  Both are "nice&simple" scripting languages free of
object oriented contamination.

Why would you use an object oriented language if you don't want to?
Thomas Bartkus



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


Re: Help! Host is reluctant to install Python

2005-01-25 Thread Thomas Bartkus
"Daniel Bickett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've been trying to convince my host to install python/mod_python on
> his server for a while now, however there are a number of reasons he
> is reluctant to do so, which I will outline here:


I'll second what you are already hearing.
Find a new hosting service because the one you have now is not qualified.

Thomas Bartkus


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


Re: Graph and Table implementation

2005-01-21 Thread Thomas Bartkus
"Jan Rienyer Gadil" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> could anyone please help me!
>
> what and how is the best implementation of creating a table based on
> data coming from the serial port ? and also how would i be able to
> create graphs (2D) based on these data?
>
> opinions and suggestion are most highly welcome. thanks.
>
If you want to use existing tools, it is hard to beat a spreadsheet with a
scatter plot graph object.
If you are on the Microsoft side of the fence, Excel is perfect for this.
There is an easy to use MSCOMM32.OCX object to control the serial port.
This reduces your problem to moving the serial port data to an [x,y] column
that is attached to a scatter plot.

This is easy to do with Excel's built in VBA so I assume it would also be
easy to do with Python, given that you can use Python to manipulate the
Excel object model .

On the Linux/Unix side. Gnumeric seems to serve very well although I don't
yet have sufficient personal experience with it to know about the "gotcha's"
you might encounter.  I am also guessing that the Open Office spreadsheet
would work too.

Thomas Bartkus




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


Re: [OT] Good C++ book for a Python programmer

2005-01-19 Thread Thomas Bartkus
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm picking up C++ again after years of using almost nothing but
> Python. I'm frankly enjoying the experience, and it's certainly
> deepening my appreciation of Python (which you can read however you
> like).
>
Gad!  After Python, how can you stand it (C++) ?
Adding object oriented utility to the C language was an atrocity, albeit
perhaps a necessary one given the state of the art when that particular
atrocity was committed. Aren't we past this?

If it is fast, fully compiled code you seek - couldn't you just C a few slow
functions and use them in your Python?

Thomas Bartkus


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


Re: simultaneous multiple requests to very simple database

2005-01-18 Thread Thomas Bartkus
"Eric S. Johansson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> 99.9 percent of what I do (and I suspect this could be true for others)
> could be satisfied by a slightly enhanced super dictionary with a record
> level locking.

BUT - Did you not mention! :
> Estimated number of records will be in the ballpark of 50,000 to
100,000 in his
> early phase and 10 times that in the future.  Each record will run
about
> 100 to 150 bytes.
.
And
> The very large dictionary must be accessed from
> multiple processes simultaneously

And
   > I need to be able to lock records
   > within the very large dictionary when records are written to

And
   > although I must complete processing in less than 90 seconds.

And - the hole in the bottom of the hull -
   all of the above using "a slightly enhanced super dictionary".

*Super* dictionary??? *Slightly* enhanced???
Have you attempted any feasability tests?  Are you running a Cray?

There are many database systems available, and Python (probably) has free
bindings to every one of them.  Whichever one might choose, it would add
simplicity, not complexity to what you are attempting.  The problems you
mention are precisely those that databases are meant to solve. The only
tough (impossible?) requirement you have is that you don't want to use one.

When you write that "super dictionary", be sure to post code!
I could use one of those myself.
Thomas Bartkus


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


Re: simultaneous multiple requests to very simple database

2005-01-18 Thread Thomas Bartkus
"Eric S. Johansson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> at this point, I know they will be some kind souls suggesting various
> SQL solutions.  While I appreciate the idea, unfortunately I do not have
> time to puzzle out yet another component.  Someday I will figure it out
> because I really liked what I see with SQL lite but unfortunately, today
> is not that day (unless they will give me their work, home and cell
> phone numbers so I can call when I am stuck. ;-)


Forgive me if this reply sounds a bit glib. But I do mean it without malice.

Do you seriously expect to write your own (database) solution and that this
will save you time and effort over learning an existing (SQL) solution?

Because -
If you are seeking to "save time" on "puzzles", you are certainly going
about it the wrong way.

Best of luck
Thomas Bartkus


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


Re: Windows GUIs from Python

2005-01-11 Thread Thomas Bartkus
"Bob Swerdlow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Anyone have opinions about whether we will be better off using PythonNet
or
> wxPython for the GUI layer of our application on Windows?  Our code is all
> Python and is now running on Mac OS X with PyObjC and Cocoa, which works
> very well.  Our goal is not necessarily to move to a cross-platform
> solution, but rather to create a solid Windows version that looks and
feels
> like a native application.  All the code that interacts with the user is
> factored out of our business logic, so it is a matter of find a good
> view/controller library and writing a thin glue layer.  And, of course, we
> want to build it as efficiently and robustly as we can.

Everyone has opinions :-)

I have settled on wxPython principally because of
   1) Linux/Gnome <-> MS Windows portablility of the code.
   2) The fact that wxPython follows the look and feel of whatever window
themes might be installed in Linux/Gnome or MS Windows.
   3) Apps so written have that native "look and feel" and fit right in.

Thomas Bartkus


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


Re: Reaching the real world

2005-01-04 Thread Thomas Bartkus
"Fuzzyman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a friend who would like to move and program lights and other
> electric/electro-mechanical devices by computer. I would like to help -
> and needless to say Python would be an ideal language for the
> 'programmers interface'.
>
> What I'd like is an electronic interface that connects to several
> relays and a python extension module to switch on and off the relays.
> I've had a quick google and can't see anything too similar to what I
> want. pyro (python robotics) seems to require expensive (relatively)
> robotic equipment.

Loosely, what you are looking for is Data Acquisition (DAQ) , Digital I/O,
and control that you can do from your pc. Those are the keywords you want to
google.

Look at www.ni.com and poke around. They will have some introductory
material.
Look at www.circuitcellar.com .  It may look a bit overwhelming at first but
look at the ads for pc equipment.  These should also lead you to some
tutorials.

You are looking for simple digital output. You can use an existing serial or
parallel port with a bit of external hardware from radio shack to control
relays on the cheap.
OR
You can purchase a Digital I/O adaptor that will plug into your computer bus
and give you outputs to control your  relays.  You will also get
instructions and some software to interface (talk!) to the adaptor.
Typically you will read and write to the I/O ports on your computer to flip
the switches.
   OR perhaps the easiest and most effective
These would be smart devices that talk to your Python (or whatever!)
software via the serial port. You would throw simple string commands (eg
"ChannelB ON") at the serial port and the microprocessor based controller
will turn on the appropriate relay.

Your challenge from Python will be to control the computers I/O ports or to
communicate with one of the serial ports.  I'm sure someone else will point
to libraries that will help you with this.

Much *much* more but you have to start somewhere :-)
Thomas Bartkus


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


Re: Reaching the real world

2005-01-04 Thread Thomas Bartkus
"Fuzzyman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a friend who would like to move and program lights and other
> electric/electro-mechanical devices by computer. I would like to help -
> and needless to say Python would be an ideal language for the
> 'programmers interface'.
>
> What I'd like is an electronic interface that connects to several
> relays and a python extension module to switch on and off the relays.
> I've had a quick google and can't see anything too similar to what I
> want. pyro (python robotics) seems to require expensive (relatively)
> robotic equipment.

Loosely, what you are looking for is Data Acquisition (DAQ) , Digital I/O,
and control that you can do from your pc. Those are the keywords you want to
google.

Look at www.ni.com and poke around. They will have some introductory
material.
Look at www.circuitcellar.com .  It may look a bit overwhelming at first but
look at the ads for pc equipment.  These should also lead you to some
tutorials.

You are looking for simple digital output. You can use an existing serial or
parallel port with a bit of external hardware from radio shack to control
relays on the cheap.
OR
You can purchase a Digital I/O adaptor that will plug into your computer bus
and give you outputs to control your  relays.  You will also get
instructions and some software to interface (talk!) to the adaptor.
Typically you will read and write to the I/O ports on your computer to flip
the switches.
   OR perhaps the easiest and most effective
These would be smart devices that talk to your Python (or whatever!)
software via the serial port. You would throw simple string commands (eg
"ChannelB ON") at the serial port and the microprocessor based controller
will turn on the appropriate relay.

Your challenge from Python will be to control the computers I/O ports or to
communicate with one of the serial ports.  I'm sure someone else will point
to libraries that will help you with this.

Much *much* more but you have to start somewhere :-)
Thomas Bartkus


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


Re: The Industry choice

2004-12-30 Thread Thomas Bartkus
"Sridhar R" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> >From technical point of view, I could not understand the the reasoning
> behind using Java in major companies.  Sure that Python, is used in
> some, but still Java is considered as a sure-job language.
>
> After being a python programmer for long time, I consider it painful to
> learn/use Java now (well, like many I will be forced to do that in my
> job).
>
   > What makes such companies to choose Java over dynamic, productive
   > languages like Python?  Are there any viable, technical reasons for
that?

Are there "viable, technical reasons"?  That would be doubtful.

But

There is a reason very important to major companies.
When you leave that company, there will be a *long* line of Java programmers
waiting to take your place.

There need be nothing "technical" about such a decision.
Thomas Bartkus



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


Re: Tkinter vs wxPython

2004-12-29 Thread Thomas Bartkus
"Jarek Zgoda" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Cameron Laird wrote:
>
> Well, while on Windows "native" look exists, on X11 "native" has other
> meaning. On my wife's desktop it's KDE that is native, GNUStep is native
> on mine and I strongly object calling GTK "native", as one can read on
> SWT/Eclipse website. There's no "universally native" look on X11. Some
> toolkits look better, but this is a matter of personal taste, for
> software developer clean, stable API and suitable widgets are of much
> higher value.
>

What I think people mean by "native" is that it follows the design scheme
selected for the desktop.

When run under Linux, my wxPython programs follow the look and feel of my
Gnome desktop.  When the same program is run on Windows, it follows that
desktop theme. Both Gnome and Windows XP alter the the controls design
according to user preferences.  wxPython GUIs reflect this automatically and
the controls always look and work like the underlying system.

I may be wrong but I don't think you get that with TKinter!
Thomas Bartkus


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


Re: BASIC vs Python

2004-12-17 Thread Thomas Bartkus
"Mike Meyer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Thomas Bartkus" <[EMAIL PROTECTED]> writes:
>
> > The "interpreted" nature of the existing Python language has little to
do
> > with how it compares to other languages.  Most languages, including
BASIC,
> > are available in either flavor - interpreted or compiled. And either
way,
> > it's still the same language.  That being said, one would expect an
> > interpreted language (like Python!) to be a bit more approachable for
> > beginners.  The mechanics of producing a working program are just
simpler
> > when the language is interpreted, no matter what that language might be.

   > On what basis do you think the mechanics of producing a working
   > language are easier because the language is interpreted. 

Because:
   Type code
   Run code.

Is easier to explain to the uninitiated than
   Type Code,
   compile code,
   make executable,
   run executable.

And - if a beginner is asking the question, there is no point getting mired
in an arcane discussion about all the in between mix and match flavors that
are constantly at play in the programming world.

As I said -
"Interpreted languages are bit more approachable for beginners"
Thomas Bartkus



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


Re: BASIC vs Python

2004-12-16 Thread Thomas Bartkus
The "interpreted" nature of the existing Python language has little to do
with how it compares to other languages.  Most languages, including BASIC,
are available in either flavor - interpreted or compiled. And either way,
it's still the same language.  That being said, one would expect an
interpreted language (like Python!) to be a bit more approachable for
beginners.  The mechanics of producing a working program are just simpler
when the language is interpreted, no matter what that language might be.

It would be quite a stretch to call Python similar to any of the very many
flavors of BASIC that exist.  So - the answer is no, Python is not similar
to BASIC.

Python is, however, an excellent beginners language. In fact, a serious
programmer with several languages under his belt might actually be at a
disadvantage when learning Python. At least that is my personal experience.

So

Similar to BASIC - no!
Great language for beginning programmers - yes!

Thomas Bartkus

"abisofile" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> hi
>
> I'm new to programming.I've try a little BASIC so I want ask since
> Python is also interpreted lang if it's similar to BASIC.
>
>
>


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


Re: why not arrays?

2004-12-16 Thread Thomas Bartkus
Because the "list" object covers all the functionality contained in the
traditional "array" structure. If it pleases you , you can ignore the
additional conveniences the list object offers and just treat it like an
ordinary array.

Unless, of course, what you are seeking are the joys associated with memory
allocation/deallocation :-)
Thomas Bartkus

"Rahul" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi.
> I just wanted to know why arrays have not been included as a builtin
> datatype like lists or dictionaries? The numpy extension shows that it
> can be implemented. then why not include arrays in core python?
> rahul
>


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


  1   2   >