d
suggestions about alternative templating systems that provide better error
messages.
Thanks,
Tom
-
# foo.mako:
hello ${data}
>>> print mako.template.Template(filename="foo.mako").render(data="world")
hello world
>>> print
mako.template.Template(filename
thought Emacs was written in Lisp.
Large parts of Emacs are indeed implemented in Emacs Lisp. There's are some
core functions implemented in C.
MS-Word, afaik, had very substantial parts written in Visual Basic.
Tom
> DaveM
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list
= time.altzone
else:
tz = time.timezone
return t - tz
So, firstly, does that work? Answer: i've tested it a it, and yes.
Secondly, do you really have to do this just to parse a date with a
timezone? If so, that's ridiculous.
tom
--
102 FX 6 (goblins)
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 13 Aug 2008, Christian Heimes wrote:
Tom Anderson wrote:
Secondly, do you really have to do this just to parse a date with a
timezone? If so, that's ridiculous.
No, you don't. :) Download the pytz package from the Python package
index. It's *the* tool for timez
|
> Ben Finney
a better approach maybe is just to write your own test harness. it's trivial
to write a minimal system, which is then a solid basis for the enhancements
which are best for you.
tom arnall
arcata
--
http://mail.python.org/mailman/listinfo/python-list
You Suck big time! <>--
http://mail.python.org/mailman/listinfo/python-list
Greetings,
I need a little help with buffer objects. Many Python objects export
the buffer interface, or can be persuaded to create a buffer object
with a buffer() call.
First question, the buffer() function appears very quick. Does it just
wrap the internal pointer and then exit?
Second questio
side it. Of course not applicable to Python.
--
Tom Harris
--
http://mail.python.org/mailman/listinfo/python-list
implementation of PEP 224. The only solution that I can
see is to subclass int.__new__(), since once I have an int all it's
attributes are immutable.
--
Tom Harris
--
http://mail.python.org/mailman/listinfo/python-list
Let me first say that I'm sure that this subject has come up before,
and so forgive me for beating a dead horse. Secondly, let me say that
Python's strength is its dynamic nature, and I don't believe that it
should ever require a precondition scaffolding. With that said, I do
believe that somethin
Thanks for the info... Kinda comforting that Guido's syntactic ideas
were somewhat similar to my own.
--
http://mail.python.org/mailman/listinfo/python-list
Really what we're talking about here is weak typing in the form of
optional type hinting performed on a function by function basis. As an
option, what it would do is allow an author to semantically 'hint' to
the interpreter that a function is expecting a certain type, and
perform any implicit conv
This type of hinting would only break type ducking in-so-much as a
function that leveraged that hinting would be looking specifically for
an instance of a particular type, which would be absolutely no
different than a developer performing the type check manually and
throwing it out if the type were
I don't use isinstance() and type() at all, nor am I testing the type
of all variables being passed into function. What I'm arguing for here
is a semantic safety mechanism that is neither required, nor imposed.
Ultimately what it looks like what I'm proposing is a syntactic
shorthand for the adapt
W. eWatson wrote:
I'm trying to store analytic data in a folder called Analysis. If the
user doesn't have the folder, I make one for him, and then write a txt
file into it. In this case a histogram of values, x and frequency.
However, it appears that I made a mistake somewhere and cannot delete
ng bug: `lambda:2` is never
reached, and a truncated list of 1 element (instead of 3) is
"successfully" generated..
Just wondered what you guys think,
-- Tom
--
http://mail.python.org/mailman/listinfo/python-list
def twice(parameter = 2)
return 4
2009/9/20 daggerdvm :
> Write the definition of a function twice , that receives an int
> parameter and returns an int that is twice the value of the
> parameter.
>
> how can i do this
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http
irst_or_raise(genexp):
L = list(islice(genexp, 1))
if not L:
raise RuntimeError('no elements found')
return L[0]
I also think Jean-Paul's had a good point about how the problems in
the list/genexp interaction could be addressed.
Thank you,
-- Tom
On Wed, Dec 30, 2009 at 4:01 PM, Steven D'Aprano
wrote:
> On Wed, 30 Dec 2009 15:18:11 -0800, Tom Machinski wrote:
>> Bottom line, I'm going to have to remove this pattern from my code:
>>
>> foo = (foo for foo in foos if foo.bar).next()
>
> I don't
he simpler cases. As you surely
realize, to be perfectly safe, especially when the iterable can
contain any value (including your sentinel), we must use an
out-of-band return value, hence an exception is the only truly safe
solution.
-- Tom
--
http://mail.python.org/mailman/listinfo/python-list
es).
> --S
That's not a bad idea. Another nice feature is support for callable
"default" values; it would make several new things easier, including
raising an exception when you really want that (i.e. if not finding a
single element is truly exceptional).
-- Tom
--
http://mail.python.org/mailman/listinfo/python-list
Ryniek90 wrote:
I've just finished reading a sort of beginner Python book, and I know
quite a bit now but I'm looking for a book that can teach me advanced
aspects of Python - code optimisation, threading, etc.
Any recommendations?
Cheers.
Check those link:
http://www.amazon.com/Beginni
Thanks!, but I already thought of your suggestion. I've already gotten
the clear impression
that the amount of work to implement this is more than the ROI.
Having said that, it might work if on exiting the app could re-zip itself.
One _big_ problem with zip files or compiled python executables
way of doing this beautifully :)
Many thanks. Tom.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the reply Ian,
I've looked in to the bin-packing problem in a general sense now, and I
think my ugly algorithm is actually not too bad (although not too
efficient either!) :)
It was only for a quick job any how.
Thanks again. Tom.
On 24/11/10 16:16, Ian Kelly wrote:
O
rn as '(spa|m)*'. But
what i neglected to mention above is that i'm actually generating patterns
from structures of objects (representations of XML DTDs, as it happens),
and as it stands, patterns like this are a possibility.
Any thoughts on what i should do? Do i have to bite the bulle
sted.
If this is an excercise in just trying to do a straight port of your
program, and you're not interested in doing it in a nicer fashion, then
I would see the simple response from Carl Banks, however, you should
really have posted the python code you're trying instead!
Cheers.
for any
other Python IDE I've tried.
Does Wing do better in mod_wsgi? Is it time for me to migrate from
mod_python to mod_wsgi?
Has anybody tried to do this (mod_wsgi and apache) in a Windoze environment?
Thx,
Tom S.
--
Tom Stambaugh
63 Boston Ave
Somerville, MA 02144
617-776-8934 (land
Hi all~
My script can't work.I've changed my defaultencoding from 'ascii' to
'utf-8',but Python also raises a 'UnicodeEncodeError' error.
the error likes this:
>>> s=u'La Pe\xf1a'
>>>print s
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position
5: ...
And in my script, the
t.
Is there any way to do something semantically the same as this with python?
Cheers
Tom
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Apr 7, 2010 at 4:10 PM, geremy condra wrote:
> On Wed, Apr 7, 2010 at 10:53 AM, Tom Evans wrote:
>> [ Please keep me cc'ed, I'm not subscribed ]
>>
>> Hi all
>>
>> I've written a bunch of internal libraries for my company, and they
>&
6f8b2513941d0f4/6d77c3d4ebd0e919?lnk=gst&q=python+3#6d77c3d4ebd0e919
Thanks,
-Tom
--
http://mail.python.org/mailman/listinfo/python-list
from .. import module
or
from ..module import foo
this is intended for use within packages.
see
http://www.python.org/dev/peps/pep-0328/
also search for
python relative import
- tom
Nathan Huesken wrote:
Hi,
Is it somehow possible to import modules from *.py files in a higher
level
On Jul 17, 11:11 am, Emmy Noether wrote:
> Well, there is a lot of resistance from the emacs community in sharing
> information. Richard Stallman is a true STALLER of progress. He has
> held the whole process hostage by not sharing information. He has
> RENEGED on his promise to make it truly ope
Tom Calhoon
(714) 834-6632
--
http://mail.python.org/mailman/listinfo/python-list
Greetings,
I want a debugging function with the effect of the function below (in a
seperate module):
def dump(expr):
print expr, '=', eval(expr)
foo = 33
dump('foo')
Of course this fails when called from another module because eval does not
know the globals or locals of the caller. Is the
; # capitalize 'usage'
2. change "optional arguments:"
to "Optional arguments:" # capitalize 'Optional'
Does anyone know how to do it without modifying source code?
Thanks,
-Tom
Thomas M. Browder, Jr.
Niceville, Florida
USA
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 10, 8:41 am, Ulrich Eckhardt wrote:
> I need to pack a floating point value into a vector of 32-bit unsigned
> values in IEEE format. Further, I maintain a CRC32 checksum for integrity
> checking. For the latter, I actually need the float as integral value.
...
> What I'm wondering is wheth
thing other reason? Seems like a good fit for the
collections module. Can anyone shed some light?
Thanks.
--
Tom
--
http://mail.python.org/mailman/listinfo/python-list
I wonder if the OP is trying to find out whether python programmes can
be compiled and run as stand alone executables.
(I know assembly and machine code are not the same, but it might be
what they're after.)
On windows you can use http://www.py2exe.org/ to bundle python
programs into stand alone
will learn which names to avoid, but it's a bit of a
pitfall early on.
Cheers,
Tom
2009/7/9 Richard Brodie :
>
> "Nick" wrote in message
> news:e54c4461-c0b7-42fb-8542-cefd7bf5f...@h18g2000yqj.googlegroups.com...
>
>> file = open(prefix1)
>> text = file.read
Maybe the IDE is the best place to warn you of something like that.
You could have an IDE where you specify which language you're more
familiar with and then have it display warnings likely to be relevant
to you. People could collaborate to add support for gradually more
niche languages.
Python
o C and vice versa. And do so
reliably. Where are they? Show me perfect machine translation and then
we can maybe stop bothering about other languages.
[1] http://en.wikipedia.org/wiki/Unicode_Mathematical_Operators
--
Tom Morris
<http://tommorris.org/>
--
http://mail.python.org/mailman/listinfo/python-list
tely decode all strings in sys.argv[] with something
like sys.argv = [string.decode(sys.stdin.encoding) for string in sys.argv]?
2) Can something similar be done to anything returned by raw_input()?
Thanks,
Tom
--
http://mail.python.org/mailman/listinfo/python-list
NPATH and LD_LIBRARY_PATH, but python2.7 is my
default python.
I guess my next step will be to manually remove python 2.7 unless I
hear some solutions soon.
Thanks,
-Tom
Thomas M. Browder, Jr.
Niceville, Florida
USA
--
http://mail.python.org/mailman/listinfo/python-list
ere to take it next, I'd really appreciate it.
Thanks a lot,
Tom
--
http://mail.python.org/mailman/listinfo/python-list
, this kind of coding is absolutely fine, but it makes things harder
to read and doesn't really save much space. I wouldn't recommend using this
kind of style yourself, at least until you're more familiar with programming
in Python.
Tom
On 29 September 2010 11:42, Tracubik wrote:
I'm attempting to write a library for reading data via USB from a
device and processing the data to display graphs. I have already
implemented parts of this code as pure python, as a proof of concept
but I have now moved on to implementing the functions in a C
extension.
My original plan was to ha
d; some will simply set
> it aside for the next allocation.
> Another possible (and related) issue is memory fragmentation. Again, it
> depends on the memory allocator.
Yes, I know that's the case but the "freed" memory should be used for
the
next allocation, or atleas
the PYCObject's destructor, the pointer is for the constant
"foo", not the memory I initially allocated.
I only posted this to help people searching, sorry for the noise.
Tom Conneely
--
http://mail.python.org/mailman/listinfo/python-list
ibuteError: 'int' object has no attribute 'append'
your creating a 1d list
this creates a 2d list
a=[[[]]*5
>>> [0]*5
[0, 0, 0, 0, 0]
>>> [[]]*5
[[], [], [], [], []]
- tom
--
http://mail.python.org/mailman/listinfo/python-list
d d ". This will obviously overflow the PLC and cause a reset.
Any ideas?
Regards,
- - Todd
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.16 (GNU/Linux)
iEYEARECAAYFAkzAnQUACgkQwnknPuQqPIOx6QCgjNP/S/dODwO/c7xk8xKZk1A7
IMQAniGKd5yaqRo3nAmHJJsrkEP6iL/j
=aH+4
-END PGP SIGNATURE-
wh
d d ". This will obviously overflow the PLC and cause a reset.
Any ideas?
Regards,
- - Todd
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.16 (GNU/Linux)
iEYEARECAAYFAkzAnQUACgkQwnknPuQqPIOx6QCgjNP/S/dODwO/c7xk8xKZk1A7
IMQAniGKd5yaqRo3nAmHJJsrkEP6iL/j
=aH+4
-END PGP SIGNATURE-
wh
"datafile" relative to where the executable (made by
py2exe) is installed. Then I could detect the operating system, and choose
appropriately.
To be that explicit seems undesirable. Any cleverer ideas?
Tom
(Please CC me on replies: I'm not subscribed. The From address is munged)
-
Larry Bates wrote:
> Tom E H wrote:
>> My Python application includes some data files that need to be accessed
>> by modules I distribute with it.
>>
>> Where can I put them, and how should I arrange my code, so that it works
>> across platforms?
>>
> I a
system you are running on?
Tom
--
http://mail.python.org/mailman/listinfo/python-list
Why is the Windows msi install file for ActivePython-2.4.3.12 only 15MB
whereas the older msi file for ActivePython-2.4.2.10 was 19MB?
BTW, is that the prefered Python environment?
--
Reply in group, but if emailing add another
zero, and remove the last word.
--
http://mail.python.org/mailm
Trent Mick <[EMAIL PROTECTED]> typed
in news://[EMAIL PROTECTED],
> Tom Del Rosso wrote:
>> Why is the Windows msi install file for ActivePython-2.4.3.12 only
>> 15MB whereas the older msi file for ActivePython-2.4.2.10 was 19MB?
>>
>> BTW, is that the prefere
[EMAIL PROTECTED] <[EMAIL PROTECTED]> typed
in news://[EMAIL PROTECTED],
> Maybe the OP is refering to PythonWin editor (as compared to IDLE)
> which is in ActiveState's release but not in the Python.org release...
> makes for a very different subject, and hopefully for very different
> answer dir
Thanks very much guys.
--
Reply in group, but if emailing add another
zero, and remove the last word.
--
http://mail.python.org/mailman/listinfo/python-list
Can someone suggest where to get a version of Gnuplot.py (for Windows) that
has been updated to use numpy? Or, is there another interface available to
use GnuPlot from Python?
Thanks.
Tom
--
View this message in context:
http://www.nabble.com/Update-of-Gnuplot.py-tp14710180p14710180.html
corrected? I really need to use this application
Thank you in anticipation for a quick response
Best Regards,
Tom
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
Virus-free.
www.avast.com
<https:
ated to my use
of the thing I borrowed it from? Is this cargo cult advice (sometimes
the gods need this structure, and so to please the gods it must be
everywhere), sensible belt and braces or needless overkill?
Cheers
Tom
[1]
http://pythonextensionpatterns.readthedocs.io/en/latest/refcount.htm
a few functions.
Cheers
Tom
--
https://mail.python.org/mailman/listinfo/python-list
WD and automatic transmission are more expensive options
than FWD and manual transmissions, and most cars are FWD and manual.
At least most cars I can afford..
Cheers
Tom
--
https://mail.python.org/mailman/listinfo/python-list
RMAT_PERSISTENT);
into ctypes compatible syntax, when I can simply adapt the working C
code to Python. :)
Plus, there is the library static initialisation to manage, the issues
of distributing the C libraries if I do a C wrapper to call from
ctypes. This way, it can be distributed from our devpi very
I am in a 8 grade coding class at the moment and my teacher asked me to
download a script called pgzero. I can not seem to download pgzer or pygame
when i try it shoots me a error message: ERROR: Command errored out with exit
status 1: command: 'c:\program files\python39\python.exe' -c 'imp
601 - 667 of 667 matches
Mail list logo