python 2.4 logging module

2006-03-10 Thread Pramod
Hi All,

How can I remove an Instance of logger ?
I need this feature in one of my script where I need to associate each
time logger instance to different handler.

Thanks in advance
Pramod

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


How to input values of the matrix from keyboard in python

2010-08-11 Thread Pramod
Hi

   I want to know the how we input values into the matrix (N*N size)
from keyboard in python,

Here I wrote Matrix programe in C++


This  asks values from key board and print on the console N*N matrix ;




Thanks in advance 


#include
using namespace std;
int main()
{
double **a;
int i,j,n;
cout<<"Enter size of the matrix\n";
cin>>n;
for(i=0;i>a[i][j];
cout

How to give matrix input from keyboard or file in python

2010-08-11 Thread Pramod





I want to write the following programm in python .


Main objective is input from keyoard to enter elements into the
matrix .


Thanks in advance



#include
#include
#include
using namespace std;
int main()
{
double **a;
int i,j,n;
cout<<"Enter size of the matrix\n";
cin>>n;
a=new double* [n];
for(i=0;i>a[i][j];
cout<
stringified = "\n".join("\t".join(row) for row in a)
  File "two.py", line 16, in 
stringified = "\n".join("\t".join(row) for row in a)
TypeError: sequence item 0: expected string, float found

Thanks in Advance




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


problem in using linalg solver in numpy

2010-08-14 Thread Pramod
Hi Friends


When run the below  program in python i got error like this ,


Matrix
[[ 8 -6  2]
 [-4 11 -7]
 [ 4 -7  6]]
row vecotr X
[[ 28 -40  33]]
Traceback (most recent call last):
  File "solve.py", line 16, in 
print A*B
  File "/usr/lib/python2.6/dist-packages/numpy/core/defmatrix.py",
line 290, in __mul__
return N.dot(self, asmatrix(other))
ValueError: objects are not aligned




#!/usr/bin/python
N=3
from numpy import linalg
from numpy import matrix


fr=open('mat.txt','r')

A=matrix([[int(fr.readline()) for j in range(N)]for i in range(N)])
B=matrix([[int(fr.readline())for j in range(N)]])

print 'Matrix \n',A
print 'row vecotr X\n',B
#A=matrix([[3,4],[5,2]])
#B=matrix([[11],[9]])
print A*B

#y=linalg.solve(A,B)
#print 'Solution vectoris \n',y


The input file is
8
-6
2
-4
11
-7
4
-7
6
28
-40
33

please try to fix the error in the program


Thankx in advance
-- 
http://mail.python.org/mailman/listinfo/python-list


Error in Following python program

2010-09-04 Thread Pramod
#/usr/bin/python
from numpy import matrix
n=input('Enter matrix range')
fr=open('mat.txt','r')
print ('Enter elements into the matrix\n')
a=matrix([[input()for j in range(n)] for i in range(n)])
for i in range(n):
for j in range(n):
print a[i][j]
print '\n'

When i run the above program the following error is Coming please
Error is
   Enter matrix range3
Enter elements into the matrix

1
2
3
4
5
6
7
8
9
[[1 2 3]]
Traceback (most recent call last):
  File "2.py", line 10, in 
print a[i][j]
  File "/usr/lib/python2.6/dist-packages/numpy/core/defmatrix.py",
line 265, in __getitem__
out = N.ndarray.__getitem__

please resolve my problem  Thanks in advance
~
-- 
http://mail.python.org/mailman/listinfo/python-list


Socket programming

2015-01-03 Thread pramod gowda
Hi i am learning socket programming,

client code:

import socket

client_socket=socket.socket()
server_address='192.168.2.2'
server_port= 80
print("hello")
client_socket.connect((server_address,server_port))
print("hello")
data=client_socket.recv(1024)
print(data)
client_socket.close()

server code:
import socket

server_socket=socket.socket()
server_name='192.168.2.2'
server_port= 80
server_socket.bind((server_name,server_port))
server_socket.listen(1)

while True:
print("hello")
c,address=server_socket.accept()
print("we got connection from:",address)
c.send("hello,hw ru")
c.close()




I am not getting the output, i am using windows 7 OS..
please  check and give me the solution.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-03 Thread pramod gowda
On Saturday, January 3, 2015 5:26:27 PM UTC+5:30, Chris Angelico wrote:
> On Sat, Jan 3, 2015 at 10:43 PM, pramod gowda  wrote:
> > I am not getting the output, i am using windows 7 OS..
> > please  check and give me the solution.
> 
> Windows 7 - that's part of the story. What version of Python are you
> using? Is 192.168.2.2 the correct IP address? What happens when you
> run these? Do you get exceptions?
> 
> ChrisA

Hi chris.


I am using python 3.4.2
I don get any exceptions,
but wn i run the code,i don see any connections, IP address is given as my 
system IP.

 c,address=server_socket.accept() in server.py..if am trying to print 
something,it fails
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-03 Thread pramod gowda
On Saturday, January 3, 2015 6:08:28 PM UTC+5:30, Chris Angelico wrote:
> On Sat, Jan 3, 2015 at 11:25 PM, pramod gowda  wrote:
> > I am using python 3.4.2
> > I don get any exceptions,
> > but wn i run the code,i don see any connections, IP address is given as my 
> > system IP.
> 
> What does the client say?
> 
> ChrisA

After  c,address=server_socket.accept()  ,this line of code,nothing s being 
executed.

example i am just trying to print "Hello"
thts also not being printed
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-03 Thread pramod gowda
On Saturday, January 3, 2015 8:39:26 PM UTC+5:30, mm0fmf wrote:
> On 03/01/2015 11:43, pramod gowda wrote:
> > server_socket=socket.socket()
> > server_name='192.168.2.2'
> > server_port= 80
> > server_socket.bind((server_name,server_port))
> > server_socket.listen(1)
> 
> I don't do much Python on Windows but do you have the necessary access 
> rights to open a listening socket on port 80? Don't you need to run this 
> with Administrator rights?

HI, i m doing n personal laptop.
so i think i ve rights to open a listening socket,could u pls tell me hw can i 
check it?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-03 Thread pramod gowda
On Saturday, January 3, 2015 9:27:20 PM UTC+5:30, Steven D'Aprano wrote:
> pramod gowda wrote:
> 
> > HI, i m doing n personal laptop.
> > so i think i ve rights to open a listening socket,could u pls tell me hw
> > can i check it?
> 
> Is your keyboard broken? There are a lot of missing characters in your
> sentences. You're going to have a lot of trouble programming with a broken
> keyboard.
> 
> As far as sockets, this is a Python discussion group, not Windows experts.
> Try googling for more information and see if that helps:
> 
> https://duckduckgo.com/?q=windows%20permission%20to%20open%20sockets
> 
> 
> 
> 
> -- 
> Steven

Hi Steven,


Sorry for using short words while posting,I am using python in windows7 with 
Python ver 3.4.2 for socket program,so i am asking for help.

Thanks
Pramod SP

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


Client side web programming

2006-01-10 Thread Pramod Subramanyan
Hi,

Well the trouble is that my orkut scrapbook is flooded. So I reckoned
that I'd write some sort of a script to delete the 14800 or so scraps.
Now the big problem is that I don't really have too much knowledge
about web programming. I have a rough idea about HTTP, HTTPS, cookies
etc. but I don't really know the specifics.

Question 1: Orkut seems to use a cookie to keep track of who I am. How
long will this cookie be valid? Supposing I login using Mozilla and
then get hold of this cookie, then use my Python script and send the
same cookie whilst send a "POST" request to delete the entry, will
orkut be fooled?

Question 2: How do I send a specific cookie along with my request? The
whole documentation for urllib2 is rather general and seems to assume
thorough knowledge of how those protocols work.

Question 3: Is there a simpler way?

Question 4: Pointers to further information?

Thanks,
Pramod

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


Re: Client side web programming

2006-01-10 Thread Pramod Subramanyan

Michele Simionato wrote:
> > Pramod Subramanyan asked aboyt urllib2:
>
> Look at this article:
>
> http://www.voidspace.org.uk/python/articles/urllib2.shtml
> 
>Michele Simionato

Thanks! This is the sort of thing I need.

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


Re: Client side web programming

2006-01-10 Thread Pramod Subramanyan

Fuzzyman wrote:
> And this one for cookie handling:
>
> http://www.voidspace.org.uk/python/articles/cookielib.shtml
> 
> All the best,
> 
> Fuzzyman

Cool! Thanks a lot.

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


Re: Client side web programming

2006-01-10 Thread Pramod Subramanyan

Luiz Geron wrote:
> Maybe this will be useful to you:
> http://www.python.org/pypi/mechanoid/0.6.8

Actually I found this thing when I was googling. But there isn't too
much documentation, which is why I posted here.

Using cookielib and urllib2, I've come up with a workable solution. Its
damn slow though - which is probably orkut's fault - deletes about
10-15 scraps a minute - so to get through 14000 scraps its probably
gonna take around 23 hours.

Anyway, thanks a lot everybody.
Pramod

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


Re: Client side web programming

2006-01-12 Thread Pramod Subramanyan

Neil Hodgson wrote:
> Pramod Subramanyan wrote:
>
> > Using cookielib and urllib2, I've come up with a workable solution. Its
> > damn slow though - which is probably orkut's fault - deletes about
> > 10-15 scraps a minute - so to get through 14000 scraps its probably
> > gonna take around 23 hours.
>
> It'll be interesting to see if it completes or whether orkut has a
> load limiter that stops you after a certain amount of traffic.
>
> Neil

It seems like the programmers at orkut have screwed up, because I
didn't really have 14000 scraps, only around 1000. My requests timed
out about 5 times in that span, but its hard to say whether it was a
load limiter because orkut is somewhat unreliable anyway.

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


Query : sys.excepthook exception in Python

2006-04-26 Thread Pramod TK
Hi,
Sometimes during execution of python scripts below mentioned error string is 
displayed on the console.
"Unhandled exception in thread started by Error in sys.excepthook:
Original exception was:"
The scripts are not terminated, they continue to execute normally.
Is this is a problem with python? Is there any known solution.
I am using Python 2.4.
Thanks in Advance

With Best Regards,
Pramod TK 


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


Query regarding support for IPv6 in python

2006-04-26 Thread Pramod TK
Hello All,
I have some queries related to python support for IPv6. Can you kindly 
clarify the doubts which I have -
1. Does python support IPv6? [128 bit IP addresses?]
2. Does it support setting of QoS flags?
3. Does it support tunneling of IPv6 on a IPv4 network?
4. If an IPv4 address is given, does it support this on a IPv6 network?
If not can you kindly let me know, Are there any plans for supporting these 
features in future?

For Example -
In IPv4 we have gethostbyname() function, which is deprecated in IPv6. In 
IPv6, getaddrinfo() and new data structure like struct addrinfo is 
introduced.
Is this new function getaddrinfo() of IPv6 is supported in Win32 Extensions 
for python.


Thanks in Advance,
Pramod TK 


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


Need Help

2008-04-09 Thread pramod sridhar
Hello,

I would like to access type library files (.tlb) from python.

The application (with .tlb extension) controls an external instrument over
standard GPIB interface.
Is it possible to control this application from Python? If so, how ?
Can anyone share or send link of some examples ?

Many Thanks in advance,
Pramod
-- 
http://mail.python.org/mailman/listinfo/python-list

help: Question regarding parallel communication using python

2008-04-30 Thread pramod sridhar
Hello,

I would like from my Python application to control 2 (or more devices) using
the existing port's interface in my PC,like serial (COM1) or Parallel port
(lpt) or any other like PCI...etc.
The control mechanism usually involves sending messages to the connected
devices in parallel.
For instance, I would like to send a command to a target connected on COM
port and at the same time would like to read the value of a Digital
multimeter over other COM port ( or may be via USB with some adapter)

My Question is:
- Is it possible to achieve the above in Python ?
- Do we need to use any kind of Parallel processing to achieve this ?
- If so, Which of the available packages (like pypar or Pydusa..etc) suits
best ?

Please suggest.

Thank you very much in advance,

With Regards,
Pramod
--
http://mail.python.org/mailman/listinfo/python-list

Query : sys.excepthook exception in Python

2006-04-10 Thread Pramod, TK
Title:  Query : sys.excepthook exception in Python






Hi,


Sometimes during execution of python scripts below mentioned error string is displayed on the console. 


"Unhandled exception in thread started by  Error in sys.excepthook:  

Original exception was:"


The scripts are not terminated, they continue to execute normally.


Is this is a problem with python? Is there any known solution.


I am using Python 2.4.


Thanks in Advance


With Best Regards,

Pramod TK






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

Question regarding python migration

2010-10-13 Thread Pramod Thirthachar Sridhar
Hi,



We have a Python based test framework which is being used in various projects.



Our current environment is

Python (ver 2.5.1)

wxPython (wxPython2.8-win32-ansi-2.8.6.0-py25)

pywin32-210.win32-py2.5

vcredist_x86.exe

pyserial-2.2



Our Framework is being currently used in Windows XP.



The issue is:

Soon our environment will be migrated from Windows XP to Windows 7.

In this regard, I would be in need of suggestions/ideas/information regarding 
migration of our existing framework into windows 7 environment.



Do i need to migrate our framework from Python 2.5 to either Python 2.6 or 
directly to Python 3.0 ? What happens to all supporting packages..etc



Which is the best way ?



We tried out of some option of using our framework under virtual xp context of 
windows 7.Thou it works for timebeing,i am not interested to having the same as 
kind of way of working for future.



Please help



Many thanks in advance



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


Question regarding python migration

2010-10-13 Thread Pramod Thirthachar Sridhar
Hi,



We have a Python based test framework which is being used in various projects.



Our current environment is

Python (ver 2.5.1)

wxPython (wxPython2.8-win32-ansi-2.8.6.0-py25)

pywin32-210.win32-py2.5

vcredist_x86.exe

pyserial-2.2



Our Framework is being currently used in Windows XP.



The issue is:

Soon our environment will be migrated from Windows XP to Windows 7.

In this regard, I would be in need of suggestions/ideas/information regarding 
migration of our existing framework into windows 7 environment.



Do i need to migrate our framework from Python 2.5 to either Python 2.6 or 
directly to Python 3.0 ? What happens to all supporting packages..etc



Which is the best way ?



We tried out of some option of using our framework under virtual xp context of 
windows 7.Thou it works for timebeing,i am not interested to having the same as 
kind of way of working for future.



Please help



Many thanks in advance



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