RE: Using the MSI installer on Windows: Setting PATH and Setuptools

2013-09-19 Thread Prasad, Ramit
cyt...@m.allo.ws wrote: > Hello All, > > I really hate Windows, and I have only intermittent access to Windows > machines right now. > > When I install Python 2.7 on Windows using the MSI installer, it definitely > does not modify the PATH > variable. So I modify the PATH variable myself as fol

RE: Language design

2013-09-11 Thread Prasad, Ramit
Mark Janssen wrote: > 1) It tried to make Object the parent of every class. No one's close > enough to God to make that work. > 2) It didn't make dicts inherit from sets when they were added to Python. > 3) It used the set literal for dict, so that there's no obvious way to > do it. This didn't g

RE: Help please, why doesn't it show the next input?

2013-09-11 Thread Prasad, Ramit
William Bryant wrote: > Sent: Wednesday, September 11, 2013 2:32 PM > To: python-list@python.org > Subject: Re: Help please, why doesn't it show the next input? > > @Dave Angel > > What is .lower() ? Thanks for bottom posting and trimming, but you should leave some content quoted for context. Ot

RE: sax.handler.Contenthandler.__init__

2013-08-30 Thread Prasad, Ramit
Neil Cerutti wrote: > This code is from The Python Cookbook, 2nd edition, 12.2 Counting > Tags in a Document: > > from xml.sax.handler import ContentHandler > import xml.sax > class countHandler(ContentHandler): > def __init__(self): > self.tags={} > def startElement(self, name, at

RE: subprocess.Popen instance hangs

2013-08-29 Thread Prasad, Ramit
Tim Johnson > using Python 2.7.1 on OS X 10.7.5 > > I'm managing a process of drush using an instance of subprocess.Popen > > The process has a '--verbose' option. When that option is passed as > part of the initializer `args' argument, the process will hang. > > It should be no surprise as drus

RE: [error] [client 178.59.111.223] (2)No such file or directory: exec of

2013-08-28 Thread Prasad, Ramit
Ferrous Cranus wrote: > Yes Uli, the script metrits.py is being invoked by Apache Web Server which in > turn runs under user > Nobody. > So, that mean that? user 'nobody' has no write permission to /home/nikos > folder? Yes. You should make it group writable with "nobody" as the group. Use chmod

RE: Can a child access parent attributes if that child added post-hoc as an attribute to the parent?

2013-08-27 Thread Prasad, Ramit
Ian Kelly wrote: > On Thu, Aug 22, 2013 at 3:26 PM, Prasad, Ramit > wrote: > > Bitswapper wrote: > >> > >> So I have a parent and child class: > >> > >> > >> class Map(object): > >> def __init__(self, name=''): > &

RE: Can a child access parent attributes if that child added post-hoc as an attribute to the parent?

2013-08-22 Thread Prasad, Ramit
Bitswapper wrote: > > So I have a parent and child class: > > > class Map(object): > def __init__(self, name=''): > self.mapName = name > self.rules = {} > > class Rule(Map): > def __init__(self, number): > Map.__init__(self) > self.number = number This

RE: utcoffset v. _utcoffset

2013-08-21 Thread Prasad, Ramit
Skip Montanaro wrote: > > Consider this little Python script: > > import dateutil.parser > import pytz > > x = dateutil.parser.parse("2013-08-16 23:00:00+01:00") > localtz = pytz.timezone("America/Chicago") > y = localtz.normalize(x) > > When I execute it (Python 2.7.2, dateutil 1.5, pytz 2011h

RE: Unpickling data with classes from dynamic modules

2013-08-21 Thread Prasad, Ramit
Fredrik Tolf wrote: > > Dear list, > > I have a system in which I load modules dynamically every now and then > (that is, creating a module with types.ModuleType, compiling the code for > the module and then executing it in the module with exec()), and where I > would wish to be able to have clas

RE: refresing the edited python function

2013-08-20 Thread Prasad, Ramit
alex23 > > On 19/08/2013 10:55 AM, Sudheer Joseph wrote: > > I have been using ipython and ipython with qtconsole and working on a > > code with functions. Each time I make a modification in function > > I have to quit IPTHON console (in both with and with out qt console ) > > and reload the funct

RE: PEP 450 Adding a statistics module to Python

2013-08-16 Thread Prasad, Ramit
CM wrote: > > On Friday, August 9, 2013 9:10:18 PM UTC-4, Steven D'Aprano wrote: > > I am seeking comments on PEP 450, Adding a statistics module to Python's > > standard library: > > I think it's a very good idea. Good PEP points, too. I hope it happens. > +1 especially for non-Cpython versi

RE: Verifying Variable value

2013-08-14 Thread Prasad, Ramit
chandan kumar wrote: > Hi , > > Is there a way to validate variable values while debugging any python > code.Run below example  in > debugging mode and i would like to know the value of c (I know print is an > option) with any other > option other than printing. > In C# or some other tools we c

RE: Could you verify this, Oh Great Unicode Experts of the Python-List?

2013-08-13 Thread Prasad, Ramit
Michael Torrie wrote: > On 08/11/2013 11:54 PM, Gregory Ewing wrote: > > Michael Torrie wrote: > >> I've always wondered if the 160 character limit or whatever it is is a > >> hard limit in their system, or if it's just a variable they could tweak > >> if they felt like it. > > > > Isn't it for com

RE: Python3 Multiprocessing

2013-08-09 Thread Prasad, Ramit
Devyn Collier Johnson > On 08/09/2013 03:44 PM, MRAB wrote: > > On 09/08/2013 20:30, Devyn Collier Johnson wrote: [snip] > >> > > jobs1.join() > > jobs2.join() > > > > Thanks MRAB! That is easy. I always (incorrectly) thought the join() > command got two threads and made them one. I did not know i

RE: Newbie: static typing?

2013-08-08 Thread Prasad, Ramit
Rui Maciel wrote: > Chris Angelico wrote: > > > On Tue, Aug 6, 2013 at 10:01 AM, Rui Maciel wrote: > >> It would be nice if some functions threw an error if they were passed a > >> type > >> they don't support or weren't designed to handle. That would avoid > >> having to deal with some bugs whi

RE: pcurl and network connection's problem

2013-07-31 Thread Prasad, Ramit
sam319 wrote: > I am having problems with pycurl in my threads , when i run it , it does > correctly but some times the > connection has been established but nothing will be downloaded and the > threads stay alive without > doing any thing (especially when the network's speed is slow and has abor

RE: Using system python vs. updated/current version

2013-07-31 Thread Prasad, Ramit
memilanuk wrote: > Hello there, > > What would be considered the correct/best way to run a current release > of python locally vs. the installed system version? On openSUSE 12.3, > the repos currently have 2.7.3 and 3.3.0. As far as I know, I'm not > really hitting any limitations with the exist

RE: PEP8 79 char max

2013-07-31 Thread Prasad, Ramit
Grant Edwards wrote: > On 2013-07-31, Neil Cerutti wrote: > > > Besides, after studying The Pragmatic Programmer I removed nearly > > all the tables from my code and reference them (usually with csv > > module) instead. > > I don't understand. That just moves them to a different file -- > doesn

RE: dump a multi dimensional dictionary

2013-07-26 Thread Prasad, Ramit
cerr wrote: > Hi, > > Can I somehow use pickle.dump() to store a dictionary of lists to a file? > I tried this: > > >>> import pickle > >>> mylist = [] > >>> mydict = {} > >>> mylist = '1','2' > >>> mydict['3'] = mylist > >>> fhg = open ("test", 'w') > >>> pickle.dump(

RE: Python Script Hashplings

2013-07-26 Thread Prasad, Ramit
Devyn Collier Johnson wrote: > Thanks Matthew Lefavor! But specifically, why use "#!/usr/bin/env python3" > instead of > "#!/usr/bin/python3"? > > Mahalo, > > DCJ I believe this will work on Windows for Python 3.3+ and also with virtualenv. https://pypi.python.org/pypi/virtualenv Virtualenv i

RE: Creating a Simple User Interface for a Function

2013-07-26 Thread Prasad, Ramit
CTSB01 wrote: > On Thursday, July 25, 2013 3:19:27 PM UTC-4, Dave Angel wrote: > > On 07/25/2013 12:03 PM, CTSB01 wrote: > > > > > I have the following code that runs perfectly: > > > > > > > def psi_j(x, j): > > > > >rtn = [] > > > > >for n2 in range(0, len(x) * j - 2

RE: RE Module Performance

2013-07-25 Thread Prasad, Ramit
Chris Angelico wrote: > On Fri, Jul 26, 2013 at 5:07 AM, wrote: > > Let start with a simple string \textemdash or \texttendash > > > sys.getsizeof('-') > > 40 > sys.getsizeof('a') > > 26 > > Most of the cost is in those two apostrophes, look: > > >>> sys.getsizeof('a') > 26 > >>> sys.

RE: Python 3: dict & dict.keys()

2013-07-25 Thread Prasad, Ramit
Terry Reedy wrote: > > On 7/24/2013 4:34 PM, Prasad, Ramit wrote: > > > I am still not clear on the advantage of views vs. iterators. > > A1: Views are iterables that can be iterated more than once. Therefore, > they can be passed to a function that re-iterates its

RE: Python 3: dict & dict.keys()

2013-07-24 Thread Prasad, Ramit
Stefan Behnel wrote: > Ethan Furman, 24.07.2013 20:31: > > On 07/24/2013 10:23 AM, Stefan Behnel wrote: > >> Peter Otten, 24.07.2013 08:23: > >>> Ethan Furman wrote: > > So, my question boils down to: in Python 3 how is dict.keys() different > from dict? What are the use cases? > >

RE: im.py: a python communications tool

2013-04-12 Thread Prasad, Ramit
Neil Cerutti wrote: > On 2013-04-12, Mark Janssen wrote: > > Possibily, but don't accept this view of the legal system. > > Judges can be quite reasonable. They don't want more time > > taken for bullshit cases and would much prefer for things to be > > settled (that is what their duty is -- to s

RE: extract HTML table in a structured format

2013-04-12 Thread Prasad, Ramit
Jabba Laci > Hi, > > I wonder if there is a nice way to extract a whole HTML table and have the > result in a nice structured > format. What I want is to have the lifetime table at the bottom of this page: > http://en.wikipedia.org/wiki/List_of_Ubuntu_releases (then figure out with a > script un

RE: newbie question about confusing exception handling in urllib

2013-04-12 Thread Prasad, Ramit
Steven D'Aprano wrote: > try: > main() > except Exception as err: > log(err) > print("Sorry, an unexpected error has occurred.") > print("Please contact support for assistance.") > sys.exit(-1) > > I like the traceback[0] module for logging last exception thrown. See tracebac

RE: im.py: a python communications tool

2013-04-12 Thread Prasad, Ramit
Mark Janssen wrote: > >> It doesn't have to say so, if it's not charging any money -- there's no > >> expectation that you're getting anything at all! > > > > Of course there is. If Oprah Winfrey stands up and publicly says that > > she's giving you a car, FOR FREE, no strings attached, and then gi

RE: please help me to debud my local chat network program

2012-11-30 Thread Prasad, Ramit
Minh Dang wrote: > > can anyone help me? Chris Angelico has given you some good comments which should give you a direction to investigate. This list is a global list and you seem a tad impatient. It is normal to hear back from a few hours to a day or two. Even if I wanted to help, without cont

RE: pyHook and time libraries

2012-11-30 Thread Prasad, Ramit
Doron wrote: > > Hey, I'm tring to create a software that records the keyboard/mouse and sends > email of the log every > predetermined period. > > I've manage to make the recorder and the auto-email sender, but I still can't > make both of them work > simultaneously. > > Can someone help me w

RE: amazing scope?

2012-11-30 Thread Prasad, Ramit
andrea crotti > > I wrote a script, refactored it and then introducing a bug as below: > > def record_things(): > out.write("Hello world") > > if __name__ == '__main__': > with open('output', 'w') as out: > record_things() > > > but the shocking thing is that it didn't actually

RE: Compare list entry from csv files

2012-11-29 Thread Prasad, Ramit
Anatoli Hristov wrote: > Hello, > > Tried to document a little bit the script, but I'm not that good in that too > :) > > The only problem I have is that I cant compare other field than the > first one in > for ex_phone in phones: > telstr = ex_phone[0].lower() > When I use telstr = ex_p

RE: re.search when used within an if/else fails

2012-11-29 Thread Prasad, Ramit
Dennis Lee Bieber wrote: > > Unless there has been a major change in the parser... (I still don't > have Python 3.x installed) > > I believe is expanded to 8-spaces -- NOT TO NEXT MULTIPLE OF > 8... A tab is *one* character. Your *editor* may show tabs visually "expanded" or conver

RE: Imaging libraries in active development?

2012-11-29 Thread Prasad, Ramit
Christian Heimes wrote: > > Am 28.11.2012 19:14, schrieb Michael Torrie: > > I'm curious. What features do you need that pil doesn't have? Other > > than updating pil to fix bugs, support new image types or new versions > > of Python, what kind of active development do you think it needs to > >

RE: re.search when used within an if/else fails

2012-11-29 Thread Prasad, Ramit
Ramit Prasad wrote: > > Dennis Lee Bieber wrote: > > > > Unless there has been a major change in the parser... (I still don't > > have Python 3.x installed) > > > > I believe is expanded to 8-spaces -- NOT TO NEXT MULTIPLE OF > > 8... > > A tab is *one* character. Your *editor* may show

RE: How to sort list of String without considering Special characters and with case insensitive

2012-11-27 Thread Prasad, Ramit
san wrote: > > Please let me know how to sort the list of String in either ascending / > descending order without considering > special characters and case. > ex: list1=['test1_two','testOne','testTwo','test_one'] > Applying the list.sort /sorted method results in sorted list ['test1_two', > 'te

RE: os.popen and the subprocess module

2012-11-27 Thread Prasad, Ramit
Andrew wrote: > > Hello world, > > I'm working on a script that will run an executable obtaine the output > from the executable > and do some analysis on the output. Essentially the script runs the > executable analyses > the data. > I'm looking into os.popen and the subprocess module, implement

RE: Getting a seeded value from a list

2012-11-26 Thread Prasad, Ramit
Chris Angelico wrote: > > On Sat, Nov 24, 2012 at 3:27 AM, Prasad, Ramit > wrote: > > Steven D'Aprano wrote: > >> > >> On Wed, 21 Nov 2012 14:41:24 +1100, Chris Angelico wrote: > >> > >> > However, this still means that the player

RE: Problem with subprocess.call and windows schtasks

2012-11-23 Thread Prasad, Ramit
Dave Angel wrote: > > On 11/20/2012 06:41 PM, Tom Borkin wrote: > > (Please don't top-post. Now we lose all the context) > > Using shlex, I now have this: > > #!\Python27\python > > import os, subprocess > > path = os.path.join("C:\\", "Program Files", "Apache Group", "Apache2", > > "htdocs", "c

RE: Getting a seeded value from a list

2012-11-23 Thread Prasad, Ramit
Steven D'Aprano wrote: > > On Wed, 21 Nov 2012 14:41:24 +1100, Chris Angelico wrote: > > > However, this still means that the player will see the exact same level > > regenerated every time, absolutely fresh. As previously stated in this > > thread, that's not usually a good thing for encounters,

RE: Choosing Source Address to Bind Socket to in IMAP Client

2012-11-20 Thread Prasad, Ramit
brint...@controlledthinking.com wrote: > > On Tuesday, November 20, 2012 2:41:58 PM UTC-8, Prasad, Ramit wrote: > > brintoul at controlledthinking.com wrote: > > > > Apologies, I misread your question. > > > > According to the imaplib docs, you can subclass IM

RE: Choosing Source Address to Bind Socket to in IMAP Client

2012-11-20 Thread Prasad, Ramit
brint...@controlledthinking.com wrote: > > > I have a multihomed machine that I would like to run the Python imaplib's > > > IMAP4 client on. I would like to be > > > able to specify which interface the underlying socket will bind to as its > > > source address. How could I best do > > > this?

RE: Choosing Source Address to Bind Socket to in IMAP Client

2012-11-20 Thread Prasad, Ramit
brint...@controlledthinking.com wrote: > > Hello: > > I have a multihomed machine that I would like to run the Python imaplib's > IMAP4 client on. I would like to be > able to specify which interface the underlying socket will bind to as its > source address. How could I best do > this? One

RE: 10 sec poll - please reply!

2012-11-20 Thread Prasad, Ramit
Steven D'Aprano wrote: > > On Tue, 20 Nov 2012 07:18:42 -0800, Michael Herrmann wrote: > > > Thanks again for your further replies. So far, it's 4 votes for > > 'send_keys' and 1 vote for 'type'. > > > > Regarding 'send_keys': To me personally it makes sense to send keys _to_ > > something. Howev

RE: Problem with list.remove() method

2012-11-20 Thread Prasad, Ramit
Alvaro Combo wrote: > > Hi All, > > I'm relatively new to Python... but I have found something I cannot > explain... and I'm sure you can help me. > > I have the following function that serves for removing the duplicates from a > list... It's a simple and (almost) > trivial task. > > I'm usi

RE: Index Error

2012-11-20 Thread Prasad, Ramit
Can you please post in plain text and stop top-posting? Thanks. inshu chauhan wrote: > > def distance(c, p): >     dist = sqrt( >     ((c[0]-p[0])**2) + >     ((c[1]-p[1])**2) + >     ((c[2]-p[2])**2) >     ) >     return dist > > > def GenerateRing(x,y, N): Gen

RE: Python Interview Questions

2012-11-19 Thread Prasad, Ramit
Roy Smith wrote: > > OK, I've just read back over the whole thread. I'm really struggling to > understand what point you're trying to make. I started out by saying: > > > Use a list when you need an ordered collection which is mutable (i.e. > > can be altered after being created). Use a tuple

RE: xml data or other?

2012-11-19 Thread Prasad, Ramit
Artie Ziff wrote: > > On 11/9/12 5:50 AM, rusi wrote: > > On Nov 9, 5:54 pm, Artie Ziff wrote: > > # submit correctedinput to etree > I was very grateful to get the "leg up" on getting started down that > right path with my coding. Many thanks to you, rusi. I took your > excellent advices and hav

RE: Printing characters outside of the ASCII range

2012-11-09 Thread Prasad, Ramit
danielk wrote: > > The database I'm using stores information as a 3-dimensional array. The > delimiters between elements are > chr(252), chr(253) and chr(254). So a record can look like this (example only > uses one of the delimiters for > simplicity): > > name + chr(254) + address + chr(254) +

RE: How to print python commands automatically?

2012-11-09 Thread Prasad, Ramit
Peng Yu wrote: > > > Is this what you want? > > http://docs.python.org/2/library/trace.html > > I'm not able to get the mixing of the python command screen output on > stdout. Is there a combination of options for this purpose? > > ~/linux/test/python/man/library/trace$ cat main1.py > #!/usr/bin

RE: problem with module PyVisa

2012-11-09 Thread Prasad, Ramit
Jean Dubois wrote: > > On 9 nov, 17:40, Rodrick Brown wrote: > > It seems pretty obvious from the error. Try installing the missing lib > > packages. > > > > OSError: /usr/local/vxipnp/linux/bin/libvisa.so.7: cannot open shared > > object file: No such file or directory > > > > Sent from my iPho

RE: Multi-dimensional list initialization

2012-11-09 Thread Prasad, Ramit
Dennis Lee Bieber wrote: > > On Fri, 9 Nov 2012 17:07:09 +1100, Chris Angelico > declaimed the following in gmane.comp.python.general: > > > On Fri, Nov 9, 2012 at 12:39 PM, Mark Lawrence > > wrote: > > > On 07/11/2012 01:55, Steven D'Aprano wrote: > > >> > > >> > > >> Who knows? Who cares? No

RE: Python3.3 str() bug?

2012-11-09 Thread Prasad, Ramit
Chris Angelico wrote: > > What you really should be doing is not transforming the whole > structure, but explicitly transforming each part inside it. I > recommend you stop fighting the language and start thinking about your > data as either *bytes* or *characters* and using the appropriate data >

RE: duck typing assert

2012-11-09 Thread Prasad, Ramit
Andriy Kornatskyy wrote: > > Thank you for all comments. > > > It makes very good sense to say: > > > > duckmatch(IFoo).compare(Foo) > > Since we do duck match of IFoo... but there is no `duck match`, there is > `duck test`. I believe instead of > `compare` is more readable with `equals`. Than

RE: Writing game-state data...

2012-11-09 Thread Prasad, Ramit
Graham Fielding wrote: > > Hey, folks, me again! > > I've been puzzling over this for a while now: > > I'm trying to write data to a file to save the state of my game using the > following function: > > def save_game(): >     #open a new empty shelve (possibly overwriting an old one) to write

RE: Right solution to unicode error?

2012-11-08 Thread Prasad, Ramit
wxjmfa...@gmail.com wrote: > > Le jeudi 8 novembre 2012 19:49:24 UTC+1, Ian a écrit : > > On Thu, Nov 8, 2012 at 11:32 AM, Oscar Benjamin > > > > wrote: > > > > > If I want the other characters to work I need to change the code page: > > > > > > O:\>chcp 65001 > > > Active code page: 65001 > > >

RE: Right solution to unicode error?

2012-11-07 Thread Prasad, Ramit
Anders wrote: > > I've run into a Unicode error, and despite doing some googling, I > can't figure out the right way to fix it. I have a Python 2.6 script > that reads my Outlook 2010 task list. I'm able to read the tasks from > Outlook and store them as a list of objects without a hitch. But whe

RE: Multi-dimensional list initialization

2012-11-07 Thread Prasad, Ramit
Gregory Ewing wrote: > > Roy Smith wrote: > > Call by social network? The called function likes the object. > > Depending on how it feels, it can also comment on some of the object's > > attributes. > > And then finds that it has inadvertently shared all its > private data with other functions a

RE: How to only get a list of the names of the non-directory files in current directory ('.')?

2012-11-06 Thread Prasad, Ramit
iMath wrote: > how to get a list of names of everything in the current directory ? http://lmgtfy.com/?q=python+get+files+in+directory ~Ramit This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and

RE: Multi-dimensional list initialization

2012-11-06 Thread Prasad, Ramit
Andrew Robinson wrote: > > On 11/06/2012 01:04 AM, Steven D'Aprano wrote: > > On Mon, 05 Nov 2012 21:51:24 -0800, Andrew Robinson wrote: > > [snip] > > Q: What about other mutable objects like sets or dicts? > > A: No, the elements are never copied. > They aren't list multiplication comp

RE: Obnoxious postings from Google Groups

2012-11-06 Thread Prasad, Ramit
Steven D'Aprano wrote: > > On Tue, 06 Nov 2012 17:16:44 +0000, Prasad, Ramit wrote: > > >> To enter the newline, I typed Ctrl-Q to tell bash to treat the next > >> character as a literal, and then typed Ctrl-J to get a newline. > > > > That sounds

RE: who can give me some practical tutorials on django 1.4 or 1.5?

2012-11-06 Thread Prasad, Ramit
Levi Nie wrote: > > Who can give me some practical tutorials on django 1.4 or 1.5? > Thank you. Maybe this will help: http://gettingstartedwithdjango.com/resources/ ~Ramit This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sa

RE: Logging output to be redirected to a particular folder

2012-11-06 Thread Prasad, Ramit
Dennis Lee Bieber wrote: > > On Tue, 06 Nov 2012 13:26:11 +0100, Peter Otten <__pete...@web.de> > declaimed the following in gmane.comp.python.general: > > > anuradha.raghupathy2...@gmail.com wrote: [snip] > > > def main(): > > >logging.basicConfig(Filename='c://myapp.log', level=logging.ERRO

RE: Multi-dimensional list initialization

2012-11-06 Thread Prasad, Ramit
Ian Kelly wrote: > > On Tue, Nov 6, 2012 at 1:21 AM, Andrew Robinson > [snip] > > See if you can find *any* python program where people desired the > > multiplication to have the die effect that changing an object in one of the > > sub lists -- changes all the objects in the other sub lists. > >

RE: Obnoxious postings from Google Groups

2012-11-06 Thread Prasad, Ramit
Steven D'Aprano wrote: > > On Mon, 05 Nov 2012 14:47:47 -0500, Dennis Lee Bieber wrote: > [snip] > > Nevertheless, I do tend to prefer underscores to spaces, simply because I > often use naive tools that treat spaces as separators. That is, command > line shells. I visually prefer spaces but it

RE: Obnoxious postings from Google Groups

2012-11-06 Thread Prasad, Ramit
Grant Edwards wrote: > On 2012-11-05, Roy Smith wrote: > > In article , > > Chris Angelico wrote: > > > >> It's nothing to do with operating system. File names are names, and > >> spaces in them are seldom worth the hassle unless you manipulate those > >> files solely using a GUI. > > > > That's

RE: date and time comparison how to

2012-10-31 Thread Prasad, Ramit
Gary Herron wrote: > On 10/29/2012 04:13 PM, noydb wrote: > > All, > > > > I need help with a date and time comparison. > > > > Say a user enters a date-n-time and a file on disk. I want to compare the > > date and time of the file to the > entered date-n-time; if the file is newer than the enter

RE: how to change os.popen4 to subprocess

2012-10-30 Thread Prasad, Ramit
Replying to skyworld because I could not find the original message from MRAB. skyworld wrote: > On Oct 27, 11:02 am, MRAB wrote: > > On 2012-10-27 03:28, skyworld wrote:> Hi, > > > > > I'm new to python and I'm trying to porting some scripts from v0.96 to > > > v2.0.1. A piece of code is like thi

RE: better way for ' '.join(args) + '\n'?

2012-10-29 Thread Prasad, Ramit
Thomas Rachel wrote: > Am 26.10.2012 09:49 schrieb Ulrich Eckhardt: > > Hi! > > > > General advise when assembling strings is to not concatenate them > > repeatedly but instead use string's join() function, because it avoids > > repeated reallocations and is at least as expressive as any alternativ

RE: turn list of letters into an array of integers

2012-10-25 Thread Prasad, Ramit
David Hutto wrote: > On Wed, Oct 24, 2012 at 1:23 AM, seektime wrote: > > Here's some example code. The input is a list which is a "matrix" of > > letters: > >a b a > >b b a > > > > and I'd like to turn this into a Python array: > > > > 1 2 1 > > 2 2 1 > > > > so 1 replaces a, and

RE: resume execution after catching with an excepthook?

2012-10-25 Thread Prasad, Ramit
andrea crotti wrote: > 2012/10/25 Steven D'Aprano : > > On Wed, 24 Oct 2012 13:51:30 +0100, andrea crotti wrote: > > [snip] > > Without a try...except block, execution will cease after an exception is > > caught, even when using sys.excepthook. I don't believe that there is any > > way to jump back

RE: Appending a list using list obtained from a class

2012-10-25 Thread Prasad, Ramit
Demian Brecht wrote: > On 2012-10-24, at 8:00 AM, inshu chauhan wrote: > > > Yes, a Class method returns a list. I am trying to append this in main() to > > make another list. > > But the list i am getting after appending i showing addresses like this > > '<__main__.Point object at > 0x0254FAB0

RE: SQLAlchemy: How to do Table Reflection and MySQL?

2012-10-23 Thread Prasad, Ramit
Nick Sabalausky wrote: > On Mon, 22 Oct 2012 14:35:23 -0700 (PDT) > darnold wrote: > > > > i'm not brave enough to dig too deeply into SQLAlchemy, but maybe this > > will help? : > > > > http://kashififtikhar.blogspot.com/2010/07/using-sqlalchemy-reflection-with-pylons.html > > > > that came up fr

RE: regex function driving me nuts

2012-10-23 Thread Prasad, Ramit
MartinD wrote: > Hi, > > I'm new to Python. > Does someone has an idea what's wrong. I tried everything. The only regex > that is tested is the last one in a > whole list of regex in keywords.txt > Thanks! > Martin > > > > def checkKeywords( str, lstKeywords ): > > for regex in

RE: A desperate lunge for on-topic-ness

2012-10-22 Thread Prasad, Ramit
Roy Smith wrote: > Pet peeve of the day... > > Why do you have to write: > > global foo > foo = 4 > > when > > global foo = 4 > > would have been so much easier? To make it more annoying for people who use globals, duh. :) Ramit Prasad This email is confidential and subject to important dis

RE: Tkinter Create/Destory Button

2012-10-19 Thread Prasad, Ramit
bbbenrothsch...@gmail.com wrote: > I am trying to create a button in Tkinter and then when it is pressed delete > it/have it disappear. Does anyone > know the simplest script to do that with. Thanks for your help. Try http://www.gossamer-threads.com/lists/python/python/118851 . If you just want

RE: Is there a way to programmatically turn on remote registry?

2012-10-19 Thread Prasad, Ramit
Kevin Holleran wrote: > Hi, > > I have written a script to poll some registry values but remote registry is > turned off through GPO on the > network I need to run it against.  The account running the script is an admin > on these boxes.  Is there a way > for me to turn on remote registry for th

RE: Python does not take up available physical memory

2012-10-19 Thread Prasad, Ramit
Pradipto Banerjee wrote: > Thanks, I tried that. Still got MemoryError, but at least this time python > tried to use the physical memory. > What I noticed is that before it gave me the error it used up to 1.5GB (of > the 2.23 GB originally showed as > available) - so in general, python takes up m

RE: Python does not take up available physical memory

2012-10-19 Thread Prasad, Ramit
Chris Angelico wrote: > On Sat, Oct 20, 2012 at 4:08 AM, Pradipto Banerjee > wrote: > > I am trying to read a file into memory. The size of the file is around 1 GB. > > I have a 3GB memory PC and the Windows Task Manager shows 2.3 GB available > > physical memory when I was trying to read the fil

RE: Python does not take up available physical memory

2012-10-19 Thread Prasad, Ramit
Emile van Sebille wrote: > On 10/19/2012 10:08 AM, Pradipto Banerjee wrote: > > Hi, > > > > I am trying to read a file into memory. The size of the file is around 1 > > GB. I have a 3GB memory PC and the Windows Task Manager shows 2.3 GB > > available physical memory when I was trying to read the

RE: pip fails to install packages on moutain loin (Mac OS 10.8.2)

2012-10-18 Thread Prasad, Ramit
Peng Yu wrote > Hi, > > I installed Python using python-2.7.3-macosx10.6.dmg on my Mac OS > 10.8.2. > > When try to use pip to install packages, I get the following message. > Then the installation fails. > > gcc-4.2 not found, using clang instead > > > I then create a link from /usr/bin/gcc t

RE: len() on mutables vs. immutables

2012-10-18 Thread Prasad, Ramit
Ian Kelly wrote: > Sent: Thursday, October 18, 2012 2:39 PM > To: Python > Subject: Re: len() on mutables vs. immutables > > On Thu, Oct 18, 2012 at 1:18 PM, Prasad, Ramit > wrote: > > Why does pointer arithmetic work for dicts? I would think the position > > of

RE: len() on mutables vs. immutables

2012-10-18 Thread Prasad, Ramit
Terry Reedy wrote: > On 10/18/2012 1:23 PM, Demian Brecht wrote: > > > When len() is called passing an immutable built-in type (such as a > > string), I'd assume that the overhead in doing so is simply a function > > call and there are no on-call calculations done. Is that correct? > > See below.

RE: A desperate lunge for on-topic-ness

2012-10-18 Thread Prasad, Ramit
Hans Mulder wrote: > On 18/10/12 08:31:51, Steven D'Aprano wrote: > > On Thu, 18 Oct 2012 02:06:19 -0400, Zero Piraeus wrote: > >> 3. Say "well, at least it's not a backslash" and break the line using > >> > parentheses. > > I mostly do this. Since most lines include a bracket of some sort, I > > r

RE: OT Questions

2012-10-18 Thread Prasad, Ramit
David Hutto wrote: > On Wed, Oct 17, 2012 at 12:38 PM, Prasad, Ramit > wrote: > > David Hutto wrote: > >> On Wed, Oct 17, 2012 at 2:06 AM, Demian Brecht > >> wrote: [snip] > > > The question is whose opinion matters. Yours? Mine? Others? Personally, >

RE: OT Questions

2012-10-18 Thread Prasad, Ramit
David Hutto wrote: > On Wed, Oct 17, 2012 at 7:12 PM, Steven D'Aprano > wrote: > > On Wed, 17 Oct 2012 18:05:12 -0400, Dwight Hutto wrote: > > > >> this was just a confidence statement that I'm > >> intelligent as well, so don't get uppity with me. > > > > Please tone down the aggression. > > > >

RE: A desperate lunge for on-topic-ness

2012-10-18 Thread Prasad, Ramit
Chris Angelico wrote: > On Fri, Oct 19, 2012 at 3:13 AM, Neil Cerutti wrote: > > Though technology has moved along swiftly, keeping your code > > accessible to the guy using a crummy old console xterm might > > still be worthwhile, and it makes printouts easy to create. > > And keeping your inte

RE: A desperate lunge for on-topic-ness

2012-10-18 Thread Prasad, Ramit
Den wrote: > On Wednesday, October 17, 2012 11:06:43 PM UTC-7, Zero Piraeus wrote: > > : > > > > > > What are people's preferred strategies for dealing with lines that go > > > > over 79 characters? A few I can think of off the bat: > > > > I personally just keep typing until my statement is finis

RE: OT Questions

2012-10-17 Thread Prasad, Ramit
David Hutto wrote: > On Wed, Oct 17, 2012 at 2:06 AM, Demian Brecht wrote: > > * Your strength is not design. Using bevel and emboss (and a pattern here > > and there) does not constitute good > design. > > It's simplicity within a symbolism, and now that I need money for > medical reasons, the

RE: system tray or notification area in python

2012-10-16 Thread Prasad, Ramit
Daniel Fetchinson wrote: > >> Hi folks, > >> > >> I'm using a stand alone window manager without gnome or kde or any > >> other de. But I still would like to have a system tray or notification > >> area and so far used stalonetray for this. Stalonetray is written in C > >> and is a GTK application,

RE: Aggressive language on python-list

2012-10-16 Thread Prasad, Ramit
Steven D'Aprano wrote: > On Tue, 16 Oct 2012 09:27:48 -0700, rurpy wrote about trolls and dicks: > > > The best advise is to ignore such posts and encourage others to do the > > same. > > If you ignore such posts, how will the poster know they are unacceptable? > > How should somebody distinguis

RE: Tkinter how to access the widget by name

2012-10-15 Thread Prasad, Ramit
? wrote: > I'm a little teapot ... himself the question: if I want to appeal to the > widget, knowing his name... ? > > # appropriated the name of the widget > label = Label(frame, width = 40, text='text', name = 'name') > ... > name_='name' > configure(name_) > ... > def configure(n

RE: for-loop on cmd-line

2012-10-11 Thread Prasad, Ramit
Chris Angelico wrote: > On Fri, Oct 12, 2012 at 3:49 AM, Gisle Vanem wrote: > > wrote in comp.lang.python > > > > (my ISP no longer updates this group. Last message is from 8. April. > > Does the postings to the python mailing-list automatically get reposted to > > comp.lang.python?) > > Yes, c.

RE: RE: Unpaking Tuple

2012-10-09 Thread Prasad, Ramit
Bob Martin wrote > in 682592 20121008 232126 "Prasad, Ramit" wrote: > >Thomas Bach wrote:=0D=0A> Hi there,=0D=0A> =0D=0A> On Sat, Oct 06, 2012 at = > >03:08:38PM +, Steven D'Aprano wrote:=0D=0A> >=0D=0A> > my_tuple =3D my_= > >tuple[:4

RE: Unpaking Tuple

2012-10-08 Thread Prasad, Ramit
Thomas Bach wrote: > Hi there, > > On Sat, Oct 06, 2012 at 03:08:38PM +, Steven D'Aprano wrote: > > > > my_tuple = my_tuple[:4] > > a,b,c,d = my_tuple if len(my_tuple) == 4 else (my_tuple + (None,)*4)[:4] > > > > Are you sure this works as you expect? I just stumbled over the following: > >

RE: Insert item before each element of a list

2012-10-08 Thread Prasad, Ramit
Agon Hajdari wrote: > On 10/08/2012 11:15 PM, Prasad, Ramit wrote: > > Agon Hajdari wrote: > >> > >> On 10/08/2012 09:45 PM, Chris Kaynor wrote: > >>> [('insertme', i) for i in x] > >> > >> This is not enough, you have to merge it

RE: Insert item before each element of a list

2012-10-08 Thread Prasad, Ramit
Agon Hajdari wrote: > Sent: Monday, October 08, 2012 3:12 PM > To: python-list@python.org > Subject: Re: Insert item before each element of a list > > On 10/08/2012 09:45 PM, Chris Kaynor wrote: > > [('insertme', i) for i in x] > > This is not enough, you have to merge it afterwards. Why do you

RE: notmm is dead!

2012-10-05 Thread Prasad, Ramit
Steven D'Aprano wrote: > Sent: Thursday, October 04, 2012 7:22 PM > To: python-list@python.org > Subject: Re: notmm is dead! > > On Thu, 04 Oct 2012 14:10:46 -0400, Etienne Robillard wrote: > > > Dear list, > > > > Due to lack of energy and resources i'm really sad to announce the > > removal of

RE: final question: logging to stdout and updating files

2012-10-04 Thread Prasad, Ramit
Chris Angelico wrote: > Sent: Thursday, October 04, 2012 9:28 AM > To: python-list@python.org > Subject: Re: final question: logging to stdout and updating files > > On Fri, Oct 5, 2012 at 12:00 AM, Steven D'Aprano > wrote: > > That is *terrible* advice. But if you insist on following it, you can

  1   2   3   >