Re: [BangPypers] Need help for python coding

2013-04-18 Thread Mandar Vaze / मंदार वझे
On Thu, Apr 18, 2013 at 6:34 PM, Rahul R wrote: > os.path.realpath(__filename__) > that should do the trick. As much as I understand the requirement, Kamalakar wants to "recognize" the path, then he needs some equivalent of "which" command (for binaries) or "locate" for non-binaries realpath did

Re: [BangPypers] Need help for python coding

2013-04-18 Thread Rahul R
os.path.realpath(__filename__) that should do the trick. ./Rahul On Thu, Apr 18, 2013 at 6:15 PM, Kamalakar gs wrote: > HI all, > I have a query that i have doc which is read through python.But instead of > giving path and filename > in the coding.I want to manipulate it like "python has to

Re: [BangPypers] Need help for python coding

2013-04-18 Thread Abdul Muneer
Hi Kamalakar, You can use os.path.join() to join the user input to a base path. Python will take care of unix/windows differentiation and append slashes accordingly. >>> import os >>> base_path = os.getcwd() >>> base_path '/home/amuneer/workspace/playground' >>> file_name = raw_input("Enter Filena

Re: [BangPypers] [OT] Intro Video - Companies in India

2013-04-18 Thread Ramchandra Apte
This is OT to this list which is about Python. On 18 April 2013 13:10, Venkatraman S wrote: > Hi, > > How do the companies in India make the intro videos to be put up on their > website? Do they outsource it to someone in the US to get the language and > the accent right or is there some automa

[BangPypers] Need help for python coding

2013-04-18 Thread Kamalakar gs
HI all, I have a query that i have doc which is read through python.But instead of giving path and filename in the coding.I want to manipulate it like "python has to ask USER for a specific filename so that python recognizes the directory internally and read the file ".How do i do this.I have trie

[BangPypers] pyodbc Teradata connection

2013-04-18 Thread JAGANADH G
Hi , Does anybody have experience with pyodbc and teradata . I was trying to connect to a remote teredata instance using pyodbc. it gives the following error. Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (SQLDriverConnect)'

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-18 Thread Dhruv Baldawa
http://code.activestate.com/recipes/578375-proof-of-concept-for-a-more-space-efficient-faster/?in=user-178123 -- Dhruv Baldawa (http://www.dhruvb.com) On Thu, Apr 18, 2013 at 2:31 PM, Rahul R wrote: > Afaik, python gc is threshold based. So, gc should trigger after a given > threshold value (

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-18 Thread Rahul R
Afaik, python gc is threshold based. So, gc should trigger after a given threshold value (which can be changed) . but defintely the code is worth looking. thanks for pointing it out. ./Rahul On Thu, Apr 18, 2013 at 2:15 PM, Hrishikesh Kulkarni wrote: > The code snippet shows the old_value and o

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-18 Thread Hrishikesh Kulkarni
The code snippet shows the old_value and old_keys are marked by decref not the dummy. I wouldnt worry about dummy keys so much. btw checkout dictresize which is called during insert/set which does resize the dict. When? that would be a good learning exercise. On Thu, Apr 18, 2013 at 2:09 PM, Rah

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-18 Thread Harish Vishwanath
As you may have noticed, dictionary size depends greatly on the order of insertion. Let us say you are trying to copy the current items from your existing dict [which could have been re-ordered multiple times because of collisions and increase in allocated memory]. It is definitely possible that th

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-18 Thread Rahul R
Hey Hrishikesk, So are you saying, if i run gc.collect() in my program I will get rid of all the dummy variables in the dictionary ? Thanks, ./Rahul On Thu, Apr 18, 2013 at 12:06 PM, Hrishikesh Kulkarni wrote: > On Wed, Apr 17, 2013 at 9:30 PM, Rahul R wrote: > > > As far as i know, python per

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-18 Thread Rahul R
Harish , you nailed it! Thanks for the video. So, decreasing the size will not be possible afterall. But what confuses me is why is copying the items to new dictionary will not consume less space ? By copying you will get rid of all the dummy variables and lookup time will also decrease. Thanks

Re: [BangPypers] [OT] Intro Video - Companies in India

2013-04-18 Thread Jayneil Dalal
Venkataraman, This should help: http://www.powtoon.com/ I have used it a couple of times and it is really good! It is free to try but you have to pay to get the video in HD format and for removing their logo. Best, Jayneil. On Thu, Apr 18, 2013 at 2:47 AM, Venkatraman S wrote: > On Thu, A

Re: [BangPypers] [OT] Intro Video - Companies in India

2013-04-18 Thread Venkatraman S
On Thu, Apr 18, 2013 at 1:10 PM, Venkatraman S wrote: > How do the companies in India make the intro videos to be put up on their > website? Do they outsource it to someone in the US to get the language and > the accent right or is there some automated Voice SDK? Offlate, i stumbled > on a few sm

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-18 Thread Harish Vishwanath
Here is a good talk on how dictionaries are implemented in python : http://blip.tv/pycon-us-videos-2009-2010-2011/pycon-2010-the-mighty-dictionary-55-3352147 Due to possibility of collisions in the hash table, dict keeps allocating 4x or 2x the size of existing allocation and *will* reorder the it

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-18 Thread Vishal
Not sure what the exact intent of resizing the dict is...however, if you wish to reduce the overall memory consumption of your python process...i would suggest: - copy the required contents to a new dict..(use dict comprehension if you can) >>> d2 = dict((k,v) for k,v in d1.items() if ) - Assign

[BangPypers] [OT] Intro Video - Companies in India

2013-04-18 Thread Venkatraman S
Hi, How do the companies in India make the intro videos to be put up on their website? Do they outsource it to someone in the US to get the language and the accent right or is there some automated Voice SDK? Offlate, i stumbled on a few small companies(/startups) who have their intro-videos with a