cmd i/o stream module

2012-06-27 Thread prakash jp
Hi All,

I am interested to interact with the command prompt, is there a module to
control the input/output stream. Thanks in advance for the pointers

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


get latest from svn

2012-06-01 Thread prakash jp
Hi All,

Can some one suggest me a module to access SVN repository so that i could
download any given branch.

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


help on QUICKFIX

2011-06-10 Thread prakash jp
Hi,

I am using quickfix, would like to start with that

..\quickfix-1.13.3\quickfix\examples\executor\python\executor.py asks for a
configuration file how should it look like.


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


find max and min values from a column of a csv file

2011-07-07 Thread prakash jp
Hi All ,

Could any one help to get max and min values from a specified column of a
csv file. The* csv file is large* and hence the below code did go bad.
*Alternate
methods would be highly appreciated
**
minimum.py*:
import csv
filename = "testLog_4.csv"
f = open(filename)
def col_min(mincname):
with open(filename, 'rb') as f:
reader = csv.reader(f, delimiter=",")
#print reader
#print mincname
col_index = next(reader).index(mincname)
#print col_index
least = min(rec[col_index] for rec in reader)
print least

col_min(str("Server Latency"))
col_min(str("Client Latency"))
f.close()

*maximum.py:*
import csv
filename = "testLog_4.csv"
f = open(filename)
def col_max(maxcname):
with open(filename, 'rb') as f:
reader = csv.reader(f, delimiter=",")
#print reader
#print cname
col_index = next(reader).index(maxcname)
#print col_index
highest = max(rec[col_index] for rec in reader)
print highest

col_max(str("Server Latency"))
col_max(str("Client Latency"))
f.close()


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


Re: find max and min values from a column of a csv file

2011-07-19 Thread prakash jp
Thanks for the suggestions. Felt the thread could be of help on
consolidating the solution.

*Max Value from a csv column:*

import numpy
data1 = numpy.genfromtxt("data.csv",dtype='float',delimiter =
',',skiprows=1, skip_header=0, skip_footer=0,
usecols=11,usemask=True)
#print data1
print data1.max()

Plz go through the below link to understand further on the arguments taken
by numpy.genfromtxt():

http://docs.scipy.org/doc/numpy-1.4.x/reference/generated/numpy.genfromtxt.html




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


how to invoke a bat file on a remote machine

2011-08-07 Thread prakash jp
Hi all,

Want to know how to invoke a bat file on a remote machine.

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


pydev ant build

2011-05-30 Thread prakash jp
Hi all,

Could any one provide relevant url/s on the usage of *pyant* scripts and its
setup as well

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


text to html

2011-12-13 Thread prakash jp
Hi All,

Want to publish a log file as a web page, is there a parser to retain the
format of the text as is and then convert to html. Please provide the
relevant pointers

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


file transfer over LAN

2009-03-26 Thread prakash jp
Hi all,
On generating log file on remote systems(say client), I want to transfer
them to the Network Admins(say Server) Computer. In doing so all the
contents of the log file r not transfered, only part of the file. I
appreciate ur help, here is the pre-existant code:

 file sender !!!--client:
# Work in progress
import socket, os
from stat import ST_SIZE
HOST = '192.168.3.136'
PORT = 31400  # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST,PORT))
if s.recv(5)!='READY':
raw_input('Unable to connect \n\n Press any key to exit ...')
s.close()
exit()
f=open(r'C:\\Python25\src\log.txt', 'rb')
fsize=os.stat(f.name)[ST_SIZE]
#s.sendd(str(fsize))
s.send(str(fsize).zfill(8))
s.send(f.read())
s.close()
f.close()
##
file receiver : server
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
HOST = '192.168.3.136'
PORT = 31400
s.bind((HOST, PORT))
s.listen(3)
conn, addr = s.accept()
print 'conn at address',addr
conn.send('READY')
f = open(r'C:\\Python25\dest\dest.txt','wb')
fsize=int(conn.recv(8))
print 'File size',fsize
f.write(conn.recv(fsize))
f.close()
conn.close()
s.close()

###

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


python -TFTP over LAN

2009-03-29 Thread prakash jp
Hi all,

I am interested in using python based TFTP over my LAN. Do let me know how
to ahead and any specific urls. Thaks in advance.

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


email from windows

2009-03-29 Thread prakash jp
Hi all,

In windows environment, how to send email from one gmail address to another
gmail (or another mail) addrress


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


Re: email from windows

2009-03-29 Thread prakash jp
preexistant code :

import sys, smtplib
import string
fromaddr = raw_input("From: ")
toaddrs  = string.splitfields(raw_input("To: "), ',')
print "Enter message, end with ^D:"
msg = ''
count = 3
while count > 0:
line = sys.stdin.readline()
#if not line:
#break
msg = msg + line
count = count -1
# The actual mail send
server = smtplib.SMTP('localhost')
server.sendmail(fromaddr, toaddrs, msg)
server.quit()

-
Running the program:
--
From: prakash.st...@gmail.com
To: prakash.st...@gmail.com
hai
how r
u
---
error creeps in :
error says

Traceback (most recent call last):
  File "C:\Python25\python-collection\mail\mail.py", line 17, in 
server = smtplib.SMTP('localhost')
  File "C:\Python25\lib\smtplib.py", line 244, in __init__
(code, msg) = self.connect(host, port)
  File "C:\Python25\lib\smtplib.py", line 310, in connect
    raise socket.error, msg
error: (10061, 'Connection refused')

On Mon, Mar 30, 2009 at 7:40 AM, prakash jp  wrote:

> Hi all,
>
> In windows environment, how to send email from one gmail address to another
> gmail (or another mail) addrress
>
>
> Regards
> Prakash
>
--
http://mail.python.org/mailman/listinfo/python-list


Re: email from windows

2009-03-29 Thread prakash jp
nope not successful. DO let me know the usage of:
#From : prakash.st...@gmail.com
#To: prakash.st...@gmail.com

import sys, smtplib
import string
fromaddr = raw_input("From: ")
toaddrs  = string.splitfields(raw_input("To: "), ',')
print "Enter message, end with ^D:"
msg = ''
count = 3
while count > 0:
line = sys.stdin.readline()
#if not line:
#break
msg = msg + line
count = count -1
# The actual mail send
server = smtplib.SMTP('localhost')
server.sendmail(fromaddr, toaddrs, msg)
server.quit()
#pls define the usage

On Mon, Mar 30, 2009 at 7:40 AM, prakash jp  wrote:

> Hi all,
>
> In windows environment, how to send email from one gmail address to another
> gmail (or another mail) addrress
>
>
> Regards
> Prakash
>
--
http://mail.python.org/mailman/listinfo/python-list


Re: Unix programmers and Idle

2009-03-30 Thread prakash jp
let run-cmd be used why go for IDLE

2009/3/31 Dale Amon 

> I wonder if someone could point me at documentation
> on how to debug some of the standard Unix type things
> in Idle. I cannot seem to figure out how to set my
> argument line for the program I am debugging in an Idle
> window. for example:
>
>vlmdeckcheck.py --strict --debug file.dat
>
> There must be a way to tell it what the command line args
> are for the test run but I can't find it so far.
>
>
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iD8DBQFJ0VLYZHES7UL0zXERAr+vAJ9FhD3fe6HY/Rd4/alqgb41jXy/oACfQWvQ
> pyH4Cgd38KrIMVlLhN0gbb4=
> =BVqw
> -END PGP SIGNATURE-
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
--
http://mail.python.org/mailman/listinfo/python-list


usb mass storage device detection

2009-03-30 Thread prakash jp
Hi all,

I am interested in detecting usb mass storage devices, r there any scripts
in python to do so. Thanks in advance.

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


py2exe fails to make valid exe

2009-03-31 Thread prakash jp
Hi all, i am trying to make an exe out of my py *prg which write to a text
file*.

On --> python setup.py py2exe

the dist folder is created but the exe creted is not working it throws an
error "pythons ps.popen function"

setup.py:

#python setup.py py2exe
from distutils.core import setup
import py2exe
setup(console=['nameofprg.py'])

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


Re: Anyone mannaged to access parallel port on windows xp?

2009-04-07 Thread prakash jp
Hi all,

just would like to say that most of the parallel port preexistant code is
usually blinking leds,
which is the not the true reprsentation of the paralle port  behaviour. Here
one needs to
think that data is coming out byte after byte. Now plz look out for the
sequence to
push data byte after byte. One pin to pulse(programatically) for a byte
of data to come
out is the Pin 0, strobe pin, then reset the same to push the next byte of
data.
Latare u r expected to send these data byte in the sequnce that the target
board
requirement. I have done this in c - dos based

regards
Prakash



On Tue, Apr 7, 2009 at 12:09 PM, alejandro wrote:

> I have a switch  that I should connect to the parallel port, but had no
> luck
> with it. Tha guy that made it for me told me that it would be easyer to
> connect via parallel instead the USB
> So did anyone have success? I only get suckess!! :-))
> tryed giveio.sys but it doesn't wort (can't figure out what is it)
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list


Re: Injecting python function in an embedded python engine

2009-04-08 Thread prakash jp
import os
ch = os.system("import -window root temp.png")
print ch
 after that no way to store the screen shot

regards
Prakash

On Mon, Apr 6, 2009 at 10:28 PM, Roberto Fichera wrote:

> Hi All in the list,
>
> I've embedded python v2.6.x engine into my application without any problem.
> Now I would like to inject some additional functions after importing a
> python module.
> So, basically I'm importing a python module via PyImport_ImportModule()
> function.
> The python module is a simple set of functions and I would check if some
> functions
> does exist or not, than if doesn't I would add it from my C application.
> Checking if
> a function does exist or not isn't an issue, it works without any
> problem, my problem
> is only how to inject a new function in an already imported module.
>
> Thanks in advance,
> Roberto Fichera.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list


stand alone exec

2009-05-10 Thread prakash jp
Hi all,

I want to run dos commands through python stand alone execs. The created
Python stand alone executable (py2exe)  works fine

in my machine but on transferring the "dist" folder to other systems the
executable fails to run.

I tried to copy the MSVCP90.dll in the "dist" folder. Also tried to exclude
the same dll in the options of the setup.py file

The error reads as follows :

"The application has failed to start because the application configuration
is incorrect. Reinstalling the application may fix this problem".

Details of the installed setup files may be useful :

1- python-2.6.1.msi
2- py2exe-0.6.9.win32-py2.6.exe
3- pywin32-212.win32-py2.6.exe

Thanks in advance

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


python script as service

2009-05-13 Thread prakash jp
Hi all,

could any one tell how to run a python script as a scheduled service(say
every one minute). I tried out the windows registration

method but encountered an error . The error reads:

"The 'script name'  on local Computer started and then stopped. Some
services stop automatically if they have no work to do, for example, the
Performance Logs and Alerts service"

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


Re: Python py2exe - memory load error

2009-11-29 Thread prakash jp
Try to install "vcredist_x86.exe", then try to build using py2exe. I think
that should solve the issue

Regards
Prakash

On Mon, Nov 30, 2009 at 10:40 AM, koranthala  wrote:

> This is cross post from stackoverflow - I couldnt get the solution
> there. Hopefully, nobody would mind.
>
> I am creating a medium level application in Python. Everything works
> well now, and I am trying to make this a windows executable with
> py2exe. The executable is created fine, but when I try to run it, it
> fails with the following error.
>
>  File "zipextimporter.pyc", line 82, in load_module
>  File "pyAA\__init__.pyc", line 1, in ?
>  File "zipextimporter.pyc", line 82, in load_module
>  File "pyAA\AA.pyc", line 8, in ?
>  File "zipextimporter.pyc", line 82, in load_module
>  File "pyAA\pyAAc.pyc", line 5, in ?
>  File "zipextimporter.pyc", line 98, in load_module
> ImportError: MemoryLoadLibrary failed loading pyAA\_pyAAc.pyd
>
> I am using pyAA in this application. I searched internet, but was
> unable to get any solution. I copied msvcp71.dll to windows/system32,
> but still issue is there.
>
> I had solved it earlier (around 7 months back), but my hard drive
> crashed and when I try to recreate it, I cannot seem to solve it
> now. :-(
>
> I would be much obliged if someone could help me out here.
>
> When I use py2exe without bundle files option, it is working
> perfectly. But when I use bundle file option, it is failing.
>
> I tried without zipfile option, wherein it creates a library.zip
> alongwith the executable. Again it failed. I did unzip of library.zip
> using 7-zip, and found that _pyAAc.pyd is there in pyAA folder inside
> the zip file. So, it looks like some issue with memoryloadlibrary
> function.
>
> >dir
> 11/30/2009  09:48 AM25,172 AA.pyc
> 11/30/2009  09:48 AM 3,351 Defer.pyc
> 11/30/2009  09:48 AM 2,311 Path.pyc
> 11/30/2009  09:48 AM11,216 pyAAc.pyc
> 11/30/2009  09:48 AM 5,920 Watcher.pyc
> 08/20/2005  02:00 PM49,152 _pyAAc.pyd
> 11/30/2009  09:48 AM   162 __init__.pyc
>
> >From the trace it does look like it can extract AA.pyc etc. I am using
> windows7 - can it be some clue?
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


wrap exe with in another exe

2009-12-18 Thread prakash jp
Hi all,
I need to call an external executable from my "calling_exe.py" python
program.
Can we make a executable say->"Final.exe" from the "calling_exe.py" and the
"external.exe"
*"calling_exe.py" ->(calling)->  "external.exe"

||

---
(integrate using py2exe)  ||  how should the setup.py file look
like?
   \||/
\/
   "Final.exe"  *
*Regards*
*Prakash*
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-30 Thread prakash jp
Hi all,
#use py2exe properly to create a single distributable exe

#setup.py- create a single exe that runs all boxex

from distutils.core import setup
import py2exe
import sys
# no arguments
if len(sys.argv) == 1:
sys.argv.append("py2exe")
# creates a standalone .exe file, no zip files
setup( options = {"py2exe": {"compressed": 1, "optimize": 2, "ascii": 1,
"bundle_files": 1}},
   zipfile = None,
   # replace test.py with your own code filename here ...
   console = [{"script": *'test.py*'}] )
---

vc ++ redistributable is a good option as well.


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


Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2010-01-03 Thread prakash jp
*#How to use setup.py file with py2exe:*
**
python daniesetup.py py2exe --bundle 1

*#Also the data files have to taken care off in the options* list

*#Here is a sample setup.py:*
*#*
from distutils.core import setup
import py2exe
import sys

# no arguments
if len(sys.argv) == 1:
sys.argv.append("py2exe")
# creates a standalone .exe file, no zip files
setup( options = {"py2exe": {"compressed": 1, "optimize": 2, "ascii": 1,
"bundle_files": 1}},
   zipfile = None,
   # replace test.py with your own code filename here ...
   console = [{"script": 'test.py'}] )
Regards
Prakash
-- 
http://mail.python.org/mailman/listinfo/python-list


search entire drive say c:

2010-02-12 Thread prakash jp
Hi all,

can any of u help to search a file say "abc.txt" in entire c drive (windows)
and print the path/s stating such a files presence.

Thanks in advance

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


Re: search entire drive say c:

2010-02-12 Thread prakash jp
Thank u Tim Case,

all,

Also how to run the standalone generated from script taking unc path names
to account

regards
Prakash

On Fri, Feb 12, 2010 at 6:31 PM, Tim Chase wrote:

>  can any of u help to search a file say "abc.txt" in entire c drive
>> (windows)
>> and print the path/s stating such a files presence.
>>
>
> Well, you can just do it from DOS:
>
>  c:\> dir /s/b/a abc.txt
>
> Just use os.walk() and check the list of files returned at each
> directory-level iteration.
>
>  ROOT = "c:\\"
>  fname = "abc.txt".lower()
>  for p, d, f in os.walk(ROOT):
>for fn in f:
>  if fn.lower() == fname:
>print os.path.join(p, f)
># break
>
> You might also investigate using os.path.normcase() instead of .lower()
>
> -tkc
>
>
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to use python to register a service (an existing .exe file)

2010-03-02 Thread prakash jp
Code of SmallestService.py is at:

http://book.opensourceproject.org.cn/lamp/python/pythonwin/

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


read text color from image

2011-01-12 Thread prakash jp
Hi All,

During automation of a test case the web interface throws failure and sucess
text in RED and GREEN colors respectively. Is there a method to read the
color of the Success(green) and Failure(red) from the screenshots of the
webinterfaces collect for Failure and Success

say :

import Image
import ImageChops
im2 = Image.open("Failure.JPG")
im1 = Image.open("Sucess.JPG")
#print list(im1.getdata())
diff = ImageChops.difference(im2, im1)
#print diff.getbbox()
#diff.show()
#print im1.tostring()

Thanks for all in advance

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


FIX Message module

2011-02-17 Thread prakash jp
Hi all,

Finacial Information Exchange (FIX) Protocol module is what I am looking
for.Using it I would like to pump and listen to the FIX messages--(hard
coded values). Please guide me through the relevant module (windows
installer) and anything that you foresee as a potential bottleneck.

So far I tried using QUICFIX at:*http://www.quickfixengine.org/download.html
*,  but could not start right away.

Thanks in Advance
Prakash
-- 
http://mail.python.org/mailman/listinfo/python-list


tools for network adminstrator

2010-04-12 Thread prakash jp
Hi all,

Can any one mention a list of *python based tools* (existant / could be
developed) which network administrators might need.

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


python interview quuestions

2010-08-06 Thread prakash jp
Hi all,

I would like to aquint myself with Python Interview questions . I am a
Python Scripter, so if u could orient the pointers in the same direction it
would be very handy


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


Re: WMI in Python

2010-09-13 Thread prakash jp
Very true most systems admins requirement range from : knoowing the Service
tag for a given IP to knowing the system harware details such as RAM sizes
etc. This is where Remote Inventory Management comes in handy. There is
vault of already existing vb scripts/perl scripts and batch files. To me it
looks fine if one can create a common interface and link the preexistant
scripts.

Else,

wmi command line can be directly implemented in python through
os.system("COMMAND WMI") so that redistributable python exe be created
through py2exe

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