need some regular expression help

2006-10-07 Thread Chris
I need a pattern that matches a string that has the same number of '(' as ')': findall( compile('...'), '42^((2x+2)sin(x)) + (log(2)/log(5))' ) = [ '((2x+2)sin(x))', '(log(2)/log(5))' ] Can anybody help me out? Thanks for any help! -- http://mail.python.org/mailman/listinfo/python-list

problem with the 'math' module in 2.5?

2006-10-14 Thread Chris
>>> from math import * >>> sin(0) 0.0 >>> sin(pi) 1.2246063538223773e-016 >>> sin(2*pi) -2.4492127076447545e-016 >>> cos(0) 1.0 >>> cos(pi) -1.0 >>> cos(2*pi) 1.0 The cosine function works fine, but I'm getting weird answers for sine. Is this a bug? Am I doing something wrong? -- http://mail.pyt

Re: problem with the 'math' module in 2.5?

2006-10-14 Thread Chris
sin(pi*0.5) is what I expected, but I expected to get 0 for sin(pi). Max Erickson wrote: > "Chris" <[EMAIL PROTECTED]> wrote: > > >>>> from math import * > >>>> sin(0) > > 0.0 > >>>> sin(pi) > > 1.2246063538223773e-016

Re: problem with the 'math' module in 2.5?

2006-10-14 Thread Chris
I don't understand what that number came from. My calculator gives me cos(pi*.5) = 0, and my interpreter gives me cos(pi*0.5) = 6.1230317691118863e-017. Max Erickson wrote: > Max Erickson <[EMAIL PROTECTED]> wrote: > > > > Try sin(pi*0.5) to see similar behavior to cos(pi) or cos(pi*2). > > > >

Re: problem with the 'math' module in 2.5?

2006-10-14 Thread Chris
Oh, ok that explains it. Is that why my 16-bit calculator gives me 0? Carsten Haese wrote: > On 14 Oct 2006 20:33:13 -0700, Chris wrote > > >>> from math import * > > >>> sin(0) > > 0.0 > > >>> sin(pi) > > 1.2246063538223773e-016

Why can't you pickle instancemethods?

2006-10-20 Thread Chris
ickle doesn't serialize code objects, so why can't it serialize the name as it does for functions? Is this one of those features that's feasible, but not useful, so no one's ever gotten around to implementing it? Regards, Chris >>> import pickle >>> >>

Re: Why can't you pickle instancemethods?

2006-10-20 Thread Chris
[EMAIL PROTECTED] wrote: > Chris wrote: > > Why can pickle serialize references to functions, but not methods? > > > > Pickling a function serializes the function name, but pickling a > > staticmethod, classmethod, or instancemethod generates an error. In > > these

.pycs

2006-10-31 Thread Chris
I had some code that I wrote that I guess I deleted. But for whatever reason I still have the bytecode .pyc file for it. Is there a way to get the code I wrote back from this? -- http://mail.python.org/mailman/listinfo/python-list

.pyc's

2006-10-31 Thread Chris
I had some code that I wrote that I guess I deleted. But for whatever reason I still have the bytecode .pyc file for it. Is there a way to get the code I wrote back from this? -- http://mail.python.org/mailman/listinfo/python-list

Re: .pyc's

2006-10-31 Thread Chris
thanks [EMAIL PROTECTED] wrote: > You can try decompyle > > http://packages.debian.org/unstable/python/decompyle > > It works only until python version 2.3 though -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] IronPython 1.0 released today!

2006-09-06 Thread Chris
short of a few tweaks, that my code will work? At work we seem to be doing more and more with dotNet and perhaps this is a way of bringing my tools into the same environment. In any event, what you've done sounds cool. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] IronPython 1.0 released today!

2006-09-07 Thread Chris
Diez B. Roggisch wrote: > Chris wrote: > >> Jim Hugunin wrote: >>> I'm extremely happy to announce that we have released IronPython 1.0 >>> today! >>> http://www.codeplex.com/IronPython >> >> >> I'm no code guru but it sounds

Re: get process id...

2006-09-21 Thread Chris
SpreadTooThin wrote: > How does one get the process id? > Is there a method for windows and unix (mac os x etc...) > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/442477 hth -- http://mail.python.org/mailman/listinfo/python-list

How can I speed this function up?

2006-11-17 Thread Chris
This is just some dummy code to mimic what's being done in the real code. The actual code is python which is used as a scripting language in a third party app. The data structure returned by the app is more or less like the "data" list in the code below. The test for "ELEMENT" is necessary ...

Re: How can I speed this function up?

2006-11-17 Thread Chris
Chris wrote: > This is just some dummy code to mimic what's being done in the real > code. The actual code is python which is used as a scripting language in > a third party app. The data structure returned by the app is more or > less like the "data" list in t

Decorator for Enforcing Argument Types

2006-12-21 Thread Chris
I'm not sure if this has been done before, but I couldn't easily find any prior work on Google, so here I present a simple decorator for documenting and verifying the type of function arguments. Feedback/suggestions/criticism is welcome. ''' 2006.12.21 Created. ''' import unittest import inspect

Re: Decorator for Enforcing Argument Types

2006-12-21 Thread Chris
On Dec 21, 3:57 pm, "Paul McGuire" <[EMAIL PROTECTED]> wrote: > "Chris" <[EMAIL PROTECTED]> wrote in messagenews:[EMAIL PROTECTED] > > > I'm not sure if this has been done before, but I couldn't easily find > > any prior work on Google,

Add/Remove Channels in Asyncore?

2006-12-23 Thread Chris
), I'd like to be able to add/remove clients ("channels"?) to/from execution by asyncore. Is this possible? Thanks, Chris -- http://mail.python.org/mailman/listinfo/python-list

DCOracle2: OCI error

2006-02-21 Thread Chris
.c OCI calls so I can investigate more because for now I'm stuck. I'll try to add disconnect / reconnect every now and then to see if it helps. Regards Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: DCOracle2: OCI error

2006-02-21 Thread Chris
d look into the issue. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: 80 bit precision ?

2005-05-14 Thread chris
"km" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > does python currently support 80 bit precision Floating Point Unit ? > > regards, > KM I've just been using the decimal module for Python 2.3 (native in Python 2.4) at 100 digit precision to solve some very high order

Web server platform for beginner

2005-05-16 Thread Chris
apart from Zope and mod_python. Are there any others which are simpler than mod_python handlers, yet not as extensive as Zope? Cheers, - Chris. -- http://mail.python.org/mailman/listinfo/python-list

Re: Web server platform for beginner

2005-05-16 Thread Chris
If only i'd seen that page ;-) Thanks for the heads up Cheers, - Chris. -- http://mail.python.org/mailman/listinfo/python-list

Re: decimal numarray

2005-06-01 Thread chris
"km" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > is there any support for decimal type in numarray module ? > regards, > KM Still a noob but perhaps you can use gmpy, a wrapper for GMP arbitrary precision library. I found it here http://gmpy.sourceforge.net/ I just

Re: decimal and trunkating

2005-06-03 Thread chris
"Reinhold Birkenfeld" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Peter Hansen wrote: > > Reinhold Birkenfeld wrote: > >> He is speaking of Decimals... > >> > >> d = Decimal("199.999") > >> d._round(5, decimal.ROUND_DOWN) > > > > Is one really supposed to call the underscore meth

XML help

2005-06-05 Thread chris
I'm 4 months new to python and 4 hours new to XML. I've been trying to understand and use the DOM tree walk sample shown at this site: http://www.rexx.com/~dkuhlman/pyxmlfaq.html to walk through an xml file from which I need to extract data for subsequent plotting. I've repeated the functions from

pyunit: remove a test case on the fly

2005-06-15 Thread chris
We have a number of TestCase classes that have multiple test methods. We are interested in removing any of the individual test methods on the fly (dynamically, at runtime, whatever). We currently have an "isSupported" method in the TestCase classes that return a bool by which the greater test harn

userinteraction for a webspider

2007-06-10 Thread Chris
localhost but i thought there might be an easier way... Thanks for your help Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: userinteraction for a webspider

2007-06-13 Thread Chris
James Stroud schrieb: > > There are sweatshops in developing countries that provide this service. > > James But since this is for fun/convenience for me only Id rather not make anyone break asweat... Great advice, helpful too -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange terminal behavior after quitting Tkinter application

2007-04-23 Thread Chris
> Is there some Tkinter clean up that you have omitted ? Not that I know about - I was hoping someone would tell me I'd omitted something. > Have you ensured that the clean up runs on both normal > exit and abnormal exit (eg ^C) ? (^C doesn't make the application exit, it just rai

what python technology for my app?

2007-04-27 Thread Chris
I have an database containing lots of numerical data. I want to write a browser based interface that will allow selection of various key parameters and yield tables, plots and/or printouts of the data according to the selections. Ultimately I want this to run on an intranet so that others can g

Re: Strange terminal behavior after quitting Tkinter application

2007-05-03 Thread Chris
) stops the terminal from getting messed up. So, I should call mainloop() for my application...except that I want to use the commandline, too, and calling mainloop() freezes the commandline. I wonder if there is another way to use the commandline and have a GUI? I couldn't find any clear information about that. Thanks again, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange terminal behavior after quitting Tkinter application

2007-05-04 Thread Chris
On May 4, 8:52 pm, "Hamilton, William " <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: Chris > > Subject: Re: Strange terminal behavior after quittingTkinter > application > > Clicking 'Quit' or on the window's &#x

Re: Strange terminal behavior after quitting Tkinter application

2007-05-04 Thread Chris
On May 5, 1:24 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 4 May 2007 08:02:13 -0700, Chris <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > > > Ah, sorry, I wasn't being precise. I meant the python commandline > > python inte

Re: Strange terminal behavior after quitting Tkinter application

2007-05-06 Thread Chris
On May 5, 2:21 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 4 May 2007 19:38:39 -0700, Chris <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > > > > > Thanks, but I was just explaining why I don't want to call mainloop().

Re: Strange terminal behavior after quitting Tkinter application

2007-05-09 Thread Chris
On May 7, 10:02 pm, "Hamilton, William " <[EMAIL PROTECTED]> wrote: > > From: Chris > > > I'll admit to being surprised at seeing a claim that atkinter > > > application, started within an interactive session, without a > mainloop, > &

Python not freeing memory (?)

2007-08-12 Thread Chris
5681.71009493 Python(28344,0xa000d000) malloc: *** vm_allocate(size=8421376) failed (error code=3) Python(28344,0xa000d000) malloc: *** error: can't allocate region Python(28344,0xa000d000) malloc: *** set a breakpoint in szone_error to debug Traceback (most recent call last): File "/Users/ch

How do I read and write to the same CSV file

2007-09-10 Thread Chris
I want to update one field in a row for a csv file. So far my code looks something like this cf_stream = open("\\config.csv","r+") csv_file = csv.DictReader(cf_stream, ['Algorithm','LastModified']) and then I know I can do something like this for row in csv_file name = row["Algorithm"]

Silent SaveAs when using the Excel win32com module

2007-09-10 Thread Chris
I'm trying to create an excel file which will act as a log, however I want to overwrite the file if it exists. Looking at the SaveAs method I can't find anything that would allow it. I don't want the prompt to appear to ask whether to replace the file or not. I just want to replace it without thin

Re: Silent SaveAs when using the Excel win32com module

2007-09-10 Thread Chris
On Sep 10, 11:57 am, Chris <[EMAIL PROTECTED]> wrote: > I'm trying to create an excel file which will act as a log, however I > want to overwrite the file if it exists. > > Looking at the SaveAs method I can't find anything that would allow > it. I don't want th

Excel process still running after program completion.

2007-09-11 Thread Chris
I have a python script that is driving Excel and using the win32com module. However, upon program completion there's still an Excel.exe process running in the background that I must terminate through Task Manager. Reading up on other threads indicate that maybe I still have some Excel objects refer

Re: Excel process still running after program completion.

2007-09-11 Thread Chris
On Sep 11, 12:59 pm, "Hamilton, William " <[EMAIL PROTECTED]> wrote: > > From: Chris > > > I have a python script that is driving Excel and using the win32com > > module. However, upon program completion there's still an Excel.exe > > process running

Re: Excel process still running after program completion.

2007-09-11 Thread Chris
On Sep 11, 1:26 pm, Chris <[EMAIL PROTECTED]> wrote: > On Sep 11, 12:59 pm, "Hamilton, William " <[EMAIL PROTECTED]> wrote: > > > > > > From: Chris > > > > I have a python script that is driving Excel and using the win32com > > > mod

Re: FloatCanvas in a wxpython application.... layout problems

2007-03-05 Thread Chris
mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas or the wxPython-users list: http://www.wxpython.org/maillist.php In this case, putting a FloatCanvas in an app is no different than putting any wx.Panel in, so the wxPython list would be fine. -Chris -- http://mail.python.org/mailman/listinfo/python-list

Tkinter Toplevel geometry

2007-03-24 Thread Chris
ter's automatic adjustment of the window to fit all the widgets by doing something like self.geometry(self.geometry()), is there any way to undo that? Thanks, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter Toplevel geometry

2007-03-25 Thread Chris
> After playing with this an inordinate amount of time, I found that one > does need to supply parameters, namely the null parameter of an empty > string. Try: > >sometop.geometry('') > > This repacks according to the widgets. Not quite clear from the > miserable docs, is it? Wow, that does

Re: Tkinter Toplevel geometry

2007-03-27 Thread Chris
> A TRULY good way to show your thanks for help like this > is to write up what you learned at theTkinterWiki > http://tkinter.unpythonic.net/wiki/>. Note: > A. You have to log in to edit pages > on this particular Wiki. If you > decide to join us, then, you'll > first need to crea

Strange terminal behavior after quitting Tkinter application

2007-04-18 Thread Chris
sys.exit() Can anyone tell me what I'm doing wrong? Thanks for your help. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange terminal behavior after quitting Tkinter application

2007-04-18 Thread Chris
(I'm not sure what happened to the formatting in my post: the "Tkinter.Button" line should be at the same level of indentation as the "Tkinter.Tk.__init__" line.) -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange terminal behavior after quitting Tkinter application

2007-04-18 Thread Chris
> What happens if you type 'stty sane' (and of course, a carriage > return) afterwards? The terminal returns to normal, thanks! But does anyone know why the Tkinter program is doing this to the terminal in the first place? I don't want to have to tell users of my program that they must recover t

How to best send email to a low volume list?

2007-10-24 Thread chris
host by sending out too many emails. Anyway, any tips appreciated. Thanks, Chris -- http://mail.python.org/mailman/listinfo/python-list

AlphaBeta Search

2007-01-12 Thread Chris
I know this probably seems trivial, but I can't seem to find the bug in my alphabeta search implementation. I'm testing it with the game of tic-tac-toe. If the first player plays in a corner, the correct move is to play in the center, but for some reason my code thinks the center and remaining cor

Re: AlphaBeta Search

2007-01-13 Thread Chris
[EMAIL PROTECTED] wrote: > Chris wrote: > > I know this probably seems trivial, but I can't seem to find the bug in > > my alphabeta search implementation. > > This is another alphabeta implementation (all the nicest algorithms are > inside this AIMA codebase): > ht

Overloading the tilde operator?

2007-02-01 Thread Chris
I am trying to overload the __invert__ operator (~) such that it can take a second argument, other than self, so that I can express: x ~ y by using: def __invert__(self, other): for example. Is this possible? Thanks in advance, -- http://mail.python.org/mailman/listinfo/python-list

pyExcelerator - Protecting Cells

2007-02-08 Thread Chris
inally extracted from a database. The problem is that I can only seem to set it to protect all written cells or not. Any advice or help would be most appreciated. :) Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: os.popen and broken pipes

2007-02-09 Thread Chris
It could easily be the 2gig file size limitation, how large are the extracts? -- http://mail.python.org/mailman/listinfo/python-list

Python on Leopard issues

2007-11-08 Thread Chris
Are others having fundamental issues on OSX 10.5 with python 2.5.1? I was excited that Python 2.5 was included, but this excitement was very short lived. Almost nothing works. Upon startup I get this message: 'import site' failed; use -v for traceback and sure enough, all of the built-in packag

Re: better way to write this function

2007-11-26 Thread Chris
On Nov 26, 9:42 am, Kelie <[EMAIL PROTECTED]> wrote: > Hello, > > This function does I what I want. But I'm wondering if there is an > easier/better way. To be honest, I don't have a good understanding of > what "pythonic" means yet. > > def divide_list(lst, n): > """Divide a list into a number

Re: better way to write this function

2007-11-26 Thread Chris
On Nov 26, 10:51 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > Chris <[EMAIL PROTECTED]> writes: > > for i in range(int(round((len(lst)/n),0))): ... > > Ugh!!! Not even correct (under future division), besides being ugly. > I think you mean: > &

Re: writing results to array

2007-12-04 Thread Chris
On Dec 3, 10:45 pm, Bevan Jenkins <[EMAIL PROTECTED]> wrote: > Hello, > > I have recently discovered the python language and am having a lot of > fun getting head around the basics of it. > However, I have run into a stumbling block that I have not been able > to overcome, so I thought I would ask

Re: read lines

2007-12-04 Thread Chris
On Dec 4, 2:14 pm, Horacius ReX <[EMAIL PROTECTED]> wrote: > Hi, I have a text file like this; > > 1 -33.453579 > 2 -148.487125 > 3 -195.067172 > 4 -115.958374 > 5 -100.597841 > 6 -121.566441 > 7 -121.025381 > 8 -132.103507 > 9 -108.939327 > 10 -97.046703 > 11 -52.866534 > 12 -48.432623 > 13 -112.7

Re: Omitting results with id3reader [Beginner]

2007-12-05 Thread Chris
Ok, just noticed you linked the id3reader. I tested my code and it worked fine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Omitting results with id3reader [Beginner]

2007-12-05 Thread Chris
On Dec 5, 1:43 pm, Ionis <[EMAIL PROTECTED]> wrote: > Hey guys, hope you can help me here. I've been playing with python for > about a week or two and I've been reading "A Byte Of Python" to get me > on my feet. I've decided to write a program which will list all ID3 > information in a directory of

Re: import antigravity

2007-12-05 Thread Chris
On Dec 5, 10:14 pm, [EMAIL PROTECTED] wrote: > Guess what made xkcd today: > > http://xkcd.com/353/ rofl, pity it's on page 2 already of the group ;( -- http://mail.python.org/mailman/listinfo/python-list

Re: Optimizing memory usage w/ HypterText package

2007-12-05 Thread Chris
On Dec 5, 10:17 pm, Chris <[EMAIL PROTECTED]> wrote: > On Dec 5, 9:35 pm, [EMAIL PROTECTED] wrote: > > > > > I've been using the HyperText module for a while now > > (http://dustman.net/andy/python/HyperText/), and I really like it. > > > I've run

Re: How to split string

2007-12-05 Thread Chris
On Dec 5, 10:55 am, Johny <[EMAIL PROTECTED]> wrote: > I have a string of a variable length and I need to split the string > in strings of 6 characters . > But if the 6th character is not space then I must split the string > at possition before the 6th character. > > For example: > if the main str

Re: Omitting results with id3reader [Beginner]

2007-12-05 Thread Chris
On Dec 5, 2:04 pm, Ionis <[EMAIL PROTECTED]> wrote: > On Dec 5, 11:59 am, Chris <[EMAIL PROTECTED]> wrote: > > > Ok, just noticed you linked the id3reader. I tested my code and it > > worked fine. > > Thanks alot Chris. Could you comment your code so I can s

Re: How to split string

2007-12-05 Thread Chris
On Dec 5, 1:46 pm, Johny <[EMAIL PROTECTED]> wrote: > On Dec 5, 11:55 am, Chris <[EMAIL PROTECTED]> wrote: > > > > > On Dec 5, 10:55 am, Johny <[EMAIL PROTECTED]> wrote: > > > > I have a string of a variable length and I need to split the string >

Re: Optimizing memory usage w/ HypterText package

2007-12-05 Thread Chris
On Dec 5, 9:35 pm, [EMAIL PROTECTED] wrote: > I've been using the HyperText module for a while now > (http://dustman.net/andy/python/HyperText/), and I really like it. > > I've run into a situation where I have code to construct a table > and while it is normally perfect, there are times where the

Re: sqlite or xml

2007-12-06 Thread Chris
On Dec 6, 10:21 pm, Kelie <[EMAIL PROTECTED]> wrote: > Hello group, > > If I need store and use a couple thousand of people's contact info: > first name, last name, phone, fax, email, address, etc. I'm thinking > of using either sqlite or xml. Which one is better? My understanding > is if there is

Re: Some python syntax that I'm not getting

2007-12-07 Thread Chris
On Dec 7, 2:31 pm, waltbrad <[EMAIL PROTECTED]> wrote: > > I understand how D['say'] gets you 5, But I still don't understand > the line after the 5. > > How is the character 's' some special code? And I don't get what is > going on with the % character. I'm used to it's use in c-style > formatt

Re: Any simpler way to do this

2007-12-07 Thread Chris
On Dec 7, 10:37 am, Lars Johansen <[EMAIL PROTECTED]> wrote: > I have a function that looks like this: > > def Chooser(color): > > if color == "RED": > x = term.RED > elif color == "BLUE": > x = term.BLUE > elif color == "GREEN": >

Re: File to dict

2007-12-07 Thread Chris
On Dec 7, 1:31 pm, [EMAIL PROTECTED] wrote: > Hello everyone, > > I have written this small utility function for transforming legacy > file to Python dict: > > def lookupdmo(domain): > lines = open('/etc/virtual/domainowners','r').readlines() > lines = [ [y.lstrip().rstrip() for y i

Re: File to dict

2007-12-07 Thread Chris
Ta Matt, wasn't paying attention to what I typed. :) And didn't know that about .get() and not having to declare the global. Thanks for my mandatory new thing for the day ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: highscores list

2007-12-08 Thread Chris
On Dec 8, 8:32 pm, Shawn Minisall <[EMAIL PROTECTED]> wrote: > I'm writing a game that uses two functions to check and see if a file > called highScoresList.txt exists in the main dir of the game program. > If it doesn, it creates one. That part is working fine. The problem is > arising when it g

Re: highscores list

2007-12-08 Thread Chris
On Dec 8, 10:07 pm, Chris <[EMAIL PROTECTED]> wrote: > On Dec 8, 8:32 pm, Shawn Minisall <[EMAIL PROTECTED]> wrote: > > > > > I'm writing a game that uses two functions to check and see if a file > > called highScoresList.txt exists in the main dir of the

Re: help with pyparsing

2007-12-09 Thread Chris
On Dec 10, 7:01 am, Prabhu Gurumurthy <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > All, > > I have the following lines that I would like to parse in python using > pyparsing, but have some problems forming the grammar. > > Line in file: > table const { 207.135.1

Re: Importing functions that require parameters

2007-12-10 Thread Chris
On Dec 10, 12:41 pm, Matt_D <[EMAIL PROTECTED]> wrote: > Good afternoon. > > As a self-tutoring project I am writing a one-time-pad encrypt/decrypt > script. I have completed the encryption portion and am working > currently on the decryption algorithm. My goal is to have the encrypt > and decrypt

Re: Error when executing the library reference echo server example

2007-12-10 Thread Chris
On Dec 10, 2:16 pm, [EMAIL PROTECTED] wrote: > Hi. Python newbie speaking, > > I've copy/pasted the example of the echo server that comes in the IDLE > documentation ("Python Library Reference" section 17.2.3) to see how > the sockets work. The only change I've made is in the host address > which I

Re: array.shape() gives TypeError: 'tuple' object is not callable

2007-12-10 Thread Chris
On Dec 10, 5:22 pm, Charles Fox <[EMAIL PROTECTED]> wrote: > Hi gys -- I am looking at Numpy but getting this error when I try to > get array sizes. I'm using Ubuntu Edgy with standard repositories and > scipy. Any ideas? Am I doing something wrong or is it my install of > scipy? > > $ python >

Matching XML Tag Contents with Regex

2007-12-11 Thread Chris
one for each div. Is what I'm trying to do possible with Python's Regex library? Is there an error in my Regex? Thanks, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Matching XML Tag Contents with Regex

2007-12-11 Thread Chris
On Dec 11, 11:41 am, garage <[EMAIL PROTECTED]> wrote: > > Is what I'm trying to do possible with Python's Regex library? Is > > there an error in my Regex? > > Search for '*?' onhttp://docs.python.org/lib/re-syntax.html. > > To get around the greedy single match, you can add a question mark > afte

Re: problem parsing lines in a file

2007-12-11 Thread Chris
it might occur in one of the other elements as well then just split the line on delimeters. In the first case you can do. for line in input_file: output_file.write( line.replace('0:00:00','') ) in the latter rather. for line in input_file: tmp = line.split( ',' ) tmp[3] = tmp[3].replace('0:00:00') output_file.write( ','.join( tmp ) ) Hope that helps, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Matching XML Tag Contents with Regex

2007-12-11 Thread Chris
On Dec 11, 1:08 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Chris wrote: > > On Dec 11, 11:41 am, garage <[EMAIL PROTECTED]> wrote: > >> > Is what I'm trying to do possible with Python's Regex library? Is > >> > there an e

Re: determining bytes read from a file.

2007-12-13 Thread Chris
A couple potential optimizations: > > # create the member variable name. > mem_var_name = options.inputfilename > mem_var_name = mem_var_name.replace(' ','_') > mem_var_name = mem_var_name.replace('.','_') > mem_var_name = options.inputfilename.replace(' ','_').replace('.','_') No need to assign

Re: making all letters Caps/Small Letters

2007-12-14 Thread Chris
On Dec 14, 11:30 am, Merrigan <[EMAIL PROTECTED]> wrote: > Hi There, > > I'm sure I have done this before, but cannot remember how, or find out > how to do it quickly - but is there a way/function/something in python > to make all the letters of a raw_input() string small/capital letters? > > Thank

Re: Rounding

2007-12-18 Thread Chris
On Dec 18, 10:53 am, "Vladimir Rusinov" <[EMAIL PROTECTED]> wrote: > On 12/15/07, katie smith <[EMAIL PROTECTED]> wrote: > > > > > if i have a number 6.345 and i wanted it to be 6 without subtracting .345 > > because it won't always be .345 what do i do? > > > how do i round to the nearest whole nu

Re: import X between submodules in a package

2007-12-19 Thread Chris
On Dec 19, 9:24 am, Donn Ingle <[EMAIL PROTECTED]> wrote: > So, I guess I am confused about the 'scope' of what gets imported where. I > am thinking that if one module (py file) does *import os* something and > *then* imports another module - the second module should have access to os > too? > I i

Re: pop3_ssl Attachment problem

2007-12-20 Thread Chris
On Dec 20, 9:22 am, los117 <[EMAIL PROTECTED]> wrote: > I am trying to fetch email from gmail, but what I am really interested > is the attachment. > I manage to access the gmail server and get the messege but the > attachment came as text: > > "--=_Part_5286_15861975.1197955173158 > Content-Ty

Re: Python; jump to a concrete line

2007-12-20 Thread Chris
On Dec 20, 7:56 pm, Horacius ReX <[EMAIL PROTECTED]> wrote: > Hi, sorry but after looking for information, I still did not get how, > when reading a text file in python, can one jump to a concrete line > and then read the different data (separated by spaces). In each line > there is different numbe

Re: Python; jump to a concrete line

2007-12-20 Thread Chris
On Dec 20, 8:13 pm, "Russell Blau" <[EMAIL PROTECTED]> wrote: > "Horacius ReX" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Hi, sorry but after looking for information, I still did not get how, > > when reading a text file in python, can one jump to a concrete line > > and

Re: How to make this Python code print blocks of text?

2007-12-20 Thread Chris
crementing counters yourself is 'counter += 1' instead of the uglier 'counter = counter + 1'. For the string you are printing, look into string formatting rather than dumping things like 'print table, "X", counter, "=", counter * table' as "prin

Twisted and Tkinter

2006-04-26 Thread Chris
Does anyone know how to use twisted and tkinter. I have a simple tcp server and I want to send messages to it once connected using a tkinter button? I have built the code as far as I can but don't know what to do from here. Any reference I try to put to sendmessage in chatfactory doesn't seem to wo

Re: Twisted and Tkinter

2006-04-27 Thread Chris
Sorry. The error message is normally AttributeError: 'NoneType' object has no attribute 'sendLine'" [EMAIL PROTECTED] wrote: > Posting that error message would be helpful -- http://mail.python.org/mailman/listinfo/python-list

finding IP address of computer

2006-04-27 Thread Chris
How do I find and print to screen the IP address of the computer my python program is working on? -- http://mail.python.org/mailman/listinfo/python-list

Re: finding IP address of computer

2006-04-27 Thread Chris
hehe, works a charm, cheers mate. -- http://mail.python.org/mailman/listinfo/python-list

Re: Twisted and Tkinter

2006-04-27 Thread Chris
Exception in Tkinter callback Traceback (most recent call last): File "C:\Python24\lib\lib-tk\Tkinter.py", line 1345, in __call__ return self.func(*args) TypeError: unbound method sendMessage() must be called with ChatFactory instance as first argument (got nothing instead) I have simplifie

Re: Twisted and Tkinter

2006-04-27 Thread Chris
it now comes up with the error message Traceback (most recent call last): File "C:\Python24\lib\lib-tk\Tkinter.py", line 1345, in __call__ return self.func(*args) File "C:\Documents and Settings\chris\Desktop\Python\client.py", line 30, in sendMessage

twisted and tkinter chat client

2006-04-27 Thread Chris
click the send button: Traceback (most recent call last): File "C:\Python24\lib\lib-tk\Tkinter.py", line 1345, in __call__ return self.func(*args) File "C:\Documents and Settings\chris\Desktop\Python\client.py", line 30, in sendMessage self.sendLine("Test"

Re: Twisted and Tkinter

2006-04-27 Thread Chris
There is no manual that's the problem. The sendLine method is part of LineReceiver which is part of twisted. It's used to send a message over the transport link. I can get it working by overriding twisted's methods for example linereceived() or connectionmade(). But how do I get it to send a messag

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