Re: python admin abuse complaint

2010-02-07 Thread Daniel Fetchinson
Xah from the PSF :) but having a single c.l.p clown is tolerable if it makes him happy. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: python admin abuse complaint

2010-02-07 Thread Daniel Fetchinson
of crazy people (using a loose definition of >> crazy) were either executed or tortured and executed, however, the one >> lonely village clown or court clown was allowed to be crazy, he even >> had a decent income from the king. I'm not suggesting a stipend for >>

Re: python admin abuse complaint

2010-02-07 Thread Daniel Fetchinson
end a very clear message to all other online communities that the Python Community is able to think outside the box, and is not afraid of taking unusual steps to maintain a healthy community and is even able to incorporate revolutionary new tactics to keep the community friendly and tolerant.

Re: python admin abuse complaint

2010-02-07 Thread Daniel Fetchinson
r I believe the relatively few number of serial trolls would all find their places somewhere eventually. This approach would actually work and solve a serious problem, as opposed to building more jails and more correctional facilities. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: obfuscate

2010-02-09 Thread Daniel Fetchinson
res Python 2.5 or 2.6. Great, these packages are badly needed! If the code base stabilizes in a production version after losing the alphas and betas they would be a great addition to the stdlib, I think. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: "if {negative}" vs. "if {positive}" style (was: New to Python)

2010-02-09 Thread Daniel Stutzbach
If they're both long, I factor out one or both of the blocks into functions. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com/> -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: obfuscate

2010-02-10 Thread Daniel Fetchinson
to or one of the other packages if you need a >> minimum amount of security. > > Agreed. However, for cases that *don't* need security from determined > attackers, I don't think those obviate the usefulness of this library. Exactly. Cheers, Daniel -- Psss, psss, put

Re: Is a merge interval function available?

2010-02-10 Thread Daniel Stutzbach
On Wed, Feb 10, 2010 at 5:23 PM, Peng Yu wrote: > I'm wondering there is already a function in python library that can > merge intervals. > Not in the standard library, but this package may help: http://pypi.python.org/pypi/interval -- Daniel Stutzbach, Ph.D. President, Stutzba

Re: Bizarre arithmetic results

2010-02-11 Thread Daniel Fetchinson
version return a complex? Try this and think about operator precedence: Python 3.1.1 (r311:74480, Dec 13 2009, 16:50:25) [GCC 4.4.2 20091027 (Red Hat 4.4.2-7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>

working with laptop battery

2010-02-13 Thread Daniel Dalton
Hi, I'm constantly working in the command line and need to write a program to give me alerts on my battery. Can someone please tell me what module I should use to access battery information? Looking for something that perhaps makes use of acpi so I can get estimated time left as well as a percenta

Re: working with laptop battery

2010-02-13 Thread Daniel Dalton
On Sat, Feb 13, 2010 at 05:26:02PM -0800, Chris Rebert wrote: > It's probably gonna depend on which OS you're running. Which would be...? Sorry, forgot to mention this. I'm running debian linux. Thanks, Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: working with laptop battery

2010-02-13 Thread Daniel Fetchinson
the numbers you want from there. HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Plugin architecture

2010-02-15 Thread Daniel Fetchinson
signing something new if I hit a wall. Chances are you won't. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: The future of "frozen" types as the number of CPU cores increases

2010-02-17 Thread Daniel Stutzbach
ge collector. > A concurrent garbage collector for frozen object would still need to walk unfrozen objects, to find references to frozen objects. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

Re: Python library for working with simple equations

2010-02-18 Thread Daniel Fetchinson
n the > expression can be evaluated. > If there are two expressions, they can be added and the symbols > preserved. Take a look at sage: http://www.sagemath.org/ I wouldn't say it's simple, in fact it's huge, but it'll do the job. Cheers, Daniel -- Psss, psss, put

Re: Python library for working with simple equations

2010-02-18 Thread Daniel Fetchinson
b. Probably you can isolate the part of sage that you actually need and can throw away 95% of it. HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: working with laptop battery

2010-02-18 Thread Daniel Dalton
On Sat, Feb 13, 2010 at 09:19:59PM -0500, Chris Colbert wrote: >You'll need acpi installed: >In [6]: import subprocess Thanks for that code, I'll try putting something together this weekend. Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: working with laptop battery

2010-02-18 Thread Daniel Dalton
I'm not sure I have those files, but I'll look a little harder this weekend when I put together the script. Thanks for your help, Dan On Sat, Feb 13, 2010 at 08:23:28PM -0600, Tim Chase wrote: > Daniel Dalton wrote: > >On Sat, Feb 13, 2010 at 05:26:02PM -0800, Chris Reb

Re: working with laptop battery

2010-02-18 Thread Daniel Dalton
On Sun, Feb 14, 2010 at 03:22:11AM +0100, Daniel Fetchinson wrote: > /proc/acpi/battery/BAT0/info > /proc/acpi/battery/BAT0/state Had a quick look, but that path doesn't seem to exist, I'll look harder on the weekend when I put the script together, because it has to be somewhe

What happened to pyjamas?

2010-02-18 Thread Daniel Fetchinson
Does anyone know what happened to pyjs.org ? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: What happened to pyjamas?

2010-02-18 Thread Daniel Fetchinson
>> Does anyone know what happened to pyjs.org ? > > it's working for me. That's odd, it's unpingable for me from both Europe and the US, ping says unknown host. Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to continue after an exception ?

2010-02-20 Thread Daniel Fetchinson
> I would like my program to continue on the next line after an uncaught > exception, > is that possible ? try: # here is your error except: pass # this will get executed no matter what See http://docs.python.org/tutorial/errors.html HTH, Daniel -- Psss, psss, put it dow

Re: Efficient way to break up a list into two pieces

2010-02-20 Thread Daniel Stutzbach
d only O(log n) time to trim l1. You'd use it something like this: >>> from blist import blist >>> l1 = blist() >>> # Here, populate l1 as you normally would >>> l2 = l1[10:] >>> del l1[10:] It's available at: http://pypi.python.org/pypi/bli

Re: Efficiently building ordered dict

2010-02-22 Thread Daniel Stutzbach
27;, 6: 'b', -5: 'c'}) >>> my_dict.keys() [-5, 1, 6] >>> my_dict[2] = 'd' >>> my_dict.keys() [-5, 1, 2, 6] It's available here: http://pypi.python.org/pypi/blist/ -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

Re: Avoid converting functions to methods in a class

2010-02-23 Thread Daniel Fetchinson
solution I currently use is to drop the target attribute in this > class, and just refer to mymodule.function in each individual test. I > don't like this solution because it violates Once And Only Once: if the > function changes name, I have to make many edits to the test

Re: Signature-based Function Overloading in Python

2010-02-23 Thread Daniel Fetchinson
a() > TypeError: a() takes exactly 1 argument (0 given) > > So - What would be the most pythonic way to emulate this? > Is there any better Idom than: > > >>> def a(x=None): > if x is None: > pass > else: > pass Thi

Re: [Python-Dev] Question for you

2010-02-23 Thread Daniel Fetchinson
ot;PAUSE" );* >> >> * return 0;* >> >> *}* >> >> >> Also: >> >> I did set up my environmental config to go to the Boost dir. >> >> Question: >> >> Do you know what am I doing wrong? >> >> Regards, >

Re: Spam from gmail (Was: fascism)

2010-02-23 Thread Daniel Fetchinson
un on > but questions about hardware are also off topic. > > Perhaps you don't quite grasp the point of topical discussion groups. > They are a way of letting individuals decide for themselves what kind > of discussions they want to be involved in. By spamming the group this >

Re: The best way to check if two lists have identical values

2010-02-25 Thread Daniel Stutzbach
> matters. > Order and repetitions matter: list1 == list2 Repetition matters, order does not: sorted(list1) == sorted(list2) # items must be comparable Neither matters: set(list1) == set(list2) # items must be hashable -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://s

Re: Challenge: escape from the pysandbox

2010-02-26 Thread Daniel Fetchinson
>> pysandbox is a new Python sandbox project Out of curiosity, the python sandbox behind google app engine is open source? If so, how is it different from your project, if not, anyone knows if it will be in the future? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepre

Re: Challenge: escape from the pysandbox

2010-02-27 Thread Daniel Fetchinson
On 2/26/10, Victor Stinner wrote: > Le vendredi 26 février 2010 15:37:43, Daniel Fetchinson a écrit : >> >> pysandbox is a new Python sandbox project >> >> Out of curiosity, the python sandbox behind google app engine is open >> source? If so, how is it di

Re: cpan for python?

2010-02-28 Thread Daniel Fetchinson
> Is there something like cpan for python? I like python's syntax, but I use > perl because of cpan and the tremendous modules that it has. It's called PyPI or Cheese Shop: http://pypi.python.org/pypi Is it only me or others also mentally read C-SPAN when somebody writes CPAN?

Re: Challenge: escape from the pysandbox

2010-02-28 Thread Daniel Fetchinson
goal is not only too ambitious but also not really a useful one. One aspect might be that one might want to have a platform independent way of sandboxing, perhaps. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Draft PEP on RSON configuration file format

2010-03-01 Thread Daniel Fetchinson
nk that working on such a project might be fun and educational for you but completely useless if you have users other than yourself in mind. Again, I'm trying to be helpful here, so you can focus on a project that is both fun/educational for you and also potentially useful for others. This

Re: Draft PEP on RSON configuration file format

2010-03-02 Thread Daniel Fetchinson
("waste" in this case is only meant as "useless for others", not "useless for me") because it's, well, hobby and fun and educational :) It's just good to know if a given project is in this category or outside. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Queue peek?

2010-03-02 Thread Daniel Stutzbach
On Tue, Mar 2, 2010 at 1:58 PM, Martin P. Hellwig < martin.hell...@dcuktec.org> wrote: > What actually happens if multiple threads at the same time, write to a > shared dictionary (Not using the same key)? > All of Python's built-in types are thread safe. Both updates wi

Re: Re Interest check in some delicious syntactic sugar for "except:pass"

2010-03-03 Thread Daniel Fetchinson
.remove(somefile) > except: > ...pass # The bloody search indexer has got the file and I > can't delete it. Nothing to be done. You just found the right solution: define a function for something that you do repeatedly. No need to change the language. Cheers, Daniel -- Psss,

Re: Curiosity stirkes me on 'import this'.

2010-03-08 Thread Daniel Fetchinson
htu arire vf bsgra orggre guna *evtug* abj. > Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn. > Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn. > Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr! > > And some other attributes in '

Re: negative "counts" in collections.Counter?

2010-03-08 Thread Daniel Stutzbach
;: -1}) >>> c = Counter({'red': 1}) >>> c2 = Counter({'red': 2}) >>> c - c2 Counter() -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

Named loops for breaking

2010-03-09 Thread Daniel Klein
Hey, I did a little searching and couldn't really find much recent on this. The only thing I found was this: http://groups.google.com/group/comp.lang.python/browse_thread/thread/a696624c92b91181/5b7479fdc3362b83?lnk=gst&q=break+named+loop#5b7479fdc3362b83 Basically I'm wondering if there are any

Re: Named loops for breaking

2010-03-10 Thread Daniel Klein
Thanks for the link to the PEP. I should search through PEPs first next time :) Okay, I understand Guido's reasoning and yield the point. I typed up the specific example in which I came across this problem and, while doing so, realized there's a much better way of approaching the problem, so thank

Re: how to start a python script only once

2010-03-14 Thread Daniel Fetchinson
race connditions. > > However I currently don't know how to do file locking under windows > and I don't know how to do file lockng with python and linux. > I'll start googling. This is the variant I'm using frequently too and I'd recommend to you as well.

passing a socket to a subprocess in windows

2010-03-16 Thread Daniel Platz
od changeFd. Harald *** Has someone information about this or can help me to solve the problem. Thanks in advance Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way to trim and keep leading and trailing whitespace

2010-03-23 Thread Daniel Chiquito
As far as I know, I don't think there is anything that strips it and returns the material that was stripped. Regex's would be your best bet. Daniel On Tue, Mar 23, 2010 at 6:09 PM, wrote: > I'm looking for a pythonic way to trim and keep leading whitespace in a > string. &

Re: (a==b) ? 'Yes' : 'No'

2010-03-30 Thread Daniel Fetchinson
>> Hi, how can I write the popular C/JAVA syntax in Python? >> >> Java example: >> return (a==b) ? 'Yes' : 'No' >> >> My first idea is: >> return ('No','Yes')[bool(a==b)] >> >> Is there a more elegant/common python expression for this? > > return ('Yes' if a == b else 'No') And for less cl

what's the precision of fractions.Fraction?

2010-11-18 Thread Daniel Fetchinson
this regard nor was http://docs.python.org/library/fractions.html Any ideas? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: what's the precision of fractions.Fraction?

2010-11-18 Thread Daniel Fetchinson
gers? > > Since fractions are represented as a pair of integers, and since python > integers have unlimited precision, I would guess that fractions also have > unlimited precision. You could check the code if you want to be absolutely > sure. Sounds reasonable, thanks a lot, Daniel

inverse of a matrix with Fraction entries

2010-11-24 Thread Daniel Fetchinson
by thousand in size. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: inverse of a matrix with Fraction entries

2010-11-24 Thread Daniel Fetchinson
It's a mathematical problem so no uncertainty is present in the initial values. And even if there was, if there are many orders of magnitude differences between the entries in the matrix floating point does not suffice for various things like eigenvalue calculation and stuff like that. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: inverse of a matrix with Fraction entries

2010-11-24 Thread Daniel Fetchinson
the initial measurement >>> uncertainty. >> >> It's a mathematical problem so no uncertainty is present in the >> initial values. And even if there was, if there are many orders of >> magnitude differences between the entries in the matrix floating point

Re: inverse of a matrix with Fraction entries

2010-11-24 Thread Daniel Fetchinson
he whole matrix into a file, call Maple on it, parse the result, etc. So after all I might just code the inversion via Gauss elimination myself in a way that can deal with fractions, shouldn't be that hard. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: inverse of a matrix with Fraction entries

2010-11-24 Thread Daniel Fetchinson
2, -20] > [-15, 30] Thanks a lot! This sounds like the simplest solution so far. I don't need to call Maple after all :) Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: inverse of a matrix with Fraction entries

2010-11-24 Thread Daniel Fetchinson
ink without needing any divisions. > Finally, we have l A M = d I, so (l/d A) M = I and l/d A is the inverse > you seek. > > Does that make sense? Absolutely! But there is nothing wrong with working out the inverse directly using fractions.Fraction arithmetic, I'd think. Cheers,

Re: inverse of a matrix with Fraction entries

2010-11-25 Thread Daniel Fetchinson
course, I might be drastically underestimating the > performance of modern hardware -- I often do -- so this may not be > especially relevant. Anyway, the possibility's there. Okay, I see your point and I completely agree. Surely it will be faster to do it with integers, will give it a shot. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: decouple copy of a list

2010-12-10 Thread Daniel Urban
b = list(a) or b = a[:] -- http://mail.python.org/mailman/listinfo/python-list

Re: Needed: Real-world examples for Python's Cooperative Multiple Inheritance

2010-12-12 Thread Daniel Urban
XJSONEncoder, YJSONEncoder): pass It is usable this way: json.dumps([X(), Y()], cls=XYJSONEncoder) Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Added Python, WSGI to XAMPP

2010-12-17 Thread Daniel Fetchinson
ed to the engine > that then creates the view. And just because the controller navigates > the logic to dynamically contruct/render a view, that does not make 'it' > the view. In turbogears that is exactly what happens. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Web App

2010-12-23 Thread Daniel Fetchinson
I seldom ever touch a mouse > and I am a huge fan of vi, mutt, slrn, screen, ratpoison, etc. where > the primary interface is totally accessable through the keyboard without > having to tab through many options. Well, implementing vi or other text based tools in the browser is trivial. I mean it

Re: How can a function find the function that called it?

2010-12-24 Thread Daniel Urban
On Fri, Dec 24, 2010 at 17:24, kj wrote: > (BTW, I don't understand why inspect doesn't provide something as > basic as the *class* that the method belongs to, whenever applicable. > I imagine there's a good reason for this coyness, but I can't figure > it out.) One function object can "belong to

Re: Interning own classes like strings for speed and size?

2010-12-27 Thread Daniel Fetchinson
oking for is (some variant of) the singleton pattern: http://en.wikipedia.org/wiki/Singleton_pattern How it's done in python see http://www.google.com/search?q=python+singleton Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Interning own classes like strings for speed and size?

2010-12-27 Thread Daniel Fetchinson
e. I did not know about this pattern, but in my defense it looks like a variant of the singleton pattern :) Thanks! One always learns something new on python-list. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting bug

2011-01-01 Thread Daniel Fetchinson
as I do not > know them, as it happens, unnecessarily get upset. > > I use Python on WinXP service pack2, I started to use Python2.5.1, and > now I am using Python2.6.5, IDLE as GUI. > > Best Regards, > Subhabrata An AI bot is playing a trick on us. Focus and don't let you

Re: collections.Set Binary Reflected Operations

2011-01-19 Thread Daniel Urban
son for this, or if it was merely an oversight. > Chris See http://bugs.python.org/issue8743 and also http://bugs.python.org/issue2226 Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Behaviour-based interface/protocol implementation?

2011-01-26 Thread Daniel Urban
nds __instancecheck__ to use an _instancehook classmethod similarly to __subclasshook__. Then in your MyInterface class you can implement _instancehook to check for methods/signatures/whatever you want. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Behaviour-based interface/protocol implementation?

2011-01-27 Thread Daniel Urban
o __instancecheck__() is just useless here. Actually it can. You don't have to modify the object, just check for the desired methods/signature/whatever. See for example the implementation of collections.Hashable.__subclasshook__ in _abcoll.py and the abc.ABCMeta.__instancecheck__ method. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Behaviour-based interface/protocol implementation?

2011-01-28 Thread Daniel Urban
On Fri, Jan 28, 2011 at 11:32, Alan Franzoni wrote: > On Thu, Jan 27, 2011 at 11:41 PM, Daniel Urban wrote: > >> Actually it can. You don't have to modify the object, just check for >> the desired methods/signature/whatever. See for example the >> implement

Re: can't use multiprocessing with class factory?

2011-01-28 Thread Daniel Urban
pickle#what-can-be-pickled-and-unpickled ). The collections.namedtuple class factory function works around this limitation by setting the __module__ attribute of the created class, but I'm not sure if this solution can be used in this case. Daniel -- http://mail.python.org/mailman/listinfo/python-list

XML to dict(d)

2011-01-31 Thread Daniel Stender
a_ascetics. 000177 2,2 272 I've found that there is the library python-dictdlib for concatenating dict dictionaries, what would be the best way to "de-XML" the source file? Thanks for any pointers in advance! Daniel Stender -- http://mail.python.org/mailman/listinfo/python-list

Re: XML to dict(d)

2011-01-31 Thread Daniel Stender
>> I've found that there is the library python-dictdlib for concatenating >> dict dictionaries, what would >> be the best way to "de-XML" the source file? > > How do you want to the dict to look like? > > Stefan What's in should be the "search word", the rest altogether belonging to that in a

Re: Use the Source Luke

2011-02-05 Thread Daniel Fetchinson
but the reason is not because the total number of source related questions decreased but because the total number of non-source related questions increased. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Init a dictionary with a empty lists

2011-02-05 Thread Daniel Urban
dLength = {0 for i in range(1,MAX_PHRASES_LENGTH+1)} But I suggest using a defaultdict: http://docs.python.org/dev/py3k/library/collections#defaultdict-objects Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Init a dictionary with a empty lists

2011-02-05 Thread Daniel Urban
On Sat, Feb 5, 2011 at 15:38, Steven D'Aprano wrote: > On Sat, 05 Feb 2011 14:38:29 +0100, Daniel Urban wrote: > >> On Sat, Feb 5, 2011 at 14:08, Lisa Fritz Barry Griffin >> wrote: >>> Hi there, >>> >>> How can I do this in a one

Re: Markdown to reStructuredText

2011-02-09 Thread Daniel Stender
http://johnmacfarlane.net/pandoc/ Greetings, DS On 10.02.2011 06:38, Michele Simionato wrote: > Do you know if there is any converter from the Markdown syntax to the > rst syntax? Googling for markdown2rst > did not help. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

executing a function with feeding its global variables

2011-02-12 Thread Jean-Daniel
Hello, I am writing a small framework where the user which writes a function can expect some global variable to be set in the function namespace. The user has to write a function like this: """ # function.py from framework import, command, run @command def myfunc(): print HOST if __name__==

Re: executing a function with feeding its global variables

2011-02-12 Thread Jean-Daniel
On Sat, Feb 12, 2011 at 7:25 PM, Peter Otten <__pete...@web.de> wrote: > Jean-Daniel wrote: > >> Hello, >> >> I am writing a small framework where the user which writes a function >> can expect some global variable to be set in the function namespace. >>

Re: Best way to gain root privileges

2011-02-16 Thread Daniel Mahoney
On Wed, 16 Feb 2011 21:26:26 +, GSO wrote: > I'm sure this question is as old as time, but what is the best way to > gain root privileges? (Am using Python 2.6.5, pygtk2 v2.16, Gtk > v2.18.9, on RHEL6.) Gain root privileges for a script? Write a c wrapper to call the script, chown it (the w

Re: Write web apps in Python?

2010-04-12 Thread Daniel Fetchinson
rameworks like Pylons, TurboGears, or Django. > > Is this correct? Basically, yes. For additional info have a look at http://wiki.python.org/moin/WebProgramming Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-16 Thread Daniel Fetchinson
> I am trying to serialize a function, class, etc and transfer it, have it > unserialized and used. You might want to look at pyro: http://pyro.sourceforge.net/ and also picloud: http://www.picloud.com/ HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown --

extra room in Paris in your are stuck at the airport

2010-04-19 Thread Jean Daniel
Hello, I live in Paris, my roommate and I would gladly host a poor soul blocked at the airport due to the ash cloud. See me for details, Cheers, PS: disambiguation: talking about real physical cloud here... :) -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] pyjamas 0.7 released

2010-04-25 Thread Daniel Fetchinson
firefox 3.3.5 (linux) with and without adblock plus. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] pyjamas 0.7 released

2010-04-26 Thread Daniel Fetchinson
t;> >>This URL returns a blank page for me on firefox 3.3.5 (linux) with and >>without adblock plus. > > http://pyjs.org/examples/asteroids/output/Space.html works. (Firefox > 3.6.3 with ABP, Chrome 4.1) Thanks, this link indeed works! And a pretty cool game too! Chee

Re: replacing words in HTML file

2010-04-28 Thread Daniel Fetchinson
w.html', 'w' ) f.write( open( 'index.html' ).read( ).replace( 'replace-this', 'with-that' ) ) f.close( ) HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

printing table on the command line

2010-04-29 Thread Daniel Dalton
Hello, I'm using the MySQLdb library in python to interface with a mysql database I've created. I have written a command line app which runs from the command line. I have 10 fields and hence, have found that each record spreads over one line. What is the best way to print a table of a database lik

Re: replacing words in HTML file

2010-04-29 Thread Daniel Fetchinson
knows are not in javascript and/or css and he knows that these words are also not in html attribute names/values, etc, etc, then the above approach would work, in which case BeautifulSoup is a gigantic overkill. The OP needs to specify more clearly what he wants, before really useful advice can be g

Re: replacing words in HTML file

2010-04-29 Thread Daniel Fetchinson
in html attribute >> names/values, etc, etc, then the above approach would work, in which >> case BeautifulSoup is a gigantic overkill. The OP needs to specify >> more clearly what he wants, before really useful advice can be given. > > Funny, everyone else understood what the OP meant, and useful advice > was given. It was a lucky day for the OP then! :) Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast Efficient way to transfer an object to another list

2010-05-01 Thread Daniel Stutzbach
t is ordered, we may be able to help you come up with a clever way to remove an item cheaply. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread Daniel Skinner
ou need a generator (and as you mentioned the extra function call > overheads)? > > How about this? > > def get_leading_whitespaces(s): > count = 0 > for c in s: > if c != ' ': break > count += 1 > return ' ' * cou

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread Daniel Skinner
sorry, my mistake it runs faster (looking at the wrong line of code). But the first two solutions are still faster. On Sat, May 8, 2010 at 12:48 PM, Daniel Skinner wrote: > That solution actually runs slower then the generator method. > > > On Sat, May 8, 2010 at 12:33 PM, Sh

Re: to prevent reveres engineering for Python

2010-05-25 Thread Daniel Fetchinson
cking :)) Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Does pickled objects work fine between different OS?

2010-05-26 Thread Daniel Fetchinson
.pkl" > just fine on Windows XP? Yes. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the largest python/django powered website in the world?

2010-05-30 Thread Daniel Fetchinson
es, then probably google and youtube are the "largest python powered websites". Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Vote to Add Python Package "pubsub" to the Python Standard Library

2010-06-01 Thread Daniel Fetchinson
stdlib: http://www.python.org/dev/peps/pep-3143/ I haven't found the beginning of the thread discussing this but you can start for example here: http://mail.python.org/pipermail/python-list/2009-March/1197808.html Good luck, Daniel -- Psss, psss, put it down! - http://www.cafepress.c

Re: [Python-Dev] adding new function

2010-06-22 Thread Daniel Fetchinson
> how can i simply add new functions to module after its initialization > (Py_InitModule())? I'm missing something like > PyModule_AddCFunction(). This type of question really belongs to python-list aka comp.lang.python which I CC-d now. Please keep the discussion on that list.

Re: web application in django

2010-06-25 Thread Daniel Fetchinson
it where ever you need to insert it. Be sure to read this also [5]. HTH, Daniel [1] http://docs.python.org/library/urllib2.html [2] http://docs.python.org/library/xml.etree.elementtree.html [3] http://www.crummy.com/software/BeautifulSoup/ [4] http://wiki.python.org/moin/PythonXml [

Re: Build unordered list in HTML from a python list

2010-06-30 Thread Daniel Fetchinson
2 > > >Item 3 >Folder 2 > >Sub Item 2.1 >Folder 2.1 > >Sub Item 2.1.1 >Sub Item 2.1.2 > > > > > > > If an item of the list has &#x

Re: Using Python for web applications

2010-06-30 Thread Daniel Fetchinson
amework from scratch which is something the bigger shops are doing like youtube. In any case there is a wiki page that you might find useful [3]. HTH, Daniel [1] http://www.djangoproject.com/ [2] http://www.turbogears.org/ [3] http://wiki.python.org/moin/WebProgramming -- Psss, psss, put it

Re: Twisted 10.1.0 released

2010-07-05 Thread Daniel Fetchinson
.msi > http://tmrc.mit.edu/mirror/twisted/Twisted/10.1/Twisted-10.1.0.winxp32-py2.6.msi > > Many thanks to Glyph Lefkowitz, who helped do the release preparation, > and the PyCon 2010 sprinters, who did so much of the work for this > release. > The twisted website at http://twiste

Re: Python 3 - Is PIL/wxPython/PyWin32 supported?

2010-07-07 Thread Daniel Fetchinson
Don't ask me when, I don't know. I have no idea about the rest. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Python script to install python

2010-07-08 Thread Daniel Fetchinson
dows I assume a similar strategy is best. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

ANN: winreg_unicode 0.5.0

2010-07-08 Thread Daniel Stutzbach
zbach/winreg_unicode/issues Source code: http://github.com/DanielStutzbach/winreg_unicode -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

<    11   12   13   14   15   16   17   18   19   >