Re: Reading binary data

2008-09-10 Thread Aaron Scott
> CORRECTION: '3cII' should be '3sII'. Even with the correction, I'm still getting the error. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading binary data

2008-09-10 Thread Aaron Scott
Sorry, I had posted the wrong error. The error I am getting is: struct.error: unpack requires a string argument of length 12 which doesn't make sense to me, since I'm specifically asking for 11. Just for kicks, if I change the line to print struct.unpack('3sII', file.read(12)) I get t

Re: Reading binary data

2008-09-10 Thread Aaron Scott
Taking everything into consideration, my code is now: import struct file = open("test.gde", "rb") signature = file.read(3) version, attr_count = struct.unpack('II', file.read(8)) print signature, version, attr_count for idx in xrange(attr_count): attr_id, attr_val_len = struct.unpack('II',

Eggs, VirtualEnv, and Apt - best practices?

2008-09-25 Thread Scott Sharkey
ould also be appreciated. Thanks!!! -Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: Eggs, VirtualEnv, and Apt - best practices?

2008-09-25 Thread Scott Sharkey
Diez B. Roggisch wrote: > Dmitry S. Makovey schrieb: >> Scott Sharkey wrote: >>> Any insight into the best way to have a consistent, repeatable, >>> controllable development and production environment would be much >>> appreciated. >> >> you have ju

Re: Beginner's question: executing scripts under Win XP pro

2006-03-25 Thread Scott Souva
On Sat, 25 Mar 2006 14:45:34 +0100, "Jean-Claude Garreau" <[EMAIL PROTECTED]> wrote: >Hi, > >I'm a beginner with python 2.4. I use it on Win XP Pro. I have no problems >with the GUI IDLE, but >when I copy the instructions in a script file, say 'test.py' and double >click on the file, I have just

How to determine COM objects/functions

2006-03-30 Thread Scott Brown
Is there a way to find out all available objects and associated functions? Using dir() on the COM object doesn't display anything except COM functions, not the application's functions (display page, refresh browser, etc). Thanks Scott -- http://mail.python.org/mailman/listinfo/python-list

Best way to handle changing list of class imports

2009-10-10 Thread Scott Grant
uld be great to be able to add or remove these player strategies as new ones come in, but I don't want to add a bunch of overhead importing each one specifically in the game manager itself. Thanks for your time, Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to handle changing list of class imports

2009-10-10 Thread Scott Grant
On Oct 10, 2:42 pm, "Diez B. Roggisch" wrote: > Scott Grant schrieb: > > > > > Hi there, > > > I'd like to set up a framework in which I can add or remove new > > classes of a given expected subclass to my package, and have the > > system

Re: Best way to handle changing list of class imports

2009-10-10 Thread Scott Grant
On Oct 10, 6:44 pm, Dave Angel wrote: > Scott Grant wrote: > > On Oct 10, 2:42 pm, "Diez B. Roggisch" wrote: > > >> Scott Grant schrieb: > > >>> Hi there, > > >>> I'd like to set up a framework in which I can add or remove new

Deeper copy than deepcopy

2009-10-27 Thread Scott Pakin
ed to wind up with r being [[1, 2, 3], [1, 2, 999], [1, 2, 3]]. What's the right way to construct r as a list of *independent* d lists? Thanks, -- Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: Deeper copy than deepcopy

2009-10-28 Thread Scott Pakin
ven a data structure with backlinks. Regards, -- Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I intentionally crash my lappy?

2010-12-20 Thread Paul Scott
On 20/12/2010 10:45, mechtheist wrote: > I am no programmer, but know the rudiments [the rudi'est of rudiments] > of working with Python. I have a simple need, to have a simple > script/app I can run that will crash my PC. On my desktops, I can > always hit the reset, but that is not an option

How to Buffer Serialized Objects to Disk

2011-01-12 Thread Scott McCarty
to pickle the entire data structure, but I need something that will manage the memory/disk allocation? Any thoughts? Gracias Scott M -- http://mail.python.org/mailman/listinfo/python-list

Re: How to Buffer Serialized Objects to Disk

2011-01-12 Thread Scott McCarty
rint i Thoughts? I know this won't manage memory, but it will keep the footprint down right? On Wed, Jan 12, 2011 at 5:04 PM, Peter Otten <__pete...@web.de> wrote: > Scott McCarty wrote: > > > Sorry to ask this question. I have search the list archives and googled, > >

documentation / reference help

2011-01-23 Thread Scott Meup
I'm trying tolearn Python. The documentation tells syntax, and other things about a command. But for too many commands, it doesn't tell what it does. for instance, in VB the 'return' command tells the program what line to execute after some event (usually an error). In Python it appears to ret

Including a remote file -- permission denied?

2010-05-14 Thread Aaron Scott
I have a Python script running on the default OSX webserver, stored in /Library/WebServer/CGI-Executables. That script spits out a list of files on a network drive, a la "os.listdir('/Volumes/code/ directory/')". If I just execute this from the terminal, it works as expected, but when I try to acce

CPython Signal Handler Check for SIGKILL

2010-07-19 Thread Scott McCarty
r a handler for SIGKILL, but python knows and won't let you. signal.signal(signal.SIGKILL, signal_handler_kill) Please can someone just point me in the right direction. Thank You Scott M -- http://mail.python.org/mailman/listinfo/python-list

Re: CPython Signal Handler Check for SIGKILL

2010-07-19 Thread Scott McCarty
right place to post this question. Thank You Scott M On Mon, Jul 19, 2010 at 2:06 PM, Antoine Pitrou wrote: > > Hello, > > > I am not asking about the signals, I understand them, > > I am asking about the registration of the SIGNAL handler and how it knows > > that

Re: Python Developer - HFT Trading firm - Chicago, IL

2010-08-21 Thread Scott MacDonald
Possibly relevant: http://www.nanex.net/FlashCrash/FlashCrashAnalysis_NBBO.html On Sat, Aug 21, 2010 at 4:22 PM, Lawrence D'Oliveiro wrote: > In message > , > Raymond > Hettinger wrote: > > > On Aug 21, 2:30 am, Lawrence D'Oliveiro > > > wrote: > > > >> Wasn’t HFT an exacerbating factor in jus

Re: multi-core software

2009-06-05 Thread Scott Burson
On Jun 4, 9:46 am, Xah Lee wrote: > Of interest: > > • Why Must Software Be Rewritten For Multi-Core Processors? >  http://xahlee.org/UnixResource_dir/writ/multi-core_software.html > > plain text version follows. > > -- > Why Must Software Be Rewritt

Using Python for file packing

2009-06-29 Thread Aaron Scott
I'm working on a Python application right now that uses a large number of audio assets. Instead of having a directory full of audio, I'd like to pack all the audio into a single file. Is there any easy way to do this in Python? My first instinct was to attempt to pickle all the audio data, but some

Re: Using Python for file packing

2009-06-29 Thread Aaron Scott
> Do you mean like a zip or tar file? > > http://docs.python.org/library/zipfile.htmlhttp://docs.python.org/library/tarfile.html > I had no idea you could access a single file from a ZIP or TAR without explicitly extracting it somewhere. Thanks. -- http://mail.python.org/mailman/listinfo/python-l

Ctypes to wrap libusb-1.0

2009-07-06 Thread Scott Sibley
I have been having issues trying to wrap libusb-1.0 with ctypes. Actually, there's not much of an issue if I keep everything synchronous, but I need this to be asynchronous and that is where my problem arises. Please refer to the following link on Stackoverflow for a full overview of the issue. h

Pickling classes -- disappearing lists?

2009-07-13 Thread Aaron Scott
I'm trying to pickle an instance of a class. It mostly works just fine -- I can save the pickle to a file, restore it from that file, and it's mostly okay. The problem is, some lists seem to disappear. For example (snipped and crunched from the code giving me trouble): --- class InitGame:

Re: Memory error due to big input file

2009-07-13 Thread Aaron Scott
> BTW, you should derive all your classes from something.  If nothing > else, use object. >   class textfile(object): Just out of curiousity... why is that? I've been coding in Python for a long time, and I never derive my base classes. What's the advantage to deriving them? -- http://mail.python

Re: Pickling classes -- disappearing lists?

2009-07-13 Thread Aaron Scott
> Your class definition isn't right. It makes 'value' and 'journal' > class variables (Java lingo: "static variables") as opposed to the > instance variables they should be. Here's a corrected version: > Woah, thanks. I can't believe I made such a stupid mistake. It's not like I'm a newcomer to Py

Re: If Scheme is so good why MIT drops it?

2009-07-20 Thread Scott Burson
x27;ve used it only a little, so I can't vouch for its stability, but it fits the threading and license requirements (well, some corporate lawyers have trouble with the LGPL, but I think it's usable). -- Scott -- http://mail.python.org/mailman/listinfo/python-list

Problem with arrays in a recursive class function

2009-08-20 Thread Aaron Scott
I have a list of nodes, and I need to find a path from one node to another. The nodes each have a list of nodes they are connected to, set up like this: class Node(object): def __init__(self, connectedNodes): self.connectedNodes = connectedNodes nodes = { 1: Node

Re: Problem with arrays in a recursive class function

2009-08-20 Thread Aaron Scott
Never mind -- ditched the attempt and implemented Dijkstra. -- http://mail.python.org/mailman/listinfo/python-list

Can multiprocessing.Process() use a different version of the interpreter?

2010-10-04 Thread Scott Pigman
I want to use the 64 bit version of python but run some code inside a spawned process that uses the 32 bit version. Is there an official way to do this, or can anybody make a recommendation about the cleanest way to do this? If someone has a better solution to the problem I describe below, I'd app

Re: Can multiprocessing.Process() use a different version of the interpreter?

2010-10-04 Thread Scott Pigman
On Oct 4, 1:34 pm, Robert Kern wrote: > My previous statement notwithstanding, there is a way to hack this. The > windows-specific implementation of the class multiprocessing.forking.Popen > uses > a global variable, _python_exe, to determine the executable to use. Instead, > you What I've bee

Re: Can multiprocessing.Process() use a different version of the interpreter?

2010-10-04 Thread Scott Pigman
On Oct 4, 1:41 pm, Scott Pigman wrote: > _python.exe variable is built from sys.exec_prefix.  So, I think that sorry, _python_exe. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can multiprocessing.Process() use a different version of the interpreter?

2010-10-04 Thread Scott Pigman
> > Personally, I think that subclassing is cleaner, but if you must monkeypatch, > then you should monkeypatch the multiprocessing.forking._python_exe variable, > not sys.exec_prefix. > > -- > Robert Kern thanks, good point. -- http://mail.python.org/mailman/listinfo/python-list

Question about expression evaluation

2010-11-08 Thread Scott Gould
Hi folks, This is a head-scratcher to me. I occasionally get this error: --- File "/var/www/myproj/account/views.py", line 54, in account if request.account.is_instructor and request.account.contact and request.account.contact.relationship.institution_party_number: AttributeError: 'NoneTyp

Re: Question about expression evaluation

2010-11-08 Thread Scott Gould
ly so once a self._contact always a self._contact. (Unless I'm misunderstanding something fundamental, which as an admitted amateur I could well be!) On Nov 8, 11:17 am, Scott Gould wrote: > Hi folks, > > This is a head-scratcher to me. I occasionally get this error: > > --- >

Announcing SCM Workbench 0.8.5 GUI for Git, Mercurial (hg) and Subversion (svn)

2017-03-22 Thread Barry Scott
SCM Workbench features • Support Subversion (svn), Mercurial (hg) and Git projects. • Easy to learn and use • Built in User Guide describes the operation and features of the application. • Add project wizard can scan for all your existing projects. • All su

Python3 C extension how to support dir()

2017-04-14 Thread Barry Scott
I have an python3 C++ extension that works. But dir(obj) does not return the list of member variables. How should I support dir() from the C API? I cannot use tp_members, not appropiate to the code I'm writing. If I provide __dir__ I then hit the problem I need the C API version all_attr

Announcing SCM Workbench 0.8.6 for Git, Mercurial and Subversion

2017-04-17 Thread Barry Scott
SCM Workbench features • Support Subversion (svn), Mercurial (hg) and Git projects. • Easy to learn and use • Builtin User Guide describes the operation and features of the application. • Add project wizard can scan for all your existing projects. • All sub

Re: Productivity and economics at software development

2005-09-23 Thread Scott David Daniels
do you consider the IDE for Assembly code or Microcode? --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Productivity and economics at software development

2005-09-24 Thread Scott David Daniels
is inextricably tied to a particular language and the language is inextricably linked with a particular IDE. -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: number of python users

2005-09-26 Thread Scott David Daniels
e move needed to happen, but it slowed 2.4 uptake on Windows] But, 2.3 is getting long-in-the-tooth. I don't believe another bugfix release of 2.3 is in the cards. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Metaclasses, decorators, and synchronization

2005-09-26 Thread Scott David Daniels
t needs o._sync_lock) until Thread two completes its code. If, for example, the method body in Thread two calls an unrelated synchronized method (perhaps on another object) and must create another _sync_lock, Threads one and two will be deadlocked. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: New Python book

2005-10-06 Thread Scott David Daniels
rs' opinion on that to see if > that's a correct assessment You could ask over on comp.lang.python.education (on Gmane as comp.python.education). -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Force flushing buffers

2005-10-06 Thread Scott David Daniels
. finally: for afile in files_to_close: afile.close() ... --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple prototype text editor in python

2005-10-06 Thread Scott David Daniels
derstood by most programmers, so they needn't go into "reading like a lawyer" mode to think about whether they can use things based on your code. The more work they have to do, the less likely they will even look at your code (if they behave anything like me). --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Weighted "random" selection from list of lists

2005-10-08 Thread Scott David Daniels
total = 0 for index, value in enumerate(weights): total += value cumulative.append(total) for i in range(20): score = random.random() * total index = bisect.bisect(cumulative, score) print random.choice(main_list[index]), -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python reliability

2005-10-10 Thread Scott David Daniels
sounds like you might need the instruments to broadcast or multicast to get to that happy place. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: searching a project to contribute to

2005-10-10 Thread Scott David Daniels
nd reviewing a patch can be thought of a getting a mini guided tour. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: convert char to byte representation

2005-10-10 Thread Scott David Daniels
ay base = ('$GPGSV,3,1,10,06,79,187,39,30,59,098,' '40,25,51,287,00,05,25,103,44*') bytes = array.array('b', base[1 : -1]) for i in reversed(range(len(bytes))): bytes[i] ^= bytes[i-1] result = bytes.tostring() --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing lists

2005-10-11 Thread Scott David Daniels
ut the trade-offs that he has been making in > choosing one particular implementation, and to > know what computational complexity therefore > attaches to the various operations exposed in > its interface. Am I to take it you provide this to all of your customers? > How reasonable is it to ask me, or anyone else > for that matter, to extract, experiment-wise > (if it can be done at all with reasonable effort) > information that properly belongs to the implementer > and really should have been exposed in the > documentation in the first place? Not at all reasonable. How reasonable is it to ask me to provide you support information for free? --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Scott David Daniels
d of thing can > make a real difference. You are right that Pypy is the place to experiment with all of this. That project holds a lot of promise for answering questions that seem to otherwise degenerate into "Jane, you ignorant slut" (for non-US readers, this is a reference to an old "

Re: How to call a script from another?

2005-10-13 Thread Scott David Daniels
ipt; script.zopescript.main() That is, if the directory ".../containing" needs to be interpreted as a package. If the script you want to call is in the same directory as the script calling it (or any directory on the path), you can simply use: import zopescript zopescript.main() --Scott D

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Scott David Daniels
Paul Rubin wrote: > Scott David Daniels <[EMAIL PROTECTED]> writes: > >>Current speeds are due to deep pipelines, and a conditional in the >>INCREF code would blow a pipeline. > > > I think most of the time, branch prediction will prevent the cache > flush.

Moving to Win XP as a Python developer

2005-10-14 Thread Scott David Daniels
e to know that typing ALT+SPACE in the CMD window took me to the options window (good for pasting). In moving to work on Windows, you will want a good text editor (notepad is not enough for me), find an emacs or vim or whatever and make sure you install it. I also carry around rcs and a little utility I wrote called "recent." It'd be a good idea to define your own utility directory, stick its name on your command path and keep stuff in there. Either MingW32 or VC71 would be good to have, both might be better. Good luck. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing lists

2005-10-14 Thread Scott David Daniels
Let me begin by apologizing to Christian as I was too snippy in my reply, and sounded even snippier than I meant to. Christian Stapfer wrote: > "Scott David Daniels" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >>a "better" set implement

Re: [PIL]: Question On Changing Colour

2005-10-14 Thread Scott David Daniels
return cs.hsv_to_rgb(hue, max(.1, saturation), value) Or: def apply_hs(color, rgb): hue, saturation, value = cs.rgb_to_hsv(*color) _hue, _saturation, value = cs.rgb_to_hsv(*rgb) return cs.hsv_to_rgb(hue, saturation, value) --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with creating a dict from list and range

2005-10-15 Thread Scott David Daniels
. >> >>> dct >> >>{'second': 1, 'third': 2, 'first': 0} >> -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Overloading & Overriden

2005-10-15 Thread Scott David Daniels
pient, >>you are not authorized to read, print, retain, copy, disseminate, distribute, >>or use this message or any part thereof. If you receive this essage in error, >>please notify the sender immediately and delete all copies of this message. > > Oops. Ok. Done. Go

Re: Upgrading 2.4.1 to 2.4.2

2005-10-17 Thread Scott David Daniels
platform platform.platform(True, False) -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Why asci-only symbols?

2005-10-18 Thread Scott David Daniels
ot a correct utf-8 encoding of anything. The problem is that there is no good way to propagate the encoding without understanding the purpose of the operations themselves. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs Ruby

2005-10-21 Thread Scott David Daniels
bruno modulix wrote: > ... Another language that failed to make it to the mainstream but is > worth giving a try is Smalltalk - the father of OOPLs (Simula being the > GrandFather). I would say Simula is the forefather of modern OOPLs, and Smalltalk is the toofather. --Scott David Danie

Re: [OT] Python vs Ruby

2005-10-24 Thread Scott David Daniels
bruno modulix wrote: > Scott David Daniels wrote: >>bruno modulix wrote: >>>... Another language that failed to make it to the mainstream but is >>>worth giving a try is Smalltalk - the father of OOPLs (Simula being the >>>GrandFather). >>I would say Sim

Re: replace words

2005-10-28 Thread Scott David Daniels
try: bracketed = gen.next() except StopIteration: break yield pre yield bracketed yield post def mangledots(string): return ''.join(wrap(string.split('.'), '.

Re: Scanning a file

2005-10-29 Thread Scott David Daniels
block.count(ss) lead = block[-be :] block = fp.read(blocksize) count += (lead + block[: be]).count(ss) ... -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: how to compile c-extensions under WinXP?

2005-11-08 Thread Scott David Daniels
() == keyed: elements = paths.split(';') if elements[-1].upper() == keyed.join('%%'): return elements[: -1] return elements class MSVCCompiler(distutils.msvccompiler.MSVCCompiler): _

Re: What do you use as symbols for Python ?

2005-11-10 Thread Scott David Daniels
t to pursue it farther, either submit an RFE with a fairly thorough explanation of why this is useful, or write and carry a PEP through about it. This suggestion is neither new nor unique (many people used to other languages suggest it as they come to Python), so you probably will have to have quite

Re: LARGE numbers

2005-11-11 Thread Scott David Daniels
multiplication. (in other words, Python is not N**2 for large numbers). --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Import statements for timeit module

2005-11-11 Thread Scott David Daniels
print " SQL: %s" % (sql) XXX>> timer = timeit.Timer('cur.execute(sql)', 'from __main__ import >>cur') timer = timeit.Timer('cur.execute(sql)', ### 'from __main__ import cur, sql') ### >>print timer.timeit() -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Inserting Records into SQL Server - is there a faster interfacethan ADO

2005-11-11 Thread Scott David Daniels
ere it should really go with nice transaction-protected SQL, proper index-building and so on. After distributing the data, you can drop the table of pending data. I agree this is off-topic, but it is too close to my experience. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Lie Hetland book: Beginning Python..

2005-11-11 Thread Scott David Daniels
RE %s = %s" cur.execute(sql % (col,table,search_col, '%s'), (param,)) which I like better, because you don't have to read extremely carefully for the double-percents. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Invoking Python from Python

2005-11-11 Thread Scott David Daniels
so that you at least inform your customer if you are creating a security hole. -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you use as symbols for Python ?

2005-11-11 Thread Scott David Daniels
hen it is associated with a line typed to a user paying attention. This way you (A) don't have to repeat the names in the source (a great place for errors), and (B) you can say to yourself, "I think this is in one of these several things" and go hunting happily. In our example, named(2

Re: testing C code with python

2005-11-11 Thread Scott David Daniels
e C equivalent, and move the tests to the C code. I've done this for programs that were always to have become C programs as well as for those things I intend to wrap as Python modules. -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Multikey Dict?

2005-11-13 Thread Scott David Daniels
hat, I prefer: john = dict(id=1, name="John Cleese", year=1939} graham = dict{id-2, name="Graham Chapman", year=1941} --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: generate HTML

2005-11-14 Thread Scott David Daniels
import sys former, sys.stdout = sys.stdout, open("output.html", "w") try: genpage(arg1, arg2) finally: htmlfile, sys.stdout = sys.stdout, former htmlfile.close() print 'file %r written' % filename --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Post/View Open Source Jobs

2005-11-15 Thread Scott David Daniels
Superior Staffing Solutions wrote: > Post/View Open Source Jobs > http://groups.yahoo.com/group/opensourcejobs > > If you have jobs to announce, there is a jobs forum on python.org. If you are advertising a web site, like other trolls, you should curl up and .... --Scott David Da

Re: Newb ?

2005-11-15 Thread Scott David Daniels
earched the group for the term backwards but I did not get any > results. The problem is that negative numbers mean "count from the rightmost end of the string or list." Also, you are going high to low without any indication that you mean to go backwards. >>> message = raw_input("Enter a Message:") >>> print message[: : -1] -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: running functions

2005-11-17 Thread Scott David Daniels
ns are indivisible" and "what happens if I read part of this from before an update and the other after the update completes, . That is why threads that don't do trivial things are so scary. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How to do "new_variable = (variable) ? True : False;" (php) on python?

2005-11-18 Thread Scott David Daniels
better answer than you think. Don't try to force everything to the type you expect, use things as they are; embrace duck-typing. :-) --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Underscores in Python numbers

2005-11-21 Thread Scott David Daniels
ls in the module? And in such a case, the cost of calling something like FloatConv (or whatever) becomes negligible. As to interactive use, I just don't see that having things like IntConv, FloatConv around strings is a real hardship -- for me the hardship is almost always trying to verify the

Re: Any royal road to Bezier curves...?

2005-11-21 Thread Scott David Daniels
The Bezier gives control points with natural interpretations and a nice "within the convex hull" property. I happen to like Beziers to control curves which are aestheticly, rather than computationally defined. -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.o

Re: wxPython Licence vs GPL

2005-11-22 Thread Scott David Daniels
be asked unless I've already posted the standard answer. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython Licence vs GPL

2005-11-23 Thread Scott David Daniels
Steven D'Aprano wrote: > On Tue, 22 Nov 2005 12:57:12 -0800, Scott David Daniels wrote: >>I would, at the very least, acknowledge the wxPython origin of the code >>whether any remains or not (credit is appreciated and cheap to give). > >... In this world where ideas are

Re: Any royal road to Bezier curves...?

2005-11-23 Thread Scott David Daniels
al sense. In fact I've even used the bezier algorithm to control not only x, y, and z, but also r, g, and b. Controlling all six, I can enforce smooth controllable color transitions that I can even tweak to satisfy my visual aesthetic. The convex hull property guarantees me that all colors will exit. Knots-only systems go outside the hulls, so colors don't make as much sense. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-24 Thread Scott David Daniels
Should I make a > _FooFunctionality class, and then inherit from that to make Foo as the > immutable class that actually gets exported? Typically, constants are set up in __new__ (which happens before __init__), because by __init__ time the object is built. Remember not to complain that you h

Re: return in loop for ?

2005-11-24 Thread Scott David Daniels
Fredrik Lundh wrote: > Steve Holden wrote: >>sepcifications > did you mean: sceptifications ? QOTW! I love it. I need to insert this in my vocabulary instantly! --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Singleton and C extensions

2005-11-25 Thread Scott David Daniels
uot;foo") Fredrik's advice is probably better, but if you must: class Editor(object): table = {} def __new__(klass, name): try: return klass.table[name] except KeyError: klass.table[name] = super(Singled, klass).__new__(klass) ret

Re: newbie question concerning formatted output

2005-11-29 Thread Scott David Daniels
7;r') gen = iter(emit(f)).next try: while True: for i in range(2): print gen(), print gen() except StopIteration: pass f.close() print --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: python number handling - tiny encryption algorithm

2005-11-30 Thread Scott David Daniels
gt;> 5) - y ^ sum - key[sum>>11 & 3]) sum = MASK & (sum - delta) y = MASK & (y - (z << 4 ^ z >> 5) - z ^ sum - key[sum&3]) return y, z --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested loop

2005-11-30 Thread Scott David Daniels
= refSymbol.strip(): priceNew.write(refSymbol.strip() + " " + showme[10]) myfile.seek(0) This is probably more what you wanted, but Steve's suggestion will run much faster. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging of Python code in embedded interpreter

2005-11-30 Thread Scott David Daniels
t;python traceback", there seems to be interesting output. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Why my modification of source file doesn't take effect when debugging?

2005-12-02 Thread Scott David Daniels
oops. >> You need to use the reload() function: > > As a matter of fact, it would help a lot if that stupid behaviour of > Idle was dropped. I'm sure I'm not the only one who lost lots of time > because of that bug. Yes I call it a bug. You are mistaken if you think th

Python & Unicode decimal interpretation

2005-12-02 Thread Scott David Daniels
" or (preferably) give me a test case that shows where that interpretation does not hold. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python string immutable?

2005-12-03 Thread Scott David Daniels
ycles. It needs to get to 2.2 or so before weakrefs are handled correctly. * Python 2.4.2 (September 28, 2005) * Python 2.4 (November 30, 2004) * Python 2.3.5 (February 8, 2005) * Python 2.2.3 (May 30, 2003) * Python 2.1.3 (April 8, 2002) * Python 2.0.1 (June 2001) * Pyt

Re: advice : how do you iterate with an acc ?

2005-12-03 Thread Scott David Daniels
if condition(line): if acc: doSomething(acc) acc = [] else: acc.append(line) assert acc == [] finally: f.close() --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python & Unicode decimal interpretation

2005-12-03 Thread Scott David Daniels
Martin v. Löwis wrote: > Scott David Daniels wrote: >> In reading over the source for CPython's PyUnicode_EncodeDecimal, >> I see a dance to handle characters which are neither dec-equiv nor >> in Latin-1. Does anyone know about the intent of such a conversion? > >

Re: urllib on windows machines

2005-12-03 Thread Scott David Daniels
do: >>> import urllib >>> g = urllib.urlopen('http://www.google.com') >>> g.read(12) '' So off-hand, I'd suspect some firewall thingie is getting in the way. Can you "bless" \Python24\python.exe and \Python24\pythonw.exe as applications allowed to do net traffic? --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: running a c program from a python script

2005-12-03 Thread Scott David Daniels
ils. The next time you ask, you really should mention your OS and Python versions; the fiddley details differ. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib on windows machines

2005-12-03 Thread Scott David Daniels
and they are not regarded as possible monsters if they try to connect to the web. I'd like the chance to deny all programs that I don't expect to connect out the chance to do so, but there has got to be a way to turn it off. Maybe there are some adjustments to the program that emitt

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