Re: [Tutor] Mac IDE

2011-10-05 Thread Liam Clarke
I second the recommendation of PyCharm, it's the best Python IDE I've used. Alan - OS X has Vim by default? At least, I've always used it and never installed it, but I started from 10.5. Regards, Liam Clarke On 30/09/2011, at 3:43 AM, Tom Tucker wrote: > > Another

Re: [Tutor] Rebuild jpg

2011-02-21 Thread Liam Clarke-Hutchinson
Hi Rafael, Do you need to use Python 3.x? If you can use Python 2.6, the Python Imaging Library is a great image manipulation module. http://www.pythonware.com/products/pil/ Regards, Liam Clarke 2011/2/21 Rafael Durán Castañeda > Hi all, > > I'm using Python 3.1 and I have

Re: [Tutor] Tkinter in classes...why?

2011-01-20 Thread Liam Clarke-Hutchinson
they might be different enough that you can escape comparisons to Tcl. But hey, sometimes, a language just doesn't fit your way of working. If Tcl suits you better, then stick with Tcl. Regards, Liam Clarke On Fri, Jan 21, 2011 at 8:57 AM, David Hutto wrote: > On Thu, Jan 20, 2011 at 2:43 PM,

Re: [Tutor] Help with basic user-data file

2006-10-12 Thread Liam Clarke
rds. >>> save_file.close() Now, next time you start up - >>> import pickle You use the pickle.load() method to get your object back. First thing is to open the file you saved it to, (open it in binary mode). >>> load_file = open("userInfo.pck", "rb") >>> userInfo = pickle.load(load_file) >>> load_file.close() >>> print userInfo {'Liam': {'password': 'snooze', 'last_login_time': datetime.datetime(2006, 10, 13, 19, 34, 58, 437000)}} Hope that helps. Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] [Fwd: Re: database web app, what tool?]

2006-10-02 Thread Liam Clarke
Original Message Subject:Re: [Tutor] database web app, what tool? Date: Mon, 02 Oct 2006 09:33:28 +0100 From: [EMAIL PROTECTED] To: Liam Clarke <[EMAIL PROTECTED]> References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTE

Re: [Tutor] database web app, what tool?

2006-10-01 Thread Liam Clarke
ediately fit to what you're trying to do, but it could do. I'd say just a straight mod_python would be simplest, to be honest, but it really depends on what you're doing. Regards, Liam Clarke > Hi! > > Im a very biginner in programming and I started with python, witch I &g

Re: [Tutor] Puzzled by print lst.sort()

2006-10-01 Thread Liam Clarke
how you were trying to assist me. > > Thanks, > > Dick > > > > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > > I think what Shantanoo was getting at was the reference thing, i.e

[Tutor] difflib - restoring from a unified diff?

2006-10-01 Thread Liam Clarke
her use any pre-existing modules. Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Puzzled by print lst.sort()

2006-09-30 Thread Liam Clarke
Dick Moores wrote: > At 03:22 AM 9/30/2006, Liam Clarke wrote: >> Dick Moores wrote: >>> >>> >>> lst = [5,3,7,6,2] >>> >>> lst.sort() >>> >>> lst >>> [2, 3, 5, 6, 7] >>> >>> lst = [5,3,7,6,2] &

Re: [Tutor] Puzzled by print lst.sort()

2006-09-30 Thread Liam Clarke
Dick Moores wrote: > At 03:22 AM 9/30/2006, Liam Clarke wrote: >> Dick Moores wrote: >>> >>> >>> lst = [5,3,7,6,2] >>> >>> lst.sort() >>> >>> lst >>> [2, 3, 5, 6, 7] >>> >>> lst = [5,3,7,6,2] &

Re: [Tutor] Puzzled by print lst.sort()

2006-09-30 Thread Liam Clarke
hat has the functionality you want: >>> x = [3,1,2] >>> y = sorted(x) >>> print y [1, 2, 3] >>> print x [3, 1, 2] You'll note that sorted() is not destructive - that is, x is not modified. Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] what.built-in

2006-09-29 Thread Liam Clarke
27;, '__name__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', 'func_closure', 'func_code', 'func_defaults', 'func_dict', 'func_doc', 'func_globals', 'func_name'] This means that unlike Java you can pass functions as arguments to other functions/methods - it also means you don't need to wrap everything in a class unnecessarily - in Python you only use a class when you need a class, not because Sun decided that classes were good. ;-) Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] [Plone-Users] Changing possible Smart Folder Criteria?

2006-09-21 Thread Liam Clarke
Ah, Unfortunately, doesn't cover events that started yesterday, but are running for the next week... On 9/21/06, Dan Busarow <[EMAIL PROTECTED]> wrote: > > On Sep 20, 2006, at 6:38 PM, [EMAIL PROTECTED] wrote: > > > Hi all, > > > > I have a Smart Folder which is grabbing events based on date, an

Re: [Tutor] folder and module

2006-09-17 Thread Liam Clarke
Hi Linda, At your Python prompt try the following: >>> import sys >>> print sys.path What directories are listed there? On 9/17/06, linda.s <[EMAIL PROTECTED]> wrote: > > > i have test.py under c:\try1\new; > > > I want to import b and b.py is under c:\trytry. How to do it? > > > Also, I impor

Re: [Tutor] folder and module

2006-09-17 Thread Liam Clarke
Hi Linda, As Alan said, you can modify your sys.path at runtime - to clarify, a simple example is: >>> import sys >>> sys.path.append("c:/trytry") "import b" should now work. Regards, Liam Clarke On 9/17/06, Alan Gauld <[EMAIL PROTECTED]> wrote:

Re: [Tutor] Binary fractions, recommendations?

2006-08-03 Thread Liam Clarke
gards, Liam On 8/4/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > Liam Clarke wrote: > > Problem is; I can't bitshift on floats, so can't test. Can't bitshift > > on floats in C either. Does anyone know how I could work on a binary > > representation of a floa

[Tutor] Binary fractions, recommendations?

2006-08-03 Thread Liam Clarke
shtml Problem is; I can't bitshift on floats, so can't test. Can't bitshift on floats in C either. Does anyone know how I could work on a binary representation of a float? Any language at all, I'm desperate... Regards, Liam Clarke ___

Re: [Tutor] Treeview

2006-05-16 Thread Liam Clarke
Sometimes it's your own problem that is hardest to solve, as you're too familiar with the code. :) Congratulations on making sense of pyGTK, the documentation isn't overly helpful... ...I'm used to the wxPython docs and still got confused with the pyGTK ones. Regards, Lia

Re: [Tutor] Button Signals

2006-05-07 Thread Liam Clarke
Hi John, I'll answer your questions, but first: Pythoncard is for wxPython. wxPython is vastly different to PyGTK afaik.The docs you quote answer your question: The return value from a connect () call is an integer tag that identifies your callback. As stated above, you may have as many callbacks p

Re: [Tutor] 2 Combo Boxes! What was I thinking?

2006-05-06 Thread Liam Clarke
y.html#function-gtk--combo-box-entry-new-text What you want to try is comboboxthing = gtk.combo_box_new_text() combobox.append_text("Option 1") combobox.append_text("Option 2") Regards, Liam Clarke On 5/7/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > John CORRY wrot

Re: [Tutor] why different

2006-05-05 Thread Liam Clarke
and paste it here also? Lastly, what directory are you running your code from? Regards, Liam Clarke On 5/5/06, linda.s <[EMAIL PROTECTED]> wrote: > I run a code, which import Numeric module. When I run the code from > PythonWin, it is OK. > But when I run it from the command

Re: [Tutor] Memory Management etc

2006-05-05 Thread Liam Clarke
There's a specific Python gotcha involving memory allocation and pymalloc, that'll manifest with large amounts of integers. http://evanjones.ca/python-memory.html And, according to that article, it's as Kent said, fixed in 2.5 :) Regards, Liam Clarke On 5/5/06, Alan Gauld &l

Re: [Tutor] Memory Management etc

2006-05-05 Thread Liam Clarke
Oh dear, I see Kent already posted that linked. Haha. On 5/6/06, Liam Clarke <[EMAIL PROTECTED]> wrote: > There's a specific Python gotcha involving memory allocation and > pymalloc, that'll manifest with large amounts of integers. > > http://evanjones.ca/python-memor

Re: [Tutor] Strange Question

2006-04-30 Thread Liam Clarke
e Django, as it plays nicely. :) Good luck and I look forward to questions to this list. :) Regards, Liam Clarke On 4/30/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > > First, I think this is a wonderful list. I always see great advice and > > great attitudes about helping

Re: [Tutor] How Big Is Too Big?

2006-04-29 Thread Liam Clarke
Hi John, For longer programmes, if posting here, I recommend using something like www.rafb.net/paste; having syntax highlighted (and not butchered by webmail!) is a great help. Regards, Liam Clarke On 4/29/06, John Connors <[EMAIL PROTECTED]> wrote: > G'day, > > Just wond

Re: [Tutor] Regex across multiple lines

2006-04-26 Thread Liam Clarke
27;t re.MULTILINE also be used? I've never really used that flag. Regards, Liam Clarke On 4/26/06, Frank Moore <[EMAIL PROTECTED]> wrote: > Kent Johnson wrote: > > >Use your compiled regex for the sub(), so it will have the DOTALL flag set: > >html_text = p.sub(replac

Re: [Tutor] Problem installing MySQLdb under windows

2006-04-25 Thread Liam Clarke
-python.exe-1.2.0.win32-py2.4.zip?download If you really need to compile it, grab mingw32 and use the --compiler option for setup.py i.e. setup.py build --compiler mingw32, but I've had heaps of trouble with including Python headers, so YMMV. Regards, Liam Clarke On 4/26/06, Peter Jessop &l

Re: [Tutor] Invoking Excel Macro

2006-04-25 Thread Liam Clarke
forums on the net. Good luck! Regards, Liam Clarke On 4/25/06, Mike Hansen <[EMAIL PROTECTED]> wrote: > I guess I'm confused. You mentioned that it still throws and error > while trying to save the workbook. hmmm Do you get this error when > trying to close Excel in the macro?

Re: [Tutor] need to automate connection

2006-04-25 Thread Liam Clarke
MAIL PROTECTED]" txt = "This is an email message" msg.set_payload(txt) c = smtplib.SMTP(ip) c.sendmail("[EMAIL PROTECTED]", "[EMAIL PROTECTED]", msg.as_string()) c.close() Regards, Liam Clarke On 4/25/06, Payal Rathod <[EMAIL PROTECTED]> wrote: > H

Re: [Tutor] Bug in python, or is it just 3am

2006-04-21 Thread Liam Clarke
1 Is saying "Make number equal number plus 1" Ha, it's all a learning experience. Regards, Liam Clarke On 4/21/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > > But when i use a number = number + 1 > > right after the value stays the same, > > I'm not

Re: [Tutor] Creating a graphical interface to database of gene coordinates

2006-04-21 Thread Liam Clarke
For graphing you can't really beat Scipy. On 4/22/06, Srinivas Iyyer <[EMAIL PROTECTED]> wrote: > Dear group, > I am happy that I am slowly finding pyhonian projects > related to my research area. > > Problem: > 1. I have a database of human gene coordinates on > chromosomes. > 2. I have gene exp

Re: [Tutor] Brain In Vice: Why is this so fun to me?

2006-04-20 Thread Liam Clarke
Argh, Kent's right. In my defense, I've only had one coffee so far. On 4/21/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > Liam Clarke wrote: > > Whereas \x1b\=.k\w*?0 would match it far more precisely, because > > that's the regex for > > > >

Re: [Tutor] GUI

2006-04-20 Thread Liam Clarke
drop interface; but you can still use wxPython method calls and objects directly if Pythoncard doesn't do what you want. Regards, Liam Clarke On 4/20/06, Valone, Toren W. <[EMAIL PROTECTED]> wrote: > So I have been how does wxPython measure to Tkinter or vice versa? > > -Ori

Re: [Tutor] Brain In Vice: Why is this so fun to me?

2006-04-20 Thread Liam Clarke
by the way, not an I. And * is very greedy, but a ? limits it's greediness greatly. Good luck, Liam Clarke On 4/21/06, doug shawhan <[EMAIL PROTECTED]> wrote: > I am discovering that. They tend to get all Ayn Rand on you and grab too > much. :-) > > > On 4/20/06, Li

Re: [Tutor] Brain In Vice: Why is this so fun to me?

2006-04-20 Thread Liam Clarke
rial as well. Great! > > > On 4/19/06, Liam Clarke <[EMAIL PROTECTED] > wrote: > > Here's my copy, it should work if you have Tkinter. > > > > Good luck! > > > > On 4/20/06, doug shawhan <[EMAIL PROTECTED]> wrote: > > > Drat, I insta

Re: [Tutor] Reqiest Centre - Adding New Call

2006-04-19 Thread Liam Clarke
. :-) ) Regards, an embarrassed Liam Clarke On 4/20/06, Bob Gailer <[EMAIL PROTECTED]> wrote: > Liam Clarke wrote: > > Hi, > > > > The categories of calls under this drop down box, are they going to > > increase anytime soon, or shall I go with what's there? >

[Tutor] Reqiest Centre - Adding New Call

2006-04-19 Thread Liam Clarke
Hi, The categories of calls under this drop down box, are they going to increase anytime soon, or shall I go with what's there? Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Brain In Vice: Why is this so fun to me?

2006-04-19 Thread Liam Clarke
Hi Doug, Best tip ever is your_python_dir\tools\scripts\redemo.py Interactive regexes. :) This is pretty good as well - http://www.amk.ca/python/howto/regex/ Good luck, Liam Clarke On 4/20/06, doug shawhan <[EMAIL PROTECTED]> wrote: > I think I'm going to have to suck it up

Re: [Tutor] GUI

2006-04-19 Thread Liam Clarke
f, but with the wxPython still lurking beneath the surface. Regards, Liam Clarke On 4/20/06, R. Alan Monroe <[EMAIL PROTECTED]> wrote: > >> If I can get it for free, I might as well go with say wxPython. Thanks > > > Yes, free as in beer, as in speech, and cross platform. Oh, an

Re: [Tutor] School Boy Error - Update

2006-04-17 Thread Liam Clarke
Dude, you've still got your trailing comma in stat. Get rid of it. If I jump into MySQL, here's an example - create table a (a int, b int); OK insert into a values (5, 4); OK insert into a values(5, 4,); Syntax error Try something like this - it's more scalable too. def generateSQL(data):

Re: [Tutor] School Boy Error

2006-04-15 Thread Liam Clarke
Wait, I have put you wrong there. Can you please copy and paste here the output of print liney[-1] Thanks, Liam On 4/16/06, Liam Clarke <[EMAIL PROTECTED]> wrote: > Hi John, > > Listy will be a list of lists, and the DBAPI specifies tuples. So > either change this - >

Re: [Tutor] School Boy Error

2006-04-15 Thread Liam Clarke
] Regards, Liam Clarke On 4/16/06, John CORRY <[EMAIL PROTECTED]> wrote: > > > > Thanks Brian for the help on the last one. I couldn't see the wood for the > trees. I have a tougher one for you. > > > > I am reading in a CSV file. Each line represents a line th

Re: [Tutor] Difficulty connecting with odbc drivers

2006-04-15 Thread Liam Clarke
According to the eGenix docs: Please refer to the ODBC manuals of your ODBC manager and database for the exact syntax of the DSN_string. It typically has these entries: 'DSN=datasource_name;UID=userid;PWD=password;' (case is important !). So, you've got DSN lowercase... On 4/16/06, John CORRY <

Re: [Tutor] PHP Functions in Python

2006-04-15 Thread Liam Clarke
Um. I suppose you could, but what are you trying to do? I'm fairly certain Python has similar functionality to PHP, and is a lot more straightforward than interfacing with a forked process. (Assuming you're using the PHP CLI and not talking PHP in Apache, etc.) On 4/15/06, Prabhakar K <[EMAIL PROT

Re: [Tutor] MySQLdb question

2006-04-14 Thread Liam Clarke
On 4/15/06, Patty <[EMAIL PROTECTED]> wrote: > Hi, > > I have a data structure in a python file that looks something like this: > > my_map= { "host1": {"target1", "target2", "target3" }, >"host2": {"target4", "target5", "target6" }, > } > > I have a method that has two parame

Re: [Tutor] Python performance resources & resouce usage hints

2006-04-07 Thread Liam Clarke
parated by seconds rather than milliseconds. Thanks for the assistance, I've now overcome my fear of blocking I/O :). Regards, Lia, Clarke On 4/8/06, Liam Clarke <[EMAIL PROTECTED]> wrote: > Thanks very much all. :) I'll have a crack this afternoon and let you know. > &g

Re: [Tutor] Python performance resources & resouce usage hints

2006-04-07 Thread Liam Clarke
Thanks very much all. :) I'll have a crack this afternoon and let you know. Kent - the increase in the queue size for the socket server is to allow for any delay in processing packets; it has a default queue size of 5 and then it starts rejecting packets; more of a safety policy when reducing CPU

[Tutor] Python performance resources & resouce usage hints

2006-04-07 Thread Liam Clarke
terpreter how often to perform these periodic checks." Should I even think about that? I'm not after performance so much as less utilisation of system resources... Much thanks for any guidance offered. Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Multi-thread environments

2006-03-31 Thread Liam Clarke
Thanks very much for that Kent, works fine and dandy now. >_< This is one to chalk up to experience. I copied the dicts as you said. Regards, Liam On 3/31/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > Liam Clarke wrote: > > Hi all, > > > > I'm working i

[Tutor] Multi-thread environments

2006-03-30 Thread Liam Clarke
f my hypothesis also gladly welcomed. I've spent about eight hours so far trying to debug this; I've never been this frustrated in a Python project before to be honest... I've reached my next skill level bump, so to speak. Much thanks, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Mysql BLOB strangeness?

2006-03-17 Thread Liam Clarke
Erk. MySQL 4. I imagine that has TEXT data-types also? On 3/18/06, Adam Cripps <[EMAIL PROTECTED]> wrote: > On 3/17/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > > Adam Cripps wrote: > > > On 3/17/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > > >>Why are you using a BLOB when the content is text?

Re: [Tutor] Sorting and secondary sorting.

2006-03-11 Thread Liam Clarke
Ahaha, thanks guys, I knew I was overlooking something. Regards, Liam Clarke On 3/12/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > Liam Clarke wrote: > > Hi all, > > > > I'm trying to think of a way to sort a list of dictionaries. In pseudo-code: > &g

[Tutor] Sorting and secondary sorting.

2006-03-11 Thread Liam Clarke
electing it back out with an ORDER BY clause, and then reconstituting it into dictionaries in a list. I get that "overlooking something simple" feeling on this one, so any assistance welcomed. I got lost with lists and lists of lists and joining lists back together, so I cheated and went the SQL way. Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Cannot Understand

2006-03-10 Thread Liam Clarke
On 3/11/06, Pawel Kraszewski <[EMAIL PROTECTED]> wrote: > Dnia piątek, 10 marca 2006 19:31, Edgar Antonio Rodriguez Velazco napisał: > > > f = lambda n: n-1 + abs(n-1) and f(n-1)*n or 1 > > Oh God! This smells lispish! Haven't seen a jevel like this before, but I LOVE > it! Haha, hey, I've been le

Re: [Tutor] Editing Pickled .dat files

2006-03-04 Thread Liam Clarke
ce] = definition print "\n\t'",sentence,"'", "Has been added to the dictionary." else: print "\n\tThat term already exists!" Once you're done, you just "repickle" the dictionary.

Re: [Tutor] Editing Pickled .dat files

2006-03-04 Thread Liam Clarke
Hi Ryan, Technically, you don't. You haul your dictionary out, as you're doing here - dictionary = cPickle.load(pickle_file) And when you're finished, you pickle it again. Regards, Liam Clarke On 3/5/06, ryan luna <[EMAIL PROTECTED]> wrote: > Hello, this is like m

Re: [Tutor] Pyexe

2006-03-04 Thread Liam Clarke
setup.py are in and I type: python setup.py py2exe at the command prompt. This runs py2exe, which, if everything goes well, creates a subfolder called dist. Everything in dist is what you need to distribute your script. Good luck, Liam Clarke On 3/4/06, ryan luna <[EMAIL PROTECTED]> wrote:

Re: [Tutor] Urgent - Using Threads for processing each single Packet ?

2006-03-04 Thread Liam Clarke
Hi Sudarshana, Out of curiosity, what are you building that requires you post 500 pages to a server at once? I apologise if the question is intrusive, but I can think of a few appns that involve that, and none of them are good. Regards, Liam Clarke On 3/4/06, Sudarshana KS <[EMAIL PROTEC

[Tutor] Fwd: Threading + socket server (blocking IO)

2006-02-19 Thread Liam Clarke
As requested. -- Forwarded message -- From: Kent Johnson <[EMAIL PROTECTED]> Date: Feb 20, 2006 2:39 PM Subject: Re: [Tutor] Threading + socket server (blocking IO) To: Cc: [EMAIL PROTECTED] Liam Clarke wrote: > Hi, > > > Just poking at threads, I'm contem

Re: [Tutor] Threading + socket server (blocking IO)

2006-02-19 Thread Liam Clarke
very unfamiliar territory, and I'm worried about sowing the seeds of my own destruction by being too clever/dumb. Regards, Liam Clarke On 2/19/06, Liam Clarke <[EMAIL PROTECTED]> wrote: > Thanks Kent, I'll try swapping it around and see how it goes. > > As for the

Re: [Tutor] Threading + socket server (blocking IO)

2006-02-18 Thread Liam Clarke
Thanks Kent, I'll try swapping it around and see how it goes. As for the setDaemon, my apologies. There's a while True: if msvcrt.kbhit(): break loop afterwards, so at a keypress it exits, hence the daemon stuff. On 2/19/06, Kent Johnson <[EMAIL PROTECTED]> wrot

Re: [Tutor] Threading + socket server (blocking IO)

2006-02-17 Thread Liam Clarke
pback, production will be sporadic packets via network or loopback, but I'm just being paranoid. Much thanks, Liam Clarke On 2/8/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > Liam Clarke wrote: > > On 2/7/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > > > >>

Re: [Tutor] Threading + socket server (blocking IO)

2006-02-06 Thread Liam Clarke
On 2/7/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > Liam Clarke wrote: > > Hi all, > > > > About to embark on my first foray into threading, and rather unsure of > > initial approach. I have a basic UDPServer from SocketServer running > > using serve_foreve

[Tutor] Threading + socket server (blocking IO)

2006-02-06 Thread Liam Clarke
N2001/ but I'm a little unsure as to what is possible. Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] mod_python and other web frameworks

2006-01-25 Thread Liam Clarke
choice in the end, good luck with the deep end approach. Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] strings & splitting

2006-01-25 Thread Liam Clarke
ything is whitespace delimited. I'd like to turn it into ["a", "=", "{", "b", "=", "1", "c", "=", "2", "d", "=", "{", "e", "=", "{", "

Re: [Tutor] mod_python and other web frameworks

2006-01-25 Thread Liam Clarke
http://digitalsouth.net.nz/~cyresse/index.htm that I've been playing with. Normally it works. ;) Django is also worth having a look at, but it's a bit sharper to learn The Turbogears Google group is really supportive, by the way. Regards, Liam Clarke On 1/26/06, Intercodes <[EMAIL PROTECTE

[Tutor] strings & splitting

2006-01-25 Thread Liam Clarke
down to 3 seconds now, but I'm trying to get... a stable solution, if possible an elegant solution.The current one is prone to breaking based on funny whitespace and is just ugly and prickly looking. Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] [OT] How to report issues with Standard library modules

2006-01-17 Thread Liam Clarke
h software that assumes everyone loves dialogs. Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] setuptools question

2006-01-16 Thread Liam Clarke
How were you calling easy_install? On 1/16/06, Shuying <[EMAIL PROTECTED]> wrote: > Hi, > > I'm not sure where's the best place to ask so I thought I'd try it > here. I've got python2.3 and python2.4 installed on my machine and > I'm trying to upgrade setuptools for both versions of python. So I'

Re: [Tutor] Complete programming newbie requires tutorial. (Chris Andrew)

2006-01-16 Thread Liam Clarke
I also highly recommand Alan Gauld's tutorial - http://www.freenetpages.co.uk/hp/alan.gauld/ On 1/16/06, Ron Sheely <[EMAIL PROTECTED]> wrote: > Two things. > > First, I've been watching this list for several weeks now. I wanted to > respond to Chris Andrew's question regarding Python tutorials (

[Tutor] Locating directory of script?

2006-01-11 Thread Liam Clarke
far I've found that import inspect class Foo: pass sourceP = inspect.getsourcefile(Foo) works, but I'm not too sure how resilient that is... Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] need help with syntax

2006-01-11 Thread Liam Clarke
Does that make sense? I hope so... but suffice to say - struct.calcsize() ensures cross platform compatibility... I tend not to use the endian identifier unless I'm dealing with a data source that will always, absolutely be a certain endianess, saves having to rejig your patter

Re: [Tutor] How can I make a python script go directory by directory and excecute on files of choice

2006-01-10 Thread Liam Clarke
a look at the .XLS specifications; there'll probably be a sequence of identifying bytes you can read to confirm that it's an XLS. Regards, Liam Clarke On 1/11/06, Srinivas Iyyer <[EMAIL PROTECTED]> wrote: > Dear group, > I have Excel files that are arranged according

[Tutor] Fwd: need help with syntax

2006-01-10 Thread Liam Clarke
oops, forward to list. -- Forwarded message -- From: Liam Clarke <[EMAIL PROTECTED]> Date: Jan 11, 2006 4:18 PM Subject: Re: [Tutor] need help with syntax To: bill nieuwendorp <[EMAIL PROTECTED]> On 1/11/06, bill nieuwendorp <[EMAIL PROTECTED]> wrote: >

Re: [Tutor] Writing/reading lists to a file

2005-12-27 Thread Liam Clarke
] >>> d [[1, 2, 3], [4, 5, 6], [7, 8, 9]] >>> print d[0][1] 2 >>> f = file("filetosaveto","wb") >>> cPickle.dump(d, f) >>> f.close() >>> del d >>> f = file("filetosaveto","rb") >>> newD

Re: [Tutor] Sets and Python; new shiny tool syndrome?

2005-12-27 Thread Liam Clarke
On 12/28/05, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > I just tried out sets for the first time, and I'm finding multiple uses > > for them, particularly for replacing and simplifying what would normally > > be one or two list comprehensions i.e. > > > > def parseKws(self, kw_data): > >

[Tutor] Sets and Python; new shiny tool syndrome?

2005-12-27 Thread Liam Clarke
for item in l if not (item in ignoreSet or item in kws) ] kws.extend(k) (Above just gets module names from various import statements.) However, I'm reminded of the joke about you can tell what chapter someone reading the Patterns book by the Gang of Four is up to by what new pa

Re: [Tutor] RegEx query

2005-12-19 Thread Liam Clarke
ngaged email before brain again. I do like BeautifulSoup, however. Although people keep telling about some XPath programme that's better, apparently, I like BeautifulSoup, it works. Regards, Liam Clarke On 12/18/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Liam Clarke wrote: &g

[Tutor] RegEx query

2005-12-17 Thread Liam Clarke
ot;:pattern} ) will only return the first found tag. Is the regex only evaluated once or similar? (Also any pointers on how to get negative lookahead matching working would be great. the regex (/thread/[0-9]*)(?!\/) still matches "/thread/28606/" and I'd assumed it wouldn't. Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python - SQL paradigm (Will I need a hammer to make it fit?)

2005-12-16 Thread Liam Clarke
On 12/16/05, bob <[EMAIL PROTECTED]> wrote: > At 02:14 AM 12/14/2005, Liam Clarke wrote: > >Hi all, > > > >Just contemplating. > > > >If in Python I were organising a data index along the lines of - > > > >j = { > > > >"k_word1&

[Tutor] Python - SQL paradigm (Will I need a hammer to make it fit?)

2005-12-14 Thread Liam Clarke
2 rec3 rec4 And then querying each table for that primary key and then once again, return results in order of number of matches to keywords. Have I aroused anyone's Code Smell nose yet? Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] smtplib mail header problem

2005-12-10 Thread Liam Clarke
Ah, good to hear. I like it when stuff gets fixed. :-) On 12/10/05, dave s <[EMAIL PROTECTED]> wrote: > On Wednesday 07 December 2005 22:47, Liam Clarke-Hutchinson wrote: > > Heheh, yah, the Python docs take a bit of scrutinisation to yield fruit. > > Also, when workin

Re: [Tutor] bnf

2005-12-10 Thread Liam Clarke
k of "read them really carefully, because the important bits usually aren't bullet-pointed for you" is the best one. Which reminds me of why Powerpoint is considered harmful. regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Timer

2005-12-06 Thread Liam Clarke-Hutchinson
Hi, time.sleep() takes an argument as seconds. Regards, Liam Clarke -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of bob Sent: Wednesday, 7 December 2005 3:59 p.m. To: Joseph Quigley; tutor@python.org Subject: Re: [Tutor] Timer At 06:57 AM 12/6

Re: [Tutor] smtplib mail header problem

2005-12-06 Thread Liam Clarke-Hutchinson
ss is that the spam agent is checking that from_addr, and getting an invalid email address and spitting the dummy. Most ISPs won't allow an invalid from_addr, although mine does.. Regards, Liam Clarke-Hutchinson -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On B

Re: [Tutor] smtplib mail header problem

2005-12-06 Thread Liam Clarke-Hutchinson
Hi Dave, IIRC The first argument to sendmail() is the name of the account that's sending... So when you include your subject there, it seems your ISP is somewhat forgiving. Liam Clarke-Hutchinson| Contact Centre Advisor| Ministry of Economic Development DDI +64 3 962 2639 | Fax +64 3 962

[Tutor] Search theory for luddites?

2005-12-04 Thread Liam Clarke
routing a connection over a network, though.) Can anyone recommend a good introduction to the theory of searching? I really need to take some Computer Science courses. Regards, Liam Clarke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] problem with IDLE

2005-12-01 Thread Liam Clarke-Hutchinson
Title: Message IDLE uses localhost (a loopback port 127.0.0.1) to communicate with running scripts (so interrupt keys and debugging calls get passed etc.) It's a nice cross platform method of interprocess communication.   So yeah, 127.0.0.1 is the one. Regards, Liam Clarke-Hutch

Re: [Tutor] Class Inheritance -> NameError

2005-11-30 Thread Liam Clarke-Hutchinson
__ method, then you'll need to call it specifically, or otherwise you'll get a UnboundLocalError, because self.__val/val won't exist. Liam Clarke-Hutchinson -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Johnson Sent: Thursday, 1 Dec

Re: [Tutor] Read Excel file without COM

2005-11-29 Thread Liam Clarke-Hutchinson
xcel and COM is designed for your problem... Alternatively check PyPI, I'm sure there's something that will do what you want, but most of what you find will probably just use the Win32 package instead of reinventing the wheel. Regards, Liam Clarke -Original Message- From: [EMAIL

Re: [Tutor] getattr of functions

2005-11-24 Thread Liam Clarke
What do you mean enabled? If it's imported into the namespace you can call it... Err, can you clarify on the enabling, what context are you using it in, and what are you trying to achieve? On 11/25/05, Negroup - <[EMAIL PROTECTED]> wrote: > Hi all! I'm here again with a question about introspec

Re: [Tutor] Newbie question

2005-11-22 Thread Liam Clarke-Hutchinson
4\Python %1 %2 %3 %4 %5 %6 %7 %8 %9 pause   or similar... Regards, Liam Clarke-Hutchinsonwww.med.govt.nz -Original Message-From: bob [mailto:[EMAIL PROTECTED] Sent: Wednesday, 23 November 2005 10:44 a.m.To: Liam Clarke-Hutchinson; 'Douglass, Erik'; 'tutor

Re: [Tutor] Newbie question

2005-11-22 Thread Liam Clarke-Hutchinson
.   It's not trivial when you're starting. :-)   Regards, Liam Clarke-Hutchinson -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Douglass, ErikSent: Wednesday, 23 November 2005 3:03 a.m.To: tutor@python.orgSubject: [Tutor] Newbie question

Re: [Tutor] smtplib alternative???

2005-11-20 Thread Liam Clarke-Hutchinson
uot;From" field is very useful for automated emailing. (By which I don't mean spam, but those emails from [EMAIL PROTECTED]) Regards, Liam Clarke -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Adisegna Sent: 20 November 2005 14:26 To: Danny Yoo C

Re: [Tutor] Website monitoring program.

2005-11-20 Thread Liam Clarke-Hutchinson
Ah, this kind of programme would be so much simpler if Last-Modified and ETag were commonly used *sigh*. Unfortunately, advertising kinda killed it... I recommend www.watchthispage.com if you just need a quick update without killing your own bandwidth. Regards, Liam Clarke-Hutchinson

Re: [Tutor] building nonbinary trees

2005-11-17 Thread Liam Clarke-Hutchinson
Erm, a dictionary of names to references? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vincent Wan Sent: Friday, 18 November 2005 2:21 p.m. To: tutor@python.org Subject: [Tutor] building nonbinary trees I would like to have a tree data structure w

Re: [Tutor] Newb ?

2005-11-17 Thread Liam Clarke-Hutchinson
ometimes to refactor some of the ones I come up with, however. Good rule of thumb is when you're feeling impressed with your own cleverness, you probably need to refactor. (Thanks c2 wiki, for teaching me that.) -Original Message- From: Christian Wyglendowski [mailto:[EMAIL PR

Re: [Tutor] compiled images

2005-11-17 Thread Liam Clarke-Hutchinson
Hehe, Sounds like someone's license was designed for C/C++. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fred Lionetti Sent: Friday, 18 November 2005 8:29 a.m. To: tutor@python.org Subject: [Tutor] compiled images Hi everyone, Thanks everyone fo

Re: [Tutor] Newb ?

2005-11-17 Thread Liam Clarke-Hutchinson
How about - print "\n\nWelcome to the Backwards Message Display." print message = raw_input("\nPlease Enter a Message.") msgAsList = [ char for char in message] msgAsList.reverse() reversedMessage = ''.join(msgAsList) I can't test that, but it should work. But, with regard to - > print "\n\nWel

  1   2   3   4   5   >