Re: OT: usenet reader software

2014-07-18 Thread Warren Post
the latter for its great filtering. I too have had stability problems with Pan, but compiling from source fixed that for me. -- Warren Post https://warrenpost.wordpress.com/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Islam is not a Religion of Extremism

2014-06-22 Thread Warren Post
oogle Gropes user and would prefer not to see more of this, try: http://twovoyagers.com/improve-usenet.org/ -- Warren Post https://warrenpost.wordpress.com/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Confused about nested scopes and when names get added to namespaces

2010-09-08 Thread Russell Warren
My tests were run in python 2.6.5. -- http://mail.python.org/mailman/listinfo/python-list

Confused about nested scopes and when names get added to namespaces

2010-09-08 Thread Russell Warren
I'm having trouble understanding when variables are added to namespaces. I thought I understood it, but my nested function examples below have me very confused. In each test function below I have an x variable (so "x" is in the namespace of each test function). I also have a nested function in e

Re: * for generic unpacking and not just for arguments?

2009-11-29 Thread Russell Warren
On Nov 29, 11:09 am, Christian Heimes wrote: > The feature is available in Python 3.x: > > >>> a, b, *c = 1, 2, 3, 4, 5 > >>> a, b, c > (1, 2, [3, 4, 5]) > >>> a, *b, c = 1, 2, 3, 4, 5 > >>> a, b, c > > (1, [2, 3, 4], 5) Interesting... especially the recognition of how both ends work with the "a,

* for generic unpacking and not just for arguments?

2009-11-29 Thread Russell Warren
Is there a reason that this is fine: >>> def f(a,b,c): ... return a+b+c ... >>> f(1, *(2,3)) 6 but the code below is not? >>> x = (3, 4) >>> (1, 2, *x) == (1, 2, 3, 4) Traceback (most recent call last): File "", line 1, in invalid syntax: , line 1, pos 8 Why does it only work when unpackin

Re: "as" keyword woes

2008-12-06 Thread Warren DeLano
ot;, as a Python keyword, is a here to stay: Love it or leave it. -> Likewise ditto for the GIL: if you truly need Python concurrency within a single process, then use a Python implementation other than CPython. Season's greetings to all! Peace. Cheers, Warren -- http://mail.python.org/mailman/listinfo/python-list

Re: "as" keyword woes

2008-12-06 Thread Warren DeLano
standalone keyword " as ". It seems to me that it should be possible to unambiguously separate the two without ambiguity or undue complication of the parser. So, assuming I now wish to propose a corrective PEP to remedy this situation for Python 3.1 and beyond, what is the best way to get started on such a proposal? Cheers, Warren -- http://mail.python.org/mailman/listinfo/python-list

Re: To Troll or Not To Troll (aka: "as" keyword woes)

2008-12-04 Thread Warren DeLano
'll put this more bluntly: Warren's messages to date > egregiously break the flow of discussion. > > Warren, in the interest of sane discussion in these forums, please: > > * preserve attribution lines on quoted material so we can see who > wrote what. > > * use the conve

"as" keyword woes

2008-12-04 Thread Warren DeLano
on, I recognize that there will be ancillary casualties in every major battle. Though I may whine incessantly about all of our pre-2.5 log-file/documents being one such casualty (your various accusations notwithstanding, we did indeed patch our own code as soon as the deprecation warnings appeared

RE: To Troll or Not To Troll

2008-12-04 Thread Warren DeLano
> I still would have to call your management of the problem considerably > into question - your expertise at writing mathematical software may > not be in question, but your skills and producing and managing a > software product are. You have nobody at your organization, which > sells a product tha

To Troll or Not To Troll

2008-12-04 Thread Warren DeLano
> Yet Another Python Troll (the ivory tower reference, as well as the > abrupt shift from complaining about keywords to multiprocessing), I > have to point out that Python does add new keywords, it has done so in > the past, and there was a considerable amount of warning, including an > automated d

"as" keyword woes

2008-12-04 Thread Warren DeLano
e indeed the optimal solution to certain problems, and those problems are still not solvable with CPython 3.0. Is it too much to hold out hope for a native Pythonic solution to the multithreading performance issues inside of the CPython VM itself? Only time will tell... but time is rapidly running out. Warren -- http://mail.python.org/mailman/listinfo/python-list

Re: "as" keyword woes

2008-12-04 Thread Warren DeLano
thon will easily transcend the limitations of its flagship implementation (if or to the extent that such an implementation cannot keep pace with the times). That's all well and good -- it may even end up being the next great leap forward for the language. I believe Guido has even said as much himself. Warren -- http://mail.python.org/mailman/listinfo/python-list

"as" keyword woes

2008-12-03 Thread Warren DeLano
ut an "as" keyword. I do sincerely hope I am wrong about this, but it is seems quite possible that C/Python's glory days are now behind us. And if so, then thank you all for so many wonderful years of effort and participation! C/Python has had a great run, and Python syntax, i

Re: "as" keyword woes

2008-12-03 Thread Warren DeLano
> Because it can be used at the import statement to let the imported thing > be known under another name? > Something like: > > >>> import xml.etree.ElementTree as ET Yes, but that syntax worked fine for years without "as" actually having to be a keyword. There must be something more going on h

"as" keyword woes

2008-12-03 Thread Warren DeLano
preserve compatibility with existing third-party scripts & infrastructure which routinely rely upon "as" as an object method. Sigh.) Cheers, Warren -- http://mail.python.org/mailman/listinfo/python-list

RE: Python-list Digest, Vol 61, Issue 368

2008-10-24 Thread Warren DeLano
done much more easily from Python than from C (e.g. data organization, U.I. survey/present tasks, rarely used transformations, ad hoc scripting experiments, etc.). Cheers, Warren -- http://mail.python.org/mailman/listinfo/python-list

RE: Safe eval of insecure strings containing Python data structures?

2008-10-08 Thread Warren DeLano
ay's web apps wouldn't exist without safe forms of untrusted eval/exec (Javascript anyone?). Such dogma is appropriate when dealing with the CPython VM, but not as a general principle. "Rocket fuel may be dangerous, but you ain't shooting the moon without it!" Cheers, Wa

Safe eval of insecure strings containing Python data structures?

2008-10-08 Thread Warren DeLano
above approach is NOT secure since object attributes can still be accessed... So is there an equally convenient yet secure alternative available for parsing strings containing Python data structure definitions? Thanks in advance for any pointers! Cheers, Warren -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Written in C?

2008-07-29 Thread Warren Myers
d"< instruction count was significantly higher for C++. I expect any sort > of C++ objects you used to implement Python structures will be slower > than the equivalent in C. So even if writing it in C++ would reduce > the overhead for deleting from a list, I expect you would lose a lot > more. > -- > http://mail.python.org/mailman/listinfo/python-list > -- Warren Myers http://warrenmyers.com -- http://mail.python.org/mailman/listinfo/python-list

"proper"/best way to hack SimpleXmlRpcServer to support datetime?

2008-07-18 Thread Russell Warren
I'm running python 2.5.1 and it seems that SimpleXmlRpcServer is not setup to support the base datetime module in the same way xmlrpclib has been with "use_datetime". I see that someone (Virgil Dupras) has recently submitted a fix to address this, but I don't want to patch my python distro. I wan

Re: Is crawling the stack "bad"? Why?

2008-02-28 Thread Russell Warren
> OK, if you crawl the stack I will seek you out and hit you with a big > stick. Does that affect your decision-making? How big a stick? :) > Seriously, crawling the stack introduces the potential for disaster in > your program, since there is no guarantee that the calling code will > provide the

Re: Is crawling the stack "bad"? Why?

2008-02-25 Thread Russell Warren
convincing argument yet on why crawling the stack is considered bad? I kind of hoped to come out of this with a convincing argument that would stick with me... On Feb 25, 12:30 pm, Ian Clark <[EMAIL PROTECTED]> wrote: > On 2008-02-25, Russell Warren <[EMAIL PROTECTED]> wrote: > > &

Re: Is crawling the stack "bad"? Why?

2008-02-25 Thread Russell Warren
> How about a dictionary indexed by by the thread name. Ok... a functional implementation doing precisely that is at the bottom of this (using thread.get_ident), but making it possible to hand around this info cleanly seems a bit convoluted. Have I made it more complicated than I need to? There

Re: Is crawling the stack "bad"? Why?

2008-02-24 Thread Russell Warren
> That is just madness. What specifically makes it madness? Is it because sys._frame is "for internal and specialized purposes only"? :) > The incoming ip address is available to the request handler, see the > SocketServer docs I know... that is exactly where I get the address, just in a mad wa

Re: Is crawling the stack "bad"? Why?

2008-02-24 Thread Russell Warren
Argh... the code wrapped... I thought I made it narrow enough. Here is the same code (sorry), but now actually pasteable. --- import SimpleXMLRPCServer, xmlrpclib, threading, sys def GetCallerNameAndArgs(StackDepth = 1): """This function returns a tuple (a,b) where: a = The name of the ca

Is crawling the stack "bad"? Why?

2008-02-24 Thread Russell Warren
I've got a case where I would like to know exactly what IP address a client made an RPC request from. This info needs to be known inside the RPC function. I also want to make sure that the IP address obtained is definitely the correct one for the client being served by the immediate function call

Re: dream hardware

2008-02-12 Thread Warren Myers
/me no longer wishes to know about your dreams. WMM On Feb 12, 2008 4:56 PM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Tue, 12 Feb 2008 10:05:59 -0800, castironpi wrote: > > > What is dream hardware for the Python interpreter? > > I'm not sure that the Python interpreter actually does dream

Re: dream hardware

2008-02-12 Thread Warren Myers
A Cray? What are you trying to do? "dream" hardware is a very wide question. WMM On Feb 12, 2008 1:05 PM, <[EMAIL PROTECTED]> wrote: > What is dream hardware for the Python interpreter? > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://warrenmyers.com "God may not play

Re: embedded python in c++ packaging

2008-02-07 Thread Warren Myers
The Python byte-code files are already pretty dense, so compressing them further is unlikely to work if you try to put them in a zip. WMM On Feb 7, 2008 11:39 AM, Furkan Kuru <[EMAIL PROTECTED]> wrote: > Hello, > > I have been developing an application in C++ that embeds Python > interpreter. >

Re: Looking for a good Python environment

2007-11-11 Thread Russell Warren
> While we're at it, do any of these debuggers implement a good way to > debug multi-threaded Python programs? Wing now has multi-threaded debugging. I'm a big Wing (pro) fan. To be fair, when I undertook my huge IDE evaluation undertaking it was approx 2 years ago... at the time as far as what

Re: logging module and trailing newlines

2007-10-03 Thread Russell Warren
Both are very good responses... thanks! I had forgotten the ease of "monkey-patching" in python and the Stream class is certainly cleaner than the way I had been doing it. On Oct 3, 3:15 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Russell Warren wrote: > > All I'

logging module and trailing newlines

2007-10-02 Thread Russell Warren
I was just setting up some logging in a make script and decided to give the built-in logging module a go, but I just found out that the base StreamHandler always puts a newline at the end of each log. There is a comment in the code that says "The record is then written to the stream with a trailin

Passing a tuple to a function as multiple arguments

2007-09-06 Thread Ben Warren
Hello, Let's say I have a function with a variable number of arguments (please ignore syntax errors): def myfunc(a,b,c,d,...): and I have a tuple whose contents I want to pass to the function. The number of elements in the tuple will not always be the same. T = A,B,C,D,... Is there a way th

RE: Hooking exceptions outside of call stack

2007-06-10 Thread Warren Stringer
Hey Josiah, I just spent a couple hours with your example, and it explains a lot. Some of your interactive session got garbled, so am reposting your merged_namespace example, with tweaks: #- def merged_namespace(*ns): try: __builti

RE: Hooking exceptions outside of call stack

2007-06-09 Thread Warren Stringer
Josiah Carlson wrote: > >>> foo = type(foo)(foo.func_code, d, foo.func_name, foo.func_defaults, > foo.func_closure) Wow! I've never seen that, before. Is there documentation for `type(n)(...)` somewhere? I did find a very useful "Decorator for Binding Constants, by Raymond Hettinger", that uses t

RE: Ableton Live Python API is out!

2007-06-09 Thread Warren Stringer
Alia Khouri Write > I have been waiting for this ages and it's finally happened! Python > meet Live, Live meet Python! Wow. This is very cool; thanks for the announcement! > I rushed to update http://wiki.python.org/moin/PythonInMusic but lo Thanks for this link, as well. Very useful. --

RE: Hooking exceptions outside of call stack

2007-06-09 Thread Warren Stringer
> Yes. Python doesn't have restartable exceptions. Perhaps you would like > to take a look at CL or Smalltalk? > > Jean-Paul Hmmm, I wonder if anyone suggest to Philippe Petit, as stepped out 110 stories off the ground, that perhaps he would like to take a look at a different tightrope? Oddly

RE: Hooking exceptions outside of call stack

2007-06-09 Thread Warren Stringer
Am still trying to hook a NameError exception and continue to run. After a few more hours of searching the web and pouring over Martelli's book, the closest I've come is: >>> import sys >>> def new_exit(arg=0): ... print 'new_exit called' ... #old_exit(arg) ... >>> def hook(type, value, tb

Hooking exceptions outside of call stack

2007-06-09 Thread Warren Stringer
ack unhandled NameError exceptions, so that they unwind the stack normally? This is intended for production code. Many thanks! Warren -- http://mail.python.org/mailman/listinfo/python-list

RE: c[:]()

2007-06-06 Thread Warren Stringer
': .' means ': ...' (its an outlook thing) -- http://mail.python.org/mailman/listinfo/python-list

RE: c[:]()

2007-06-05 Thread Warren Stringer
Roland Puntaier [mailto:[EMAIL PROTECTED] > Warren, can you please restate your point. Hey Roland, where were you a few days ago ;-) I think most suggestions were valid, in their own context. Only yesterday, was I finally able to get it in perspective, so here goes: There are two idioms

RE: c[:]()

2007-06-04 Thread Warren Stringer
> "Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > || Warren Stringer wanted to call the functions just for the side effects > | without interest in the return values. So building a list of return > | values which

RE: c[:]()

2007-06-03 Thread Warren Stringer
> Anyway, the code below defines a simple "callable" list; it just calls > each contained item in turn. Don't bother to use [:], it won't work. > > py> class CallableList(list): > ... def __call__(self): > ... for item in self: > ... item() > ... > py> def a(): print "a" > ... > py> d

RE: c[:]()

2007-06-02 Thread Warren Stringer
Oops, forgot to cut and paste the point, to this: > > - there is no Python error for "you > > cannot do this with this object, but you can do it with other objects > > of the same type". > > Yes there is: > > # > def yo(): print "yo" > def no(): print blah > yo() > no()

RE: c[:]()

2007-06-02 Thread Warren Stringer
Andre Engels wrote: > > I am not insisting on anything. I use ``c[:]()`` as shorthand way of > saying > > "c() for c in d where d is a container" > > > > Having c() support containers seems obvious to me. It jibes with duck > > typing. Perhaps the title of this thread should have been: "Why don't >

RE: c[:]()

2007-06-01 Thread Warren Stringer
Gabriel wrote: > I begin to think you are some kind of Eliza experiment with Python > pseudo-knowledge injected. Tell me more about your feelings that I am an Eliza experiment with Python with pseudo knowledge injected. Thanks for the code example. -- http://mail.python.org/mailman/listinfo/pyt

RE: c[:]()

2007-06-01 Thread Warren Stringer
Thanks, Dakz for taking the time to reply: > This discussion has gone in more circles than Earth has gone 'round > the Sun, but it seems you should consider the following: Yes, I've been feeling a bit dizzy > 1) Sequences and functions serve fundamentally different purposes in > Python. One is f

RE: c[:]()

2007-06-01 Thread Warren Stringer
> > [Please quit saying "a container" if you mean lists and tuples. > > "A container" is way too general. There most probably _are_ > > containers for which c() does not fail.] > > One example of such a container is any folderish content in Zope: > subscripting gets you the contained pages, calli

RE: c[:]()

2007-06-01 Thread Warren Stringer
> And that your > insisting on ``c[:]()`` instead of just ``c()`` seems to indicate you want > a change that is quite surprising. It would mean that a slice of a list > returns an other type with the __call__ method implemented. I am not insisting on anything. I use ``c[:]()`` as shorthand way of

RE: c[:]()

2007-06-01 Thread Warren Stringer
> Warren Stringer wrote: > > > `c[:]()` is unambiguous because: > > > > def c(): print 'yo' > > > > c() # works, but > > c[:]() # causes: > > > > Traceback (most recent call last)... > > c[:]()

RE: c[:]()

2007-06-01 Thread Warren Stringer
> Warren Stringer wrote: > > > As mentioned a while back, I'm now predisposed towards using `do(c)()` > > because square brackets are hard with cell phones. The one mitigating > factor > > for more general use, outside of cell phones, is speed. > > The spee

RE: c[:]()

2007-05-31 Thread Warren Stringer
issues, though you > will of course get all sorts of opinions on c.l.py. Oh well. Perhaps I can relax and actually write functioning code ;-) What do you mean by 'c.l.py' ? The first thing that comes to mind is 'clippy' that helpful little agent in Word that helped pay for Simonyi's trip into space. Ching ching, Warren -- http://mail.python.org/mailman/listinfo/python-list

RE: c[:]()

2007-05-31 Thread Warren Stringer
_call__ create any extra indirection? If yes, then I presume that `do(c)()` would be slower the `c[:]()`. I am writing rather amorphous code. This may speed it up. 4) I posit yes. Am I missing something? What idiom does would c[:]() break? This correlates with whether `c[:]()` breaks the language d

RE: c[:]()

2007-05-31 Thread Warren Stringer
> > I did not hijack another thread > > You really did. In the first message you sent, we see the following > header: > > > In-Reply-To: <[EMAIL PROTECTED]> ... Damn! I suck. Outlook as a newsreader sucks. I need to use something else. > I retyped the code you posted in the first pos

RE: c[:]()

2007-05-31 Thread Warren Stringer
> > What?!? I started this thread. > > > No you didn't. Your original post was a reply to a message whose subject > line was 'Re: "is" and ==', and included the header > > In-Reply-To: <[EMAIL PROTECTED]> You're right, thanks. > >> I think the fundamental mistake you have made is to convince you

RE: c[:]()

2007-05-31 Thread Warren Stringer
Quotes out of context with mistaken assumptions, now follow: > So c[:]() -- or the more recent go(c)() -- executes all those > behaviors. > > No it doesn't. See below. > > > > If c[:]() works, the so does this, using real world names > > > > orchestra[:].pickle() > > orchestra[c

RE: Is PEP-8 a Code or More of a Guideline?

2007-05-31 Thread Warren Stringer
Wildemar Wildenburger wrote: > This may be a nice > idea for the Next Overwhelming Programming Escapade (Codename: NOPE) > ... > You may want to elaborate on the "new way to think about names". Maybe > you have a point which I just don't see. Is it considered pythonic to LOL? Nietzsche would lov

RE: c[:]()

2007-05-31 Thread Warren Stringer
> >> c[:] holds many behaviors that change dynamically. > > > > I've absolutely no clue what that sentence means. If c[:] does > > behave differently than c, then somebody's done something > > seriously weird and probably needs to be slapped around for > > felonious overriding. I'm still a bit ne

RE: c[:]()

2007-05-31 Thread Warren Stringer
> How is it more expressive? In the context you're concerned > with, c[:] is the exactly same thing as c. You seem to be > worried about saving keystrokes, yet you use c[:] instead of c. > > It's like having an integer variable i and using ((i+0)*1) > instead of i. Nope, different. c[:] holds

RE: Is PEP-8 a Code or More of a Guideline?

2007-05-31 Thread Warren Stringer
Perhaps a foot pedal? Hmmm My two cellphones don't like underbars very much. And the shift key -- while much easier -- still is cumbersome. If outlook didn't autocaps on me, this message would be in all lowercase. In fact, when communicating with friends from outlook, to their sms, I take the

RE: c[:]()

2007-05-31 Thread Warren Stringer
> > > > But that still isn't as simple or as direct as: > > > > c[:]() > > Why do you always use a _copy_ of c in your examples? As long > as you're wishing, why not just > > c() Oh hey Grant, yes, I misunderstood your question for a bit. I thought you meant the difference between List compr

RE: c[:]()

2007-05-31 Thread Warren Stringer
Hey Marc, > > [d() for d in c] > > If you are using the list comprehension just for the side effect of > calling `d` then consider this bad style. You are building a list of > `None` objects just to have a "cool" one liner then. Yep, you're right > for func in funcs: > func() > > Becaus

RE: c[:]()

2007-05-31 Thread Warren Stringer
On Behalf Of Mikael Olofsson > Sent: Thursday, May 31, 2007 1:52 AM > To: python-list@python.org > Subject: Re: c[:]() > > Warren Stringer wrote: > > I want to call every object in a tupple, like so: > > [snip examples] > > Why? Because I want to make Python call

RE: c[:]()

2007-05-31 Thread Warren Stringer
Hey Douglas, Perhaps I was being too abstract? Here goes: ,--- | def selector(): |... |return funcKey #get down get down | | def func(): |... | funcSwitch = {} | funcSwitch[funcKey] = func | ... | funcSwitch[selector()]() even more intere

RE: c[:]()

2007-05-30 Thread Warren Stringer
Oops! guess I should have tested my rather hasty complaint about executable containers. This is nice: def a(): return 'b' def b(): print 'polly! wakey wakey' c = {} c['a'] = b c[a()]() #works! c[a()]() is a switch statement with an amorphous selector- very handy in its own right. But, using a()

RE: c[:]()

2007-05-30 Thread Warren Stringer
python list. Cheers, \~/ > -Original Message- > From: [EMAIL PROTECTED] [mailto:python-list- > [EMAIL PROTECTED] On Behalf Of Dustan > Sent: Wednesday, May 30, 2007 4:14 PM > To: python-list@python.org > Subject: Re: c[:]() > > On May 30, 5:37 pm, "Warre

RE: c[:]()

2007-05-30 Thread Warren Stringer
; [EMAIL PROTECTED] On Behalf Of Brian van den Broek > Sent: Wednesday, May 30, 2007 3:00 PM > To: python-list@python.org > Subject: Re: c[:]() > > Warren Stringer said unto the world upon 05/30/2007 05:31 PM: > > Hmmm, this is for neither programmer nor computer; this is f

RE: c[:]()

2007-05-30 Thread Warren Stringer
oster) ... \~/ > -Original Message- > From: [EMAIL PROTECTED] [mailto:python-list- > [EMAIL PROTECTED] On Behalf Of Carsten Haese > Sent: Wednesday, May 30, 2007 12:55 PM > To: python-list@python.org > Subject: Re: c[:]() > > On Wed, 2007-05-30 at 11:48 -0700, Warren Stringer wrote: > &g

c[:]()

2007-05-30 Thread Warren Stringer
# huh? a >>> [i() for i in c] # too long and ...huh? a b [None,None] #-- Why? Because I want to make Python calls from a cell phone. Every keystroke is precious; even list comprehension is too much. Is there something obvious that I'm mis

RE: Is PEP-8 a Code or More of a Guideline?

2007-05-29 Thread Warren Stringer
y project? Perhaps a few lines of script to add CamelBack support, using an amplitude increase for initial caps and maybe lingering on the initial phoneme for an extra 100 milliseconds. So then, the above example would read: "camel link dot set Parse Action between parens emit Link H T M L j

Telnetlib to twisted

2006-10-27 Thread Matthew Warren
Hallo, >>> import telnetlib >>> l=telnetlib.Telnet('dbprod') >>> l.interact() telnet (dbprod) Login: Could anyone show how the above would be written using the twisted framework? All I'm after is a more 'intelligent' interactive telnet session (handles 'vi' etc..) rather than the full capabilit

RE: [Tutor] How to get the width of teh button widget..??

2006-10-20 Thread Matthew Warren
    Folks,   Sorry for asking you such a trivial question.!!! But i want to size up all the buttons with the same size as the largest one in the interface.. And thats why I am asking this question..   Regards, Asrarahmed      Hi Asrarahmed.  I think, from yo

RE: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-20 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Fredrik Lundh > Sent: 20 October 2006 06:43 > To: python-list@python.org > Subject: Re: Tkinter--does anyone use it for sophisticated > GUI development? > > Kevin Walzer wrote: > > > Comi

RE: making a valid file name...

2006-10-18 Thread Matthew Warren
> > Hi I'm writing a python script that creates directories from user > input. > Sometimes the user inputs characters that aren't valid > characters for a > file or directory name. > Here are the characters that I consider to be valid characters... > > valid = > ':./,^0123456789abcdefghijklmno

RE: Return returns nothing in recursive function

2006-10-17 Thread Matthew Warren
> break > else: > _DoThingsToTree(path[1:],value,item[path[0]],delete) > The '_' in front of DoThingsToTree shouldn't be there. That's what I get for trimming off the '_' elsewhere after I pasted the code in. Matt. This email is confidential and

Return returns nothing in recursive function

2006-10-17 Thread Matthew Warren
Hallo people, I have the following code that implements a simple recursive tree like structure. The trouble is with the GetTreeBranch function, the print statement prints a valid value but the return immediatley afterward doesn't return anything. Can anyone help me with why? Thanks, Matt. Co

RE: Any idea how to do this in Python?

2006-10-17 Thread Matthew Warren
> On 17 Oct 2006 02:56:45 -0700, Lad <[EMAIL PROTECTED]> wrote: > > > > Dennis, > > Thank you for your reply > > You say: > > >Pretend you are the computer/application/etc. How would YOU > > > perform such a ranking? > > That is what I do not know , how to perform such ranking. > > Do you have any

Re: Funky file contents when os.rename or os.remove are interrupted

2006-10-11 Thread Russell Warren
Thanks, guys... this has all been very useful information. The machine this is happening on is already running NTFS. The good news is that we just discovered/remembered that there is a write-caching option (in device manager -> HDD -> properties -> Policies tab) available in XP. The note right b

RE: Bad Code (that works) help me re-write!

2006-10-11 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Giles Brown > Sent: 11 October 2006 12:38 > To: python-list@python.org > Subject: Re: Bad Code (that works) help me re-write! > > Matthew Warren wrote: >

Bad Code (that works) help me re-write!

2006-10-11 Thread Matthew Warren
I have the following piece of code, taken from a bigger module, that even as I was writing I _knew_ there were better ways of doing it, using a parser or somesuch at least, but learning how wasn't as fun as coding it... And yes alarm bells went off when I found myself typing eval(), and I'm sure th

Funky file contents when os.rename or os.remove are interrupted

2006-10-10 Thread Russell Warren
I've got a case where I'm seeing text files that are either all null characters, or are trailed with nulls due to interrupted file access resulting from an electrical power interruption on the WinXP pc. In tracking it down, it seems that what is being interrupted is either os.remove(), or os.renam

Using twisted, not telnetlib for interactive telnet (WAS: RE: Improving telnetlib)

2006-10-06 Thread Matthew Warren
> >The trouble is, I havent got a clue where to start and would > appreciate > >a couple of pointers to get me going... > > > > I'd suggest taking a look at Twisted, which contains a more complete > telnet implementation (not as important for being able to launch vi), > an ssh implementation (

RE: building strings from variables

2006-10-05 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Gal Diskin > Sent: 05 October 2006 16:01 > To: python-list@python.org > Subject: building strings from variables > > Following a discussion with an associate at work about various ways to > b

RE: dictionary of list from a file

2006-10-05 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Giovanni Bajo > Sent: 04 October 2006 15:17 > To: python-list@python.org > Subject: Re: dictionary of list from a file > > [EMAIL PROTECTED] wrote: > > > while(){ > > @info=split

RE: dictionary of list from a file

2006-10-05 Thread Matthew Warren
> -> > Python 2.5 introduced a dictionary type with automatic > > creation of values, > > ala Perl: > > > > === > > from collections import defaultdict > > > > d = defaultdict(list) > > for line in fl: > > k, v = line.strip().split() > > d[k].append(v

RE: Why do this?

2006-10-05 Thread Matthew Warren
> [Matthew Warren] > > | Blame outlook and AutoCaps. If number were a number I would write > | > | print "There are",number,"ways to skin a "+furryanimal > > You see now that strikes me as a bit mixed up. Why not simply use? > > print "a"

RE: Why do this?

2006-10-05 Thread Matthew Warren
> Duncan Booth wrote: > > > print "There are"+number+"ways to skin a"+furryanimal > > > > or at least something equivalent to it. If I try to make > the same mistake > > with a format string it jumps out to me as wrong: > > > > "There are%sways to skin a%s" % (number, furryanimal) > > Relate

RE: Why do this?

2006-10-05 Thread Matthew Warren
> Also, having a variable of type str called 'number' seems > perverse (and > probably error prone), so I suspect I might need something like: > And not something I would normally do, but for hastily written contrived examples I might :) >print "There are "+str(number)+" ways to skin a "

RE: Why do this?

2006-10-05 Thread Matthew Warren
> > | Now, I started programming when I was 8 with BBC Basic. > > Hey, likewise! (Except I was 12 when it came out!) I think it came out before I was 8, and I started out with print and input. Not sure if that's 'real' programming - I don't think I graduated to ifs and thens and gotos and gosubs

Why do this?

2006-10-05 Thread Matthew Warren
Ok, not really python focused, but it feels like the people here could explain it for me :) Now, I started programming when I was 8 with BBC Basic. I never took any formal classes however, and I have never become an expert programmer. I'm an average/hobbyist programmer with quite a few languages

RE: Raw strings and escaping

2006-10-04 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Scott David Daniels > Sent: 03 October 2006 18:11 > To: python-list@python.org > Subject: Re: Raw strings and escaping > > Matthew Warren wrote: > >

Improving telnetlib

2006-10-04 Thread Matthew Warren
Hi, I use telnetlib in an app I am writing, and would like to add functionality to it to support interactive terminal sessions , IE: be able to 'vi' a file. Currently it seems telnetlib isnt quite sophisticated enoguh to support such a thing. The trouble is, I havent got a clue where to start

RE: Escapeism

2006-10-03 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Matthew Warren > Sent: 03 October 2006 16:07 > To: python-list@python.org > Subject: RE: Escapeism > > > > > -Original Message- > &

RE: Escapeism

2006-10-03 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Kay Schluehr > Sent: 30 September 2006 18:02 > To: python-list@python.org > Subject: Re: Escapeism > > Sybren Stuvel wrote: > > Kay Schluehr enlightened us with: > > > Usually I struggle a

Raw strings and escaping

2006-10-03 Thread Matthew Warren
Hi, I would expect this to work, rawstring=r'some things\new things\some other things\' But it fails as the last backslash escapes the single quote. ..although writing this I think I have solved my own problem. Is \' the only thing escaped in a raw string so you can place ' in a raw string? Alt

RE: Making sure script only runs once instance at a time.

2006-09-30 Thread Matthew Warren
Apologies for repost. not sure what happened.   This email is confidential and may be privileged. If you are not the intended recipient please notify the sender immediately and delete the email from your computer. You should not copy the email, use it for any purpose or disclose its contents

RE: Making sure script only runs once instance at a time.

2006-09-29 Thread Matthew Warren
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hari SekhonSent: 29 September 2006 14:55To: python-list@python.orgSubject: Re: Making sure script only runs once instance at a time. I'm not sure if that is a very old way of doing it, which is why I wa

RE: Problems with Python 2.5 installer.

2006-09-29 Thread Matthew Warren
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of paw Sent: 29 September 2006 11:01 To: python-list@python.org Subject: Re: Problems with Python 2.5 installer. John Machin wrote: > paw wrote: > > I have ran the MSI installer for Python 2.5 several times at

  1   2   >