In Python and Windows environment how to supress certain key press and send some other key event for it

2017-04-02 Thread Krishnan Shankar
Hi All, I was trying to build a VIM like shortcuts in windows. For example, IF i press CAPSLOCK & h: It should "{Left}" move one to left. If CAPSLOCK & b: It should "{Ctrl Down}{Left}{Ctrl Up}" move one word left etc. I was successful in sending the key event. I used libraries like, 1. pynput 2

Re: Reading csv file

2013-12-16 Thread Krishnan Shankar
Hi Igor You can use the following way to do this using "with" operator. def Read_CSV_File(filename): with open(filename, "r") as csvfile: csvreader = csv.DictReader(csvfile) line = 1 for row in csvreader: if line < 6: reader.next(

Accessing the Taskbar icons

2013-11-07 Thread Krishnan Shankar
Hi All, I am automating an application in windows using python. After installation i need to check if the applications icon has appeared in Taskbar or not. If yes i need to right click the application. I had been using pywinauto for the same but could not get the job done till now. I did the fo

Doubt on generators behavior

2013-10-13 Thread Krishnan Shankar
Hi Friends, I am new to Generators and was learning the same by experimenting. I wrote a small code which is as below. >>> def test_gen(var): ... print "The number is", var ... if var % 2 == 0: ... yield var ... else: ... print "Number is odd" ... >>> But when i was e

Re: TypeError: 'int' object is not callable

2013-08-26 Thread Krishnan Shankar
Hi, The problem is in the second line. a = time.daylight() The daylight is not a method in time module. It is clear here, http://docs.python.org/2/library/time.html Since it is not a method we cannot call it. It is just a integer variable . It returns zero if DST timezone is not defined and ret

List getting extended when assigned to itself

2013-08-24 Thread Krishnan Shankar
Hi Python Friends, I came across an example which is as below, >>> var = [1, 12, 123, 1234] >>> var [1, 12, 123, 1234] >>> var[:0] [] >>> var[:0] = var >>> var [1, 12, 123, 1234, 1, 12, 123, 1234] >>> Here in var[:0] = var we are assigning an entire list to the beginning of itself. So shouldn't

Re: Verifying Variable value

2013-08-14 Thread Krishnan Shankar
You can even use logging module in python to validate the variable values. You can import the module and use any of the following levels in your program import logging logging.CRITICAL, logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG For more you can refer to, http://docs.python.or

Re: Verifying Variable value

2013-08-14 Thread Krishnan Shankar
Hi Chandan, Python has built-in module called pdb which can be used for debugging. Importing it in the right place will be like setting break point in code and will change the execution to debugging mode. We can use different debugging commands ((n)ext, (c)ontinue, (s)tep etc) to evaluate through

Re: .split() Qeustion

2013-08-13 Thread Krishnan Shankar
Hi, >How can I use the '.split()' method (am I right in calling it a method?) The .split() is a method in Python which comes as in built method for String objects in Python. Any string defined in python will have the ability to call this function. >>> var = 'Hello how r u?' >>> dir(var) ['__add_

Introduction to my fellow Python Friends

2013-08-11 Thread Krishnan Shankar
Hi Friends, I would like to introduce myself. I am Krishnan from Chennai, India. I am using python for 2 years for Test Automation. I am fascinated by the language and its capabilities. I am willing to move into Python development and I am doing the best i can to learn the language completely and

Re: Python Basic Doubt

2013-08-10 Thread Krishnan Shankar
#x27; Because i recommended this should not be done. But my colleagues say it is correct. Regards, Krishnan On Sat, Aug 10, 2013 at 10:10 PM, Tim Chase wrote: > On 2013-08-10 21:03, Krishnan Shankar wrote: > > >>> a=10 > > >>> id(a) > > 21665504 > > &g

Python Basic Doubt

2013-08-10 Thread Krishnan Shankar
Hi Fellow Python Friends, I am new to Python and recently subscribed to the mailing list.I have a doubt regarding the basics of Python. Please help me in understanding the below concept. So doubt is on variables and their contained value. Why does in the below example from Interpreter exploratio

Python Contribution

2011-07-13 Thread Shankar Raman
Hello everyone, My name is Shankarraman and I have been working with Python for past 5 months.I find it really interesting and cool and would like to know different ways I can contribute to it. Though I went through the bug lists, I was wondering if I could contribute to Python in other ways.

Re: How do you check if a program/process is running using python?

2008-07-19 Thread Venky K Shankar
On Sunday 20 July 2008 12:08:49 am Lamonte Harris wrote: > How do you check if a program or process is running when using python? > What I want to do is have an infinite loop to check if a program is running > or not and send data to my web server to check yes or no. Is this > possible? If so how

Re: Question

2008-07-19 Thread Venky K Shankar
On Saturday 19 July 2008 03:14:20 pm Peter Otten wrote: > [EMAIL PROTECTED] wrote: > > Why is Perl so much better than python? > > Because you have the video: > > http://mail.python.org/pipermail/python-list/2004-March/253370.html >> what about this ? i feel python's better :) >> h

Re: Testing for Internet Connection

2008-07-17 Thread Venky Shankar
may be try to open a connection to 4.2.2.2 at port 53 ? -vks On Wed, Jul 16, 2008 at 12:13 AM, norseman <[EMAIL PROTECTED]> wrote: > > Grant Edwards wrote: > >> On 2008-07-15, Alexnb <[EMAIL PROTECTED]> wrote: >> >> What exactly do you think will work? I am not sure what you >>> think I should

Re: Testing for connection to a website

2008-07-17 Thread Venky Shankar
ping the universal DNS ? (4.2.2.2) -Venky On Wed, Jul 16, 2008 at 1:17 AM, Jordan <[EMAIL PROTECTED]> wrote: > On Jul 15, 3:43 pm, Alexnb <[EMAIL PROTECTED]> wrote: > > Okay, I already made this post, but it kinda got lost. So anyway I need > to > > figure out how to test if the user is able

Re: Query regarding PythonQt

2008-06-30 Thread Shankar Narayana
file. Otherwise, the terminal will crash. Now issue the command "make" and run your application. Things work fine now. I am not very clear with QRC but its a very good solution. Rgds, Shankar On Fri, Jun 27, 2008 at 2:41 PM, Shankar Narayana <[EMAIL PROTECTED]> wrote: > Hi,

Re: Query regarding PythonQt

2008-06-28 Thread Shankar Narayana
Hi, Can somebody please help me with the issue of ".pyc" creating problems when we rerun the application, written using PythonQt ? The description of the problem is given below. Regards, Shankar On Fri, Jun 27, 2008 at 2:41 PM, Shankar Narayana <[EMAIL PROTECTED]> wrote: >

Query regarding PythonQt

2008-06-27 Thread Shankar Narayana
xt to the existing text edit welcomemsg.append("Hurray I did it") welcomemsg.show() Can somebody help me what makes this not to run once Python interpreter works on the Python file and creates a .pyc file ? Regards, Shankar -- http://mail.python.org/mailman/listinfo/python-list

Accessing std::wstring in Python using SWIG

2006-05-09 Thread Shankar
) . . When I run this program I see that the address of the string is printed, but not the actual content. Within Python code how can I dereference this wstring pointer to actually print the value and not the address. Thanks in advance, With best regards, Shankar -- http://mail.python.org

Embedding Python: How to run compiled(*.pyc/*.pyo) files using Python C API?

2006-05-05 Thread Shankar
en things work fine. The .py file contains only one statement, print "Hello World" Which Python C API should I use to run compiled Python files(*.pyc and *.pyo) in the scenario where the source file (*.py) is not present. Thanks in advance, Regards, Shankar -- http://mail.python.org/mailman/listinfo/python-list

Running compiled Python files

2006-05-03 Thread Shankar
Hello, I am trying to run compiled Python files (*.pyc and *.pyo) using Python C API. I am using the method PyRun_FileFlags() for this purpose. The code snippet is as follows:- PyCompilerFlags myFlags; myFlags.cf_flags=1; // I tried all values 0, 1 and 2 PyRun_FileFlags(script, file, Py_file_i

Tkinter Button widget

2005-07-14 Thread Shankar Iyer ([EMAIL PROTECTED])
when the button widgets are first created. Why is this the case and how do I prevent this from happening? Shankar -- http://mail.python.org/mailman/listinfo/python-list

loop problem

2005-07-13 Thread Shankar Iyer ([EMAIL PROTECTED])
e so that it plots (or writes to the Text widget) every two seconds, I am confused as to why this is happening. Shankar -- http://mail.python.org/mailman/listinfo/python-list

plot module

2005-07-12 Thread Shankar Iyer ([EMAIL PROTECTED])
Hi, I am looking for documentation on the plot module. Does anyone know where I can find this information? Thanks. Shankar -- http://mail.python.org/mailman/listinfo/python-list

Re: Frame widget (title and geometry)

2005-06-24 Thread Shankar Iyer ([EMAIL PROTECTED])
hen I get errors which claim that these attributes do not exist. I do think, however, that the Frame widget is what I want to use. I want to partition my root window into several smaller sections. Shankar -- http://mail.python.org/mailman/listinfo/python-list

Frame widget (title and geometry)

2005-06-24 Thread Shankar Iyer ([EMAIL PROTECTED])
and title attributes that the code in classtitle.py attempts to access. Does this mean that I cannot use a Frame widget as w in this situation? Thanks for your help. Shankar -- http://mail.python.org/mailman/listinfo/python-list

dir() with string as argument

2005-06-16 Thread Shankar Iyer ([EMAIL PROTECTED])
could feed to dir to cause the desired effect? I think I could modify the string a bit and then use the exec command, but I was advised against that on this board last week. Shankar -- http://mail.python.org/mailman/listinfo/python-list

Re: bind in Tkinter

2005-06-10 Thread Shankar Iyer ([EMAIL PROTECTED])
Thanks! Your message guided me to the solution to my problem. Shankar - Original Message - From: Markus Weihs <[EMAIL PROTECTED]> Date: Friday, June 10, 2005 5:01 pm Subject: Re: bind in Tkinter > Hi! > > If you press a key, a key-event is passed to the function, here

Re: bind in Tkinter

2005-06-10 Thread Shankar Iyer ([EMAIL PROTECTED])
I believe the quit function is built in. Anyway, I get the same type of error if I substitute a function that I have defined. Shankar - Original Message - From: VK <[EMAIL PROTECTED]> Date: Friday, June 10, 2005 4:53 pm Subject: Re: bind in Tkinter > Shankar Iyer ([EMAIL

bind in Tkinter

2005-06-10 Thread Shankar Iyer ([EMAIL PROTECTED])
tempt to quit, but instead an error message appears claiming that quit() takes 1 argument but 2 are given. I get the same type of error if I replace self.quit with some function that I have written. I am not sure how to fix this problem and hope that someone here can spot my error. Thanks

Re: RE: a question from a newcomer to this language

2005-06-10 Thread Shankar Iyer ([EMAIL PROTECTED])
Thank you for your help. I will post the problem in more detail if I find that I cannot avoid using exec. Shankar - Original Message - From: Michael Chermside <[EMAIL PROTECTED]> Date: Friday, June 10, 2005 3:49 pm Subject: RE: a question from a newcomer to this language >

a question from a newcomer to this language

2005-06-10 Thread Shankar Iyer ([EMAIL PROTECTED])
into an instruction that will be executed? For example, suppose there's a string sString = "z = x*y". Is there any way to have the instruction z = x*y be executed by performing some operation on sString? Thanks in advance for your help. Shankar -- http://mail.python.org/mai