Re: To check for empty string after a portion of the string in python 3.6

2018-12-03 Thread srinivasan
ode 0 2. Output when device is not enabled When the device is not connected, I get the below error saying "IndexError: list index out of range" The value of res Scanning ... Traceback (most recent call last): the value ['Scanning ...'] File "/home/sriniv

To check for empty string after a portion of the string in python 3.6

2018-12-03 Thread srinivasan
Dear Python Experts, Could you please help me, as am still learning python syntax, how can I add conditional check for empty string after running "hcitool scan" (ie., when there is no Bluetooth devices discovered) ie., after the word "Scanning..." , when there are no Bluetooth discover-able devic

Re: [Tutor] Error Python version 3.6 does not support this syntax.

2018-11-29 Thread srinivasan
n range(0, 10): print(i) time.sleep(1) # Seems to be an issue -- bl.get_paired_devices() print("Getting Paired devices for 10 seconds...") for i in range(0, 10): print(i) time.sleep(1) Error Logs: Traceback (most recent call last

Re: [Tutor] Error Python version 3.6 does not support this syntax.

2018-11-29 Thread srinivasan
print(e) return None if __name__ == "__main__": print("Init bluetooth...") bl = Bluetoothctl() print("Ready!") bl.start_scan() print("Scanning for 10 seconds...") for i in range(0, 10): print(i)

Error Python version 3.6 does not support this syntax.

2018-11-27 Thread srinivasan
Dear Python Experts, As still I am newbie and learning python, I am trying to reuse the Bluetoothctl wrapper in Python from the link ( https://gist.github.com/egorf/66d88056a9d703928f93) I am using python3.6 version, In pycharm editor on the bold highlighted code snippets I see the error message "

Re: Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread srinivasan
Dear Karsten, With the help of Mrab Inputs, I tried Even with "return stdout.strip().decode("utf-8")", it still seems to be an issue, I am using python 3.6, is this causing a issue? /home/srinivasan/Downloads/wifidisconnectissuenov23_homework/venv/bin/python /home/

Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread srinivasan
Dear Mrab, Even with "return stdout.strip().decode("utf-8")", it still seems to be an issue, I am using python 3.6, is this causing a issue? /home/srinivasan/Downloads/wifidisconnectissuenov23_homework/venv/bin/python /home/srinivasan/Downloads/wifidisconnectissuenov23_home

Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread srinivasan
".format(cmd, e.returncode, e.output, shell=True) raise AssertionError(s) #return proc.strip().decode("utf-8") #return proc.decode("utf-8").strip() #return proc.decode("utf-8") *return stdout.strip().decode("utf-8")*

Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread srinivasan
Even only with "*proc.decode("utf-8")"* in the above code still it seems to throw the error #return proc.strip().decode("utf-8") #return proc.decode("utf-8").strip() *return proc.decode("utf-8")* Error: /home/srinivasan/Downloads

Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread srinivasan
uot;"".format(cmd, e.returncode, e.output, shell=True) raise AssertionError(s) #return proc.strip().decode("utf-8") *return proc.decode("utf-8").strip()* main("Apartment 18", "40672958689850014685ad") Error: /home/srinivasan/Download

Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread srinivasan
.CalledProcessError as e:* *s = """While executing '{}' something went wrong.* *Return code == '{}'* * Return output:\n'{}'* * """.format(cmd, e.returncode, e.outpu

Re: Issue in parsing the string output from the command using "subprocess"

2018-11-18 Thread srinivasan
code = self._helper.execute_cmd_return_code(cmd) print(exit_code) time.sleep(1) print "%d seconds have passed" % i if exit_code == 0: return True return False On Mon, Nov 19, 2018 at 12:50 AM MRAB wrote: &

Issue in parsing the string output from the command using "subprocess"

2018-11-18 Thread srinivasan
eturncode, e.output, shell=enable_shell) raise AssertionError(s) return result.strip().decode("utf-8") if __name__ == "__main__": m = wifi() print("disconnect and reconnect") print(m.wifi_disconnect_reconnect("NaWiFi", "abcds&

Cannot find reference 'bluetoothctl' in 'sh.py' less... (Ctrl+F1)

2018-11-14 Thread srinivasan
Dear Python Experts, As am newbie to python, I am planning to automate BT functionality test using Bluez "bluetoothctl" utility by writing python wrapper and robot framework integrated with Jenkins I came across the below link: https://www.reddit.com/r/raspberry_pi/comments/4bxu2o/bluetoothctl_i

All of a sudden code started throwing errors

2018-11-14 Thread srinivasan
Dear Python Experts Could you please let me know why am I seeing the following errors as before this it was working consistently? root:~/qa/robot_tests# python3 -m robot --variable SIGNAL_LEVEL_THRESHOLD:-60 wifi_testing.robot

Re: Unable to get the gateway IP of wlan interface using python code

2018-11-13 Thread srinivasan
] = '1' return '.'.join(list_) With the above return value I was able to pass the gateway IP to my robot framework, and process further Many Thanks in advance, Srini On Tue, Nov 13, 2018 at 10:11 AM srinivasan wrote: > Hi Wildman, > > The below snippet see

Re: Unable to get the gateway IP of wlan interface using python code

2018-11-13 Thread srinivasan
t.pack(" wrote: > I tried posting this already but it didn't make it. I am > trying again... > > On Tue, 13 Nov 2018 01:07:06 +0530, srinivasan wrote: > > > Dear Python Experts, > > > > *First method:* > > > > I need to get the IP address b

Re: Issue in parsing the strings in python code

2018-11-12 Thread srinivasan
return False* Kindly do the needful Srini On Mon, Nov 12, 2018 at 4:02 PM Thomas Jollans wrote: > On 2018-11-12 10:23, srinivasan wrote: > > Hi Thomas, > > > > Great to hear from you, Could you please let me know how do I get the > UUID > > "

Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread srinivasan
Dear Python Experts, *First method:* I need to get the IP address basically the gateway IP in my setup I get it as "192.168.178.1" when I run the below standalone python code. *def get_gateway_ip(self):* *"""* *Get the IP address to the WIFI module from the AP* *

Re: Issue in parsing the strings in python code

2018-11-12 Thread srinivasan
d-371a-4a27-872b-c945d51926de wifi -- NIFunkloch 1040 4a84f94e-46bd-47d3-b7e3-5dcf9dc5f54a wifi -- NIFunkloch 1041 9d93fe6e-6a74-4744-8edf-09160fb3583f wifi -- On Mon, Nov 12, 2018 at 10:23 AM srinivasan wrote: > Hi Thomas, > > Great to hear from you, Could

Re: Issue in parsing the strings in python code

2018-11-12 Thread srinivasan
llans wrote: > On 12/11/2018 09:28, srinivasan wrote: > > Dear Python Experts team, > > > > This question might be very simple for you, As am newbie to python, could > > you please how to parse the below strings > > > > [snip] > > > > > >

Issue in parsing the strings in python code

2018-11-12 Thread srinivasan
Dear Python Experts team, This question might be very simple for you, As am newbie to python, could you please how to parse the below strings 1. Could you please do the needful in guiding me, that how can I extract the strings under the UUID column in python code in the below output (nmcli c show

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread srinivasan
I feel I have kick started my learning in python :) Have a great day ahead! On Wed, Nov 7, 2018 at 3:11 PM Ben Bacarisse wrote: > srinivasan writes: > > > Even after changing as per the below > > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" &

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread srinivasan
ot;TYPE=", 1)[1] quoted = re.compile('(?<=^\")[^"]*') for string in quoted.findall(var): return string On Wed, Nov 7, 2018 at 1:39 PM Chris Angelico wrote: > On Wed, Nov 7, 2018 at 11:36 PM Qian Cai wrote: > > > > sri

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread srinivasan
till my output is: */dev/mmcblk1p1: LABEL="efi" UUID="1084-AA42" TYPE="vfat"* My expected output should be only: *vfat* Could you guys please do the needful? On Wed, Nov 7, 2018 at 11:10 AM Brian J. Oney wrote: > On Wed, 2018-11-07 at 10:22 +0100, srinivasan w

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread srinivasan
x27;TYPE' | cut -d" > and BETA=" -f3" > > Other issues may also be there. > -Original Message- > From: Tutor On Behalf Of > Alan Gauld via Tutor > Sent: Tuesday, November 6, 2018 7:37 PM > To: tu...@python.org > Cc: python-...@python.org > Subje

SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-06 Thread srinivasan
Dear Python Experts Team, As am newbie to python development, I am trying to use the below function to get verify the filesystem type of the SD card parition using bash command in python using subprocess module, I ma seeing the below Error "SyntaxError: can't assign to literal" *CODE:* ** im

Re: Data exchange between python script and bash script

2017-04-19 Thread Venkatachalam Srinivasan
On Thursday, April 6, 2017 at 12:55:41 AM UTC+2, Gregory Ewing wrote: > Anssi Saari wrote: > > Bash manual explicitly states command substition (the $(...) structure) > > replaces the command with the standard *output* of the command. > > Another problem is your use of '&' here: > > sensor_da

Re: Data exchange between python script and bash script

2017-04-19 Thread Venkatachalam Srinivasan
On Tuesday, April 4, 2017 at 7:58:56 PM UTC+2, justin walters wrote: > On Tue, Apr 4, 2017 at 10:39 AM, Venkatachalam Srinivasan < > venkatachalam...@gmail.com> wrote: > > > Hi, > > > > Thanks for the answer. I need bash for connecting data exchange between &

Re: Data exchange between python script and bash script

2017-04-19 Thread Venkatachalam Srinivasan
On Wednesday, April 5, 2017 at 2:38:00 PM UTC+2, Anssi Saari wrote: > venkatachalam...@gmail.com writes: > > > For example, the data is printed in > > execute_sensor_process.py as follows: > > > > print >>sys.stderr,sens_data > > > > By printing the data onto sys.stderr and assigning a return vari

Re: Data exchange between python script and bash script

2017-04-04 Thread Venkatachalam Srinivasan
ther analysis. I am not getting the data returned > > from the python script on to the bash variable. > > > > Can someone help me to understand why the code is not working? I tried > > other approaches of function call such as > > > > > > sensor_data=$`

Re: Data exchange between python script and bash script

2017-04-04 Thread Venkatachalam Srinivasan
someone help me to understand why the code is not working? I tried > > other approaches of function call such as > > You haven't given us enough of the code to really answer. > > > sensor_data=$`python execute_sensor_process.py` & > > > > python execute_sensor

Looking for OpenStack Developer

2015-08-05 Thread Pranesh Srinivasan
Hi, Hope you are doing well !!! My name is Siva and I'm a recruiter at TheAppliedthought , a global staffing and IT consulting company. Please find the below job description which may suits any of your consultants who are available in market or who are looking for change, please send me latest u

Re: This code not working, need suggetions

2012-04-23 Thread Anirudh Srinivasan
get_file = raw_input("Which file would you like to browse ?") > if get_file == '': > On = False > #break > else: > cat(os.path.join(working_dir,get_file)) > > > if __name__ == "__main__": > m

This code not working, need suggetions

2012-04-22 Thread Anirudh Srinivasan
) def cat(get_file): f = open(get_file, "rU") text = f.read() print text, get_file = raw_input("Which file would you like to browse ?") -- Anirudh Srinivasan | MTS QA | Nutanix.Inc | 408-569-0323 -- http://mail.python.org/mailman/listinfo/python-list

[pyodbc] Setting values to SQL_* constants while creating a connection

2011-05-25 Thread srinivasan munisamy
Hi, I would like to know how to set values to values to SQL_* constants while creating a db connection through pyodbc module. For example, i am getting a connection object like below: In [27]: dbh1 = pyodbc.connect("DSN=;UID= ;PWD=;DATABASE=;APP=") In [28]: dbh1.getinfo(pyodbc.SQL_DESCRIBE_PARAM

Get perl method documentation in python wrapper

2010-07-31 Thread srinivasan munisamy
Hi, I would like to get the documentation of a perl method inside python wrapper. To say it with example, there is a perl module ‘X.pm’. It has a method ‘print_hello()’. x.py is a wrapper module over X.pm. when I say x.print_hello.__doc__ then I need to get the documentation of X::print_hello. Th

Pdf download using mechanize

2010-07-06 Thread srinivasan srinivas
HI, I am using mechanize module for web scraping projects. One of y tasks is to download pdf file from a page and store it. Is there a way to download pdf file using mechanize how we do it in Perl's WWW::Mechanize? Thanks, Srini -- http://mail.python.org/mailman/listinfo/python-list

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Sriram Srinivasan
> So all libraries written have to use the common subset, which - unless > things are *removed*, which with python3 actually happened - is always > the oldest interpreter. And if a feature goes away, they have to be > rewritten with the then common subset. you see that's the problem with py3. inst

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Sriram Srinivasan
> You are describing a lending library, which is not the only sort of > library. My personal library doesn't do any of those things. It is just a > room with shelves filled with books. how i see is all libraries are libraries, for a personal library you are the only customer and you are the manag

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Sriram Srinivasan
On Nov 12, 6:07 pm, "Diez B. Roggisch" wrote: > > ok let me make it more clear.. > > forget how you use python now.. i am talking about __futuristic__ > > python programming. > > > there is no more python2.x or python3.x or python y.x releases. there > > is only updates of python and standard libr

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Sriram Srinivasan
On Nov 12, 4:35 pm, "Diez B. Roggisch" wrote: > Sriram Srinivasan schrieb: > > > > > On Nov 12, 3:56 pm, "Diez B. Roggisch" wrote: > >> Sriram Srinivasan schrieb: > > >>> I guess why every programming language has some kind of a &#

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Sriram Srinivasan
On Nov 12, 3:56 pm, "Diez B. Roggisch" wrote: > Sriram Srinivasan schrieb: > > > > > I guess why every programming language has some kind of a 'standard > > library' built in within it. > > In my view it must not be called as a 'library

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Sriram Srinivasan
On Nov 12, 3:56 pm, "Diez B. Roggisch" wrote: > Sriram Srinivasan schrieb: > > > > > I guess why every programming language has some kind of a 'standard > > library' built in within it. > > In my view it must not be called as a 'library

standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Sriram Srinivasan
I guess why every programming language has some kind of a 'standard library' built in within it. In my view it must not be called as a 'library' at all. what it does is like a 'bunch of built-in programs ready-made to do stuff'. Lets see what a 'library' does: 1. offers books for customers 1.1 l

conversion of Python object to perl object

2009-08-18 Thread srinivasan srinivas
Hi, I have to call a perl method which takes a hash as its argument from a python module. Is there a way to convert python dictionary to perl hash ( not hash ref)? Thanks, Srini See the Web's breaking stories, chosen by people like you. Check out Yahoo! Buzz. http://in.buzz.yahoo.com/

calling obect method

2009-07-30 Thread srinivasan srinivas
Hi, I would like to know if i have an object and one of its methods as a string. How to call the method using this string? For ex If object is x and string y has one of its method names. x.value(y)() ---. Is there a way to do this? Thanks, Srini See the Web's breaking stories, chosen by

Python debugger

2009-07-03 Thread srinivasan srinivas
Hi, Could you suggest some python debuggers? Thanks, Srini Love Cricket? Check out live scores, photos, video highlights and more. Click here http://cricket.yahoo.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Which one is best Python or Java for developing GUI applications?

2009-05-05 Thread srinivasan srinivas
Could you list down those advantages?? - Original Message From: Bruno Desthuilliers To: python-list@python.org Sent: Tuesday, 5 May, 2009 1:07:41 PM Subject: Re: Which one is best Python or Java for developing GUI applications? Paul Rubin a écrit : > srinivasan srinivas wri

Which one is best Python or Java for developing GUI applications?

2009-05-04 Thread srinivasan srinivas
Could you tell me does Python have any advantages over Java for the development of GUI applications? Thanks, Srini Now surf faster and smarter ! Check out the new Firefox 3 - Yahoo! Edition http://downloads.yahoo.com/in/firefox/?fr=om_email_firefox -- http://mail.python.org/mailman/list

Query related to matplotlib

2009-04-28 Thread srinivasan srinivas
I would like to draw a chart which takes 'dates' in x axes and some values in y axes.   I would like to draw a simple chart using matplotlib. Can someone tell me which submodule i could use for this purpose? The module has to support in the way that i can draw more than one set can be passed to

Re: What is the best framework or module in Python for a small GUI based application development?

2009-04-22 Thread srinivasan srinivas
: What is the best framework or module in Python for a small GUI based application development? On Apr 22, 8:11 am, srinivasan srinivas wrote: > Hi, > Could you suggest me some modules in Python which can be used to develop GUI > based applications? and tell me which could be the best(in

What is the best framework or module in Python for a small GUI based application development?

2009-04-22 Thread srinivasan srinivas
Hi, Could you suggest me some modules in Python which can be used to develop GUI based applications? and tell me which could be the best(in terms of efficiency) one for a small GUI based application development? Thanks, Srini Bollywood news, movie reviews, film trailers and more! Go to

Can someone explain about the usage of unittest.TestSuite?

2009-04-09 Thread srinivasan srinivas
Hi, I would like to know about the unittest.TestSuite clearly like at what situations i can use this TestSuite? I am not getting the clear difference between this and unittest.TestCase. Thanks, Srini Cricket on your mind? Visit the ultimate cricket website. Enter http://beta.cricket.ya

What way is the best to check an empty list?

2009-03-25 Thread srinivasan srinivas
For ex: to check list 'A' is empty or not.. if A == []: if A.count == 0: if len(A) == 0: if not A: Connect with friends all over the world. Get Yahoo! India Messenger at http://in.messenger.yahoo.com/?wm=n/ -- http://mail.python.org/mailman/listinfo/python-list

What way is the best to check an empty list?

2009-03-25 Thread srinivasan srinivas
For ex: to check list 'A' is empty or not.. if A == []: if A.count == 0: if len(A) == 0: if not A: Thanks, Srini Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ -- http://mail.python.org/mailman/listinfo/python-list

Fw: Query regarding Python sybase module

2009-03-25 Thread srinivasan srinivas
- Forwarded Message From: srinivasan srinivas To: s...@pobox.com Sent: Tuesday, 24 March, 2009 7:42:35 PM Subject: Re: Query regarding Python sybase module NO. I tried with what u have mentioned in the previous update. But it gave only one result set. Thanks, Srini

Query regarding Python sybase module

2009-03-23 Thread srinivasan srinivas
Hi, Does Sybase Python driver module implement multiple result sets from a single command? Could anyone guide e in finding answer for this? Thanks, Srini Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ -- http://mail.python.org/mailman/listinfo/pyt

Is there any way for a program to choose between 32 bit or 64-bit python dynamically?

2009-03-20 Thread srinivasan srinivas
Hi, Is thera any way for a program to choose between 32-bit or 64-bit dynamically? Thanks, Srini Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ -- http://mail.python.org/mailman/listinfo/python-list

what does 64-bit python mean?

2009-03-18 Thread srinivasan srinivas
Hi, Could someone help me in understanding what 64-bit python means? tahnks, Srini Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ -- http://mail.python.org/mailman/listinfo/python-list

Difference between 32 bit and 64 bit Python

2009-03-04 Thread srinivasan srinivas
Hi, I would like to know more about the advantages of 64-bit python. What appliactions can use 64-bit python and all? Can someone help me out in this? Thanks, Srini Bring your gang together. Do your thing. Find your favourite Yahoo! group at http://in.promos.yahoo.com/groups/ -- http://m

Re: Python Module for console text formatting?

2009-02-18 Thread srinivasan srinivas
0:04:34 AM Subject: Re: Python Module for console text formatting? You can insert those codes just like you would any other character. If there's enough interest I can whip up a wrapper library for you. http://www.linux.gr/cgi-bin/man2html?console_codes+4 On Tue, Feb 17, 2009 at 11:19

Python Module for console text formatting?

2009-02-17 Thread srinivasan srinivas
Hi, Does anyone know any python module other than 'ConsoleFormat0.1.1' used to format text on console? For example, printing bold characters on console. Thanks, Srini Did you know? You can CHAT without downloading messenger. Go to http://in.webmessenger.yahoo.com/ -- http://mail.python.

How do i add body to email.mime.multipart.MIMEMultipart instance?

2009-02-04 Thread srinivasan srinivas
Hi, Could someone tell me the way to add body to the instance email.mime.multipart.MIMEMultipart instance which has attachments? Thanks, Srini Bollywood news, movie reviews, film trailers and more! Go to http://in.movies.yahoo.com/ -- http://mail.python.org/mailman/listinfo/python-list

How do i add body to 'email.mime.multipart.MIMEMultipart' instance?

2009-02-03 Thread srinivasan srinivas
Hi, Could someone tell me the way to add body content to 'email.mime.multipart.MIMEMultipart' instance? Thanks, Srini Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Doubts related to subprocess.Popen()

2009-01-20 Thread srinivasan srinivas
am getting 'Too many open files' error. Thanks, Srini - Original Message From: Mark Wooding To: python-list@python.org Sent: Tuesday, 20 January, 2009 6:16:17 PM Subject: Re: Doubts related to subprocess.Popen() srinivasan srinivas writes: > Does subprocess.Popen() count a

Doubts related to subprocess.Popen()

2009-01-20 Thread srinivasan srinivas
Hi, Does subprocess.Popen() count a new open file for each suprocess? I mean does it occupy an entry in file descriptor table of parent process? If so, wat is each file descriptor connected to? Thanks, Srini Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/i

Getting OSError, Could someone suggest?

2009-01-19 Thread srinivasan srinivas
Hi,  I have written a script which will spawn more than 200 no of subprocesses. I have used subprocess.Popen to do that.  OSError: [Error 24] Too many open files. Could someone help me in fixing this error? Thanks, Srini Add more friends to your messenger and enjoy! Go to http://messen

Re: How to deepcopy a list of user defined lists?

2009-01-08 Thread srinivasan srinivas
): ---> 92 return cls.__new__(cls, *args) 93 94 def _slotnames(cls): : __new__() takes exactly 3 arguments (1 given) - Original Message ---- From: Chris Rebert To: srinivasan srinivas Cc: python-list@python.org Sent: Thursday, 8 January, 2009 1:56:27 PM Subject: Re: How to dee

How to deepcopy a list of user defined lists?

2009-01-08 Thread srinivasan srinivas
Hi, I have a class which is a subclass of builtin-type list. #-- class clist(list):     def __new__(cls, values, ctor):     val = []     for item in values:     item = ctor(item)     val.append(item

How to send body and attachements in an email message?

2008-12-03 Thread srinivasan srinivas
HI, I would like to send an email message with body-content 'test' and an attachment. The snippet i used is: outer = email.mime.multipart.MIMEMultipart() msg1 = email.mime.text.MIMEText(, _subtype = 'text') msg1.add_header('Content-Disposition', 'attachment') outer.attach(msg1) body = email.mime.

Re: Getting fractional part from a float without using string operations

2008-11-19 Thread srinivasan srinivas
Yes it works for most of the cases.  But it doesn't for the following case: >>> str(abs(int(1234567.89)-1234567.89)) '0.88999898' Thanks, Srini - Original Message From: Tino Wildenhain <[EMAIL PROTECTED]> To: srinivasan srinivas <[EMAIL PROTE

Re: Getting fractional part from a float without using string operations

2008-11-19 Thread srinivasan srinivas
hon-list@python.org Sent: Wednesday, 19 November, 2008 7:14:17 PM Subject: Re: Getting fractional part from a float without using string operations On Wed, Nov 19, 2008 at 8:35 AM, srinivasan srinivas <[EMAIL PROTECTED]> wrote: Thanks, Srini      Add more friends to your messenger and en

Getting fractional part from a float without using string operations

2008-11-19 Thread srinivasan srinivas
Thanks, Srini Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ -- http://mail.python.org/mailman/listinfo/python-list

Inheriting frozenset gives bug if i overwrite __repr__ method

2008-11-19 Thread srinivasan srinivas
Hi, I am getting an error while executing the following snippet. If i comment out method __repr__ , it works fine. class fs(frozenset):     def __new__(cls, *data):     data = sorted(data)     self = frozenset.__new__(cls, data)     self.__data = data     return self     def __re

Python certification

2008-10-17 Thread srinivasan srinivas
Hi, I m planning to do certification in Python?? Is therr any good certification available in Python like Sun certification for java?? Thanks, Sirni Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php -- http://mail.python.or

Is there any nice way to unpack a list of unknown size??

2008-09-14 Thread srinivasan srinivas
I want to do something like below: 1. first, second, third, *rest = foo  2. for (a,b,c,*rest) in list_of_lists: Please suggest. Thanks, Srini Bring your gang together. Do your thing. Find your favourite Yahoo! group at http://in.promos.yahoo.com/groups/ -- http://mail.python.org/mailma

Extracing data from webpage

2008-09-11 Thread srinivasan srinivas
Hi, I am trying to download data from a webpage. I use mechanize python module. Could someone tell me how to set/pass an agent like Mozilla or IE that we do in perl's WWW::Mechanize?? Thanks, Srini Be the first one to try the new Messenger 9 Beta! Go to http://in.messenger.yahoo.com/win

Directory creation

2008-09-06 Thread srinivasan srinivas
Can someone tell me is there any module available to create directories?? I tried os, tempfile. I was facing some issues with os.mkdir(). The mode setting was not proper with this method. I created the directory 'stdin' with '0700' mode using os.mkdir() method. $> ls -alR stdin/ stdin/: total 1

Creating directories

2008-09-04 Thread srinivasan srinivas
Can someone tell me is there any module available to create directories?? I tried os, tempfile. I was facing some issues with os.mkdir(). The mode setting was not proper with this method. I created the directory 'stdin' with '0700' mode using os.mkdir() method. $> ls -alR stdin/ stdin/: total 12

Python one-liner??

2008-08-22 Thread srinivasan srinivas
Hi, Do we have python one-liner like perl one-liner 'perl -e'?? Thanks, Srini Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/ -- http://mail.python.org/mailman/listinfo/python-list

Do we have python equivalent of 'perl -e'??

2008-08-21 Thread srinivasan srinivas
HI, Like we run perl small code snippet using perl -e, do we have anything like that in python?? Thanks, Srini Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting pid of a remote process

2008-08-19 Thread srinivasan srinivas
etting pid of a remote process srinivasan srinivas wrote: > This is wat i am doing : > > args = [ "SSH", ,  ] > I am giving this to subprocess.Popen() > Thanks, > Srini Then the answer is simple: how would you figure out the remote process pid using ssh? Once you found

Re: Getting pid of a remote process

2008-08-19 Thread srinivasan srinivas
a remote process srinivasan srinivas schrieb: > HI, > I am using Solaris and subprocess.Popen to spawn a process on a remote > machine. No, you are *not* doing that. You are maybe using subproces to run SSH to spawn a remote process. Why don't you *show* us how you actually do that? DIEZ --

Re: Getting pid of a remote process

2008-08-18 Thread srinivasan srinivas
HI, I am using Solaris and subprocess.Popen to spawn a process on a remote machine. Thanks, Srini - Original Message From: Diez B. Roggisch <[EMAIL PROTECTED]> To: python-list@python.org Sent: Monday, 18 August, 2008 9:23:20 PM Subject: Re: Getting pid of a remote process srin

Getting pid of a remote process

2008-08-18 Thread srinivasan srinivas
Hi, Could you please suggest me a way to find pid of a process started on a remote machine by the current process?? I should get pid in the current process environment. The approach should be somewhat generic. It shouldn't expect the remote process to print its pid. Thanks, Srini Unlimit

Suggestion for converting PDF files to HTML/txt files

2008-08-11 Thread srinivasan srinivas
Could someone suggest me ways to convert PDF files to HTML files?? Does Python have any modules to do that job?? Thanks, Srini Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/ -- http://mail.python.org/mailman/listin

Python Modules To convert PDF files to HTML files

2008-07-30 Thread srinivasan srinivas
Hi, could someone tel me any python modules which can be used to convert PDF files to HTML files?? Thanks, Srini Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/ -- http://mail.python.org/mailman/listinfo/python-list

We programming

2008-07-28 Thread srinivasan srinivas
Hi, Could someone suggest me better python modules for developing web programming related projects like web-pages download and uopload?? Thanks, Srini Explore your hobbies and interests. Go to http://in.promos.yahoo.com/groups/ -- http://mail.python.org/mailman/listinfo/python-list

Do we have perl's Data::Dumper equivalent in Python??

2008-07-14 Thread srinivasan srinivas
Thanks, Srini Bollywood, fun, friendship, sports and more. You name it, we have it on http://in.promos.yahoo.com/groups/bestofyahoo/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pickle bound methods

2008-07-03 Thread srinivasan srinivas
From: Peter Otten <[EMAIL PROTECTED]> To: python-list@python.org Sent: Thursday, 3 July, 2008 12:13:45 PM Subject: Re: How to pickle bound methods srinivasan srinivas wrote: Please don't top-post. > Could you please explain the code breifly?? I am not getting what it does. >

Re: How to pickle bound methods

2008-07-02 Thread srinivasan srinivas
Peter, Could you please explain the code breifly?? I am not getting what it does. Thanks, Srini  - Original Message From: Peter Otten <[EMAIL PROTECTED]> To: python-list@python.org Sent: Wednesday, 2 July, 2008 12:53:19 PM Subject: Re: How to pickle bound methods srinivasan sr

Re: How to pickle bound methods

2008-07-02 Thread srinivasan srinivas
day, 2 July, 2008 5:15:41 PM Subject: Re: How to pickle bound methods srinivasan srinivas wrote: (Please don't top-post) > It works will for instance and class methods. But it doesn't work for > static methods. Can you tel me how to pickle static methods as well?? For static meth

Re: How to pickle bound methods

2008-07-02 Thread srinivasan srinivas
08 12:53:19 PM Subject: Re: How to pickle bound methods srinivasan srinivas wrote: > I would like to know how to pickle a bound method?? $ cat pickle_method.py import copy_reg import new def make_instancemethod(inst, methodname):     return getattr(inst, methodname) def pickle_instanc

How to identify whether a function is module scoped function or static method of a class by using its fully qualified name

2008-07-02 Thread srinivasan srinivas
Thanks, Srini Best Jokes, Best Friends, Best Food and more. Go to http://in.promos.yahoo.com/groups/bestofyahoo/ -- http://mail.python.org/mailman/listinfo/python-list

How to pickle bound methods

2008-07-01 Thread srinivasan srinivas
Hi, I would like to know how to pickle a bound method?? Thanks, Srini Meet people who discuss and share your passions. Go to http://in.promos.yahoo.com/groups/bestofyahoo/ -- http://mail.python.org/mailman/listinfo/python-list

Is there any way to find out sizeof an object

2008-06-23 Thread srinivasan srinivas
Hi, I have written a class which has some attributes. I want to know how do i find out the size of an instance of this class?? class T(object):     def __init__(self, fn_name, *args, **kwds):         self.fn_name = fn_name         self.args = args         self.kwds = kwds Thanks, Srini Bol

Re: Execute a script on a remote machine

2008-06-20 Thread srinivasan srinivas
This is ok. Is there any other way to find it out? Thanks, Srini - Original Message From: Gerhard Häring <[EMAIL PROTECTED]> To: python-list@python.org Sent: Friday, 20 June, 2008 10:03:30 PM Subject: Re: Execute a script on a remote machine srinivasan srinivas wrote: >

Execute a script on a remote machine

2008-06-20 Thread srinivasan srinivas
Hi, My requirement is i have to execute a python script on a remote machine as a subprocess from a python script and to get the subprocess pid of the process running the script. Is there anyway to do that?? I have used subprocess.popen() method to do that. I have done as following: executable = '

python socket programming

2008-06-19 Thread srinivasan srinivas
HI, I want to know the different kind of exceptions may occur in client-server  socket communication and the way to handle those scenarios. 1. What does the server do when a socket error occurs at any point: accepting a connection, sending data to a client, receiving data from a client, waiting f

  1   2   >