darrenr wrote:
Thanks for the quick reply. Could you provide a link to more
information on the debug build you refer to?
Here you are:
http://svn.python.org/projects/python/branches/release25-maint/Misc/SpecialBuilds.txt
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
Hello,
I'm trying to write a Python extension module in C for the first time.
I have two questions:
I have a much better suggestion:
Use Cython!
Although I'm pretty experienced with the Python C API, I prefer Cython
over hand written C code for most stuff. It's s
Robin Becker wrote:
I've just been testing out Jakob Sievers' speedup of Python 2.5.2 by
compiling on freebsd with gcc-4.3.3 (the standard freebsd 6.1 gcc is
3.4.4).
I'm glad to say that his modification did improve pybench overall by
about 12%, but during the testing I noticed that in fact s
Python 2.5 is the last version for Win9x and NT. Starting with Python
2.6 and 3.0 at least Windows 2000 SP4 is required.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Johannes Bauer wrote:
Hello group,
I'm porting some code of mine to Python 3. One class has the __cmp__
operator overloaded, but comparison doesn't seem to work anymore with that:
__cmp__ is gone
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Terry Reedy wrote:
I was going to say "look in "What's New", but the __cmp__ removal is
missing. So I filed
http://bugs.python.org/issue4372
The whatsnew section of Python 3.0 is still empty. Guido didn't had time
to write it. http://bugs.python.org/issue2306
--
http://mail.python.org/mail
Stef Mientki wrote:
hello,
if I pass a class method to a function,
is it possible to determine the class instance in that function ?
class test ( object ) :
def My_Method ( self ) :
return 22
def do_something ( parameter ) :
# here I want to determine My_Instance
My_Instance = test ()
d
bieff...@gmail.com wrote
> I checked, and, for windows platform subprocess.py uses the modules
> mvscrt and _subprocess, which I ham unable to
> locate on my windows XP python 2.6 installation. This make the whole
> thing harder, even impossible if _subprocess has
> been created especially for subp
aha wrote
> def runner(cmd, stdin, stdout, ...):
> try:
> import subprocess
> sbm = 1
> except:
> sbm = 0
>
> # Now do something
> if sbm:
> process = subporcess(...)
> else:
> import popen2
> process = popen2.Popen4(...)
>
> Has anyone else run into a situation
Denis Kasak wrote
> You could, however, argue that the swap function doesn't work as
> expected (e.g. from a Pascal or a C++ POV) simply because the
> underlying objects aren't mutable. The objects *do* get passed by
> reference;
We are getting down the same road every couple of months. Please do
venutaurus...@gmail.com schrieb:
> Hello,
> I am facing problems while using os.system() of python for
> copying a file from source to destination where the file name is in
> unicode (multi lingual characters).My python interpreter is trying to
> convert them to ascii and is failing. I tri
birdsong wrote:
> I searched but didn't see this already discussed, sorry if I didn't
> search hard enough.
>
> Can I decrement a semaphore's counter within the same thread more than
> once? I'd like to set hard and soft limits in a server I'm writing.
> The server upon initialization would creat
Seth wrote:
> I implemented "if isinstance(port, str): " that seems to work for now.
>
> Currently I am running into:
>
> err, n = win32file.WriteFile(self.hComPort, data,
> self._overlappedWrite)
> TypeError: expected an object with a buffer interface
Unicode objects (in Py3k: str) don't implem
Seth wrote:
> I tried all three ways you guys listed nothing seems to convert the
> string to bytes.
>
> It may have to do with the makeDeviceName function, but I can't find
> where that is defined.
>
> Any thoughts??
>
> Here is the whole block of code:
>
> if type(port) in (str, bytes):
RGK wrote:
> Any input appreciated :)
How about:
import logging
try:
# run your function
some_function()
except Exception:
# except only the exceptions you *really* want to catch
# at most you should except "Exception" since it doesn't
# catch KeyboardInterrupt and SystemExit
l
Dan Barbus schrieb:
> Hi,
>
> I have a problem with setting a property to a class instance, in
> python 2.5.1. The property is defined through get and set methods, but
> when I set it, the setter doesn't get called. Instead, I believe the
> property in the instance gets replaced with a new object
Visco Shaun schrieb:
> hi all
>
> while getting used to with subprocess module i failed in executuing a)
> but succeeded in running b). Can anyone explain me why as i am providing
> absolute path? Is this has to do anything with shared library.. which
> must be accessed based on system variables?
Lie Ryan wrote:
>> But this fails with:
>>
>> TypeError: can't set attributes of built-in/extension type
>> 'datetime.date'
>
> This is because today is an attribute. In python, we can override
> attribute access to become a function call. I don't have python right
> now, but try this:
>
> del da
Christian R. schrieb:
> Hello,
>
> Brand new to this list, I've not found a quick way to search the
> archives, and this is not a technical question.
>
> I've just been hired at a digital signage company. They use VBScript
> for simple-to-medium scripting. I've abandoned it about 8 years ago. I
>
Thomas Raef wrote:
> What a great response.
It's a correct, straight forward and short answer to the op's question.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Kless schrieb:
> Does anybody has seen the performance of Python 3?
> Respect to speed it's the last language together to Ruby 1.8, but Ruby
> 1.9 has a lot of better performance. :(
Python 3.0 is slower than Python 2.5 and 2.6. Lot's of code was added or
modified -- code that hasn't been optimize
Benjamin Kaplan wrote:
> cmp(e, string) is actually just a shortcut for e.__cmp__(string).
FYI, cmp(e, string) does a lot more than just calling e.__cmp__(string).
Check out Objects/object.c:do_cmp()
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Avetis KAZARIAN schrieb:
> Gary Herron wrote:
>> The question now is: Why do you care? The properties of strings do
>> not depend on the implementation's choice, so you shouldn't care because
>> of programming considerations. Perhaps it's just a matter of curiosity
>> on your part.
>>
>> Gary H
Johannes Permoser wrote:
> But what's the way to bring python3 to the Web?
> mod_python isn't available, cgi is said to be slow, mod_wsgi looks
> complicated...
WSGI is the right way to go. It's *the* Python standard for web
application interfaces. You don't need mod_wsgi and Apache to run a WSGI
Muddy Coder schrieb:
> Hi Folks,
>
> If I have a python file foo.py in the current directory, I can simply
> import it in the way below:
>
> import foo
>
> when a project keeps grow, more and more Python files are created, and
> they are also needed to put into different directories. Then, a
> p
TP schrieb:
> Hi everybody,
>
> I would like to prevent the loading of modules in the current directory.
> For example, if I have a personal module in the current directory
> named "os", when I do "import os", I would like Python to import os
> standard module, not my personal module of the curren
dan.erik.peter...@gmail.com schrieb:
> I suppose that what I am looking for is the Windows version of "make
> install" as we know it after running configure with --
> prefix=custom_location --exec-prefix=custom_location flags and make on
> the Linux platform.
The Windows build system doesn't have
Fencer schrieb:
> Hi, I need a boolean b to be true if the variable n is not None and not
> an empty list, otherwise b should be false.
> I ended up with:
> b = n is not None and not not n
> which seems to work but is that normally how you would do it?
> It can be assumed that n is always None or a
Emanuele D'Arrigo wrote:
> So, it appears that in the first case a and b are names to the same
> string object, while in the second case they are to two separate
> objects. Why? What's so special about the forward slash that cause the
> two "/a" strings to create two separate objects? Is this an
>
Steven D'Aprano wrote:
> Yes. Floating point NANs are required to compare unequal to all floats,
> including themselves. It's part of the IEEE standard.
As far as I remember that's not correct. It's just the way C has
interpreted the standard and Python inherited the behavior. But you may
proof me
bearophileh...@lycos.com wrote:
> Are the computed gotos used in the future pre-compiled Windows binary
> (of V.3.1) too?
No, the MS Visual C compiler doesn't supported labels as values [1]. The
feature is only supported by some compilers like GCC.
Christian
[1] http://gcc.gnu.org/onlinedocs/gcc
Victor Lin wrote:
> Hi,
>
> I am going to develop a c library binding with ctypes. That c library
> will call callback from worker threads it created. Here comes the
> problem : Will the GIL be acquired before it goes into Python
> function?
>
> I got a little try..
>
> DSPPROC = WINFUNCTYPE(Non
Victor Lin wrote
> I know I have to call PyEval_InitThreads if my module create threads
> that will contact python stuff, for example, call a python callback
> function from threads. But however, it is ctypes. I have no idea
> should I do that for the imported dll? If it is, how?
You have to initi
Terry Reedy wrote:
> Are you looking for pre-built binaries or the build files to make your
> own? PSF distributes 2.? to 2.5 binaries built with VS2003 and 2.6+
> binaries built with VS2008 (I believe) and the corresponding build
> files. People have built with VS2005, but you will have to sear
Royce Wilson schrieb:
> I'm working on a minimilistic linux project and would like to include
> Python. However, since Python is around 17MB (compressed) and previous
> releases of this linux distro are under 100MB (compressed) standard Python
> releases are much to large. I just need the runtime
Vlastimil Brom wrote:
> def path_from_pardir(path):
> return
> os.path.realpath(os.path.normpath(os.path.join(os.path.dirname(__file__),
> os.pardir, path)))
> # __file__ is substituted with sys.path[0] if not present
>
> real_path = path_from_pardir("txt/text_1.txt")
>
> The above seems to
Royce Wilson schrieb:
> Thanks, much better. What exactly do I lose when I launch python without
> site.py?
Why do you want to strip Python off everything useful? A bare
interpreter without the standard library isn't useful for anything.
Christian
--
http://mail.python.org/mailman/listinfo/pytho
Scott David Daniels wrote:
> Aahz wrote:
>> In article ,
>> Rhodri James wrote: ...
>>> sys.path.append("C:\\DataFileTypes")
>>
>> My preference:
>> sys.path.append(r"C:\DataFileTypes")
>> This doesn't work if you need to add a trailing backslash, though.
>
> Also my preference (except, due to ag
Chris Rebert wrote:
> Haven't used it, but Python for .NET sounds like it might be what you
> want: http://pythonnet.sourceforge.net/
I've done some development for and with PythonDotNET. It's definitely
the right thing. It works with .NET, Mono and Python 2.4 to 2.6.
Christian
--
http://mail.py
dmitrey wrote:
> This doesn't work for
> costlyFunction2 = lambda x: 11
> as well; and it doesn't work for imap, apply_async as well (same
> error).
> So, isn't it a bug, or it can be somehow fixed?
> Thank you in advance, D.
It's not a bug but a limitation of the pickle protocol. Pickle can't
han
Chris Rebert wrote:
> It's been compiled for 64-bit processors, so it uses 64-bit pointers
> and 64-bit small integers. And I would think it would only work w/ C
> extension libraries also compiled for 64-bit CPUs. So, the same
> meaning 64-bit has for anything else really.
A 64bit build of Python
Chris Rebert wrote:
> There's no effect on attribute read-writes as they all take place
> within the single __dict__ of the instance. As for method lookup, it
> doesn't add an indirection per se, but rather the list of classes to
> look thru to find a method gets longer, making base-class method
>
Deepak Rokade wrote:
> How can I get rid of this ?
> Is this package not available for sun solaris ?
Apparently Solaris doesn't support sem_timedwait(). You have to disable
the feature in setup.py::
HAVE_SEM_TIMEDWAIT=0
Why are you using pyprocessing instead of multiprocessing?
Christian
--
Deepak Rokade wrote:
> This did not wok.
> I continued to get those warning and Import Error.
>
> I wanr through documentation of multiprocessing and it looks almost similar
> to processing module.
> Any advantages of multiprocessing module ?
You may have to disable more features and recompile e
Deepak Rokade wrote:
> I am trying to build package "pyprocessing" for python 2.5
>
> I am using sun machine with Solaris 5.8
>
> drok...@himalaya:~/modules_python/processing-0.52
> (Deepak:)uname -a
> SunOS himalaya 5.8 Generic_117350-35 sun4u sparc SUNW,Sun-Fire
>
> While building the package
Terry Reedy wrote:
> Compare that to MyClass.myMethod is MyClass.myMethod, which is True at
> least in 3.0.
It's true because Python 3.0 has no unbound methods. MyClass.myMethod
returns the function object. It's possible to get the same behavior in 2.x:
MyClass.myMethod.im_func is MyClass.my
Randy Turner wrote:
> I was reading a book on Python-3 programming recently and the book stated
> that, while there is an __init__ method for initializing objects, there was a
> __del__ method but the __del__ method is not guaranteed to be called when an
> object is destroyed.
>
> If there is c
Victor Subervi schrieb:
> Hi;
> If I am writing a script that generates HTML, how do I grab the name of the
> actual file in which I am working? For example, let us say I am working in
> test.py. I can have the following code:
>
> import os
> dir = os.getcwd()
>
> and that will give me the workin
Russ P. wrote:
> I am running 2.5.2 on Red Hat 5. I am getting many printouts of
> reference counts, such as
>
> [10263 refs]
>
> I do not recall ever seeing this until recently. Why am I getting
> this? Thanks.
You are using a debug build of Python.
Christian
--
http://mail.python.org/mailman
W. Martin Borgert schrieb:
> (Resend, because of funny error message:
>> Your mail to 'Python-list' with the subject
>> Iterating over readlines() and map()
>> Is being held until the list moderator can review it for approval.
> Whatever this means.)
>
> Hi,
>
> if I understand correctly, thi
Johan Compen wrote:
> If Python doesn't include the _d.lib file, then why does the header
> file reference it? I would prefer manual control over which lib file
> to use. (And I don't want to disable _DEBUG for other reasons).
>
> Could the header file be changed so it alwas uses the release lib?
> So I'm proposing: please use _PYTHON_DEBUG for this purpose. Would
> this cause any problems?
Python has its own debug flag: Py_DEBUG. The roles of _DEBUG and
Py_DEBUG could easily be changed in PC/pyconfig.h. Any change needs a
discussion on the Python ideas list. *wink*
Christian
--
http://m
Josh Dukes wrote:
> Of course this would detect unicode files as being binary and maybe
> that's not what you want. How are you thinking about doing it in
> perl exactly?
There is no such thing as a unicode file. You most likely mean UTF-8 or
UTF-16 coded text.
Christian
--
http://mail.python.o
Paul Rubin wrote:
> Yes, hashes are 32 bit numbers and there are far more than 2**32
> possible Python values (think of long ints), so obviously there must
> be multiple values that hash to the same slot.
No, hashs are C longs. On most 64bit platforms a C long has 64bits. As
far as I know only 64b
gert wrote:
> I do understand, and I went looking into pySerial, but it is a long
> way from getting compatible with python3.x and involves other libs
> that are big and non pyhton3.x compatible.
So don't use Python 3.0. Most people are still using Python 2.5 or 2.6.
Christian
--
http://mail.pyt
Aaron Scott wrote:
> Yeah, I'd link to think I'm fairly experienced and not making any
> stupid mistakes. That said, I'm fairly new to working with mod_python.
>
> All I really want is to have mod_python stop caching variables. This
> seems like it should be easy enough to do, but I can't for the
gert wrote:
> On Apr 3, 10:10 pm, Christian Heimes wrote:
>> gert wrote:
>>> I do understand, and I went looking into pySerial, but it is a long
>>> way from getting compatible with python3.x and involves other libs
>>> that are big and non pyhton3.x compatib
Gerhard Häring wrote:
> char* buf = strdup(s);
> if (!buf) {
> PyErr_SetString(PyExc_MemoryError, "Out of memory: strdup failed");
> return NULL;
> }
>
> /* TODO: your string manipulation */
Don't forget to free(buf). ;)
Christian
--
http://mail.python.org/mailman/listinfo/python-list
TP wrote:
> If "di" is reliable, it seems a good solution for my initial constraint
> which is the impossibility to store anything but strings in my data
> structure.
'di' is dangerous and not reliable. When the original object is freed,
then the memory address may be used by another Python object
Marek Szuba wrote:
> Is there any way of detecting in a script whether the interpreter
> session running it has been launched with the -i option? My Google fu
> has failed me on this subject... Thanks in advance.
There is no direct way to detect the interactive flag. However sys.ps1
and sys.ps2 ar
Ken Seehart wrote:
> Picky note: The phrase "statically compile pythonxx.dll into my C++
> application" is not quite correct. A DLL is dynamically linked, not
> statically linked. All this means is that you ship pythonxx.dll with
> your application along with any other DLLs and pyd files you migh
eric.le.bi...@spectro.jussieu.fr wrote:
> Hello,
>
> Is there a way to easily build an object that behaves exactly like a
> float, but whose value can be changed? The goal is to maintain a list
> [x, y,…] of these float-like objects, and to modify their value on the
> fly (with something like x.v
Stef Mientki wrote:
> Now doesn't seem to be allowed,
> nor is there an import from __future__ :-(
>
> What's the best solution (other than moving to 2.6 or up ?
The word 'print' is a reserved word like is, class or def. You can't
have a function named 'print' in Python 2.5. You have to call you
Emmanuel Surleau wrote:
> First off, it's pretty commonplace in OO languages. Secondly, given the
> number of methods available for the string objects, it is only natural to
> assume that dir("a") would show me a len() or length() or size() method.
> Having to use a function for such a mundane o
Andreas Otto wrote:
>
> well propable found the answer by my own ...
>
> Py_RETURN_NONE
>
> should be the best
You have found the correct answer to your query. :)
Christian
--
http://mail.python.org/mailman/listinfo/python-list
David Cournapeau schrieb:
> On Wed, Apr 22, 2009 at 4:20 PM, 83nini <83n...@gmail.com> wrote:
>> Hi guys,
>>
>> I'm new to python, i downloaded version 2.5, opened windows (vista)
>> command line and wrote "python", this should take me to the python
>> command line, but it did not! i'm getting : py
David Cournapeau schrieb:
> On Wed, Apr 22, 2009 at 6:24 PM, Christian Heimes wrote:
>
>> I highly recommend against adding C:\Python25 to your %PATH%. You can
>> get the same effect by adding a simple bat file to C:\Windows\System32
>
> I am curious, what's the di
Jean-Paul Calderone wrote:
> I'm not sure what the easiest way to determine whether Python has found
> gethostbyname_r or not on your system is. The configure script used to
> build Python will probably tell, but I doubt you have that lying around.
> You could just assume this is the case, since y
Peter Otten wrote:
> Like Gerhard says, in the long run you are probably better off with
> ElementTree.
In the long run it's even better to use lxml [1]. It's the fastest und
most powerful XML library for Python. It also supports element tree.
Christian
[1] http://codespeak.net/lxml/
--
http://
83nini schrieb:
> hi guys,
>
> i've been sweating the whole day trying to make python work with mysql
> but in vain!
> i'm doing the following:
> 1. visiting http://sourceforge.net/projects/mysql-python
> 2. dowloading mysql-python-test-1.2.3c1
> 3. extracting the files to C:\Python26\Lib\site-pac
s...@pobox.com schrieb:
> This little shell script lists the partitions containing /var/opt on a set
> of hosts:
>
> for h in host1 host2 host3 ; do
> echo -n "$h "
> ssh $h df -h /var/opt | egrep -v '^Filesystem' | awk '{print $6}'
> done
>
> producing output like this:
>
>
Clarendon schrieb:
> I am trying to get the index for the last occurrance of a sub string.
>
> S = 'dab dab dab'
> print S.find('ab')
> 1
>
> This gives me the index for the first position of 'ab'.
> But I need to index the last position of 'ab' here.
> Is there a quick option for find that will
Evan Kroske schrieb:
> I'm planning on learning Python, and I'd like to know which version to
> start with. I know that Python 3.0 isn't ready for production and it
> doesn't have enough libraries yet, so I thought I should learn Python
> 2.6. Unfortunately, installing Python 2.6 on my Linux distro
Steven D'Aprano wrote:
> Are you saying that Intrepid uses Python3.0 as it's default Python?
>
> If not, then just use the default Python installed. Possibly Python 2.5.
> The differences between 2.5 and 2.6 are minor.
Ubuntu 9.04 has Python 2.6.2 as default Python interpreter. It's also
shipped
Eric Winter schrieb:
> Hi all. I'm trying to build some internal code that needs to link
> against libpython2.5.so on a OS X 10.4 (Tiger) machine. It seems that
> no matter what combination of options and environment variables I give
> to the configure script from python 2.5.1, all I get is the
> l
rahul schrieb:
> Is functions equivalent to ruby's rb_big2str() and rb_str2cstr()
> available in Python.
> I had search a lot in google but not able to find that.
> If anybody know than please give me the name of those functions of
> Python.
Please don't assume that we know what the Ruby function
Gunter Henriksen wrote:
> but that seems like an arcane way to do something
> which would ideally be transparent... if there is
> a function in the standard library, that would be
> good, even if I have to import it. I guess there is
> collections.namedtuple... that would not look much
> prettier.
Philipp Hagemeister schrieb:
> Where is the fault in my reasoning here?
Python processes .pth files only in some directories. The directories are
* the global site-packages directory
* the user site-packages directory (starting with Python 2.6)
* and any directory that is added by a .pth file
Andreas Otto wrote:
> 1. on LINUX I create a "pymsgque.so" and I can load this library
> with "import pymsgque"
>
> 2. in WINDOWS, I expect to create a "pymsgque.dll" and do the
> same as on unix "import pymgque"
>
> -> is this behaviour is supported or not ???
>
>
Trevor schrieb:
> Is anyone aware of a good library for building 2d barcodes (any format
> will work for me) and outputing them as some picture format,
> presumably png or bmp to be used for html printing? For 1D barcodes a
> simple barcode font will suffice, but obviously 2D is not so simple
> and
seanm...@gmail.com schrieb:
> The explaination in my introductory Python book is not very
> satisfying, and I am hoping someone can explain the following to me:
>
4 / 5.0
> 0.80004
>
> 4 / 5.0 is 0.8. No more, no less. So what's up with that 4 at the end.
> It bothers me.
Welcom
Joana wrote:
> I mantain Python on Windows, all installed packages are under c:
> \Python25\Lib\site-packages. Now I have to build C libraries used by
> python extensions and I am using cygwin, but I don't know how to
> install the module in Windows directory.
Are you sure you want to use Cygwin?
Joana wrote
> hmm.. but the problem with mingw32 is that it does not have the
> libraries I need. The module I want to install includes netinet/in.h.
> So the answer is that I can't install that module in Windows?
What's the name of the package? Perhaps it doesn't work on Windows. Or
it hasn't bee
Matthew Wilson schrieb:
> I use a @property decorator to turn some methods on a class into
> properties. I want to be able to access some of the attributes of the
> original funtion, but I don't know how to get to it.
>
> Any ideas?
Here you are:
>>> class Example(object):
... @property
...
abolotnov schrieb:
> Hi, I am trying to build mySQL-python with python 2.6 on windows and
> can't figure what's wrong with it.
>
> D:\temp\mysqlPyC\MySQL–python–1.2.3c1>python setup.py build
> running build
> running build_py
> copying MySQLdb\release.py –> build\lib.win32–2.6\MySQLdb
> running bu
abolotnov schrieb:
>> You need Visual Studio 2008. Other versions of VS aren't supported by
>> Python 2.6.
>
> Aren't 2005, 2008+ versions all have same c compiler - it's just the
> IDE versions that are different?
There are important differences between the several versions of VC++.
The most imp
abolotnov wrote:
> say I obtain and install "an alternative" compiler. how do I tell
> python which one to use?
>
> I am sorry for asking dumb questions. Can't find the answers in the
> docs/mans.
http://docs.python.org/install/index.html#gnu-c-cygwin-mingw
Christian
--
http://mail.python.org/
LittleGrasshopper wrote:
> This is probably trivial, but it's driving me mad somehow. All (new
> style) classes are instances of 'type' by default, unless a custom
> metaclass is specified. I take this to mean that when a class
> declaration is found in the code, an instance of 'type' representing
Colin J. Williams schrieb:
>> See PCbuild/readme.txt.
>
> I presume that this is PCbuild8.txt
No, it's PCbuild/readme.txt in Python 2.6 and 3.0
By the way you can call Tools\buildbot\external.bat from the root
directory of the 2.6 and 3.0. It checks out and build the dependencies.
The script req
Odys schrieb:
> Hi there,
>
> Since execfile() is removed in Python 3.0
> I have question about using exec.
>
> I know about
> exec(open('filename').read())
> but from documentation the 1st arg of exec can be 'file object'.
> However
>exec(open('filename'))
> does not work.
> Does anybody h
[EMAIL PROTECTED] schrieb:
> We have to avoid the use of the 'is' identity operator with basic,
> immutable values such as numbers and strings. The result is
> unpredictable because of the way Python handles these objects
> internally.
You are confusing immutable objects with singletons. Never use
Rajarshi schrieb:
> Hi, I teach an introductory programming course in Python. As part of
> the introduction I'd like to highlight the usage of Python in
> industry. The idea is to show that there are big players using Python
> for a variety of tasks. Given that the students come from a variety of
>
Eric Anderson schrieb:
> Seems like unnecessary code but obviously I know nothing about Python.
Correct, the truth example isn't a good example. "if argv" is better.
But you can write interesting things with the operator module. For example
>>> import operator
>>> def fac(x):
... return reduc
Ian Kelly schrieb:
> The purpose of obj.__len__() is to implement len(obj), which simply
> calls it. So obj.__len__() may be faster, but only marginally. The
> reason to prefer len(obj) is that if you inadvertently pass an object
> that does not implement __len__, you get the more appropriate
> T
brad schrieb:
> However, other components can be written in a more user friendly, more
> easily maintained language. We've chosen Python for this. The main
> question now is how to pass the computationally heavy info to c++ from
> within Pyhton. os.system is not ideal. Just wondering how other folk
globalrev schrieb:
> cust1 = customer.__init__('12',['1','435','2332'])
cust1 = customer('12',['1','435','2332'])
Christian
--
http://mail.python.org/mailman/listinfo/python-list
inhahe schrieb:
> what is going on here, and how do I compile these external libraries?
I assume you are trying to compile Python 2.5 with VS 9.0. It's not
supported. Some extensions don't compile under VS 9.0
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Matthieu Brucher schrieb:
> Hi,
>
> I did not manage to build extension with distutils with Python compiled with
> VS different than 2003. The need for 2003 was hard-coded in distutils.
> You can try building extensions with VS2008 with Scons. This is what I do a
> lot, and everything works fine a
Matthieu Brucher schrieb:
> Even if you compile Python 2.5 with VS2008, VS2003 is used for the
> extensions, AFAIR. I didn't try Python 2.6 because I only have Visual C++
> Express 2008.
You can compile 2.6 and 3.0 with the free Express Edition just fine.
Christian
--
http://mail.python.org/mail
Luis Zarrabeitia schrieb:
> Personally, I like to use "is" with singletons. I find it easier to type and
> read "if param is None" than "if param == None", but some python developers
> dislike the first one because of the "dark magic" involved in knowing that
> None is a singleton.
Testing for
501 - 600 of 1052 matches
Mail list logo