一首诗 wrote:
Hi all,
I read this interesting post comparing Boost.Python with Pyd:
http://pyd.dsource.org/vsboost.html
What's your opinion about it?
What's your first choice when you have write a C/C++ module for Python?
I'm using handwritten C code or Cython/Pyrex to create Python C
extensi
[EMAIL PROTECTED] wrote:
File symLinkTest is a symbolic link.
Why S_ISLNK(mode) returns False and S_ISREG(mode) returns True ?
Because you are using os.stat() instead of os.lstat().
http://docs.python.org/lib/os-file-dir.html
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Neal Becker wrote:
Is there a posix semaphore wrapper for python?
Would that be a good addition?
The threading module provides a high level interface to native
semaphores, e.g. pthread.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
walterbyrd wrote:
I have heard about Pysco. But does create a single executable that can
run without Python being installed? Or does that just compile the
libraries?
Psyco is a kind of JIT (just in time) optimizer for Python. It's limited
to i386 compatible CPUs (aka X86 architecture). It has
Neal Becker wrote:
Does that provide semaphores between unrelated processes?
No, it just provides unshared semaphores. You can either create your own
Python extensions or you can use ctypes if you need a shared or named
semaphore.
Depending on your requirements you can choose between sem_in
Johny wrote:
Is it possible to get a number of the http processes running on Linux
directly from Python ?
The Python core has no direct API for the job. However you can use the
virtual /proc/ file system for the job. Or check out my enumprocess
package.
http://pypi.python.org/pypi?:action=di
Pau Freixes wrote:
The best way for add new path before call PyImport_Import is adding new
string item into sys path object ?
The same way you'd add a path in Python:
PyObject *sys_path;
PyObject *path;
sys_path = PySys_GetObject("path");
if (sys_path == NULL)
return NULL;
path = PyStrin
[EMAIL PROTECTED] wrote:
I presume it's better for me to not hold my breath while I wait
CPython to be written in C99 :-)
First you have to convince Microsoft to release C99 compiler ... good luck!
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Gandalf wrote:
if i want to print utf-8 string i should writre:
print u"hello word"
but what happen if i want to print variable?
u"hello world" is *not* an utf-8 encoded string. It's a unicode string.
I suggest you read http://www.joelonsoftware.com/articles/Unicode.html
Christian
--
http
Rowland Smith wrote:
Anyone know where the source code for the built-in property function is
located in a python distribution?
I would like to see how it works - mainly, how does it know which class
it is being called from?
Property is not a function but a type. Properties are a common usage
Fredrik Lundh wrote:
Peter Pearson wrote:
(startled noises) It is a delight to find a reference to
that half-century-old essay (High Finance) by the wonderful
C. Northcote Parkinson, but how many readers will catch the
allusion?
anyone that's been involved in open source on the development si
Lanny wrote:
Please don't tell me that "list indices must be integers" because I know
that, Why can't I put a varible thats an integer instead?
raw_input() always returns a string. You have to convert the string into
an integer using int().
Christian
--
http://mail.python.org/mailman/list
mathieu wrote:
Hi there,
I am trying to write something very simple to test if a list
contains another one:
a = [1,2,3]
b = [3,2,1,4]
but 'a in b' returns False. How do I check that a is indeed contained
in b ?
Use sets:
>>> a = [1,2,3]
>>> b = [3,2,1,4]
>>> set(a).issubset(set(b))
True
Gary Robinson wrote:
In Python 2.5.2, I notice that, in the interpreter or in a script, I can exit
with:
exit()
The exit callable is defined in the site module. Check out site.py! It
shouldn't be used in code. It was added to help newbies to 'escape' from
an interactive Python shell.
AON LAZIO wrote:
Hi, Pythoners.
I would like to know that in some class, it uses __XX__ but in some it
uses only XX
for example,
class Test:
def __som__(self):
...
def som(self):
...
What does "__XX__" make the method different from XX?
Thanks in advance
ago wrote:
Wouldn't it be possible to support a PYTHONSITEDIR environment
variable in site.py for this purpose? I have attached a possible
patch. In what follows, if PYTHONSITEDIR is defined, that dir is used
as the only source of site-packages, extra paths can easily be added
by creating a .pth
ago wrote:
The only thing I would add is that in my experience I often use
different working-envs for different projects, so I'd prefer to have a
more generic solution as opposed to a single working-env per user. The
latter could still be achieved by setting the appropriate environment
variable i
Fredrik Lundh wrote:
what makes you think you can write a better sort than the built-in
algorithm by typing in some toy quick-sort implementations from a
"sorting for dummies" article?
Anybody who can FULLY understand Tim's text at
http://svn.python.org/projects/python/branches/release25-maint
Fredrik Lundh wrote:
what makes you think you can write a better sort than the built-in
algorithm by typing in some toy quick-sort implementations from a
"sorting for dummies" article?
Anybody who can FULLY understand Tim's text at
http://svn.python.org/projects/python/branches/release25-maint
Diez B. Roggisch wrote:
Which actually isn't really helpful, as a DLL itself says nothing about what
language was used to create it - and sending the OP to e.g. ctypes makes no
sense at all in the face of C++.
The library - or more precisely the calling convention of the library -
is related t
Berthold Höllmann wrote:
Is there any "common" reason to for such a strange object on the command
stack, or is it more likely that any of my extension modules is causing
havoc?
It's very likely that your extension has a reference counting bug. It
looks like you are either missing a Py_INCREF o
Chris wrote:
Hi,
I'd like to be able to access an attribute of a particular Python
object as fast as possible from some C code.
I wondered if using __slots__ to store the attribute would allow me to
do this in a faster way.
The reason I'd like to do this is because I need to access the
attribu
Anjanesh Lekshminarayanan wrote:
import re
new_str = re.sub('[aeiou]', '-', str)
Wow - this is neat. Thanks
But probably slower and definitely harder to understand. For simple
problems the str methods are usually faster than a regular expression.
Christian
--
http://mail.python.org/mailman
Kenneth McDonald wrote:
When making calls of the form Popen(cmd, shell=True,
stdout=subprocess.PIPE), we've been getting occasional, predictable
hangs. Will Popen accumulate a certain amount of stdout and then block
until its read? We don't want to use threads, so just want to read the
entire
Tzury Bar Yochay wrote:
So what if it is connectionless.
It would make sense if you get a load of users who sends large sets of
binary data to each other.
Transmitting large binary data over UDP? That makes only sense for few
applications like video and audio streaming. UDP does neither guaran
aditya shukla wrote:
now this dosen't change the value of the variable which was set earlier
.Please help me in fixing this issue.
Are you trying to modify or add an environment var so the change is
visible from the calling shell? That's not possible. You can't change
the env var of a parent
Chris wrote:
Ok, thanks for the confirmation. We'd been hoping to avoid creating
such a struct...
Don't worry, a C extension with its own struct isn't hard to write. Your
C code can access the member variables w/o using any Python API. You'll
get the full speed of C. :]
Christian
--
http:/
Bojan Mihelac wrote:
I guess A class not yet exists in line 4. Is it possible to achive
adding dynamic attributes without using exec?
Correct, the class doesn't exist until the end of the class body. You
can either do it outside the class definition or you can use a metaclass.
Christian
--
python dev wrote:
Hello everyone,
I am trying to get a list of all the partitions (along with their respective
file system types) listed in the /media directory. Does anybody know if
there is a way to do this using Python, or do I have to get this information
by parsing the output of a Linux co
Python wrote:
a temp solution is to append it to that list:
sys.path.append('C:/Python25/Progs/')
a permanent solution is to add it to the environment variable
(no idea where to set this in windows)
$PYTHONPATH = "/C:/Python25/Progs/"
Don't append a / or \!Use "C:/Python25/Progs" instead of
Torsten Mohr wrote:
I just found an article that describes it better, this example works:
class C2(object):
def __new__(cls, a):
obj = object.__new__(cls)
print "new called"
obj.a = 8
return obj
__new__ = staticmethod(__new__)
Staticmethod isnt' requir
rmac wrote:
the following code attempts to extract a symbol name from a string:
extensionStart = int(filename.rfind('.'))
filenameStart = int(filename.rfind('/'))
#print 'Extension Start - ' + str(extensionStart)
#print 'FileName Start - ' + str(filenameStart)
currentSymbol=f
Alex Snast wrote:
Another quick question please, is the List data structure just a
dynamic array? If so how can you use static size array, linked list,
AVL trees etcetera.
You should treat Python lists as an opaque item. You shouldn't concern
yourself with the implementation details. Python li
Kay Schluehr wrote:
Actually it is simply wrong in the mentioned case and here is the
proof:
def foo():
return 2+2
import dis
dis.dis(foo)
2 0 LOAD_CONST 2 (4)
3 RETURN_VALUE
OO is a heuristic method used to understand the semantics of a
programming
Dennis Lee Bieber wrote:
Interesting... The only win32ui* on my machine (running v2.4) is a
win32ui.pyd (D, not C) and it is part of the PythonWin IDE obtained as
part of the ActiveState installer for windows.
Oh, and /how much RAM/? ".099g" sounds rather small; my PDA has
".5G"
Drake wrote:
I have a general question of Python style, or perhaps just good
programming practice.
My group is developing a medium-sized library of general-purpose
Python functions, some of which do I/O. Therefore it is possible for
many of the library functions to raise IOError Exceptions. The
Rob Kirkpatrick wrote:
I'm assuming this has been discussed before, but I'm lacking any
Google keywords that bring up the appropriate discussion.
You are looking for "mro" aka method resolution order. The inspect
module contains several helper functions to inspect a class hierarchy.
The foll
Almar Klein wrote:
Can
anyone say something about that? Will it take a month, a year?
A year or more is realistic. A couple of years is even more realistic.
Large projects are moving slowly and Python 3.0 introduces some heavy
changes. The separation of text (unicode str) and data (bytes) tak
graph wrote:
Does anyone know why PySys_GetObject wasn't documented until somewhat
recently (http://bugs.python.org/issue1245) if it has been part of the
system module interface since at least Python 1.5.2? Is it not
supposed to be used? What's the difference the above and importing
the sys mod
Steven D'Aprano wrote:
str(b'123') # b prefix is added
"b'123'"
Perhaps I'm misinterpreting it, but from here it looks to me that str()
is doing what repr() used to do, and I'm really not sure that's a good
thing. I would have expected that str(b'123') in Python 3 should do the
same thing a
[EMAIL PROTECTED] wrote:
Hi,
I'm using the writelines() method to write some lines to a text file. But
I'm unable to write the % character to the file using the following format:
fdTolFile.writelines("\n\tdiff Not in %s '%' range" %(toleranceInPer))
Try %% :)
Christian
--
http://mail.pyth
process wrote:
What is not an object in Python?
Everything that is not part of Python's syntax is an object, including
all string and number types, classes, metaclasses, functions, models,
code and more. It's technically not possible to have something like e.g.
an int that isn't an object.
robert wrote:
I want to detect changes in a directory tree fast with minimum
overhead/load. In order to check the need for sync tasks at high frequency.
It must not be 100% reliable (its also forced time periodic), so kind of
hashing would be ok.
How?
Almost every modern OS has some sort of s
Blubaugh, David A. wrote:
To All,
I have been attempting to execute the following program within the
Python environment:
Myprogram.exe, which means this is an executable file!!
I would usually execute this program (with the appropriate arguments) by
going to following directory within MS-DOS
[EMAIL PROTECTED] wrote:
I would add the following line right before your call to os.system:
os.chdir(r'C:\myprogramfolder\run')
I wouldn't. os.chdir() tends to introduce all sorts of trouble. It's a
quick n'dirty hack for a small script but no solution for a large
program or library.
Chri
Eric wrote:
I've been wanting to learn Python for a while now but I can't decide
on whether to wait for Python 3's final release and learn it or just
go ahead and learn 2.x. Would it be hard to make the transition being
a noob?
I suggest you stick to Python 2.5 or 2.6 for now. It's going to tak
Russell Warren wrote:
> but the code below is not?
>
x = (3, 4)
(1, 2, *x) == (1, 2, 3, 4)
> Traceback (most recent call last):
> File "", line 1, in
> invalid syntax: , line 1, pos 8
>
> Why does it only work when unpacking arguments for a function? Is it
> because the code below i
Victor Subervi wrote:
> When I go into the python interpreter and execute that statement, it
> succeeds. What have I missed?
You are confusing the permissions of a Unix file system. In order to
create or a remove a file from a directory you need the x and w
permission to enter the directory (x) an
Nadav Chernin wrote:
> When I use getargspec(func) for user-defined function, all is working
> OK, but using it for built-in functions raise TypeError:
That's just fine and to be expected. It's not possible to inspect a C
function. Only functions implemented in Python have the necessary metadata.
Victor Subervi wrote:
> Well, that's what I've tried. I've loaded the permissions up, 0777, and it
> still throws the same error. I've also tried os.chmod(file, 0777) from the
> script, and I get the same permissions error. I can do all of this from the
> python prompt. I've set the ownership of th
Michele Simionato wrote:
> Python 2.5, but it could be an artifact of the way I am looking if a
> file is closed.
> I have subclassed the file builtin, added a .close method and it was
> not called by the
> "with" statement. This during debugging, but now I have found another
> reason to explain wh
Jonathan Hartley wrote:
> Only this week I sent a py2exe-derived executable to someone else (a
> non-developer) and it would not run on their WinXP machine ("'The
> system cannot execute the specified program'") - my current favourite
> hypothesis is that my omission of this dll or something simila
John schrieb:
> Hi there,
>
> I have a rather lengthy program that troubles me for quite some time. After
> some debugging, I arrived at the following assertion error:
>
> for e in edges.keys():
> assert edges.has_key(e)
>
> Oops!? Is there ANY way that something like this can possibly ha
cassiope wrote:
> The strange thing is that even with the right user-id, I cannot seem
> to write to the directory, getting an IOError exception. Changing the
> directory to world-writable fixes this. I can confirm the uid and gid
> for the script by having the script print these values just befo
Iain King wrote:
> better would be:
> def ishex(s):
> for c in s:
> if c not in string.hexdigits:
> return False
> return True
Even more elegant and probably a faster solutions:
---
from string import hexdigits
hexdigits = frozenset(hexdigits)
def ishex(s):
return
Steve Howell wrote:
> Is that really true in CPython? It seems like you could advance the
> pointer instead of shifting all the elements. It would create some
> nuances with respect to reclaiming the memory, but it seems like an
> easy way to make lists perform better under a pretty reasonable us
Steve Howell wrote:
> I disagree that Python code rarely pops elements off the top of a
> list. There are perfectly valid use cases for wanting a list over a
> dequeue without having to pay O(N) for pop(0). Maybe we are just
> quibbling over the meaning of "rarely."
I was speaking from my own po
Arnaud Delobelle wrote:
> I made the comment you quoted. In CPython, it is O(n) to delete/insert
> an element at the start of the list - I know it because I looked at the
> implementation a while ago. This is why collections.deque exists I
> guess. I don't know how they are implemented but inser
Steve Howell wrote:
> That maybe would be an argument for just striking the paragraph from
> the tutorial. If it's rare that people pop the head off the list in
> code that is performance critical or prominent, why bother to even
> mention it in the tutorial?
How else are you going to teach new P
Steve Howell wrote:
> Another benchmark is that deques are slower than lists for accessing
> elements.
deques are optimized for accessing, inserting and removing data from
both ends. For anything else it's slower than the list type. The fact
was explained in this very thread yesterday.
Christian
Rotwang wrote:
> import os
> os.chdir()
>
> to site.py (or any other module which is automatically imported during
> initialisation) change the default location to every time I used
> Python?
First of all you shouldn't alter the site module ever! The optional
sitecustomize module exists to mak
Benjamin Kaplan wrote:
> Extensions written in C must be recompiled for every version of
> Python. Since you're using a version of Python not available through
> the package manager, your packages are also not available through
> that. You'll have to download the sources for those and compile them
John Nagle wrote:
> 1. Python 3 is supported by major Linux distributions.
>
> FALSE - most distros are shipping with Python 2.4, or 2.5 at best.
You are wrong. Modern versions of Debian / Ubuntu are using Python 2.6.
My Ubuntu box has python3.0, too.
> 2. Python 3 is supported by multip
dirknbr wrote:
> I am trying to install simplejson on Python 3.1 on Windows. When I do
> 'python setup.py install' I get 'except DisutilsPlatformError, x:
> SyntaxError' with a dash under the comma.
There is no need to install simplejson yourself. Python 3 and 2.6
already have a JSON package calle
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? Your answer is the first that
clearly marks the end of lifetime for the 2.x series. I didn't know that
and I
Neal Becker wrote:
> Is pep370 (per-user site-packages) available on 2.6?
Yes
--
http://mail.python.org/mailman/listinfo/python-list
Dave Angel wrote:
> The property is called __file__
>
> So in this case,filename = settings.__file__
Actually it's an attribute set by Python's import machine. Since the
__file__ attribute may contain a relative path it's a good idea to use
os.path.abspath(__file__).
Christian
--
http://ma
Ben Finney wrote:
> If you're committed to changing the epoch anyway, I would recommend
> using http://en.wikipedia.org/wiki/Astronomical_year_numbering>
> (epoch at 4004 BCE) since it is widely used to unify dates referring to
> human history.
I prefer JDN or MJD (http://en.wikipedia.org/wiki/JDN
Chris Colbert wrote:
> if you want to use it with apapache, you need mod_wsgi.
Or you can use mod_proxy alone or with mod_rewrite if you want to stick
to the builtin webserver of cherrypy.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
M.-A. Lemburg schrieb:
> Christian Heimes wrote:
>> Ben Finney wrote:
>>> If you're committed to changing the epoch anyway, I would recommend
>>> using http://en.wikipedia.org/wiki/Astronomical_year_numbering>
>>> (epoch at 4004 BCE) since it is widel
Curious schrieb:
> On Oct 7, 4:07 pm, Roger Binns wrote:
>> Curious wrote:
>>> Ubuntu comes pre-installed with Python2.6 but this python installation
>>> is a 32 bit installation.
>> For 64 bit Ubuntu you are mistaken:
>>
>> $ file /usr/bin/python2.6
>> /usr/bin/python2.6: ELF 64-bit LSB executabl
Laszlo Nagy wrote:
> But really thread.start_new_thread is better:
>
> import thread.start_new_thread as thr
>
> thr(my_function,arg1,arg2)
Please don't use the thread module directly, especially the
start_new_thread function. It a low level function that bypasses the
threading framework. The is
Hendrik van Rooyen wrote:
> What does the Threading module buy me, other than a formal OO approach?
* the interpreter won't know about your thread when you bypass the
threading module and use the thread module directly. The thread isn't in
the list of active threads and the interpreter is unable t
Ulrich Eckhardt wrote:
> No, as this one doesn't give me a handle to the thread. I also find this
> barely readable, for sure it doesn't beat the readability of the proposed
> function.
Roll your own convenient function, though. :) At work we have this short
function in our tool box:
def daemonth
Dr. Phillip M. Feldman schrieb:
> I currently have a function that uses a list internally but then returns the
> list items as separate return
> values as follows:
>
> if len(result)==1: return result[0]
> if len(result)==2: return result[0], result[1]
>
> (and so on). Is there a cleaner way to
Laszlo Nagy wrote:
> IMHO it is much cleaner to implement this as a decorator. Pro:
> transparent passing of positional and keyword arguments, keeps function
> documentation.
You are entitled to your opinion but I STRONGLY recommend against your
decorator. You MUST NOT start threads a a side eff
Peng Yu schrieb:
> Hi,
>
> I'm wondering what is the general way to define __hash__. I could add
> up all the members. But I am wondering if this would cause a
> performance issue for certain classes.
> def __hash__(self):
> return self._a + self._b
The hash of a tuple is based on the ha
raffaele ponzini schrieb:
> Dear all,
> I have a question concerning the output of the id() function.
> In particular since is should:
> ""
> Return the identity of an object. This is guaranteed to be unique among
> simultaneously existing objects. (Hint: it's the object's memory address.)
> ""
>
Andre Engels schrieb:
> What is going on is that a few objects that are often used, in
> particular the small (how small is small depends on the
> implementation) integers, are 'preloaded'. When one of these is then
> referred to, a new object is not created, but the pre-defined object
> is used. 1
Chris Rebert wrote:
> The built-ins aren't mutable, and the singletons are each immutable
> and/or unique; so in no case do objects that are both different and
> mutable have the same ID.
Correct, the fact allows you to write code like "type(egg) is str" to
check if an object *is* an instance of s
Mel wrote:
> As Python has evolved the semantics have got richer, and the implementation
> has got trickier with proxy objects and wrapped functions and more.
> Whatever use there was for `is` in ordinary code is vanishing.
'is' has important use cases but it's not trivial to use if you leave
t
Fred P wrote:
> Is there any tool and/or methodology I could use to at least pinpoint the
> exact DLL that libpyexiv2 is failing to load, and ideally also the reason
> why ?...
The depencency walker http://www.dependencywalker.com/ works fine for me.
Christian
--
http://mail.python.org/mailma
MRAB wrote:
> You could use multithreading: put the commands into a queue; start the
> same number of worker threads as there are processors; each worker
> thread repeatedly gets a command from the queue and then runs it using
> os.system(); if a worker thread finds that the queue is empty when it
Alan G Isaac schrieb:
> I expected this to be fixed in Python 3:
>
sum(['ab','cd'],'')
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: sum() can't sum strings [use ''.join(seq) instead]
>
> Of course it is not a good way to join strings,
> but it should work, shou
Alan G Isaac schrieb:
> On 10/16/2009 3:40 PM, Tim Chase wrote:
>> What's always wrong is giving me an *error* when the semantics are
>> perfectly valid.
>
>
> Exactly.
> Which is why I expected this to be fixed in Python 3.
It's not going to happen.
Christian
--
http://mail.python.org/mailma
Alan G Isaac wrote:
> On 10/16/2009 5:03 PM, Christian Heimes wrote:
>> It's not going to happen.
>
> That's a prediction, not a justification.
It's not a prediction, it's a statement. It's not going to happend
because it violates Guido's gut fe
Benjamin Middaugh schrieb:
> I'm trying to make an integer that is the reverse of an existing integer
> such that 169 becomes 961. I guess I don't know enough yet to figure out
> how to do this without a ton of awkward-looking code. I've tried for
> loops without much success. I guess I need a g
Martin Shaw wrote:
> I have a tkinter application running on my windows xp work machine and I am
> attempting to stop the console from appearing when the application runs.
> I've researched around and the way to do this appears to be to use
> pythonw.exe instead of python.exe. However when I try to
Michael Ströder wrote:
> - snip -
> /usr/src/Python-2.6.4rc2> make
> 'import site' failed; use -v for traceback
> Traceback (most recent call last):
> File "./setup.py", line 15, in
> from distutils.command.build_ext import build_ext
>
KillSwitch wrote:
> int main(int argc, char *argv[])
> {
> Py_Initialize();
>
> const char* filename = "asdf.py";
>
> const char* str = "print('lol')";
>
> Py_CompileString(str, filename, 0);
>
> Py_Finalize();
> system("PAUSE");
> return 0;
> }
>
> On
Toff wrote:
> hello
>
> i can't parse a file with lxml
>
>
>
>
>
>
> http://download.mozilla.org/?
> product=firefox-3.5&os=win&lang=fr" />
>
>
> =
Bakes wrote:
> Can I use a pyd compiled on linux in a Windows distribution?
>
> Or must I recompile it for windows users?
On Linux and several other Unices the suffix is .so and not .pyd. The
compiled extensions depend on the Python version, operating system as
well as platform and architecture.
Philip Guo wrote:
> Does anyone know how to get this information either from a code object or
> from a related object? I am hacking the interpreter, so I have full access
> to everything.
Does this help?
>>> class A(object):
... def method(self):
... pass
...
>>> A.method.im_class
>
metal wrote:
> But this style makes code full with ugly self.__class__
>
> Any standard/pythonic way out there?
You are already using one standard way to implement an alternative
constructor.
If you don't need any instance attributes you can use another way:
class Egg(object):
@classmethod
Lawrence D'Oliveiro schrieb:
> In message , Christian
> Heimes wrote:
>
>> On Linux and several other Unices the suffix is .so and not .pyd.
>
> Why is that? Or conversely, why isn't it .dll under Windows?
.so is the common suffix of shared libraries on Linux. I
Jorge wrote:
> Hi,
> to access firebird data bases which shall I use kinterbasdb or sqlalchemy.
You have to use kinterbasdb. SQLAlchemy is not a DBA but an ORM.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Peng Yu wrote:
> It seems that int() does not convert '1e7'. I'm wondering what
> function to use to convert '1e7' to an integer?
1e7 is a way to express a float in science and math. Try float("1e7")
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Zac Burns wrote:
> Using python 2.6
>
> cPickle.dumps has an import which is causing my application to hang.
> (figured out by overriding builtin.__import__ with a print and seeing
> that this is the last line of code being run. I'm running
> cPickle.dumps in a thread, which leads me to believe th
kj wrote:
> Because the problem that gave rise to this question is insignificant.
> I would want to know the answer in any case. *Can* it be done in
> Python at all?
>
> OK, if you must know:
>
> With Perl one can set a module-global variable before the module
> is loaded. This provides a very
Diez B. Roggisch wrote:
> with open("/sys/class/net/wlan1/device/tx_power", "w") as f:
> f.write("%i" % POWER)
IIRC the sys and proc virtual file system requires new line at the end
of a modifier. At least echo appends \n unless it's told otherwise.
Christian
--
http://mail.python.org/mail
701 - 800 of 1052 matches
Mail list logo