Github org: https://github.com/circuits
cheers
James
James Mills / prologic
E: prolo...@shortcircuit.net.au
W: prologic.shortcircuit.net.au
--
https://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations/
!
cheers
James
James Mills / prologic
E: prolo...@shortcircuit.net.au
W: prologic.shortcircuit.net.au
--
https://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations/
://circuits.readthedocs.org/en/latest/changes.html
[2]: http://circuits.readthedocs.org
James Mills / prologic
E: prolo...@shortcircuit.net.au
W: prologic.shortcircuit.net.au
--
https://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation
I'd like to volunteer!
On Mar 5, 2014 7:13 PM, M.-A. Lemburg m...@python.org wrote:
[Please help spread the word by forwarding to other relevant mailing lists,
user groups, etc. world-wide; thanks :-)]
Dear Python Community,
for many years, the Python Job board (
examples.
- Component Interface querying.
For more information see the PyPi page:
pypi.python.org/pypi/circuits/
cheers
James
James Mills / prologic
E: prolo...@shortcircuit.net.au
W: prologic.shortcircuit.net.au
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support
/wait synchronous primitives.
* Simplified API for Eventing and Channel targeting.
* Many more bug fixes and test coverage.
For more information see the PyPi page:
pypi.python.org/pypi/circuits/
cheers
James
James Mills / prologic
E: prolo...@shortcircuit.net.au
W: prologic.shortcircuit.net.au
On Dec 14, 3:30 am, Pedro Henrique Guedes Souto
pedro.h.so...@gmail.com wrote:
On Tue, Dec 13, 2011 at 3:22 PM, prakash jp prakash.st...@gmail.com wrote:
Want to publish a log file as a web page, is there a parser to retain the
format of the text as is and then convert to html. Please
easy-to-use core
functionality with a synchronous-like API on top of circuits.
This release also includes a number of minor bug fixes
and greater test coverage.
For more information see the PyPi page:
pypi.python.org/pypi/circuits/
cheers
James
James Mills / prologic
Developer | circuits
cool. I haven't looked at the source code yet...
There was another game very similar to this - much more basic though
and when I saw it back then I wanted to do something similar!
Nice job!
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman
gap.
On my desktop at home which runs CRUX (http://crux.nu) I use
the Terminius (1) fonts which I installed myself.
I find this font especially nice for both Terminals and Editing code.
cheers
James
1. http://terminus-font.sourceforge.net/
--
-- James Mills
--
-- Problems are solved by method
seems more fitting :)
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
-source?
As I mentioned before (which I don't think you quite got)...
Write your game for the web.
Write is as a SaaS (Software as a Service) - even if it's free and open source.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python
.
Funny you should mention this now :)
I happen to be blind myself.
Yes I agree Flash is not very accessible (never has been).
Web Standards web apps and such however are quite
accessible!
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo
write all parts you want to hide in C/C++/Cython and
distribute them as .so/.dll
Or you could do what everyone else is doing
and provide your application as a service in some manner.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo
.
They are synonyms.
5. is there a way to find out if the thread is still active or dead?
See: pydoc threading.Thread or help(threading.Thread)
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
or not?
Recently I wrote a simple backup system for a client using
a mixture of Python and Bash using rsync, ssh and pptp.
(Not packaged well enough to show source though)
It works very well and does the job.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org
:) However I was referring to real experience
where I've seen code that catches all any any exception
and simply logs it.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
is a dynamic programming language) but errors should
be handled and caught by the caller - not the callee.
My 2c, others may have other points of view...
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
)
[[' ', ' ', ' ', ' ', ' '],
[' ', ' ', ' ', ' ', ' '],
[' ', ' ', ' ', ' ', ' '],
[' ', ' ', ' ', ' ', ' '],
[' ', ' ', ' ', ' ', ' ']]
grid[2][2] = X
pprint(grid)
[[' ', ' ', ' ', ' ', ' '],
[' ', ' ', ' ', ' ', ' '],
[' ', ' ', 'X', ' ', ' '],
[' ', ' ', ' ', ' ', ' '],
[' ', ' ', ' ', ' ', ' ']]
cheers
James
--
-- James Mills
--
-- Problems
frankly
I'm sick of seeing posts that argue for the sake of arguing.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, May 6, 2011 at 4:36 PM, Jabba Laci jabba.l...@gmail.com wrote:
If I want to check if a list is empty, which is the more pythonic way?
[...]
(2) if not li:
This is fine.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo
) do this:
if a not in line or b not in line or c not in line:
print line
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
- notably:
except Exception, e: # Python 2.x
except Exception as e: # Python 3.x
I might suggest you take a look at using lxml instead
which ships with the standard library.
[ ... ]
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo
, = 1, 1
while n 1:
a, b = b, a + b
n -= 1
return b
#cloud.start_simulator()
jobs = cloud.map(fib, range(100))
print [cloud.result(job) for job in jobs]
Enjoy! :)
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman
the API provided to be quite simple robust and potentially very
powerful - depending on your application.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
/library/pickle.html#the-pickle-protocol
Any time you want to unpickle a user class, that class must be available.
I suggest serializing to a more common format (say JSON) and re-create
your class with the data.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http
module is best suited to
do this? subprocess?
Yes start with the subprocess module:
http://docs.python.org/library/subprocess.html
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
that this is typical of MixIns
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
/lepl/source/browse/src/lepl/matchers/matcher.py#40 I
have
_Matcher = ABCMeta('_Matcher', (object, ), {})
and then
class Matcher(_Matcher):
...
Thank Andrew. I like this approach Elegance wins for me :)
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http
Hi all,
Is there a compatible way to use meteclasses
in both Python 2.x (2.6 to 2.7) and Python 3.x
(3.0 to 3.2).
Python 2.x:
class Foo(object):
__meteclass__ = MyMetaClass
Python 3.x:
class Foo(metaclass=MyMetaClass):
pass
Thanks,
cheers
James
--
-- James Mills
--
-- Problems
.
if test:
message = %s %s (message, Humbug!)
print(message)
Python3 (afaik) also introduced the .format(...) method on strings.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Apr 19, 2011 at 2:05 PM, harrismh777 harrismh...@charter.net wrote:
Are bug reports wanted here, or just in issue tracker?
Pretty sure they're wanted in the Issue Tracker.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo
this! :) And you're a bit late...
You said it yourself If there is code after that snippet
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
to make use of modules here
as opposed to nesting classes.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
the language).
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
Does anyone know of a tool that will help with
reformatting badly written code to be pep8 compliant ?
a 2to3 for pep8 ?
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Apr 14, 2011 at 11:47 AM, James Mills
prolo...@shortcircuit.net.au wrote:
Does anyone know of a tool that will help with
reformatting badly written code to be pep8 compliant ?
a 2to3 for pep8 ?
In case there is no such tool (And I don't have the time to write one)
I've found
On Thu, Apr 14, 2011 at 11:47 AM, Ethan Furman et...@stoneleaf.us wrote:
*Please* don't re-post his crap.
Opps sorry :) I have never really known what to do with big-huge-long posts ? :)
Won't happen again!
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http
in
readability more than anything. I often use pyflakes in conjunction with
pep8 to keep my own code clean, readable and consistent.
Thanks for the suggestion!
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
your tastes.
I doubt such a tool could be written either.
The vim plugin I referenced earlier works nicely enough.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
a week or month at least.
Because he has better things to do ?
LIke his job at Google ?
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
-mentoring, python-ideas, etc)
so that there is a clear separation of what's what.
Can we stop arguing about this now ?
cheers
James
http://mail.python.org/mailman/listinfo/python-list
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
said.
Nice comments btw Chris :)
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
an assumption and I'm
not going back on it :)
Thanks for making the two sides obviously clear!
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
you like it and if you feel
it useful, share the patch and/or file a bug with the patch.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
fun until someone looses an eyeball!
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
python ideology.
be expanded to
_temp = expr
if _temp: return _temp
This could be simplified to just:
return expr or None
And more to the point... If your calee is relying
on the result of this function, just returning the
evaluation of expr is enough.
cheers
James
--
-- James Mills
an answer)
raise ValueError raise ValueError
Are you saying the two snippets above are equivalent?
def foo(n):
x = n 5
if x:
return x
is functionally equivalent to:
def foo(n):
return n 5
--
-- James Mills
--
-- Problems are solved by method
--
http
On Tue, Apr 12, 2011 at 12:18 PM, Jason Swails jason.swa...@gmail.com wrote:
This is only true if n 5. Otherwise, the first returns None and the
second returns False.
Which is why I said:
return expr or None
But hey let's argue the point to death!
cheers
James
--
-- James Mills
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
about what the OP intended. Perhaps OPs should be more
clear ? :)
kid!
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
-managed not recognized
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
solution.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Mar 11, 2011 at 9:30 AM, Grant Edwards invalid@invalid.invalid wrote:
No it doesn't. Try writing something other than foobar.
You've demonstrated a case where this doesn't work :)
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman
missing something here I don't see how you could
achieve communication with another process unless that
process has some kind of communication(s) interface; eg:
* some kind of listening socket
* some kind of I/O (pipe, stdin/stdout)
cheers
James
--
-- James Mills
--
-- Problems are solved by method
)
... print(Hello %s % y)
...
x = ExtendedBase(foo, bar)
Hello foo
Hello bar
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
and greater test coverage.
For more information see the PyPi page:
http://pypi.python.org/pypi/circuits/1.5
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation
the exception? Is it necessary to catch this exception
and manually retry the Queue operation? Thanks.
Are you getting this when your application is shutdown ?
I'm pretty sure you can safely ignore this exception and
continue.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
quality code.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
expect if you called f(...) incorrectly.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
with the attributes you've defined.
Note for convention reasons I've also included proper class names
in the example. Classes normally start with an Upper case letter.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
constructor directly and using the super type ?
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
was not a member of the
OP's class ship.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
) to see if it
meets your needs ?
cheers
James
1. http://pypi.python.org/pypi/psutil/0.2.0
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
groups
http://groups.google.com/group/circuits-users or on the
#circuits IRC Channel on the FreeNode IRC Network.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation
in a sensible way (instead of just
doing: if foo in s)
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
the examples: https://bitbucket.org/prologic/circuits/src/1.3.1/examples/
Please give us feedback on the circuits-users groups
http://groups.google.com/group/circuits-users or on the
#circuits IRC Channel on the FreeNode IRC Network.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
it from PyPi: http://pypi.python.org/pypi/sahriswiki/0.8
Following it's development at:
https://bitbucket.org/prologic/sahriswiki/overview
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python
and its metaclass? Is there a standard for this?
IHMO (but others may have other opinions) the same way
you'd represent a decorated function. Metaclasses IHMO
have the same effect as a decorated function - modifying
another classes's behavior.
cheers
Jaes
--
-- James Mills
--
-- Problems
-Agent strings.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
release)
the transition isn't very steep as most things are the same
just better :)
Please see http://pypi.python.org/pypi/circuits/ for more details
and the bitbucket home page http://bitbucket.org/prologic/circuits/
I plan to release more often so see you again!
cheers
James
--
-- James Mills
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
class Foo(object):
pass
Foo.foo = foo
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
.
This is a good idea and you could also
make use of the following library:
http://pypi.python.org/pypi?:action=searchterm=utmpsubmit=search
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
on this
is lacking...
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
)
main()
Roger, why not use the nicely written and documented psutil module ?
http://pypi.python.org/pypi/psutil/0.2.0
http://code.google.com/p/psutil/
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Nov 11, 2010 at 12:42 AM, alexander bookre...@gmail.com wrote:
Could any give a hand?
Assignment ? Homework ?
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
()[:5]]
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
thousand times from a bash script. Any input or pointers to functions that'd
help would be very much appreciated. Thanks!
os.walk or os.listdir
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
):
#!/usr/bin/env python
import sys
print [v for v in list(line for line in sys.stdin)[:5]]
This uses a generator expression to read from stdin, converts this to
a list (only getting the first 5 items).
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org
On Thu, Nov 11, 2010 at 11:38 AM, MRAB pyt...@mrabarnett.plus.com wrote:
'list' will exhaust the input, then the slicing will return at most 5
lines.
Hmm you're right :)
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Nov 11, 2010 at 1:02 PM, Steve Holden st...@holdenweb.com wrote:
This suggests that you are mistaken about not exhausting the source.
Yeah I was mistaken. Oh well :) I was thinking of a generator-based
solution and got lost in the implementation!
--
-- James Mills
--
-- Problems
in sys.stdin), 0, 5)]
?
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
islice).
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
)
cheers
James
1. http://pypi.python.org/pypi/Traits/3.5.0
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
boilerplate ?
To define variables, just assign a value to a name:
x = 1
x
1
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Nov 1, 2010 at 3:03 PM, Yingjie Lan lany...@yahoo.com wrote:
with open('scores.csv'), open('grades.csv', wt) as f,g:
g.write(f.read())
One could write their own ContextManager here...
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org
Chad
... return self
... def last(self):
... print A
... return self
...
x = Foo()
y = x.first()
Chad
y.last()
A
__main__.Foo object at 0x1011d7ad0
NB: You must return self in this case so you can do chained calls.
cheers
James
--
-- James Mills
On Mon, Oct 25, 2010 at 9:02 AM, Chris Rebert c...@rebertia.com wrote:
Method chaining is usually* not idiomatic in Python.
I don't agree but anyway... I've just not seen it commonly used
amongst python programmers.
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http
The implementation of many common operators return self (the object
you're working with).
cheers
James
--
-- James Mills
--
-- Problems are solved by method
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Oct 25, 2010 at 12:49 PM, Steven D'Aprano
steve-remove-t...@cybersource.com.au wrote:
...if you're writing x.__add__(1).__sub__(3) instead of x + 1 - 3 then
you're almost certainly doing it wrong.
It was just an example :) ... And this isn't python-tutor
--James
--
-- James Mills
On Mon, Oct 25, 2010 at 9:39 AM, James Mills
prolo...@shortcircuit.net.au wrote:
Function/Method Chaining is probably used a lot in Python itself:
x = 4
x.__add__(1).__sub__(3)
2
The implementation of many common operators return self (the object
you're working with).
My apologies
1 - 100 of 567 matches
Mail list logo