Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 19:58

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Python C extension help

Discussion on Python C extension help within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
Question Python C extension help

Hi, i'm learning python C extensions and want to implement my own dynamic stack function, i made it work but don't know how to return a non-tuple value.

Am i missing something or what, i used as reference python's collection module but i can't figure out what i'm doing wrong.
I don't want to put python code to manage the tuple return i need it to be embedded in c code. (also should return any data type)

My module:


Python collection module (deque):


My stack module

collections module:
elmarcia is offline  
Old 09/02/2019, 18:33   #2
 
sk8land​'s Avatar
 
elite*gold: 50
Join Date: Nov 2018
Posts: 1,065
Received Thanks: 2,594
Change line
Code:
{"push",(PyCFunction)Stack_setContent,METH_VARARGS,"..."},
into
Code:
{"push",(PyCFunction)Stack_setContent,METH_O,"..."},
sk8land​ is offline  
Thanks
1 User
Old 09/05/2019, 23:41   #3
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
Quote:
Originally Posted by sk8land​ View Post
Change line
Code:
{"push",(PyCFunction)Stack_setContent,METH_VARARGS,"..."},
into
Code:
{"push",(PyCFunction)Stack_setContent,METH_O,"..."},
LOL, i read all examples but can't find that, thx dude!
elmarcia is offline  
Reply


Similar Threads Similar Threads
Help with extension files *wregion/*idx/*tab/*wc/*wm
09/07/2022 - 12Sky2 - 24 Replies
I will need some hellp with this files *wregion/*idx/*tab/*wc/*wm because i try with my team to get the 12sky up again!An private server like officiall aeria games but with new modes.The problems are only the monsters and the npc spawn.We succefully oppened database/created an register page and also we get an forum.We will get the forum out after we succed to respawn the npc/monsters.The client is same as aeria games latest version but with some new updates.We will try to change the level on...
PROBLEM WITH PYTHON PLEASE HELP ME/ PROBLEM MIT PYTHON BITTE HELFEN MICH
05/26/2017 - Metin2 Private Server - 0 Replies
What are the values to change to move the search for the bonus in the item that is in the inventory's first slot? I would like to move it to the second slot (python switcher) Was sind die Werte, die geändert werden sollen, um die Suche nach dem Bonus in dem Element zu verschieben, der sich im ersten Slot des Inventars befindet? Ich möchte es auf den zweiten Slot (Python Switcher)
[TuT] How To Change Pk2 Extension To Any Extension And Change File Name
06/16/2014 - SRO PServer Guides & Releases - 7 Replies
In This tutorial i'll show you how to change .pk2 extension and change the file name for anything you want . We can do it in two ways .. First using Ollydbg Second using Hex Workshop ....
[HELP] Pack - file extension "RAR"
01/12/2014 - Metin2 Private Server - 5 Replies
hello, who knows how to edit these files? http://files.tinypic.pl/i/00488/isgumfhh7rpx_t.jp g
Help to make a python file works with python loader
03/03/2013 - Metin2 - 2 Replies
Hey epvp! I want make a very. Little hack works on pythonn loader can anybody help me please?



All times are GMT +1. The time now is 19:59.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.