Re: [Tutor] Yet another list comprehension question

2007-03-02 Thread Andrei
gt; > > > doesn't work (not that I expected it to). > > Why not use a Set? > > s = Set([somefun(i) for i in some-iterator]) > Alternatively, you could put the results as keys in a dictionary, then request mydict.keys() to get a list of unique outcomes. Yours, An

Re: [Tutor] geeks like us and the rest of THEM

2007-03-03 Thread Andrei
ome webscraping if the files are not readily modifiable. Its setup is about 350 kB. In terms of installers, NSIS (with the package to make it look modern, instead of that awful default look - forgot its name) or InnoSetup are the usual suspects. NSIS has a smaller overhead, but an uglier langu

Re: [Tutor] dictionaries and memory handling

2007-03-03 Thread Andrei
articular time? Not as such. In your case, I think the task manager would be enough. You only have this one demanding data structure I assume, so in a rough approximation you can pretend that whatever the task manager reports (have a look at VM and peak memory usage columns, not just memory u

Re: [Tutor] Yet another list comprehension question

2007-03-03 Thread Andrei
.keys() ... [1,2,3,4] The set solution is the Most Obvious Way to do it, but the dict one doesn't require an understanding of list comprehensions. -- Yours, Andrei = Mail address in header catches spam. Real contact info: ''.join([''.join(s) for s in zi

Re: [Tutor] What/Why this Cookbook recipe?

2007-03-06 Thread Andrei
r 'Name: %s' string and he gives you 'Borkbork: %s' or whatever. The translation doesn't need to be modified if you decide to make a user class and get rid of the username and userage vars. - format strings give you more control, so you can e.g. specify how many digits

Re: [Tutor] What/Why this Cookbook recipe?

2007-03-08 Thread Andrei
ving to manually update who knows how many translations whenever you decide to rename a variable On the other hand, having the variable name in there may give the translator useful information about the way he should translate a string, as the translation may be in

Re: [Tutor] Developing a GUI application

2007-03-23 Thread Andrei
and my app is yet another CDROM > database program; more details available if it matters.) -- Yours, Andrei = Mail address in header catches spam. Real contact info: ''.join([''.join(s) for s in zip( "[EMAIL PROTECTED] pmfe!Pes ontuei ulcpss edtels,s hr' on

Re: [Tutor] Another parsing question

2007-03-31 Thread Andrei
yourself, movie stars, pets or other frivolities - flattering as it may be - will become problematic when a couple of months later you're wondering why the application crashes upon adding Fido to DarthVader, appending the result to ApplePie and writin

Re: [Tutor] Communication between classes

2007-04-01 Thread Andrei
es if you need getter/setter methods or simple attributes otherwise. In your case, I would not make __filename etc. 'private' (that's what the double underscore suggests), then write a getter method for it - just call it FileName and be done with it. Python idiom here is more flexi

Re: [Tutor] Communication between classes

2007-04-02 Thread Andrei
owHelp() else: fileop.Perform() Adding new operations would be a matter of implementing an appropriate class and adding it to the operations dictionary. With a bit of Python magic you could even get the operation classes to auto-register, so just writing an operation class would

Re: [Tutor] ConfigParser and multiple option names

2007-04-07 Thread Andrei
552211', '"/home/whoever"'), ('dir0.8258732656650.272559810163', '"/home/florian"'), ('dir0.6565224032210.703769464586', '"/home/john"')] Note that it will do this for *all* options in your file, even

[Tutor] read from standard input

2008-02-13 Thread Andrei Petre
Hello, I want to read from the standard input numbers until i reach a certain value or to the end of the "file". What is the simplest, straightforward, pythonic way to do it? a sketch of how i tried to do it: [code] while 1 < 2: x = raw_input() if type(x) != int or x == 11: break

[Tutor] crashed with Runtime Error: NZEC (non-zero exit code)

2008-02-24 Thread Andrei Petre
write(number) [/code] Any alternatives for the personal rambling(if it's a wrong way to do it, of course): L = [1,2,[3,4],[5,5]] for item in L: if type(item) == list: print L[item[0]], L[item[1]] else: print L[item] Thanks, Andrei import sys def write(numb

Re: [Tutor] crashed with Runtime Error: NZEC (non-zero exit code)

2008-02-27 Thread Andrei Petre
i'm thinking the same way Eric do. On Wed, Feb 27, 2008 at 11:18 PM, Eric Brunson <[EMAIL PROTECTED]> wrote: > Alan Gauld wrote: > > "bob gailer" <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote > > > > i don't really understand that. you are trying to say that the > tests > from the online judge

[Tutor] tokenizing a simple string with split()

2007-03-31 Thread Andrei Petre
n may consist of multiple characters". But I cannot figured out why this simple example not working: s = "spam;egg mail" s.split("; ") output: ['spam;egg mail'] instead of ['spam', 'egg', 'mail'] any suggestion is welcome, andre

Re: [Tutor] Creating Sudoku

2008-04-07 Thread Andrei Petre
A good place to look at : http://www.norvig.com/sudoku.html On Mon, Apr 7, 2008 at 6:53 PM, Luke Paireepinart <[EMAIL PROTECTED]> wrote: > W W wrote: > > On 4/7/08, Luke Paireepinart <[EMAIL PROTECTED]> wrote: > > > >> W W wrote: > >> What are you talking about? I don't understand what you mean

Re: [Tutor] Help Learn python - Step by Step

2015-05-09 Thread Andrei Colta
Thanks for sharing, will try it. Cheers, Andrei On 9 May 2015 15:45, "Nym City" wrote: > I am on the same boat. I have tried using online sites like codeacademy > and courses on courser but now I am starting with this new book called > "Automate The Boring Stuff with

[Tutor] Practice Exercises for Beginner ?

2016-06-02 Thread Andrei Colta
Hi, Anyone can recommend practical work on learning python.. seems reading and reading does not helping. Thanks in advance, Andrei ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman

Re: [Tutor] Practice Exercises for Beginner ?

2016-06-03 Thread Andrei Colta
hi guys, Thanks all for input, if anything else.. please let me know. cheers, Andrei > On 03 Jun 2016, at 11:14, Alan Gauld via Tutor wrote: > > On 02/06/16 21:43, Andrei Colta wrote: >> Hi, >> >> Anyone can recommend practical work on learning python.. seems readi

<    1   2