Re: Doubt C and Python

2005-08-23 Thread Jeff Schwab
praba kar wrote: > Dear All, >I want to know the link between c and python. >Some people with C background use Python instead > of programming in C.why? For me, the choice is typically among C++, Perl, Python, and Java. The arguments for Python relative to these languages are:

Ud_lG play for free Ud_lG

2005-08-24 Thread Jeff Hanson
Dear Casino Player, YOU HAVE BEEN PREAPPROVED. Receive $100 FREE at the Online Casino Of The Year 2002 when you open a new account. DOWNLOAD AWARD WINNING CASINO GAMES or VISIT THEIR WEBSITE FOR MORE INFORMATION. http://webmaster.windowscasino.com/SmartDownload.asp?affid=14409 WINDOWS CASINO

Re: NooB Question

2005-08-29 Thread Jeff Schwab
APCass wrote: > How do you execute a .py in Linux with KDE? If I double click on my > program it opens Kwrite, for editing. Try inserting this as the first line of the file: #!/usr/bin/env python -- http://mail.python.org/mailman/listinfo/python-list

Re: simple question: $1, $2 in py ?

2005-09-05 Thread Jeff Pitman
es_uomikim wrote: > $ echo "something" | ./my_script.py echo "test" | python -c "import sys; print sys.stdin.readlines()" -- http://mail.python.org/mailman/listinfo/python-list

Re: Django Vs Rails

2005-09-14 Thread Jeff Shell
My opinion, as posted there, was pretty immediate and only going off of surface values. I just saw in Django what I had seen too much of in my own code. I've written similar things in Zope and Formulator that did all sorts of fancy automatic 'admin screen' generation, DBMS CRUD statements. I even a

Re: Looking for a database. Sugestions?

2005-09-15 Thread Jeff Shell
If it's embedded, is there any reason why it should be SQL? A solid alternative could me MetaKit, which has Python bindings: http://www.equi4.com/metakit/python.html """ Buzzwords - Metakit is an embeddable database which runs on Unix, Windows, Macintosh, and other platforms. It lets you build ap

Re: Finding where to store application data portably

2005-09-21 Thread Jeff Schwab
Steven D'Aprano wrote: > As a Linux user, I really am sick of every damn application, script and > program under the sun filling the top level of my home directory with > dot-files. > > I wish the Linux Standard Base folks would specify that settings files > should all go into a subdirectory like

Re: [noob] Questions about mathematical signs...

2005-02-06 Thread Jeff Epler
t; 3. How can i input root? Assuming that you've already executed import math Here are some ways to find the square root of a number: math.sqrt(4) 4 ** .5 math.pow(4, .5) Jeff pgpUKyYywumMf.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Python on WWW - beginners question: what to choose?

2005-02-07 Thread Jeff Reavis
Spyce has support for Cheetah Templates: http://spyce.sourceforge.net/doc-mod_template.html as well as pooling: http://spyce.sourceforge.net/doc-mod_pool.html Spyce templates are converted into python before execution, and you can enable caching in the Spyce configuration file. Spyce also comes w

Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread Jeff Epler
xcept', which is really offensive. If I want to beg my computer to run programs, I know where to find Intercal with its "PLEASE" and "DO PLEASE" constructions. Jeff pgpmDM5lPWYOK.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: variable declaration

2005-02-08 Thread Jeff Shannon
. After it, on step (3) you can safely and peacefully add new PowerOfGenerator variable. You can also get all places where said variable exists by using grep, or your editor's search feature. I don't see how a var declaration gains you anything over 'grep PowerOfGenerator *.py

Re: Basic file operation questions

2005-02-08 Thread Jeff Shannon
losed during program shutdown if it hasn't happened before then. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Big development in the GUI realm

2005-02-08 Thread Jeff Shannon
on a single installation medium would be a tricky edge case. I suspect it *could* be done in a GPL-acceptable way, but one would need to take care about it.) Of course, this is only my own personal interpretation and opinion -- IANAL, TINLA, YMMV, etc, etc. Jeff Shannon Technician/Program

Re: interactive execution

2005-02-08 Thread Jeff Shannon
real security, because malicious code can still get to __builtins__ from almost any object...) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: interactive execution

2005-02-09 Thread Jeff Shannon
the exec'ed statement actually sees, as well as what happens with the results. (But as I mentioned before, there is no real security here if you're exec'ing arbitrary code -- there's no sandboxing involved, and the exec'ed string *can* use that __builtins__ reference (among other things) to do all sorts of malicious stuff.) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2005-02-09 Thread Jeff Shannon
may (as just one of many examples) be much better off with something more like: for i in range(n)[::-1]: func(n) The '[::-1]' iterates over the range in a reverse (decreasing) direction; this may or may not be necessary depending on the circumstances. Jeff Shannon Technician/

Re: Is Python as capable as Perl for sysadmin work?

2005-02-09 Thread Jeff Shannon
Courageous wrote: *checks self to see if self is wearing rose colored glasses* assert(self.glasses.color != 'rose') ;) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2005-02-10 Thread Jeff Shannon
Dennis Lee Bieber wrote: On Wed, 09 Feb 2005 18:10:40 -0800, Jeff Shannon <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: for i in range(n)[::-1]: func(n) Shouldn't that be func(i) (the loop index?) You're right, that's what I *

Re: how can I replace a execfile with __import__ in class to use self variables

2005-02-10 Thread Jeff Shannon
-- def pr(self): print self.var --- (Though frankly I don't see the advantage of having this tiny function in a separate file to begin with...) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: [N00B] What's %?

2005-02-10 Thread Jeff Shannon
the interval [0...4) (including 0 but not including 4). Modulus is useful for all sorts of periodic behavior. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter.Canvas saved as JPEG?

2005-02-10 Thread Jeff Epler
The Tkinter Canvas directly supports saving to postscript format, but not any standard bitmap format (or even modern vector formats like pdf or svg). Jeff pgpBVvDhXslRq.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2005-02-11 Thread Jeff Shannon
Dennis Lee Bieber wrote: On Thu, 10 Feb 2005 09:36:42 -0800, Jeff Shannon <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: And as Peter Hansen points out, none of the Python versions leave n in the same state that the C loop does, so that's one more way in whic

Re: goto, cls, wait commands

2005-02-11 Thread Jeff Shannon
not* take that opportunity to purge things like GOTO. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: exec function

2005-02-12 Thread Jeff Epler
In this case, you can use getattr() instead of the exec statement: getattr(self.frame, t).SetTable(DataTable(d, r[0]), True) Jeff pgp6KrffC7xJf.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Why Tk treat F10, F11, F12 diferently from F1...F9?

2005-02-12 Thread Jeff Epler
to get rid of this binding, you would do it with something like w.bind_all("", "") for some widget w. I don't know why you see the "L1" and "L2" keysyms. I don't on my system (Fedora Core 2) Jeff pgpzGQcAMSSXd.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: SCons build tool speed

2005-02-13 Thread Jeff Epler
installed on their system (yes, a pretty Linux-centric view). One criticism of Make that I'd take seriously is that it's a domain-specific language and usually I say those are terrible ideas. I still have to refer to the manual to remember which of $*, $@, $^ or $< I need, sometimes,

Re: 64 bit Python

2005-02-14 Thread Jeff Epler
you could change the type of ob_size to long in the "#define PyObject_VAR_HEAD". I don't know what breaks when you do this, but maybe a few google or google groups searches could help you find others who have tried this. Jeff PS the limit of 500MB of "real data" in the 32-bit system m

Re: [Errno 18] Invalid cross-device link using os.rename

2005-02-14 Thread Jeff Epler
activities, os.shutil provides something that is between os.xxx and os.system("xxx") in complexity and capability. Jeff pgpQO2TDLG6iB.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I tell if my host supports Python?

2005-02-14 Thread Jeff Epler
suggestion with the simplest Python CGI program. http://docs.python.org/lib/node462.html that program would look something like #!/usr/bin/python import cgi; cgi.test() though you must know the correct path to the Python interpreter for this to work. Your best bet may be to a

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-14 Thread Jeff Shannon
act) matches to his "requirements". Instead of saying "Hey, someone's done half my work for me -- great!", he's saying "Hey, why haven't you done the rest of my work!" Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables.

2005-02-15 Thread Jeff Shannon
eed -- it looks like this worked perfectly to me, so the issue is in what's expected. :) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-15 Thread Jeff Shannon
ot;Interpretation is irrelevant. Logic is irrelevant. You will be assimilated." Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling a function from module question.

2005-02-15 Thread Jeff Shannon
names do that nicely. What do you see as the harm of using it?) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables.

2005-02-15 Thread Jeff Shannon
Bruno Desthuilliers wrote: Jeff Shannon a écrit : If running a console app from Explorer, the console will close as soon as the app terminates. Using raw_input() at the end of the app means that it won't close until the user hits Enter. So why dont you just open the console before runnin

Re: super not working in __del__ ?

2005-02-15 Thread Jeff Epler
dules are cleaned up. If anybody knows if this is better-documented somewhere, please speak up! Jeff pgpQsq77lVQfz.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: super not working in __del__ ?

2005-02-16 Thread Jeff Shannon
x27;t ever (normally) be cleaned up while they're still in use, but during program shutdown refcounting necessarily ceases to apply. The closest that would happen in C++, I believe, would manifest itself as memory leaks and/or access of already-freed memory. Jeff Shannon Technician/Programmer Credi

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-16 Thread Jeff Shannon
u insist on using an OS that's been obsolete for a decade or more. ;) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: renaming 'references' to functions can give recursive problems

2005-02-16 Thread Jeff Shannon
name to this new function, it's simply calling itself. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't join() call str() on its arguments?

2005-02-16 Thread Jeff Shannon
se, one could ensure that unicode.join() used unicode() and str.join() used str(), but I can conceive of the possibility of wanting to use a plain-string separator to join a list that might include unicode strings. Whether this is a realistic use-case is, of course, a completely different quest

Re: Imported or executed?

2005-02-16 Thread Jeff Shannon
do more command-line checking than this...) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: super not working in __del__ ?

2005-02-16 Thread Jeff Shannon
__() is not a C++/Java destructor. Trying to make it into one is unlikely to give an overal benefit. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Font size

2005-02-16 Thread Jeff Shannon
27;t actually looked at it, but EasyGui (recently mentioned here; google should help you find it) may meet your needs and be simpler to use. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't join() call str() on its arguments?

2005-02-16 Thread Jeff Shannon
e), then str() will throw an exception. The Effbot mentioned a join() implementation that would be smart enough to do the right thing in this case, but it's not as simple as just implicitly calling str(). Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Jeff Shannon
eep using that word. I do not think that it means what you think it means." Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Pausing a program - poll/sleep/threads?

2005-02-17 Thread Jeff Shannon
se a timer to do this; just have it fire periodically every second or so, rather than only after several minutes.) Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-17 Thread Jeff Shannon
questionable. There *are* similar-but-not-compatible libraries for DOS... or perhaps I should say *were*, because I have no idea where one might find such a thing now. (Though I presume that Google would be the best starting place.) One would then need to find/create a Python wrapper for th

Re: Pausing a program - poll/sleep/threads?

2005-02-17 Thread Jeff Shannon
our server changing status without your client taking direct action. I really think that you *do* want to do fairly frequent status checks with your server. The cost is small, and the gains in responsiveness and robustness are potentially very significant. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: How to wrap a class's methods?

2005-02-17 Thread Jeff Shannon
rgs, **kwargs) if s != 'OK': raise NotOK((s,r)) return r return wrapped I believe that this will be semantically almost equivalent, but conceptually slightly simpler. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: super not working in __del__ ?

2005-02-17 Thread Jeff Shannon
Christopher J. Bottaro wrote: Jeff Shannon wrote: Python's __del__() is not a C++/Java destructor. Learn something new everyday... What is it then? Excuse my ignorance, but what are you suppose to do if your object needs to clean up when its no longer used (like close open file handles

Re: global var

2005-02-21 Thread Jeff Shannon
module-level reference "var". No variables are actually created in the execution of "global var". Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Attaching to a Python Interpreter a la Tcl

2005-02-24 Thread Jeff Epler
stuff like sending the text of an exception as the result of the 'send' command. Jeff # import Tkinter __all__ = 'python', 'setup_send' def makecommand(master, name, func, subst=None, needcleanup=0):

Re: Running Python Scripts With 'sudo'

2005-03-02 Thread Jeff Epler
unpickler, eval() or the exec statement)? If your program opens files with user-controlled names, did you make all the right checks? Jeff pgpLhnjBDThEJ.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter absorb chars

2005-03-03 Thread Jeff Epler
at specially. If you want to suppress that character, return the string "break" from the binding. Example: from Tkinter import * t = Tkinter.Tk() e = Tkinter.Entry(t); e.pack() e.bind("x", lambda event: "break") Jeff pgpdlybvqgp9Z.pgp Description: PGP signature -

Re: Tough Spawn Problem

2005-03-06 Thread Jeff Epler
;waitpid result is", os.waitpid(pid, 0) and the output is $ python /tmp/googlemike.py child is pid 13874 spawned program waitpid result is (13874, 0) the fact that "spawned program" is printed after "child is pid N" shows that the python program continu

Re: reversed heapification?

2005-03-07 Thread Jeff Epler
(x), i, x) Jeff pgpKui90u477G.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: pyconfig.h

2005-03-07 Thread Jeff Epler
it's probably due to something unique SUSE did in packaging Python. If you're having problems with SUSE's own modifications, then the place to go is probably their bug database or mailing lists. Jeff pgp3KIk3XPCY9.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode BOM marks

2005-03-07 Thread Jeff Epler
ocol */ } PyUnicodeObject; Py_UNICODE is some "C" integral type that can hold values up to sys.maxunicode (probably one of unsigned short, unsigned int, unsigned long, wchar_t). Jeff pgpP4skAuElRz.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: pymem.h In function '__declspec'

2005-03-07 Thread Jeff Epler
LE_SHARED and HAVE_DECLSPEC_DLL that Python decides how to define PyAPI_FUNC, and this little detail is usually below the radar. Jeff pgppEf9f5kh5m.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with "time"

2005-03-08 Thread Jeff Epler
ld reasonably synthesize > different values for that flag for _any_ time value converted in about > the same millisecond. What gives? The tm_isdst field is not about the DSTness at the time of conversion---it's about the DSTness of the converted time. Jeff pgpNFKAG8aJuW.pgp Description

Re: Web framework

2005-03-09 Thread Jeff Reavis
You may also want to look at Spyce. It is similar to JSP,PHP, or ASP. There are some good docs and examples at the site. http://spyce.sourceforge.net/ -jjr -- http://mail.python.org/mailman/listinfo/python-list

Re: python cvs interface?

2005-03-09 Thread Jeff Reavis
Corey, WinCvs can use python for macros, you might want to look at their code: http://cvs.sourceforge.net/viewcvs.py/cvsgui/cvsgui/PythonLib/cvsgui/ You may also want to look at viewcvs, which is written in Python. -jjr -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a short-circuiting dictionary "get" method?

2005-03-09 Thread Jeff Epler
untested def my_getter(m, i, f): try: return m[i] except (KeyError, IndexError): return f() my_getter(d, 'x', bigscaryfunction) my_getter(d, 'y', lambda: scaryinlineexpresion) pgp04VRKFqQL1.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python

Re: Apparently, I don't understand threading

2005-03-14 Thread Jeff Epler
Ah -- I'm sorry I was off-target, and I'm glad someone else had what may be better advice for you. Jeff pgptOZnkOhiE1.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 18, Issue 208

2005-03-14 Thread Jeff Shannon
sizes, octal is nearly useless but is still carried about for backwards compatibility. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 18, Issue 208

2005-03-14 Thread Jeff Shannon
Steven Bethard wrote: Jeff Shannon wrote: now that almost the entire industry has standardized on power-of-2 word sizes, octal is nearly useless but is still carried about for backwards compatibility. So do you think it's worth lobbying for its removal in Python 3.0 when we can break

Re: will it cause any problems to open a read-only file & not close it?

2005-03-14 Thread Jeff Shannon
that, then this idiom should be harmless even under Jython. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib (and urllib2) read all data from page on open()?

2005-03-14 Thread Jeff Shannon
the system network code instead of the application code.) If you need to care about when the network access happens, then you should be using the lower-level protocols -- httplib and/or socket. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: a program to delete duplicate files

2005-03-14 Thread Jeff Shannon
m constructing a single hash collision to make it worthwhile to invest a *large* number of petaflops of processing power.) Sure it's not "100% perfect", but... how perfect do you *really* need? Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I load a module when I will only know the name 'on the fly'

2005-03-14 Thread Jeff Shannon
Tobiah wrote: m = get_next_module() some_nice_function_somehow_loads( m ) that'd be mymodule = __import__('modulename') Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 18, Issue 208

2005-03-15 Thread Jeff Shannon
Martin v. Löwis wrote: Jeff Shannon wrote: I'd be in favor of that, unless someone can come up with a compelling current use-case for octal literals. Existing code. It may use octal numbers, and it would break if they suddenly changed to decimal. Right, which was my original point -- i

Re: Python becoming less Lisp-like

2005-03-15 Thread Jeff Shannon
my guess being that it's towards the hight end of that range. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing the contents of a 'cell' object from Python

2005-03-15 Thread Jeff Epler
lang.python/msg/71b57a32b311ffc8?dmode=source Jeff pgpXLMoKMtyfX.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-15 Thread Jeff Shannon
icial things, and in many cases there's real evidence to support the contention that Python's design choices will decrease the frequency of bugs. Perhaps Python *is* becoming less Lisp-like... but I've never been convinced that Lisp is the best of all possible programming l

Re: will it cause any problems to open a read-only file & not close it?

2005-03-16 Thread Jeff Shannon
the automatic file closing happens as part of the object deletion, files opened in this way won't be closed until the garbage collector runs (and collects this file object). Most of the time, this won't be a problem, but it's good to be aware that things are not necessar

Re: Python becoming less Lisp-like

2005-03-16 Thread Jeff Shannon
in other cases it won't be, so it's important to keep in mind that the cost exists. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple import of a load of variables

2005-03-16 Thread Jeff Shannon
As far as I'm concerned, if you're just going to 'import *' your helper modules, you might as well leave the whole mess as one big file, because you're throwing away almost all of the benefits of dividing it into modules. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting current variable name

2005-03-17 Thread Jeff Shannon
st would enable you to do this for multiple local names with a single call, but getvinfo() doesn't try to do that... Don't forget, in Python, all names are references. You only have to be careful when you start re-binding names... Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-18 Thread Jeff Shannon
Antoon Pardon wrote: Op 2005-03-16, Jeff Shannon schreef <[EMAIL PROTECTED]>: Bruno Desthuilliers wrote: - if x is a class attribute of class A and a is an instance of A, a.x=anyvalue create a new instance attribute x instead of modifying A.x This is very consistent with the way that bin

Re: how to handle repetitive regexp match checks

2005-03-18 Thread Jeff Shannon
raise ValueError("...") The for/else pattern may look a bit odd, but the key feature here is that the else clause only runs if the for loop terminates normally -- if you break out of the loop, the else does *not* run. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python like VB?

2005-03-18 Thread Jeff Shannon
lopers working on OO.o), it's not too surprising that OpenOffice hasn't changed that much. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Jeff Shannon
Raymond Hettinger wrote: def count(self, value, qty=1): try: self[key] += qty except KeyError: self[key] = qty I presume that the argument list is a typo, and should actually be def count(self, key, qty=1): ... Correct? Jeff

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Jeff Epler
Maybe something for sets like 'appendlist' ('unionset'?) Jeff pgpCq9GushexV.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread Jeff Epler
> [Jeff Epler] > > Maybe something for sets like 'appendlist' ('unionset'?) > On Sat, Mar 19, 2005 at 04:18:43AM +, Raymond Hettinger wrote: > I do not follow. Can you provide a pure python equivalent? Here's what I had in mind: $ python /tmp/uni

Re: subprocess 'wait' method causes .py program to hang.

2005-03-19 Thread Jeff Epler
. Perhaps some of the functions in the 'win32process' module of win32all can help. Here's an example for Windows written in C: http://win32.mvps.org/processes/fkill.html Jeff pgpZEr2XdFCHl.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

[OT] Re: Hi Guys. First Time Poster

2005-03-20 Thread Jeff Schwab
sheldon279 wrote: Hi guys. First time poster long time reader. Just wanted to say "Hi" ;) On a side note my Hubby is REAL excited about this new IPO stock GRDX. They just started trading this one like 2 days ago. It's already almost doubled in just 2 days! My Husband is really excited about this st

Re: RELEASED Python 2.4 (final)

2004-11-30 Thread Jeff Shannon
Now(tm), though, now that 2.4 is officially released. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: installing 2.4

2004-12-02 Thread Jeff Shannon
ll have 2.4-compiled binary distributions pretty soon. As for 2.3 being broken, check your application path and file associations. You may be inadvertently running the 2.3 version of Pythonwin under the 2.4 interpreter. Jeff Shannon Technician/Programmer Credit International -- http://mai

Re: installing 2.4

2004-12-02 Thread Jeff Shannon
ou can try reinstalling 2.4, uninstalling the packages, and then uninstalling 2.4 again... or, if the packages' files were deleted when Python was uninstalled, you may have to hack your registry to remove those entries from the uninstall list. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Replace string except inside quotes?

2004-12-03 Thread Jeff Shannon
;""My "foo" object"""), then things break down again. In order to handle this sort of nested structure with anything resembling true reliability, it's necessary to step up to a true lexing/parsing procedure, instead of mere string matching and regular

Re: updating locals() and globals() (WAS: How do I do this? (eval() on the left hand side))

2004-12-08 Thread Jeff Shannon
such special-case behavior would be extremely foolish to do...) Of course, I'm just going off of what I remember having been said elsewhere on c.l.p., and I wouldn't recommend anyone betting their life savings on the reliability of my memory... :) Jeff Shannon Technician/Programmer Credi

Re: exec'ing functions (WAS: updating locals() and globals())

2004-12-08 Thread Jeff Shannon
Steven Bethard wrote: Jeff Shannon wrote: Note also that functions which use exec cannot use the static namespace optimization, and thus tend to be *much* slower than normal functions In what circumstances will this be true? I couldn't verify it: [...] exec """\ def fib2

Re: Creating Fixed Length Records

2004-12-08 Thread Jeff Shannon
ed-length block. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I do this? (eval() on the left hand side)

2004-12-09 Thread Jeff Shannon
eference C++ members despite the fact that 'this' was not required, just because I wanted to be able to *see* which variables were members and which weren't...) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I do this? (eval() on the left hand side)

2004-12-09 Thread Jeff Shannon
have my modules use 'from const import const'. But I will admit that the extra complication on import may not be worth the "cleaner" module internals... As always, it's a tradeoff, and each programmer must decide which costs are worth bearing in their particular situ

Re: Ideas for projects

2004-12-09 Thread Jeff Shannon
a UI to use that code in IDLE. An optional stage two could then be rewriting the name-finding code to be smarter. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling a C program from a Python Script

2004-12-09 Thread Jeff Shannon
hon code is slow, and not all C code is fast, and if you're writing C from scratch then you want to be sure where the hotspots are and focus on converting only those areas to C. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading a file only once into an object and being able to access it from other modules - still have a problem

2004-12-09 Thread Jeff Shannon
7;s called, an instance of this class is created. All subsequent calls just return a reference to the same instance. This ensures that any changes to the instance are reflected anywhere that the object is used. (In your code, only changes to the class SW1_DICT are reflected elsewhere, not changes

Re: python gui

2004-12-14 Thread Jeff Shannon
VS.NET, and hopes to have wxPython built for 2.4 Real Soon Now(tm). Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: change windows system path from cygwin python?

2004-12-15 Thread Jeff Lindholm
> > I want to write some kind of install script for my python app that > will add c:\cygwin\usr\bin to the system path. I don't want > to walk around to 50 PC's and twiddle through the GUI to: > > My Computer --> Control Panel --> System --> Advanced --> Environment > > > How can a python, or even

Re: Why no list heritable type?

2004-12-16 Thread Jeff Shannon
her copyright information. >>> type(list) >>> class my_list(list): ... pass ... >>> type(my_list) >>> l = my_list() >>> l.append('foo') >>> l.extend(['bar', 'baz']) >>> l[2] 'baz' >>> l [

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