Re: [Tutor] calling class instances in functions

2007-09-11 Thread John Fouhy
(self): self.yeast = None def setYeast(self, yeast): self.yeast = self.yeasts[yeast]() w = World() w.setYeast('good') ## But I confess that I have not read or run your code, so I'm not sure if this is the best way forward for you.. -- John

Re: [Tutor] Making a python script to feed files into another python script

2007-09-10 Thread John Fouhy
os.system('python %s %s %s' % (script2, input, output)) 2. You can import your second script and call its main function directly. How well this works will depend on the structure of the second script. -- John. ___ Tutor maillist - Tutor

Re: [Tutor] making math problems mmmm fun

2007-09-10 Thread John Fouhy
On 11/09/2007, max baseman [EMAIL PROTECTED] wrote: basically the problem is to find a bunch of ways to put 1,2,3,4,5 into different math problems to that equal 1-25, i haven't spent to much time thinking about how to do this but i cant think of a way to do it it without writing making the

[Tutor] dynamic attribute assignment

2007-09-06 Thread John
I've just noticed that you can use the import statement to import variables, such that a simple file such as vars.py: # File with predefined variables var1= 'some text' var2= 2 var3=['a','b','c'] Would then, upon import, provide: vars.var1 'some text' vars.var2 2 vars.var3 ['a','b','c'] This

[Tutor] more on reading binary... a better way?

2007-09-05 Thread John
Hello everyone, Here's my solution for reading binary data (unformatted mixed types) and packing it into a dictionary. It works, but somehow doesn't seem so 'pythonic'. Just seeking comments on how I might make it more efficient. Thanks! def readheader(filename): import struct

[Tutor] binary data struct module

2007-09-03 Thread John
Hello, I have an unformatted mixed type binary file I'm trying to read into Python. So far, I've gotten as far as: f2=file(infile,'rb') Dfmt=['3i','13s','7i','2f','2i','2f','2i','i'] #format for binary reading first bits if f2: print infile + ' has been opened' #for ft in Dfmt: #

Re: [Tutor] A replacement for a for loop

2007-08-28 Thread John Fouhy
, attrs[key]) -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] validation

2007-08-27 Thread John Fouhy
the pythonic way to check is to catch the exception: while True: user_input = raw_input() try: num = int(user_input) break except TypeError: print 'Oops, try again!' HTH! -- John. ___ Tutor maillist - Tutor@python.org http

Re: [Tutor] tagging pieces of information

2007-08-27 Thread John Fouhy
for an object: select tag from tagTable where objectID = ? Find objects matching a tag: select objectID from tagTable where tag = ? -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] A fun puzzle

2007-08-22 Thread John Fouhy
for n in xrange(1,101) if str(n) != str(n)[::-1] and n % int(str(n)[::-1]) == 0 and n % 10 != 0] [8712, 9801, 87912, 98901, 879912, 989901] :-) -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] A fun puzzle

2007-08-22 Thread John Fouhy
/Reversal.html -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Data Gathering

2007-08-19 Thread John Fouhy
then need to look into python libraries like urllib. (actually, with some sites, you could get by without form submission. Eg, for Wikipedia, you would just need to fetch the url 'http://en.wikipedia.org/wiki/Special:Search?search=%s' % searchString) -- John

Re: [Tutor] xls file

2007-08-15 Thread John Fouhy
Really? What are you having trouble with? I have used pyexcelerator under Windows without problems. -- John. On 16/08/07, Kirk Bailey [EMAIL PROTECTED] wrote: looks good. works bad; this is a windows workplace. ouch. Advice please (other than change operating systems)? John Fouhy wrote

Re: [Tutor] Need to convert 1,987,087,234,456 to an int

2007-08-15 Thread John Fouhy
) Instead, do this: decomma(*n) 1234567 -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need to convert 1,987,087,234,456 to an int

2007-08-15 Thread John Fouhy
, which means that using '8' or '9' is a syntax error. Also, even if you don't get the syntax error, the numbers will come out differently. decomma(1,024) 120 It'll be fixed in Python 3000 :-) -- John. ___ Tutor maillist - Tutor@python.org http

Re: [Tutor] Need to convert 1,987,087,234,456 to an int

2007-08-15 Thread John Fouhy
/2007-April/053725.html -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to parse and extract data from a log file?

2007-08-07 Thread John Fouhy
. I encourage you to go through the tutorial :-) -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] sqlite: does ? work in PRAGMA commands?

2007-08-02 Thread John Fouhy
I'm not sure about PRAGMA, but you can do introspection in sqlite by examining the table 'sqlite_master'. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] sqlite: does ? work in PRAGMA commands?

2007-08-02 Thread John Fouhy
On 03/08/07, Terry Carroll [EMAIL PROTECTED] wrote: On Thu, 2 Aug 2007, John Fouhy wrote: I'm not sure about PRAGMA, but you can do introspection in sqlite by examining the table 'sqlite_master'. Thanks. That's how I get the table names, actually. But it doesn't give the column names

Re: [Tutor] passing form data into a class

2007-07-31 Thread John Fouhy
On 01/08/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: John, I spent the last two hours trying to understand what you wrote, and I feel I'm missing something: a_dict = {'one':1, 'two':2, 'three':3} class A(object): def __init__(self, **kwargs): for var in kwargs

Re: [Tutor] What exactly is [::-1]?

2007-07-26 Thread John Fouhy
/typesseq.html -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Platform-independent Excel reader

2007-07-14 Thread John Fouhy
On 13/07/07, encore jane [EMAIL PROTECTED] wrote: Does anyone know about a good native Excel file reader that is platform independent? I have had success with pyExcelerator: http://sourceforge.net/projects/pyexcelerator -- John. ___ Tutor maillist

Re: [Tutor] reading random line from a file

2007-07-14 Thread John Fouhy
the whole index file (which will be much shorter than the main quote file), select one at random, then use .seek() and .read() to read just the bytes you are interested in from the main file. -- John. ___ Tutor maillist - Tutor@python.org http

Re: [Tutor] Question regarding syntax

2007-07-12 Thread John Morris
On 7/11/07, Andre Roberge [EMAIL PROTECTED] wrote: It is a standard convention. Lots of tools are built on the assumption that translatable strings are going to be enclosed in _(...) These tools extract the strings from programs, and put them in files (.po) that are easily editable by human

Re: [Tutor] Here is newbie doc on how to implement generators

2007-07-12 Thread John Fouhy
(TREE): print value ### treetest.py # HTH! -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Making Incremental Filenames

2007-07-11 Thread John Fouhy
, ...) Check the python docs (library reference, under Sequence types) for more information. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Question regarding syntax

2007-07-11 Thread John Morris
I'm editing some code from Mailman and seeing: legend = _(%(hostname)s Mailing Lists) Can anyone tell me what the _( means in that context? Thanks, John ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Question regarding syntax

2007-07-11 Thread John Morris
On 7/11/07, Dave Kuhlman [EMAIL PROTECTED] wrote: On Wed, Jul 11, 2007 at 11:03:18AM -0400, John Morris wrote: I'm editing some code from Mailman and seeing: legend = _(%(hostname)s Mailing Lists) The outer parentheses are a function call. The underscore is a name that has a callable

Re: [Tutor] green brackets?

2007-07-11 Thread John
This is how you put a newline or linebreak in a string: \n -just adding that for someone's search later on, since 'newline' and 'linebreak' hadn't been mentioned yet ;) (Should I be doing something else!?) ___ Tutor maillist - Tutor@python.org

[Tutor] An interesting case... of east vs. west

2007-07-10 Thread John
all North. However, the West / East issue is another story. Anyone have a more elegant solution? -john ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] An interesting case... of east vs. west

2007-07-10 Thread John
Just a quick follow up.. it doesn't work :s There are definitely some problems... ideas are welcome! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] An interesting case... of east vs. west

2007-07-10 Thread John
Weiss [EMAIL PROTECTED] wrote: John: One way to handle the situation of longitude is to make everything west of the Greenwich meridan a negative value until -180 degrees and everything east of Greenwich a positive value. HTH. Albert *John [EMAIL PROTECTED]* Sent by: [EMAIL PROTECTED

Re: [Tutor] An interesting case... of east vs. west

2007-07-10 Thread John
A little closer, this seems to work, but it's not catching the 'W' or 'S' cases to make it negative... for i in range(0,20): y=d[i][2].split('\xb0') x=d[i][3].split('\xb0') ydeg,ymin=int(y[0].rstrip()),float(y[1].strip('\' N')) xdeg,xmin=int(x[0].rstrip()),float(x[1].rstrip(\'

Re: [Tutor] An interesting case... of east vs. west

2007-07-10 Thread John
I will work with this further, and report back once I find Alan's method... but for now, this seems to work: for i in range(0,20): y=d[i][2].split('\xb0') x=d[i][3].split('\xb0') ydeg,ymin=int(y[0].rstrip()),float(y[1].strip('\' N')) xdeg,xmin=int(x[0].rstrip()),float(x[1].rstrip(\' E).rstrip(\'

Re: [Tutor] file methods

2007-07-09 Thread John Fouhy
the variable 'line' to each line of the file in turn. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] file methods

2007-07-09 Thread John Fouhy
, not a file-like object. This also causes the behaviour you get when iterating 'for line in file'... -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How can I escape a pound symbol in my script?

2007-07-05 Thread John Fouhy
On 06/07/07, Richard Querin [EMAIL PROTECTED] wrote: I'm writing a very simple python script which writes out some predefined text to a file (which will later become part of an html file). I need to write out a pound sign '#' to the file and I can't figure out how to escape it. I've tried '\#'

Re: [Tutor] Help! Pickle file

2007-07-04 Thread John Fouhy
# If you run the first script, it will create a pickle of the list ['one', 'two', 'three']. You'll be able to see the file in the directory where you ran the script; you can even look at it if you like. The second script will read the pickle and reconstruct the list. Hope this helps! -- John

Re: [Tutor] optimization: faster than for

2007-07-01 Thread John Fouhy
? It's IPython -- http://ipython.scipy.org/moin/ -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Iterating through two lists at the same time with manipulation..

2007-06-28 Thread John Fouhy
into a sqlite in-memory database, then use SQL to pull it back out. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Getting at sqlite schema info from within Python?

2007-06-25 Thread John Fouhy
On 26/06/07, Terry Carroll [EMAIL PROTECTED] wrote: Is there any way of getting to the schema of an sqlite database from within Python? In particular, a list of tables in the DB. Try 'select * from sqlite_master'. -- John. ___ Tutor maillist

Re: [Tutor] executionable file

2007-06-22 Thread John Morris
don't know of a equivalent for Unix/Linux platforms, however. HTH, John ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] using shelve

2007-06-21 Thread John Fouhy
msec per loop So, that's about a factor of 25 difference. HTH! -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] AttributeError: 'list' object has no attribute 'capitalize'

2007-06-20 Thread John Fouhy
. capwords = [s.capitalize() for s in raw.split()] # this will give you a list of capitalized words capstr = ' '.join(capwords)# join them together, with spaces between -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman

Re: [Tutor] iterating over a sequence question..

2007-06-17 Thread John Fouhy
module. I don't have the ability to test this right now, but try something like: import itertools lst = [1,2,3,5] t = ('r', 'g', 'b') itertools.izip(lst, itertools.cycle(t)) -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman

Re: [Tutor] capwords, maketrans

2007-06-13 Thread John Fouhy
constants that are quite useful. Only those string functions that exist as string methods (and are on the deprecated list) will eventually die. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Best way to POST XML to CGI

2007-06-07 Thread Ertl, John C CIV 63134
. My guess is I am missing something about how cgi can work. I bet Python has a simple way to receive a XML post so I do not have to look for a specific form name? Any help would be appreciated. Thanks, John Web page code to post XML in a text area form action=http:///cgi-bin

Re: [Tutor] Multi-line comments?

2007-06-06 Thread John Fouhy
the module docstring, 'help(Foo.Foo)' would give me the class docstring, and so on. Check out the source code for python modules on your system (in the lib directory of your install) for lots of examples. -- John. ___ Tutor maillist - Tutor

[Tutor] problem with mmap

2007-05-30 Thread Ertl, John C CIV 63134
as this code but I do not even get to that part...the mmap call is bad. I have never used mmap before so this is new to me. I am running python 2.4 John # code from mmap import mmap import os from bisect import bisect_left import sys class Zipcodes(object): Use mmap to treat

[Tutor] I'm clearly not getting an important pygtk concept

2007-05-25 Thread John
unfortunately. Sometimes pressing the button registers in my logs and sometimes it does not. Pressing the button twice in rapid succession may cause a hit to register if a single click did not. Pressing the button 5 or 6 times will cause 4 or 5 hits. What is it I am not understanding? John

[Tutor] for k,v in d: ValueError: too many values to unpack

2007-05-21 Thread John Washakie
I have a Dictionary, that is made up of keys which are email addresses, and values which are a list of firstname, lastnamet, address, etc... If I run the following: #! /bin/python import csv last = {} rdr = csv.DictReader(file(reg-data.csv)) for row in rdr: #print row

Re: [Tutor] for k,v in d: ValueError: too many values to unpack

2007-05-21 Thread John Fouhy
On 22/05/07, John Washakie [EMAIL PROTECTED] wrote: I have a Dictionary, that is made up of keys which are email addresses, and values which are a list of firstname, lastnamet, address, etc... If I run the following: last = {} [...] for k,v in last: print Email: %s , has the Last

[Tutor] pywinauto for OS X and Linux?

2007-05-18 Thread John
I have been playing with pywinauto http://pywinauto.pbwiki.com/ for a few hours. Pywinauto allows you to use python to automate the GUI of Windows using Python in very intuitive ways. What are the closest analogs for this under OS X and Linux? John

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

2007-05-14 Thread John Fouhy
, despite being divisible by 4. But y2k was a leap year, because it was a multiple of 400. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Running and passing variables to/from Fortran

2007-05-12 Thread John Washakie
WAY too large a project I'm afraid. Yes, that would be the one which would make me an 'expert' in Python ;) Too bad there's just no time right now... On 5/10/07, Bob Gailer [EMAIL PROTECTED] wrote: John Washakie wrote: I have access to the source code. Did you tell us why you want to keep

Re: [Tutor] Inherit from int?

2007-05-12 Thread John Fouhy
special. Check out this page; it may help you: http://www.python.org/download/releases/2.2.3/descrintro/#__new__ -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] whats the best way to structure my data?

2007-05-10 Thread John Fouhy
of tuples. Each element is a triple (value, text, time). measurements = [] Then, later on, when you get a new measurement, something like: measurements.append((value, text, time)) You can find the mean in the same way: mean = sum(m[0] for m in measurements)/len(measurement) -- John

Re: [Tutor] whats the best way to structure my data?

2007-05-10 Thread John Fouhy
the timeit module. Type 'import timeit' and then 'help(timeit)' from the python interpreter. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Running and passing variables to/from Fortran

2007-05-09 Thread John Washakie
I have access to the source code. And I probably could pass the data to stdout, so maybe .popen would work! I'll have a look... thanks! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Alright... I'm new...

2007-05-09 Thread John Washakie
I want to create a fully functional program that actually does something USEFUL. And just what would that be? Ask yourself that.. then perhaps folks on the list could guide you in the right direction... -j ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Newbie Question on Exceptions...

2007-05-08 Thread John Fouhy
of this in the Cookbook and the Nutshell for something more about error-checking strategies. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] canvas - make an object 'seem' to move

2007-05-07 Thread John Fouhy
of actor self.xp = 100 self.yp = 600 # create maze, etc. def onClickVertical(self, newY, xp, yp): # etc HTH! -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Running and passing variables to/from Fortran

2007-05-06 Thread John Washakie
I have a FORTRAN program which reads in unformatted sparse matrix data. Rather than rewriting the code in Python, I was hoping there is a way to call the Fortran program, passing filename variables TO Fortran, and returning the data (which is an array) back to my .py code for use there. Is there

[Tutor] New York City Python Users Group Meeting - Tuesday May 8th

2007-05-03 Thread John Clark
/nycpython/ Hope to see you there! -John ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] canvas - make an object 'seem' to move

2007-05-03 Thread John Fouhy
(dur/step) # you may need to add a call to canvas1.update_idletasks() here # untested HTH! -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] if in an iteration, quick Q!!

2007-05-01 Thread John Washakie
I can't recall how to do this: I want: a = [int(x) for x in tmp] but, my tmp has some empty elements, so it fails... Therefore I want to be able to say: a = [int(x) for x in tmp IF x in tmp] I know there's a way! Ive seen it before, but now cannot find it! 'if' is a pretty generic thing to

Re: [Tutor] if in an iteration, quick Q!!

2007-05-01 Thread John Washakie
Thanks Depending on what an 'empty' element is you may have to refine that. I also noted, if I used: tmp = data[6].strip().split() rather than: tmp = data[6].strip().split(' ') I eliminated the 'empty' elements... ___ Tutor maillist -

Re: [Tutor] Running a program

2007-05-01 Thread John Washakie
Jessica, Assuming you have python installed on your system (Windows?, *nix?), then all you have to do is double click the .py file and it will run. If you want, you can run it from the command line: C:\ python yourfile.py On 5/1/07, Jessica Brink [EMAIL PROTECTED] wrote: I know this

[Tutor] Aaagh! Stack arrays!?! calc average

2007-05-01 Thread John Washakie
Hello, I'm trying to calculate an average for columns in my array(data), there's a catch though, I want to create a new array of shorter length (NOTE: this crashes at line 8): 1) tinit = data[0][0] 2)for d in data: 3)if d[0] = tinit+60: 4)sum = sum+d 5)else: 6)

Re: [Tutor] Aaagh! Stack arrays!?! calc average

2007-05-01 Thread John Washakie
Thanks for the feedback, The average was a little bit goofed up. Here's what I have now: for d in data: if d[0] = tinit+60: d = column_stack(d) cnt=cnt+1 sum = sum+d else: avg = sum/cnt if init==0: newData =

Re: [Tutor] Aaagh! Stack arrays!?! calc average

2007-05-01 Thread John Washakie
Ug, It still doesn't make sense due to the sum/cnt where cnt is just an int, and sum is a 1-dimensional array! I'm missing something here about working with numpy arrays... ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Aaagh! Stack arrays!?! calc average

2007-05-01 Thread John Washakie
It aint pretty! And if I had just walked away, it probably would've taken half the time in the morning, but here's what I've come up with (any suggestions for improvements, or course are welcome): for d in data: w = len(d) if d[0] = tinit+60: d = column_stack(d)

Re: [Tutor] Aaagh! Stack arrays!?! calc average

2007-05-01 Thread John Washakie
And of course, thanks all! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Aaagh! Stack arrays!?! calc average

2007-05-01 Thread John Fouhy
On 02/05/07, John Washakie [EMAIL PROTECTED] wrote: It aint pretty! And if I had just walked away, it probably would've taken half the time in the morning, but here's what I've come up with (any suggestions for improvements, or course are welcome): I'm still not sure exactly what you want

[Tutor] listing files in an html directory

2007-04-29 Thread John Washakie
Hello all, I'm trying to write a program which will take a path, look in it for all files matching a certain pattern, then create javascript player to play them. A key part of the code at this point is: searchPath = imageRoot + '*' + imgExt avail = glob.glob(searchPath) #will glob work over

[Tutor] a way to glob over http?

2007-04-26 Thread John Washakie
directories on http servers are not readable, even if a readable image is located in them... but that's another question for another time. Thanks, john ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] best search/replace method?

2007-04-25 Thread John Washakie
be three lines: cat raw.html | sed 's/ImagePathReplaceMe/NewPathToImage/g' | sed 's/TitleReplaceMe/NewTitle/g' new.html However, this is going to be part of an Plone product so I want to use Python. What is the best method to accomplish this? Thanks, john

Re: [Tutor] best search/replace method?

2007-04-25 Thread John Washakie
, John Washakie [EMAIL PROTECTED] wrote: cat raw.html | sed 's/ImagePathReplaceMe/NewPathToImage/g' | sed 's/TitleReplaceMe/NewTitle/g' new.html One line's sufficient: sed -e 's/ImagePathReplaceMe/NewPathToImage/g;s/TitleReplaceMe/NewTitle/g' raw.html new.html However, this is going

Re: [Tutor] best search/replace method?

2007-04-25 Thread John Washakie
Excellent. Thanks Luke, that seems to be working On 4/25/07, Luke Paireepinart [EMAIL PROTECTED] wrote: John Washakie wrote: Tested. Failed... I thought it would be something like that, but that doesn't work.. perhaps because 'ImagePathReplaceMe' isn't separate from the rest

Re: [Tutor] Averaging a list of lists with a listcomp?

2007-04-25 Thread John Fouhy
) for x in zip(*orig)] [30, 20, 50] HTH! :-) -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tkinter import error

2007-04-24 Thread John DeStefano
Michael Lange [EMAIL PROTECTED] wrote: Usually there is no need to pass extra arguments to configure. My guess is that you missed to install Tcl / Tk and/or the Tcl/Tk development packages before compiling python. That was it: I had both Tcl and Tk installed, but not the development packages

[Tutor] Tkinter import error

2007-04-23 Thread John DeStefano
, and it is there (dated the last time I recompiled Python 2.5). What else can I try? Thank you, ~John ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tkinter import error

2007-04-23 Thread John DeStefano
Python interpreter to use, I believe, so you could direct it at one of your other installs for now until you get 2.5 working I think it's more of a system/configuration problem than one specifically with 2.5. The other Python versions give the same exact error. Thanks, ~John

Re: [Tutor] Exceptions while dealing with MySQL

2007-04-22 Thread John Clark
that there is a text book out there called Database Access Patterns, can anyone provide a recommendation or a critique of the book? Are there other (better) references I should be consulting in designing the database interaction layer of my application? Thanks, -John Clark

[Tutor] read text file in zip archive, process, plot

2007-04-15 Thread John W
Kent and Alan: better? .j import zipfile import os import pylab as P iFile = raw_input(Which file to process?) def openarchive(filename): open the cmet archive and read contents of file into memory z = zipfile.ZipFile(filename, r) for filename in z.namelist(): print filename

[Tutor] ANN: Next NYC Python User Group meeting, Tues May 8th, 2007, 6:30 pm

2007-04-11 Thread John Clark
to give to building security to make sure you can gain access to the building. RSVP to [EMAIL PROTECTED] to add your name to the list. More information can be found on the yahoo group page: http://tech.groups.yahoo.com/group/nycpython Hope to see you there! -John _ From: [EMAIL

Re: [Tutor] kwds

2007-04-10 Thread John Fouhy
:-) -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Addressing a variable whose name is the value of a string

2007-04-08 Thread John Clark
Bob Gailer wrote: Andreas Pfrengle wrote: Hello, I want to change the value of a variable whose name I don't know, but this name is stored as a string in another variable, like: x = 1 var = 'x' Now I want to change the value of x, but address it via var. exec is the statement for doing

Re: [Tutor] windows and python and shebangs, oh my!

2007-04-05 Thread John Clark
Be aware that by default the Apache web server _WILL_ use the shebang line even when running on Windows to try to find the Python interpreter when python is run as a CGI script. There is a setting in the configuration file that controls whether to use the shebang line or to reference the

[Tutor] New York City Python Users Group Meeting

2007-04-04 Thread John Clark
/nycpython/ Hope to see you there! -John ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] windows and python and shebangs, oh my!

2007-04-04 Thread John Fouhy
). -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] passing arguments via an instance of a class

2007-04-03 Thread John Fouhy
where the NameError occurs) -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] or

2007-03-29 Thread John Fouhy
option, using the in operator: for f in fruit: if f not in [apples, pairs]: print f, is not an apple or pair. HTH! -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Filesystem vs Database vs Lucene

2007-03-28 Thread John Fouhy
python modules in C and incorporate them into your python programs. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to set value back to .conf file

2007-03-20 Thread John Fouhy
. To continue your example, you can do this: f = open('test.conf', 'w') conf.write(f) f.close() -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] The whole Roman to Dec and vice versa issue

2007-03-11 Thread John Fouhy
the same. [note that this code will not produce strings like 'IV' for 4. OTOH, as I recall, the Romans didn't do that consistently either..] -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] The whole Roman to Dec and vice versa issue

2007-03-11 Thread John Fouhy
for this one too. Ahh, good point. I was thinking in terms of extra logic to figure out the subtraction rules, but you could just use extra symbols :-) -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] String-manipulation question

2007-03-11 Thread John Fouhy
this; look about half-way down the page: http://docs.python.org/tut/node5.html HTH! -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] trouble with function-- trying to check differences btwn 2 strings

2007-03-06 Thread John Fouhy
= [1,2,3,4] 555 == 555 in lst False (555 == 555) in lst True 1 == 1 in lst True (this works because 1 == True) -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] sorting question

2007-03-06 Thread John Fouhy
from foo order by whatever limit 5'. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

<    1   2   3   4   5   6   7   8   9   10   >