Extract half screen of a video

2010-01-27 Thread aditya shukla
Hello Guys, I have a video and what I want is to extract only half of the screen of it.By half screen i mean when i run the video i can say the left half(from the monitor's screen) of the video and dump the right half. Thanks Aditya -- http://mail.python.org/mailman/listinfo/python-list

Mencoder not working from a python script

2010-01-08 Thread aditya shukla
Hello guys, I am trying to create a python script which uses mencoder to create videos from a set of images.When I am using the command(windows 7) i am able to generate the video properly.But when used within a python script i am ggetting error.Below is the code and error.any help is appreciated.

Mencoder and creating videos

2010-01-06 Thread aditya shukla
Hello Guys, I have a multiprocessing script which downloads images from 5 urls to 5 directories(usinf multiprocess in python 2.6).The download is for 5 mins.My aim is to create a video for every minute for each directory and dump the images as the video is created. My question are , should i use *

Re: Do I have to use threads?

2010-01-05 Thread aditya shukla
Thanks.i will look into multiprocessing. Aditya -- http://mail.python.org/mailman/listinfo/python-list

Do I have to use threads?

2010-01-05 Thread aditya shukla
Hello people, I have 5 directories corresponding 5 different urls .I want to download images from those urls and place them in the respective directories.I have to extract the contents and download them simultaneously.I can extract the contents and do then one by one. My questions is for doing it

Question-Answer based web App

2009-12-26 Thread aditya shukla
Merry christmas guys, I am trying to make a web based application which has a set of questions and answers associated with it such that a report is generated based on the answers a user chooses for each question.It's like facebook apps where we have questions , answers and reports . Should i gener

Live Video Capture using Python

2009-12-20 Thread aditya shukla
Hello Guys, I am trying to capture images from a live broadcast of a "cricket match" or say any video using python. I can see the video in the browser.My aim is to capture the video at any moment and create an images.Searching on google turns up http://videocapture.sourceforge.net/ .I am not sure

Re: Inserting into a database

2009-10-11 Thread aditya shukla
On Sun, Oct 11, 2009 at 5:06 PM, aditya shukla wrote: > Hello Stephen, > > > I have put the code and the traceback.Can you please help me now? .I am > scratching my head :) > > I am using python 2.6 on windows 7 and MySQLdb to make connections to the > database.The

Re: Inserting into a database

2009-10-11 Thread aditya shukla
Hello Guys I am using python 2.6 on windows 7 and MySQLdb to make connections to the database.The issue here is that I am not able to insert from the python script to the database.When I run the same query in mysql query brower then the insert statement works .I am able to select from the databa

Inserting into a database

2009-10-11 Thread aditya shukla
Hello Guy's I am using python 2.6 on windows 7 and MySQLdb to make connections to the database.The issue here is that I am not able to insert from the python script to the database.When I run the same query in mysql query brower then the insert statement works .I am able to select from the databa

Changing IP's and Connecting to a site

2009-09-16 Thread aditya shukla
Hello Guys' I have a script which i am using to do interaction with a website.Is there a way by which i can connect to the site through different ip's .Say use a proxy or something. Thanks Aditya -- http://mail.python.org/mailman/listinfo/python-list

KeyBoard interrupt and Redirection operator

2009-09-15 Thread aditya shukla
Hello Guys, I have a program which i use like this scraps.py arg1 arg2 > filename. I am using the redirection operator to direct the output to the filename .The scenario here is that I want to print a message as long as the program is running and as generate an error message and exit as I use a k

Site Scarpping with Beautiful Soup

2009-09-10 Thread aditya shukla
Hello Guys, I would like to scrap a site by using Beautiful Soup library.The site has various options listed in a drop down menu.What I want to do is pass the drop down option with the python script and scrap the result obtained for each value.Let's say we have three values i the drop down menu

Temporary file

2009-04-09 Thread aditya shukla
I am trying to create a temporary file. import tempfile temp = tempfile.NamedTemporaryFile(suffix='_suffix', prefix='prefix_', dir='/tmp', ) try: print 'temp:', temp print 'temp.name:'

pyparse

2009-03-14 Thread aditya shukla
Hello guys i am trying to make a simple sql parser and i found pyparse , my question here is does it return a data structure like an abstract syntax tree of the sql query.Any help is appreciated Aditya -- http://mail.python.org/mailman/listinfo/python-list

String manipulation using RE

2008-10-26 Thread aditya shukla
Hello folks, i have a string eg "(((A:1,B:1):3,C:3):4,((E:1,F:1):2,D:2):4)" now i have to convert this string to "(((A:1,B:1):2,C:3):1,((E:1,F:1):1,D:2):2)" So i used the logic eg. taking the substring "1):3" and converting it to "1):2"(3-1=2) so on for all the similar substrings.But i am not a

Selecting random elements from a list.

2008-10-13 Thread aditya shukla
Hello folks, i have a list say list1=[a,b,c,...z] ie 26 elements i have to take 5 elements from it randomly and save in another list.Please explain how to do this? Aditya -- http://mail.python.org/mailman/listinfo/python-list

RE module question

2008-10-03 Thread aditya shukla
Hello folks : i have a string "-bin-ulockmgr_server:0.99[&&NHX:C=0.195.0]" from which i want to delete [&&NHX:C=0.195.0] . I wrote a regular expression for [&&NHX:C=0.195.0] as \[&&(\w)+:\w=((-)?(\d|\d\d|\d\d\d)\.)+\d\] now when i do p = re.compile('\[&&(\w)+:\w=((-)?(\d|\d\d|\d\d\d)\.)+\d\]') m

Regular expressions question

2008-10-02 Thread aditya shukla
Hello folks , I trying to match a pattern in a string , i am new in using re .This is what is happening When i do this p = re.compile('(\[&&NHX:)') >>> m = p.match("[&&NHX:C=0.195.0]") >>> print m <_sre.SRE_Match object at 0x013FE1E0> --- thus i am able to find the match but when i use the stri

Parser Module

2008-09-28 Thread aditya shukla
Hello folks , I wanna create a parser for newick files which generates an ultrametric tree -> every leaf is equidistant from the root eg ->( http://www.icp.be/~opperd/private/upgma.html) as the parse tree.Can this type of a parse tree be constructe

File modifications

2008-09-27 Thread aditya shukla
Hello folks , I have a file like this /T_0_size=105((-bin-ulockmgr_server:0.99[&&NHX:C=0.195.0],(((-bin-hostname:0.00 [&&NHX:C=200.0.0], (-bin-dnsdomainname:0.00[&&NHX:C=200.0.0],(-bin-domainname:0.00[&&NHX:C=200.0.0],(-bin-nisdomainname:0.00[&&NHX:C=200.0.0],-bin-ypdomainname:0.00[&&NHX:C=200.0.

Classes and functions.

2008-09-26 Thread aditya shukla
Hello folks , i am using the newick module http://www.daimi.au.dk/~mailund/newick.html.I am just learning to use it and i have a question about it. from newick.tree import parse_tree from newick.tree import add_parent_links from newick.tree import add_distance_from_root import sys t = parse_t

Newick parser

2008-09-21 Thread aditya shukla
Hello folks , i have a .nwk file.I want to parser the tree from that file.I found this python parser for newick trees. http://www.daimi.au.dk/~mailund/newick.html But i don't understand the usage properly.What i wanna do is if i have a file in the location c:\\files\\file1.nwk , then i wanna parse

Adding environment variables to bash.

2008-09-11 Thread aditya shukla
Hello folks Can i add any environment variable to bash from my python script? so that when i use env command then i can see that environment variable. Thanks Aditya -- http://mail.python.org/mailman/listinfo/python-list

Working with environment variables.

2008-09-10 Thread aditya shukla
Hello folks, i am working with Python-2.5.2, fedora 9 sulphur I wanna change the value of environment variable , so if i open bash and type envvariable=value;export variable then this sets the envvariable equal to the value.Now i am writing a python script to set the value of this environment v

tempfile module

2008-09-10 Thread aditya shukla
Hello folks, I am using Python-2.5.2 on fedora 9 sulphur -2.6.25-14.fc9.i686.I am creating a temporary file , in which data is written by another program and then i am using that temporary file to do my computations.I am new to linux and i am facing two issues homedir = os.path.expanduser('~')

File operations

2008-09-10 Thread aditya shukla
Hello folks, I am using Python-2.5.2 on fedora 9 sulphur -2.6.25-14.fc9.i686.I am creating a temporary file , in which data is written by another program and then i am using that temporary file to do my computations.I am new to linux and i am facing two issues homedir = os.path.expanduser('~')

I/O error 13 Permission denied -Cannot access file as it is used by another process.

2008-08-28 Thread aditya shukla
Hello folks, I am creating a python script[windows vista and python2.5] which accesses another program(prog2).I my python script i am creating a temporary file and i write the output of prog2 in this temporary file. temp = tempfile.NamedTemporaryFile(suffix='_suffix',prefix='prefix_',dir='C:\\Pyt

Extracting path of a program from a list.

2008-08-26 Thread aditya shukla
Hello folks, I wanna know how can i extract path of a program whose path i have added to the PATH variable. This is what i have done import os x=os.getenv("PATH") print x >>%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Pr

Environment variables

2008-08-26 Thread aditya shukla
Hello folks, How can i create environment variables using python? Aditya -- http://mail.python.org/mailman/listinfo/python-list

Creating environment variables.

2008-08-26 Thread aditya shukla
Hello folks, I am writing a program(prog 1) in python , which requires to know the path of another program(prog 2) in order to execute.I can get my prog1 to work when i hard code the path of the existing program(prog2).But since the path of prog could be anywhere on the file system , thus i cannot

File operations

2008-08-21 Thread aditya shukla
Hello guys I am trying to search a file say xyz.txt after searching i get the location of the file in search_file (containing abspath) ,eg search_file="c:\\abc\\xyz.txt" now how should i open this file i can use file=open("c:\\abc\\xyz.txt","rb") but i have to use search_ file How can this be

Find file in a given search path

2008-08-20 Thread aditya shukla
Hello folks, i am trying to find a particular file in a given search path.I found code for this on internet. Code from os.path import exists, join from os import pathsep from string import split def search_file(filename, search_path): """Given a search path, find file """ file_found = 0

IDLE issue

2008-08-20 Thread aditya shukla
I found something interesting while working in idle.I have windows vista and python2.5 if i do import subprocess proc =subprocess.Popen('cmd.exe',stdin=subprocess.PIPE,stdout=subprocess.PIPE) output = proc.communicate('dir\n')[0] print repr(output) This dosen't work in idle while if it put it up

os.system()- cannot add parameter

2008-08-20 Thread aditya shukla
Hello folks, I have a program which is in the form of a client-server. i wanna send the parameters from my python script such that the client passes it to the server.this is what i have done Server is running in vmplayer.This is what i have done b="c:\progs" os.system('start c:\\pnew\\xyz\\win32\

Subprocess module question.

2008-08-19 Thread aditya shukla
Hello folks, I am using windows vista and i am trying to communicate with various processes. so when i do import subprocess proc=subprocess.Popen('cmd.exe') --This opens the command prompt But when i do proc=subprocess.Popen('netscan.exe') it gives an error Traceback (most recent call last):

Newbie question about sending and receiving data to the command prompt.

2008-08-19 Thread aditya shukla
Hello folks, I am using windows vista and i am trying to send data to the command prompt ,this is what is done. import subprocess proc =subprocess.Popen('cmd.exe',stdin=subprocess.PIPE) proc.communicate('abc') when i run this the command prompt just blinks and disappears , can anyone explain what

command line tool for process communication

2008-08-17 Thread aditya shukla
Hello guys, I have a program which is run through command line .I am trying to create another command line tools which controls this program. So for example in my new program when i give newprog -a then it should invoke the existing tool and perform one of its operation.eg existtprog -s How coul

Command line arguements

2008-07-27 Thread aditya shukla
Hello folks ,I have a program in which a text file is generated as an output eg C:\prog\ prog -x test.txt Right now whenever i have to read the test file i have to put its name manually in my code. eg f=open("c:\\prog\\test.txt","r") How ever i want to add the name of the test file dynamically to

Taking command line arguments from another program

2008-07-27 Thread aditya shukla
Hello folks ,I have a program in which a text file is generated as an output eg C:\prog\ prog -x test.txt Right now whenever i have to read the test file i have to put its name manually in my code. eg f=open("c:\\prog\\test.txt","r") How ever i want to add the name of the test file dynamically to

Histogram of floating point values.

2008-07-25 Thread aditya shukla
Hello folks, I have a list say data=[0.99,0.98,0.98,0.98,0.97,0.93,0.92,0.92,0.83,0.66,0.50,0.50] i am trying to plot histogram of these values i have installed numpy and matplotlib and this is what i am doing* import numpy import pylab from numpy import * from pylab import * input_hist=a

Histogram and \lambda parameter of the laplacian curve.

2008-07-25 Thread aditya shukla
Thanks everyone for your earlier help. I have to plot a histogram of values lets say [0.5,0.6,0.8,0.9].I guess the histogram would show an exponential decay ie, the laplacian curve. I need to find the \lambda parameter of this curve . So please tell me if it be done through http://matplotlib.so

File operations.

2008-07-24 Thread aditya shukla
Guys i just understood the problem.Thanks for all your help Aditya -- http://mail.python.org/mailman/listinfo/python-list

file operations.

2008-07-24 Thread aditya shukla
Guys thanks for your previous help .I have a doubt again My text file is :- 0\9\10\11|0.50|c:\windows\apppatch/AcLayers.dll 0\9\10\11|0.50|c:\windows\apppatch/AcRedir.dll 0\9\10|0.66|c:\windows\apppatch/AcSpecfc.dll 0\9|0.83|c:\windows\apppatch/iebrshim.dll 0|0.92|c:\windows\apppatch/pcamain.sdb

Reading a file

2008-07-24 Thread aditya shukla
Thanks a lot guys , i got it now. Aditya -- http://mail.python.org/mailman/listinfo/python-list

Reading a file

2008-07-24 Thread aditya shukla
I have a text file whose contents are like this:- jd|fj|dnv|jd|0.33|c:\\windows\\win32 shcbsbs|nscsjsj|0.93|hsbcjsnc I am trying to read the file like this:- >>> x = open("c:\\a.txt","r") >>> x.read() the result that i get is ike this:- 'jd|fj|dnv|jd|0.33|c:windowswin32\nshcbsbs|nscsjsj

Re:Taking the floating point distances and plotting histogram

2008-07-23 Thread aditya shukla
Hello folks:- I have a program whose output is stored in a text file , say test.txt eg. 0\9\10\11|0.50|c:\windows\apppatch/AcLayers.dll 0\9\10\11|0.50|c:\windows\apppatch/AcRedir.dll 0\9\10|0.66|c:\windows\apppatch/AcSpecfc.dll 0\9|0.83|c:\windows\apppatch/iebrshim.dll After reading this text fil