Re: Python processors? : WAS Re: Does python have the capability for driver development ?

2009-08-01 Thread Steven D'Aprano
On Sun, 02 Aug 2009 14:19:45 +1200, greg wrote:

> That's what killed things like the Lisp machine. Their developers
> couldn't keep up with the huge resources that people like Intel and
> Motorola had to throw at CPU development, so eventually a
> general-purpose CPU could run Lisp faster than a Lisp machine.

When you say "eventually", I think you mean "decades ago". I recall a 
collaboration between Apple and Texas Instruments to build a Macintosh 
with a Lisp Machine in the late 1980s. From the one box, you could run 
two computers simultaneously, with two operating systems, one running the 
Motorola 68020 and the other a Lisp Machine processor.

I don't think it sold very well -- by memory, benchmarks showed that for 
half (or less) of the price, you could run Lisp in software on a vanilla 
Mac and the software would be faster than running it on the Lisp Machine.

TI also had at least one Nubus card for the Mac running a Lisp Machine:
http://en.wikipedia.org/wiki/TI_Explorer

On a similar note, there were Forth machines also available for the Apple 
Macintosh. Unlike Lisp, I think they suffered from the general lack of 
popularity of Forth rather than lack of speed.



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


cgi script

2009-08-01 Thread golu
Hi,
i started learning cgi few days ago in python and everything went
fine  until i started getting the follwing error
"
The server encountered an internal error and was unable to complete
your request. Either the server is overloaded or there was an error in
a CGI script.

If you think this is a server error, please contact the webmaster. "
  i am using apache on xampp. plz help
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Custom namespaces

2009-08-01 Thread Chris Rebert
On Sat, Aug 1, 2009 at 6:06 PM, Steven
D'Aprano wrote:
> I was playing around with a custom mapping type, and I wanted to use it
> as a namespace, so I tried to use it as my module __dict__:
>
 import __main__
 __main__.__dict__ = MyNamespace()
> Traceback (most recent call last):
>  File "", line 1, in 
> TypeError: readonly attribute
>
> Why is __dict__ made read-only?
>
> I next thought I could change the type of the namespace to my class:
>
 __main__.__dict__.__class__ = MyNamespace
> Traceback (most recent call last):
>  File "", line 1, in 
> TypeError: __class__ assignment: only for heap types
>
> Drat, foiled again!!!
>
> Okay, if I can't do this at the module level, can I at least install a
> custom namespace at the class level?

> Apparently not. It looks like the namespace provided to the class
> constructor gets copied when the class is made.

> Is there any way to install a custom type as a namespace?

For classes/objects, yes, using metaclasses.
See the __prepare__() method in PEP 3115:
http://www.python.org/dev/peps/pep-3115/

Cheers,
Chris
-- 
http://blog.rebertia.com
-- 
http://mail.python.org/mailman/listinfo/python-list


ANNOUNCING Tahoe, the Lofty-Atmospheric Filesystem, v1.5

2009-08-01 Thread Zooko Wilcox-O'Hearn

Dear people of python-list:

Python is our preferred programming language for the Tahoe-LAFS  
project.  We use C/C++ extension modules for the CPU-intensive parts,  
and we interoperate with many languages through the RESTful web API,  
but the core code is 100% Python.


Regards,

Zooko
---
The Tahoe-LAFS team is pleased to announce the immediate availability of
version 1.5 of Tahoe, the Lofty Atmospheric File System.

Tahoe-LAFS is the first cloud storage technology which offers security
and privacy in the sense that the cloud storage service provider itself
can't read or alter your data. Here is the one-page explanation of
its unique security and fault-tolerance properties:

http://allmydata.org/source/tahoe/trunk/docs/about.html

This release is the successor to v1.4.1, which was released April 13,
2009 [1]. This is a major new release, improving the user interface and
performance and fixing a few bugs, and adding ports to OpenBSD, NetBSD,
ArchLinux, NixOS, and embedded systems built on ARM CPUs. See the NEWS
file [2] for more information.

In addition to the functionality of Tahoe-LAFS itself, a crop of related
projects have sprung up to extend it and to integrate it into operating
systems and applications.  These include frontends for Windows,
Macintosh, JavaScript, and iPhone, and plugins for duplicity, bzr,
Hadoop, and TiddlyWiki, and more. See the Related Projects page on the
wiki [3].


COMPATIBILITY

Version 1.5 is fully compatible with the version 1 series of
Tahoe-LAFS. Files written by v1.5 clients can be read by clients of all
versions back to v1.0. v1.5 clients can read files produced by clients
of all versions since v1.0.  v1.5 servers can serve clients of all
versions back to v1.0 and v1.5 clients can use servers of all versions
back to v1.0.

This is the sixth release in the version 1 series. The version 1 series
of Tahoe-LAFS will be actively supported and maintained for the
forseeable future, and future versions of Tahoe-LAFS will retain the
ability to read and write files compatible with Tahoe-LAFS v1.

The version 1 series of Tahoe-LAFS is the basis of the consumer backup
product from Allmydata, Inc. -- http://allmydata.com .


WHAT IS IT GOOD FOR?

With Tahoe-LAFS, you can distribute your filesystem across a set of
servers, such that if some of them fail or even turn out to be
malicious, the entire filesystem continues to be available. You can
share your files with other users, using a simple and flexible access
control scheme.

We believe that the combination of erasure coding, strong encryption,
Free/Open Source Software and careful engineering make Tahoe-LAFS safer
than RAID, removable drive, tape, on-line backup or other Cloud storage
systems.

This software comes with extensive tests, and there are no known
security flaws which would compromise confidentiality or data integrity
in typical use.  (For all currently known issues please see the
known_issues.txt file [4].)


LICENCE

You may use this package under the GNU General Public License, version 2
or, at your option, any later version.  See the file "COPYING.GPL" [5]
for the terms of the GNU General Public License, version 2.

You may use this package under the Transitive Grace Period Public
Licence, version 1 or, at your option, any later version.  (The
Transitive Grace Period Public Licence has requirements similar to the
GPL except that it allows you to wait for up to twelve months after you
redistribute a derived work before releasing the source code of your
derived work.) See the file "COPYING.TGPPL.html" [6] for the terms of
the Transitive Grace Period Public Licence, version 1.

(You may choose to use this package under the terms of either licence,
at your option.)


INSTALLATION

Tahoe-LAFS works on Linux, Mac OS X, Windows, Cygwin, Solaris, *BSD, and
probably most other systems.  Start with "docs/install.html" [7].


HACKING AND COMMUNITY

Please join us on the mailing list [8].  Patches are gratefully accepted
-- the RoadMap page [9] shows the next improvements that we plan to make
and CREDITS [10] lists the names of people who've contributed to the
project.  The Dev page [11] contains resources for hackers.


SPONSORSHIP

Tahoe-LAFS was originally developed thanks to the sponsorship of
Allmydata, Inc. [12], a provider of commercial backup services.
Allmydata, Inc. created the Tahoe-LAFS project and contributed hardware,
software, ideas, bug reports, suggestions, demands, and money (employing
several Tahoe-LAFS hackers and instructing them to spend part of their
work time on this Free Software project).  Also they awarded customized
t-shirts to hackers who found security flaws in Tahoe-LAFS (see
http://hacktahoe.org ). After discontinuing funding of Tahoe-LAFS R&D in
early 2009, Allmydata, Inc. has continued to provide servers, co-lo
space and bandwidth to the open source project. Thank you to Allmydata,
Inc. for their generous and public-spirited support.

This is the second release of Tahoe-LAFS which was creat

Re: Help understanding the decisions *behind* python?

2009-08-01 Thread sturlamolden
On 31 Jul, 21:31, Masklinn  wrote:

> It's intuitive if you come to Python knowing other languages with  
> tuples (which are mostly functional, and in which tuples are *never*  
> sequences/iterables). At the end of the day, and if Guido's intention  
> truly was what Raymond says, implementing tuples as immutable sequence  
> was a mistake. And the documentation is to blame as well: in it,  
> tuples are clearly described as a *sequence* type, not a *structure*  
> type.

That depends on the readers' preconceptions: Only when the reader have
knowledge of C structs, Pascal records, or Java classes should this
matter. The naïve reader will not have preconceptions about a
difference between "structure types" and "sequence types". A more
advanced C programmer will also know that a struct is a form of a
sequence in C: you can e.g. memcpy any struct to a char array.

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


Re: Help understanding the decisions *behind* python?

2009-08-01 Thread sturlamolden
On 2 Aug, 04:47, Nobody  wrote:

> OTOH, using a "for" loop when you could use a generator means less work
> when you need to make a minor change and a generator is no longer
> sufficient.

It's not just that. It is e.g. using a for loop and indexes instead of
a slice. E.g.

for i in range(10): # Java idiom
   a[i] = b[i+1]

instead of

a[:10] = b[1:11] # Pythonic





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


Re: socket policy flash help

2009-08-01 Thread NighterNet
Here the full code.

flashpolicy.xml
[[[


   

]]]

flashpolicytest_server3x.py
[[[

#!/usr/local/bin/python
'''
Still under testing...
python version 3.x.x
'''
import socket
import threading
import sys
import os

file_name = 'flashpolicy.xml'
fh = open(file_name, "r")
policy = fh.read(10001)

host = ''; #out side network
port = ;

print ("#  - Init... -  #");
class ClientThread (threading.Thread):
global policy;
allClients = [];
vlock = threading.Lock();
id = 0 # next available thread number
def __init__(self,clientSocket):
threading.Thread.__init__(self)
self.sockfd = clientSocket; #socket client
self.name = '';
ClientThread.id += 1
self.id = ClientThread.id
self.nickName = '';
self.allClients.append(self.sockfd);
def sendAll(self,buff):
for index,clientSock in enumerate(self.allClients):
try:
clientSock.send(buff);
except (socket.error):
print ('error socket %s\n',index,"| clean");
clientSock.close()
del self.allClients[index]
def run(self):
while True:
buff = self.sockfd.recv(1028);
if not buff:
print ("connect close...(client side)");
self.sockfd.close();
break #incase it loop infinite
if str(buff) == str("b\'\\x00\'"):
print ('policy FOUND >>> sending...')
print(buff)
b = b''
print (b)
self.sockfd.send(b);
self.sockfd.sendall(b);
print(buff);
self.sendAll(buff)
self.sockfd.close()
print ("#  - Init... Listen Client -  #\n");
try:
server = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
except AttributeError:
# AttributeError catches Python built without IPv6
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error:
# socket.error catches OS with IPv6 disabled
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server.bind((host,port))
server.listen(5)
print ("Server Up Listen!",host,":",port," Bind!");
while True:
(clientSocket, address) = server.accept();
print("client connect from :",address);
ct = ClientThread(clientSocket);
print(ct.id);
ct.start();

]]]

Some odd reason I can't send flash policy from python to flash socket
to agrees with the connection.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Does python have the capability for driver development ?

2009-08-01 Thread sturlamolden
On 30 Jul, 02:19, MalC0de  wrote:

> actually I mean driver programming under Windows operating system, if
> you know, there's A kit name DDK available at microsoft's website for
> developing device drivers under C / C++ environment,

Actually, Microsoft has replaced DDK with a new kit called WDK for
Vista. The funny thing about WDK is that there are a lot of illegal C
and C++ in the headers, which even Microsoft's own compiler refuse to
accept. So good luck on getting anything to compile.










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


Re: Help understanding the decisions *behind* python?

2009-08-01 Thread Nobody
On Sat, 01 Aug 2009 19:19:43 -0700, sturlamolden wrote:

>> More than one person here has
>> observed that the time to learn to program Pythonically is inversely
>> proportional to their experience in Java.
> 
> I believe it is opposite. The longer the Java experience, the longer
> it takes to program pythonically. The correlation is not inverse. In
> particular, programmers accustomed to Java or C++ seem to use for-
> loops awfully lot. And when they do, they always loop over a sequence
> of integers, and use these as array indices.

It would be more accurate to say that of programmers who are *only*
accustomed to Java or C++. I've been using C for 80-90% of my code for 25
years, and I wouldn't normally loop over the indices. But then the other
10-20% is Lisp, Tcl, Haskell, PostScript and, more recently, Python.

OTOH, using a "for" loop when you could use a generator means less work
when you need to make a minor change and a generator is no longer
sufficient.

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


Re: fast video encoding

2009-08-01 Thread sturlamolden
On 29 Jul, 10:14, gregorth  wrote:

> for a scientific application I need to save a video stream to disc for
> further post processing.

I have worked a bit on this as well. There are two things that make
scientific applications different form common video encoding:

First, a scientific video stream is often very different from a
'movie': There are usually very little 'movement'. For example, when I
have filmed a mouse swimming in a water maze (a pool of milky white
water), the only thing that moves is the rat. So I could achieve
excellent compression just by saving the pixels that changed.

Second, scientific data should be stored with lossless compression if
possible.

Common video codecs are aimed at films and home video, not scientific
video streams.

I don't know how your data are, but I would be very picky about the
codec. And chances are you will be better off home-brewing your own
domain specific compression.

If you need to store large amounts of scientific data, consider using
something like a HDF5 database for storage. There are two Python
wrappers for HDF5 that I know of (h5py and PyTables).





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


Re: Help understanding the decisions *behind* python?

2009-08-01 Thread sturlamolden
On 31 Jul, 23:43, Raymond Hettinger  wrote:

> More than one person here has
> observed that the time to learn to program Pythonically is inversely
> proportional to their experience in Java.

I believe it is opposite. The longer the Java experience, the longer
it takes to program pythonically. The correlation is not inverse. In
particular, programmers accustomed to Java or C++ seem to use for-
loops awfully lot. And when they do, they always loop over a sequence
of integers, and use these as array indices. They consequently use a
class where a tuple would be more appropriate, never return multiple
values from functions, etc. Due to their coding style, they produce
programs that are notoriously inefficient, and blame this on 'Python
being slow'. Unlearning the idioms from Java takes a while. Python is
not Java and should not be programmed as such.

On the other hand, I found that my experience with MATLAB helped me a
lot on picking up a pythonical style quickly.



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


Re: Python processors? : WAS Re: Does python have the capability for driver development ?

2009-08-01 Thread greg

Francesco Bochicchio wrote:


I wonder: has anybody thought of making a python-machine, or at least
a processor able to directly execute high-level bytecode (LLVM-like?).


In some of my idle moments I've speculated on what such
a machine might be like. One of my ideas for potential
future projects is to flesh out the design and maybe even
build an FPGA prototype.

It would purely be for fun, though. It's unlikely that
such a processor would be able to compete speed-wise
with a general-purpose CPU running a Python interpreter
with critical libraries written in C.

That's what killed things like the Lisp machine. Their
developers couldn't keep up with the huge resources that
people like Intel and Motorola had to throw at CPU
development, so eventually a general-purpose CPU could
run Lisp faster than a Lisp machine.

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


Re: Predefined Variables

2009-08-01 Thread Fred Atkinson
On Sat, 01 Aug 2009 18:56:33 -0700, Fred Atkinson
 wrote:

>On Thu, 23 Jul 2009 15:28:50 +0200, "Diez B. Roggisch"
> wrote:
>
>>Fred Atkinson wrote:
>>
>>> Is there a pre-defined variable that returns the GET line
>>> (http://www.php.net/index.php?everythingafterthequestionmark) as a
>>> single variable (rather than individual variables)?
>>
>>Variables don't return things. Functions do. And additionally the answer
>>depends on what and with what you actually do.
>>
>>Diez
>
>   I want to display the client browser's IP address on the Web
>page.  
>
>   I'd like to create a variable like this: ip = somefunction(). 
>   Then I can print the IP address on the Web page and/or log it
>in an error file.  
>
>
>
>   Fred 

I replied to the wrong post.  

Sorry.  

 I want to do something like this: 

string = os.environment('QUERY_STRING')

If this is the string in the URL:
http://www.someurl.com/cgi-bin/somescript.cgi?anythingafterthequestionmark
   'string' should now contain the value
'everythingafterthequestionmark'

   When I use the os.environment('QUERY_STRING'), it doesn't work.  

   Is there something I should import to make this function work?  Or
what else is wrong?  



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


Re: Wrapping prstat on Solaris

2009-08-01 Thread Skip Montanaro

> You haven't told us how you are actually reading from prstat's output
> pipe, which may be the cause. For instance, if you are doing
> 
> for line in pipe:
>   print line
>   ...
> 
> then this could cause your buffering issue.
> 
> Instead try using readline():
> 
> while True:
>   line = pipe.readline()
>   ...

Yes, I've been using for line in pipe.  Switching to your construct
seems to work like a charm.

Thanks,

Skip



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


Re: Help understanding the decisions *behind* python?

2009-08-01 Thread sturlamolden
On 20 Jul, 18:27, Phillip B Oldham  wrote:

> We're not looking to start any arguments or religious wars and we're
> not asking that python be changed into something its not. We'd simply
> like to understand the decision behind the lists and tuple structures.
> We feel that in not "getting" the difference between the two types we
> may be missing out on using these data structures to their full
> potential.

A crude simplification would be:

- A Python programmer will use a tuple where a C programmer will use a
struct.

- Python and C programmers use lists and arrays similarly.

Tuples are used for passing arguments to and from a function. Common
use of tuples include multiple return values and optional arguments
(*args).

It has already been mentioned that tuples are immutable and can be
used as dictionary keys.






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


Re: Newbie Question regarding __init__()

2009-08-01 Thread Simon
Okay I will fix my code and include "self" and see what happens.  I
know I tried that before and got another error which I suspect was
another newbie error.

The idea behind the init_Pre is that I can put custom code here to
customize the __init__ instead of creating a new subclass.  This kind
of hook pattern allows you to flatten your inheritance hierarchy.  I
can choose in the init_Pre method to execute code before the init_exec
(which contains the default __init__ code) and still execute the
init_Exec method or I can completely customize the entire __init__ by
returning False from init_Pre and prevent the init_Exec from being
called.  I use this type of pattern with almost all my methods.  In
this way I can create a less complicated inheritance chain but still
have have custom code when needed without sub-classing.

I am use to Visual FoxPro which where you can do

=This.init_Pre().And.This.init_Exec() and the result is discarded so
that is why it looks the way it does.  In this form init_Exec has to
return a value.  However, If self.init_Pre(): self.init_Exec() would
work the same and then I could avoid returning a value.

Thanks,
Simon


On Aug 1, 5:52 am, Dave Angel  wrote:
> Nat Williams wrote:
> > As MRAB described, ALL instance methods need to accept 'self' as a first
> > parameter, as that will be passed to them implicitly when they are called.
> > This includes __init__.  The name 'self' is just a commonly accepted
> > convention for the name of the instance object passed to methods.  You don't
> > have to call it that, but you really should.
>
> > Take a look athttp://docs.python.org/tutorial/classes.html#class-objects
> > It might help shed some light on how methods and instances work.
>
> > One other thing.  I'm a little confused by the first line of
> > dcObject.__init__:
>
> > self.init_Pre() and self.init_Exec()
>
> > I suspect this does not do what you think it does.  init_Pre and init_Exec
> > will both be called by this expression (unless init_Pre throws an exception,
> > of course).  You're not getting anything here that you wouldn't by just
> > calling each method on a separate line, except just making it harder to
> > read.
>
> Read the doc-string for init_Pre() and for init_Exec().  The final
> version of init_Pre() will return False in some circumstances, and in
> those circumstances Simon doesn't want init_Exec() to be called.  He's
> deliberately using the short-circuit evaluation of  'and'  to accomplish
> that.
>
>
>
>
>
>
>
> > On Fri, Jul 31, 2009 at 8:53 PM, Simon  wrote:
>
> >> Hi
>
> >> So should the dcObject class include the "self" as well since I have
> >> not defined an __init__ method in dcCursor?
>
> >> Simon
>
> >> --
> >>http://mail.python.org/mailman/listinfo/python-list
>
> Every one of those methods in both of those classes need a "self" first
> argument.  As others have said, all instance methods need a 'self.'

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


Re: Custom namespaces

2009-08-01 Thread Red Forks
On Sun, Aug 2, 2009 at 9:06 AM, Steven D'Aprano <
st...@remove-this-cybersource.com.au> wrote:

> I was playing around with a custom mapping type, and I wanted to use it
> as a namespace, so I tried to use it as my module __dict__:
>
> >>> import __main__
> >>> __main__.__dict__ = MyNamespace()
> Traceback (most recent call last):
>  File "", line 1, in 
> TypeError: readonly attribute
>
> Why is __dict__ made read-only?

to protect module type? Use .update() method:
__main.__.__dict__.update(MyNamespace())
You can create your own Module instance:
from types import ModuleType
m = ModuleType('modulename')
and make a sub class of ModuleType is also OK

>
>
> I next thought I could change the type of the namespace to my class:
>
> >>> __main__.__dict__.__class__ = MyNamespace
> Traceback (most recent call last):
>  File "", line 1, in 
> TypeError: __class__ assignment: only for heap types
>
> Drat, foiled again!!!
>
> Okay, if I can't do this at the module level, can I at least install a
> custom namespace at the class level?
>
> >>> class MyNamespace(dict):
> ... def __getitem__(self, key):
> ... print "Looking up key '%s'" % key
> ... return super(MyNamespace, self).__getitem__(key)
> ...
> >>> namespace = MyNamespace(x=1, y=2, z=3)
> >>> namespace['x']
> Looking up key 'x'
> 1
> >>> C = new.classobj("C", (object,), namespace)
> >>> C.x
> 1
>
> Apparently not. It looks like the namespace provided to the class
> constructor gets copied when the class is made.
>
> Interestingly enough, the namespace argument gets modified *before* it
> gets copied, which has an unwanted side-effect:
>
> >>> namespace
> {'y': 2, 'x': 1, '__module__': '__main__', 'z': 3, '__doc__': None}
>
>
> Is there any way to install a custom type as a namespace?
>
>
>
> --
> Steven
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: string.Template issue

2009-08-01 Thread Red Forks
On Thu, Jul 30, 2009 at 4:17 PM, Javier Collado wrote:

> Hello,
>
> In the string.Template documentation
> (http://docs.python.org/library/string.html) it's explained that if a
> custom regular expression for pattern substitution is needed, it's
> possible to override idpattern class attribute (whose default value is
> [_a-z][_a-z0-9]*).
>
> However, if the custom pattern that is needed is just uppercase
> letters something like [A-Z]+ won't work because of the following line
> in the _TemplateMetaclass class __init__ method:
> cls.pattern = _re.compile(pattern, _re.IGNORECASE | _re.VERBOSE)

derive a new class, and replace __init__ method, or
replace _TemplateMetaclass.__init__() method.

>


>
> I would say that this is an error (IGNORECASE just shouldn't be there)
> and that the line above should be:
> cls.pattern = _re.compile(pattern, _re.VERBOSE)
> and the default value for idpattern:
> [_a-zA-Z][_a-zA-Z0-9]*
>
> Do you agree on this? Is there any reason for the IGNORECASE option to
> be passed to re.compile?
>
> Best regards,
>Javier
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Custom namespaces

2009-08-01 Thread Steven D'Aprano
I was playing around with a custom mapping type, and I wanted to use it 
as a namespace, so I tried to use it as my module __dict__:

>>> import __main__
>>> __main__.__dict__ = MyNamespace()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: readonly attribute

Why is __dict__ made read-only?

I next thought I could change the type of the namespace to my class:

>>> __main__.__dict__.__class__ = MyNamespace
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __class__ assignment: only for heap types

Drat, foiled again!!!

Okay, if I can't do this at the module level, can I at least install a 
custom namespace at the class level?

>>> class MyNamespace(dict):
... def __getitem__(self, key):
... print "Looking up key '%s'" % key
... return super(MyNamespace, self).__getitem__(key)
...
>>> namespace = MyNamespace(x=1, y=2, z=3)
>>> namespace['x']
Looking up key 'x'
1
>>> C = new.classobj("C", (object,), namespace)
>>> C.x
1

Apparently not. It looks like the namespace provided to the class 
constructor gets copied when the class is made.

Interestingly enough, the namespace argument gets modified *before* it 
gets copied, which has an unwanted side-effect:

>>> namespace
{'y': 2, 'x': 1, '__module__': '__main__', 'z': 3, '__doc__': None}


Is there any way to install a custom type as a namespace?



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


Re: Predefined Variables

2009-08-01 Thread Fred Atkinson
On Thu, 23 Jul 2009 15:28:50 +0200, "Diez B. Roggisch"
 wrote:

>Fred Atkinson wrote:
>
>> Is there a pre-defined variable that returns the GET line
>> (http://www.php.net/index.php?everythingafterthequestionmark) as a
>> single variable (rather than individual variables)?
>
>Variables don't return things. Functions do. And additionally the answer
>depends on what and with what you actually do.
>
>Diez

I want to display the client browser's IP address on the Web
page.  

I'd like to create a variable like this: ip = somefunction(). 
Then I can print the IP address on the Web page and/or log it
in an error file.  



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


Shortest path code on real map

2009-08-01 Thread Joongkoo Cho
Dear All,

I'm trying to calculate shortest paths on US highway map. I understand how
shortest path algorithms work in Python but I need helps to do it on real
maps. How can I make link-node information?

Best,
John
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie thwarted by sys.path on Vista

2009-08-01 Thread David Lyon
On Sat, 1 Aug 2009 22:58:53 +0100, "Michael M Mason"
 wrote:
> I'm running Python 3.1 on Vista and I can't figure out how to add my own 
> directory to  sys.path.
> 
> The docs suggest that I can either add it to the PYTHONPATH environment 
> variable or to the PythonPath key in the registry.  However, PYTHONPATH 
> doesn't exist, and updating the registry key has no effect
>
> So where does sys.path get its value from, and how do I change it?

The simplest hack (worst - but most direct) is that sys.path is a list
and you can use it like any other list. (add, delete, change items in it)

It gets loaded from site.py (in the standardard library) at startup.

Anything else you'll have to ask somebody else.

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


Re: Newbie thwarted by sys.path on Vista

2009-08-01 Thread Dave Angel

Michael M Mason wrote:
I'm 
running Python 3.1 on Vista and I can't figure out how to add my own 
directory to  sys.path.


The docs suggest that I can either add it to the PYTHONPATH 
environment variable or to the PythonPath key in the registry.  
However, PYTHONPATH doesn't exist, and updating the registry key has 
no effect (and in any case the contents aren't the same as sys.path).


So where does sys.path get its value from, and how do I change it?

sys.path gets its values from several places.  The ones I think I know 
of are:


current directory (which uses ""  rather than the expected ".")
directories listed in PythonPath environment variable
Windows-system directory
relative to the executable (python.exe or pythonw.exe) that's 
actually running
relative to the user directory  (docs&settings/username/Application 
Data 


If there's no PythonPath variable, it just uses those other items.   I 
have no idea what it gets from the registry entries.


Anyway, I'd suggest adding it to PythonPath, and if it's empty, just 
create it with the directory you need.


I'm hoping you know you can also add to sys.path directly during script 
initialization.  It's just a list, and is writeable.


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


Re: string.Template issue

2009-08-01 Thread Aahz
In article ,
Javier Collado   wrote:
>
>In the string.Template documentation
>(http://docs.python.org/library/string.html) it's explained that if a
>custom regular expression for pattern substitution is needed, it's
>possible to override idpattern class attribute (whose default value is
>[_a-z][_a-z0-9]*).
>
>However, if the custom pattern that is needed is just uppercase
>letters something like [A-Z]+ won't work because of the following line
>in the _TemplateMetaclass class __init__ method:
>cls.pattern = _re.compile(pattern, _re.IGNORECASE | _re.VERBOSE)
>
>I would say that this is an error (IGNORECASE just shouldn't be there)

Good point!  I don't have an answer for you, but please file a report at
bugs.python.org to make sure it doesn't get lost.
-- 
Aahz (a...@pythoncraft.com)   <*> http://www.pythoncraft.com/

"Many customs in this life persist because they ease friction and promote
productivity as a result of universal agreement, and whether they are
precisely the optimal choices is much less important." --Henry Spencer
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie thwarted by sys.path on Vista

2009-08-01 Thread Piet van Oostrum
> "Michael M Mason"  (MMM) wrote:

>MMM> I'm running Python 3.1 on Vista and I can't figure out how to add my own
>MMM> directory to  sys.path.

>MMM> The docs suggest that I can either add it to the PYTHONPATH environment
>MMM> variable or to the PythonPath key in the registry.  However, PYTHONPATH
>MMM> doesn't exist, 

Then create it.
-- 
Piet van Oostrum 
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie thwarted by sys.path on Vista

2009-08-01 Thread Jon Clements
On 1 Aug, 22:58, "Michael M Mason"  wrote:
> I'm running Python 3.1 on Vista and I can't figure out how to add my own
> directory to  sys.path.
>
> The docs suggest that I can either add it to the PYTHONPATH environment
> variable or to the PythonPath key in the registry.  However, PYTHONPATH
> doesn't exist, and updating the registry key has no effect (and in any case
> the contents aren't the same as sys.path).
>
> So where does sys.path get its value from, and how do I change it?
>
> --
> Michael

sys.path is just a list. So in your 'main' module where you do most of
your imports, just append or prepend the path you desire (the search
order is left to right). Although, I believe under Windows creating a
system level or user level PYTHONPATH environment variable will enable
Windows to pick it up. Not 100% sure as I don't have a Windows machine
handy.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Calling functions: Why this complicated ?

2009-08-01 Thread lkcl
On Jul 14, 11:31 pm, Chris Rebert  wrote:
> On Tue, Jul 14, 2009 at 1:40 PM, Mohan Parthasarathy 
> wrote:
> > Hi,
> > I am a newbie. I am reading
> >http://www.network-theory.co.uk/docs/pytut/KeywordArguments.html
> > Defining a function with "N" arguments and calling them in "M" different
> > ways. Why does it have to be this complicated ? I like the idea of calling
> > the function by explicitly naming the arguments, but there are so many other
> > ways here that is very confusing. Do people really use all these features ?
> > Perhaps, there is a equivalent book to "Javascript: Good Parts" for Python ?
>
> Oh $DEITY, don't even compare Python toJavaScript. At least in
> Python, when you try to access a non-existent attribute, a proper
> NameError exception is thrown rather than silently getting back
> "undefined"... (*has traumatic horror story flashback*)

 yehh, that's what i thought, originally, but after talking it over
with the people doing the EMCAScript Harmony spec, they explained that
nooo, there _are_ exceptions thrown (two if the browser implements it
properly, which IE of course doesn't).  you can try it by installing
the spidermonkey js compiler, which is the exact same js engine that's
in firefox.

 in the python-to-javascript compiler, http://pyjs.org, however, we've
taken to adding a double-check (the equivalent of getattr) when you
specify the --strict option, juuust to make sure.

 and yes, there was a talk at europython 2009, pretty much called
"javascript, the good parts, for python programmers", you can look it
up, the talk audio is online by now.  http://europython.eu

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


Re: How to read webpage

2009-08-01 Thread James Matthews
Check your connection to the internet.

On Sat, Aug 1, 2009 at 6:43 PM, Marcus Wanner  wrote:

> On 8/1/2009 11:31 AM, Jon Clements wrote:
>
>> On 1 Aug, 14:52, MRAB  wrote:
>>
>>> tarun wrote:
>>>
 Dear All,
 I want to read a webpage and copy the contents of it in word file. I
 tried to write following code:
 import urllib2
 urllib2.urlopen("http://www.rediff.com/";)
 *Error:-*
urllib2.urlopen("http://www.icicibank.com/";)
  File "C:\Python25\lib\urllib2.py", line 121, in urlopen
return _opener.open(url, data)
  File "C:\Python25\lib\urllib2.py", line 374, in open
response = self._open(req, data)
  File "C:\Python25\lib\urllib2.py", line 392, in _open
'_open', req)
  File "C:\Python25\lib\urllib2.py", line 353, in _call_chain
result = func(*args)
  File "C:\Python25\lib\urllib2.py", line 1100, in http_open
return self.do_open(httplib.HTTPConnection, req)
  File "C:\Python25\lib\urllib2.py", line 1075, in do_open
raise URLError(err)
 urllib2.URLError: 

>>> I've just tried it. I didn't get an exception, so your problem must be
>>> elsewhere.
>>>
>>
>> I'm hoping this adds to MRAB's reply; it is intended however for the
>> OP.
>>
>> Jeeze -- been a while since I've had to deal with Sockets (directly
>> anyway).
>> If memory serves correctly, it's where the system can't name resolve
>> the required address.
>> So best guess is it's either a temporary glitch, or an issue with your
>> routing.
>>
>> Jon.
>> Jon.
>>
>
> 'getaddrinfo failed' means that the nameserver can't be found, or that it
> has no records of that address (I'm 90% sure of that).
>
> Marcus
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
http://www.goldwatches.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Newbie thwarted by sys.path on Vista

2009-08-01 Thread Michael M Mason
I'm running Python 3.1 on Vista and I can't figure out how to add my own 
directory to  sys.path.


The docs suggest that I can either add it to the PYTHONPATH environment 
variable or to the PythonPath key in the registry.  However, PYTHONPATH 
doesn't exist, and updating the registry key has no effect (and in any case 
the contents aren't the same as sys.path).


So where does sys.path get its value from, and how do I change it?

--
Michael 


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


"PAK WEB PAGES" "PAK WEB SITES" "PAK WEB PAGES" "PAK WEB SITES" "PAK WEB PAGES" "PAK WEB SITES" ON www.pak-web-pages.blogspot.com

2009-08-01 Thread saima81
"PAK WEB PAGES"

www.pak-web-pages.blogspot.com


"PAK WEB SITES"


www.pak-web-pages.blogspot.com


"PAK WEB PAGES"


www.pak-web-pages.blogspot.com


"PAK WEB SITES"


www.pak-web-pages.blogspot.com


 "PAK WEB PAGES"


www.pak-web-pages.blogspot.com

 "PAK WEB SITES"


www.pak-web-pages.blogspot.com


 ON


www.pak-web-pages.blogspot.com



 www.pak-web-pages.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Queryable Daemon

2009-08-01 Thread garabik-news-2005-05
MRAB  wrote:
> Justin DeCell wrote:
>> Hi All,
>> 

...

>> The only other way I thought 
>> of would be to write to a file on disk every so often from the daemon 
>> and just read the from the query process but it seems like there should 
>> be a more elegant way to do this...
>> 
>> By the way I'm writing this for unix only so there's no need to worry 
>> about compatibility with other os'.
>> 
> Instead of a file descriptor, how about a socket? A certain port at
> "127.0.0.1"?

Or a Unix domain socket.

Or let the demon catch signal, say SIGUSR1 and dump its state to a file.
A bit easier programming that a socket, a bit less elegant.

-- 
 ---
| Radovan Garabík http://kassiopeia.juls.savba.sk/~garabik/ |
| __..--^^^--..__garabik @ kassiopeia.juls.savba.sk |
 ---
Antivirus alert: file .signature infected by signature virus.
Hi! I'm a signature virus! Copy me into your signature file to help me spread!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Module updating plans for Python 3.1: feedparser, MySQLdb

2009-08-01 Thread Buck
I use MySQLdb quite a bit in my work. I could volunteer to help update
it. Are there any particular bugs we're talking about or just a
straight port to 3.0?

--Buck

On Jul 31, 6:32 pm, John Nagle  wrote:
>     Any progress on updating feedparser and MySQLdb for Python 3.x in the
> foreseeable future?
>
>     Feedparser shouldn't be that hard; it's just that nobody is working on it.
> MySQLdb is known to be hard, and that may be a while.
>
>                                 John Nagle

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


Re: iterate lines with regex

2009-08-01 Thread Mark Lawrence

Michael Savarese wrote:

I'm a python newbie and I'm trying to test several regular expressions on
the same line before moving on to next line.
it seems to move on to next line before trying all regular expressions which
is my goal.
it only returns true for first regular expression
does the curser have to be rest to beginning of line? If so, how would I do
that.
remember I'm new
thanks in advance to any advice
Mike S.

the following is part of my code,
readThis=open('c:/9320.txt','r')

for line in readThis:
try:
thisKey = key.search(line).group(1)
thisMap = map.search(line).group(1)
thisParcel = parcel.search(line).group(1)
except:
continue


The bare except will hide any errors in the lines above it. Either catch 
errors that you expect or take the try-except out.


--
Kindest regards.

Mark Lawrence.

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


Re: iterate lines with regex

2009-08-01 Thread Jochen Schulz
Michael Savarese:
> 
> for line in readThis:
> try:
> thisKey = key.search(line).group(1)
> thisMap = map.search(line).group(1)
> thisParcel = parcel.search(line).group(1)
> except:
> continue

Why do you catch all exceptions in that loop? Remove the try-except
clause including the 'continue' and a stacktrace will probybably tell
you why your loop appears to do nothing.

J.
-- 
A passionate argument means more to me than a blockbuster movie.
[Agree]   [Disagree]
 


signature.asc
Description: Digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python docs disappointing

2009-08-01 Thread jkn
update: if I set 'use KHTMLPart-based widget' instead of 'QTextBrowser-
based Widget' to display HTML content in the application settings of
KchmViewer, all is readable. Hurrah!

I wonder if it is picing up some QT stylesheet I have lying around in
an over-clever way...

J^n

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


Re: Python docs disappointing

2009-08-01 Thread jkn
Hi Tim

On Aug 1, 8:32 pm, Tim Golden  wrote:
>
> > Unfortunately, the combination of the python 2.6 CHM helpfile style,
> > and the KChmViewer application gives me body text which is almost
> > unreadable (black text on dark blue background). I'm not sure if this
> > a bug in KChmViewer but it's pretty annoying. Anyone else see this?
>
> This was noised about when the new-style docs were first released.
> Somehow (I don't run Linux usually) I had the impression it had
> been fixed; presumably not. However, rebuilding the docs is not
> at all hard: you just need a Python installation and the
> HTMLHelp Workshop. Then you can fiddle about with the CSS to
> your heart's content.
>

The HTML form of the documents (on python.org) seem fine (dark text on
a light background, with a 'light blue on dark blue' sidebar). I was
guessing that the .CHM was intended to have the same style, and
therefore there was a problem with either my viwer, or with the
conversion. Is this not the case then?

I've just checked using xchm, and this displays OK - but I don't think
it's taking any notice of any styles. FWIW I'm running 4.0-r1; there
is a later release but it's not yet available for my Gentoo
distribution.

Can you point me at any references to this bug in the Python release
world please?

Thanks
J^n


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


iterate lines with regex

2009-08-01 Thread Michael Savarese
I'm a python newbie and I'm trying to test several regular expressions on
the same line before moving on to next line.
it seems to move on to next line before trying all regular expressions which
is my goal.
it only returns true for first regular expression
does the curser have to be rest to beginning of line? If so, how would I do
that.
remember I'm new
thanks in advance to any advice
Mike S.

the following is part of my code,
readThis=open('c:/9320.txt','r')

for line in readThis:
try:
thisKey = key.search(line).group(1)
thisMap = map.search(line).group(1)
thisParcel = parcel.search(line).group(1)
except:
continue
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python docs disappointing

2009-08-01 Thread Tim Golden

jkn wrote:


The ActiveState distribution also includes the doc set as a CHM file
(the canonical version didn't used to; one reason why I've used
ActiveState in the past).


It has done for quite some while now: Python 2.3 was the first
and that was released, what, six years ago. Still, you're right;
it used to use plain HTML.


Unfortunately, the combination of the python 2.6 CHM helpfile style,
and the KChmViewer application gives me body text which is almost
unreadable (black text on dark blue background). I'm not sure if this
a bug in KChmViewer but it's pretty annoying. Anyone else see this?


This was noised about when the new-style docs were first released.
Somehow (I don't run Linux usually) I had the impression it had
been fixed; presumably not. However, rebuilding the docs is not
at all hard: you just need a Python installation and the
HTMLHelp Workshop. Then you can fiddle about with the CSS to
your heart's content.

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


Re: Queryable Daemon

2009-08-01 Thread MRAB

Justin DeCell wrote:

Hi All,

I was hoping for a little help with a project I'm working on. I'm 
writing a daemon in python that I want to be queryable  (i.e. I should 
be able to run foo -s and it will report some internal information about 
the foo daemon if it's running) but I can't figure out a way get 
information from that process from an external process. I was thinking 
that there should be a way to open a file descriptor, have the daemon 
write to that every so often and then have the query process just read 
from that fd but it looks like on the process reading from an fd has to 
be a child of the daemon for this to work. The only other way I thought 
of would be to write to a file on disk every so often from the daemon 
and just read the from the query process but it seems like there should 
be a more elegant way to do this...


By the way I'm writing this for unix only so there's no need to worry 
about compatibility with other os'.



Instead of a file descriptor, how about a socket? A certain port at
"127.0.0.1"?
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python docs disappointing

2009-08-01 Thread jkn
On Aug 1, 4:18 am, Terry Reedy  wrote:

> This is one area where Windows users seems to have an advantage. The
> standard installer includes the doc set as a Windows help file. I often
> keep that open in one window while programming in others. I only later
> discovered that this was a copy of the online docs ;-), which I only use
> to check the in-development version before submitting a doc bug.

The ActiveState distribution also includes the doc set as a CHM file
(the canonical version didn't used to; one reason why I've used
ActiveState in the past).

I run a dual-boot system and have used a CHM (Windows Compiled help
file format) viewer under Linux to read the Windows help file. This
has been pretty handy in the past.

Unfortunately, the combination of the python 2.6 CHM helpfile style,
and the KChmViewer application gives me body text which is almost
unreadable (black text on dark blue background). I'm not sure if this
a bug in KChmViewer but it's pretty annoying. Anyone else see this?

J^n

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


Re: M2Crypto: AttributeError: 'CSR' object has no attribute 'pkey'

2009-08-01 Thread Heikki Toivonen
Matthias Güntert wrote:
> class CSR(object):
> def __init__(self):
> pass
> 
> def create_cert_signing_request(keypair, cert_name,
> cert_extension_stack=None):

You missed self. Although this method does not seem to be using any
instance data so there isn't actually much reason to have a CSR object
unless you intend to expand it in ways that require it.

> if cert_extension_stack != None:

A word of advice: always check equality/inequality to None with 'is',
because that way it is a straight pointer conversion which is faster and
won't cause any surprises. In other words, write the above as:

 if cert_extension_stack is not None:

-- 
  Heikki Toivonen - http://heikkitoivonen.net
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: JavaScript toolkits (was Re: ANN: Porcupine Web Application Server 0.6 is released!)

2009-08-01 Thread lkcl
On Jul 21, 12:55 pm, Paul Boddie  wrote:
> On 20 Jul, 18:00, a...@pythoncraft.com (Aahz) wrote:
>
>
>
> > Out of curiosity, are there anyJavaScripttoolkits that generate code
> > that degrades gracefully whenJavaScriptis disabled?
>
> You mean "Web toolkits which useJavaScript", I presume. I have
> written (and use myself) a toolkit/framework called XSLForms (part of
> the XSLTools distribution) which supports in-page updates (AJAX,
> effectively) that degrade to vanilla whole-page requests ifJavaScript
> is switched off:

 yeahhh i remember doing something like that.  each portion of the
page i did as a separate AJAX load, and then there was some loader-
infrastructure where you could, if javascript was switched off, do a
tree-walk-reconstruction of the page.

 if anyone's interested i can provide source code.

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


Queryable Daemon

2009-08-01 Thread Justin DeCell

Hi All,

I was hoping for a little help with a project I'm working on. I'm  
writing a daemon in python that I want to be queryable  (i.e. I should  
be able to run foo -s and it will report some internal information  
about the foo daemon if it's running) but I can't figure out a way get  
information from that process from an external process. I was thinking  
that there should be a way to open a file descriptor, have the daemon  
write to that every so often and then have the query process just read  
from that fd but it looks like on the process reading from an fd has  
to be a child of the daemon for this to work. The only other way I  
thought of would be to write to a file on disk every so often from the  
daemon and just read the from the query process but it seems like  
there should be a more elegant way to do this...


By the way I'm writing this for unix only so there's no need to worry  
about compatibility with other os'.


Thanks,

-Justin

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


Re: JavaScript toolkits (was Re: ANN: Porcupine Web Application Server 0.6 is released!)

2009-08-01 Thread lkcl
On Jul 20, 4:00 pm, a...@pythoncraft.com (Aahz) wrote:
> Out of curiosity, are there anyJavaScripttoolkits

 or python-to-javascript compilers

>  that generate code
> that degrades gracefully whenJavaScriptis disabled?

 http://advogato.org/article/981.html

 you'll need to do a little bit of work - use a state-machine-based
framework (such as twisted, from what i can gather), or use fastcgi,
or solve the problem of storing the state of the pyjamas application
"in between" web requests - but yes, pyjamas-web is a port of pyjamas
to the web server.

 so, by writing an app that conforms to the pyjamas API, you get to
compile it to native javascript, to run in the web browser; you get to
run it as pure python using pyjamas-desktop (python-hulahop underneath
or pywebkitgtk) and then, if you want to finish off the experiment
that i started, you get to run the _same_ python app server-side on
behalf of the users.

 all quite quite mad, to be honest :)

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


Re: os.path.exists() and Samba shares

2009-08-01 Thread Michel Claveau - MVP
Hi!

> SAMBA is a Linux implementation of the SMB protocol, natively supported on 
> Windows.

Right.
But, with Vista or Seven, only recents releases of Samba are supported.
And, Samba know only NTLM release 2
(in register: 
  HKLM\SYSTEM\CurrentControlSet\Control\Lsa
  value  LMCompatibilityLevel ; set 1 or 0.
)

@-salutations
-- 
Michel Claveau 

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


M2Crypto: AttributeError: 'CSR' object has no attribute 'pkey'

2009-08-01 Thread Matthias Güntert
Hello python-guys

I am trying to build a python based certificate authority using
m2crypto. I am quite new to python and I am asking myself why my code
snippets below throw the following Traceback:

$ python csr.py

...
...
Traceback (most recent call last):
  File "csr.py", line 48, in 
csr.create_cert_signing_request(pubkey, cert_name)
  File "csr.py", line 17, in create_cert_signing_request
cert_request.set_pubkey(keypair)
  File "/usr/lib64/python2.6/site-packages/M2Crypto/X509.py", line 926,
in set_pubkey
return m2.x509_req_set_pubkey( self.req, pkey.pkey )
AttributeError: 'CSR' object has no attribute 'pkey'

Bellow are my modules containing two classes CSR and Keypair. There
seems to be something wrong in the way I am calling
csr.create_cert_signing_request(), because if I directly add the key
generation part to the create_cert_singing_request function it works... 

http://www.heikkitoivonen.net/m2crypto/api/M2Crypto.X509.Request-class.html#set_pubkey

This link states out, that the instance function set_pubkey takes an
EVP_KEY object as argument, and thats what I am passing to it, or not? 

I really would be happy if someone could give me a helping hand on this
and maybe could comment every style / ... mistake I made to accelerate
my learning experience. 

Thanks,
Matthias 

$ cat csr.py

from config import *
from keypair import *
from M2Crypto import X509, EVP

class CSR(object):
def __init__(self):
pass

def create_cert_signing_request(keypair, cert_name,
cert_extension_stack=None):
# create a certificate signing request object
cert_request = X509.Request()

# set certificate version to 3
cert_request.set_version(3)

# which rsa public key should be used?
cert_request.set_pubkey(keypair)

# create an subject for the certificate request
cert_request.set_subject_name(cert_name)

if cert_extension_stack != None:
# add the extensions to the request
cert_request.add_extensions(cert_extension_stack)

# sign the request using the RSA key pair
cert_request.sign(keypair, 'sha1')

return cert_request

if __name__ == "__main__":
csr = CSR()
cert_name = X509.X509_Name()
keyp = Keypair()

keyp.create_keypair()
keyp.save_keypair("host.key")
pubkey = keyp.get_keypair()

cert_name.C = "GB"
cert_name.ST = "Greater Manchester"
cert_name.L = "Salford"
cert_name.O = "COMODO CA Limited"
cert_name.CN = "COMODO Certification Authority"
cert_name.OU = "Information Technology"
cert_name.Email = "cont...@comodo.com"

csr.create_cert_signing_request(pubkey, cert_name)

$ cat keypair.py

from M2Crypto import X509, m2, RSA, EVP
from config import *

class Keypair(object):
def __init__(self):
self.config = Config()
self.keypair = EVP.PKey()

def create_keypair(self):
# generate an RSA key pair
# OpenSSL book page 232
# second argument should be a constant RSA_F4 or RSA_3
rsa_key_pair =
RSA.gen_key(int(self.config.get_attribute('CA','key_size')), m2.RSA_F4)

# check if RSA key pair is usable
# OpenSSL book page 232
if rsa_key_pair.check_key() != 1:
print 'error while generating key!'
sys.exit()

# EVP object which can hold either a DSA or an RSA object
# OpenSSL book page 236
evp_key_container = EVP.PKey()
evp_key_container.assign_rsa(rsa_key_pair)

self.keypair = evp_key_container

def save_keypair(self, filename):
self.keypair.save_key(filename, None)

def load_keypair(self, filename):
self.keypair = EVP.load_key(filename)

def get_keypair(self):
return self.keypair

def get_public_key(self):
return self.keypair.pkey

def print_keypair(self):
print self.keypair.as_pem(None)

if __name__ == "__main__":
key = Keypair()
key.create_keypair()
key.save_keypair("test.key")

print key.get_keypair()
print key.get_public_key()

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


Re: Python docs disappointing

2009-08-01 Thread Nobody
On Fri, 31 Jul 2009 20:10:45 +, kj wrote:

> I'm pretty new to Python, and I like a lot overall, but I find the
> documentation for Python rather poor, overall.

FWIW, I find the module documentation to be mostly adequate.

What's missing is a human-readable language *manual*. The tutorial omits
too much; the language reference may be fine for language lawyering,
but it's not much use otherwise.

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


Re: How to read webpage

2009-08-01 Thread Marcus Wanner

On 8/1/2009 11:31 AM, Jon Clements wrote:

On 1 Aug, 14:52, MRAB  wrote:

tarun wrote:

Dear All,
I want to read a webpage and copy the contents of it in word file. I
tried to write following code:
import urllib2
urllib2.urlopen("http://www.rediff.com/";)
*Error:-*
urllib2.urlopen("http://www.icicibank.com/";)
  File "C:\Python25\lib\urllib2.py", line 121, in urlopen
return _opener.open(url, data)
  File "C:\Python25\lib\urllib2.py", line 374, in open
response = self._open(req, data)
  File "C:\Python25\lib\urllib2.py", line 392, in _open
'_open', req)
  File "C:\Python25\lib\urllib2.py", line 353, in _call_chain
result = func(*args)
  File "C:\Python25\lib\urllib2.py", line 1100, in http_open
return self.do_open(httplib.HTTPConnection, req)
  File "C:\Python25\lib\urllib2.py", line 1075, in do_open
raise URLError(err)
urllib2.URLError: 

I've just tried it. I didn't get an exception, so your problem must be
elsewhere.


I'm hoping this adds to MRAB's reply; it is intended however for the
OP.

Jeeze -- been a while since I've had to deal with Sockets (directly
anyway).
If memory serves correctly, it's where the system can't name resolve
the required address.
So best guess is it's either a temporary glitch, or an issue with your
routing.

Jon.
Jon.


'getaddrinfo failed' means that the nameserver can't be found, or that 
it has no records of that address (I'm 90% sure of that).


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


Re: socket policy flash help

2009-08-01 Thread NighterNet
On Aug 1, 4:52 am, Piet van Oostrum  wrote:
> > NighterNet  (N) wrote:
> >N> I need help on the policy to able to let access to user to the server
> >N> once the policy access is finish. I been trying to find a good
> >N> example, but I got no luck. Using python version 3.1.
> >N> Here the code I tested but it not working.
> >N> if str(buff) == str("b\'\\x00\'"):
>
> What is buff supposed to contain here? I assume a byte sequence?
> Do you reaaly mean that buff[0] contains the byte 'b' and buff[1]
> contains a single quote? And the last byte also a single quote? And the
> four bytes with \ x 0 0 before that instead of a null byte? In total 29 bytes?
>
> Or did you mean just the 23 bytes long b'\x00'?
>
> Maybe it should be if buff == b'\x00':
>
> >N>                               print ('policy FOUND >>> sending...')
> >N>                               rawinput = str(' >version=\"1.0\"?> >to-ports=\"*\" />')
>
> The str here is unnecessary as you have already a string.
>
> >N>                               print (rawinput)
> >N>                               b = bytes ( ord(c) for c in rawinput)
>
> Why not
> b = b' domain=\"*\" to-ports=\"*\" />' ?
>
> >N>                               self.sockfd.send(b);
>
> --
> Piet van Oostrum 
> URL:http://pietvanoostrum.com[PGP 8DAE142BE17999C4]
> Private email: p...@vanoostrum.org


I try that method and flash socket is not getting the policy.

b = b''
self.sockfd.send(b);

server = socket.socket( socket.AF_INET, socket.SOCK_STREAM)

When it able to read the policy it send it but it fail to send to
flash some reason and send it again and then d/c.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to read webpage

2009-08-01 Thread Jon Clements
On 1 Aug, 14:52, MRAB  wrote:
> tarun wrote:
> > Dear All,
> > I want to read a webpage and copy the contents of it in word file. I
> > tried to write following code:
>
> > import urllib2
> > urllib2.urlopen("http://www.rediff.com/";)
>
> > *Error:-*
>
> >     urllib2.urlopen("http://www.icicibank.com/";)
> >   File "C:\Python25\lib\urllib2.py", line 121, in urlopen
> >     return _opener.open(url, data)
> >   File "C:\Python25\lib\urllib2.py", line 374, in open
> >     response = self._open(req, data)
> >   File "C:\Python25\lib\urllib2.py", line 392, in _open
> >     '_open', req)
> >   File "C:\Python25\lib\urllib2.py", line 353, in _call_chain
> >     result = func(*args)
> >   File "C:\Python25\lib\urllib2.py", line 1100, in http_open
> >     return self.do_open(httplib.HTTPConnection, req)
> >   File "C:\Python25\lib\urllib2.py", line 1075, in do_open
> >     raise URLError(err)
> > urllib2.URLError: 
>
> I've just tried it. I didn't get an exception, so your problem must be
> elsewhere.

I'm hoping this adds to MRAB's reply; it is intended however for the
OP.

Jeeze -- been a while since I've had to deal with Sockets (directly
anyway).
If memory serves correctly, it's where the system can't name resolve
the required address.
So best guess is it's either a temporary glitch, or an issue with your
routing.

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


Re: How to read webpage

2009-08-01 Thread koranthala
On Aug 1, 6:52 pm, MRAB  wrote:
> tarun wrote:
> > Dear All,
> > I want to read a webpage and copy the contents of it in word file. I
> > tried to write following code:
>
> > import urllib2
> > urllib2.urlopen("http://www.rediff.com/";)
>
> > *Error:-*
>
> >     urllib2.urlopen("http://www.icicibank.com/";)
> >   File "C:\Python25\lib\urllib2.py", line 121, in urlopen
> >     return _opener.open(url, data)
> >   File "C:\Python25\lib\urllib2.py", line 374, in open
> >     response = self._open(req, data)
> >   File "C:\Python25\lib\urllib2.py", line 392, in _open
> >     '_open', req)
> >   File "C:\Python25\lib\urllib2.py", line 353, in _call_chain
> >     result = func(*args)
> >   File "C:\Python25\lib\urllib2.py", line 1100, in http_open
> >     return self.do_open(httplib.HTTPConnection, req)
> >   File "C:\Python25\lib\urllib2.py", line 1075, in do_open
> >     raise URLError(err)
> > urllib2.URLError: 
>
> I've just tried it. I didn't get an exception, so your problem must be
> elsewhere.

Is it that the website expects a valid browser?
In that case, spoof a browser and try to get the site.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to read webpage

2009-08-01 Thread MRAB

tarun wrote:

Dear All,
I want to read a webpage and copy the contents of it in word file. I 
tried to write following code:


import urllib2
urllib2.urlopen("http://www.rediff.com/";)

*Error:-*

urllib2.urlopen("http://www.icicibank.com/";)
  File "C:\Python25\lib\urllib2.py", line 121, in urlopen
return _opener.open(url, data)
  File "C:\Python25\lib\urllib2.py", line 374, in open
response = self._open(req, data)
  File "C:\Python25\lib\urllib2.py", line 392, in _open
'_open', req)
  File "C:\Python25\lib\urllib2.py", line 353, in _call_chain
result = func(*args)
  File "C:\Python25\lib\urllib2.py", line 1100, in http_open
return self.do_open(httplib.HTTPConnection, req)
  File "C:\Python25\lib\urllib2.py", line 1075, in do_open
raise URLError(err)
urllib2.URLError: 


I've just tried it. I didn't get an exception, so your problem must be
elsewhere.
--
http://mail.python.org/mailman/listinfo/python-list


How to read webpage

2009-08-01 Thread tarun
Dear All,I want to read a webpage and copy the contents of it in word file.
I tried to write following code:

import urllib2
urllib2.urlopen("http://www.rediff .com/")

*Error:-*

urllib2.urlopen("http://www.icicibank.com/";)
  File "C:\Python25\lib\urllib2.py", line 121, in urlopen
return _opener.open(url, data)
  File "C:\Python25\lib\urllib2.py", line 374, in open
response = self._open(req, data)
  File "C:\Python25\lib\urllib2.py", line 392, in _open
'_open', req)
  File "C:\Python25\lib\urllib2.py", line 353, in _call_chain
result = func(*args)
  File "C:\Python25\lib\urllib2.py", line 1100, in http_open
return self.do_open(httplib.HTTPConnection, req)
  File "C:\Python25\lib\urllib2.py", line 1075, in do_open
raise URLError(err)
urllib2.URLError: 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: socket policy flash help

2009-08-01 Thread Piet van Oostrum
> NighterNet  (N) wrote:

>N> I need help on the policy to able to let access to user to the server
>N> once the policy access is finish. I been trying to find a good
>N> example, but I got no luck. Using python version 3.1.

>N> Here the code I tested but it not working.

>N> if str(buff) == str("b\'\\x00\'"):

What is buff supposed to contain here? I assume a byte sequence?
Do you reaaly mean that buff[0] contains the byte 'b' and buff[1]
contains a single quote? And the last byte also a single quote? And the
four bytes with \ x 0 0 before that instead of a null byte? In total 29 bytes?

Or did you mean just the 23 bytes long b'\x00'?

Maybe it should be if buff == b'\x00':

>N> print ('policy FOUND >>> sending...')
>N> rawinput = str('version=\"1.0\"?>to-ports=\"*\" />')

The str here is unnecessary as you have already a string.

>N> print (rawinput)
>N> b = bytes ( ord(c) for c in rawinput)

Why not 
b = b'' ?

>N> self.sockfd.send(b);

-- 
Piet van Oostrum 
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Confused About Python Loggin

2009-08-01 Thread Vinay Sajip
On Jul 31, 2:04 pm, Jean-Michel Pichavant 
wrote:
> Jannik Sundø wrote:
> > Hi all. I think I fixed this problem by setting fileLogger.propagate =
> > 0. Otherwise it will propagate up to the root logger, which outputs to
> > stdout, as far as I can understand.
>
> > On 31 Jul 2009, at 01:17, Jannik Sundø wrote:
>
> >> Dear all, I am quite confused about the Pythonlogging. I have read
> >> and re-read the Python documentation for the Pythonloggingmodule
> >> and googled, but to no avail. I simply want one logger to log to a
> >> file and another logger to log to the console. Neither should log the
> >> other's messages. The code below causes fileLogger to log to BOTH a
> >> file and the console, how come? It seems to me that a call such as
> >> "consoleHandler =logging.StreamHandler()" affects other loggers,
> >> which I do not want. Also, if I do not do
> >>logging.basicConfig(level=logging.INFO) in one of the classes of my
> >> application, theloggingdoes not work. Any ideas how come?
>
> >> Thanks a lot for any help! :)
>
> >> fileHandler =logging.FileHandler('../../logs/log.txt')
> >> fileLogger =logging.getLogger('TESTHARNESSFILE')
> >> fileLogger.addHandler(fileHandler)
> >> fileLogger.setLevel(logging.INFO)
> >> consoleHandler =logging.StreamHandler()
> >> logger =logging.getLogger('TESTHARNESS')
> >> logger.addHandler(consoleHandler)
> >> logger.setLevel(logging.INFO)
>
> > --http://mail.python.org/mailman/listinfo/python-list
>
> Please do not top post :o)
>
> Are sure you have used the code provided above ?
> Loggers only propagate events to its parent.
>
> fileLogger =logging.getLogger('TESTHARNESSFILE"
> logger =logging.getLogger('TESTHARNESS')
> Those one have no parent relationship.
>
> However these one have parent relationship:
> fileLogger =logging.getLogger('TESTHARNESS.FILE") # note the dotted name
> logger =logging.getLogger('TESTHARNESS')
>
> Or maybe you have added a handler to the root logger...
>
> Using the propagate attribute is correct only between 2 loggers that are
> meant to be parents.
>
> JM

What you say is true, Jean-Michel, but the OP might be meaning the
parent-child relationship both his loggers have with the mother of all
loggers - the root logger ;-)

Regards,

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


Re: Newbie Question regarding __init__()

2009-08-01 Thread Dave Angel

Nat Williams wrote:

As MRAB described, ALL instance methods need to accept 'self' as a first
parameter, as that will be passed to them implicitly when they are called.
This includes __init__.  The name 'self' is just a commonly accepted
convention for the name of the instance object passed to methods.  You don't
have to call it that, but you really should.

Take a look at http://docs.python.org/tutorial/classes.html#class-objects
It might help shed some light on how methods and instances work.

One other thing.  I'm a little confused by the first line of
dcObject.__init__:

self.init_Pre() and self.init_Exec()

I suspect this does not do what you think it does.  init_Pre and init_Exec
will both be called by this expression (unless init_Pre throws an exception,
of course).  You're not getting anything here that you wouldn't by just
calling each method on a separate line, except just making it harder to
read.

  
Read the doc-string for init_Pre() and for init_Exec().  The final 
version of init_Pre() will return False in some circumstances, and in 
those circumstances Simon doesn't want init_Exec() to be called.  He's 
deliberately using the short-circuit evaluation of  'and'  to accomplish 
that.




On Fri, Jul 31, 2009 at 8:53 PM, Simon  wrote:

  

Hi

So should the dcObject class include the "self" as well since I have
not defined an __init__ method in dcCursor?

Simon

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




  
Every one of those methods in both of those classes need a "self" first 
argument.  As others have said, all instance methods need a 'self.'



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


Re: socket policy flash help

2009-08-01 Thread paul

NighterNet schrieb:

I need help on the policy to able to let access to user to the server
once the policy access is finish. I been trying to find a good
example, but I got no luck. Using python version 3.1.

Here the code I tested but it not working.

if str(buff) == str("b\'\\x00\'"):
print ('policy FOUND >>> sending...')
rawinput = str('')
print (rawinput)
b = bytes ( ord(c) for c in rawinput)
self.sockfd.send(b);

And the error is? Doesn't Flash use http as transport?

cheers
 Paul

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


problem in event handling on change of variable value.

2009-08-01 Thread sirjee
hello;

i m facing a problem in handling events on change of value of
environment variable in a tool CANoe.

class CANoeEvents:
def OnChange(self,value):
print "value of environment variable has changed"
def OnOpen(self,App):
print "opening Application"

App_Event = DispatchWithEvents('CANoe.Application',CANoeEvents)
time.sleep(2)
App_Event.Open("C:\projectConfig.cfg")  # printd "opening Application"
and event handled properly.
...(now a code file runs in the canoe in which value of
environment variable called dummy is changed during execution. Just
like OnOpen; OnChange is defined in specification which should be
called on change of environment variable.But it is not happening.)
while ():
myenvVar = App_Event.Environment.GetVariable("dummy")

The VB does it very easily and defines a subroutine called :
Sub myenvVar _OnChange(value)
   print "value of environment variable has changed"
End Sub
//however the
alternative for subroutine for OnOpen in VB (defined below) works fine
as shown above in python.
Sub AppEvent_OnOpen(App)
print "opening Application"
End Sub

for VB; all this stuff is cake work object_eventname subroutine
and done.what in python?
-- 
http://mail.python.org/mailman/listinfo/python-list


Aug 1 & 16- Global VOIP Free SW HW Culture meeting, BerkeleyTIP, For Forwarding

2009-08-01 Thread john_re
Interested in joining the friendly global Free SW HW & Culture communities in a 
global Voice meeting?  You´re invited. :)

You can join from your home, or better: get a local meeting together. Tip: a 
college WiFi cafe could be a great local meeting place.  Make sure you have a 
VOIP headset!

For all details, see the website (I´m leaving out many sublinks to make this 
email smaller).
http://sites.google.com/site/berkeleytip

Start by joining #berkeleytip on IRC freenode.net.  We´ll help you get your 
VOIP connection working. :)

=  MARK YOUR CALENDARS: 1st Sat & 3rd Sunday each month. August 1 & 16.
10A - 6P Pacific US time (+7H GMT, IIRC)
= 1P-9P Eastern US time = 5P - 1A GMT ?

Or, come to the local meeting on the UC Berkeley campus.
NOTE: SPECIAL LOCATION AUG 1: SEE BTIP WEBSITE FOR LOCATION,
& RSVP TO ME OR THE BTIP LISTS.

AUG 1 MEETING WILL BE 12N - 3P AT THE BTIP VOIP SERVER LOCATION 
ON THE UCB CAMPUS.  SEE THE WEBSITE FOR ROOM LOCATION.
We´ll hack on the new BTIP Asterisk VOIP server, in its presence.

PLEASE RSVP TO ME (John) OR THE LIST IF YOU WANT TO MEET AT OUR
USUAL LOCATION, THE FREE SPEECH CAFE, 10A-12n, 3-6PM,
(otherwise i might not be there).

=  MEETING TOPICS FOR AUGUST:
1) Whatever _you_ want to work on - Email the BTIPGlobal list & 
let us know what your interests are.
2) Our VOIP conference server, using Asterisk.
3) Planning for year 2.

=  JOIN FOR THE START OF YEAR 2 GLOBAL MEETINGs:
We had a great first year.  We had local attendees from around the San 
Francisco Bay Area & Northern California.  High School, College, Grad Students, 
& working & retired people attended.

>From the US, people joined the meeting (IRC or VOIP) from Hawaii to Virgina, 
>Washington to Michigan to Florida. (+ California & other states.)

Globally, Sweden, Germany, England, Ireland, Iran & India (& maybe others I 
don´t recall right now.) :)

In May Richard Stallman joined the global meeting for Q & A about free SW & HW.

== YEAR 2 FOCUS: COLLEGE LOCAL MEETINGS, & AMERICAS´ ANNOUNCEMENTS.

Two main things I´ll focus on this year:
1) Inviting groups to join at colleges & universities - BTIP is educational.  
My hope: if more students learn about free SW hw & culture, some of them will 
then go on to become _contributors_. :)

2) I´ll try to get monthly announcements out to the biggest LUGs in the 10 
largest countries in the Americas.

== What would _YOU_ like to accomplish this year?  Email the BTIP mail list, 
say ¨hi¨, tell us about your interests, projects & desires.

=  FOR FORWARDING - You are invited to forward this announcement wherever 
you think it might be appreciated.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: possible to round number and convert to string?

2009-08-01 Thread Mark Dickinson
On Jul 31, 11:17 pm, "Dr. Phillip M. Feldman" 
wrote:
> I'd like to be able to convert a float to a string representation in which
> the number is rounded to a specified number of digits.  If num2str is a
> hypothetical function that does this, then num2str(pi,3) would be '3.142'
> (not '3.141').

Python's string formatting does exactly this.

Python 2.6.2 (r262:71600, Jul  8 2009, 09:56:31)
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> num2str = '{0:.{1}f}'.format
>>> num2str(3.14159, 3)
'3.142'

(In Python 3.1, num2str = '{:.{}f}'.format  is enough.)


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


Re: possible to round number and convert to string?

2009-08-01 Thread r
On Jul 31, 7:42 pm, "Dr. Phillip M. Feldman" 
wrote:
> This was very close to what I wanted.  Thanks!  My final code looks like
> this:
>
> def num2str(x,f=4):
>    """Convert x (int or float) to a string with f digits to right of
>    the decimal point.  f may be zero or negative, in which case the decimal
>    point is suppressed."""
>    s= str(round(x,f))
>    if f<=0:
>       # Delete decimal point:
>       i= s.find('.')
>       if i>0: s= s[:i]
>    return s


Is it *really* necessary to create a named function for something as
trivial as this?

>>> import math
>>> '%0.3f' %math.pi
'3.142'
>>> '%d' %math.pi
'3'

Seems string formatting is more "pythonic" -- opps, now why did i have
to go and say that... :)
-- 
http://mail.python.org/mailman/listinfo/python-list


fil open close very slow

2009-08-01 Thread Robert Robert
hiya all,
I have a "large" script written in python. There is in that big script at a 
certain point a loop in which I create a lots of simple small text files. Each 
text file just contain I think 4 or 5 short lines. When I simply run it in 
IDLE, it runs fast. But when I compile it to binary files, it becomes very 
slow. I turned on the profiler and discorvered it was slow at the open() and 
close() calls. I removed those calls to confirm this, and yes my program runs 
very fast then. Does anyone has an idea or suggestion why this can be possible. 
I only compile them to .pyc files, which as what I see, when I normally run in 
IDLe these files are created as well, so I really got no clue.
rh.


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


"ADMISSION IN FA FSC" "ADMISSION IN FA/FSC" "ADMISSION IN GC UNIVERSITY LAHORE" "ADMISSION IN SCIENCE COLLEGE LAHORE" "ADMISSION IN KIPS LAHORE" "ADMISSION IN LEADERSHIP COLLEGE LAHORE" "ADMISSION I

2009-08-01 Thread Riaz Ahmad
"ADMISSION IN FA  FSC"


www.admissionspk.blogspot.com


"ADMISSION IN FA/FSC"


www.admissionspk.blogspot.com


 "ADMISSION IN GC UNIVERSITY LAHORE"



www.admissionspk.blogspot.com


 "ADMISSION IN SCIENCE COLLEGE LAHORE"


www.admissionspk.blogspot.com


 "ADMISSION IN KIPS LAHORE"


www.admissionspk.blogspot.com


"ADMISSION IN LEADERSHIP COLLEGE LAHORE"

www.admissionspk.blogspot.com

 "ADMISSION IN BAHAUDDIN ZAKARIYA UNIVERSITY MULTAN"

www.admissionspk.blogspot.com





www.admissionspk.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-list