Re: Package organization

2006-07-15 Thread Matt Good
g "engine/timer/Timer.java" you'd get an "engine.timer.Timer" class. As you saw in Python defining Timer in "engine/timer/timer.py" the class is now "engine.timer.timer.Timer". Dropping that extra level by combining the classes in engine.timer into a single module will simplify things. -- Matt Good -- http://mail.python.org/mailman/listinfo/python-list

Re: Pychecker

2006-06-09 Thread Matt Good
(or pyflakes, pylint, or even a static code compiler) aren't a substitute for unit tests. They can definitely help catch common mistakes, but they can't ensure your code does what you intended. -- Matt Good -- http://mail.python.org/mailman/listinfo/python-list

Re: Kamaelia 0.4.0 RELEASED - Faster! More Tools! More Examples! More Docs! ; -)

2006-06-26 Thread Matt Hammond
e AxonVisualiser would be particularly affected by > this - any wobbling you'll see there is probably more down to the > simple physics model the visualiser uses not having sufficient > dampening for the layout you see. (The physics model was apparently > originally written by Matt

Re: what is pygtk.require("2.0") for?

2006-06-27 Thread Matt Good
yaru22 wrote: > when I read a book, it just said we need to do > > import pygtk > pygtk.require("2.0") > import gtk > > in order to import gtk modules > > What is that pygtk.require("2.0") command for? It enables you to install multiple versions of pygtk in parallel and makes sure when you do "im

Re: beautifulsoup .vs tidy

2006-07-01 Thread Matt Good
sing. Of course BeautifulSoup is also a very nice library if you need to extract some information, but don't necessarilly require XML processing to do it. -- Matt Good -- http://mail.python.org/mailman/listinfo/python-list

Re: prompt auto complete and history

2006-07-10 Thread Matt Good
complete and other more advanced features: http://ipython.scipy.org/ -- Matt Good -- http://mail.python.org/mailman/listinfo/python-list

Re: Broadcast server

2006-08-31 Thread Matt Hammond
p and running, and with learning how to write your own components to make the system more sophisticated. We hang about on #kamaelia on freenode (irc) - please do drop in for a chat! Hope this helps! Matt -- | Matt Hammond | Research Engineer, Tech. Group, BBC, Kingswood Warren, Tadworth, Surrey, UK | http://kamaelia.sf.net/ | http://www.bbc.co.uk/rd/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Coding style and else statements

2006-08-31 Thread matt . newville
r Truth: >>> x = 8 >>> foo(x) 9 >>> foo(x>1) 2 >>> foo(x and 1) 2 >>> foo(x or 1) 9 --Matt -- http://mail.python.org/mailman/listinfo/python-list

threading

2006-09-05 Thread matt westerburg
From what I understand in order to guarantee thread safety Python implements an Global Interpreter Lock. Which removes the concurrency, but provides thread safety. Is Python 2.4 still like this and if I used Python to handle rpc requests and responses would it be efficient in a multithreaded sense.

Re: syntax error in sum(). Please explicate.

2006-11-18 Thread Matt Moriarity
try surrounding your sum argument in brackets: sum([phi(x // ps[i+1], i) for i in range(a)]) instead of: sum(phi(x // ps[i+1], i) for i in range(a)) On Nov 18, 5:23 pm, Michael Press <[EMAIL PROTECTED]> wrote: > I have not written python codes nor run any. I saw this > code posted and decided t

Python Jobs

2006-12-04 Thread Matt H
ty to cross train in other development languages such as PostgreSQL and Python. Training provided. Call for more details - 01932 245500 Matt Hancock - Recruitment Consultant. [EMAIL PROTECTED] www.jenrickcpi.co.uk 01932 245500 -- http://mail.python.org/mailman/listinfo/python-list

makeactivexclass stopped giving me events when i upgraded to wxpython 2.7 =(

2006-12-07 Thread matt sib
a wx.Frame instead of a wx.Panel, i do get the flash events! I am most mystifieddoes anyone have any idea here? thanks all, matt Heres the trimmed down version of the code that used to give me events: Note that when i change the wx.Panel to wx.Frame, i start getting the events again

Re: psycopg2

2006-02-02 Thread Matt Goodall
remove the PSYCOPG_DEBUG from setup.cfg in the version you already have and reinstall. Hope this helps. - Matt -- __ / \__ Matt Goodall, Pollenation Internet Ltd \__/ \w: http://www.pollenation.net __/ \__/e: [EMAIL PROTECTED] / \__/ \t: +44 (0)113 2252500 \__/

win32com, BSTR, and null terminated strings

2006-02-05 Thread Matt Helm
garbage. This is the expected behavior and I understand this. However, what is the proper way to recover the actual string? I have been using: r.split("\0", 1)[0] but it seems like a bit of a kludge. Regards, Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: win32com, BSTR, and null terminated strings

2006-02-06 Thread Matt Helm
> It's perfectly good Python, though, so just forget about it or wrap it > in a "cstring(s)" function do you don't have to look at it! Thanks for the sanity check. I just wanted to make sure I was correct as well as right. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: win32com, BSTR, and null terminated strings

2006-02-06 Thread Matt Helm
"John Bauman" <[EMAIL PROTECTED]> writes: > "Matt Helm" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> However, what is the proper way to recover the actual string? I have >> been using: >> >>r.split("

Re: Twisted book opinions?

2006-02-09 Thread Matt Goodall
r it was published. <http://tv.debian.net/articles/review-snakeball/>. - Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Jesus said, "I am the way, the truth and the life: no one can come to the Father(God)(in Heaven), but by me." (John 14:6) This means that if you die without trusting in Jesus Christ as your Lord and Saviour you will die in your sins and be forever sepa

2005-05-11 Thread Matt Hayden
MC05 wrote: > "don freeman" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > The truth is, Jesus should never have torn down the fig tree. He got so > > pissed off at the fig tree for not having figs, even though it wasn't > > fig season. This was not the action of someone who has

Numarray question

2005-05-13 Thread Matt Feinstein
It seems to me that if I could vectorize logical expressions (a la Matlab), it would be a lot easier to write functions that will take either scalar or vector input values. Am I missing something? Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.python.org/mailman/listinfo/python-list

Re: OSx 10.4 lacks pythonIDE?

2005-05-13 Thread Matt Feinstein
On Fri, 13 May 2005 03:21:40 +0100, baza <[EMAIL PROTECTED]> wrote: >Where is the IDE in 'Tiger' for the mac? Don't tell me I have to use >text edit all the time?? You can use Spotlight to find the file idle.pyw and use that as an IDE... Matt Feinstein -- Ther

Applying a function to a 2-D numarray

2005-05-16 Thread Matt Feinstein
see that this looks neat but probably generates several copies of the array, which is not so neat. Is there a better way? Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.python.org/mailman/listinfo/python-list

Re: Applying a function to a 2-D numarray

2005-05-16 Thread Matt Feinstein
[ 1, 2, 3, 4, 5], >[ 6, 7, 8, 9, 10], >[11, 12, 13, 14, 15], >[16, 17, 18, 19, 20]]) > >Is this not what you wanted? The problem is that I chose an example function that's too simple. Non-trivial functions aren't so polymorphic, unfortunately. Sorry

Re: Applying a function to a 2-D numarray

2005-05-16 Thread Matt Feinstein
in one place in the 'genfunc' function-- I can change that and everything else stays the same. However, I realize that the gain in flexibility means a loss in efficiency. I'm limited to not-so-efficient ways of. For this work, it's OK-- I just want to know the best not-so-effici

Unhappy with numarray docs

2005-06-01 Thread Matt Feinstein
mmediately have the degree of clairvoyance needed to figure out that import numarray.numarryall as num was required for the critical step of associating an array with a MemmapSlice. Grr. Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.

Re: Unhappy with numarray docs

2005-06-01 Thread Matt Feinstein
o? It's plainly inappropriate for me to write documentation for a module that I'm still struggling to learn. Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unhappy with numarray docs

2005-06-01 Thread Matt Feinstein
ssage will be simply missed by the >appropriate people, which would be a shame. They are generally very >responsive to user requests and constructive criticism. Done. Thanks for the suggestion. Matt Feinstein -- There is no virtue in believing something that can be proved to be true.

Re: Annoying behaviour of the != operator

2005-06-08 Thread Matt Warden
; // true s1.equals(s2); // true s1 == s3; // false s1.equals(s3); // true s3 == s4; // false s3.equals(s4); // true Doesn't make it any less silly, though. -- Matt Warden Miami University Oxford, OH, USA http://mattwarden.com This email proudly and graciously contributes to entropy. -- http://mail.python.org/mailman/listinfo/python-list

PIL and GeoTIFF

2005-06-09 Thread Matt Feinstein
a GeoTIFF file with PIL means poking around in the PIL TIFF plugin file which I'm a little wary of doing. Also, I don't see any clear description in the PIL documentation on how to add specified TIFF keys to a saved file. Any words of wisdom about either of these questions would be much

Re: PIL and GeoTIFF

2005-06-09 Thread Matt Feinstein
my purposes. If a couple of lines of Python added to what I've already got will do the job, I'd rather do that then compile and learn yet another API. Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.python.org/mailman/listinfo/python-list

Problem with 'struct' module

2005-06-14 Thread Matt Feinstein
Using the 'struct' module (Win32, python version 2.4.1)-- The library documentation says that 'no alignment is required for any type'. However, struct.calcsize('fd') gives 16 while struct.calcsize('df') gives 12, implying that double precision data has to

Re: Problem with 'struct' module

2005-06-14 Thread Matt Feinstein
the difference between "@" and "=": both use native >byte order, but the size and alignment of the latter is >standardized. Thanks. I clearly missed the point of the explanation... Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.python.org/mailman/listinfo/python-list

PIL cutting off letters

2007-06-15 Thread Matt Haggard
I'm using PIL (Python Imaging Library) to generate button images. They consist of a left end image, a middle, repeating image and a right side image anyway, that's not important I'm using a TTF font for the text of the button (Verdana.TTF) and it keeps cutting the bottom part of the the g's q'

labeled break/continue

2007-06-17 Thread Matt Chisholm
://sourceforge.net/tracker/index.php?func=detail&aid=1714448&group_id=5470&atid=355470 I would be willing to help make a case and then write a PEP for labeled break and continue, as long as the community or the BDFL hasn't already decided against it. -matt P.S. My apologies abo

Re: labeled break/continue

2007-06-19 Thread Matt Chisholm
On Mon, 18 Jun 2007 05:28, faulkner <[EMAIL PROTECTED]> wrote: >On Jun 18, 12:35 am, Matt Chisholm <[EMAIL PROTECTED]> wrote: >> Hi. I was wondering if there had ever been an official decision on >> the idea of adding labeled break and continue functionality to

Re: Can a low-level programmer learn OOP?

2007-07-13 Thread matt westerburg
I also come from a low level background (assembly and c) and I struggled with object oriented programming. People talk about procedural languages or designs and object oriented languages or designs. But after the interpreter or compiler runs the byte or machine code is procedural always. Object

Re: Can a low-level programmer learn OOP?

2007-07-13 Thread matt westerburg
On 7/13/07, matt westerburg <[EMAIL PROTECTED]> wrote: I also come from a low level background (assembly and c) and I struggled with object oriented programming. People talk about procedural languages or designs and object oriented languages or designs. But after the interpreter or co

Fwd: Can a low-level programmer learn OOP?

2007-07-13 Thread matt westerburg
I also come from a low level background (assembly and c) and I struggled with object oriented programming. People talk about procedural languages or designs and object oriented languages or designs. But after the interpreter or compiler runs the byte or machine code is procedural always. Object

Re: Break up list into groups

2007-07-17 Thread Matt McCredie
r. I would probably use the generator version in my code, but wrapping `list' around a generator adds about 4us (on my machine). Anyway, getgroups7 passes all of the tests I mentioned and it was timed at 10.37usec/pass. The down side: the code doesn't seem nearly as elegant. Matt

Re: How to check if an item exist in a nested list

2007-07-19 Thread Matt McCredie
e specific code that actually throws the exception. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: class C: vs class C(object):

2007-07-19 Thread Matt McCredie
ing difficulty thinking of a scenario where they might actually be useful. I suppose you could use it to do a calculation on instance variables and return the result. You are probably better of using a method for that anyway though. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficiently removing duplicate rows from a 2-dimensional Numeric array

2007-07-19 Thread Matt McCredie
Could you use a set of tuples? set([(1,2),(1,3),(1,2),(2,3)]) set([(1, 2), (1, 3), (2, 3)]) Matt On 7/19/07, Alex Mont <[EMAIL PROTECTED]> wrote: I have a 2-dimensional Numeric array with the shape (2,N) and I want to remove all duplicate rows from the array. For example if I sta

Re: Images in Tkinter

2007-07-20 Thread Matt McCredie
image object. Please help! You need to call Tkinter.Tk() before you can create an instance of `PhotoImage' (I don't know why, but I know I got a similar error when I didn't). Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and GUI

2007-05-24 Thread matt . newville
> Do others think like me here? Yes!! I agree completely: Wax is not only a fantastic idea, but a very good start at an implementation of that idea. --Matt Newville -- http://mail.python.org/mailman/listinfo/python-list

Re: pylint style convention

2007-07-23 Thread Matt McCredie
ns in python: http://www.artima.com/weblogs/viewpost.jsp?thread=4829. You didn't really ask for it, but I think it is good reading. His examples all use getopt though, instead of optparse. I have come up with my own (probably overkill for 99% of python scripts) template that uses optpars

Why PHP is so much more popular for web-development

2007-07-26 Thread matt westerburg
Why are you praising PHP on a python mailing list are you trying to start a flame war? (Not evaluating PHP as a language), our company just switched over to using Django and my has it saved us time, and we can organize our code its really beautiful. PHP is full of new to programming users and thu

Learning Jython?

2007-07-26 Thread Matt Bitten
m not going to be able to come up with any kind of GUI without learning the Java libraries. Can someone point me to a tutorial for Everything I've found are like, "You know the Java libraries forwards and backwards; now learn to call them in Python." That's not what I need. -- Matt

Fwd: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread matt westerburg
-- Forwarded message -- From: matt westerburg <[EMAIL PROTECTED]> Date: Jul 26, 2007 11:09 AM Subject: Re: I am giving up perl because of assholes on clpm -- switching to Python To: zentara <[EMAIL PROTECTED]> Welcome, the people here are friendly occasional argume

I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread matt westerburg
Maybe we should welcome zentara instead of try to recreate the perl experience. Your not a troll either. That is very inappropriate and rather rude. Welcome to Python enjoy! -- http://mail.python.org/mailman/listinfo/python-list

wxPython - drawing without paint event

2007-08-09 Thread Matt Bitten
I've got a wxPython program that needs to do some drawing on a DC on a regular basis, whether or not a paint event happens. I know how to make a ClientDC to do the drawing in, and I know what drawing calls to make. But how do I make it all happen? After I call MainLoop, none of my code gets called

Fwd: AttributeError: 'module' object has no attribute 'HTTPSHandler'

2007-08-10 Thread Matt McCredie
er' > > What should I do? You need `_ssl.pyd' for HTTPSHandler to work. I guess, try to figure out why that wasn't built, then build it. I suppose I _might_ be able to give a little more help, but you haven't mentioned what platform you are using. Even then, I'm not an

AttributeError: 'module' object has no attribute 'HTTPSHandler'

2007-08-13 Thread Matt McCredie
You can also find the source in the python repository at: http://svn.python.org/projects/external/openssl-0.9.8a And build that yourself. I _think_ that if you have it installed, configure might find it for you and autmatically build _ssl.pyd. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: try/finally exceptions dying

2007-08-14 Thread Matt McCredie
xample, status could be just a tuple of args. Then you just need to figure out how to modify the args in the exception case. The above leaves a lot of holes though. If you want more help you will have to send a more complete example. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: threads, mutual exclusion, and lists

2007-08-15 Thread Matt McCredie
> My question is -- are python list operations atomic? If they are not, > then I assume I need to put some mutual exclusion around the append() > and pop() calls ? They are not, but there is one included in the standard library: http://docs.python.org/dev/lib/module-Queue.html Matt

Re: threads, mutual exclusion, and lists

2007-08-16 Thread Matt McCredie
ly that you can't get a multi-threaded app to communicate using lists, but the Queue is explicitly built for it and better suited. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: how to convert a c program to java program

2007-08-17 Thread Matt McCredie
. Anyway, if you want to learn Python try one of these: http://python.org/doc/tut/ or http://www.diveintopython.org/. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: porting vc++ project to python?

2007-08-22 Thread Matt McCredie
ewrite then options 1 or 2 will work best. It is probably best to stay away from 1b unless portions of your stuff already exist as COM DLLs. If you do have COM DLLs however, accessing them from Python is very easy. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: What Are These Import/From Statements about?

2007-08-22 Thread Matt McCredie
t the source for more clues. Also, you should be able to do this: >>> import MakeQTE >>> help(MakeQTE) Which will also likely give you some good clues. -Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python using a book based on version 1.5

2007-08-22 Thread Matt McCredie
s: http://docs.python.org/tut/ http://www.diveintopython.org/ -Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: I can't get value of entry box, Tinker

2007-08-24 Thread Matt McCredie
> What/should I, can I do? Fix your code? > def login(): > global e2,e1 > print e2.get() > print e1.get() That should work. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem w/ Tkinter

2007-08-24 Thread Matt McCredie
//www.pythonware.com/library/tkinter/introduction/ Also, this might help: http://www.python.org/dev/peps/pep-0008/ Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem w/ Tkinter

2007-08-24 Thread Matt McCredie
(anchor='w') root.mainloop() def print_val(): k = v.get() print k, choices[k] if __name__ == "__main__": main() [/code] I'm curious, what do you feel is incorrect about the Radiobutton explanation? It seemed to work for me. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: the del function

2007-08-27 Thread Matt McCredie
gth = len(array) - 1 ray = random.randint(0,length) _red[x] = array[ray] del array[ray] print array x = x + 1 print _red [/code] I'm sure you could do something with random.shuffle or random.choice though that would be much cleaner. It isn't entirely clear what y

Re: Image.open( "C:\test.jpg") is this wrong ?

2007-08-27 Thread Matt McCredie
"C:\\test.jpg" where "\\" is the escape sequence for a single backslash `\' You can use a raw string: r"C:\test.jpg" which disables escaping. You can use forward slashes "C:/test.jpg", which might look funny but does work. Read more here: http://docs.pytho

Re: an eval()-like exec()

2007-08-27 Thread Matt McCredie
n eval(statement, globals_, locals_) except SyntaxError: if locals_ is None: import inspect locals_ = inspect.currentframe().f_back.f_locals exec statement in globals_, locals_ [/code] It seems to work for me. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: So what exactly is a complex number?

2007-08-31 Thread Matt McCredie
> So what exactly is a complex number? It is a math construct, and has almost nothing to do with Python, other than the fact that Python has a data type for them. So, here is a list of better ways to get information about complex numbers than asking python-list: 1. Google it: http://www.google.co

Re: Registering a python function in C

2007-09-04 Thread Matt McCredie
get the version strings and stuff? >>>import sys >>>print sys.version That might give you a clue. It might just be that you need to compile against a different version of Python. You could always just download the different versions of Python and see if the included Python.h and

Re: help - error when trying to call super class method

2007-09-09 Thread Matt McCredie
>>> s = Stack() >>> s.push(1) >>> s.push(2) >>> s.push(3) >>> s.pop() 3 >>> s.pop() 2 >>> s.pop() 1 [/code] Matt -- http://mail.python.org/mailman/listinfo/python-list

Python object overhead?

2007-03-23 Thread Matt Garman
ot;just the way it is" or am I overlooking something obvious? Thanks, Matt Example 1: read lines into list: # begin readlines.py import sys, time filedata = list() file = open(sys.argv[1]) while True: line = file.readline() if len(line) == 0: break # EOF filedata.append(line)

Re: Python object overhead?

2007-03-26 Thread Matt Garman
Note that, in addition to the class structure I defined above, I also create two caches of all the data (two dicts with different keys from the collection of objects). This is necessary to ensure the program runs in a semi-reasonable amount of time. Thanks to all for your input and suggestions. I received many more responses than I expected! Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Python object overhead?

2007-03-26 Thread Matt Garman
quot;new style class", do you mean that the __slots__ feature is only available in a newer version of Python? Unfortunately, I'm stuck on 2.3.4 for this project. Thanks, Matt -- http://mail.python.org/mailman/listinfo/python-list

SUMMON - Rapid prototyping of 2D visualizations

2007-04-05 Thread matt . rasmus
ing, sizing, and justification of text). - Its cross-platform: It only relies on python2.4, OpenGL, GLUT, and SDL. So if this sounds like something you may need for your work, please check it out and let me know what you think. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Using python to create windows apps that everyone can use?

2007-09-18 Thread Matt McCredie
; Microsoft visual studio or qt designer, not a code based one) and/or an app > that can make this into a .exe that can be opened by any person on any > computer without python installed. check out py2exe: http://py2exe.org matt -- http://mail.python.org/mailman/listinfo/python-list

Re: re question

2007-09-20 Thread Matt McCredie
return False try: if not 0 <= int(oct) < 256: return False except ValueError: return False return True Both solutions seem to work, though I used a small set of test cases. Others may have better suggestions. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: re question

2007-09-20 Thread Matt McCredie
gt; > > > Thanks, > > Dan > > > > r'^[12]\d?\d?.\d{1,3}.\d{1,3}.\d{1,3}$' so 299.999.999.999 is a valid IP and 34.0.0.1 isn't? Also, the "."s need to be escaped. Otherwise they match ANY character. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: I could use some help making this Python code run faster using only Python code.

2007-09-20 Thread Matt McCredie
but much better than the origional. It is strong enough that someone knowing how you scrambled it will have trouble unscrambling it even if they don't know the key. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: I could use some help making this Python code run faster using only Python code.

2007-09-21 Thread Matt McCredie
> Now I think I will code this little scrambler using nothing but the D > Language just to see whether there is any benefit in using D over > Python for this sort of problem. Isn't D compiled to machine code? I would expect it to win hands down. That is, unless it is horribly unop

Re: I could use some help making this Python code run faster using only Python code.

2007-09-21 Thread Matt McCredie
orth taking a look at. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: I could use some help making this Python code run faster using only Python code.

2007-09-23 Thread Matt McCredie
r windows). http://www.mingw.org Matt -- http://mail.python.org/mailman/listinfo/python-list

"".join(string_generator()) fails to be magic

2007-10-10 Thread Matt Mackal
I have an application that occassionally is called upon to process strings that are a substantial portion of the size of memory. For various reasons, the resultant strings must fit completely in RAM. Occassionally, I need to join some large strings to build some even larger strings. Unfortunately,

Re: Moving objects in Tkinter

2007-10-12 Thread Matt McCredie
n.grid() # note that rect is actually just an integer that is used to identify that shape in the # context of the canvas that it was created within. rect = can.create_rectangle(400,0,600,200,fill=rectanglecolor) for i in range(100): # move the rectangle 0 in the x direction and disty in the y direction. can.move(rect, 0, disty) root.update() # update the display root.after(30) # wait 30 ms root.mainloop() # this just keeps the window open [/code] Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-15 Thread Matt McCredie
op. > > > > > > Try: > > > > > > if xs == []: > > > return [] > > > elif xs == '': > > > return '' > > > else: > > > ... > > > > > > > > > Gary Herron > > >

Re: Control Log File Size

2007-10-19 Thread Matt McCredie
Examples of using alternative handlers are here: http://docs.python.org/lib/multiple-destinations.html Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: __main__ : What is this?

2007-10-19 Thread Matt McCredie
dn't give it much thought before I wrote it. I am simply used to doing it that way, and being irked whenever I see it written the other way in C or C++ (and perhaps unjustifiably Python). Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: does PyAntlr come with Antlr download

2007-10-25 Thread matt wilkie
chewie54 wrote: > > I want use java2python which requires PyAntlr.I can't seem to find > PyAntlr mentioned on the main website for Antlr. > j2py requires antlr 2.7.7 This is what I did (for windows): - download and run 2.7.7 msi installer from http://www.antlr2.org/download.html, un-che

Re: Going past the float size limits?

2007-10-26 Thread Matt McCredie
(I think) and can have a decimal portion. to use longs: x = 5 * 10**350 to use decimal: import decimal x = decimal.Decimal("5e350") You will probably want to read up on the decimal module. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Assertion for python scripts

2007-11-02 Thread Matt McCredie
at a time. Many Python programs and modules include a compile step as part of their installation process. There is also a -OO option, which will strip doc-strings as well. Matt -- http://mail.python.org/mailman/listinfo/python-list

Newbie question: replacing nulls in CSV with preceding value

2007-02-01 Thread Matt Waite
e results of this back to the file. Any help anyone can offer is greatly appreciated. I'm trying hard to learn, but have been frustrated by this problem. Matt Matthew Waite www.mattwaite.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question: replacing nulls in CSV with preceding value

2007-02-01 Thread Matt Waite
['ZONE','CITY','EVENT'], dialect='excel') for row in reader: for key in row: if not row[key]: row[key] = last.get(key, "") writer.writerow(row) last = row On Feb 1, 3:37 pm, [EMAIL PROTECTED] wrot

Re: Insert image to a List box

2007-11-16 Thread Matt McCredie
27;. The following two things should work: dirpath = "." # This always uses the current working directory dirpath = "/Users/linda/Desktop" # This will always use the same directory The second thing, which I think is the error you are currently seeing, is the escape error. In strings in python the backslash is used as an escape character, if you want to type a single backslash you have to type two of them '\\' or, for paths (especially on a mac) is is completely valid to use forward slashes instead. Also, there are raw strings which don't do escaping. Any of the following will work: dirpath = "\\Users\\linda\\Desktop" dirpath = "/Users/linda/Desktop" dirpath = r"\Users\linda\Desktop" # prepending an 'r' makes it a raw string (no escaping) HTH Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Insert image to a List box

2007-11-16 Thread Matt McCredie
imgname = L.get(L.curselection()[0]) img.config(image=gifsdict[imgname]) L.bind('', list_entry_clicked) [/code] That _should_ work, but it is untested. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: guess file type in python

2007-11-19 Thread Matt Nordhoff
Japan Shah wrote: > > > > > > mimetypes module? -- -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting a list of list

2007-11-21 Thread Matt Nordhoff
Tim Chase wrote: >> are there available library or pythonic algorithm for sorting a list >> of list depending on the index of the list inside the list of my >> choice? > > The built-in sorted() function and the sort() method on various > collections take an optional "key=function" keyword paramate

Re: new is missing in module hmac SHA-based encryption function in Python

2007-11-21 Thread Matt Nordhoff
Hailong Wang wrote: > Matt, > > Thanks for response, I changed my script to hw_hmac.py, but still does > not work. > > Traceback (most recent call last): > File "C:/Python25/hw_script/my_hmac.py", line 1, in > import hmac > File "C:\Python25\hw

Re: new is missing in module hmac SHA-based encryption function in Python

2007-11-21 Thread Matt Nordhoff
Hailong Wang wrote: > I have small hmac encryption programm by python, but always complain > that hmac module does not have attribute new, do I need to install > anything additinal in my laptop? I am using python 2.5.1 > > import hmac > import md5 > import sha > myhmac = hmac.new("test") > > > T

python newbie - question about lexical scoping

2007-11-30 Thread Matt Barnicle
hi everyone.. i've been chugging along learning python for a few months now and getting answers to all needed questions on my own, but this one i can't figure out nor can i find information on the internet about it, possibly because i don't understand the right words to type into google.. i ha

Re: "Python" is not a good name, should rename to "Athon"

2007-11-30 Thread Matt Nordhoff
Tim Chase wrote: > (You'd think this was the Lisp ML, not Python... ) Atsp? :-) -- -- http://mail.python.org/mailman/listinfo/python-list

Re: "Python" is not a good name, should rename to "Athon"

2007-11-30 Thread Matt Nordhoff
[EMAIL PROTECTED] wrote: > Python is a good programming language, but "Python" is not a good > name. > > First, python also means snake, Monty Python. If we search "python" in > google, emule, many results are not programming resource. If we search > PHP, all results are programming resource. >

Re: python newbie - question about lexical scoping

2007-12-01 Thread Matt Barnicle
> On Dec 1, 4:47 pm, Matt Barnicle <[EMAIL PROTECTED]> wrote: >> hi everyone.. i've been chugging along learning python for a few months >> now and getting answers to all needed questions on my own, but this one >> i can't figure out nor can i find

Re: python newbie - question about lexical scoping

2007-12-01 Thread Matt Barnicle
> On Dec 1, 4:47 pm, Matt Barnicle <[EMAIL PROTECTED]> wrote: >> hi everyone.. i've been chugging along learning python for a few months >> now and getting answers to all needed questions on my own, but this one >> i can't figure out nor can i find

Re: python newbie - question about lexical scoping

2007-12-01 Thread Matt Barnicle
>> On Dec 1, 4:47 pm, Matt Barnicle <[EMAIL PROTECTED]> wrote: > aye yaye aye... thanks for the pointers in the right direction.. i > fiddled around with the code for a while and now i've reduced it to the > *real* issue... i have a class dict variable that apparentl

<    1   2   3   4   5   6   7   8   >