Re: Passing parameters for a C program in Linux.

2009-06-30 Thread venutaurus...@gmail.com
On Jun 30, 5:42 pm, Petr Messner wrote: > Hi, > > this can be done using module "subprocess"; there is also function > popen() in module "os" and module popen2, but they are deprecated > since Python 2.6. > > PM > > 2009/6/30 venutaurus...@gmail.c

Passing parameters for a C program in Linux.

2009-06-30 Thread venutaurus...@gmail.com
Hi all, I have to write an automted script which will test my c program. That program when run will ask for the commands. For example: local-host# ./cli Enter 1 for add Enter 2 for sub Enter 3 for mul 1---Our option Enter two numbers 44 33 Our option Result is 77

Calling user defined functions from a different script..

2009-04-15 Thread venutaurus...@gmail.com
Hello all, I have a situation where I need to call functions present in a different script whose hierarchy is something like below: C:\Pythonlib\uitl\script1.py {Place where my functions definitions are present} C:\Scripts\script2.py { Place where function calls are made} In

HTML Conversion in python

2009-04-12 Thread venutaurus...@gmail.com
Hello All, Is there any library defined in Python which can convert a given text file into a html page. Basically, I require functions for creating tables or filling background colours for the html pages etc instead of writing each and every tag in my script.. Thank you, Venu Madhav. -

Re: Creating huge data in very less time.

2009-03-31 Thread venutaurus...@gmail.com
On Mar 31, 1:15 pm, Steven D'Aprano wrote: > On Mon, 30 Mar 2009 22:44:41 -0700, venutaurus...@gmail.com wrote: > > Hello all, > >             I've a requirement where I need to create around 1000 > > files under a given folder with each file size of around 1GB. Th

Creating huge data in very less time.

2009-03-30 Thread venutaurus...@gmail.com
Hello all, I've a requirement where I need to create around 1000 files under a given folder with each file size of around 1GB. The constraints here are each file should have random data and no two files should be unique even if I run the same script multiple times. Moreover the filename

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-22 Thread venutaurus...@gmail.com
On Mar 21, 3:05 pm, Tim Golden wrote: > venutaurus...@gmail.com wrote: > > Thank you Sir for your reply. It is working for me. But is failing if > > I have Unicode characters in my path. I tried giving a 'u' in front of > > the path but still it fails at f.cre

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread venutaurus...@gmail.com
On Mar 20, 6:58 pm, Tim Golden wrote: > venutaurus...@gmail.com wrote: > > Thank you for your suggestion but.. I'll have around 1000 such files > > in the whole directory and it becomes hard to manage such output > > because again I've to take this snapshot before b

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread venutaurus...@gmail.com
On Mar 20, 5:09 pm, Tim Golden wrote: > Tino Wildenhain wrote: > > Tim Golden wrote: > > ... > >> and do the following: > > >> > >> from winsys import fs > > >> for f in fs.flat ("c:/temp"): > >>  f.dump () > >          ^ eeek! > > Was the k! for the space before the bracket > (which, for som

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread venutaurus...@gmail.com
On Mar 20, 1:58 pm, Tino Wildenhain wrote: > venutaurus...@gmail.com wrote: > > Hello all, > >             Is there any way to list out all the properties (name, > > type, size) and attributes( Accesstime, mod time, archived or readonly > > etc) of a folder and its con

Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread venutaurus...@gmail.com
Hello all, Is there any way to list out all the properties (name, type, size) and attributes( Accesstime, mod time, archived or readonly etc) of a folder and its contents recursively. Should I need ot go inside each and every directory to list them? This has to be for Windows.

Re: Creating 50K text files in python

2009-03-18 Thread venutaurus...@gmail.com
On Mar 18, 6:58 pm, Marco Mariani wrote: > venutaurus...@gmail.com wrote: > >     for k in range (1,1001): >        ... > >         k = k+1 > > Man, you have a trouble with loops, all over. But the situation demands it.:-( I've to create 5 folders and 10 folders

Re: Creating 50K text files in python

2009-03-18 Thread venutaurus...@gmail.com
On Mar 18, 6:35 pm, Peter Otten <__pete...@web.de> wrote: > venutaurus...@gmail.com wrote: > > Hello all, > >           I've an application where I need to create 50K files spread > > uniformly across 50 folders in python. The content can be the name of > > f

Re: Creating 50K text files in python

2009-03-18 Thread venutaurus...@gmail.com
On Mar 18, 6:16 pm, "venutaurus...@gmail.com" wrote: > Hello all, >           I've an application where I need to create 50K files spread > uniformly across 50 folders in python. The content can be the name of > file itself repeated 10 times.I wrote a code using n

Creating 50K text files in python

2009-03-18 Thread venutaurus...@gmail.com
Hello all, I've an application where I need to create 50K files spread uniformly across 50 folders in python. The content can be the name of file itself repeated 10 times.I wrote a code using normal for loops but it is taking hours together for that. Can some one please share the code for

how to identify the file system type of a drive?

2009-03-16 Thread venutaurus...@gmail.com
hi all, Is there any way to identify the File system type of a drive in python in Windows? Some thing like: C:\ -- NTFS D:\ -- FAT32.. so on.. Thank you, Venu Madhav. -- http://mail.python.org/mailman/listinfo/python-list

Problem while copying a file from a remote filer

2009-03-15 Thread venutaurus...@gmail.com
Hi all, I have to write an application which does a move and copy of a file from a remote machine to the local machine. I tried something like: file = ur"venuwin2008\\C\\4Folders\\Folder02\\Folder002\ \TextFile_06.txt" dest = "C:\\test" shutil.copy(file,dest) But it is throwing an error

Re: Behaviour of os.rename()

2009-03-11 Thread venutaurus...@gmail.com
On Mar 11, 7:27 pm, Emile van Sebille wrote: > venutaurus...@gmail.com wrote: > > Hello all, > >             I got a suspicion on the behaviour of os.rename > > (src,dst).If the src is the path of a file and dst is a new filename > > this os.rename() function is infa

Re: Behaviour of os.rename()

2009-03-11 Thread venutaurus...@gmail.com
On Mar 11, 7:20 pm, Tim Golden wrote: > venutaurus...@gmail.com wrote: > > Hello all, > >             I got a suspicion on the behaviour of os.rename > > (src,dst).If the src is the path of a file and dst is a new filename > > this os.rename() function is infact creat

Re: Problem with os.chdir()

2009-03-11 Thread venutaurus...@gmail.com
On Mar 11, 7:17 pm, Tim Golden wrote: > venutaurus...@gmail.com wrote: > > On Mar 11, 6:41 pm, Tim Golden wrote: > >> venutaurus...@gmail.com wrote: > >>> On Mar 11, 5:19 pm, Tim Golden wrote: > >>>>> Here is my code snippet which you will be

Behaviour of os.rename()

2009-03-11 Thread venutaurus...@gmail.com
Hello all, I got a suspicion on the behaviour of os.rename (src,dst).If the src is the path of a file and dst is a new filename this os.rename() function is infact creating a new file with the dst name in the current working directory and leaving the src as it is. Is this the expected b

Re: Problem with os.chdir()

2009-03-11 Thread venutaurus...@gmail.com
On Mar 11, 6:41 pm, Tim Golden wrote: > venutaurus...@gmail.com wrote: > > On Mar 11, 5:19 pm, Tim Golden wrote: > >>> Here is my code snippet which you will be interested in: > >> Indeed. > > >>> file = ur'\\?\C:\\TestDataSet\DeepPaths >

Re: Problem with os.chdir()

2009-03-11 Thread venutaurus...@gmail.com
On Mar 11, 5:19 pm, Tim Golden wrote: > > Here is my code snippet which you will be interested in: > > Indeed. > > > file = ur'\\?\C:\\TestDataSet\DeepPaths > > \DeepPathLevel01\DeepPathLevel02\DeepPathLevel03\DeepPathLevel04\DeepPathLe > > vel05\DeepPathLevel06\DeepPathLevel07\DeepPathLevel08\De

Re: Problem with os.chdir()

2009-03-11 Thread venutaurus...@gmail.com
On Mar 11, 5:02 pm, Tim Golden wrote: > venutaurus...@gmail.com wrote: > > On Mar 11, 11:08 am, Tim Golden wrote: > >> venutaurus...@gmail.com wrote: > >>> Hello all, > >>>            I am writing a python script which has to access deep paths >

Re: Problem with os.chdir()

2009-03-11 Thread venutaurus...@gmail.com
On Mar 11, 11:08 am, Tim Golden wrote: > venutaurus...@gmail.com wrote: > > Hello all, > >            I am writing a python script which has to access deep paths > > then supported normally by the Windows OS (>255). So I am appending "\ > > \?\" to do

Problem with os.chdir()

2009-03-10 Thread venutaurus...@gmail.com
Hello all, I am writing a python script which has to access deep paths then supported normally by the Windows OS (>255). So I am appending "\ \?\" to do so. But when I use the path in the above fashion with os.chdir() it is unable to recognize my folder and throwing an error: Traceback

Re: Problem in accessing long paths.

2009-03-06 Thread venutaurus...@gmail.com
On Mar 6, 7:09 pm, "Tim Golden" wrote: > venutaurus...@gmail.com wrote: > > Hello All, > >             I have a requirement where I've to access folders with > > path lengths >255 ( Windows only supports 255). To do this I've > > created junction

Problem in accessing long paths.

2009-03-06 Thread venutaurus...@gmail.com
Hello All, I have a requirement where I've to access folders with path lengths >255 ( Windows only supports 255). To do this I've created junction points for the folders whose length is > 255. The problem is my python script is unable to recognize these junction points. As an example I

Re: Problem with py2exe conversion.

2009-03-04 Thread venutaurus...@gmail.com
On Mar 4, 6:23 pm, "Gabriel Genellina" wrote: > En Wed, 04 Mar 2009 11:12:32 -0200, venutaurus...@gmail.com   > escribió: > > > Hello all, > >             I am facing an interesting problem with py2exe conversion. > > I've a python script which uses th

Problem with py2exe conversion.

2009-03-04 Thread venutaurus...@gmail.com
Hello all, I am facing an interesting problem with py2exe conversion. I've a python script which uses the shutil libarary. When I convert that python script into exe, it creates a dist folder and then in that it places the exe. Along with the exe it also places a zip folder containing p

Re: Run a python script as an exe and run a new process from it

2009-02-26 Thread venutaurus...@gmail.com
t;, you can Browse > to the python executable, so Explorer will use it to open .py files > when you double-click on them. > > As someone else mentioned there is also a py2exe program. Google it. > > 2009/2/26 venutaurus...@gmail.com : > > > > > Hello all, > &g

Re: Run a python script as an exe and run a new process from it

2009-02-26 Thread venutaurus...@gmail.com
On Feb 26, 7:47 pm, Tim Wintle wrote: > On Thu, 2009-02-26 at 06:00 -0800, venutaurus...@gmail.com wrote: > > Thanks for the reply, > >            Being a newbie to python, I am finding it difficult to > > understand the logic even after thorough reading of comments. Is ther

Re: Run a python script as an exe and run a new process from it

2009-02-26 Thread venutaurus...@gmail.com
On Feb 26, 7:00 pm, "venutaurus...@gmail.com" wrote: > On Feb 26, 6:10 pm, Tim Wintle wrote: > > > > > On Thu, 2009-02-26 at 04:55 -0800, venutaurus...@gmail.com wrote: > > > Hello all, > > >            I've a strange requirement where I need

Re: Run a python script as an exe and run a new process from it

2009-02-26 Thread venutaurus...@gmail.com
On Feb 26, 6:10 pm, Tim Wintle wrote: > On Thu, 2009-02-26 at 04:55 -0800, venutaurus...@gmail.com wrote: > > Hello all, > >            I've a strange requirement where I need to run a python > > script just as we run an exe (by double clicking through windows > >

Run a python script as an exe and run a new process from it

2009-02-26 Thread venutaurus...@gmail.com
Hello all, I've a strange requirement where I need to run a python script just as we run an exe (by double clicking through windows explorer or by typing the script name at command prompt). In that process I should be able to execute another python script in such a way that, the second s

Finding the attributes of a file

2009-02-24 Thread venutaurus...@gmail.com
Hello all, I am writing an application which has to identify the archived files in a given directory.I've tried using the function i = win32api.GetFileAttributes (full_path) to obtain the attributes.But am unable to identify based on the value it returns as it is returning 5152, 13856 e

Re: Problem with os.system()

2009-02-24 Thread venutaurus...@gmail.com
On Feb 25, 9:55 am, Christian Heimes wrote: > venutaurus...@gmail.com schrieb: > > > Hello, > >          I am facing problems while using os.system() of python for > > copying a file from source to destination where the file name is in > > unicode (multi lingual cha

Problem with os.system()

2009-02-24 Thread venutaurus...@gmail.com
Hello, I am facing problems while using os.system() of python for copying a file from source to destination where the file name is in unicode (multi lingual characters).My python interpreter is trying to convert them to ascii and is failing. I tried giving unicode string as input for the f

Problem with os.system()

2009-02-24 Thread venutaurus...@gmail.com
Hello, I am facing problems while using os.system() of python for copying a file from source to destination where the file name is in unicode (multi lingual characters).My python interpreter is trying to convert them to ascii and is failing. I tried giving unicode string as input for the f

Re: Problem in accessing files with unicode fonts.

2009-02-24 Thread venutaurus...@gmail.com
On Feb 24, 1:44 pm, "Gabriel Genellina" wrote: > En Tue, 24 Feb 2009 05:15:33 -0200, venu madhav   > escribió: > > > > >> > def findFile(dir_path): > >> >     for name in os.listdir(dir_path): > >> >         full_path = os.path.join(dir_path, name) > >> >         print full_path > >> >         if

Re: opening files with names in non-english characters.

2009-02-23 Thread venutaurus...@gmail.com
On Feb 24, 8:29 am, "venutaurus...@gmail.com" wrote: > On Feb 23, 11:02 pm, Chris Rebert wrote: > > > > > On Mon, Feb 23, 2009 at 5:51 AM, venutaurus...@gmail.com > > > wrote: > > > Hi all, > > >          I am trying to find the attribut

Re: opening files with names in non-english characters.

2009-02-23 Thread venutaurus...@gmail.com
On Feb 23, 11:02 pm, Chris Rebert wrote: > On Mon, Feb 23, 2009 at 5:51 AM, venutaurus...@gmail.com > > wrote: > > Hi all, > >          I am trying to find the attributes of afile whose name has > > non english characters one like given below. When I try to run my

opening files with names in non-english characters.

2009-02-23 Thread venutaurus...@gmail.com
Hi all, I am trying to find the attributes of afile whose name has non english characters one like given below. When I try to run my python scirpt, it fails giving out an error filename must be in string or UNICODE. When i try to copy the name of the file as a strinig, it (KOMODO IDE) is

Re: How to open a remote file using python.

2009-02-22 Thread venutaurus...@gmail.com
On Feb 23, 9:25 am, MRAB wrote: > venutaurus...@gmail.com wrote: > > Hello all, > >            I am writing an application where I need to open a shared > > file on a remote machine using python script. I tried using the > > following function: > > > f = ur

How to open a remote file using python.

2009-02-22 Thread venutaurus...@gmail.com
Hello all, I am writing an application where I need to open a shared file on a remote machine using python script. I tried using the following function: f = urllib.open("\\remote_machine\\folder1\\file1.doc") I also tried using class urllib.FancyURLopener(...) but d