[Tutor] Looping

2009-04-20 Thread Matt
Hey everyone, First post to this list. I hope I'm doing it right. Let's say I want to run func 10 times Is there a more pythonic way to do it than this: for i in xrange(10): func() Thanks. ___ Tutor maillist - Tutor@python.org http://mail.python.org

[Tutor] String Encoding problem

2009-04-20 Thread Matt
xml.etree.ElementTree. This makes no sense to me, since it works fine normally. Thank you very much. Any and all help or pointers are appreciated. ~Matt db.py ### from xml.etree import ElementTree as ET import os class Database(object): def __init__(self, path): self.__d

Re: [Tutor] Looping

2009-04-20 Thread Matt
efficient. On Mon, Apr 20, 2009 at 1:27 PM, Alan Gauld wrote: > "Matt" > wrote > > Let's say I want to run func 10 times Is there a more pythonic way to do >> it >> than this: >> for i in xrange(10): >> func() >> > > Yes, use r

[Tutor] Functional Derivatives

2009-04-20 Thread Matt
I'm trying to calculate the derivative of a function in Python like so: def D5(func,h=1e-5):     ""' Return derivative of function func'''     def df(x):return (func(x+h)-func(x))/h df.__name__ = func.__name__ + '_dx'     return df However, I run into the problem of limited float precisio

[Tutor] Creating & Handling lots of objects

2004-12-03 Thread Matt Williams
ght I'd like to be able to automate something closer to the a=MyClass("a") but don't know how to do it....It may be that I'm trying to do it very badly, which is Python seems to make it hard for me. Thanks, Matt ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

[Tutor] How to find complex roots

2004-12-09 Thread Matt Williams
you need to take the nth root of the absolute value of c (this can be ignored when we're doing it for 1, as of course the nth root of 1 is 1). Obviously I haven't included any code....but I hope this helps a bit. Matt P.S. Thrilled to be able to answer something on the tutor list, instea

[Tutor] Complex roots

2004-12-09 Thread Matt Williams
Further to my previous post, please find some code below: Hope this helps, Matt #Complex number Roots #Matt Williams 9.12.04 import math number=complex(0.5,0) n=float(3) size=math.sqrt((number.real**2)+(number.imag**2)) arg=math.radians(360/n) root=1/n modulus=size**root theta=float(0

[Tutor] Nifty

2004-12-17 Thread Matt Williams
I'd be interested, Matt On Fri, 2004-12-17 at 11:01, [EMAIL PROTECTED] wrote: > Send Tutor mailing list submissions to > [EMAIL PROTECTED] > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/tutor > or, vi

Re: [Tutor] Merging Text Files

2010-10-13 Thread Matt Williams
y. HTH, Matt Robert Jackiewicz wrote: On Wed, 13 Oct 2010 14:16:21 -0600, Ara Kooser wrote: Hello all, I am working on merging two text files with fields separated by commas. The files are in this format: File ONE: *Species, Protein ID, E value, Length* Streptomyces sp. AA4, ZP_

[Tutor] output formatting

2009-04-25 Thread Matt Domeier
Hello, I have a series of lists that I need to output into files with a specific format. Specifically, I need to have line breaks after each entry of the list, and I need to do away with the ['..'] that accompany the data after I transform the list into a string. Can I simply append a '\n

Re: [Tutor] output formatting

2009-04-25 Thread Matt Domeier
ase of the print function setup that you suggested with write? Or could I somehow use the print function itself to write to the file (rather than just output to my shell/prompt)? Thanks! Quoting W W : On Fri, Apr 24, 2009 at 10:57 PM, Matt Domeier wrote: Hello, I have a series of lists t

[Tutor] glob paramiko

2009-05-08 Thread Matt Herzog
Hey All. All I need to do in this script is scp or sftp a bunch of files to a remote server. This script will run from a cron job eventually. For whatever reason, paramiko can't cope with a list. --- AttributeError

Re: [Tutor] glob paramiko

2009-05-08 Thread Matt Herzog
On Fri, May 08, 2009 at 02:30:22PM -0400, Kent Johnson wrote: > On Fri, May 8, 2009 at 1:04 PM, Matt Herzog wrote: > > Hey All. > > > > All I need to do in this script is scp or sftp a bunch of files to a remote > > server. This script will run from a cron job event

[Tutor] paramiko again

2009-05-09 Thread Matt Herzog
Hello again. This code comes straight from the http://oreilly.com/catalog/9780596515829/ book. The only actual code I changed was s/get/put on the second to last line. The author says I ought to be able to do this and have it Just Work. There are several things I don't understand. Would be nic

Re: [Tutor] paramiko again

2009-05-09 Thread Matt Herzog
On Sun, May 10, 2009 at 12:53:49AM +0100, Alan Gauld wrote: > Have you used normal ftp in its command line version? > The put command specifies the location on the remote machine > where you want to store the files. This is normal ftp behaviour. The server supports only sftp. Yeah, I could turn o

[Tutor] moving files from one dir to another

2009-05-11 Thread Matt Herzog
Should be simple, right? Not for me, heh. def schmove(src,dst): ... src = '/home/datasvcs/PIG/cjomeda_exp/' ... dst = '/home/datasvcs/PIG/cjomeda_exp_archive/' ... listOfFiles = os.listdir(src) ... for filez in listOfFiles: ... os.system("mv"+ " " + src

[Tutor] simply moving files

2009-05-12 Thread Matt Herzog
ectory, it'll move the file there." Example: If I use: "os.rename(src, dst)" where I had "os.system("mv"+ " " + src + " " + dst)" no files are coppied. os.renames happily renames the source directory, but that's not what I want.

[Tutor] sftp get single file

2009-07-17 Thread Matt Herzog
Hello All. I need to use paramiko to sftp get a single file from a remote server. The remote file's base name will be today's date (%Y%m%d) dot tab. I need help joining the today with the .tab extension. Do I need globbing? example: 20090716.tab #!/usr/bin/env python import paramiko import glob

Re: [Tutor] sftp get single file

2009-07-20 Thread Matt Herzog
g is missing. Traceback (most recent call last): File "./scpgetter.py", line 20, in ? sftp(remotepath,localpath) TypeError: 'SFTPClient' object is not callable I tried using the paramiko.SFTP.get method too. Failed. -- Matt H > > Kent -- I fear you speak u

Re: [Tutor] sftp get single file

2009-07-20 Thread Matt Herzog
On Mon, Jul 20, 2009 at 10:22:37PM +0200, Sander Sweers wrote: > I do not know paramiko but looking over the client documentations... > > 2009/7/20 Matt Herzog : > > if __name__ == "__main__": > >t = paramiko.Transport((hostname, port)) > >t.connect

Re: [Tutor] sftp get single file

2009-07-20 Thread Matt Herzog
On Mon, Jul 20, 2009 at 11:02:52PM +0200, Sander Sweers wrote: > 2009/7/20 Matt Herzog : > > Traceback (most recent call last): > > ??File "./scpgetter.py", line 20, in ? > > ?? ?? ??sftp.get(remotepath, localpath) > > ?? ?? ?? ??File "build/bdis

Re: [Tutor] sftp get single file

2009-07-20 Thread Matt Herzog
If I change remotepath = 'datestr' to remotepath = datestr I get: sftp.get(remotepath, localpath) File "build/bdist.linux-x86_64/egg/paramiko/sftp_client.py", line 587, in get IOError: [Errno 21] Is a directory: '/tmp/testor/' So remotepath is really more like a path + filname. So I ne

[Tutor] paramiko list user said,

2009-07-20 Thread Matt Herzog
A user of the paramiko mailing list said, "Paramiko has an SFTPClient class and an SSHClient that can be used to transfer files, why complicate it by using a Transport directly. The easiest thing is to open an SSHClient:

Re: [Tutor] sftp get single file

2009-07-20 Thread Matt Herzog
On Mon, Jul 20, 2009 at 11:57:57PM +0200, Sander Sweers wrote: > Please reply to the list. > > 2009/7/20 Matt Herzog : > > Yeah. I have no idea if I am able to do this. The jail makes it ambiguous. > > There is no difference, the jail just moves the root directory as

Re: [Tutor] sftp get single file

2009-07-20 Thread Matt Herzog
On Mon, Jul 20, 2009 at 05:26:09PM -0500, Wayne wrote: > On Mon, Jul 20, 2009 at 5:18 PM, Matt Herzog wrote: > > > On Mon, Jul 20, 2009 at 11:57:57PM +0200, Sander Sweers wrote: > > > Please reply to the list. > > > > > > 2009/7/20 Matt Herzog : > >

[Tutor] updating Unix config file

2009-10-19 Thread Matt Herzog
Hi All. The below script seems to work well enough to use but I'm wondering if I'm doing the file edit stuff in a "kosher" manner. I was just reading the Lutz O'Reilly "Learning" book and remembered that strings are immutable. So how was I able to change the strings for my dotted quad? I did no

Re: [Tutor] updating Unix config file

2009-10-19 Thread Matt Herzog
On Mon, Oct 19, 2009 at 08:07:47PM +0100, Alan Gauld wrote: > > "Matt Herzog" wrote > > >remembered that strings are immutable. > >So how was I able to change the strings for my dotted quad? > > You didn't. > > >LASTKNOWN = '173.48.204

Re: [Tutor] updating Unix config file

2009-10-19 Thread Matt Herzog
On Mon, Oct 19, 2009 at 07:51:06PM -0400, Matt Herzog wrote: > On Mon, Oct 19, 2009 at 08:07:47PM +0100, Alan Gauld wrote: > > > > "Matt Herzog" wrote > > > > >remembered that strings are immutable. > > >So how was I able to change the

Re: [Tutor] updating Unix config file

2009-10-20 Thread Matt Herzog
On Tue, Oct 20, 2009 at 08:29:59AM +0100, Alan Gauld wrote: > "Matt Herzog" wrote > > >Anyway, I'd like a hint as to how I could convert this: > > > >ifcfg_lines = os.popen("/sbin/ifconfig fxp0").readlines() > >x = string.split(ifcfg_lines[3

Re: [Tutor] updating Unix config file

2009-10-20 Thread Matt Herzog
On Tue, Oct 20, 2009 at 02:49:53PM +, Tiago Saboga wrote: > On Tue, Oct 20, 2009 at 2:44 PM, Matt Herzog wrote: > > Yes, thanks. What failed was the invocation of PIPE. Apparently I had to > > explicitly import PIPE from subprocess or python had no clue as to what > > P

Re: [Tutor] updating Unix config file

2009-10-20 Thread Matt Herzog
On Tue, Oct 20, 2009 at 07:53:17AM -0700, Steve Willoughby wrote: > On Tue, Oct 20, 2009 at 10:44:16AM -0400, Matt Herzog wrote: > > Yes, thanks. What failed was the invocation of PIPE. Apparently I had to > > explicitly import PIPE from subprocess or python had no clue as to wha

[Tutor] cookielib and form authentication woes

2010-01-09 Thread Matt Ball
;http://www.instamapper.com/fe?page=track&device_key=abc ') print resp.read() resp.close() The ValueError is raised each time. If I remove this and read the response, the page thinks I have disabled cookies and blocks access. Why isn't cj grabbing the InstaMapper cookie? Are there

[Tutor] Database

2005-02-11 Thread Matt Williams
I would recommend KirbyBase as a quick starter - it's nice and simple, and outputs text files, so you can always check things manually. http://www.netpromi.com/kirbybase.html Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/ma

[Tutor] References in loops

2005-02-11 Thread Matt Dimmic
get a reference to an element in a list? Is it really Example B? Thanks, Matt (My apologies if this double-posts; I accidentally sent it previously from a non-subscribed address. Moderator, please deny the other copy.) ___ Tutor maillist - Tutor@python.or

[Tutor] OT: Google Gmail Accounts

2005-02-19 Thread Matt Hauser
If anyone is interested in an invitation to Google GMail, let me know and I will send you a free invitation to join. It works great for organizing mailing lists and with 1000 MB of storage, you don't have to manage your inbox. -- Have you seen the dog lately? Email - [EMAIL PROTECTED] Blog - i

[Tutor] Filtering a String

2005-03-20 Thread Matt Williams
of my slowness: This is my first programming language I couldn't get the tutor list to work for ages - until I realised I was sending all the desperate pleas for help to tutor-request. Perhaps there is no hope.. Matt Williams ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Accessing List items

2005-03-21 Thread Matt Williams
the second loop does - but is very ugly. x = "200% inv_nodes=0-2 node_caps=no" y=x.split() for i in y: i="z" print y for i in range(len(y)): y[i]="z" print y Surely there must be a better way than this ? Thanks, Matt __

Re: [Tutor] Confused "from module import Name" better than "import module"?

2005-07-11 Thread Matt Richardson
ty as my programs are fairly small and don't do a whole lot. I would imagine that there would be a penalty, but for now I'm happy with keeping my namespaces distinct and knowing what came from where at a glance. Matt -- Matt Richardson IT Consultan

Re: [Tutor] Confused "from module import Name" better than "import module"?

2005-07-11 Thread Matt Richardson
r, but I was curious about it. Going through the library reference I found a bunch of modules that would replace some ugly (but working) code I had, then started to wonder if importing a bunch of different modules would have much of an effect. In any case, I'm more concerned with readabilit

[Tutor] Python FTP GUI - Possible project ?

2005-08-01 Thread Matt Williams
have often been questions along the lines of "Where can I find projects to get involved in", and I thought this might help. Thanks, Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] How to test for a remainder from division

2007-05-14 Thread Matt Smith
I get the line above to work. Thanks, Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to test for a remainder from division

2007-05-14 Thread Matt Smith
not a leap year" Thanks, Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Help with excetion handing and making my code more efficient needed please

2007-05-18 Thread Matt Smith
k...). I cannot think of a way of checking each of the 8 cells surrounding the one being tested without doing it this way. Is there a better way of doing this? Thanks in advance, Matt. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with excetion handing and making my code more efficient needed please

2007-05-18 Thread Matt Smith
ould suppress_the_error() actually call? Cheers, Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with excetion handing and making my code more efficient needed please

2007-05-18 Thread Matt Smith
> > Is there a better way of doing this? > > Perhaps something like this: > > for n in (x, x+1, x-1): > for m in (y, y+1, y-1): > if matrix[n, m]: > neighbour_count = neighbour_count + 1 > I need to not text matrix[x][y] is there a simple way to exclude this from the possible combi

Re: [Tutor] Help with excetion handing and making my code more efficient needed please

2007-05-19 Thread Matt Smith
> the possible combinations of values from the two tuples? > see my other reply, Matt. > -Luke Hi Luke, Sorry if I'm missing something but which other reply? Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with excetion handing and making my code more efficient needed please

2007-05-19 Thread Matt Smith
On Fri, 2007-05-18 at 17:03 -0500, Luke Paireepinart wrote: > see my other reply, Matt. > -Luke Apologies Luke, I have found your earlier post in the tutor archives - I don't seem to have received it from the list yet. Thanks for the

[Tutor] Still having trouble with my game of life algorithm

2007-05-25 Thread Matt Smith
ted. The program does use curses to display the board so I guess it won't be any good for Windows users. I hope someone can see where I am going wrong here. Thanks, Matt #! /usr/bin/env python import curses def read_start(): # Read the starting configuration from a text file file = op

[Tutor] More trouble debugging my game of life program

2007-06-03 Thread Matt Smith
d: #! /usr/bin/env python # Curses based Game of Life program # Written by Matt Smith import curses from copy import deepcopy def read_start(): # Read the starting configuration from a text file file = open('/home/matt/Python/game_of_life/r-pentomino.txt', 'r&

[Tutor] Suggestions for a first object orientated program

2007-06-03 Thread Matt Smith
odule under Linux (see my posts about the game of life program). The game of life program might also show the kind of stage I am at with my learning of Python at the moment. Thanks, Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/ma

Re: [Tutor] More trouble debugging my game of life program

2007-06-04 Thread Matt Smith
as using. Looking at my code - I can see it will break if the lists within the big list making up the matrix are not all the same length. Maybe this is something I need to test for in the program. Cheers, Matt ___ Tutor maillist - Tutor@python.org ht

[Tutor] Invoking Python from Vim

2007-06-07 Thread Matt Smith
: map :w\|!python % This doesn't work for GVim which I prefer to use. Do any Vim users have a better way of running a Python program while it is being edited in Vim? Thanks, Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python IDE

2007-06-12 Thread Matt Erasmus
Check out geany. It's fairly simple but I've found it very neat and simple. http://geany.uvena.de/ On 6/11/07, scott <[EMAIL PROTECTED]> wrote: Could someone suggest a few good IDE's for me to look at. I would need a IDE that haves syntax highlighting and I also really like type compl

[Tutor] How to keep trying something until it doesn't return an error?

2007-11-12 Thread Matt Smith
Hi there, I am currently working on a noughts and crosses program to try and teach myself some very simple AI programming and also to start to use OOP in Python. I am currently writing the framework for the game so I can then write a number of functions or a class to deal with the strategy sid

[Tutor] Use of sqrt() from math module

2007-12-01 Thread Matt Smith
velocity > 0: impactvel = sqrt(velocity ** 2 + (2 * gravity * (ypos - 384 * 160))) ... Traceback (most recent call last): File "", line 32, in ValueError: math domain error This one has me stumped as the usage of the module looks straight forward from the documentation.

Re: [Tutor] Use of sqrt() from math module

2007-12-01 Thread Matt Smith
Matt Smith wrote: > import sys, pygame, math > > ... > > if ypos >= 384 and velocity > 0: > impactvel = sqrt(velocity ** 2 + (2 * gravity * (ypos - 384 * > 160))) > > ... > > > Traceback (most recent call last): > File "",

Re: [Tutor] Use of sqrt() from math module

2007-12-01 Thread Matt Smith
o square root a number less than 0. Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] hey i need some help here

2005-09-11 Thread Matt Warren
I just started attempting to program and thought i would try python as my first tool. However following the beginners guide on their page it says to insert python as a command and that it should come up with the program information. When i insert python it says it is not recognizable as an inte

Re: [Tutor] IDEs

2005-09-14 Thread Matt Williams
tor to run... As regards using wxPython - I thought it was ok, but frankly Glade was s much easier.. (all IMHO) Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Python DB

2005-09-22 Thread Matt Williams
nice and simple, and has the advantages of text- based files) or ZODB. I have a bit of an allergy to SQL, even if mediated via SQLObject (which looks very nice) These seem to be at the opposite end of the spectrum - so do others have either comments on these options, or other suggestions. Thanks,

[Tutor] Python DB

2005-09-22 Thread Matt Williams
eds to have a simple GUI frontend. The nice thing about ZODB is that I could just map the eventhandlers to functions on objects.. If people have more comments in the light of the bigger spec. above, I'd still love to hear them... Matt ___ Tutor mail

[Tutor] Linking with C programs

2005-09-27 Thread Matt Williams
Dear List, Could someone explain how, in very general terms, one would use python to wrap some C libraries/ API. I ask because there are a few bits of C software that look quite interesting, and I know that Python can be used to wrap the C - but how does it work? Thanks, Matt

[Tutor] Accessing Variables

2005-10-05 Thread Matt Williams
ke some classes & objects, and then they can easily pass parameters to each other, but I just thought I'd check. Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutor Digest, Vol 20, Issue 26: New Python Book

2005-10-08 Thread Matt Williams
would be a reasonable default. Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Listing all of an instances variables

2005-10-08 Thread Matt Williams
turn all of the variables in an instance? I'm sure I'm not the first person to ask, but I couldn't find an answer anywhere else... Thanks, Matt -- Dr. M. Williams MRCP(UK) Clinical Research Fellow Cancer Research UK +44 (0)207 269 2953 +44 (0)7384 899570 ___

[Tutor] problem with class overloading (maybe it's just me)

2005-10-24 Thread Matt Richardson
overlooking, so I'll go get a cup of coffee and see if someone with better eyes spots my error. thanks, Matt -- Matt Richardson IT Consultant College of Arts and Letters CSU San Bernardino (909)537-7598 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] problem with class overloading (maybe it's just me)

2005-10-24 Thread Matt Richardson
Danny Yoo wrote: > Hope this helps! Helped a lot. Shows that syntax errors aren't always visible (like whitespace) and that I should know better than to attempt anything before having at least one cup of coffee. Thanks! Matt -- Matt Richardson IT Consultant College of Arts and Let

[Tutor] General programming questions

2005-10-27 Thread Matt Williams
t the moment, I have something like: def __init__ (self, a, b, c): if type(a) == type("a") then. elif type(a) == type(["a"]) then I'm sure there must be a better way to do this (both the polymorphism and the type testing) - but I

[Tutor] Nokia 60 series

2005-10-29 Thread Matt Williams
There's some extra info here: http://comments.gmane.org/gmane.comp.python.announce/5658 HTH, Matt -- Dr. M. Williams MRCP(UK) Clinical Research Fellow Cancer Research UK +44 (0)207 269 2953 +44 (0)7834 899570 http://acl.icnet.uk/~mw http://adhominem.blogspo

[Tutor] Easier way to access wxPython

2005-11-07 Thread Matt Williams
sked, I thought people might like to know... http://daboenv.com/ HTH, Matt -- Dr. M. Williams MRCP(UK) Clinical Research Fellow Cancer Research UK +44 (0)207 269 2953 +44 (0)7834 899570 http://acl.icnet.uk/~mw http://adhominem.blogspot.com ___

[Tutor] Mono

2005-11-07 Thread Matt Williams
ially interested in the idea of being able to write different bits in different languages, and then run them all on Mono. Thanks, Matt -- Dr. M. Williams MRCP(UK) Clinical Research Fellow Cancer Research UK +44 (0)207 269 2953 +44 (0)7834 899570 http://acl.icnet.uk/~mw http://adhominem.blogspo

[Tutor] Python and Semantic Web

2005-11-08 Thread Matt Williams
#x27;m looking for a pythonic version of something like Protege or SWOOP Thanks, Matt -- Dr. M. Williams MRCP(UK) Clinical Research Fellow Cancer Research UK +44 (0)207 269 2953 +44 (0)7834 899570 http://acl.icnet.uk/~mw http://adhominem.blogspot.com ___ Tuto

Re: [Tutor] Python and Semantic Web

2005-11-08 Thread Matt Williams
h the Protege OWL plugin) and SWOOP, but both are Java based. HTH. Matt -- Dr. M. Williams MRCP(UK) Clinical Research Fellow Cancer Research UK +44 (0)207 269 2953 +44 (0)7834 899570 http://acl.icnet.uk/~mw http://adhominem.blogspot.com ___ Tutor mai

[Tutor] Latin Perl

2005-11-10 Thread Matt Williams
The suprising thing about Latin Perl is that it's more readable than normal Perl.... Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Symbolic maths In Python

2005-11-13 Thread Matt Williams
I don't know if this will do anywhere near what you want... http://swiginac.berlios.de/ is a set of Python bindings to GiNaC, which handles symbolic maths in C/C++. Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/lis

[Tutor] TurboGears - and some issues

2005-11-14 Thread Matt Williams
and del.icio.us tagged sites/blogs. Where else do other people look? Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Favourite Modules - wiki

2005-11-15 Thread Matt Williams
I think the Wiki's a great idea. del.icio.us already has a Python tagged page: http://del.icio.us/tag/python Other pages I use are: http://mechanicalcat.net/pyblagg.html http://www.planetpython.org/ I've added a couple of things to the Wiki - SQLObject and RSPy

[Tutor] Python on Fedora

2006-01-24 Thread Matt Williams
FC4 (the latest finished one) has python 2.4.1 as part of the distro (I think RedHat actually use python for some of their scripts). Just pull up a terminal and type 'python' and you should get the prompt... If you _are_ running FC4 and have more probs, feel free to drop me a line.

Re: [Tutor] Python DB

2006-02-07 Thread Matt Williams
You might also want to have a look at DABO; I don't know how well it work on a handheld, though. http://dabodev.com/about Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Struggling with writing results of loop into txt file

2006-03-21 Thread Matt Dempsey
I'm using xmltramp to process some U.S. House of Rep. vote data. I can get it to print what I want but when I try to write it to a text file I had all sorts of problems. Can someone tell me what I'm doing wrong? I've done quite a bit of searching for the solution but as a novice to Python I'm at a

[Tutor] unicode issue?

2006-03-21 Thread Matt Dempsey
I'm having a new problem with my House vote script. It's returning the following error: Traceback (most recent call last):  File "C:/Python24/evenmorevotes", line 20, in -toplevel-    f.write(nm+'*'+pt+'*'+vt+'*'+md['vote-result'][0]+'*'+md['vote-desc'][0]+'*'+'\n') UnicodeEncodeError: 'ascii' code

[Tutor] sockets

2006-05-03 Thread Matt Richardson
Just verifying what I looked up earlier: are strings and binary (through struct.pack) the only data types that can be sent through a socket? This is my first crack at socket programming, so I'll probably have lots of questions to bug you with. thanks,

Re: [Tutor] sockets

2006-05-04 Thread Matt Richardson
pear' either through theft or people taking them home to do 'work from home' or whatever. Makes annual inventory a huge pain. Matt -- Matt Richardson IT Consultant College of Arts and Letters CSU San Bernardino (909)537-7598 ___ Tutor

Re: [Tutor] sockets

2006-05-04 Thread Matt Richardson
could be just a simple string, sent via UDP, that would happen after networking was established but before log in. I had done something simpler before using a bash script and sendmail, but I really don't want my inbox plugged up with a bunch of 'phone home' messages :) Matt

Re: [Tutor] debug process

2006-06-13 Thread Matt Richardson
in and run as you code, which saved me from making lots of silly mistakes. -- Matt Richardson IT Consultant College of Arts and Letters CSU San Bernardino work: (909)537-7598 fax: (909)537-5926 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] MySQLdb: cant get '... where field in %s' to work for string sequences

2006-06-23 Thread Matt Richardson
ENAME > print TESTARTICLENAME > print cur.execute(FIXEDARTICLENAME), > print cur.execute(TESTARTICLENAME), > # cannot get this to work > print cur.execute(SQLARTICLENAME, (ARTICLES,)) > print > print FIXEDPID >

Re: [Tutor] Python Programming Books

2006-07-14 Thread Matt Richardson
programming, pickling, and interfacing with MySQL. Showing how particular things were done in python in clear, concise examples is it's big strength. Thanks for not getting sucked in to using lots of source code :) -- Matt Waiting for the second edition __

[Tutor] (*args, **kwargs)

2006-08-04 Thread Matt Williams
could someone explain _very_ slowly? Apologies for the gross stupidity, Matt -- http://acl.icnet.uk/~mw http://adhominem.blogsome.com/ +44 (0)7834 899570 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] (*args, **kwargs)

2006-08-04 Thread Matt Williams
it__(self,**kw) self.property1 = self.kw['property1'] self.property2 = self.kw['property2'] etc Does anyone know of an example of this ? Thanks, Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Regex

2006-08-14 Thread Matt Williams
ot sure why there should be any difference between the two - but I'm sure it's very simple. Thanks for any tips, Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Sorting a list in an add order

2006-09-06 Thread Matt Williams
tc}, but I don't don't know how to take it on from here. I was thinking of looking up the filename in the dictionary (using .startswith() to get some basic rough-matching capacity) and then using that to return the order that the files should be

Re: [Tutor] Has anyone tried matplotlib...??

2006-10-22 Thread Matt Richardson
I just used it a couple of weeks ago to produce a histogram of randomly generated numbers. Read the documentation, it's well written and has good examples. Matt On 10/22/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > > Folks, > > Has anyone tried matplotlib ..//???

[Tutor] Sloppy Code ?

2006-11-13 Thread Matt Erasmus
te("System Report for: ") report.write(system_name) ... Is there a better way of doing this ? It works for what I want to do, but I would like to know if there's another way of doing things.... Thanks in advance. Matt E matt.erasmus (at) gmail (dot) com

Re: [Tutor] Sloppy Code ?

2006-11-13 Thread Matt Erasmus
hostname() > > I hope this helps Thanks so much Michael -Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Lexicographic ordering (or something simpler)

2007-03-13 Thread Matt Williams
ecision based on all the results. I've tried coding it as if...elif statements, but that all gets horrible. Given a list of the form [1,0,0,1,-1] I need to make decision (in this, it is undecided, so we drop down to the next criteria). Any ideas/ pointers as to how I implement this? Thanks, M

Re: [Tutor] Equivalent of grep in python

2008-12-21 Thread Matt Herzog
- Forwarded message from Tiago Katcipis - i forgot, this might help you http://docs.python.org/tutorial/inputoutput.html#reading-and-writing-files I can't help wondering how to do this in python: perl -wnl -e '/string/ and print;' filename(s) Not that I want to forget the pre

[Tutor] optparse

2008-12-23 Thread Matt Herzog
Hi All. I want to write a script that will emulate grep to some extent. This is just an exercise for me. I want to run the script like this: ./pythongrep directory searchstring Just like grep, I want it to print: filename, instance_of_match As of now, the script can't find anything I tell it t

[Tutor] Redux: optparse

2008-12-27 Thread Matt Herzog
On Wed, Dec 24, 2008 at 01:12:55AM -, Alan Gauld wrote: > > "Kent Johnson" wrote > > >> for filename in os.listdir(directory): > >> result = re.match(s, filename) > >> print result > > > >You never open and read the files. You are searching for the pattern > >in the filenam

Re: [Tutor] Redux: optparse

2008-12-27 Thread Matt Herzog
> Do you want to use optparse, or get the command line arguments yourself? > It seems the pattern string will be the first arg, will it? Again I am confused. I assumed that optparse was the best way to pass in arguments (such as filenames) from the command line. Like so: ./script.py -x r

Re: [Tutor] calling setters of superclasses

2010-12-22 Thread Matt Gregory
#x27;ve been able to get what I need by just defining __setattr__ in both classes. Whether I did that correctly is a story for another thread ... matt ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

  1   2   >