Re: [Tutor] software modeling tools used with Python

2007-06-04 Thread Alexander Kapshuk
Dear Python Community,

 

I was just wondering about what software modelling tools are normally
used to design Python programs.

 

I have heard of Star UML. Has anyone used it to design their programs?

 

What else is available out there?

 

Thanking you all in advance.

 

Alexander Kapshuk

ISD Education Office

ICQ#295-121-606

 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] SSH using python

2007-06-04 Thread Chandrashekar
Hi ,

Can anyone tell me how to do ssh to a machine using python and execute programs 
on the remote machine? Thanks in advance. 

Regards,
Chandru


   
-
Boardwalk for $500? In 2007? Ha! 
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] software modeling tools used with Python

2007-06-04 Thread Alan Gauld
"Alexander Kapshuk" <[EMAIL PROTECTED]> wrote 

> I was just wondering about what software modelling tools 
> are normally used to design Python programs.

By the nature of Python and the size of programs normally 
written I'd say there is no modelling tool used *normally*.

If a project is big enough to warrant a modelling tool then 
any of the normal tools would be adequate.

Personally I have used Borland Together, Rational Rose,
Visio, Dia and xfig plus a couple of really expensive 
Enterprise Architecture tools for which I happened 
to have licenses at the time... All of them worked
within their own limitations.

> I have heard of Star UML. 

Sorry, never heard of that one.

> What else is available out there?

See the list above :-)
Do you have a price range?
Do you have any particular features you need? 
For example do you want a fancy drawing tool (eg Visio) 
or do you want the tool to syntax check UML? 
Or generate code? Or reverse engineer existing code? 
To generate documents? Single or multi-user? Integration 
with change control tools or IDEs? etc etc etc.

Regards,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] using re

2007-06-04 Thread Roel Schroeven
johnf schreef:
> I have the following
> pattern='^([0-9]{0,%s})(\.[0-9]{0,%s})?$' % (self.IntegerWidth, 
> self.DecimalWidth)
> )
>   if re.match(pattern, self.GetValue())==None:
>   self.BackColor == "pink"
>   else:
>   self.BackColor == "white"
> 
> self.IntegerWidth = 2
> self.DecimalWidth=2
> 
> the problem is the pattern allows ".999".  What am I doing wrong?

It's because of the 0 in {0,%s} in the first part of you regular 
expression. That 0 means that the pattern matches numbers without 
integer part.

You just need to change that 0 to a 1, as follows:

^([0-9]{&,%s})(\.[0-9]{0,%s})?$

-- 
If I have been able to see further, it was only because I stood
on the shoulders of giants.  -- Isaac Newton

Roel Schroeven

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] installing maya/python on linux

2007-06-04 Thread Preecha Bundrikwong

Dear all,

Can anybody please give me an easy instruction on installing maya/python
(pysource/sourcepy etc.) on a Linux machine. I've already downloaded it but
never succeeded installing.

BTW, there's no way to make installing process easier to life than this?
(all those compile, source, .so, etc.. h...)

Regards,
PB
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] installing maya/python on linux

2007-06-04 Thread Thorsten Kampe
* Preecha Bundrikwong (Mon, 4 Jun 2007 16:07:49 +0700)
> Can anybody please give me an easy instruction on installing maya/python
> (pysource/sourcepy etc.) on a Linux machine.

http://cgkit.sourceforge.net/mayadoc/install.html

> I've already downloaded it but never succeeded installing.

Aha. Why?
 
> BTW, there's no way to make installing process easier to life than this?
> (all those compile, source, .so, etc.. h...)

http://cgkit.sourceforge.net/support.html

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] SSH using python

2007-06-04 Thread Thorsten Kampe
* Chandrashekar (Mon, 4 Jun 2007 01:45:57 -0700 (PDT))
> Can anyone tell me how to do ssh to a machine using python and execute 
> programs on the remote machine? Thanks in advance. 

Paramiko

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] using re

2007-06-04 Thread Kent Johnson
johnf wrote:
> I have the following
> pattern='^([0-9]{0,%s})(\.[0-9]{0,%s})?$' % (self.IntegerWidth, 
> self.DecimalWidth)

You should use a raw string (prefix with r) to define pattern, though 
that isn't the problem here.

> )
>   if re.match(pattern, self.GetValue())==None:
>   self.BackColor == "pink"
>   else:
>   self.BackColor == "white"
> 
> self.IntegerWidth = 2
> self.DecimalWidth=2
> 
> the problem is the pattern allows ".999".  What am I doing wrong?

Are you sure? That's not what I get:

In [3]: pattern='^([0-9]{0,%s})(\.[0-9]{0,%s})?$' % (2, 2)
In [5]: import re
In [9]: print re.match(pattern, '.99')
<_sre.SRE_Match object at 0x1280218>
In [10]: print re.match(pattern, '.999')
None

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] installing maya/python on linux

2007-06-04 Thread Preecha Bundrikwong

Thanks, but sorry again; how do you 'compile' the downloaded package? I'm
new to Linux :-(
PB
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] software modeling tools used with Python

2007-06-04 Thread Alexander Kapshuk
Thanks for your reply, Alan.

 

I'm not there yet, as in I'm not a very experienced Python programmer
and I'm still in the early stages of learning the language and
programming as a whole.

 

What I'm looking for is a way to design my programs, big or small, other
than just pseudo-coding them on a piece of paper.

 

How do you design your programs?

 

Regards,

 

Alexander Kapshuk

ISD Education Office

ICQ#295-121-606

 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] software modeling tools used with Python

2007-06-04 Thread Alexander Kapshuk
Thanks a lot Danny.

Will definitely look into those things.

Regards,

Alexander Kapshuk
ISD Education Office
ICQ#295-121-606

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] software modeling tools used with Python

2007-06-04 Thread Danny Yoo
> What I'm looking for is a way to design my programs, big or small, other 
> than just pseudo-coding them on a piece of paper.
>
> How do you design your programs?

[Apologies to the list in advance: not much Python-specific information]

I hope you don't mind the "academic" answer, but:

 http://htdp.org/

might address your question at some level.


For myself, I'm starting to learn how to use a system for modeling 
software systems called Alloy:

 http://alloy.mit.edu/

It's a very nice modeling language with support for writing real 
assertions and tests, so it's more concrete than pseudocode.  I've started 
writing my experiences with it so far in:

 http://hashcollision.blogspot.com/2007/06/lists-1.html

Again, it doesn't have much to do with Python programming, but more to do 
with software designs at a different abstraction layer.


Best of wishes!
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] using re

2007-06-04 Thread johnf
On Monday 04 June 2007 03:10, you wrote:
> johnf wrote:
> > I have the following
> > pattern='^([0-9]{0,%s})(\.[0-9]{0,%s})?$' % (self.IntegerWidth,
> > self.DecimalWidth)
>
> You should use a raw string (prefix with r) to define pattern, though
> that isn't the problem here.
>
> > )
> > if re.match(pattern, self.GetValue())==None:
> > self.BackColor == "pink"
> > else:
> > self.BackColor == "white"
> >
> > self.IntegerWidth = 2
> > self.DecimalWidth=2
> >
> > the problem is the pattern allows ".999".  What am I doing wrong?
>
> Are you sure? That's not what I get:
>
> In [3]: pattern='^([0-9]{0,%s})(\.[0-9]{0,%s})?$' % (2, 2)
> In [5]: import re
> In [9]: print re.match(pattern, '.99')
> <_sre.SRE_Match object at 0x1280218>
> In [10]: print re.match(pattern, '.999')
> None
>
> Kent
Thanks for you response.  You are correct and I have determined that something 
is wrong with the "self.BackColor == "pink" " statement because it does not 
turn the background pink but is firing.  
-- 
John Fabiani
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] New programming tutorials

2007-06-04 Thread Mike Hansen
I was just looking at the Daily Python URL and there are two new Python
tutorials:

Building Skills in Programming
How To Write Your Own Software Using Python
http://homepage.mac.com/s_lott/books/nonprog/htmlchunks/index.html

Hands-on Python
http://www.cs.luc.edu/~anh/python/hands-on/

Mike
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] installing maya/python on linux

2007-06-04 Thread Thorsten Kampe
* Preecha Bundrikwong (Mon, 4 Jun 2007 17:30:03 +0700)
> Thanks, but sorry again; how do you 'compile' the downloaded package? I'm
> new to Linux :-(

./configure
make
make install

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] SSH using python

2007-06-04 Thread Jesse Noller

On 6/4/07, Chandrashekar <[EMAIL PROTECTED]> wrote:


Hi ,

Can anyone tell me how to do ssh to a machine using python and execute
programs on the remote machine? Thanks in advance.

Regards,
Chandru

--
Boardwalk for $500? In 2007? Ha!
Play Monopoly Here and 
Now(it's
 updated for today's economy) at Yahoo! Games.


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor



pSSH:
http://www.theether.org/pssh/

Paramiko:
http://www.lag.net/paramiko/

pExpect example:
http://www.palovick.com/code/python/python-ssh-client.php

Twisted Conch:
http://twistedmatrix.com/users/z3p/files/conch-talk.html
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] software modeling tools used with Python

2007-06-04 Thread Alan Gauld
"Alexander Kapshuk" <[EMAIL PROTECTED]> wrote 

> What I'm looking for is a way to design my programs, 
> big or small, other than just pseudo-coding them on 
> a piece of paper.

IMHO One solution does not fit all here.

The other day I had to do a lot of file maintenance - bulk 
renames and moves etc. I did it with Python and I developed 
the 3 functions I needed interactively in pyCrust then copied 
them to a module which I then ran.

Slightly bigger programs I will use pseudo code. In fact I 
use pseudo code for almost anything for which I'm not 
using OOP regardless of size. Occasionally I supplement 
that with DFDs if there are multiple processes involved 
and ERDs if the data is complex.

For larger OOP projects (more than 6 classes say) I will 
draw a basic class diagram and sequence diagram using 
a simple drawing tool like Visio/Dia (or even pencil and paper!). 
This scales up to about 20 or so classes.

For big projects at work involving more than 30 classes 
and more than one process I'll use a full blown modelling 
tool - usually Borland Together now (used to be Rational Rose)
But its definitely overkill unless there are several 
designers/developers and a complex project. (My current 
project involves over 20 systems, each of which has multiple 
components each of which has many classes - and some 
have several processes running over multiple networks. Maybe 
3000 or so classes in total. With around 200 designers 
on the project, working across 8 different companies, 
in 3 different continents and time-zones, trying to design 
that without a formal modelling tool would be extremely 
difficult!)

I don't know if that answered the question, but its 
how I do things! :-)

Alan G.



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Launch external application?

2007-06-04 Thread Terry Carroll
On Fri, 1 Jun 2007, Brad Tompkins wrote:

> Is there an easy way to make a python script that will launch an external
> application for me ?  I'm using Windows XP and I'm trying to create a little
> front end that will launch the VLC media player for me.

In addition to Grant's approach, if your filetype (say "mpg") is already 
associated with VLC, you can use this:

os.startfile('filename.mpg')
 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] More trouble debugging my game of life program

2007-06-04 Thread Matt Smith
On Sun, 2007-06-03 at 18:09 -0400, Brian van den Broek wrote:

> The first thing I would do to try to track down the problem would be 
> to try 15x30 and 30x15 matrices. If you have two cases where one 
> behaves as expected and one does not, it is usually very useful to try 
> to match the two cases as closely as possible as an aid to pinpointing 
> the problem.

Thanks Brian,

Initially 15*30 worked but 30*15 didn't. I have just gradually
increased the width of my text file up to 30 characters and it worked
at 30*30 so I guess the problem must be with the text file I was using.
Looking at my code - I can see it will break if the lists within the
big list making up the matrix are not all the same length. Maybe this
is something I need to test for in the program.

Cheers,

Matt


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] using re

2007-06-04 Thread Luke Paireepinart

> Thanks for you response.  You are correct and I have determined that 
> something 
> is wrong with the "self.BackColor == "pink" " statement because it does not 
> turn the background pink but is firing.  
>   
== is comparison, not assignment.  Perhaps this is the problem?
-Luke

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor