Re: Python dictionaries are awesome

2012-11-26 Thread Dave Angel
On 11/26/2012 09:32 PM, Steven D'Aprano wrote: > ... especially when you consider how some other languages implement them. > > > http://twistedoakgames.com/blog/?p=925 > > [quote] > Here’s the hypothetical situation: you’re making a flash game. In that > game users can create named profiles. You s

Re: How to pass class instance to a method?

2012-11-26 Thread Dave Angel
On 11/26/2012 11:10 PM, Steven D'Aprano wrote: > On Mon, 26 Nov 2012 22:14:59 -0500, Dave Angel wrote: > >> On 11/26/2012 05:18 PM, Steven D'Aprano wrote: >>> On Mon, 26 Nov 2012 16:58:47 -0500, Dave Angel wrote: >>> In a statically typed language, the valid types are directly implied by

Re: How to pass class instance to a method?

2012-11-26 Thread Roy Smith
Steven D'Aprano wrote: > Given the practical reality that documentation is often neglected, there > is a school of thought that says that *code* is the One True source of > information about what the code does, that documentation is at best a > hint or at worst completely redundant. Yes, there

Re: How to pass class instance to a method?

2012-11-26 Thread Steven D'Aprano
On Mon, 26 Nov 2012 22:14:59 -0500, Dave Angel wrote: > On 11/26/2012 05:18 PM, Steven D'Aprano wrote: >> On Mon, 26 Nov 2012 16:58:47 -0500, Dave Angel wrote: >> >>> In a statically typed language, the valid types are directly implied >>> by the function parameter declarations, while in a dynamic

Re: Compare list entry from csv files

2012-11-26 Thread Dave Angel
On 11/26/2012 05:27 PM, Anatoli Hristov wrote: > I understand, but in my case I have for sure the field "Name" in the > second file that contains at least the first or the last name on it... > So probably it should be possible:) > The Name "Billgatesmicrosoft" contains the word "Gates" so logically

Re: How to pass class instance to a method?

2012-11-26 Thread Dave Angel
On 11/26/2012 05:18 PM, Steven D'Aprano wrote: > On Mon, 26 Nov 2012 16:58:47 -0500, Dave Angel wrote: > >> In a statically typed language, the valid types >> are directly implied by the function parameter declarations, while in a >> dynamic language, they're defined in the documentation, and only

Re: How to pass class instance to a method?

2012-11-26 Thread Dave Angel
On 11/26/2012 06:07 PM, Ian Kelly wrote: > On Mon, Nov 26, 2012 at 2:58 PM, Dave Angel wrote: >> Not how I would put it. In a statically typed language, the valid types >> are directly implied by the function parameter declarations, > As alluded to in my previous post, not all statically typed la

Python dictionaries are awesome

2012-11-26 Thread Steven D'Aprano
... especially when you consider how some other languages implement them. http://twistedoakgames.com/blog/?p=925 [quote] Here’s the hypothetical situation: you’re making a flash game. In that game users can create named profiles. You store the profiles, keyed by their name, so that you ca- OOP

Re: Re: Managing multiple packages

2012-11-26 Thread Evan Driscoll
On 11/22/2012 06:22 PM, Thomas Bach wrote: I am using virtual environments and do a python setup.py develop on each package. This just creates a symbolic link to the package and all edits show up immediately. That's awesome; I didn't know about the 'develop' command. Thanks! Is that just a s

Re: How to pass class instance to a method?

2012-11-26 Thread Drew
On Sunday, November 25, 2012 7:11:29 AM UTC-5, ALeX inSide wrote: > How to "statically type" an instance of class that I pass to a method of > other instance? > > > > I suppose there shall be some kind of method decorator to treat an argument > as an instance of class? > > > > Generally it

Re: Getting a seeded value from a list

2012-11-26 Thread Hans Mulder
On 26/11/12 21:17:40, Prasad, Ramit wrote: > 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 will see the exact s

Re: How to pass class instance to a method?

2012-11-26 Thread Hans Mulder
On 27/11/12 00:07:10, Ian Kelly wrote: > On Mon, Nov 26, 2012 at 2:58 PM, Dave Angel wrote: >> Not how I would put it. In a statically typed language, the valid types >> are directly implied by the function parameter declarations, > > As alluded to in my previous post, not all statically typed l

Re: How to pass class instance to a method?

2012-11-26 Thread Ian Kelly
On Mon, Nov 26, 2012 at 2:58 PM, Dave Angel wrote: > Not how I would put it. In a statically typed language, the valid types > are directly implied by the function parameter declarations, As alluded to in my previous post, not all statically typed languages require parameter type declarations to

Re: Compare list entry from csv files

2012-11-26 Thread Emile van Sebille
Anatoli Hristov wrote: I understand, but in my case I have for sure the field "Name" in the second file that contains at least the first or the last name on it... So probably it should be possible:) The Name "Billgatesmicrosoft" contains the word "Gates" so logically I might find a solution for i

Re: Compare list entry from csv files

2012-11-26 Thread Anatoli Hristov
I understand, but in my case I have for sure the field "Name" in the second file that contains at least the first or the last name on it... So probably it should be possible:) The Name "Billgatesmicrosoft" contains the word "Gates" so logically I might find a solution for it. Thanks On Mon, Nov 2

Re: How to pass class instance to a method?

2012-11-26 Thread Steven D'Aprano
On Mon, 26 Nov 2012 16:58:47 -0500, Dave Angel wrote: > In a statically typed language, the valid types > are directly implied by the function parameter declarations, while in a > dynamic language, they're defined in the documentation, and only > enforced (if at all) by the body of the function.

Re: Compare list entry from csv files

2012-11-26 Thread Dave Angel
On 11/26/2012 04:08 PM, Anatoli Hristov wrote: > Hello, > > I'm trying to complete a namebook CSV file with missing phone numbers > which are in another CSV file. > the namebook file is structured: > First name;Lastname; Address; City; Country; Phone number, where the > phone number is missing. > >

Re: How to pass class instance to a method?

2012-11-26 Thread Dave Angel
On 11/26/2012 03:51 PM, Ian Kelly wrote: > On Mon, Nov 26, 2012 at 9:56 AM, Nobody wrote: >> In a dynamically-typed language such as Python, the set of acceptable >> types for an argument is determined by the operations which the function >> performs on it. This is in direct contrast to a statical

Re: Regular expression for different date formats in Python

2012-11-26 Thread Miki Tebeka
On Monday, November 26, 2012 8:34:22 AM UTC-8, Michael Torrie wrote: > http://pypi.python.org/pypi/python-dateutil > ... > I don't believe the library is updated for Python 3 yet, sadly. dateutil supports 3.x since version 2.0. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pass class instance to a method?

2012-11-26 Thread Ian Kelly
On Mon, Nov 26, 2012 at 9:56 AM, Nobody wrote: > In a dynamically-typed language such as Python, the set of acceptable > types for an argument is determined by the operations which the function > performs on it. This is in direct contrast to a statically-typed language, > where the set of acceptab

Re: Getting a seeded value from a list

2012-11-26 Thread Chris Angelico
On Tue, Nov 27, 2012 at 7:17 AM, Prasad, Ramit wrote: > Hmm. I guess most of the games where I remember "regenerating" > enemies are a bit older. Chrono Trigger had enemies that > would regenerate if you left a map screen and came back, but > then again it seems more likely that the enemies were h

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 will see the exact same level > >> > regenerated every time, absol

Re: How to pass class instance to a method?

2012-11-26 Thread Nobody
On Sun, 25 Nov 2012 04:11:29 -0800, ALeX inSide wrote: > How to "statically type" an instance of class that I pass to a method of > other instance? Python isn't statically typed. You can explicitly check for a specific type with e.g.: if not isinstance(arg, SomeType): raise T

Re: Regular expression for different date formats in Python

2012-11-26 Thread Michael Torrie
On 11/26/2012 06:15 AM, undesputed.hack...@gmail.com wrote: > I am a beginner in python and need help with writing a regular > expression for date and time to be fetched from some html documents. Would the "parser" module from the third-party dateutil module work for you? http://pypi.python.org/p

Re: Migrate from Access 2010 / VBA

2012-11-26 Thread Michael Torrie
On 11/22/2012 08:19 PM, kgard wrote: > I am the lone developer of db apps at a company of 350+ employees. > Everything is done in MS Access 2010 and VBA. I'm frustrated with the > limitations of this platform and have been considering switching to > Python. I've been experimenting with the language

Re: how to pass "echo t | " input to subprocess.check_output() method

2012-11-26 Thread Miki Tebeka
> But i dont know how to pass the "echo t | " in subprocess.check_output while > calling a process. You need to create two subprocess and connect the stdout of the first to the stdin of the 2'nd. See http://pythonwise.blogspot.com/2008/08/pipe.html for a possible solution. -- http://mail.python

Regular expression for different date formats in Python

2012-11-26 Thread undesputed . hackerz
Hello Developers, I am a beginner in python and need help with writing a regular expression for date and time to be fetched from some html documents. In the following code I am walking through the html files in a folder called event and printing the headings with h1 tag using beautifulsoup. The

Re: how to pass "echo t | " input to subprocess.check_output() method

2012-11-26 Thread Kushal Kumaran
dacha...@gmail.com writes: > On Monday, 26 November 2012 16:32:22 UTC+5:30, Kushal Kumaran wrote: >> dacha...@gmail.com writes: >> >> >> >> > Hi all, >> >> > >> >> > I want to list the repositories in svn using python. For this i have used >> > below command, >> >> > " res = subprocess.che

Re: Migrate from Access 2010 / VBA

2012-11-26 Thread kagard
On Nov 25, 3:48 pm, Wolfgang Keller wrote: > > I am the lone developer of db apps at a company of 350+ employees. > > Everything is done in MS Access 2010 and VBA. I'm frustrated with the > > limitations of this platform and have been considering switching to > > Python. > > > I've been experiment

Re: how to pass "echo t | " input to subprocess.check_output() method

2012-11-26 Thread Duncan Booth
dacha...@gmail.com wrote: > Hi Duncan, > > I tried using --non-interactive --trust-server-cert, but the call > fails with error message, svn: E175002: OPTIONS of > 'https://127.0.0.1/svn/Repos': Server certificate verification failed: > certificate issued for a different hostname, issuer is not t

Re: how to pass "echo t | " input to subprocess.check_output() method

2012-11-26 Thread dachakku
On Monday, 26 November 2012 16:32:22 UTC+5:30, Kushal Kumaran wrote: > dacha...@gmail.com writes: > > > > > Hi all, > > > > > > I want to list the repositories in svn using python. For this i have used > > below command, > > > " res = subprocess.check_output(["svn.exe", "list", > > "Https:

Re: how to pass "echo t | " input to subprocess.check_output() method

2012-11-26 Thread dachakku
On Monday, 26 November 2012 16:22:42 UTC+5:30, Duncan Booth wrote: > dacha...@gmail.com wrote: > > > > > Hi all, > > > > > > I want to list the repositories in svn using python. For this i have > > > used below command, " res = subprocess.check_output(["svn.exe", > > > "list", "Https://127

Re: how to pass "echo t | " input to subprocess.check_output() method

2012-11-26 Thread Chris Rebert
On Nov 26, 2012 3:03 AM, "Kushal Kumaran" wrote: > dacha...@gmail.com writes: > > I want to list the repositories in svn using python. For this i have used below command, > > " res = subprocess.check_output(["svn.exe", "list", " Https://127.0.0.1:443/svn/Repos"], stderr=subprocess.STDOUT) " > > >

Re: how to pass "echo t | " input to subprocess.check_output() method

2012-11-26 Thread Kushal Kumaran
dacha...@gmail.com writes: > Hi all, > > I want to list the repositories in svn using python. For this i have used > below command, > " res = subprocess.check_output(["svn.exe", "list", > "Https://127.0.0.1:443/svn/Repos"], stderr=subprocess.STDOUT) " > > but it throws an exception, since it req

Re: how to pass "echo t | " input to subprocess.check_output() method

2012-11-26 Thread Duncan Booth
dacha...@gmail.com wrote: > Hi all, > > I want to list the repositories in svn using python. For this i have > used below command, " res = subprocess.check_output(["svn.exe", > "list", "Https://127.0.0.1:443/svn/Repos"], stderr=subprocess.STDOUT) > " > > but it throws an exception, since it req

Re: how to pass "echo t | " input to subprocess.check_output() method

2012-11-26 Thread Chris Rebert
On Nov 26, 2012 2:41 AM, wrote: > > Hi all, > > I want to list the repositories in svn using python. For this i have used below command, > " res = subprocess.check_output(["svn.exe", "list", " Https://127.0.0.1:443/svn/Repos"], stderr=subprocess.STDOUT) " > > but it throws an exception, since it r

how to pass "echo t | " input to subprocess.check_output() method

2012-11-26 Thread dachakku
Hi all, I want to list the repositories in svn using python. For this i have used below command, " res = subprocess.check_output(["svn.exe", "list", "Https://127.0.0.1:443/svn/Repos"], stderr=subprocess.STDOUT) " but it throws an exception, since it requires an user input to validate certifica

Re: How to pass class instance to a method?

2012-11-26 Thread Alain Ketterlin
ALeX inSide writes: > How to "statically type" an instance of class that I pass to a method > of other instance? Python does not do static typing. > I suppose there shall be some kind of method decorator to treat an > argument as an instance of class? Decorators are an option. Another is the u