> Therefore, Windows has a "trick" for mark the file like visible, or not,
> in 32 mode. What trick?
It's called file system redirection. When you access \windows\system32
in a 32-bit process, you *actually* access \windows\syswow64, which
has entirely different files.
The same also happens for p
Am 31.08.2011 03:43, schrieb Travis Parks:
> I am writing a simple algorithms library that I want to work for both
> Python 2.7 and 3.x. I am writing some functions like distinct, which
> work with dictionaries under the hood. The problem I ran into is that
> I am calling itervalues or values depen
Am 03.03.2011 07:58, schrieb Gregory Ewing:
> What is the recommended way to write code for 2.7 using
> maketrans() on text strings in such a way that it will
> convert correctly using 2to3?
That depends on how you chose to represent text in 2.7.
The recommended way for that (also with 3.x in mind
Am 06.03.2011 12:18, schrieb Alex Willmer:
> On the English version of http://python.org I'm seeing 下载 as a menu
> item between Download and Community. AFAICT it's Simplified Chinese
> for 'download'. Is it's appearance intentional, or a leak through from
> a translation of the entire page?
It's i
It's intentional. Notice that it goes to a different URL than the
English download link.
Which is a synonym for the English download link (/getit is /download at
present)
Perhaps a translated page is planned?
No, translation is not the motivation at all.
Chinese readers will know when to u
> Could it be a problem with the operation system? Is it possible that an
> os.stat call requires 100% CPU power from the OS? Or is it a problem
> with the Python implementation?
There is a chance that the CPU usage actually comes from the thread
doing sleep(). If you have a very short sleep time,
> Is there a way to keep things (almost) as simple as this using the
> 'Capsules' ??
Most certainly. Instead of PyCObject_FromVoidPtr, use PyCapsule_New.
Either pass NULL as a name, or the class name for additional
type-safety. Instead of PyCObject_AsVoidPtr, use PyCapsule_GetPointer.
The only di
Am 24.03.2011 04:19, schrieb Miki Tebeka:
> Greetings,
>
> My company want to distribute Python packages internally. We would like
> something like an internal PyPi where people can upload and easy_install from
> packages.
>
> Is there such a ready made solution?
> I'd like something as simple
> The cmp argument doesn't depend in any way on an object's __cmp__
> method, so getting rid of __cmp__ wasn't any good readon to also get
> rid of the cmp argument
So what do you think about the cmp() builtin? Should have stayed,
or was it ok to remove it?
If it should have stayed: how should it
> import ssl
> ssl.OPENSSL_VERSION
>
> is there a way that this can be done in python2.4? It's annoying but I
> need to support python2.4 for a while yet :-(
ldd /usr/lib/python2.4/lib-dynload/_ssl.so
[...]
libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0x7f6a5a9b7000)
[...]
HTH,
Marti
> I have a vague memory of reading somewhere that it's possible to
> replace the Python memory allocator. This would be an option, if
> there's no simple way to say "your maximum is now 16MB", but I now
> can't find it back. Was I hallucinating?
You can adjust the implementations of PyMem_Malloc a
Am 07.04.2011 02:06, schrieb Chris Angelico:
> On Thu, Apr 7, 2011 at 6:38 AM, Martin v. Loewis wrote:
>> You can adjust the implementations of PyMem_Malloc and PyObject_Malloc.
>> This would catch many allocations, but not all of them. If you adjust
>> PyMem_MALLOC instead
Am 13.04.2011 10:17, schrieb Nathan Coulson:
> Well, as the subject says, I am looking to find libpython31.a
> [win64bit version] for use in a linux to windows 64bit cross compiler
> [x86_64-w64-mingw32-gcc], but seems to be missing.
I wouldn't call it "missing", but "just not there". I had no
i
>> be expanded to
>>
>>_temp = expr
>>if _temp: return _temp
>
> This could be simplified to just:
>
> return expr or None
> """
No, it can't be simplified in this way.
If there is code after that snippet, then
it will get executed in the original version if _temp is
false, but won't get
Am 18.04.2011 09:59, schrieb Werner F. Bruhin:
> On 04/17/2011 11:57 PM, "Martin v. Löwis" wrote:
>>
>> http://www.python.org/2.5.6
> Just FYI, getting a 404 error on the above.
Thanks. There had been a number of glitches which have been
corrected. If anything looks still incorrect, please le
> Thanks Martin, I'm glad these older releases are still getting important
> fixes.
>
> I notice http://www.python.org/download/releases/2.5.6/NEWS.txt says the
> release date was 17 Apr 2010. Presumably that should have said 2011.
Thanks for pointing it out. I fixed it in the repository, so it
> I tried to create another 2.7 key but regedit wouldn't let me.
> So, if I can only have one 2.7 key, it would seem that the routine
> GetPythonVersions will only ever get 1 version of 2.7.
> Does this mean that it is unsupported to have more than one Python 2.7
> installation on Windows?
Exactly
Am 23.04.2011 14:16, schrieb Disc Magnet:
> Is PEP necessary to add a new package to the standard library?
A PEP is necessary if the proposed change is contentious. If there is
widespread agreement that the change is desirable, no PEP is needed.
> What if the community just wants to add a new mod
Am 27.04.2011 12:43, schrieb est:
> Hi guys,
>
> I need to ship python runtime environment package on Windows, if I
> want to stripping unnessasery functions from python27.dll to make it
> as small as possible(and perhaps finally UPX it), which parts of
> python27.dll do you think can be removed?
> But how could i do this in Windows.
It's not supported. Hopefully, it will be supported in Python 3.3,
due to PEP 393.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> I have vague recollections that pythonXY.dll could not be statically
> linked on Windows, or that doing so causes some serious loss of
> functionality. Was this ever true, and is it still?
You'll have to rebuild Python to make use of static linkage, of course,
but then: it is certainly possible
> On the CJK issue, why python ship its own codec, not using OS builtin?
The OS doesn't provide all the codecs that Python provides. For the one
it does provide, it behaves semantically different in border cases from
the ones that come with Python.
> If I don't need the full Unicode5.1 can I just
> Is it just that nobody's implemented it, or is there a good reason for
> avoiding offering this sort of thing?
I've been considering to implement killing threads several times for the
last 15 years (I think about it once every year), and every time
I give up because it's too complex and just not
> Thus my Python script dies a horrible death:
>
> File "./update_db", line 67, in
> for line in open(tempfile, "r"):
> File "/usr/local/lib/python3.1/codecs.py", line 300, in decode
> (result, consumed) = self._buffer_decode(data, self.errors, final)
> UnicodeDecodeError: 'utf8' code
> For example, initerrno should now be PyInit_errno. Am I missing something?
No; freeze hasn't been ported to Python 3 yet. Contributions are welcome.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> In addition to Ned Deily's previous comments, I'd like to note that 2to3
> assumes the source is valid 2.6 code - you have to ensure the code runs
> fine with Python 2.6 before using 2to3 to convert to 3.x
That's wrong - 2to3 works just fine on, say, 2.3 code that has never
been run on 2.6.
Reg
> I'm stuck on the "PGP Key ID". When I whip out my trusty Ubuntu and run
> pgp -kg, I get a 16-digit "DSA / EIGamal" key.
>
> When I enter it into http://pypi.python.org/pypi?%3Aaction=register_form
> , I get a helpful "PGP Key ID is invalid".
>
> Should I try a key of some other algorithm?
If
>> The key ID should be an eight-digit string, such as EA5BBD71 (i.e. a
>> 32-bit key ID).
>
> pretend I was someone who had never ever used PGP before.
>
> pgp -kg, then what?
I don't have pgp, only gpg. In gpg --list-keys, it's the 32-bit ID
that gets listed. Try -kv.
If you have never used P
> Any tips?
A binary distribution won't have a setup.py, because
you can install it by other means (such as Windows Installer),
instead of running setup.py
What you want is a source distribution (sdist).
Even if you want to create a binary distribution, don't use the
bdist command, but some spec
Phlip wrote:
>> What you want is a source distribution (sdist).
>
> Thanks. Yes, this is prob'ly documented somewhere.
>
> Now my next problem - how to get pypi.python.org to stop burning up
> version numbers each time I test this?
I don't speak English well enough to understand what "to burn up
> FYI, my experience is that an entire manifest must be distributed. As
> the manifest in question actually lists 3 DLLs, IIUC, you must ship all
> 4 files - the 3 DLLs and the manifest, even if only one of the DLLs is
> actually used.
You don't actually need to include all three DLLs. Just inclu
> Does anyone have any recommendations on which version of the
> MSVC?90.DLL's need to be distributed with a Python 2.6.4 PY2EXE (0.6.9)
> based executable?
You'll need to include Microsoft.VC90.CRT.manifest and msvcr90.dll.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> Thank you for your answers. From my research and testing on this topic:
Unfortunately, I can't answer these questions for py2exe. In principle,
it would hope that it is possible to include the DLLs *in* the
executable, if the py2exe mode is used where it includes all DLLs.
Regards,
Martin
--
h
Миклухо wrote:
> Hi, all. My problem is:
> 1) I have a database(postgresql)
> 2)I'm getting some string from database(string is a classname -
> written by me).
> 3)I need to construct new object from this string.
> In java it's done by Class.forName().newInstance();
>
> For instance:
> 1)I receive
>> name2class = { "MyObject" : MyObject,
>>"MyOtherObject" : MyOtherObject,
>>"Etc" : Etc }
>>
>> Then, when you receive the string class_name, you do
>>
>> o = name2class[class_name]
>> o.myfunction()
>>
> The class needs to be instantiated, so the one line should b
>> However, this takes a few seconds to run. Is there a sensible way for
>> me to only run this if the required DLL is not already installed? How
>> should I be detecting that?
Look at windows\winsxs\
>> Also: Will this work on 64 bit machines? Or do I not need to worry
>> about that?
If you shi
Peng Yu wrote:
> I observe that python library primarily use exception for error
> handling rather than use error code.
[...]
> It says "Another popular design flaw—namely, throwing exceptions for
> expected outcomes—also causes inefficiencies because catching and
> handling exceptions is almost al
> You do understand that exceptions aren't just for errors? They are raised
> under specific circumstances. Whether that circumstance is an error or
> not is entirely up to the caller.
I think that's a fairly narrow definition of the word error, and
probably also the source of confusion in this
> I mentioned an "exception stack" above, though I'm not 100% sure if that is
> the proper term. I think that exceptions can be stacked upon each other
> (e.g. an HTTPD throwing a high-level RequestError when it encounters a low-
> level IOError) and that that is also how the backtrace is implem
> For my own interest, I want understand the run time behavior of python
> and what details causes it much slower. Although people choose python
> for its programming efficiency, but sometimes the runtime still
> matters. This is an important aspect of the language. I'm wondering
> this is not even
>> 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 recommend to rewrite this like so:
def first(gen):
try:
return gen.next()
except StopIteration:
raise ValueError, "No first value"
foo = first(foo for foo in
> I'm asking about why the behavior of a StopIteration exception being
> handled from the `expression` of a generator expression to mean "stop
> the loop" is accepted by "the devs" as acceptable.
I may be late to this discussion, but the answer is "most definitely
yes". *Any* exception leads to t
> I can do xmlrpc over ssl WITHOUT certificates with following code:
>
> import xmlrpclib
> server_url = 'https://myserver'
> server = xmlrpclib.Server(server_url);
>
>
> and I can perform a https get request WITH certificates with below snippet:
>
> import httplib
> conn = httplib.HTTPSConnect
> My next task is how to find out at the client side, that the server
> certificate is a properly signed one.
As Heikki says, you'll need Python 2.6 for that. You'll probably need to
extend your transport implementation.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> First of all, is the Windows FAQ fairly up to date?
Fairly, yes.
> Should people be
> referring to section 6 if they are going to build an application with
> an embedded Python interpreter?
I think that's very selective in its view of problems - why would I
be using SWIG, for example? (yet the
> In Python 3.1 is there any difference in the buffering behavior of the
> initial sys.stdout and sys.stderr streams?
No.
> Were they different at some earlier point in Python's evolution?
That depends on the operating system. These used to be whatever the
C library set up as stdout and stderr.
> I've been playing with "Lua" and found something really cool that I'm
> unable to do in "Python". With "Lua", a script can be compiled to byte
> code using "luac" and by adding "#!/usr/bin/lua" at the top of the
> binary, the byte code becomes a single file executable. After I found
> this trick,
> This works great! Do you or anyone else have information on how to do
> the same thing for Windows and/or Solaris.
On Windows, just associate the .pyc extension with Python - the standard
installation will already do that.
On Solaris, I don't think something like this is supported.
Regards,
Ma
> This ought to be a bug; objects that compare equal and are hashable
> must have the same hash code.
It's not a bug. Changing the default encoding is not really supported,
let alone changing it to anything but latin-1, precisely for the reasons
you discuss.
If you do change the default encoding,
> Thanks to all of you. This once again proves how deep you can get
> yourself into a mess if you mix unicode and string objects in your
> code!
The specific issue is that you apparently changed the default encoding.
Don't do that, Python will break if you do.
Regards,
Martin
--
http://mail.pyth
>>> This ought to be a bug; objects that compare equal and are hashable
>>> must have the same hash code.
>> It's not a bug. Changing the default encoding is not really supported,
>> let alone changing it to anything but latin-1, precisely for the reasons
>> you discuss.
>>
>> If you do change the
> never mind. just discovered that while "python3 -V" won't do it,
> executing it gives me:
>
> $ python3
> Python 3.2a0 (py3k:77609, Jan 19 2010, 04:10:16)
> ...
>
> and it's that 77609 rev number i was after.
If you want that in a command line fashion, do
python -c 'import sys;print(sys.su
> Python has had
> previous major changes in the past (e.g. 1.5 to 2.0 and 2.1 to 2.2) and
> hardly anyone made a complaint.
I think this is actually false for the switch from 1.5 to 2.0. People
complained a lot, and announced that they won't switch to Python 2 in
any foreseeable future, and ind
> Well, I'd consider that an official release. Note that I didn't claim
> there was no hope PSF wouldn't change it's mind on 2.8.
I'd like to point out that the PSF formally doesn't have any say in
this.
Instead, releases are created by the release manager, who gets appointed
by Guido van Rossum
> Why do I feel like there's less of an onus on Unladen Swallow to
> _actually prove itself in substantial real world usage_ before
> integration into CPython than there is on even the smallest of modules
> for inclusion in the standard library?
Because it's a VM change, not an end-user change. VM
Christian Heimes wrote:
> Blog wrote:
>> WTF? Where'd you hear about version 2.8? FRI, 2.7 is and will be THE
>> LAST version of the 2.x series - "the" End-Of-Life for Python 2
>
> Where do you get your information from?
It was discussed repeatedly on python-dev, last time when the release
anno
> Naming files using magic numbers is really beyond me. The fact that the
> above needs comments to explain what's what already shows to me that
> there's a problem with this naming scheme. What if for one reason or
> another I want to delete all pyc files for Python 2.5? Where do I look
> up the m
> True. You might also want to note that "Python 2.6 -U" appears to have a
> different magic number from "Python 2.6" and "Python 2.6 -O".
>
> I don't know whether they always change for each new version.
Here is a recent list of magic numbers:
Python 2.6a0: 62151 (peephole optimizations a
> In Python 2.6 I can't socket.recv_into(a byte array instance). I get a
> TypeError which complains about a "pinned buffer". I have only an
> inkling of what that means.
A pinned buffer is one that cannot move in memory, even if another
thread tries to behind your back. Typically, resizable conta
Antoine Pitrou wrote:
> Le Mon, 01 Feb 2010 03:30:56 +0100, Martin v. Loewis a écrit :
>>> Is this a bug in Python 2.6 or a deliberate choice regarding
>>> implementation concerns I don't know about?
>> It's actually a bug also that you pass an array; doing so
> Clearly it was added to work with an array, and it's
> being used with an array. Why shouldn't people use it
> with Python 2.x?
Because it's not thread-safe; it may crash the interpreter if used
incorrectly.
Of course, if you don't share the array across threads, it can be safe
to use.
Regards
> floor(x) returns an integer
Why do you say that? Assuming you are talking about math.floor, it works
differently for me:
py> math.floor(10.0/3)
3.0
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> CELL_SIZE = 4
>
> def key(point):
>
> return (
> int((floor(point[0]/CELL_SIZE))*CELL_SIZE),
> int((floor(point[1]/CELL_SIZE))*CELL_SIZE),
> int((floor(point[2]/CELL_SIZE))*CELL_SIZE)
> )
>
>
> Since python allows keys to be tuples, I think that this should wor
lallous wrote:
> Hello
>
> How can I do something similar to pure virtual functions in C++ ?
See, for example
http://code.activestate.com/recipes/266468/
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
>> class C1:
>>
>> # Pure virtual
>> def cb(self, param1, param2):
>> """
>> This is a callback
>>
>> @param param1: ...
>> @param param2: ...
>> """
>> raise NotImplementedError, "Implement me"
>>
>> # Dispatcher function that calls '
> How one could create 32-bit Python run-time enviroment, preferable
> virtualenv, on 64-bit Linux (VPS), reducing memory usage?
I'd install a 32-bit Linux on the hardware, and install a bigmem kernel
if it has more than 3GB of main memory.
> I assume this involves having lib32 libs and compiling
>> That's not true. Currently, the hasattr() call would report that cb is
>> available, when it is actually not implemented. It would be possible to
>> do something like
>>
>> if hasattr(c, 'cb') and not is_pure(c.cb):
>> c.cb("Hello", "World")
>>
>> is_pure could, for example, look at a fu
John Nagle wrote:
>I know there's a performance penalty for running Python on a
> multicore CPU, but how bad is it? I've read the key paper
> ("www.dabeaz.com/python/GIL.pdf"), of course. It would be adequate
> if the GIL just limited Python to running on one CPU at a time,
> but it's worse t
> It's far from scientific, but I've seen behaviour that's close to a 100%
> performance penalty on a dual-core linux system:
>
>http://www.rfk.id.au/blog/entry/a-gil-adventure-threading2
>
> Short story: a particular test suite of mine used to run in around 25
> seconds, but a bit of ctypes
> I can create ASCII strings containing byte values between 127 and 255.
No, you can't - or what you create wouldn't be an ASCII string, by
definition of ASCII.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> I don't know how to solve this problem and I am looking forward for
> help.
Try running "python setup.py install" directly, after downloading and
unpacking the package.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
>> I have a Windows 7 (64bit AMD) machine
This is somewhat imprecise: is it
a) that your CPU is AMD64, and thus supports 64-bit mode, or
b) that *in addition*, your Windows 7 installation is a 64-bit
installation, or
c) that *in addition*, your Python installation is also a 64-bit
installation
> I’m sorry everyone. I didn’t realise I had installed the 64-bit
> version of Python. Well, at least someone else might find have the
> same problem. But I think that there is going to be a bit of a rough
> patch as everyone moves over to 64-bit.
Expect that move to take a few more years. 64-bit
>> Can somebody explain what happens when I put non-ASCII characters into a
>> non-unicode string? My guess is that the result will depend on the
>> current encoding of my terminal.
>
> Exactly right.
To elaborate on the "what happens" part: the string that gets entered is
typically passed as a b
Michael Rudolf wrote:
> Am 12.03.2010 21:56, schrieb Martin v. Loewis:
>> (*) If a source encoding was given, the source is actually recoded to
>> UTF-8, parsed, and then re-encoded back into the original encoding.
>
> Why is that?
Why is what? That string literals get reen
nn wrote:
>
> Stefan Behnel wrote:
>> nn, 23.03.2010 19:46:
>>> Actually what I want is to write a particular byte to standard output,
>>> and I want this to work regardless of where that output gets sent to.
>>> I am aware that I could do
>>> open('nnout','w',encoding='latin1').write(mychar) but
> Is anyone else having trouble with the 2.6.5 Windows x86 installer?
Not me. Run
msiexec /i py...msi /l*v py.log
and inspect py.log for errors (post it to bugs.python.org if you can't
determine the cause of the problems).
Are you using SUBST by any chance?
Regards,
Martin
--
http://mail.pyth
> WindowsError: [Error 14001] The application has failed to start
> because its side-by-side configuration is incorrect. Please see the
> application event log for more detail
This is a configuration error on your system. The application you are
trying to start is incorrectly installed - it's not
Christopher Roach wrote:
> I have a script that I am working on to process a bunch of data. A
> good portion of the Tk-based GUI is driven by a large set of YAML data
> and I'd love to store that data inside of the script so that I can
> send just a single file to my colleague. Ruby has a mechanism
> Thanks for the confirmation Martin!
>
> Do you think, it the mentioned omission of the character names of some
> CJK ranges in unicodedata intended, or should it be reported to the
> tracker?
It's certainly a bug. So a bug report would be appreciated, but much
more so a patch. Ideally, the pat
Am 22.11.2010 22:43, schrieb Martin Lundberg:
> Hi,
>
> I want to be able to let the user enter paths like this:
>
> apps/name/**/*.js
>
> and then find all the matching files in apps/name and all its
> subdirectories. However I found out that Python's glob function
> doesn't support the recursi
> Occurrence of search term weighted by field (name, summary, keywords,
> description, author, maintainer)
>
> I thought PyPI used to offer a 'kwality' score for packages, based on
> the presence of installers, doc files, tests etc. Does anyone know
> what happened to that?
There was indeed a kwa
> Does anyone know what I need to do to read filenames from stdin with
> Python 3.1 and subsequently open them, when some of those filenames
> include characters with their high bit set?
If your files on disk use file names encoded in iso-8859-1, don't set
your locale to a UTF-8 locale (as you app
> The world does not revolve around Python. Unix filenames have been
> encoding-agnostic long before Python was around. If Python3 does not
> support this then it's a regression on Python's part.
Fortunately, Python 3 does support that.
Regards,
Martin
--
http://mail.python.org/mailman/listinf
> This sounds like a strong prospect for how to get things working (I
> didn't realize open would accept a bytes argument for the filename),
> but I'm also interested in whether reading filenames from stdin and
> subsequently opening them is supposed to "just work" given a suitable
> encoding - lik
> result = myfunction (vars)
>
> if not result:
> # error condition
>
> Now above I first realized that the function can also return an empty
> list under some conditions and so changed it to
If your function returns a list when successful, it should not return
False in the error case. Ins
Am 11.12.2010 18:33, schrieb Perry Johnson:
> Python's re module does not support POSIX character classes, for
> example [:alpha:]. It is, of course, trivial to simulate them using
> character ranges when the text to be matched uses the ASCII character
> set. Sadly, my problem is that I need to pro
Am 11.12.2010 23:41, schrieb Peter C.:
> Hello, I am looking at the possibility of making a program in C++. The
> catch is it will require the ability to work with binding for use with
> scripting in both Python 2.x and 3.x for various tool plugins. Is
> there any way to bind a C++ app to work with
>> Python is designed to provide readable code. Writing
>>
>> while True:
>> ...
>>
>> is much more legible than its pre-True couterpart
>>
>> while 1:
>> ...
>
> No argue with that!
I actually want to argue with that: I find "while 1" more legible.
That's probably because
Am 13.12.2010 23:38, schrieb Cristian Consonni:
> Dear all,
>
> I'm not sure this is the right place to point this out, but on this page:
>
> http://www.python.org/download/windows/
>
> It is not mentioned "Windows 7".
>
> Is there some problem with 7 or it is simply an omission?
It's simply a
Am 21.12.2010 22:56, schrieb Luis M. González:
> I wonder if Unladen Swallow is still being considered for merger with
> Python 3.3.
> Is it?
3.2 isn't even released yet, and 3.3 will appear 18 months after it (so
in Summer 2012). It's much too early to tell.
OTOH, to answer you literal question:
> Type "help", "copyright", "credits" or "license" for more information.
9.95
> 9.9493
"%.16g" % 9.95
> '9.949'
round(9.95, 1)
> 10.0
>
> So it seems that Python is going out of its way to intuitively round
> 9.95, while the repr retains the unnecessary digit
>> "Float-to-string and string-to-float conversions are correctly rounded.
>> The round() function is also now correctly rounded."
>>
>> Not sure that this is correct English; I think it means that the
>> round() function is now correct.
>
> Well, the correct result of the example the OP gave woul
Am 30.12.2010 14:52, schrieb crow:
> Hi, I'm writing a test tool to simulate Web browser. Is there anyway
> to run JavaScript in python? Thanks in advance.
See PyV8: http://pypi.python.org/pypi/PyV8
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Am 31.12.2010 08:47, schrieb Aman:
> Hey all... I just started with Python, and I chose Python3 because it
> seemed a subtle choice as compared to doing Pthon 2.x now and then
> porting to Python3.x later... I plan to start with Web Development
> soon... I wanted to know what all web frameworks are
>> To support older Python versions, you need to write your own wrapper
>> functions for bytes literals that do nothing in Python 2 and convert the
>> literal back to a bytes literal in Python 3. That's ugly, but there's no
>> other way to do it.
>
> I think the developers expected that most maint
> 1. Code running in multiple versions has to be syntactically correct in
> every detail all versions in order to be compiled without error.
> However, version specific syntax *can* be used in modules that are
> conditionally imported and therefore conditionally compiled and executed.
I also encou
> What's the right way to get the strings in UTF-8?
This will work. I doubt you can get it much simpler
in 2.x; in 3.x, your code will work out of the box
(with proper syntactical adjustments).
import pprint, cStringIO
class UniPrinter(pprint.PrettyPrinter):
def format(self, obj, context, ma
>> CGI is still used in some places today, hello?
>
> Yeah, James Cameron made a *ton* of money using it to make Avatar.
He used compacted graphite iron in Avatar? I didn't know that.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> Using numpy, I can create large 2-dimensional arrays quite easily.
IIUC (please confirm), you don't need a generic two-dimensional
array, but rather an Nx2 array, where N may be large (but the other
dimension will always have a magnitude of 2).
> Since I want to keep the two elements together d
1 - 100 of 239 matches
Mail list logo