[FAQTS] Python Knowledge Base Update -- July 25th, 2000

Fiona Czuczman fiona at sitegnome.com
Tue Jul 25 07:05:44 EDT 2000


Hi All,

The latest entries to be entered into http://python.faqts.com

cheers,

Fiona Czuczman

Including:

- Can I run python code with files that don't end with the python 
extensions(.py and others)?
- Can someone please point me to link(s) to python modules dealing with 
cryptography e.g ssleay or open ssl wrappers?
- How can I hold x,y,z coordinates in a multi-level grid?


## New Entries #################################################


-------------------------------------------------------------
Can I run python code with files that don't end with the python extensions(.py and others)?
http://www.faqts.com/knowledge-base/view.phtml/aid/4997
-------------------------------------------------------------
Fiona Czuczman
Steve Purcell

Yes. Simply 'chmod +x scriptname' and make the first line of the script 
read '#!/usr/bin/env python'. But, an executable file is almost as 
obviously a script as a '.py' file.


-------------------------------------------------------------
Can someone please point me to link(s) to python modules dealing with cryptography e.g ssleay or open ssl wrappers?
http://www.faqts.com/knowledge-base/view.phtml/aid/4998
-------------------------------------------------------------
Fiona Czuczman
Ng Pheng Siong

M2Crypto at http://www.post1.com/home/ngps/m2 is a Python interface to
OpenSSL's crypto, SSL and S/MIME functionality.

python-crypto at egroups.com is a low-volume mailing list talking about
Python and crypto.


-------------------------------------------------------------
How can I hold x,y,z coordinates in a multi-level grid?
http://www.faqts.com/knowledge-base/view.phtml/aid/4999
-------------------------------------------------------------
Fiona Czuczman
Peter Schneider-Kamp

You can use lists of lists of lists of 3-tuples containing the 
coordinates. Adressing is done via repeated indexing.

For example the corners of a unit cube between 0 and 1:

>>> a = [ [ [(0,0,0), (0,0,1)], [(0,1,0), (0,1,1)] ],
...       [ [(1,0,0), (1,0,1)], [(1,1,0), (1,1,1)] ] ]
>>> a[0][0][0]
(0, 0, 0)
>>> a[1][0][1]
(1, 0, 1)
>>>

You can also use NumPy. Chances are (if only slight ones) that it will 
be included with 2.0

(see PEP 206 http://python.sourceforge.net/peps/pep-0206.html)







More information about the Python-list mailing list