Re: [Tutor] first call - newcomer

2008-10-10 Thread Lie Ryan
On Mon, 2008-10-06 at 05:32 +0200, [EMAIL PROTECTED] wrote:
> 
> Message: 8
> Date: Sun, 5 Oct 2008 20:27:39 -0700
> From: Anthony Smith <[EMAIL PROTECTED]>
> Subject: [Tutor] first call - newcomer
> To: 
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> 
> This is my first post - I will be brief...
>  
> One:  I have programmed before - but it has been DECADES...so just a
> few simple queries:
>  
> 1.  A brief (but complete) description regarding the use of script
> editor (I will be using

Your script editor can be any plain text-editing tools, Notepad could
do.

>  command prompt in Windows), as:
>  
>  a.  details about loading and saving programs (not in that
> order) and little
>   specs about pathnames or other requirements (I will
> probably store all
>   my little goodies in one folder or space).

Pathnames is free, you can name your program anything your OS allows for
a file. A convention is to name the script ending with .py/.pyw
extension (command-line script/GUI script), although python doesn't
complain if it is not in those extension (in Windows, the extension is
associated with the interpreter). Calling a program from command line is
done like this:

python filename.py

>   That should get me going ... a book and manual by my side should
> suffice for
>the rest - - - except for one thing:

> 2.  I have been unable to locate the gizmo in the literature to get
> ascii codes
> in python.  In the old days, it was a list of 256 (or so)
> characters that 
> represented all keyboard symbols (A equalled 36; B equalled 37; et
> cetera).
>To assign a value, you used "Let A$ = ASC (36)" where A$ was a
> variable
> and 36 was the ASCII value for 'A'.  I believe the reverse of this
> process
> was PRINT VAL(A$) or something.  I want to play with a program
> that will
>assign a number to a word (using a simple algorhythm that will give
> a
> specific number to every word).  Other stuff is pretty easy to
> find with
> the book and on-line literature.  I will need to get an ascii code
> out of
>  a string (whose content is not known to the programmer, as
> raw_input).
> Then to assign, I will need the actual list with assigned numbers.

a = ord('A')
b = chr(36)

-- read on the help file: Built-in Functions
 
> You will be giving me probably the only boost I will need!  I will be
> available later on,
> if I want to take part in the ask/answer system here.

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


Re: [Tutor] Installation Problems

2008-10-10 Thread Pierre Dagenais

Matthew Hill wrote:

oops  I ment to say 2.5.2 is what blender wanted and 2.6 was the newest one I 
had
  
Then blender is likely to look for python.exe in c:\python25 while on 
your computer it's probably under c:\python26. Try renaming the 
directory c:\python26 to c:\python25 and see if that works. You might 
also have to modify the PATH and PYTHONPATH environments.
If you wish to install python v2.5.2 maybe you need to uninstall v 2.6, 
just gessing.

HTH

Pierre

--- On Thu, 10/9/08, Pierre Dagenais <[EMAIL PROTECTED]> wrote:

From: Pierre Dagenais <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Installation Problems
To: 
Cc: tutor@python.org

Date: Thursday, October 9, 2008, 7:55 PM

Matthew Hill wrote:
  

I am a newly beginning aspiring programmer.  I have been learning Blender


3D and I want to use python with it.  I downloaded the newest version of python
and I tried running it with Blender 2.47.  Python would work alone but would not
with Blender.  I read on a forum that I needed to get python 5.52 to match with
what blender wants. 
  
  


Version 5.52 ??? The latest version of python is 2.6 (3.0 for beta).
  

 Only the new (5.52) version won't install.  It says 'contact the


vender to verify this is a windows program' when I try the install.  What is
going on?  Is 5.52 compatible with windows vista?  Am I just missing something? 
The prompt I got inside blender with 2.6 was: 
  

'import site' failed; use -v for traceback
checking for installed Python... no installed Python found.
  

Sounds like a blender problem, blender can't find python.exe which 
usually is in C:\python26. Unfortunately I'm not familiar with blender.
  

Only built-in modules are available. some scripts may not run.
continuing happily.
 
any insight to these problems would really help me out



  
  



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




No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.173 / Virus Database: 270.7.6/1715 - Release Date: 08/10/2008


7:19 PM
  
  



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



  
  




No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.173 / Virus Database: 270.8.0/1717 - Release Date: 09/10/2008 4:56 PM


  


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


Re: [Tutor] Python Working Environment, Checkout, Compare (diff), ...

2008-10-10 Thread Wayne Watson
Title: Signature.html




I decided on WinMerge. It works fine, but unless I missed it does not
highlight changed lines on a b/w printer. I found some options for
color, but none of them applied to the "yellow" line highlighting for
differences. 

Wayne Watson wrote:

  
I'm sure you're correct, but I posted a similar message about diff on
the Newsgroup, and got nowhere. 
  
Anyway, it looks like there are some good choices. Thanks.
  
Kent Johnson wrote:
  
On Thu, Oct 9, 2008 at 12:03 PM, Wayne Watson
<[EMAIL PROTECTED]> wrote:
  

  Is there a Win Python environment that provides Linux like facilities like
diff (compare) and checking in and out program files?



This is not really a Python question. There are many good diff
programs for Windows, a couple of free ones are WinMerge and ExamDiff.
http://www.winmerge.org/
http://www.prestosoft.com/ps.asp?page=edp_examdiff

A big list here:
http://en.wikipedia.org/wiki/Comparison_of_file_comparison_tools

For checkin/checkout you need a version control system, many are listed here:
http://en.wikipedia.org/wiki/List_of_revision_control_software

If you are already using a VCS then you just need the Windows client.

Kent

  
  
  
  -- 
  
  
 Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

 (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)

   "Truth is mighty and will prevail. There is nothing wrong
with this, except that it ain't so."   -- Mark Twain

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


-- 

Signature.html
   Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

 (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)

   "Truth is mighty and will prevail. There is nothing wrong
with this, except that it ain't so."   -- Mark Twain

Web Page: 



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


[Tutor] Iterating two one dimensional lists to create a multidemsional array

2008-10-10 Thread S Potter
OK I'm still new to the python list / array deal. I'm having problems with 
something very simple that I could accomplish in C++ but
for some reason I'm not grasping it python.

Here is my example psuedo code:

I have two lists:

items = ['roses','violets','sugar','so']

and

attributes = ['red','blue','sweet','you']

I have a variable:

action = 'are'

>From the above lists I would like to populate a multi dimensional array that 
>would be like this;

poem ={ ['roses','are red'],
  ['violets','are blue'],
  ['sugar','are sweet']
  ['so','are you'] }

I'm assuming I would need two separate loops once through list(items) and then 
through list(attributes) and would have to concatenate variable(action) + 
str(attributes[0]).

But I'm having a severe brain squeeze right now and cannot get my code to work 
as desired.

Could someone please show me what the code should look like?

I know this is very elementary, I also know I can accomplish this in other 
languages but the objective is to
get my head around the python version.

Your help would be greatly appreciated.

Thanks





_
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Iterating two one dimensional lists to create a multidemsional array

2008-10-10 Thread Kent Johnson
On Fri, Oct 10, 2008 at 10:45 PM, S Potter <[EMAIL PROTECTED]> wrote:
> OK I'm still new to the python list / array deal. I'm having problems with
> something very simple that I could accomplish in C++ but
> for some reason I'm not grasping it python.
>
> Here is my example psuedo code:
>
> I have two lists:
>
> items = ['roses','violets','sugar','so']
>
> and
>
> attributes = ['red','blue','sweet','you']
>
> I have a variable:
>
> action = 'are'
>
> From the above lists I would like to populate a multi dimensional array that
> would be like this;
>
> poem ={ ['roses','are red'],
>   ['violets','are blue'],
>   ['sugar','are sweet']
>   ['so','are you'] }

The zip() function is handy for processing multiple lists in parallel.
List comprehensions are handy for processing lists by item. Together
they make short work of this:

In [5]: items = ['roses','violets','sugar','so']

In [6]: attributes = ['red','blue','sweet','you']

In [7]: zip(items, attributes)
Out[7]: [('roses', 'red'), ('violets', 'blue'), ('sugar', 'sweet'),
('so', 'you')]

In [8]: [ [item, 'are '+attribute] for item, attribute in zip(items,
attributes) ]
Out[8]:
[['roses', 'are red'],
 ['violets', 'are blue'],
 ['sugar', 'are sweet'],
 ['so', 'are you']]

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


Re: [Tutor] Text Scatter Plots?

2008-10-10 Thread Wayne Watson
Title: Signature.html




Hi, I'm finally in a position where I might want to use matplotlib. I
looked at the site but I'm not sure there's a download for 2.4. There
seems to be one (
matplotlib-0.98.1.win32-py2.5.exe)download for Win XP
(and other Win OSes). I did see that it requires python 2.3 as a min.
Any idea?

Kent Johnson wrote:

  On Mon, Sep 29, 2008 at 11:33 AM, Wayne Watson
<[EMAIL PROTECTED]> wrote:

  
  
I don't really want to dabble with graphics at this point, although I have
some months ago, but maybe I can grab something very elementary and use it.
At the moment, I don't want to get into all the finery of using GUIs.
However, it seems as though there ought to be some really simple set up to
just produce a scatter plot. Maybe I'm overestimating the difficulty.

  
  
Producing a scatterplot with matplotlib and displaying the result in a
window can be pretty simple. Here is an example that displays a sine
curve in eight lines of code:
http://msenux.redwoods.edu/mathdept/python/simple.php

Kent

  


-- 


   Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

 (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)

   "Truth is mighty and will prevail. There is nothing wrong
with this, except that it ain't so."   -- Mark Twain

Web Page: 



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