guess an issue with this could be the endianess
problem: it would make sense if, when called recursively, struct.pack/unpack
used by the default the endianess specified by the external format string.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
ike a big fat no-op to me; you've done all the heavy lifting
> yourself.
Looks like you totally misread my message. Your string "x" is what I find in
binary data, and I need to *unpack* into a regular Python string, which would
be "abcde".
>
>> idx = s.find(&q
Giovanni Bajo wrote:
> You need struct.unpack() to parse these datas, and you need custom
> packer/unpacker to avoid post-processing the output of unpack() just
> because it just knows of basic Python types. In binary structs, there
> happen to be *types* which do not map 1:1 to Pytho
adjust data, call struct.pack(), return
custom unpacker: call struct.unpack(), adjust data, return
I should have chosen a most complex example probably, but I did not want to
confuse readers. It seems I have confused them by choosing too simple an
example.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
ther board drivers (buf if so,
wouldn't other application start going mad)?
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
he
Python's GC. I have no idea whether this would be considered a bug by Python's
developer, but you can try opening a bugreport...
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
gc.collect()) when you
are done with the allocations.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
elf.
Does this smell "Bitkeeper fiasco" to anyone else than me?
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
selection.
There are many open source applications around. They might not be the best, but
at least they are yours, and not of some third party software vendors with its
own interests.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
y, I don't give a damn about the language the application is coded in, as
long as it is OUR application and not an application of a private company which
we do not own.
Even though you are totally right.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Giovanni Bajo wrote:
>
>> Does this smell "Bitkeeper fiasco" to anyone else than me?
>
> I can't understand why people waste time arguing this stuff.
>
> Use whatever tool is best at it's job... if it's not written in Pyt
s smell "Bitkeeper fiasco" to anyone else than me?
>
> The committee did expect this recommendation to be controversial. :)
I guess :)
In fact, I have a deepest hope that this recommendation was just a fake just to
get people setup a roundup installation...
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
ou could have recommended Roundup *and*
explained there is a need for funding and/or volunteers before the migration
can happen.
You might also be understimating how negative could be the reaction from the
open-source community to such a move.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
CC's
Bugzilla installation is pretty much on its own; Daniel Berlin does some
maintainance every once in a while (upgrading when new versions are out,
applying or writing some patches for most requested features in the
community, or sutff like that), but it's surely not his
ways more strongly typed, so you have to specify a
factory function.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
Lone Wolf wrote:
> reading = ser.read(40)
Simply try ser.readline() here, or maybe ser.readline(eol="\r").
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
>
>> The really sad thing is that I get a perfectly constructed
>> packet from the reading variable, and that gets butchered when I
>> try to slice it up to pick out individual elements. Since
>> pyserial doesn’t do anything to rearrange the data, then the
>> CMUcam must d
python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list.htm
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
;>
>> p = subprocess.Popen("python", stdout=subprocess.PIPE,
>> stdin=subprocess.PIPE)
>> p.stdin.write('print 10\n')
>
> + p.stdin.close()
>
>> assert p.stdout.readline() == '10\n'
Yeah, but WHY was the API designed like this? Why
additional indentation.
for x in ...:
if not x > 0:
continue
... more code ...
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
x27;__reduce_ex__',
'__repr__', '__setattr__', '__str__', 'next']
does not have a __length_hint__ method.
Is this just a missing optimization, or there is a deep semantic reason for
which a __length_hint__ could not be constructed out of the __len__ result?
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
er(A()).__length_hint__()
> 42
>
> Peter
Ah well, actually it's there also in dir(), you just need to use Python 2.5
of course ;)
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
or()
pass
def longFunction(callback):
for i in xrange(10):
# do something
callback(i / 10.0)
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
, it's now at
http://groups.google.com/group/PyInstaller. Join us for discussion!
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
the traceback is. I'd be very glad to fix the problem for you.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
o add it as an additional data file, read the manual about
that. It will be extracted to the runtime directory and you should be able to
access it through _MEIPASS2 (manual should be clear about that). You can't
just read it from the "current directory" because the current directory
gt; search for :for ( i = 0; i < 10; i++)
> Replace with: for( printf( "10" ), i =0; i < 10; i++)
> Where 10 is the line no.
import re
import fileinput
for L in fileinput.input(inplace=True):
pattern = 'printf("%d"),' % input.filelineno()
L
a prerequisite for using Python. So,
while I don't give a damn if those symbols are going to be supported by Python,
I don't think the plain ASCII version should be deprecated. There are too many
situations where it's still useful (coding across old terminals and whatnot).
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
of CPython 2.4 though. I'm not sure which version the
OP was using because he didn't say.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
[D:\Work]python -m timeit -n100 -s "import foo" "foo.iters2(1)"
100 loops, best of 3: 10.9 msec per loop
[D:\Work]python -m timeit -n100 -s "import foo" "foo.iters2(2)"
100 loops, best of 3: 22.2 msec per loop
[D:\Work]python -m timeit -n100
h other solutions like the
ones you propose, but even the "simple" implementation (and most readable and
Pythonic, IMHO) behaves "well" under CPython 2.4.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
d to be fixed for the testcases I
had.
BTW: putting "PyInstaller" in the subject of the mail for PyInstaller-related
mails (and/or mailing to the PyInstaller mailing list) would be preferred to
get a quicker answer.
Thanks!
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
g at the first positional argument, leaving other options unparsed.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
;ArchiveViewer.py
out1.pyz" (ArchiveViewer.py is shipped with Python). It will display a list of
all the packaged modules: in my list, 'encodings.hex_codec' appears.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
l objects as long as they support new __enter__ and __exit__ special
method), so go to the link above for more details and more juicy examples that
I'm sure you'll like.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
gt; import shlex
>>> def extract(s):
... s = s.split("=")[1]
... s = shlex.split(s)[0]
... return s
...
>>> extract("parameter=12ab")
'12ab'
>>> extract("parameter=12ab foo bar")
'12ab'
>>> extract
30 layers of complex abstractions for doubtful benefits and obvious
slowness.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
parsing
(line 1)
>>> calc("type(3).__class__")
Traceback (most recent call last):
File "", line 1, in ?
File "", line 5, in calc
ValueError: error during expression evaluation: name 'type' is not defined
Of course, one can still bring your system to its knees when
"1000**1000"...
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
Ravi Teja wrote:
> Actually, py2exe (from version 0.6.1) onwards does create single file
> exes without ANY additional dependencies.
They still require an external MSVCR71.DLL if made with Python 2.4. PyInstaller
1.1 (to be released today) does not have this problem.
--
Giovanni Bajo
--
ncies (fix provided
by Vikram Aggarwal).
+ (Windows) With Python 2.4, setup UPX properly so to be able to compress
binaries generated with Visual Studio .NET 2003 (such as most of the
extensions). UPX 1.92+ is needed for this.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
s 0, a)
Usa lambda x: x==0 or simply lambda x: x
Using 'is' relies on the interpreter reusing existing instances of the
immutable object '0', which is an implementation detail.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
orld case. You didn't even look at the Python source
code to check if your assumptions were true. Try to check your assumptions
before designing solutions to problems which do not exist. I suggest you start
writing real-world Python before doing so many assumptions.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
made. For instance, wxWidgets is
*HUGE*.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
.3.5 Core +
OpenGL + Table in a single .pyd of 1.2Mb (compressed). You can add to that the
usual Python overhead (around 1Mb compressed), thanks to having those useless
CJK codecs compiled within python24.dll (sigh!).
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
in this direction, I
think it should add standardized support for the "subcommand pattern", that is
the same command line arrangement that CVS, SVN and other programs uses. rpm
doesn't use it and I consider this an error in UI design (it should really have
been "rpm query --changelog" and similar).
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
usage is
> quite simple and flexible. The classics is already referenced by the
> Python docs:
>
> http://www.python.org/doc/essays/metaclasses/Enum.py
Agreed. Allowing subclassing of an existing enum is a strong plus to me.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
specified for that value when constructing the
> enumeration::
>
> >>> gym_night = Weekdays.wed
> >>> str(gym_night)
> 'wed'
What's the repr of an enumeration value? OTOH, it should be something like
"Weekdays.wed", so that eva
e extra performance from their programs.
>
> Good to know. Is there any advanced optimizer for Python code, which
> would do such things for me (or suggest them, like pychecker does
> for readability)?
Prove that a.f() would not change the meaning of "a.f" after its invokation
t which referenced the Boostified C++ instance, e.g.:
Those situations get more and more common as you keep wrapping your code. To
the best of my knowledge, SIP is the only one which does the right thing here.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
is is pretty complicate, and there's much
confusion (Google turns up red herrings). This package handles everything for
you, and it just works.
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com
--
http://mail.python.org/mailman/listinfo/python-list
ree
alternative, it might be worth to give it a go :)
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
1.DLL
problem. It was announced on this very list a few days ago:
http://www.develer.com/oss/GccWinBinaries
Feedback is welcome!
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
into "libmsvcr60.a", and "libmsvcrtd.a"
into "libmsvcr60d.a". After that, it should just works.
Let me know if it works for you, so that I can report results on the webpage.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
to run it anyway. You can try by simply
invoking "gcc -v" at the MSYS prompt and see if it's picking up the right
version of GCC.
I would appreciate if you give some feedback about this. I would like to
incorporate your findings on the webpage.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
MSVCRT_VERSION__ is being set correctly.. that is something gccmrt
should eventually take care of, but for this specific _ctype problem you
probably need to submit a patch to mingw-runtime.
I can guide you through it though... I don't have much time in these days
though.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
oved this work-around.
And by the way, this is also a FAQ:
http://effbot.org/pyfaq/why-does-my-c-extension-suddenly-crash-under-2.5.htm
and even explained in the Misc/NEWS of Python 2.5.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
ition to develop a software, and then
buy the commercial edition only the day before you want to release it as non
open-source. I can't even understand how they can even try to support such a
nonsense position. You're free to develop your software for years as GPL
without distributing it, and then relicense your own code whenever you want.
They're obviously just trying to scare people. ]]
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
ter searching for the file I found it in the C:\Qt\4.2.2\bin
> directory. I copied the dll to the windows dir just to run in to the
> next missing dll error (QtCore4.dll) which is also located in the same
> directory. What have I missed? I've been trying to install QT for 6
&g
# fast on initial miss, but slow on
> non-misses; works for any constant
>
> The itertools.repeat(const).next approach wins on speed and
> flexibility.
But it's the most unreadable too. I'm surprised that defaultdict(int) is
slower than the lambda one though. What's the
a py
> 2.5 problem.
> I'm right? or I have to compile it with something other switches?
Make sure -fno-strict-aliasing is specified. Python does not conform to ISO C
type aliasing rules.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
f doing it? (Yes, it sucks).
Shouldn't Python automatically alias whatever is returned by
locale.getpreferredencoding() to "mbcs", so that my original code works
portably?
Thanks in advance!
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
;>> min(L, key=lambda a:a.x) is L[0]
True
>>> min(L, key=lambda a:a.x) is L[3]
False
Is this guaranteed by the Python language formal specification?
Is this guaranteed to always by true in CPython? (I guess so)
I can't find any mention in the documentation.
--
Giovanni Bajo
--
tems() vs c.elements(). Items and
elements are synonymous (again, in my understanding of English).
All in all, I think I prefer your previous bag class:
http://code.activestate.com/recipes/259174/
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com
--
http://mail.python.org/mailman/listinfo/python-list
On 1/23/2009 2:49 AM, Chris Rebert wrote:
On Thu, Jan 22, 2009 at 5:41 PM, Giovanni Bajo wrote:
On Thu, 22 Jan 2009 10:11:37 -0800, Raymond Hettinger wrote:
The collections module in Python 2.7 and Python 3.1 has gotten a new
Counter class that works like bags and multisets in other
On Tue, 03 Jun 2008 08:35:37 +0200, Mark Delon wrote:
> Hi,
>
> I need to generate single EXEcutable via PyInstaller. It will be
> genereated -> i get one single executable.
>
> AFTER CALL (exe) I get an error: "no module named _gt"
>
> Build command:
> 1. Configure.py
> 2. Makespec.py -F
= k.read()
ret = k.close()
if ret is None:
return out
raise LaunchError(ret, cmd, out)
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
h1b', 'FOO blah2', and 'FOO blah3a blah3b blah3b'.
> [...]
> Can someone suggest a regular expression which will return
> groups corresponding to the FOO substrings above?
FOO.*?(?=(?:FOO|$))
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
#x27;t need to worry about
> other OS's.
If I were you, I would write a Pyrex 4-liners which exposes this structure to
Python in the way you prefer. This would immediately fix all these
compatibility issues.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
Jonathan Ellis wrote:
> ... which, of course, goes to show how stupid a metric this is, now
> that even Ian Bicking has admitted that SqlObject in its current form
> is a dead end.
Got a pointer?
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
27;s an april's joke, please? :)
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
sume that the only use-case of range() is within a for-loop.
range() is a builtin function that can be used in any Python expression. For
instance:
RED, GREEN, BLUE, WHITE, BLACK = range(5)
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
If you provide me with a
complete bugreport (on the pyinstaller list, or as a ticket in the pyinstaller
bug system) I might have a look. Alas, I have little time to spend on
PyInstaller at the moment, but I'm eventually going to tackle this.
--
Giovanni Bajo
--
http://mail.python.org/mailman/listinfo/python-list
doc/CHANGES.txt
=== Feedback ===
We're eager to listent to your feedback on using PyInstaller:
Ticketing system: http://www.pyinstaller.org/newticket
Mailing list: http://groups-beta.google.com/group/PyInstaller
--
Giovanni Bajo :: Develer S.r.l.
ra...@develer.com :: http://w
101 - 173 of 173 matches
Mail list logo