Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-29 Thread emile
than the IBM mag-card system I started with, itself a step up from single use punch cards... Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] managing memory large dictionaries in python

2012-10-16 Thread emile
millions of file entries in a directory. If a filesystem based answer is sought, I'd consider generating 16-bit CRCs per key and appending the keys to the CRC named file, then pass those, sort and do the final counting. Emile ___ Tutor mai

Re: [Tutor] Doubt!

2012-10-23 Thread emile
und returns an empty string." HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to find reverse pair words in a list of Words that has to be accessed through a URL

2013-04-19 Thread emile
se of self paired words that aren't pairs. (pop,wow,mom,etc) I got 94 distinct pairs. Which is a better result than the 124.5 pairs I got the first pass through. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscriptio

Re: [Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread emile
On 12/23/2013 07:11 AM, Steven D'Aprano wrote: Are you now even a *tiny* bit moved to use a single space after full stops?) No. See http://www.heracliteanriver.com/?p=324 Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or c

Re: [Tutor] ValueError: could not convert string to float: '13,2'

2014-01-03 Thread emile
be aware that it could impact other parts of your porgram as well, particularly if this is a read in data set from a non-local region. Also, in places where commas are used as decimal points, it's also common to use periods as commas: >>> print

Re: [Tutor] run a python script from access form

2014-01-31 Thread emile
e's python distribution which includes Mark Hammond's windows extensions. Then read through the docs on com servers. It's been a while since I've done so, but I expect that should get you going. Emile ___ Tutor maillist - Tutor@pytho

Re: [Tutor] auto completion before initially running program

2014-01-31 Thread emile
than running the program I presume there is no way around this. Autocompletion is provided by the editor you're using. You'll need to place some more context around this question to get appropriate responses. Emile ___ Tutor maillist - T

Re: [Tutor] is an alias a variable

2014-01-31 Thread emile
, 09:35:42) [GCC 2.96 2731 (Red Hat Linux 7.1 2.96-85)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys as s >>> m = s >>> id(m) 1075446500 >>>

Re: [Tutor] for: how to skip items

2014-02-17 Thread emile
13:47:21) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> a100 = list(range(100)) >>> a100[::10] [0, 10, 20, 30, 40, 50, 60, 70, 80, 90] >>> HTH,

Re: [Tutor] Printing multi-line variables horizontally

2014-08-08 Thread emile
On 08/08/2014 01:50 AM, Greg Markham wrote: die_1 = """ .-. | | | o | | | `-'""" die_2 = """ .-. |o| | | |o| `-'""" I'll leave the cleanup as an exercise for you. HTH, Emile

Re: [Tutor] Printing multi-line variables horizontally

2014-08-08 Thread emile
On 08/08/2014 10:58 AM, emile wrote: On 08/08/2014 01:50 AM, Greg Markham wrote: die_1 = """ .-. | | | o | | | `-'""" die_2 = """ .-. |o| | | |o| `-'""" Not quite sure how this

Re: [Tutor] Searching in a file

2010-01-13 Thread Emile van Sebille
e I would need to get out of the loop. How about (untested): additionalLines = 3 remainingLines = 0 for line in file: if 'NEW' in line or remainingLines: mylist.append(line) if not remainingLines: remainingLines = additionalLines else: remainingLines -= 1

Re: [Tutor] length of a string? Advice saught

2010-01-27 Thread Emile van Sebille
n and save the trouble, or do AI need a witchdoctor here? Also consider that closing a connection before the buffer is fully flushed can cause loss of data. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opt

Re: [Tutor] hash value input

2010-01-29 Thread Emile van Sebille
plest possible one.] So, how does python do this? Start here... http://effbot.org/zone/python-hash.htm Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] imaplib command to delete messages

2010-02-27 Thread Emile van Sebille
98e86c1fd/884359798ce1e025?q=python+imaplib+delete+message) Emile What am I missing? Bill ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] getting diagonals from a matrix

2010-03-03 Thread Emile van Sebille
ii::sizeW+1][:ln]) result.append(FpuzzleLayout[ii::sizeW+1][:ln]) # now add in the reversed results for ii in result[:]: result.append("".join(reversed(ii))) # and the corners result.extend([puzzleLayout[0], puzzleLayout[-1], FpuzzleLayout[0],

Re: [Tutor] Opening a dos exe

2010-03-11 Thread Emile van Sebille
duler from www.mjtnet.com just for the windows automation tasks I run into (scripted from within python). There's also http://pypi.python.org/pypi/SendKeys/0.3, but at this point if I were to start over I'd look closely at http://www.rutherfurd.net/python/sen

Re: [Tutor] Problems with iterations and breaking loops.

2010-03-17 Thread Emile van Sebille
On 3/17/2010 8:02 AM Karjer Jdfjdf said... I'm having problems with iterations and loops. So I'm curious about the best Python-way to do iterations of lists (in if, while etc statements) and breaking of loops. I have a list of tuples with 2 values. I want to perform calculations on all of the

Re: [Tutor] Assertion Error

2010-03-18 Thread Emile van Sebille
On 3/17/2010 11:02 PM sitharak said... I tried this statement to store in RDF form This is too specialized for this list. I couldn't find a dedicated news group for this project, but there is an IRC support channel -- see http://en.wikipedia.org/wiki/RDFLib#Support HTH, Emile

Re: [Tutor] Efficiency and speed

2010-03-19 Thread Emile van Sebille
On 3/19/2010 9:41 AM James Reynolds said... OK, so starting here: def mcrange_gen(self, sample): lensample = len(sample) nx2 = self.nx1 nx2_append = nx2.append nx2_sort = nx2.sort nx2_reverse = nx2.reverse nx2_index = nx2.index nx2_remove = nx2.remove for s in ra

Re: [Tutor] Why this Difference in Importing NumPy 1.2 vs 1.4?

2010-03-26 Thread Emile van Sebille
;> Comments? Version specific variations of packages with dedicated mailing lists are likely beyond the scope of this group. I'd ask on the numpy list. See http://www.scipy.org/Mailing_Lists Emile -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (12

Re: [Tutor] "IOError: [Errno 32] Broken pipe" when running python with cron (alternatives?)

2010-03-28 Thread Emile van Sebille
/usr/local/bin/myscript.py and change cron to * * * * * someone /usr/local/bin/myscript.sh and see if that helps. Emile Error in sys.exitfunc: Traceback (most recent call last): File "/usr/lib/python2.6/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/usr/l

Re: [Tutor] automatic output file naming scheme

2010-03-28 Thread Emile van Sebille
On 3/28/2010 8:44 AM kevin parks said... okay. I got the subprocess bit to work and i have os walk doing its walk. But now for something i did not think about until i started to think about how to fit these two bits to work together. os walk is going to traverse my dirs from some given startin

Re: [Tutor] automatic output file naming scheme

2010-03-28 Thread Emile van Sebille
nctions you may find helpful: >>> os.path.split(sourcefile) ('/home/someone/somedir', 'foo01.aif') >>> os.path.basename(sourcefile) 'foo01.aif' >>> os.path.splitext(sourcefile) ('/home/someone/somedir/foo01', '.aif') >>>

Re: [Tutor] First extension

2010-03-28 Thread Emile van Sebille
cking http://pypi.python.org/pypi/setuptools I see links to the list at http://mail.python.org/pipermail/distutils-sig/ Those are the guys that will want this info and will most likely help you work through it. HTH, Emile I have taken the following steps already: 1. My path is set

Re: [Tutor] ask

2010-03-28 Thread Emile van Sebille
You're almost there it seems. HTH, Emile > > > I don't know what kind of translated output he need. I guess: > > 1. the name of the file containing the translated output is * > storyAmer.txt* and it is to located in a subdirectory off your cset1100py >

Re: [Tutor] how to change some words in a text file

2010-03-28 Thread Emile van Sebille
uot;ent" print newstr But the system said TypeError: 'type' object is unsubscriptable What's wrong? str is an unfortunate variable name choice -- try oldstr instead. What you've done is often called shadowing. I don't get the error her

Re: [Tutor] How do I find information about a Python object.

2010-03-30 Thread Emile van Sebille
On 3/30/2010 8:23 AM Mike Baker said... Random Googling shows that there are things like process identification numbers available - such as proc.pid. How do I find the other options? try dir(proc) or help(proc) for starters... Emile ___ Tutor

Re: [Tutor] constructor

2010-04-04 Thread Emile van Sebille
""" def __init__(self,name): print "A new critter has been born!" self.name = name def talk(self): print "\nHi. I'm %s, an instance of class Critter." % self.name # main crit1 = Critter('Polly&

Re: [Tutor] create a wrapper for a C program

2010-04-06 Thread Emile van Sebille
x27;t work... Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] ftp and python

2010-04-07 Thread Emile van Sebille
sting system. FTP is essentially a file transfer protocol designed and inteded to move data between systems. If what you're asking for is essentially how to do a cp (or copy on win??) from a remote machine you may want to look at "scp - secure copy (remote file copy program)

Re: [Tutor] Python Examples of processing MS Outlook

2010-04-21 Thread Emile van Sebille
dig into the spambayes code -- see http://spambayes.sourceforge.net/ Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] the binary math "wall"

2010-04-21 Thread Emile van Sebille
) as whole numbers and only convert upon presentation and your calculations will always be accurate for the source measurements taken. In accounting systems I've always keep dollar amounts in whole pennies for this same reason. Emile ___

Re: [Tutor] Binary search question

2010-04-23 Thread Emile van Sebille
10) d = dict(zip(a,a)) 5 in d Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Binary search question

2010-04-23 Thread Emile van Sebille
On 4/23/2010 2:21 PM Alan Gauld said... "Emile van Sebille" wrote It's expensive enough that for a list this size I'd convert it to a dict and use in on that. eg, a = range(10) d = dict(zip(a,a)) Surely that would depend on how often you do the search? If its a o

Re: [Tutor] Binary search question

2010-04-23 Thread Emile van Sebille
list 1/10th the size is a typo? Anyway, I think we're all on the same page. Nice benchmarks, btw. Regards, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] sqrt?

2010-04-25 Thread Emile van Sebille
r261:67515, Dec 5 2008, 13:58:38) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> def sqrt(x): return x**.5 ... >>> sqrt(4) 2.0 >>> sqrt(12) 3.4641016151377544

Re: [Tutor] Modify inherited methods

2010-04-28 Thread Emile van Sebille
t a correct statement. It wasn't the omitted case that exhibits the difference. When sub-classing, any methods omitted defer to the parent's version so the init from the dict parent happened. Emile ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Modify inherited methods

2010-04-28 Thread Emile van Sebille
On 4/28/2010 9:32 AM Walter Wefft said... Emile van Sebille wrote: On 4/28/2010 3:20 AM Walter Wefft said... You reiterate my point. To say that dict.__init__ can be omitted in a subclass's __init__ with no effect, is not a correct statement. It wasn't the omitted case that ex

Re: [Tutor] Python 2.5.4 - error in rounding

2010-05-21 Thread Emile van Sebille
es of issues after being bitten. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Recursion - Beginner

2010-05-28 Thread Emile van Sebille
x27;d need the code for getLeaves, which isn't here. It must have been provided to you somewhere... Emile getLeaves ( jenny ) [5,3,0,9] getLeaves ( joshua ) [15,17,19,11,13] I know its really simple, but I'm really new to this

Re: [Tutor] Misc question about scoping

2010-06-03 Thread Emile van Sebille
On 6/3/2010 8:50 AM Tino Dai said... Hi All, Is there a way to express this: isThumbnail = False if size == "thumbnail": isThumbnail = True like this: [ isThumbnail = True if size == "thumbnail" isThumbnail = False ] and the scoping extending to one lev

Re: [Tutor] Misc question about scoping

2010-06-04 Thread Emile van Sebille
ttle off the one-liners as part of the original coding effort, and only break it out when there's a need to -- I'm not striving to compact things into one-liners. BTW, doesn't dict(map(lambda x: (str(x[1]),x[0]),map(lambda

Re: [Tutor] What's the catch with ZopeDB?

2010-06-11 Thread Emile van Sebille
ible to recover the lost data, and I've a fair amount of experience recovering lost data even from unmountable partitions and drives that don't power up. I'm not opposed to the idea so I think I'd try it out, but those are issues I'd watch for. Emile _

Re: [Tutor] Repeat function until...

2010-06-23 Thread Emile van Sebille
time.sleep(n - (time.time()-start)) Watch out for this -- you may want to do time.sleep(n - max(0,(time.time()-start))) to avoid passing sleep a negative number which causes the big sleep... Emile ___ Tutor maillist - Tutor@python.org To unsubsc

Re: [Tutor] Use flag to exit? (OT - PEP 8 Gripe)

2010-06-25 Thread Emile van Sebille
ither put hash marks in or leave the blank lines out... Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Use flag to exit? (OT - PEP 8 Gripe)

2010-06-25 Thread Emile van Sebille
On 6/25/2010 9:08 AM Steve Willoughby said... On 25-Jun-10 08:23, Emile van Sebille wrote: On 6/25/2010 1:33 AM ALAN GAULD said... Copy and pasting is a PITA. Why would you want to copy and paste? Because it makes it easy to work on code. My preferred editor (TextPad) allows block

Re: [Tutor] endless loop

2010-07-05 Thread Emile van Sebille
nto filter will always result in [] (so a is always false) and will thereby cause the else clause never to be reached. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help return a pattern from list

2010-07-05 Thread Emile van Sebille
On 7/5/2010 4:19 PM Alan Gauld said... But for the specific case of file extensions the os.path.splitext() is a better solution. If, as the names suggest, the source is the file system, then I'd reach for glob. Emile ___ Tutor mai

Re: [Tutor] module for fingerprint and pictures

2010-07-12 Thread Emile van Sebille
do a demo for that app and then go commercial if my project impresses the client. What's the app going to do? Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] LOCATION ISSUES

2010-07-12 Thread Emile van Sebille
supposed to create thumbnails of picture in the directory where I saved my file. Which is what it will do when python is started from that directory. How are you starting python? Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] LOCATION ISSUES

2010-07-13 Thread Emile van Sebille
, navigate to the directory where the images are stored, and start python from there so that glob will find the files. HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman

Re: [Tutor] Global name not found, though clearly in use

2010-07-14 Thread Emile van Sebille
st() #-End File test.py- Output: in class Test in __main__ in def test in class Test.__init__ - As you can see, the print statements at the class level are executing when encountered, but the prints in defs only when executed. HTH, Emile __

Re: [Tutor] Searching a text file's contents and comparing them to a list

2010-07-14 Thread Emile van Sebille
(): if line in aisle_one: So it's failing this test. print "success" else: print "no joy" Try adding some debugging code here, maybe changing the print to: print "no joy matching %s" % line Then read up on readlines and strin

Re: [Tutor] Searching a text file's contents and comparing them to a list

2010-07-14 Thread Emile van Sebille
On 7/14/2010 9:22 AM Eric Hamiter said... Fantastic! I have this, which now works. Is there a better place to put string.strip? I might make the changes below, but there's nothing wrong with the way you've got it. aisle_one = ["chips", "bread", "pretzels", "magazines"] grocery_list = open

Re: [Tutor] Global name not found, though clearly in use

2010-07-14 Thread Emile van Sebille
ave that done within a class definition and I expect it shouldn't be there. HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Global name not found, though clearly in use

2010-07-14 Thread Emile van Sebille
g more specific than "stream processing" and "*file" pointers hinting at serial processing of the source py file. I also found this interesting (but possibly not to newbies :) : http://www.shinetech.com/attachments/108_python-language-internals.pdf Emile _

Re: [Tutor] How to deal failed function and 0xDEADBEEF type errors...

2010-07-15 Thread Emile van Sebille
ameters to your print statement. HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] append, list and variables

2010-07-15 Thread Emile van Sebille
for eachline in opened(sourcefilename): if line.startswith('@'): append [sourcefilename, line] to result # print it for eachline in result: print eachline ---- Hope this gets you going, Emile ___ Tutor maillist - Tutor@

Re: [Tutor] append, list and variables

2010-07-16 Thread Emile van Sebille
n empty data storage container for use within the processing loop -- if it wasn't defined before use, you'd get an error the first time you tried to append to it. There's some good info in the tutorial -- see http://docs.python.org/tutorial/datastructures.html for details. Emile

Re: [Tutor] Decorator listing

2010-07-27 Thread Emile van Sebille
r than in any position of the line. IE, instead of something like: if "@" in line: ...try something more like: if line.strip().startswith("@"): This way you won't pick up the email addresses at all, and won't subsequentl

Re: [Tutor] Distributing Python Code for Commercial Porpoises?

2010-08-06 Thread Emile van Sebille
where to put new *.py modules you send him, run through it, and you're done. A little education will likely go a lot further than delving deeper into heavier technologies in an attempt to 'simplfy'. HTH, Emile ___ Tutor maillis

Re: [Tutor] Distributing Python Code for Commercial Porpoises?

2010-08-07 Thread Emile van Sebille
a try. Or try one of the free versions of Komodo or Wing. HTH, Emile http://downloads.activestate.com/ActivePython/releases/2.6.5.14/ActivePython-2.6.5.14-win32-x86.msi http://sourceforge.net/projects/numpy/files/NumPy/1.5.0b1/numpy-1.5.0b1-win32-superpack-python2.6.exe/download http://so

Re: [Tutor] import errors

2010-08-11 Thread Emile van Sebille
;>> import sys >>> for ii in sys.path: ii ... '' '/usr/lib/python24.zip' '/usr/lib/python2.4' '/usr/lib/python2.4/plat-linux2' '/usr/lib/python2.4/lib-tk' '/usr/lib/python2.4/lib-dynload' &

Re: [Tutor] Need help understanding output...

2010-08-11 Thread Emile van Sebille
itive test when you have this kind of issue. Then you might have written: if nummer == reeks[-1] and nummer == reeks[-2]: print "it's the same as the prior two" else: reeks.append(nummer) HTH, Emile reeks.append(nummer) else: print 'Nummer: ', nummer, 'is g

Re: [Tutor] Question about Dictionaries

2010-08-16 Thread Emile van Sebille
d maintain a second index allowing instant access to the keys associated with a specific value. HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Moving from Python 2.5.4 to 2.5.2?

2010-08-16 Thread Emile van Sebille
;re in the same sub-version (2.5) I agree. 2.5.4 is a bug release for the 2.5 series and by decree may not introduce backward incompatibilities of any kind. If there's a compatibility issue, please provide details so it can be verified as it ought to be re

Re: [Tutor] Question about Dictionaries

2010-08-16 Thread Emile van Sebille
. HTH, Emile Something along these lines: class myDict(dict): def __init__(self): self.altKeys = {} def __setitem__(self,ky,val): self.altKeys[val]=ky return dict.__setitem__(self, ky,val) def lookup(self,ky): return self.altKeys[ky] a = myDict

Re: [Tutor] List comprehension for dicts?

2010-08-19 Thread Emile van Sebille
if cond: result.append(ii) Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Overloaded Brackets

2010-08-20 Thread Emile van Sebille
ight be an interesting example to parse. Regards, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] monodevelop 2.2

2010-08-21 Thread Emile van Sebille
onoDevelop 2.2 for Python under Ubuntu. IT'S AMAZING!" http://www.daniweb.com/forums/thread286328.html So, sounds like a yes to me. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.py

Re: [Tutor] Function object

2010-08-25 Thread Emile van Sebille
ble ii is %s-%s" % (ii,ii) ... >>> for funcobj in (test1,test2): funcobj('spam') ... single ii is spam double ii is spam-spam >>>for funcobj in (test1,test2): test(funcobj) ... my name is test1 my name is test2 Once defined, code is an object. try dir(test) o

Re: [Tutor] Function object

2010-08-25 Thread Emile van Sebille
On 8/25/2010 10:56 AM Emile van Sebille said... >>> def test1(ii): print "my name is %s" % ii.func_name ... Oops -- my bad editing s/b or once was: def test1(ii): print "single ii is %s" % ii ___ Tutor mai

Re: [Tutor] exercise problem

2010-08-26 Thread Emile van Sebille
e doctests above I think that u is the name of the new list and v is the number which represent the number which must be eveluated. No. u,v are the parameters names for the two lists of numbers of the same length. So in the example add_vectors([1, 0], [1, 1]), u will take on the value [1,

Re: [Tutor] Serial communication ...

2010-09-13 Thread Emile van Sebille
t? You'll probably get better answers directly from there than here. HTH, Emile class SerialDevice(Serial): def __init__(self,port): Serial.__init__(self) self.port = port self.baudrate = 57600 self.bytesize = EIGHTBITS self.parity

Re: [Tutor] What's the best way to ask forgiveness here?

2010-09-13 Thread Emile van Sebille
ingle operation when the dir will only need to be created a single time (and then may be written to several hundred times) is pretty wasteful. Agreed -- if it's in a loop, you'd want to only check once. Of course, if the directory is eg an nfs share, continued access could be an issue.

Re: [Tutor] Comparing two lists

2010-09-16 Thread Emile van Sebille
ii for jj in alist for ii in blist if jj in ii ] ['column0label', 'column1label', 'dimension0guid'] Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why are arguments sometimes on the left side?

2010-09-20 Thread Emile van Sebille
a [1, 2, 3] >>> extend(a,[4,5,6]) >>> a [1, 2, 3, 4, 5, 6] >>> Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why are arguments sometimes on the left side?

2010-09-20 Thread Emile van Sebille
On 9/20/2010 9:54 AM Joel Goldstick said... That's pretty creative I think, but not sure its quite on the mark for beginners? ;) With this one fitting into context so easily, it seemed appropriate. Emile ___ Tutor maillist - Tutor@python.o

Re: [Tutor] trouble with a small Tkinter example

2010-09-21 Thread Emile van Sebille
#x27;ve got you assembling the program from bits and pieces as it's presented and reviewed. Can you post your program as you've reassembled it so we can see what's actually coded? Emile ___ Tutor maillist - Tutor@python.org To unsu

Re: [Tutor] trouble with a small Tkinter example

2010-09-21 Thread Emile van Sebille
27;) Using this form of the line, canvas.create_line(xstart, ystart, xend, yend, fill="red") seems to do it, although I can't say what versions allowed the author to (apparently successfully) write canvas.draw_line(xstart, y

Re: [Tutor] __import__()

2010-09-23 Thread Emile van Sebille
e" and not as "Return the dictionary holding the current global symbol table" so the fact that it works on may version (and perhaps all others) doesn't mean it'll work everywhere. HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] filling 2d array with zeros

2010-09-27 Thread Emile van Sebille
On 9/27/2010 10:54 AM Alex Hall said... What is wrong with the following line? self.am=[[(a,b) for a in range(len(self.lines)) a=0] for b in range(len(self.lines)) b=0] The a=0 and b=0 -- what do you think they're doing? Emile ___

Re: [Tutor] if value in list of dictionaries

2010-09-27 Thread Emile van Sebille
bove to append it to the end: for index, row in enumerate(topics.get_rows()): if row[0] != 'other': options.append({'name': row[0], 'value': MSG(row[1])}) HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] pyMVPA and OSError

2010-09-28 Thread Emile van Sebille
ecific packages and related dependencies are rarely an area of expertise outside the users of the package. Join the mailing list. See http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa HTH, Emile my operating system is Mac Leopard (i get a depracation warning when I try to

Re: [Tutor] if value in list of dictionaries

2010-09-28 Thread Emile van Sebille
e'] #then sort it topics.sort(key=sortOtherToEnd) But, generally, I'd stop once I got it going without worrying too much about 'better' ways -- that's a subjective measure. There is often one obvious way to do it, but unless you've seen that way before, ther

Re: [Tutor] if value in list of dictionaries

2010-09-28 Thread Emile van Sebille
On 9/28/2010 9:37 AM Norman Khine said... thank you, here is the updated version: http://pastie.org/1186860 The only obvious redundancy is the duplicated sort of options just before the return. You only need the newer sort_key based one. Emile

Re: [Tutor] if value in list of dictionaries

2010-09-28 Thread Emile van Sebille
ead of invoking: options = BusinessType().get_options() You'd write: options = BusinessType('topics.cvs').get_options() Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Doubly linked list

2010-09-30 Thread Emile van Sebille
x27;ll find a lot of useful info working the tutorial. HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using contents of a document to change file names

2010-10-02 Thread Emile van Sebille
ur second files contents as a first step to facilitate the subsequent lookups. You haven't included any code and we can't gauge how far along you are, so follow up and post the code you write as you go and we'll be better able to help out. Hope this is enough to get you started, Em

Re: [Tutor] function error

2010-10-02 Thread Emile van Sebille
syntax Is that all of your code? it seems to be cut off Do you see it now? Your reply contained the 10 ten lines or so of code that follows. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] function error

2010-10-02 Thread Emile van Sebille
On 10/2/2010 10:45 AM Steve Willoughby said... On 02-Oct-10 10:32, Emile van Sebille wrote: Well, not really -- this is the OPs code. I was responding to Joel's comment of not seeing the entire post. File "my_turtle.py", line 19 if (abs(turtle.position()[0]) > turtle.win

Re: [Tutor] how to learn python from scratch, (for simpe people)?

2010-10-02 Thread Emile van Sebille
x.html Finally, i'd suggest you start with python2 (vs python3) -- most of the info you'll find on the net is python2 and not always up to date for python3. Good luck! Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change s

Re: [Tutor] how to learn python from scratch, (for simpe people)?

2010-10-02 Thread Emile van Sebille
On 10/2/2010 4:21 PM Emile van Sebille said... On 10/2/2010 8:22 AM a a said... Now my questions: 1) Is python enough and complete to build a simple program of the kind deskribed above? Yes 2) Will I be able to build standalone program with it? Yes Sorry - Forget to answer your

Re: [Tutor] Downloading data from web

2010-10-04 Thread Emile van Sebille
://www.crummy.com/software/BeautifulSoup/ Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to extract data only after a certain condition is met

2010-10-06 Thread Emile van Sebille
-big-is-over-200Mb-ish-ly y'rs, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to extract data only after a certain condition is met

2010-10-06 Thread Emile van Sebille
On 10/6/2010 11:58 AM Joel Goldstick said... On Wed, Oct 6, 2010 at 2:50 PM, Emile van Sebille wrote: On 10/6/2010 9:25 AM Eduardo Vieira said... Of course this solution is simpler: extracted = a[a.index("i")+1:] But I didn't want to build a list in memory with "read

Re: [Tutor] WRITING XLS FROM OS.WALK()

2010-10-08 Thread Emile van Sebille
appending its members to allfiles can be done more simply with append, so where you're saying: filelist = [... you could say allfiles.extend([... and forget about filelist entirely. HTH, Emile ___ Tutor maillist - Tutor@pytho

Re: [Tutor] WRITING XLS FROM OS.WALK()

2010-10-09 Thread Emile van Sebille
On 10/8/2010 8:55 PM Steven D'Aprano said... I'm sorry to tell you that you've just reinvented the wheel. This was already solved, a long, long time ago. It is called the glob module: Only if glob now descends into the file system... which is why you'd choose os.w

  1   2   3   4   5   6   >