the problem was: ActivePython does not install debug libraries, so you must
link with release libraries in your project. but if you run the debug version,
you're linking against debug libraries which conflict with the ones linked to
by python.
"fixed" by running the release version. basical
note that when the script is called, i DO see this in the output window:
> 'kJams 2 Debug.exe': Loaded 'C:\Python27\Lib\site-packages\win32\win32api.pyd'
> 'kJams 2 Debug.exe': Loaded 'C:\Windows\SysWOW64\pywintypes27.dll'
> 'kJams 2 Debug.exe': Unloaded
> 'C:\Python27\Lib\site-packages\win32\win
I find i'm having this problem, but the solution you found isn't quite specific
enough for me to be able to follow it.
I'm embedding Python27 in my app. I have users install ActivePython27 in order
to take advantage of python in my app, so the python installation can't be
touched as it's on a
Thank you for your thoughtful and thorough response. I now understand much
better what you (and apparently the others) were warning me against and I will
certainly consider that moving forward.
I very much appreciate your help as I learn about python and embedding and all
these crazy encoding
I am very sorry that I have offended you to such a degree you feel it necessary
to publicly eviscerate me.
Perhaps I could have worded it like this: "So far I have not seen any troubles
including unicode characters in my strings, they *seem* to be fine for my
use-case. What kind of trouble ha
i am already doing (3), and all is working perfectly. bytestring literals are
fine, i'm not sure what this trouble is that you speak of.
note that i'm not using PyRun_AnyFile(), i'm loading the script myself, assumed
as utf8 (which was my original problem, i had assumed it was macRoman), then
i got it!! OMG! so sorry for the confusion, but i learned a lot, and i can
share the result:
the CORRECT code *was* what i had assumed. the Python side has always been
correct (no need to put "u" in front of strings, it is known that the bytes are
utf8 bytes)
it was my "run script" function
fair enough. I can provide further proof of strangeness.
here is my latest script: this is saved on disk as a UTF8 encoded file, and
when viewing as UTF8, it shows the correct characters.
==
# -*- coding: utf-8 -*-
import time, kjams, kjams_lib
def log_success(msg, successB, s
i'm sorry this is so confusing, let me try to re-state the problem in as clear
a way as i can.
I have a C++ program, with very well tested unicode support. All logging is
done in utf8. I have conversion routines that work flawlessly, so i can assure
you there is nothing wrong with logging and
> What _are_ you using?
i have scripts in a file, that i am invoking into my embedded python within a
C++ program. there is no terminal involved. the "print" statement has been
redirected (via sys.stdout) to my custom print class, which does not specify
"encoding", so i tried the suggestion a
> I see you are using Python 2
correct
> Firstly, in Python 2, the compiler assumes that the source code is encoded in
> ASCII
gar, i must have been looking at doc for v3, as i thought it was all assumed to
be utf8
> # -*- coding: utf-8 -*-
okay, did that, still no change
> you need to use u"
note everything works great if i use Ascii, but:
in my utf8-encoded script i have this:
> print "frøânçïé"
in my embedded C++ i have this:
PyObject* CPython_Script::print(PyObject *args)
{
PyObject*resultObjP = NULL;
const char *utf8_
Hi all,
This is an old thread, but I'm having the same behavior in my terminal when
I run some code but kill the process in the terminal (Ctrl-C). The code has
two prime suspects (from a simple google search):
1. Creates ssh port forward via the subprocess module
(http://unix.stackexchange.com/q
i was able to get what i wanted by simply iterating over the tupile instead of
using ParseTupile, then just query the type, then convert the type to C and
move on to the next. totally great, now i can pass N different argument types
to a single function, and have the C side deal gracefully with
I'd like to be able to use PyArg_ParseTuple() in a generic way.
for example, i'd like to have all commands start with 1 integer parameter, and
this "commandID" will inform me of what parameters come next (via LUT).
knowing that i can then call ParseTuple again with the proper parameters.
like t
okay, well that might turn out to be useful, except i don't quite know how to
use it, and there are no "from scratch" instructions.
i managed to download "py2exe-0.6.9.zip" and unzip it, but how does one
"install" this package? (yes, still a newb at that)
then, once installed, how do i say "in
yes, i've looked there, and all over google. i'm quite expert at embedding at
this point.
however nowhere i have looked has had instructions for "this this is how you
package up your .exe with all the necessary python modules necessary to
actually run on a user's system that does not have pyth
Okay, i'm really surprised nobody knows how to do this. and frankly i'm amazed
at the utter lack of documentation. but i've figured it out, and it's all
working beautifully.
if you want the code, go here:
http://karaoke.kjams.com/wiki/Python
--
http://mail.python.org/mailman/listinfo/python-l
nooobody knw
the trouble a s...
--
http://mail.python.org/mailman/listinfo/python-list
in my C++ app, on the main thread i init python, init threads, then call
PyEval_SaveThread(), since i'm not going to do any more python on the main
thread.
then when the user invokes a script, i launch a preemptive thread
(boost::threads), and from there, i have this:
static int
DOH! as my second thread, i had been using a sample script that i had
copy-pasted without much looking at it. guess what? it prints the time. and
yes, it did "from time import time", which explains it all.
thanks for the hints here, that helped me figure it out!
--
http://mail.python.org/mai
no, there is no "time.py" anywhere (except perhaps as the actual python library
originally imported)
did you understand that the function works perfectly, looping as it should, up
until the time i run a second script on a separate thread?
--
http://mail.python.org/mailman/listinfo/python-list
okay, i have simplified it: here is the code
==
import time
def main():
while True:
print "i'm alive"
time.sleep(0.25)
#-
if __name__ == "__main__":
main()
===
does nobody know how to do this?
does nobody know where proper documentation on this is?
--
http://mail.python.org/mailman/listinfo/python-list
in my app i initialize python on the main thread, then immediately call
PyEval_SaveThread() because i do no further python stuff on the main thread.
then, for each script i want to run, i use boost::threads to create a new
thread, then on that thread i "ensure" the GIL, do my stuff, then release
what must i include in my app package if i'm embedding python?
i tried including *everything* in the "DLLs" directory, but my app still
crashes as soon as i attempt to initialize python.
this is on a system that does not have python installed, as most of my users
won't have it. is it actually
Okay the link problem was solved: i had installed a 64bit python and my app is
32bit.
i'm using ActivePython installer from here:
http://www.activestate.com/activepython/downloads
it seems that now the problem is that this does not install the _d versions of
the .lib. :(
does anyone know how
update: okay so the python27.dll is in /windows/system32 so ignore that
i've set my include directory correct, so i can compile
i've set my "additional libraries" directory to the "libs" directory (where the
".lib" files are. (note: NOT including "Lib" directory, cuz that's full of .py
files a
> > Now for Windows: same thing, i think i must create a .dll, right?
> you should already have a python.dll in your installation
i can find "python27.lib" in the "libs" folder, but there is no
"python27_d.lib", and there is no "python27.dll" in the DLLs folder?
are there instructions for creati
> http://karaoke.kjams.com/wiki/Python
nevermind, i got it, it's working now (see link for code)
--
http://mail.python.org/mailman/listinfo/python-list
i don't use stdout in my own code, my code goes to my own log file. i want the
output from any python code to go to my existing log file, so log statements
from my app and any python code are intermingled in that one file.
my updated code is here, which now bridges my python print function to m
well, umm, gosh, now i feel quite silly. that was easy. okay that's done.
next: i'd like to redirect the output of any "print" statements to my C
function:
> voidLog(const unsigned char *utf8_cstrP);
on the mac, python output sys.stdout goes into the debug console if you're in
the
i'm targeting Mac and Windows. Let's skip the thing about "it should work when
my app isn't running", just assume it's going to be embedded, no pipes or
sockets necessary.
For Mac, I understand i need to "create" (?) a python.dylib, but i find no
directions for that at the expected location:
i'd like my app to be "available" to python while it's running.
for example, say my app is "FooBar.app".
when my FooBar.app is running, now there is a python interface available to
python, and the user can write python scripts to make use of it.
with their scripts, they can control my running a
> Literally any idea will help, pen and paper, printing off all the code
and doing some sort of highlighting session - anything!
> I keep reading bits of code and thinking "well where the hell has that
been defined and what does it mean" to find it was inherited from 3
modules up the chain.
>
> Roy Smith
> As part of our initial interview screen, we give applicants some small
> coding problems to do. One of the things we see a lot is what you could
> call "Java code smell". This is our clue that the person is really a
> Java hacker at heart who just dabbles in Python but isn't
Νίκος Γκρ33κ :
>> What paramstyle are you using?
>
>Yes it is Chris, but i'am not sure what exactly are you asking me.
>Please if you cna pout it even simper for me, thank you.
For instance:
>>> import MySQLdb
>>> MySQLdb.paramstyle
'format'
FWIW and HTH,
DC
--
http://mail.python.org/mailman
Lovely, thanks for the ideas! I remember considering having release()
pick the next thread to notify, where all the waiters were sitting on
separate Conditions or whatever; not sure why I didn't pursue it to the
end. Probably distracted by something shiny; or insufficient brainpower.
:) D
Okay, next silly question. :)
We have a very simple multi-threaded system where a request comes in,
starts running in a thread, and then (zero, one, or two times per request)
gets to a serialization point, where the code does:
with lock:
do_critical_section_stuff_that_might_take_awhile()
> w...@mac.com
> Something like:
> Does a log file exist? -> No -> First run; create log file & continue
> |
> Yes
> |
> Read backwards looking for date change, copy lines after change
> to new file, delete from old file.
Yep, I'm concluding that also.
It just wasn
> d...@davea.name
>
> On 10/23/2012 11:23 AM, David M Chess wrote:
> > We have a TimedRotatingFileHandler with when='midnight'
>
> You give us no clue what's in this class, or how it comes up with the
> filenames used.
Sorry if I was
> jorge
> I'm programming a server that most send a message to each client
> connected to it and nothing else. this is obviously a base of what i
> want to do. the thing is, I made a class wich contains the Handler class
> for the ThreadingTCPServer and starts the server but i don't know how
We have a TimedRotatingFileHandler with when='midnight'.
This works great, splitting the log information across files by date, as
long as the process is actually up at midnight.
But now the users have noticed that if the process isn't up at midnight,
they can end up with lines from two (or I g
> If you (the programmer) want a function that asks the user to enter a
> literal at the input prompt, you'll have to write a post-processing for
> it, which looks for prefixes, for quotes, for backslashes, etc., and
> encodes the result. There very well may be such a decoder in the Python
> libra
or advice greatly appreciated.
DC
David M. Chess
IBM Watson Research Center
--
http://mail.python.org/mailman/listinfo/python-list
you have any suggestions that might help me out here? I would really
appreciate your input.
Thank you,
David M Covey Sr.
ad...@daffitt.com
--
http://mail.python.org/mailman/listinfo/python-list
On 11/13/2009 3:26 PM, Aahz wrote:
> Ken Thompson's classic paper on bootstrapped malware
> finally gets a rebuttal:
>
> http://lwn.net/Articles/360040/
thanks for pointing this out.
-- david
--
http://mail.python.org/mailman/listinfo/python-list
On 11/12/2009 11:26 AM, Dave Angel wrote:
> Try http://fireftp.mozdev.org/
in the past i found this to be buggy. i'd recommend
something different.
what is your OS?
-- david
--
http://mail.python.org/mailman/listinfo/python-list
Martin v. Löwis v.loewis.de> writes:
> > This is a good test for Python implementation bottlenecks. Run
> > that tokenizer on HTML, and see where the time goes.
>
> I looked at it with cProfile, and the top function that comes up
> for a larger document (52k) is
> ...validator.HTMLConformanceCh
On Jun 10, 11:24 pm, David Wilson wrote:
> Hi,
>
> During a fun coding session yesterday, I came across a problem that I
> thought was already solved by itertools, but on investigation it seems
> it isn't.
>
> The problem is simple: given one or more ordered sequences, return
> only the objects th
On Jun 11, 12:59 am, Jack Diederich wrote:
> On Wed, Jun 10, 2009 at 6:24 PM, David Wilson wrote:
> > During a fun coding session yesterday, I came across a problem that I
> > thought was already solved by itertools, but on investigation it seems
> > it isn't.
>
> > The problem is simple: given on
On Jun 11, 3:05 am, Chris Rebert wrote:
> On Wed, Jun 10, 2009 at 5:53 PM, Mensanator wrote:
> > On Jun 10, 5:24 pm, David Wilson wrote:
> >> Hi,
>
> >> During a fun coding session yesterday, I came across a problem that I
> >> thought was already solved by itertools, but on investigation it seem
On 5/16/2009 5:26 PM, Aahz wrote:
> On Sat, May 16, 2009, Pete wrote:
>
>> python-concurre...@googlegroups.com is a new email list
>> for discussion of concurrency issues in python.
>
> Is there some reason you chose not to create a list on
> python.org? I'm not joining the list because Google
>
Going to see if Newsproxy actually blocks google groups.
-=___=-
David M Lemcoe Jr.
Roswell, Georgia
http://www.davidlemcoe.com/
[EMAIL PROTECTED]
QRZ: KI4YJL
AIM: lemcoe9
YIM: lemcoe9
GTalk: [EMAIL PROTECTED]
MSN: [EMAIL PROTECTED]
Xfire: shawtylo1
ICQ: 359114839
Hello [EMAIL PROTECTED],
No language is better than another because Python is not intended for the
same uses and/or people.
Your question has no place here.
David
-=___=-
David M Lemcoe Jr.
Roswell, Georgia
http://www.davidlemcoe.com/
[EMAIL PROTECTED]
QRZ: KI4YJL
Hello Michael,
Any people that use Python as the predominant language for their game
development here?
~Michael
Well, I make little CLI games that are extremely basic and have no actual
graphics, but i'm sure a few people actually use them in video games.
David
--
http://mail.python.org
pdb.set_trace()
at the point you want the debugger to stop. Useful if you want to
break after some failing condition, for instance.
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] (David M. Cooke) writes:
>
> Bruno's already mentioned that iterators and generators aren't
> sequences. Numpy arrays act like the other sequence types:
>
>>>> a = numpy.array([])
>>>> a
> array([], dtype=int64)
>>>> le
iterators and generators aren't
sequences. Numpy arrays act like the other sequence types:
>>> a = numpy.array([])
>>> a
array([], dtype=int64)
>>> len(a)
0
>>> bool(a)
False
(0-dimensional numpy arrays are pathological anyways)
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
ipy/numpy/
>
>
> * numpy should install now with easy_install from setuptools
Note that you'll need to use the latest setuptools (0.6b1). The hacks
I added to get easy_install and numpy.distutils to get along are hard
enough without trying to be backward compatible :-(
--
|>|\
e you'd probably want to use numpy. We've optimized x**n so
that it does handle n=0.5 and integers specially; it makes more sense
to do this for an array of numbers where you can do the special
manipulation of the exponent, and then apply that to all the numbers
in the array at once.
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
Python 2.4 :-) Lost comments and stuff, but the code came out great.
--
|>|\/|<
/------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
s installed) it's really to
compile: python setup.py build && python setup.py install.
Do you need Tiger (10.4) or Panther (10.3) compatibility?
--
|>|\/|<
/------\
|David M. Cooke
|cookedm(at)physics(dot)mcmas
li
There's also pyPDF, at http://pybrary.net/pyPdf/. I haven't tried it,
but it looks interesting.
--
|>|\/|<
/------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
I am fairly new to Python and trying to figure out a syntax error
concerning lists and iteration through the same. What I am trying to do is
sum a list of float values and store the sum in a variable for use later.
The relevant code looks like this -
def getCredits():
""" This func
r module
scipy.random. It's actually used to wrap some C code, but it does the
job well.
--
|>|\/|<
/------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
Thanks but the C Struct describing the data doesn't match up with the
list on the module-struct page.
this is the acct.h file
#ifndef _SYS_ACCT_H
#define _SYS_ACCT_H 1
#include
#define __need_time_t
#include
#include
__BEGIN_DECLS
#define ACCT_COMM 16
/*
comp_t is a 16-bit "floating
OK so here is my task. I want to get at the data stored in
/var/account/pacct, which stores process accounting data, so that I can
make it into a more human understandable format then what the program
sa can do. The thing is, its in a binary format and an example program
that reads some data from
a6 = -0.00019 84090
a8 = 0.0 27526
a10= -0.0 00239
x2 = x**2
return 1. + x2*(a2 + x2*(a4 + x2*(a6 + x2*(a8 + x2*a10
(or least that's what I like to write). Now, if I were going to higher
precision, I'd have more digits of course.
--
|>|\/|<
/-
TY_HOLE_PASS_AUTHORIZATION.html
>From what I can see, this is still true in Apache 2.
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
ally an "iskeyword" function
there :)
For modules, sys.modules is a dictionary of the modules that have been
imported.
--
|>|\/|<
/------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern <[EMAIL PROTECTED]> writes:
> greg wrote:
>> David M. Cooke wrote:
>>
>>>>To solve that, I would suggest a fourth category of "arbitrary
>>>>ordering", but that's probably Py3k material.
>>>
>>>We've
orget the one module to rule them all, subprocess:
file_list = subprocess.Popen(['ls'], stdout=subprocess.PIPE).communicate()[0]
which by default won't use the shell (unless you pass shell=True to it).
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
y size:
[1+2j, 3+4j].sort(key=abs)
and since .sort() is stable, for those numbers where the key is the
same, the order will stay the same.
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
's doable.
It should also be doable with Maple, using the OpenMaple API. I've
looked at it, and it should be possible. I haven't had the time to
actually do anything, though :-)
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
to handle
than the general case.
--
|>|\/|<
/------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
o could be included in the desc field.
return PyCObject_FromVoidPtr(dib, NULL)
(the NULL can be replaced with a routine that will free the image.)
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
/scipy.org) has wraps for FFTW (Fast
Fourier Transform in the West).
--
|>|\/|<
/------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
versioned form, db_create_4002). Running 'nm -D -g' on the
libsvn_fs_base library shows it uses the same db_create_4002 function.
--
|>|\/|<
/--\
|David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/
|[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
/usr/lib/libtasn1.so.2 (0x002a96d1b000)
libgcrypt.so.11 => /usr/lib/libgcrypt.so.11 (0x002a96e2b000)
libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x002a96f77000)
libz.so.1 => /usr/lib/libz.so.1 (0x002a9707b000)
If it doesn't look like that, then
use threads, use a Queue.Queue object where
timestamps w/ state changes are pushed on in thread 1, and popped
off and analysed before logging in thread 2. (Or something; this
just popped in my head.)
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
you could use
>>> import numarray.ieeespecial
>>> numarray.ieeespecial.plus_inf
inf
(there's minus_inf, nan, plus_zero, and minus_zero also)
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
objects can fail. If you *know* A and B
objects can't be compared for equality, it'd be ok to raise a
TypeError, but that should be after a type test.
> Also, do you need to increment the reference count
> of Py_NotImeplemented before returning it?
Yes; it's a singleton like Py_None.
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
some
customization options that might be helpful. In particular, I'd try
import Gnuplot
Gnuplot.GnuplotOpts.prefer_fifo_data = 0
... then the data will be save to a temporary file instead of piped
through a fifo.
Alternatively, try
Gnuplot.GnuplotOpts.prefer_inline_data = 1
... then no file will be used.
[I don't use Gnuplot myself; this is just what I came up with after a
few minutes of looking at it]
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
anything numerical in Python, you'll want them :-)
--
|>|\/|<
/------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
():
val = testme()
wi = int(val >> 4)
bi = int(val & 0xF)
print wi
print bi
print tbl[wi,bi]
and that'll work.
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
true anymore, of course (it was in 2.2.3). In 2.3.5, UserDict,
tarfile and some the Mac-specific module use classmethod, and the
datetime extension module use the C version (the METH_CLASS flag).
And staticmethod (and METH_STATIC) aren't used at all in 2.3 or 2.4 :-)
[if you ignore __new__]
--
so makes it easier to know what is a global :-)
--
|>|\/|<
/------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
ctly this approach, with some extra frills:
looking in subdirectories, for instance.
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
make things easier on yourself; the
documentation has a good overview:
http://www.python.org/doc/2.4/lib/module-cgi.html
In this case, your script would look something like this:
import cgi
form = cgi.FieldStorage()
if form.getvalue('sort') == 'ascending':
... sort in asce
r:
def __init__(self, text):
self.m = None
self.text = text
def match(self, pat):
self.m = pat.match(self.text)
return self.m
def __getitem__(self, name):
return self.m.group(name)
Then, use it like
for line in fo:
m = Matcher(line)
if m.matc
t;, "&",
and "%20value"? The xml.sax.handler.ContentHandler.characters method
(which I presume you're using for SAX, as you don't mention!) is not
guaranteed to get all contiguous character data in one call. Also check
if .skippedEntity() methods are firing.
--
|>
m.
Are you sure it's monkey/chicken/dog/cat, and not
monkey\chicken\dog\cat? The later one will print monkey\\chicken...
because of the repr() call.
Also, you probably want it as [\x20-\x7e] (the DEL character \x7f
isn't printable). You're also missing tabs (\t).
The
the name of the python file, minus the ".py" extension.
You'd better hope someone doesn't name their plugin
'os; os.system("rm -rf /"); import sys'
Use __import__ instead.
--
|>|\/|<
/--
is more suited to type testing
(for example, writing "isinstance(f, file)").
"""
... which more accurately reflects what I believe the consensus is
about the usage of open vs. file.
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
27;s linked, then it's not being installed right.
You don't have a previous Numeric installation that's being picked up
instead of the one you're trying to install, do you?
At the interpreter prompt, check that
>>> import Numeric
>>> Numeric.__file_
, and set some directories)
Also set use_dotblas to 1.
- do the 'python setup.py build', 'python setup.py install' dance.
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
st version is 23.7. It should be
real easy to upgrade to that, as that version picks up Apple's vecLib
framework for the linear algebra routines. Just do the usual 'python
setup.py build', 'sudo python setup.py install'. That should put the
header files where the MMTK install
^
I think that's your error. The extension type is declared to be
hyper.PeriodicGrid, where it actually is model.hyper.PeriodicGrid
(because hyper is in the model package).
Pickle stores g.__class__.__module__ (which is "hyper") and
g.__class__.__name__ (="PeriodicGrid") to find the class object for
reimporting, and on unpickling, tries to do __import__("hyper"), which
fails.
The tp_name slot of your extension type should be "model.hyper.PeriodicGrid".
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
rted a few times.
You'll want to change it to
def swig_sources(self, sources, extension=None):
so that if you use an older python it won't complain about missing
arguments.
--
|>|\/|<
/--\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 108 matches
Mail list logo