[Tutor] Comparing two CSV filess using Python

2015-02-12 Thread andy van
Hi, I'm trying to compare two CSV files (and many more like these below). I tried many ways, using lists, dictreader and more but nothing gave me the output I require. I want to compare all those rows that have same !Sample_title and !Sample_geo_accession values (whose positions vary). I've been

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

2013-12-23 Thread Andy McKenzie
life. Good luck to all of you, and I hope your lives are pleasant. And I hope those of you who don't currently know learn how to treat people politely. Andy McKenzie On Mon, Dec 23, 2013 at 10:11 AM, Steven D'Aprano st...@pearwood.infowrote: On Mon, Dec 23, 2013 at 12:59:15PM +, Mark

Re: [Tutor] Beginner Question

2013-10-22 Thread Andy McKenzie
address. That was a lot more readable and a lot more concise than something like first_ip( 1.2.3.0/24). I hope this helps! Andy ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo

Re: [Tutor] global variables

2013-08-22 Thread Andy McKenzie
GUIs prove that OOP is bad is, frankly, illogical at best and stupid at worst. I strongly suspect that either the speaker they were listening to wasn't clear, or they weren't clear. Either that, or the speaker or whoever you were talking to mis-represented their ability level. Andy

Re: [Tutor] [OT] Replies go to individuals, not the list?

2013-08-20 Thread Andy McKenzie
be receiving the reply. I've never understood it, even after reading the arguments in favor. Andy ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] [OT] Replies go to individuals, not the list?

2013-08-20 Thread Andy McKenzie
On Tue, Aug 20, 2013 at 2:53 PM, Alan Gauld alan.ga...@btinternet.comwrote: On 20/08/13 13:15, Andy McKenzie wrote: Yep. Someone decided it didn't make sense for reply to go to the list that sent the message Lists never send messages. People do. So reply goes to the *person* who sent

Re: [Tutor] [OT] Replies go to individuals, not the list?

2013-08-20 Thread Andy McKenzie
one thing, I like another. If you want to present your view rationally and objectively, or talk about your preferred layouts, that's fine. But let's not start saying someone has bad habits because they disagree with you. Andy ___ Tutor maillist - Tutor

[Tutor] Multiple search and replace?

2013-05-02 Thread Andy McKenzie
. Thanks, Andy McKenzie ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] multiple versions of python on windows?

2013-04-22 Thread Andy McKenzie
might give Eclipse/PyDev a try. -Andy On Mon, Apr 22, 2013 at 2:42 AM, Jim Mooney cybervigila...@gmail.comwrote: On 21 April 2013 22:47, School northri...@s.dcsdk12.org wrote: You can install multiple versions. The programs use the version they were assigned to, so there shouldn't be any

[Tutor] Hello, and a newbie question

2013-04-16 Thread Andy McKenzie
to follow standards. Should I just start out with the tutorial from docs.python.org? I would assume that that would start putting me in the right habits from the beginning... is that accurate, or is there a better way to go? Thanks in advance, Andy McKenzie

Re: [Tutor] Hello, and a newbie question

2013-04-16 Thread Andy McKenzie
On Tue, Apr 16, 2013 at 4:18 PM, Dave Angel da...@davea.name wrote: On 04/16/2013 11:58 AM, Andy McKenzie wrote: Hey folks. I'm just starting to pick up Python, and I'd like to avoid some of the mistakes I made in the past. To elaborate on that, my primary programming/scripting experience

Re: [Tutor] Hello, and a newbie question

2013-04-16 Thread Andy McKenzie
On Tue, Apr 16, 2013 at 5:31 PM, Dave Angel da...@davea.name wrote: On 04/16/2013 05:20 PM, Andy McKenzie wrote: SNIP Thanks for the advice, folks. Given that it looks like the biggest changes are unicode handling (which I'm not going to need any time soon) and the way

Re: [Tutor] Hello, and a newbie question

2013-04-16 Thread Andy McKenzie
On Tue, Apr 16, 2013 at 7:39 PM, Alan Gauld alan.ga...@btinternet.comwrote: On 16/04/13 22:20, Andy McKenzie wrote: For instance: output of running print_r on a very short dictionary from PHP: Array ( [key3] = thing3 [key2] = thing2 [key1] = thing1 ) And running

[Tutor] Removing GB pound symbols from Beautiful soup output

2010-07-16 Thread Andy
\]\{4\}) but this fails because it doesn't follow the standard patten for ascii. I'm not sure that I 100% understand the unicode system but is there a simple way to remove/subsitute these non ascii strings? Thanks for any help! Andy ___ Tutor maillist

[Tutor] Html entities, beautiful soup and unicode

2010-01-19 Thread andy
to use regexp? and where does unicode fit into all of this? Thanks for your help Andy ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Python and google sites

2009-09-09 Thread andy
clever before me Thanks for any help Andy ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] delphi, pascal and Python

2009-06-11 Thread andy
of error? (I'm on 64bit ubuntu btw) Thanks for any suggestions/help Andy By the way, the error was generated by following the tutorial and compiling in lazarus After Much Looking and pointers from the author, There is this most excellent post by the same author at http

Re: [Tutor] delphi, pascal and Python

2009-06-03 Thread Andy Cheesman
, but if someone could point me in the right direction, I would be rather grateful Thanks Andy Marc Tompkins marc.tompk...@gmail.com wrote Is there a Method for wrapping delphi and/or pascal code into python like SWIG? http://membres.lycos.fr/marat/delphi/python.htm That's a package to let you

Re: [Tutor] delphi, pascal and Python

2009-06-02 Thread Andy Cheesman
: Python: No such file: No such file or directory I've no clue what the issue is and I don't understand what should be going on. I'm running 64bit ubuntu. I know this might be a bit off topic, but if someone could point me in the right direction, I would be rather grateful Thanks Andy Marc

[Tutor] delphi, pascal and Python

2009-05-20 Thread Andy Cheesman
Hi people Is there a Method for wrapping delphi and/or pascal code into python like SWIG? I've googled to no avail, Can anyone help me? Andy ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] replacing range with xrange

2008-01-28 Thread Andy Cheesman
the example below where I need a non-continuous range. Any suggestions? Andy x = range(10) + range(20, 30) for thing in x: ... ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] printing format with list

2008-01-24 Thread Andy Cheesman
Hi people Is there a way to use a list with printf formating without having to explicitly expanding the list after the % e.g a = [1, 2, 3] print Testing %i, %i, %i %(a[0], a[1], a[2]) Cheers Andy ___ Tutor maillist - Tutor

[Tutor] Saving Objects

2008-01-17 Thread Andy Cheesman
this? Andy class Spod: def __init__(self, name): self.name=name fish = Spod(andy) file = open(test.pickle,w) pickle.dump(fish, file) # New session file = open(test.pickle,r) pickle.load(file) ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Saving Objects

2008-01-17 Thread Andy Cheesman
this this way. Thanks again for your help Andy Paul McGuire wrote: My initial tests using pickle and a simple class system (shown below) have failed. The method shown below fails with a AttributeError: 'FakeModule' object has no attribute 'Spod', so when I create a an empty class Spod in the new

[Tutor] Condensed python2.5 cheat sheet

2007-12-19 Thread Samm and Andy
Hi people, I've a competent programmer friend who I'm trying to convert to the ways of python and I was wondering if people could recommend a decent cheat sheet for python 2.5. He know how to program but just needs the syntax to become pythonic Thanks Andy

[Tutor] Best way of learning

2007-12-05 Thread andy
advice for someone in their mid-40s who would like to learn Python in a more methodical and effective manner? Thanks in anticipation. Andy -- If they can get you asking the wrong questions, they don't have to worry about the answers. - Thomas Pynchon, Gravity's Rainbow

Re: [Tutor] How to Practice Python?(Linpeiheng)

2007-10-01 Thread Andy
-- -Andy I have a great faith in fools; self-confidence my friends call it. – Edgar Allen Poe ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Would an emulator be possible in Python?

2007-09-12 Thread Andy
emulator eventually. Is Python anywhere near fast enough to do this and have it be playable? I hope so because I really don't like C/C++. -- -Andy I have a great faith in fools; self-confidence my friends call it. – Edgar Allen Poe ___ Tutor maillist

[Tutor] Finding a row match within a numpy array

2007-08-13 Thread Andy Cheesman
], [ 8, 9, 10, 11], [12, 13, 14, 15]]) b = array([8, 9, 10, 11]) I was wondering if people could suggest a possible more efficient route as there seems to be numerous steps. Thanks Andy ___ Tutor maillist - Tutor@python.org http

Re: [Tutor] Simple way to compare Two lists

2007-08-10 Thread Andy Cheesman
I think you could use sets, (I asked a similar question a few days ago re numpy arrays). ie Convert both list to sets use Set intersection convert answer to lists HTH Andy Tom Fitzhenry wrote: On Fri, Aug 10, 2007 at 02:54:44AM -0700, Jaggo wrote: Can anyone think of any better way

Re: [Tutor] comparing two numpy arrays

2007-08-08 Thread Andy Cheesman
Thats a great solution, thanks! I've googled a bit for manipulation of sets into other data structure(lists, arrays) and not seen much. Is the only way of interconversion a brute force method? i.e a = set([1, 2, 3]) b = [] for thing in a: b.append(thing) Andy

Re: [Tutor] Issue with iterating within lists, objects and functions

2007-08-03 Thread Andy Cheesman
Thanks for your help Kent The error was that I was trying to assign to a non-assignable reference as you highlighted. Everything works now Thanks Andy Kent Johnson wrote: Andy Cheesman wrote: for thing in [top, right, bottom, left]: eval(self. + thing).append(fish) You don't need

[Tutor] Issue with iterating within lists, objects and functions

2007-08-03 Thread Andy Cheesman
as shown below? e.g for thing in [top, right, bottom, left]: eval(self. + thing).append(fish) eval(self. + thing +_extra) eval(self. + thing) = external_function(eval(self. + thing)) #This falls Thanks for your help Andy

[Tutor] rotation within arrays

2007-07-04 Thread Andy Cheesman
which I have is that I now need to rotated alternative layer of the arrays but I still need to have the original mapping i.e 3 - 12. 0 1 2 3 4 5 6 7 8 11 14 17 10 13 16 9 12 15 Does anyone have any suggestions for how to do this? Thanks Andy

[Tutor] Animating changes with Numpy arrays

2007-06-26 Thread Andy Cheesman
debuging tool, I don't want to spend weeks coding it in! Thanks Andy Examples from-= to 1 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Automatic generation of an all possible combinations array

2007-06-15 Thread Andy Cheesman
: return map(lambda x: x+[0], recursive_bit_list(n-1)) + \ map(lambda x: x+[1], recursive_bit_list(n-1)) Hope this helps! -Hugh On 6/14/07, *Andy Cheesman* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi people I am trying to generate an array of all

[Tutor] Ipython and refreshing changed modules

2007-06-11 Thread Andy Cheesman
Dear People Silly question, I'm using Ipython and importing python modules which I've written. After a code modification, is there an easy, quick way to refresh changed modules? I've googled for the solutions but the answers does not seem clear! Andy

[Tutor] UnicodeDecodeError in kinterbasdb

2007-04-05 Thread Andy Koch
237: ordinal not in range(128) .. From searching the web I'm led to think this is related to the default encodings on the machine. But I'm not sure what to do about this. For what it's worth, I have another machine and this same library works just fine. Thank You, Andy Koch

[Tutor] Is Python the language for me?

2007-01-14 Thread Andy
? I'm sorry if this is a horribly dumb question but I've been looking around and I can't find the answer to these on my own. Thank you all for any help you can give me. -- -Andy I have a great faith in fools; self-confidence my friends call it. – Edgar Allen Poe

Re: [Tutor] die or exit function?

2006-06-14 Thread Andy Koch
doug shawhan wrote: Hi Andy, Putting a try:/except: loop in your __main__() (or whatever you call your base function) with sys.exit(Message) is pretty much the way I always do it. try: gak = puke + die except: sys.exit(Oy!) If you would like sys.exit() to provide you

[Tutor] die or exit function?

2006-06-13 Thread Andy Koch
Bkgd: I've been doing PHP for the last several years. Q: In PHP there are functions die and exit which terminate processing of a script with an optional string output. Is there something similar to this in Python? ___ Tutor maillist -

Re: [Tutor] wanted exercises in python

2006-04-18 Thread Andy
Well, these are from a Ruby group but I don't see any reason why you couldn't do them in Python. http://www.rubyquiz.com Look through their quiz's, might find something fun to try. -Andy Be who you are and be that well. - Saint Francis de Sales On 4/18/06, Payal Rathod [EMAIL PROTECTED

Re: [Tutor] Open file error

2006-01-18 Thread andy senoaji
Thanks Danny Alan,your print repr(os.listdir(C:/)) has embarrased myself :(. I found out the file name is Test.txt.txt in my c: drive. I guess I learn something here.Again ThanksAndy On 1/17/06, Danny Yoo [EMAIL PROTECTED] wrote: On Tue, 17 Jan 2006, andy senoaji wrote: I'm back to my home

[Tutor] Open file error

2006-01-17 Thread andy senoaji
etc? Is there a configuration settings that I can tweak in my Python? FYI I am using Activestate's. Thx, Andy ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Open file error

2006-01-17 Thread andy senoaji
,AndyOn 1/17/06, Python [EMAIL PROTECTED] wrote: (replying back to the list also)On Tue, 2006-01-17 at 10:03 -0800, andy senoaji wrote: Sorry for the inconsistent error message. I think I may pasted incorretcly. I am now in a different machine, and have tested Paul's suggestion, and it worked

Re: [Tutor] Python 2.4.1 on Mndrk Linux 10.1 - path

2005-10-15 Thread Andy Dani
comment the it out (import readline)? Thanks - Andy - Original Message - From: Nick Lunt [EMAIL PROTECTED] To: Andy Dani [EMAIL PROTECTED], tutor@python.org Subject: RE: [Tutor] Python 2.4.1 on Mndrk Linux 10.1 - path Date: Fri, 14 Oct 2005 20:12:33 +0100 Hi Andy, Behalf Of Andy

[Tutor] upgrading from 2.3 to 2.4.1 on Mandrake Linux 10.1

2005-09-12 Thread Andy Dani
Hi, Which is the best location to install Python in Linux? Should it be under one directory or different (like lib, doc, bin etc.)? I followed installation instructions in inst.pdf from python documents. I can see that Python 2.4.1 has been installed in /user/lib/local by standard