Embeding python with mingw on win32 and python 2.4.4
Hi
I'm bringing up an old story once more! I'm on win32 (winxp sp2)
python 2.4.4. mingw gcc version is 3.4.5. msys is in c:\msys. mingw is
in c:\mingw and python is in c:\pyton24. there is also python24.lib
and libpython24.a in c:\python24\libs.
when I try to compile this sample code [1] from with command [2] in
msys shell I get the results [3].
this subject was discussed a few times over these years and I tried
everything in the posts and forums that I found and google could
translate with no success. I realy need your suggestion!
Regards, Mani
[1] Sample code:
#include
int main(int argc, char *argv[])
{
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"print 'Today is',ctime(time())\n");
Py_Finalize();
return 0;
}
[2] Command:
$ g++ -I/c/python24/include -I/c/MinGW/include -L/c/python24/libs -L/c/
mingw/lib -lpython24 -shared -mwin32 -o p1 p1.o
[3] Results:
p1.o:p1.cpp:(.text+0x2b): undefined reference to `_imp__Py_Initialize'
p1.o:p1.cpp:(.text+0x39): undefined reference to
`_imp__PyRun_SimpleString'
p1.o:p1.cpp:(.text+0x40): undefined reference to `_imp__Py_Finalize'
collect2: ld returned 1 exit status
--
http://mail.python.org/mailman/listinfo/python-list
Embeding python with mingw on win32 and python 2.4.4
Hi
I'm bringing up an old story once more! I'm on win32 (winxp sp2)
python 2.4.4. mingw gcc version is 3.4.5. msys is in c:\msys. mingw is
in c:\mingw and python is in c:\pyton24. there are also python24.lib
and libpython24.a in c:\python24\libs.
when I try to compile this sample code [1] from msys prompt with
command [2] in
msys shell I get the results [3].
this subject was discussed a few times over these years and I tried
everything in the posts and forums that I found and google could
translate with no success. I realy need your suggestion!
Regards, Mani
[1] Sample code:
#include
int main(int argc, char *argv[])
{
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"print 'Today is',ctime(time())\n");
Py_Finalize();
return 0;
}
[2] Command:
$ g++ -I/c/python24/include -I/c/MinGW/include -L/c/python24/libs -L/
c/
mingw/lib -lpython24 -shared -mwin32 -o p1 p1.o
[3] Results:
p1.o:p1.cpp:(.text+0x2b): undefined reference to `_imp__Py_Initialize'
p1.o:p1.cpp:(.text+0x39): undefined reference to
`_imp__PyRun_SimpleString'
p1.o:p1.cpp:(.text+0x40): undefined reference to `_imp__Py_Finalize'
collect2: ld returned 1 exit status
--
http://mail.python.org/mailman/listinfo/python-list
Re: Embeding python with mingw on win32 and python 2.4.4
It's me answering my self. I found the solution in http://groups.google.com/group/comp.lang.python/browse_thread/thread/4d80df2e53dfa127/de87533c05d8021c?lnk=gst&q=Py_Initialize+undefined+reference#de87533c05d8021c It was the problem of gcc arguments order. -- http://mail.python.org/mailman/listinfo/python-list
Re: Why not a Python compiler?
On Feb 6, 2:43 am, "Luis M. González" <[EMAIL PROTECTED]> wrote: > On 5 feb, 05:19, Santiago Romero <[EMAIL PROTECTED]> wrote: > > > > > ( Surely if this question has been asked for a zillion of times... ) > > ( and sorry for my english! ) > > > I'm impressed with python. I'm very happy with the language and I > > find Python+Pygame a very powerful and productive way of writing 2D > > games. I'm not, at this moment, worried about execution speed of the > > small game I'm working on (it runs at full 60 fps even in an old AMD- > > K6 450 Laptop computer), but I continue asking me the same question: > > > Why not a Python COMPILER? > > > It would be very nice to be able to output Linux, MAC or Windows > > binaries of compiled (not bytecompiled) code. It would run faster, it > > will be smaller in size (I think) and it will be easy to distribute to > > people not having python installed. Yes, I know about py2exe, but I'm > > not sure if that's the right aproach. > > > So, what's wrong with compiling python? > > > Maybe is not possible due to nature of the language? Is just a > > decision? > > > What do you think about this? > > There are some projects aimed to speed up Python by a large margin. > Right now you can use psyco, which is considered to be feature > complete, and whose future relies on the Pypy project. > > Pypy is a very ambitious project and it aims, amongst many other > goals, to provide a fast just-in-time python implementation. > They even say that the "secret goal is being faster than c, which is > nonsense, isn´t it?" (I still didn´t get the joke though...). > > And finally, you have ShedSkin, a project developed by one lonely and > heroic coder (Mark Dufour). > Shedskin aims at being a static python compiler, which can translate a > subset of python to stand alone executables. > It also can compile extension modules for cpython. > It works by translating python to c++ and then to machine code. > The python code must be done in a static way (getting rid of dynamic > features like, for example, not asigning different types to the same > variable). > > Luis and Take a look at this page if you look for a plan to develop a fast python program, you wont regret it. http://ondrej.certik.cz/development/ Mani -- http://mail.python.org/mailman/listinfo/python-list
Embedding processing module in c (winxp sp2)
Hello every one
Did anybody tried to embed pyprocessing (http://
pyprocessing.berlios.de/) in a c app? im using python 2.4 and
pyprocessing 0.52 under winxp sp2. but it doesnt seem to work. I added
a print statement in Process.start() method after
'_current_process._children.add(self)' command in process.py file line
97 and it prints as its in a kind of loop!
here is the sample program:
#define WIN32_LEAN_AND_MEAN
#include
#include "python.h"
int main(int argc, char **argv)
{
Py_Initialize();
PyRun_SimpleString("import sys\n"
"sys.argv=['']\n" //a cheat to make processing go on!
"from processing import Process,Queue,freezeSupport\n"
"def f(q):\n"
"\timport wx\n"
"\tfrom wx.py import crust\n"
"\tapp = wx.PySimpleApp(redirect=False)\n"
"\tframe = crust.CrustFrame()\n"
"\tframe.Show()\n"
"\tapp.MainLoop()\n"
"q=Queue()\n"
"if __name__ == '__main__':\n"
"\tfreezeSupport()\n"
"\tq=Queue()\n"
"\tp = Process(target=f, args=(q,))\n"
"\tp.start()\n");
Py_Finalize();
}
Best Regards,
Mani
--
http://mail.python.org/mailman/listinfo/python-list
Python not finding modules
Hey! I installed a few python modules through the freebsd ports, but when I try to import them in the interpreter it says "module xxx not found". This seems to happen for some modules and not for the others. ex:- I installed psyco and parallel python which seem to be found but then scipy, PIL aren't being imported. Below is my $PYTHONPATH ['', '/usr/local/lib/python2.5/site-packages/setuptools-0.6c7-py2.5.egg', '/usr/local/lib/python25.zip', '/usr/local/lib/python2.5', '/usr/local/lib/python2.5/plat-freebsd6', '/usr/local/lib/python2.5/lib-tk', '/usr/local/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/local/lib/python2.5/site-packages/gtk-2.0', '/usr/local/lib/vtk/python', '/usr/local/lib/python2.5/site-packages'] The scipy libs are located at "/usr/local/lib/python2.4/site-packages/scipy" so I manually added this path to the PYTHONPATH but it still doesn't seem to find it. Can someone please help me out here?:) ps Also does including a directory in PYTHONPATH include all of it's sub-directories too? Download prohibited? No problem. CHAT from any browser, without download. Go to http://in.messenger.yahoo.com/webmessengerpromo.php/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Python not finding modules
Hey, Thanks for replying. But what about the module whose path I included manually. That didn't work too!Is it like packages that are made for python2.4 do not work for 2.5? Also are folders recursively included? Thanks Mani chandra --- On Wed, 13/2/08, Guilherme Polo <[EMAIL PROTECTED]> wrote: > From: Guilherme Polo <[EMAIL PROTECTED]> > Subject: Re: Python not finding modules > To: [EMAIL PROTECTED], [email protected] > Date: Wednesday, 13 February, 2008, 3:56 PM > 2008/2/13, Mani Chandra <[EMAIL PROTECTED]>: > > Hey! > > I installed a few python modules through the > freebsd ports, but when I try to import them in the > interpreter it says "module xxx not found". This > seems to happen for some modules and not for the others. > ex:- I installed psyco and parallel python which seem to be > found but then scipy, PIL aren't being imported. Below > is my $PYTHONPATH > > > > ['', > '/usr/local/lib/python2.5/site-packages/setuptools-0.6c7-py2.5.egg', > '/usr/local/lib/python25.zip', > '/usr/local/lib/python2.5', > '/usr/local/lib/python2.5/plat-freebsd6', > '/usr/local/lib/python2.5/lib-tk', > '/usr/local/lib/python2.5/lib-dynload', > '/usr/local/lib/python2.5/site-packages', > '/usr/local/lib/python2.5/site-packages/gtk-2.0', > '/usr/local/lib/vtk/python', > '/usr/local/lib/python2.5/site-packages'] > > > > The scipy libs are located at > "/usr/local/lib/python2.4/site-packages/scipy" > so I manually added this path to the PYTHONPATH but it > still doesn't seem to find it. > > > > You need to install python modules for python2.5, you > clearly installed for 2.4. > > > Can someone please help me out here?:) > > > > ps Also does including a directory in PYTHONPATH > include all of it's sub-directories too? > > > > > > > > Download prohibited? No problem. CHAT from any > browser, without download. Go to > http://in.messenger.yahoo.com/webmessengerpromo.php/ > > > > -- > > http://mail.python.org/mailman/listinfo/python-list > > > > > -- > -- Guilherme H. Polo Goncalves Get your domain and website for less than Rs.100/month*. Go to http://in.business.yahoo.com/ -- http://mail.python.org/mailman/listinfo/python-list
Fw: error in importing scipy
--- On Wed, 13/2/08, Mani Chandra <[EMAIL PROTECTED]> wrote: > From: Mani Chandra <[EMAIL PROTECTED]> > Subject: error in importing scipy > To: [EMAIL PROTECTED] > Date: Wednesday, 13 February, 2008, 9:30 PM > Hi > I get the following error while importing scipy. > /usr/local/lib/python2.4/site-packages/scipy_base/__init__.py:16: > RuntimeWarning: Python C API version mismatch for module > fastumath: This Python has API version 1013, module > fastumath has version 1012. import fastumath # no need to > use scipy_base.fastumath > > Can someone please help me out? > > Thanks, > Mani chandra > > > Get the freedom to save as many mails as you wish. To > know how, go to > http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/ -- http://mail.python.org/mailman/listinfo/python-list
please solve
hi folks, i have been assigned a project on Python. i need to execute a remote shell script file from a windows machine through SSH twisted or paramiko. if it is a normal file then directly with the command sh .sh it is getting executed. self.conn.sendRequest(self, 'exec', common.NS(sh test1.sh), wantReply = 1) but if a shell scripts asks for user input, this particular way does not wait for user input. it just print the echo part . is there any way so that interactive type of scripts can be executed in Paramiko or Twisted Conch in a windows machine (remote login in a unix machine through Paramiko SSH or Twisted) i did try with another way in Paramiko which helps in opening a remote window by creating an instance of SSHClient and invoking the method invoke_shell(with some parametes) but remote shell window is not opening.the method specifies starts a terminal shell window in SSH server. To my interpretation it is somewaht opening a terminal window like putty. -- http://mail.python.org/mailman/listinfo/python-list
urllib2, proxies, and pac files on OS X
Hi all,
urllib2 correctly detects proxies as configured in my preferences pane
on OS X 10.5:
Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
>>> urllib2.ProxyHandler().proxies
{'http': 'http://openproxy.in.tungle.com:8080'}
>>>
However, when configuring a proxy via PAC file, this does not seem to
be the case:
Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
>>> urllib2.ProxyHandler().proxies
{}
>>>
Is there any way to obtain (and parse using something like pacparser)
the PAC file via urllib2 (or some other standard python library), or
is this something I need to tackle using Cocoa (in my case PyObjC)?
Thanks a lot!
Mani
--
http://mail.python.org/mailman/listinfo/python-list
Arisingsoft provides the Norton antivirus all in one security suite.
hai, Uses : The package includes a personal firewall, phishing protection and the ability to detect and remove malware. Norton 360 is compatible with 32-bit editions of Windows XP and 32-bit or 64-bit editions of Windows Vista.Windows 7 support has been added. Reviews cited Norton 360's low resource usage, relative to Norton Internet Security 2007, and phishing protection. http://www.arisingsoft.com/2010_11_14_archive.html http://www.arisingsoft.com/ -- http://mail.python.org/mailman/listinfo/python-list
logging.fileConfig limitations?
Hi all, I have an application that writes out its logs in a subfolder of the user's local data directory. Let's say our user's name is "ßéäöÜ2". On my Windows XP machine, this logging path turns out to be: C:\Documents and Settings\ßéäöÜ2\Local Settings\Application Data\MyApp\MyApp.log My application has a "bootstrap" kind of application that sets up the application's subfolder and writes out the log config file. Notice that the user's name contains non-ASCII characters. So, I encode the path in UTF8 format before writing the log config file. My resulting log config is (the last line is the most important): - BEGIN [formatters] keys: normal [handlers] keys: rotatingfile [loggers] keys: root [formatter_normal] format: %(asctime)s %(levelname)s %(module)s: %(message)s [logger_root] level: DEBUG handlers: rotatingfile [handler_rotatingfile] class: handlers.RotatingFileHandler formatter: normal args: ["C:/Documents and Settings/ßéäöÜ2/Local Settings/Application Data/MyApp/MyApp.log", "a", 2*1024*1024, 5, None] - END Now it turns out that the logging module can't find "C:/Documents and Settings/ßéäöÜ2/Local Settings/Application Data/MyApp/MyApp.log" specified in the "args" section, and rightfully so because this is an encoded string. *There does not seem to be a way for me to specify the encoding of the string so that the logging module resolves the proper unicode path.* This is my key problem! Is there some way to accomplish what I want? One interesting observation: I did some poking around in the logging module shipped with Python 2.5. I put in some code in the Python logging module to force UTF8 decoding of the "filename" argument, the result of which was interesting: it would end up logging in "C:\Documents and Settings\ßéäöÜ2\Local Settings\Application Data\MyApp\MyApp.txt" (not MyApp.log !). I've done a little debugging and can't immediately figure out why this is happening. Any help would be greatly appreciated! Regards, Mani -- http://mail.python.org/mailman/listinfo/python-list
My New Project : Aduct
Hello, I made my first Python package that can be installed via PIP. It is called "Aduct". https://github.com/atornel/Aduct. Aduct is a toolkit to design graphical applications that can be dynamically changed with a little work as possible. It is designed by inheriting objects provided by [Gtk](http://www.gtk.org/) and thus by following principles of Aduct with Gtk, one can make powerful applications that are easy for a developer to develop, third-party person to improve and end user to use. Put simply, Aduct lets you make complex interfaces which can be easily changed by users without any trouble. What help I need : This is my first project where I put a much work in writing docs and things. So I'm a pretty noob who needs a help from various people with different ideas. Hence I kindly request you to spend time with Aduct (if you can) : 1. Use Aduct - please use it and tell me your feedback, I will be really happy 2. Requesting features and reporting bugs - as already said, you might have a different perspective of how a feature should work, I welcome those. 3. Criticisms - They are always hurting, but still I'm ready to face it. 4. Sharing with others - If you think that there is someone who can make use of Aduct, you can help by sharing Aduct. 5. Writing docs - The docs could be unclear, could be improved, you can help me here. 6. Improving source code - I salute those brave hearts who are ready to dive into business of coding. Don't worry, formatting won't be so poor, I used Black, Pylint, Bandit to make it readable and powerful. 7. Star it - The most easy one; it encourages me. This is not any spam or promotion. Aduct is released in LGPL license and is completely free. Improving and using Aduct, strengthens the community work, meaning of open source, gives me a satisfaction. Thank you for reading till here, J Arun Mani :) -- https://mail.python.org/mailman/listinfo/python-list
