Re: Python-like C++ library

2006-08-23 Thread Simon Forman
.. couldn't you use python itself or parts of it as a library? I know you said you're not looking to interface C++ with Python in any way, but why emulate if you could include? (Again, if this is stupid, sorry! :) ) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Regex help...pretty please?

2006-08-23 Thread Simon Forman
: cond ( - 1 , 1 , f ) * ( ( float ( e ) * ( 2 ** 4 ) ) + ( float ( d ) * 8 ) + ( float ( c ) * 4 ) + ( float ( b ) * 2 ) + float ( a ) ) Once you've got that far the rest should be easy. :) Peace, ~Simon http://pyparsing.wikispaces.com/ http://pages.cpsc.ucalgary.ca/~aycock/spark/ http

Re: setting a breakpoint in the module

2006-08-23 Thread Simon Forman
Jason Jiang wrote: Hi, I have two modules: a.py and b.py. In a.py, I have a function called aFunc(). I'm calling aFunc() from b.py (of course I import module a first). The question is how to directly set a breakpoint in aFunc(). The way I'm doing now is to set a breakpoint in b.py at the

Re: setting a breakpoint in the module

2006-08-23 Thread Simon Forman
Jason Jiang wrote: Simon Forman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Jason Jiang wrote: Hi, I have two modules: a.py and b.py. In a.py, I have a function called aFunc(). I'm calling aFunc() from b.py (of course I import module a first). The question is how

Re: range of int() type.

2006-08-23 Thread Simon Forman
| sys.maxint 2147483647 From the sys module docs: maxint The largest positive integer supported by Python's regular integer type. This is at least 2**31-1. The largest negative integer is -maxint-1 -- the asymmetry results from the use of 2's complement binary arithmetic. Peace, ~Simon P.S. ints

Re: Problem with tokenize module and indents

2006-08-23 Thread Simon Forman
/lib/module-tabnanny.html Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get file name of the running .py file

2006-08-23 Thread Simon Forman
Also, check out: http://groups.google.ca/group/comp.lang.python/browse_frm/thread/712572b3c2f2cb13 Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: setting a breakpoint in the module

2006-08-23 Thread Simon Forman
Jason Jiang wrote: Great! It's working now. Thank you so much. Jason You're welcome, it's a pleasure! :-D ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: swapping numeric items in a list

2006-08-22 Thread Simon Forman
lists): def rev(n): i = iter(n) while True: a = i.next() yield i.next() yield a Example of use: r = range(24) print list(rev(r)) If your list comes from binary (str) data, and you're dealing with endianness, I smell a faster way using struct. Peace, ~Simon

Re: key not found in dictionary

2006-08-22 Thread Simon Forman
Or you can use the has_key() and test it first. For example if foo.has_key('bar'): print 'we have it' else : print 'we don't have bar.' Nowadays you can also say: if 'bar' in foo: # do something -- http://mail.python.org/mailman/listinfo/python-list

Re: [NEWB]: List with random numbers

2006-08-20 Thread Simon Forman
while loop. HTH, ~Simon P.S. Take a look at the random.shuffle() function... :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Help in using introspection to simplify repetitive code

2006-08-20 Thread Simon Percivall
[EMAIL PROTECTED] wrote: Hello. I'm writing a proxy class, i.e: a class whose methods mostly delegate their functionality to other class object. Most of the methods (which are quite a lot) defined in the class would end up being: def thisIsTheMethodName(self):

Re: Access to sys.argv when python interpreter is invoked in some modes like 'python -c command'

2006-08-20 Thread Simon Forman
is not being executed interactively. It will simply get the value of sys.argv and then throw it away. Try import sys; print sys.argv, if you want to print the value of sys.argv. Happy coding, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: List comparison help please

2006-08-20 Thread Simon Forman
(fname) 6) Why are you using #~ for comments? Also, check out os.path.splitext() http://docs.python.org/lib/module-os.path.html#l2h-1761 HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: string validation/ form validation

2006-08-20 Thread Simon Forman
be appreciated Yes. Please read this: http://www.catb.org/~esr/faqs/smart-questions.html Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: text editor suggestion?

2006-08-18 Thread Simon Forman
John Salerno wrote: Ok, I know it's been asked a million times, but I have a more specific question so hopefully this won't be just the same old post. I've tried a few different editors, and I really like UltraEdit, but it's Windows-only and I'm working more on Linux nowadays. Here are my

Re: text editor suggestion?

2006-08-18 Thread Simon Forman
Paul Rubin wrote: Simon Forman [EMAIL PROTECTED] writes: Have you tried IDLE? It ships with python, meets your 5 criteria(*), can be customized (highlighting colors and command keys and more), and includes a usable GUI debugger. It's got some warts, but I like it a lot, it's pretty much

Re: round not rounding to 0 places

2006-08-16 Thread Simon Forman
a number to a given precision in decimal digits (default 0 digits). This always returns a floating point number. Precision may be negative. HTH, ~Simon BTW, '+value+' ..? Huh? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python form Unix to Windows

2006-08-16 Thread Simon Forman
. YMMV Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Very weird behavior that's driving me crazy

2006-08-16 Thread Simon Forman
you're trying to do and post its output. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the keyword is for?

2006-08-16 Thread Simon Forman
Sybren Stuvel wrote: Dan Bishop enlightened us with: a = b = 1e1000 / 1e1000 a is b True a == b False If a is b then they refer to the same object, hence a == b. It cannot be otherwise, unless Python starts to defy logic. I copied your code and got the expected result: a = b =

Re: how to deepcopy a slice object?

2006-08-16 Thread Simon Forman
Alexandre Guimond wrote: thx for all the help simon. good ideas i can work with. thx again. alex. You're very welcome, a pleasure. ;-) ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Clean way to not get object back from instantiation attempt gone bad

2006-08-16 Thread Simon Forman
John Machin wrote: Simon Forman wrote: | class f: ... def __init__(self): ... del self Of course nothing happens. Args are local variables. 'self' is is a vanilla arg of a vanilla function. I know. ... | e = f() | e __main__.f instance at 0xb7dd91ec

Re: Documentation Question About Depricated String Functions

2006-08-16 Thread Simon Forman
The following list of functions are also defined as methods of string and Unicode objects; see ``String Methods'' (section 2.3.6) for more information on those. i.e. string.lower() = WHAT?.lower() (would return what?...) HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: trouble understanding inheritance...

2006-08-16 Thread Simon Forman
your object is by choosing which class to use to construct the object. HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: getting database column names from query

2006-08-16 Thread Simon Forman
', -1L), (3L, 'Test2', -1L)) -j k.description See also http://www.python.org/dev/peps/pep-0249/ HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: trouble understanding inheritance...

2006-08-16 Thread Simon Brunning
On 16 Aug 2006 12:53:12 -0700, KraftDiner [EMAIL PROTECTED] wrote: I can see that this might work... c = [a, b] for c in [a,b]: c.getName() but when does baseClass ever get used? Why did i even have to define it? Well, quite. -- Cheers, Simon B, [EMAIL PROTECTED], http

Re: Anyone have a link handy to an RFC 821 compliant email address regex for Python?

2006-08-16 Thread Simon Forman
the bill? http://docs.python.org/lib/module-email.Utils.html#l2h-3944 HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Mega Newbie Questions: Probably FAQs

2006-08-15 Thread Simon Forman
/comp.lang.python/browse_frm/thread/b4e08adec2d835f5/af340f17faec4055 Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: how to deepcopy a slice object?

2006-08-15 Thread Simon Forman
? Anyway, I don't know much about them, other than that they are slightly unusual objects that play a very restricted role in python, rather like the Ellipsis. Workarounds are possible, I think, but really you almost certainly don't need to do this. Peace, ~Simon -- http://mail.python.org

Re: how to deepcopy a slice object?

2006-08-15 Thread Simon Forman
going to 3D and 4D grid, and its somewhat annoying to carry so many indices in my class definition. Simon Forman wrote: Alexandre Guimond wrote: Hi all, i'm trying to deepcopy a slice object but i get the following error. Does anyone know a workaround? ActivePython 2.4.3

Re: how to deepcopy a slice object?

2006-08-15 Thread Simon Forman
Duncan Booth wrote: Simon Forman wrote: Why would you want to [deep]copy a slice object? I would guess the original poster actually wanted to copy a data structure which includes a slice object somewhere within it. That is a perfectly reasonable albeit somewhat unusual thing to want

Re: using python at the bash shell?

2006-08-15 Thread Simon Forman
cga2000 wrote: On Tue, Aug 08, 2006 at 12:22:42PM EDT, Simon Forman wrote: John Salerno wrote: [EMAIL PROTECTED] wrote: John Aside from the normal commands you can use, I was wondering if John it's possible to use Python from the terminal instead of the John normal

Re: idea on how to get/set nested python dictionary values

2006-08-15 Thread Simon Forman
[EMAIL PROTECTED] wrote: | would use a recursive approach for this - given that you have a sort of recursive datastructure: py def SetNewDataParam2(Data, NewData): ... if type(Data[Data.keys()[0]]) == type(dict()): Note: | type(dict()) is dict True dict *is* a type... --

Re: Clean way to not get object back from instantiation attempt gone bad

2006-08-15 Thread Simon Forman
= f_factory(True) | foo __main__.f instance at 0xb7dd944c | foo = f_factory(False) | foo | print foo None There might be a way using __new__(), but I don't know what or how. Also, del is a statement, not a function. You don't need to use ()'s. HTH, ~Simon -- http://mail.python.org/mailman/listinfo

Re: yEnc

2006-08-15 Thread Simon Forman
Kairo Matthias wrote: How can i encode with yEnc? What's yEnc? :-) Seriously though, did you try googling for yEnc python? Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: programming with Python 3000 in mind

2006-08-15 Thread Simon Forman
replacing stdout) was rewriting it not to use print statements... http://groups.google.ca/group/comp.lang.python/browse_frm/thread/70aca5068c18384f/d19e9119b7ca1af2 Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing n elements per line in a list

2006-08-15 Thread Simon Forman
the lines with '\n' and stick a call to rstrip() in there: G = grouper(5, R, '') print '\n'.join(' '.join(str(n) for n in N) for N in G).rstrip() but then you're back to ugly. lol. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing n elements per line in a list

2006-08-15 Thread Simon Forman
, John Very nice. ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: outputting a command to the terminal?

2006-08-14 Thread Simon Forman
write most of my tiny little helper scripts in python, but in this case, bash is the clear winnar. (And on *nix. man pages are your best friend. Plus you get to feel all l33t when you grok them. lol) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: outputting a command to the terminal?

2006-08-14 Thread Simon Forman
John Salerno wrote: Simon Forman wrote: It's simple, short, and to-the-point. The equivalent python script would be much longer, for no appreciable gain. I write most of my tiny little helper scripts in python, but in this case, bash is the clear winnar. (And on *nix. man pages

Re: Memory problem

2006-08-14 Thread Simon Forman
: new_list = [0 for notused in xrange(100)] or if you already have a list: my_list.extend(0 for notused in xrange(100)) HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: reading from sockets

2006-08-13 Thread Simon Forman
AndrewTK wrote: Simon Forman wrote: So I'm guessing it's something wrong in your java server. Thanks then. I'll keep testing then... Although I don't seem to have netcat on my unit... I'm using a uni computer so I can't install stuff... but I'm guessing what I wrote is something like

Re: open() and Arabic language

2006-08-13 Thread Simon Forman
/howto/unicode , there is a brief section near the bottom on Unicode filenames. If your problem is related to Unicode, this may help you, but I'm not sure. HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: yet another noob question

2006-08-13 Thread Simon Forman
combination and you should be well rewarded. :-) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: yet another noob question

2006-08-13 Thread Simon Forman
for you then it won't do any harm to use it. (Just don't mention my name ;-) ) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: looking for a simple way to load a program from another python program..

2006-08-13 Thread Simon Forman
://docs.python.org/lib/module-subprocess.html) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested if and expected an indent block

2006-08-13 Thread Simon Forman
. (If you're using IDLE it should have indented it for you when you hit return after the def statement.) HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator wrapper

2006-08-12 Thread Simon Forman
alf wrote: Simon Forman wrote: | I = ([n] for n in i) This is nice but I am iterating thru hude objects (like MBs) so you know ... No, I don't know... :-) potentially my source lists are huge - so wanted to avoid unnecessary memory allocation My friend, I think you've

Re: reading from sockets

2006-08-12 Thread Simon Forman
]:~ $ python delme.py 'hi there\n' 'how are you\n' I'm fine thanks\n [EMAIL PROTECTED]:~ $ So I'm guessing it's something wrong in your java server. HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: trouble with replace

2006-08-12 Thread Simon Forman
/Cookbook/Python/Recipe/81330 It uses a regular expression, so I'd guess it wouldn't be to hard to get it to work in multiline mode. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: self=pickle.load(file)? (Object loads itself)

2006-08-12 Thread Simon Forman
this? Usually you would just say obj = pickle.load(f) and be done with it (you could manipulate obj after it's created, of course.) Why do you want to do obj = Obj() but have the obj come from obj.dat? Just curious. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: trouble with replace

2006-08-12 Thread Simon Forman
Simon Forman wrote: f pemberton wrote: Marc 'BlackJack' Rintsch wrote: In [EMAIL PROTECTED], f pemberton wrote: I've tried using replace but its not working for me. xdata.replace('abcdef', 'highway') xdata.replace('defgef', 'news') xdata.replace('effwer', 'monitor

Re: sys.platform documentation?

2006-08-11 Thread Simon Forman
processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 8 model name : Pentium III (Coppermine) HTH, ;-) ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator wrapper

2006-08-11 Thread Simon Forman
) | I.next() [0] | I.next() [1] | I.next() [2] | I.next() Traceback (most recent call last): File stdin, line 1, in ? StopIteration Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator wrapper

2006-08-11 Thread Simon Forman
alf wrote: Simon Forman wrote: class LW(object): # ListWrapper ... def __init__(self, i): ... self.theiter = i ... def next(self): ... return [self.theiter.next()] I hoped one lamda would take care of it but looks like it is a simplest choice. | I = ([n] for n

Re: Make Object Oriented?

2006-08-10 Thread Simon Hibbs
be useful or appropriate? Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.platform documentation?

2006-08-10 Thread Simon Forman
', 'Power Macintosh', 'powerpc') That's on Mac OS X 10.4.6. Indeed more useful. Michiel It might be a good idea to write a brief script to print out sys.platform, platform.platform(), platform.uname(), etc.. and post it here for people to run and post their results. Peace, ~Simon -- http

Re: String Formatting

2006-08-10 Thread Simon Forman
Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: reading from sockets

2006-08-10 Thread Simon Forman
on. (BTW, while len(data) 0: can just be while data:) (Heaven help me, but maybe you could post your java server code here... If anyone screams too loudly blame me. Hahaha..) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: draw an image in wx.BufferedDC onto the page created by AddPage of wx.Notebook

2006-08-10 Thread Simon Forman
is going on. I need your help. Thanks a lot. Have you tried http://wiki.wxpython.org/index.cgi/Asking_For_Help Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: seaching a list...

2006-08-10 Thread Simon Forman
in s.get_matching_blocks() if n == c] [3] There may be better ways. my real problem involves figuring out how to reduce the number of hits to the db/tbl... What? thanks ps. if this is confusing, i could provide psuedo-code to make it easier to see... Yes, please. Peace, ~Simon -- http://mail.python.org

Re: win32 load icon not from file, but from something

2006-08-10 Thread Simon Forman
cPickle.dumps(hicon) leads to nothing, cause it only gets the ID of the hicon :( Any ideas / recommendations / tipps? Harald Write the data to a temporary file and load it from there. (Also, iconPathName is already a string, you don't have to call str(iconPathName).) HTH, ~Simon -- http

Re: converting a nested try/except statement into try/except/else

2006-08-10 Thread Simon Forman
John Salerno wrote: Simon Forman wrote: What about the version I gave you 8 days ago? ;-) http://groups.google.ca/group/comp.lang.python/msg/a80fcd8932b0733a It's clean, does the job, and doesn't have any extra nesting. Peace, ~Simon I remember that version, but I found

Re: error handling

2006-08-10 Thread Simon Forman
] functions, or redesign it somehow. Peace, ~Simon (Also, there's no such thing as sys.error, do you mean sys.excepthook()?) -- http://mail.python.org/mailman/listinfo/python-list

Re: easy string formating question

2006-08-10 Thread Simon Forman
Slawomir Nowaczyk wrote: On Thu, 10 Aug 2006 11:39:41 -0700 f pemberton [EMAIL PROTECTED] wrote: # I have kind of an interesting string, it looks like a couple hundred # letters bunched together with no spaces. Anyway, i'm trying to put a # ? and a (\n) newline after every 100th character

Re: hide python code !

2006-08-10 Thread Simon Forman
service is a good one. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Python share CPU time?

2006-08-10 Thread Simon Forman
to create programmed objects that received a budget of processor time. The objects would not work if they ran out of processor time... Perhaps something like this could help you? (Sorry to be so vague.) HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: converting a nested try/except statement into try/except/else

2006-08-09 Thread Simon Forman
about the version I gave you 8 days ago? ;-) http://groups.google.ca/group/comp.lang.python/msg/a80fcd8932b0733a It's clean, does the job, and doesn't have any extra nesting. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Eval (was Re: Question about using python as a scripting language)

2006-08-09 Thread Simon Forman
://groups.google.ca/group/comp.lang.python/browse_frm/thread/8e427c5e6da35c/a34397ba74892b4e Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: binary conversion issues

2006-08-08 Thread Simon Forman
godavemon wrote: I'm using python's struct and binascii modules to write some values from my parser to binary floats. This works great for all of my binary files except one. For some reason this file is saving to 836 (stated by my command shell) bytes instead of 832 like it should. It

Re: using python at the bash shell?

2006-08-08 Thread Simon Forman
an '!' before them. If you ever need to run something that for some reason doesn't work with this, you can always run !bash and do it in bash. :-) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question: what's with self?

2006-08-08 Thread Simon Forman
, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: String.digits help!!!

2006-08-08 Thread Simon Forman
) in the string to the var variable at each iteration. HTH, ~Simon (BTW, ur is your and u is you. I'm sorry to nitpick, but it's a personal idiosyncrasy of mine to be bothered by such.) -- http://mail.python.org/mailman/listinfo/python-list

Re: String.digits help!!!

2006-08-08 Thread Simon Forman
[EMAIL PROTECTED] wrote: Simon Forman: It's unlikely to be deprecated since it doesn't make much sense to make it an attribute of the str type. Why? Thank you, bearophile Let me toss the question back at you: Does it make sense to you that str should have this attribute? Why? I'm

Re: (easy question) Find and replace multiple items

2006-08-08 Thread Simon Forman
ds4ff1z wrote: Hello, i'm looking to find and replace multiple characters in a text file (test1). I have a bunch of random numbers and i want to replace each number with a letter (such as replace a 7 with an f and 6 with a d). I would like a suggestion on an a way to do this. Thanks

Re: newb question: file searching

2006-08-08 Thread Simon Forman
start your script from a different directory. HTH. (Also, if you're not already, be aware of os.path.isfile() and os.path.isdir(). They should probably be helpful to you.) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Class data being zapped by method

2006-08-08 Thread Simon Forman
having trouble later I'll try to take another look at your code. Print statements and debuggers are your friends, and John Machin's advice seems good to me. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: How to reverse tuples in a list?

2006-08-08 Thread Simon Forman
tuples are all two items, you can do it like this: y = [(b, a) for a, b in y] if not, then: y = [tuple(reversed(t)) for t in y] :-D Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Import module with non-standard file name

2006-08-07 Thread Simon Forman
.pyc files (when available) of your main module, rather than re-parsing its text. HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: using python at the bash shell?

2006-08-07 Thread Simon Forman
help system. object? - Details about 'object'. ?object also works, ?? prints more. In [1]: !man ls Reformatting ls(1), please wait... viewing actual man page here. ~Simon In [2]: !!ls -l Out[2]: ['total 40', 'drwxr-xr-x 3 sforman sforman 4096 2006-08-02 12:41 docs', 'drwxr-xr-x 3 sforman sforman

Re: subprocesses and deadlocks

2006-08-06 Thread Simon Forman
[EMAIL PROTECTED] wrote: Hi, there are many ways of solving the problem of finite buffer sizes when talking to a subprocess. I'd usually suggest using select() but today I was looking for a more readable/understandable way of doing this. Back in 1997 Guido himself posted a very nice

Re: current recursion level

2006-08-06 Thread Simon Forman
Cameron Laird wrote: In article [EMAIL PROTECTED], Simon Forman [EMAIL PROTECTED] wrote: David Bear wrote: Is there an easy way to get the current level of recursion? I don't mean . . . import sys def getStackDepth

Re: Backup GMAIL Messages with Python

2006-08-05 Thread Simon Forman
library module: http://docs.python.org/lib/module-email.html HTH, ~Simon Out of curiosity, why do you want to _backup_ a gmail account? (I use my gmail account to backup files and documents I never want to lose.) I could think of some reasons, but I'm wondering what yours are. : ) -- http

Re: testing array of logicals

2006-08-05 Thread Simon Forman
Janto Dreijer wrote: Janto Dreijer wrote: John Henry wrote: Simon Forman wrote: False not in logflags Or, if your values aren't already bools False not in (bool(n) for n in logflags) Very intriguing use of not in... Is there a reason why you didn't

Re: Thread Question

2006-08-05 Thread Simon Forman
to consider would be to split your download and zipping code into separate functions then create one more thread to do all the zipping. That way your downloading threads would never be waiting around for each other to zip. Just a thought. :) ~Simon -- http://mail.python.org/mailman/listinfo

Re: Need help building boost python on mac os x.

2006-08-04 Thread Simon Forman
python list: http://www.boost.org/more/mailing_lists.htm HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: opposite of import

2006-08-03 Thread Simon Brunning
. And if none of those are what you meant by the opposite of an import, you'll need to be more explicit. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: opposite of import

2006-08-03 Thread Simon Brunning
On 8/3/06, Simon Brunning [EMAIL PROTECTED] wrote: If you want to remove the module from a namespace into which you imported it, you can do that with del: import amodule amodule.afunction() # Works fine del amodule amodule.afunction() # Will die now Note that this doesn't get rid

Re: Datetime question

2006-08-03 Thread Simon Brunning
, only create a new one. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: opposite of import

2006-08-03 Thread Simon Brunning
reference counting *would* remove the module as soon as you de referenced it, but for the fact that Python stashes a reference to the module in (IIRC) sys.__modules__. And you mess with *that* at your peril. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http

Re: opposite of import

2006-08-03 Thread Simon Brunning
. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Datetime question

2006-08-03 Thread Simon Brunning
, but it also still has the same value. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best way to print the usage string ?

2006-08-03 Thread Simon Forman
newline is not needed since print will add one of it's own.) HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Hiding Console Output

2006-08-03 Thread Simon Forman
Kkaa wrote: This seems like the right thing to do, but it runs the program in the background, and I need my program to wait until the x.exe has finished. I tried using this code: p = subprocess.Popen(x.exe,shell=True,stdout=subprocess.PIPE,stdin=subprocess.PIPE, stderr=subprocess.PIPE)

Re: OS independent files

2006-08-03 Thread Simon Forman
in http://docs.python.org/lib/os-procinfo.html) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: help - iter dict

2006-08-03 Thread Simon Forman
closest key. result = u return result I hope that helps. :-) Python is an amazing language once you get the hang of it. Enjoy. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: where i can find this module

2006-08-03 Thread Simon Brunning
://agtk.sourceforge.net/, perhaps? If not, we'll need more context. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: current recursion level

2006-08-03 Thread Simon Forman
...''' if n 4: return g(n + 1) else: return n Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem reading/writing files

2006-08-03 Thread Simon Forman
= f.read() | f.close() | len(s) 1 | print s \x00 The problem is not with the read() method. Or, if it is, something very very weird is going on. If you can do the above and not get the same results I'd be interested to know what file data you have, what OS you're using. Peace, ~Simon (Think about

<    7   8   9   10   11   12   13   14   15   16   >