8-12-09 a snake in the pants

Complain about your schedule. Apparently people like that sort of thing.
Post Reply
User avatar
fluffy
Eisenhower
Posts: 11202
Joined: Sat Sep 25, 2004 10:56 am
Instruments: sometimes
Recording Method: Logic Pro X
Submitting as: Sockpuppet
Pronouns: she/they
Location: Seattle-ish
Contact:

8-12-09 a snake in the pants

Post by fluffy »

qotd: Has anyone here used libPython to allow calling Python code from C? I feel like I'm banging my head against the wall in trying to do basic, vital things, like resolving function objects. The only useful stuff I find online is going the other way around (calling C from Python) which isn't what I need.
HeuristicsInc
Ibárruri
Posts: 5350
Joined: Sat Sep 25, 2004 6:14 pm
Instruments: Synths
Recording Method: Windows computer, Acid, Synths etc.
Submitting as: Heuristics Inc. (duh) + collabs
Pronouns: he/him
Location: Maryland USA
Contact:

Re: 8-12-09 a snake in the pants

Post by HeuristicsInc »

no, but i did have a really similar problem trying to find info on calling java code from c++.
i did eventually figure that one out.
-bill
152612141617123326211316121416172329292119162316331829382412351416132117152332252921
http://heuristicsinc.com
Liner Notes
SF Lyric Ideas
User avatar
jast
Niemöller
Posts: 1336
Joined: Tue Jul 29, 2008 7:03 pm
Instruments: Vocals, guitar
Recording Method: Cubase, Steinberg UR44
Submitting as: Jan Krueger
Pronouns: .
Location: near Aachen, Germany
Contact:

Re: 8-12-09 a snake in the pants

Post by jast »

If it helps... I hate Python and never use it.
User avatar
fluffy
Eisenhower
Posts: 11202
Joined: Sat Sep 25, 2004 10:56 am
Instruments: sometimes
Recording Method: Logic Pro X
Submitting as: Sockpuppet
Pronouns: she/they
Location: Seattle-ish
Contact:

Re: 8-12-09 a snake in the pants

Post by fluffy »

I used to think JNI was horrific, and then I had to use libpython. I don't hate JNI as much anymore.
User avatar
Caravan Ray
bono
bono
Posts: 8738
Joined: Sat Sep 25, 2004 1:51 pm
Instruments: Penis
Recording Method: Garageband
Submitting as: Caravan Ray,G.O.R.T.E.C,Lyricburglar,The Thugs from the Scallop Industry
Location: Toowoomba, Queensland
Contact:

Re: 8-12-09 a snake in the pants

Post by Caravan Ray »

I used to be licenced to handle both pythons and venomous snakes in Queensland. I would remove them from people's houses and release them in the bush. Pythons are easy to catch - but brown snakes are really scary.
User avatar
fluffy
Eisenhower
Posts: 11202
Joined: Sat Sep 25, 2004 10:56 am
Instruments: sometimes
Recording Method: Logic Pro X
Submitting as: Sockpuppet
Pronouns: she/they
Location: Seattle-ish
Contact:

Re: 8-12-09 a snake in the pants

Post by fluffy »

I figured it out. It turns out that while all the examples use PyModule_AddModule(), I wanted to use PyModule_ImportModule(), which I would have known if I'd bothered to read the documentation for PyModule_AddModule() but I don't know Python and the documentation seems to assume some sort of pathologically intimate familiarity with not only the language but the source code of the interpreter itself.
User avatar
Ross
Churchill
Posts: 2745
Joined: Sun Feb 27, 2005 3:27 pm
Instruments: Guitar, Vox, Bass, Tuned glasses, etc...
Recording Method: Logic on a Macbook.
Submitting as: Ross Durand
Location: Orange CA
Contact:

Re: 8-12-09 a snake in the pants

Post by Ross »

I have no idea what you are talking about - except the part caravan ray said.
"I don't like this song, but at least it's good." - veGetar Ianra Ge
http://www.rossdurandmusic.com
User avatar
mrbeany
de Gaulle
Posts: 156
Joined: Thu Dec 11, 2008 12:54 am
Instruments: none
Recording Method: LMMS and Audacity
Submitting as: Mr. Beany's Bitty Band; "Mr. Beany, <something-somethings>"
Location: Indiana, USA (where "losingest" is a word)

Re: 8-12-09 a snake in the pants

Post by mrbeany »

Personally, I really like Python. Sure the syntax is a bit odd compared to some (the whole white-space has meaning thing) but when you accept that all practical coding styles either highly recommend or outright require some sort of spacing consensus it isn't nearly that bad.

I'm planning to teach my daughter Python as her first computer language. My wife jokes that it'll make her a Parselmouth.

I've never needed to call it from another language. Last time I even thought about that, I decided it was a better idea to just do the whole thing in Python.

I, however, abhor Ruby. Everyone has certain things that they just can't stomach when it comes to languages.

Back in the day, I did some testing on a Java runtime environment. That whole process caused me to hate Java a lot, but in the long term even back then it was less than I currently hate Ruby. And now, shoot, I practically don't hate Java at all.
User avatar
fluffy
Eisenhower
Posts: 11202
Joined: Sat Sep 25, 2004 10:56 am
Instruments: sometimes
Recording Method: Logic Pro X
Submitting as: Sockpuppet
Pronouns: she/they
Location: Seattle-ish
Contact:

Re: 8-12-09 a snake in the pants

Post by fluffy »

Well yeah, Python does seem like a rather good "my first language" language. Certainly better than BASIC, which is what I grew up with. And it's a great extension/scripting language for a number of reasons, which is why we're using it. But we can't just do the whole thing in Python for reasons I won't get into.

Now that I have module loading, symbol resolution, and method invocation working, I'm satisfied and not hating the library so much as the crappy documentation. The main thing I hate about it is just the SDK docs, since it has a lack of useful example code (and for some reason it's really hard to find any simple do-just-this-one-thing code online) which aren't very easy to consult unless you know exactly what you're looking for, which requires a lot more intimacy with the language's conceptual model than I've ever had any reason to get.

Many years ago I played with libtcl for similar purposes and found it extremely easy and straightforward to use, but Tcl just isn't a popular enough language (mostly because of a bad reputation from Tcl/Tk, but also because its standard library is a bit cumbersome to work with) even though conceptually Tcl and Python actually aren't all that different, from an underlying semantics/design standpoint anyway, although the big advantage Python has is that nearly everything's a dictionary (which makes OO stuff completely natural), while in Tcl everything's a list, so in Tcl you end up having a lot of "marshalling" mechanisms which treat objects as opaque tokens which have to be accessed through external functions.
User avatar
ujnhunter
Niemöller
Posts: 1901
Joined: Fri Mar 07, 2008 1:09 pm
Instruments: Bass, Keyboards, Crummy Guitar & Animal Noises (especially Donkeys)
Recording Method: Reaper 5.9x, Tascam FireOne/Behringer UMC202HD/Avid Eleven Rack/Line 6 UX2, Win 7 PC / Win 10 Laptop
Submitting as: Cock, Chth*.*, D.A.H. (Der Alter Hahn)
Pronouns: His Infernal Majesty
Location: CT, USA
Contact:

Re: 8-12-09 a snake in the pants

Post by ujnhunter »

I thought Ebonics was the most hated language?
-Ujn Hunter
Photovoltaik - Free 6 Track EP - Song Fight! Liner Notes
Billy's Little Trip wrote:I must have this....in my mouth.....now.
User avatar
Billy's Little Trip
Odie
Posts: 12090
Joined: Mon Nov 13, 2006 2:56 pm
Instruments: Guitar, Bass, Vocals, Drums, Skin Flute
Recording Method: analog to digital via Presonus FireBox, Cubase and a porn machine
Submitting as: Billy's Little Trip, Billy and the Psychotics
Location: Cali fucking ornia

Re: 8-12-09 a snake in the pants

Post by Billy's Little Trip »

Has anyone here used libPython to allow calling Python code from C?
I invented it, ask me anything. Image

Please ask in the form of a yes or no question.
Please note, there is a 50% error allowance in my answers.


Ok, fire when ready, grizzly. Image
User avatar
fluffy
Eisenhower
Posts: 11202
Joined: Sat Sep 25, 2004 10:56 am
Instruments: sometimes
Recording Method: Logic Pro X
Submitting as: Sockpuppet
Pronouns: she/they
Location: Seattle-ish
Contact:

Re: 8-12-09 a snake in the pants

Post by fluffy »

Hey! Where ya been?

(Also I am pretty sure your name is not Guido.)
User avatar
Billy's Little Trip
Odie
Posts: 12090
Joined: Mon Nov 13, 2006 2:56 pm
Instruments: Guitar, Bass, Vocals, Drums, Skin Flute
Recording Method: analog to digital via Presonus FireBox, Cubase and a porn machine
Submitting as: Billy's Little Trip, Billy and the Psychotics
Location: Cali fucking ornia

Re: 8-12-09 a snake in the pants

Post by Billy's Little Trip »

fluffy wrote:Hey! Where ya been?

(Also I am pretty sure your name is not Guido.)
That's because you don't have ESPN (extrasensory perception knowledge...the K is silent)

Business finally started getting better. I couldn't sell a gold fish pond towards the end of 08, and now I'm closing huge projects. YAY!!! Jon will be happy to know that he campaigned for the right guy, lol.

I need to rock again. I miss all you freaks, geeks and alcoholics. :P
User avatar
JonPorobil
Ibárruri
Posts: 5682
Joined: Sat Sep 25, 2004 11:45 am
Instruments: Piano, Guitar, Harmonica, Mandolin, Accordion, Bass, lots of VSTs
Recording Method: Cubase 10.5
Submitting as: Jon Eric, Jon Porobil, others
Pronouns: He/Him
Location: Pittsburgh, PA
Contact:

Re: 8-12-09 a snake in the pants

Post by JonPorobil »

Billy's Little Trip wrote:
fluffy wrote:Hey! Where ya been?

(Also I am pretty sure your name is not Guido.)
That's because you don't have ESPN (extrasensory perception knowledge...the K is silent)

Business finally started getting better. I couldn't sell a gold fish pond towards the end of 08, and now I'm closing huge projects. YAY!!! Jon will be happy to know that he campaigned for the right guy, lol.

I need to rock again. I miss all you freaks, geeks and alcoholics. :P
You do need to rock again. :)

(Ahh... the old dumbrella board had an emoticon of the Devil's Horns. I miss that.)

In fact, if you find yourself available again, then keep an eye on your PM box in the near future.
"Warren Zevon would be proud." -Reve Mosquito

Stages, an album of about dealing with loss, anxiety, and grieving a difficult year, now available on Bandcamp and all streaming platforms! https://jonporobil.bandcamp.com/album/stages
User avatar
fluffy
Eisenhower
Posts: 11202
Joined: Sat Sep 25, 2004 10:56 am
Instruments: sometimes
Recording Method: Logic Pro X
Submitting as: Sockpuppet
Pronouns: she/they
Location: Seattle-ish
Contact:

Re: 8-12-09 a snake in the pants

Post by fluffy »

Yeah this phpBB doesn't have :evil: or :twisted: at all and it's sad

oh wait
User avatar
Spud
Roosevelt
Posts: 4782
Joined: Fri Sep 24, 2004 10:25 am
Instruments: Bass, Keyboards, eHorn
Submitting as: Octothorpe
Pronouns: he/him
Location: Seattle
Contact:

Re: 8-12-09 a snake in the pants

Post by Spud »

It's also too bad you can't just link one from somewhere else Image
"I only listen to good music. And Octothorpe." - Marcus Kellis
Song Fight! The Rockening
User avatar
JonPorobil
Ibárruri
Posts: 5682
Joined: Sat Sep 25, 2004 11:45 am
Instruments: Piano, Guitar, Harmonica, Mandolin, Accordion, Bass, lots of VSTs
Recording Method: Cubase 10.5
Submitting as: Jon Eric, Jon Porobil, others
Pronouns: He/Him
Location: Pittsburgh, PA
Contact:

Re: 8-12-09 a snake in the pants

Post by JonPorobil »

I meant the hand signal. You guys don't remember that?
"Warren Zevon would be proud." -Reve Mosquito

Stages, an album of about dealing with loss, anxiety, and grieving a difficult year, now available on Bandcamp and all streaming platforms! https://jonporobil.bandcamp.com/album/stages
User avatar
Billy's Little Trip
Odie
Posts: 12090
Joined: Mon Nov 13, 2006 2:56 pm
Instruments: Guitar, Bass, Vocals, Drums, Skin Flute
Recording Method: analog to digital via Presonus FireBox, Cubase and a porn machine
Submitting as: Billy's Little Trip, Billy and the Psychotics
Location: Cali fucking ornia

Re: 8-12-09 a snake in the pants

Post by Billy's Little Trip »

Here's one with some head bangin' Image

This one looks like that strong bad guy. Image
Post Reply