Trouble importing module using swig and python

2008-10-10 Thread Basha J P M
I am beginner in python. I am working through the tutorial examples from http://www.swig.org/ and have run into some problems. I took the following command instructions from the tutorial on swig.org: http://www.swig.org/tutorial.html I have written example.c and example.i as described in the abo

Re: Interconvert a ctypes.Structure to/from a binary string?

2008-08-02 Thread Andrew P. Lentvorski, Jr.
On Aug 1, 11:35 pm, Andrew Lentvorski <[EMAIL PROTECTED]> wrote: > Basically, I'd like to use the ctypes module as a much more descriptive > "struct" module. > > Is there a way to take a ctypes.Structure-based class and convert it > to/from a binary string? > > Thanks, > -a After chugging through

Re: Manipulating MySQL Sets

2009-12-13 Thread Robert P. J. Day
to expect, how could you > possibly write code that produces what you expect? (Don't answer > this question. It's a rhetorical question.) http://twitter.com/rpjday/status/6576145809 rday -- ==== Robert P. J.

Re: Manipulating MySQL Sets

2009-12-13 Thread Robert P. J. Day
On Sun, 13 Dec 2009, Victor Subervi wrote: > On Sun, Dec 13, 2009 at 11:56 AM, Robert P. J. Day > wrote: > On Sun, 13 Dec 2009, Victor Subervi wrote: > > > On Sun, Dec 13, 2009 at 11:36 AM, Carsten Haese > > > wrote: > >      

Re: can i examine the svn rev used to build a python 3 executable?

2010-01-19 Thread Robert P. J. Day
On Tue, 19 Jan 2010, Robert P. J. Day wrote: > i'm currently checking out python3 from the svn repo, configuring, > building and installing under /usr/local/bin on my fedora 12 system, > all good. > > i'm curious, though -- is there a query i can make of that > e

can i examine the svn rev used to build a python 3 executable?

2010-01-19 Thread Robert P. J. Day
sing not, but i thought i'd ask. rday -- ==== Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting, Training and Kernel Pedantry. Web page:

how to check if a module is importable?

2010-01-20 Thread Robert P. J. Day
run "import" -- is that the accepted way to test? rday -- ==== Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting, Training and Kernel Pedantry.

examining an initial, pristine python3 shell session

2010-01-20 Thread Robert P. J. Day
ell session looks like before starting to import things, then seeing how that importing changes the session before getting down to actual programming. what other useful commands might i run immediately after starting a session whose output would be informative? i can certainly poke at s

Re: how to check if a module is importable?

2010-01-20 Thread Robert P. J. Day
On Thu, 21 Jan 2010, Lie Ryan wrote: > On 01/20/10 19:58, Robert P. J. Day wrote: > > > > finally getting back to clawing my way thru the python 3 book so > > probably a number of newbie questions coming up. first one -- can i > > check if a module is importab

Re: examining an initial, pristine python3 shell session

2010-01-20 Thread Robert P. J. Day
On Wed, 20 Jan 2010, Alf P. Steinbach wrote: > * Robert P. J. Day: ... snip ... > > what other useful commands might i run immediately after > > starting a session whose output would be informative? i can > > certainly poke at some of those objects to see them in

deleting, then re-importing a class method

2010-01-21 Thread Robert P. J. Day
or is there an operator other than "import" that more represents a full refresh of a class? rday p.s. no, i don't have a valid application of the above, i'm just trying to break things. -- Robert P

how to list the attributes of a class, not an object?

2010-01-24 Thread Robert P. J. Day
3 that exists? being able to print off the entire language spec on two or four pages and tacking it up in front of me would be just ducky. thanks. -- ==== Robert P. J. Day Waterloo, Ontario, CANADA

Re: how to list the attributes of a class, not an object?

2010-01-24 Thread Robert P. J. Day
On Sun, 24 Jan 2010, Alf P. Steinbach wrote: > * Robert P. J. Day: > > once again, probably a trivial question but i googled and didn't > > get an obvious solution. how to list the attributes of a *class*? > > > > eg., i was playing with dicts and noticed t

listing an object's methods/attributes?

2009-11-05 Thread Robert P. J. Day
that go again? rday -- ==== Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting, Training and Kernel Pedantry. Web page: http://crashcourse.ca Twitter: http:

why does "help(import)" not work?

2009-11-06 Thread Robert P. J. Day
)" and type "import" to get that help. it seems counter-intuitive to have the first variation fail but the second succeed. what is the rule for this in python3? rday -- ==== Robert P. J. Day

Re: Program to compute and print 1000th prime number

2009-11-07 Thread Robert P. J. Day
g to http://code.activestate.com/recipes/366178/. rday -- ==== Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting, Training and Kernel Pedantry. Web page:

Re: Program to compute and print 1000th prime number

2009-11-07 Thread Robert P. J. Day
. answer: go to the building manager and say, "i'll give you this really neat barometer if you tell me how tall this building is." rday -- Robert P. J. Day

how to display the return type of an os method?

2009-11-07 Thread Robert P. J. Day
ns a posix.stat_result object in one line. how dumb a question is that? rday -- ==== Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting, Training and Kernel Pedantry. Web page

Re: What is the best way to delete strings in a string list that that match certain pattern?

2009-11-07 Thread Robert P. J. Day
other users' life easier. huh? why do you need the slice notation on the left? why can't you just assign to "dirs" as opposed to "dirs[:]"? using the former seems to work just fine. is this some kind of python optimization or idiom? rday -- =

Re: how to display the return type of an os method?

2009-11-07 Thread Robert P. J. Day
On Sat, 7 Nov 2009, Bruno Desthuilliers wrote: > Robert P. J. Day a écrit : > > once again, a thoroughly newbie question but what's the quickest way > > to display the return type of, say, os.stat()? i can obviously do > > this in two steps: > > > >>

Re: My own accounting python euler problem

2009-11-07 Thread Robert P. J. Day
iv897/sqg/dads/HTML/knapsackProblem.html it's NP-complete. rday -- ==== Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting, Training and Kernel Pedantry. Web page:

Re: My own accounting python euler problem

2009-11-07 Thread Robert P. J. Day
give higher value to paying off older invoices. that's how the general knapsack problem works. rday -- Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting, Training and Kernel Pedantry. Web page:

Re: My own accounting python euler problem

2009-11-08 Thread Robert P. J. Day
ent invoices of equal amounts? i would be reluctant to use the word "subset" in a context where you can have more than one element with the same value. rday -- Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting, T

python simply not scaleable enough for google?

2009-11-11 Thread Robert P. J. Day
http://groups.google.com/group/unladen-swallow/browse_thread/thread/4edbc406f544643e?pli=1 thoughts? rday -- Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting

starting with python 3.1 vs 3.2, and "test_telnetlib"

2009-11-11 Thread Robert P. J. Day
test error is complaining about -- that it can't find a listening telnet server? -- Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting, Training and Kernel Pedantry. Web page: http://cr

Re: Code for finding the 1000th prime

2009-11-15 Thread Robert P. J. Day
Science and Programming. Thanks, Ray it's 7919. rday -- ==== Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting, Training and Kernel Pe

Re: Deformed Form

2010-06-10 Thread Stephen Hansen (L/P)
On 6/10/10 7:14 AM, Victor Subervi wrote: > Hi; > I have a script that calls values from the form that calls it. This script > imports another script: > > from New_Passenger import New_Passenger > > def create_edit_passengers3(): > ... > new_passengers_curr_customers = New_Passengers_Curr_Cus

Re: Using Classes

2010-06-24 Thread Alf P. Steinbach /Usenet
* Mag Gam, on 24.06.2010 13:58: I have been using python for about 1 year now and I really like the language. Obviously there was a learning curve but I have a programing background which made it an easy transition. I picked up some good habits such as automatic code indenting :-), and making my

Re: Decorators, with optional arguments

2010-07-02 Thread Alf P. Steinbach /Usenet
* Stephen Hansen, on 02.07.2010 19:41: Okay, so! I actually never quite got around to learning to do deep and useful magic with decorators. I've only ever done the most basic things with them. Its all been a little fuzzy in my head: things like what order decorators end up being called in if the

Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread Alf P. Steinbach /Usenet
* Steven D'Aprano, on 03.07.2010 16:24: On Sat, 03 Jul 2010 08:46:57 -0400, D'Arcy J.M. Cain wrote: On Fri, 02 Jul 2010 22:40:34 -0700 John Nagle wrote: Not according to Vex's published package list: http://www.vex.net/info/tech/pkglist/ Hold on. That *is* the generated list

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-06 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 06.07.2010 17:50: Just a little reminder: Microsoft has withdrawn VS2008 in favor of VS2010. The express version is also unavailable for download.>:(( We can still get a VC++ 2008 compiler required to build extensions for the official Python 2.6 and 2.7 binary installers her

Argh! Name collision!

2010-07-06 Thread Alf P. Steinbach /Usenet
name "pyni" occurred to me. "pyni"! Pronounced like "tiny"! Yay! I sat down and made my first Python extension module, following the tutorial in the docs. It worked! But, wait, perhaps some other extension is already named "piny"? Google. http://code.g

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-06 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 06.07.2010 19:35: On 6 Jul, 19:09, Thomas Jollans wrote: Okay, you need to be careful with FILE*s. But malloc and free? You'd normally only alloc& free something within the same module, using the same functions (ie not mixing PyMem_Malloc and malloc), would you not? You h

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* Martin v. Loewis, on 07.07.2010 21:10: Python 3.1.1, file [pymem.h]: PyAPI_FUNC(void *) PyMem_Malloc(size_t); #define PyMem_MALLOC(n)(((n)< 0 || (n)> PY_SSIZE_T_MAX) ? NULL \ : malloc((n) ? (n) : 1)) The problem with the latter that it seems that it's intended for

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 07.07.2010 21:12: On 7 Jul, 06:54, "Alf P. Steinbach /Usenet" wrote: PyAPI_FUNC(void *) PyMem_Malloc(size_t); #define PyMem_MALLOC(n) (((n)< 0 || (n)> PY_SSIZE_T_MAX) ? NULL \ : malloc((n) ? (n) : 1)) I wa

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 07.07.2010 21:46: On 7 Jul, 21:41, "Alf P. Steinbach /Usenet" wrote: You still have two CRTs linked into the same process. So? CRT resources cannot be shared across CRT borders. That is the problem. Multiple CRTs are not a problem if CRT resources are ne

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* Martin v. Loewis, on 07.07.2010 21:56: Perhaps (if it isn't intentional) this is a bug of the oversight type, that nobody remembered to update the macro? Update in what way? I was guessing that at one time there was no PyMem_Malloc. And that it was introduced to fix Windows-specific problem

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* Christian Heimes, on 07.07.2010 22:47: The main problem that the required MSVC redistributables are not necessarily present on the end user's system. It's not a problem for Python anymore. It took a while to sort all problems out. Martin and other developers have successfully figured out how

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* Alf P. Steinbach /Usenet, on 07.07.2010 23:19: However developing an extension with MSVC 10 the extension will use the 10.0 CRT, which is not necessarily present on the end user's system. As I see it there are five solutions with different trade-offs: A Already having Visual Studio

Re: Argh! Name collision!

2010-07-07 Thread Alf P. Steinbach /Usenet
* rantingrick, on 07.07.2010 07:42: On Jul 6, 9:11 pm, "Alf P. Steinbach /Usenet" wrote: "pyni"! Pronounced like "tiny"! Yay! hmm, how's about an alternate spelling... "pyknee", or "pynee", or "pynie" ... considering those

Re: Argh! Name collision!

2010-07-07 Thread Alf P. Steinbach /Usenet
* Alf P. Steinbach /Usenet, on 08.07.2010 01:47: enum DoAddRef { doAddRef }; class Ptr { private: PyObject* p_; public: Ptr( PyObject* p = 0 ): p_( p ) {} Ptr( PyObject* p, DoAddRef ): p_( p ) { assert( p

How do I add method dynamically to module using C API?

2010-07-07 Thread Alf P. Steinbach /Usenet
The code below, very much work in progress, just trying things, is C++. Sorry about the formatting, I had to reformat manually for this posting: class Module { private: Ptr p_; public: Module( PyModuleDef const& def ) : p_( ::PyModule_Create( co

Re: How do I add method dynamically to module using C API?

2010-07-07 Thread Alf P. Steinbach /Usenet
looks like this: // progrock.cppy -- "C++ plus Python" // A simple C++ framework for writing Python 3.x extensions. // // Copyright (C) Alf P. Steinbach, 2010. #ifndef CPPY_MODULE_H #define CPPY_MODULE_H #include //-

Re: How do I add method dynamically to module using C API?

2010-07-08 Thread Alf P. Steinbach /Usenet
r, just a use-as-you-wish finalization callback. Nice! But I think that could be more clear in the docs... Code, for those who might be interested: // progrock.cppy -- "C++ plus Python" // A simple C++ framework for writing Python 3.x extensions. // // Copyright (C) Al

Cpp + Python: static data dynamic initialization in *nix shared lib?

2010-07-09 Thread Alf P. Steinbach /Usenet
[Cross-posted comp.lang.python and comp.lang.c++] I lack experience with shared libraries in *nix and so I need to ask... This is about "cppy", some support for writing Python extensions in C++ that I just started on (some days ago almost known as "pynis" (not funny after all)). For an extens

Re: Hello

2010-07-09 Thread Alf P. Steinbach /Usenet
* Dani Valverde, on 09.07.2010 18:31: Hello! I am new to python and pretty new to programming (I have some expertise wit R statistical programming language). I am just starting, so my questions may be a little bit stupid. Can anyone suggest a good editor for python? Cheers! If you're working in

Re: Cpp + Python: static data dynamic initialization in *nix shared lib?

2010-07-09 Thread Alf P. Steinbach /Usenet
* Ian Collins, on 09.07.2010 23:22: On 07/10/10 03:52 AM, Alf P. Steinbach /Usenet wrote: [Cross-posted comp.lang.python and comp.lang.c++] I lack experience with shared libraries in *nix and so I need to ask... This is about "cppy", some support for writing Python extensions in

Not-quite-the-module-name qualified names in extension modules? What?

2010-07-10 Thread Alf P. Steinbach /Usenet
Hi. I built the [xxmodule.c] from the source distribution, as suggested by the Python 3.1.1 docs. I named this [xx.pyd], as I believed the module name was just "xx". Indeed importing xx works fine, but when I do help(xx) I get ... >>> help( xx ) Help on module xx: NAME

Re: any issues with long running python apps?

2010-07-10 Thread Alf P. Steinbach /Usenet
* John Nagle, on 10.07.2010 20:54: On 7/9/2010 12:13 PM, Les Schaffer wrote: i have been asked to guarantee that a proposed Python application will run continuously under MS Windows for two months time. And i am looking to know what i don't know. The app would read instrument data from a serial

Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-11 Thread Alf P. Steinbach /Usenet
* rantingrick, on 11.07.2010 08:50: On Jul 11, 1:22 am, Stephen Hansen wrote: Utter nonsense. No one does that unless they are coming from C or some other language without a True/False and don't know about it, or if they are using a codebase which is supporting a very old version of Python bef

Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-11 Thread Alf P. Steinbach /Usenet
* Stephen Hansen, on 11.07.2010 09:19: On 7/10/10 11:50 PM, rantingrick wrote: It was a typo not an on purpose misspelling If this had been the first time, perhaps. If you had not in *numerous* previous times spelled my name correctly, perhaps. If it were at all possible for "f" to be a typo

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Alf P. Steinbach /Usenet
* rantingrick, on 11.07.2010 09:26: Another source of asininity seems to be the naming conventions of the Python language proper! True/False start with an upper case and i applaud this. However str, list, tuple, int, float --need i go on...?-- start with lowercase. Q: Well what the hell is your

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* Stephen Hansen, on 11.07.2010 21:00: On 7/11/10 11:45 AM, wheres pythonmonks wrote: Follow-up: Is there a way to define compile-time constants in python and have the bytecode compiler optimize away expressions like: if is_my_extra_debugging_on: print ... when "is_my_extra_debugging" is set t

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* MRAB, on 12.07.2010 00:37: Alf P. Steinbach /Usenet wrote: * Stephen Hansen, on 11.07.2010 21:00: On 7/11/10 11:45 AM, wheres pythonmonks wrote: Follow-up: Is there a way to define compile-time constants in python and have the bytecode compiler optimize away expressions like: if

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* Stephen Hansen, on 12.07.2010 04:02: On 7/11/10 6:12 PM, Alf P. Steinbach /Usenet wrote: However, as stated up-thread, I do not expect facts, logic or general reasoning to have any effect whatsoever on such hard-core religious beliefs. Grow up, and/or get a grip, and/or get over yourself

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* MRAB, on 12.07.2010 04:09: Alf P. Steinbach /Usenet wrote: * MRAB, on 12.07.2010 00:37: Alf P. Steinbach /Usenet wrote: * Stephen Hansen, on 11.07.2010 21:00: On 7/11/10 11:45 AM, wheres pythonmonks wrote: Follow-up: Is there a way to define compile-time constants in python and have the

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 12.07.2010 06:52: On 11 Jul, 21:37, "Alf P. Steinbach /Usenet" wrote: Oh, I wouldn't give that advice. It's meaningless mumbo-jumbo. Python works like Java in this respect, that's all; neither Java nor Python support 'swap'. x,y = y,

Design questions for C++ support for Python extensions (cppy)

2010-07-12 Thread Alf P. Steinbach /Usenet
Hi. With the current cppy code the Python 3.1.1 doc's spam example extension module looks like this (actual working code): #include #include using namespace progrock; namespace { class Spam: public cppy::Module { public: Spam(): cppy::M

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 12.07.2010 16:59: On 12 Jul, 07:51, "Alf P. Steinbach /Usenet" wrote: We're talking about defining a 'swap' routine that works on variables. I did not miss the point. One cannot make a swap function that rebinds its arguments in the callin

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* Steven D'Aprano, on 12.07.2010 04:39: On Mon, 12 Jul 2010 03:12:10 +0200, Alf P. Steinbach /Usenet wrote: * MRAB, on 12.07.2010 00:37: [...] In Java a variable is declared and exists even before the first assignment to it. In Python a 'variable' isn't declared and w

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* Rhodri James, on 12.07.2010 22:19: On Mon, 12 Jul 2010 13:56:38 +0100, bart.c wrote: "Steven D'Aprano" wrote in message news:[email protected]... On Mon, 12 Jul 2010 09:48:04 +0100, bart.c wrote: That's interesting. So in Python, you can't tell what local variabl

Standard distutils package problems with MSVC / lacking functionality?

2010-07-12 Thread Alf P. Steinbach /Usenet
I let the setup.py script talk: # 03_1__noddy from distutils.core import setup, Extension import distutils.ccompiler compilerName = distutils.ccompiler.get_default_compiler() options = [] if compilerName == "msvc": # * distutils sets warning level 3: # Overriding with warning level

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* Rami Chowdhury, on 13.07.2010 00:14: Perhaps I'm misunderstanding, but ... On Jul 12, 2010, at 13:57 , Alf P. Steinbach /Usenet wrote: Existence of a variable means, among other things, that * You can use the value, with guaranteed effect (either unassigned exception or you

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* Steven D'Aprano, on 13.07.2010 01:50: On Mon, 12 Jul 2010 22:57:10 +0200, Alf P. Steinbach /Usenet wrote: Existence of a variable means, among other things, that * You can use the value, with guaranteed effect (either unassigned exception or you get a proper value

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* Steven D'Aprano, on 13.07.2010 01:34: On Mon, 12 Jul 2010 20:28:49 +0200, Alf P. Steinbach /Usenet wrote: As I see it it doesn't matter whether the implementation is CPython call frame slots or that mechanism called something else or a different mechanism called the same or a

Re: Cpp + Python: static data dynamic initialization in *nix shared lib?

2010-07-13 Thread Alf P. Steinbach /Usenet
* geremy condra, on 09.07.2010 23:43: On Fri, Jul 9, 2010 at 5:22 PM, Ian Collins wrote: On 07/10/10 03:52 AM, Alf P. Steinbach /Usenet wrote: [Cross-posted comp.lang.python and comp.lang.c++] I lack experience with shared libraries in *nix and so I need to ask... This is about "

Re: Cpp + Python: static data dynamic initialization in *nix shared lib?

2010-07-13 Thread Alf P. Steinbach /Usenet
* Robert Kern, on 13.07.2010 17:16: On 7/13/10 2:34 AM, Alf P. Steinbach /Usenet wrote: PS: You (the reader) may be wondering, why why why Yet Another Python/C++ binding? Well, because I had this great name for it, "pyni", unfortunately already in use. But cppy is very different

Re: Cpp + Python: static data dynamic initialization in *nix shared lib?

2010-07-13 Thread Alf P. Steinbach /Usenet
* Jonathan Lee, on 13.07.2010 16:41: Problem (C) is outside the realm of the C++ standard, since the C++ standard doesn't support shared libraries, and I've never actually used *nix shared libraries so I don't /know/... Is such dynamic initialization guaranteed? Not guaranteed, though I think

Re: Cpp + Python: static data dynamic initialization in *nix shared lib?

2010-07-13 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 13.07.2010 22:03: On 9 Jul, 17:52, "Alf P. Steinbach /Usenet" wrote: For an extension module it seems that Python requires each routine to be defined as 'extern "C"'. That is strange. PyMethodDef is just a jump table. So why should 'ext

Re: Cpp + Python: static data dynamic initialization in *nix shared lib?

2010-07-13 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 13.07.2010 22:06: On 13 Jul, 21:39, "Alf P. Steinbach /Usenet" wrote: Thanks! It seems that SCXX does those things that I've been planning to do but haven't got around to (wrapping standard Python types), while what it doesn't do (abstracting away

Re: floatref

2010-07-13 Thread Alf P. Steinbach /Usenet
* Gary Herron, on 14.07.2010 01:26: On 07/13/2010 03:02 PM, Roald de Vries wrote: Hi Gary, On Jul 13, 2010, at 8:54 PM, Gary Herron wrote: On 07/13/2010 10:26 AM, Roald de Vries wrote: Hi all, I have two objects that should both be able to alter a shared float. So i need something like a mut

Re: floatref

2010-07-13 Thread Alf P. Steinbach /Usenet
* Steven D'Aprano, on 14.07.2010 06:31: Gary did the right thing by pointing out that the simple-sounding term "points to" is anything but simple, it depends on what you mean by pointing and pointers. Possibly you have a point here. Cheers, - Alf -- blog at http://alfps.wordpress.com> -- h

Re: Cpp + Python: static data dynamic initialization in *nix shared lib?

2010-07-14 Thread Alf P. Steinbach /Usenet
* Hrvoje Niksic, on 14.07.2010 10:17: "Alf P. Steinbach /Usenet" writes: Also, things like the 'owned' option is just asking for trouble. Isn't owned=true (or equivalent) a necessity when initializing from a PyObject* returned by a function declared to return a &

Re: Nested loop not working

2010-07-16 Thread Alf P. Steinbach /Usenet
* Johann Spies, on 16.07.2010 16:34: I am overlooking something stupid. I have two files: one with keywords and another with data (one record per line). I want to determine for each keyword which lines in the second file contains that keyword. The following code is not working. It loops throu

Sharing: member type deduction for member pointers (Alf's device?)

2010-07-17 Thread Alf P. Steinbach /Usenet
[Cross-posted comp.lang.c++ and comp.lang.python] Consider the following code, from an example usage of some C++ support for Python I'm working on, "cppy": struct Noddy { PyPtr first; PyPtr last; int number; Noddy( PyWeakPtr pySelf

Re: Sharing: member type deduction for member pointers (Alf's device?)

2010-07-17 Thread Alf P. Steinbach /Usenet
* Alf P. Steinbach /Usenet, on 17.07.2010 11:50: [Cross-posted comp.lang.c++ and comp.lang.python] [snip] this occurred to me: #define CPPY_GETSET_FORWARDERS( name ) \ ::progrock::cppy::forwardersGetSet( \ &CppC

Re: why is this group being spammed?

2010-07-17 Thread Alf P. Steinbach /Usenet
* be.krul, on 18.07.2010 07:01: why is this group being spammed? It depends a little on what you're asking, e.g. technical versus motivation. But I'll answer about something you probably didn't mean to ask, namely what human trait enables and almost forces that kind of behavior. And I belie

Re: Sharing: member type deduction for member pointers (Alf's device?)

2010-07-19 Thread Alf P. Steinbach /Usenet
* Vladimir Jovic, on 19.07.2010 09:41: Alf P. Steinbach /Usenet wrote: #include // PyWeakPtr, PyPtr, PyModule, PyClass using namespace progrock; namespace { using namespace cppy; struct Noddy { PyPtr first; PyPtr last; int number

CPython 3.1.1 docs error in noddy3 example?

2010-07-19 Thread Alf P. Steinbach /Usenet
"Extending and Embedding the Python Interpreter" §2.1.2, the noddy3 extension module example, uses "S" as format character for string arguments in its call to PyArg_ParseTupleAndKeywords. This causes Noddy to only accept bytes as arguments, instead of strings (format "U"). I suspect this is

Re: Different python versions confusion under Windows Vista x64

2010-07-19 Thread Alf P. Steinbach /Usenet
* Edward Diener, on 19.07.2010 14:53: In Windows Vista x64 I have installed python 2.6 64-bit version and python 3.1 64-bit version to separate folders. Within the command interpreter I add python 2.6 to the PATH. In the command interpreter, When I type python somescript.py with an import sys p

Re: [Q] How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-16 Thread Alf P. Steinbach /Usenet
* Standish P, on 16.08.2010 09:20: [garble garble] Nonsense article "We look for an exogenous stack" cross-posted to [comp.lang.c], [comp.lang.c++], [comp.theory], [comp.lang.python], [comp.lang.forth]. Please refrain from following up on Standish' article.

Re: Static typing, Python, D, DbC

2010-09-12 Thread Alf P. Steinbach /Usenet
* Paul Rubin, on 13.09.2010 04:50: Ed Keith writes: I think DbC as envisioned by the Eiffel guy... the term is that it's a static verification technique, Eiffel throws an exception when a contract is violated. That is run time behavior, not static verification. The runtime checks are for wh

Re: Grouping pairs - suggested tools

2010-09-20 Thread Alf P. Steinbach /Usenet
* Astley Le Jasper, on 20.09.2010 23:42: I have a list of tuples that indicate a relationship, ie a is related to b, b is related to c etc etc. What I want to do is cluster these relationships into groups. An item will only be associated with a single cluster. Before I started, I wondered if th

Re: Grouping pairs - suggested tools

2010-09-20 Thread Alf P. Steinbach /Usenet
* Alf P. Steinbach /Usenet, on 21.09.2010 01:09: * Astley Le Jasper, on 20.09.2010 23:42: I have a list of tuples that indicate a relationship, ie a is related to b, b is related to c etc etc. What I want to do is cluster these relationships into groups. An item will only be associated with a

Re: Grouping pairs - suggested tools

2010-09-21 Thread Alf P. Steinbach /Usenet
* Arnaud Delobelle, on 21.09.2010 11:13: On Sep 21, 7:19 am, "Alf P. Steinbach /Usenet" wrote: * Alf P. Steinbach /Usenet, on 21.09.2010 01:09: * Astley Le Jasper, on 20.09.2010 23:42: I have a list of tuples that indicate a relationship, ie a is related to b, b is related to

Re: Instagram: 40% Py3 to 99% Py3 in 10 months

2017-06-16 Thread Rauklei P . S . Guimarães
Very Nice. Em sex, 16 de jun de 2017 às 13:30, Terry Reedy escreveu: > https://thenewstack.io/instagram-makes-smooth-move-python-3/ > -- > Terry Jan Reedy > > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Re Wide Unicode build for Windows available somewhere?

2005-01-13 Thread News M Claveau /Hamster-P
Hi ! See inconvcodec wrapper, at : http://cjkpython.berlios.de/ (not for Python 2.4) -- http://mail.python.org/mailman/listinfo/python-list

Re: who can tell me BASICS of Python

2005-02-05 Thread News M Claveau /Hamster-P
Troll ? -- http://mail.python.org/mailman/listinfo/python-list

Re: executing VBScript from Python and vice versa

2005-02-05 Thread News M Claveau /Hamster-P
Cool. :-) And it's OK, also, for JScript (MS-Javascript) : import win32com.client vbs = win32com.client.Dispatch("ScriptControl") vbs.language = "vbscript" scode="""Function mul2(x) mul2=x*2 End Function """ vbs.addcode(scode) print vbs.eval("mul2(123)") js = win32com.client.Dispatch("ScriptC

Re: writing unicode apps in python - some beginner questions.

2005-02-13 Thread News M Claveau /Hamster-P
Hi! XP unicode view depend, also, of the uniscribe motor version. The last version come with SP-2. Other element : is the font "Arial Unicode MS" installed ? @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: New versions breaking extensions, etc.

2004-12-10 Thread News M Claveau /Hamster-P
Hi ! But, if Python is as much sensitive to the passage of an external software, version 6 (obsolete) with a version 7 (obsolete also), it is worrying. Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

PIL : possible ?

2004-12-12 Thread News M Claveau /Hamster-P
PIL PI = Py (in french, it's the same 'sound') => PIL = (Py)L and Py become P24 => PIL = (P24)L however, 'L' Christmas finishes It (in french, Christmas = NoëL) and '(P24)' can to do readed like "Prepare, 24, for" => PIL = (P24)L => Prepare, 24 for NoëL (Christmas) Therefore, I hope that Fredick

Re: IconvCodec, UTF-32 & P4 ?

2005-03-21 Thread News M Claveau /Hamster-P
Hi ! Thanks My e-mail : [EMAIL PROTECTED] @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Calling a dos batch file from python

2007-09-04 Thread n o s p a m p l e a s e
Suppose I have a batch file called mybatch.bat and I want to run it from a python script. How can I call this batch file in python script? Thanx/NSP -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling a dos batch file from python

2007-09-05 Thread n o s p a m p l e a s e
On Sep 4, 5:01 pm, [EMAIL PROTECTED] wrote: > On Sep 4, 8:42 am, n o s p a m p l e a s e <[EMAIL PROTECTED]> > wrote: > > > Suppose I have a batch file called mybatch.bat and I want to run it > > from a python script. How can I call this batch file in python scri

Calling a matlab script from python

2007-09-05 Thread n o s p a m p l e a s e
Suppose I have a matlab script mymatlab.m. How can I call this script from a python script? Thanx/NSP -- http://mail.python.org/mailman/listinfo/python-list

Re: Covariance matrix syntax

2020-10-13 Thread Bruno P. Kinoshita via Python-list
I think the np.cov is from the numpy module (imported/aliased as np?). If so, the numpy repository should have what you are looking for: https://github.com/numpy/numpy/blob/156cd054e007b05d4ac4829e10a369d19dd2b0b1/numpy/lib/function_base.py#L2276 Hope that helps Bruno On Tuesday, 13 October

<    12   13   14   15   16   17