python 2.6 wininst problem
I just installed Python2.6 on my WinXP box in a non-standard location (not C:\Python26) since I'm not admin. I used cygwin to create a module of an extension I wrote, but when I went to execute the installer, I get a popup error This application has failed to start because the application configuration is incorrect. Reinstalling the application my fix this problem. It turns out that the application installs my module on another machine where python is installed in C:\Python26, but why not in my installation? I went and reinstalled python2.5 in a similar nonstandard location (%USERPROFILE%\Python25) and rebuilt my extension module under that. The module installer worked just fine, so it seems to be a 2.6 issue. Do I now have to get the Helpdesk to install Python for me? TIA. -- http://mail.python.org/mailman/listinfo/python-list
install wxPython on windows without admin?
The subject line says it all. Is there a way to install wxPython on a Windows machine without admin privs? I love the way python doesn't need admin to install locally, and I'd like to try wxPython w/o having to get our help desk involved. Do I have to compile it from source with Cygwin? Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Re: install wxPython on windows without admin?
On Nov 17, 9:57 am, Steve Holden [EMAIL PROTECTED] wrote: timw.google wrote: The subject line says it all. Is there a way to install wxPython on a Windows machine without admin privs? I love the way python doesn't need admin to install locally, and I'd like to try wxPython w/o having to get our help desk involved. Do I have to compile it from source with Cygwin? Installing wxPython on Cygwin from source is an uphill battle which I would recommend against, though it's possible it's been done ... regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ I agree with that. After I posted, I went to install wxPython on my linux box and ran into trouble with getting wxWidgets installed because of gtk version issues. I did it before, but since then our OS has changed from FC3 to CentOS 5 and not everything gets installed that needs to be. I may try and get back to it when I get the chance, but for now, it's Tkinter and Pmw. -- http://mail.python.org/mailman/listinfo/python-list
Re: disable ctrl-P in idle?
On Nov 10, 4:53 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Nov 10, 3:27 pm, timw.google [EMAIL PROTECTED] wrote: On Nov 10, 2:57 pm, Robert Singer [EMAIL PROTECTED] wrote: On Mon, 10 Nov 2008 20:56:46 +0100, Robert Singer [EMAIL PROTECTED] wrote: On Mon, 10 Nov 2008 10:40:28 -0800 (PST), timw.google [EMAIL PROTECTED] wrote: Is there a way to disable ctrl-P (print window) in IDLE? I'm editing some python code in IDLE and I keep hitting this by mistake from my years of emacs editing. Thanks in advance. Try autohotkey and map it to something else. Like, nothing :-) Internally, I don't think so, it's part of CUI. -- Bob ... continue: Or, you can just continue using emacs. I'm using vim, and can't think of a single reason why I should change it for idle. -- Bob Thanks. I on a XP box now, and it's a pain to get things installed here. That's why I'm not using emacs. When I'm on Linux, I use emacs. It's not worth the trouble to install something else for just this. It is not more difficult to install emacs on XP. What makes you think that? It's not that it's technically difficult. It's just a hassle to involve the help desk. -- http://mail.python.org/mailman/listinfo/python-list
Re: disable ctrl-P in idle?
On Nov 10, 10:35 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Nov 10, 4:49 pm, RichardT [EMAIL PROTECTED] wrote: On Mon, 10 Nov 2008 10:40:28 -0800 (PST), timw.google [EMAIL PROTECTED] wrote: Is there a way to disable ctrl-P (print window) in IDLE? I'm editing some python code in IDLE and I keep hitting this by mistake from my years of emacs editing. Thanks in advance. In Idle, select 'Configure IDLE..' from the options menu. In the Options dialog, select the Keys tab. Scroll down to the 'print-window' entry and select it. Click the Get New Keys For Selection button. Select the new key combination e.g. Shift+Ctrl+p and click OK button. If you have not enter any custom keys before, you will get a prompt for a Custom Key Set Name - enter a name and click OK. For the archive, since our hero prefers not to receive credit. Ctrl+P should no longer send the window to the printer. On my system (python 2.5.1 on XP) it now moves the cursor up a line for some reason (deafult binding for the widget?) Cursor up is the default emacs binding for Ctrl+P so this will probably please the original poster (and me too!) Wonderful! I remapped ctrl-N too while I was at it. Thanks (and no help desk involvement either!) -- http://mail.python.org/mailman/listinfo/python-list
disable ctrl-P in idle?
Is there a way to disable ctrl-P (print window) in IDLE? I'm editing some python code in IDLE and I keep hitting this by mistake from my years of emacs editing. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list
Re: disable ctrl-P in idle?
On Nov 10, 2:57 pm, Robert Singer [EMAIL PROTECTED] wrote: On Mon, 10 Nov 2008 20:56:46 +0100, Robert Singer [EMAIL PROTECTED] wrote: On Mon, 10 Nov 2008 10:40:28 -0800 (PST), timw.google [EMAIL PROTECTED] wrote: Is there a way to disable ctrl-P (print window) in IDLE? I'm editing some python code in IDLE and I keep hitting this by mistake from my years of emacs editing. Thanks in advance. Try autohotkey and map it to something else. Like, nothing :-) Internally, I don't think so, it's part of CUI. -- Bob ... continue: Or, you can just continue using emacs. I'm using vim, and can't think of a single reason why I should change it for idle. -- Bob Thanks. I on a XP box now, and it's a pain to get things installed here. That's why I'm not using emacs. When I'm on Linux, I use emacs. It's not worth the trouble to install something else for just this. -- http://mail.python.org/mailman/listinfo/python-list
Re: supplying password to subprocess.call('rsync ...'), os.system('rsync ...')
On Oct 7, 1:01 pm, Michael Torrie [EMAIL PROTECTED] wrote: timw.google wrote: Hi I want to write a python script that runs rsync on a given directory and host. I build the command line string, but when I try to run subprocess.call(cmd), or p=subprocess.Popen(cmd, shell=True),or os.system(cmd), I get prompted for my login password. I expected this, but when I try to give my password, it's echoed back to the terminal and the special characters in the password is (I think) getting interpreted by the shell (zsh) I can't ssh w/o supplying a password. That's the way the security is set up here. How do I use python to do this, or do I just have to write a zsh script? You need to use the pexpect module. Thanks. Thanks to all the suggestions on getting this to work w/ python. I'll look into this more when I get the chance. I don't have root access, so setting up some kind of server is out. I may not be able to try the other suggestions either, as they have things locked down pretty tight around here. -- http://mail.python.org/mailman/listinfo/python-list
supplying password to subprocess.call('rsync ...'), os.system('rsync ...')
Hi I want to write a python script that runs rsync on a given directory and host. I build the command line string, but when I try to run subprocess.call(cmd), or p=subprocess.Popen(cmd, shell=True),or os.system(cmd), I get prompted for my login password. I expected this, but when I try to give my password, it's echoed back to the terminal and the special characters in the password is (I think) getting interpreted by the shell (zsh) I can't ssh w/o supplying a password. That's the way the security is set up here. How do I use python to do this, or do I just have to write a zsh script? Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Re: supplying password to subprocess.call('rsync ...'), os.system('rsync ...')
On Oct 5, 10:33 am, timw.google [EMAIL PROTECTED] wrote: Hi I want to write a python script that runs rsync on a given directory and host. I build the command line string, but when I try to run subprocess.call(cmd), or p=subprocess.Popen(cmd, shell=True),or os.system(cmd), I get prompted for my login password. I expected this, but when I try to give my password, it's echoed back to the terminal and the special characters in the password is (I think) getting interpreted by the shell (zsh) I can't ssh w/o supplying a password. That's the way the security is set up here. How do I use python to do this, or do I just have to write a zsh script? Thanks. I wrote a zsh script to do what I wanted, but I'd still like to know how to do it in Python. -- http://mail.python.org/mailman/listinfo/python-list
Re: how to join array of integers?
On Sep 15, 8:36 am, Summercool [EMAIL PROTECTED] wrote: i think in Ruby, if you have an array (or list) of integers foo = [1, 2, 3] you can use foo.join(,) to join them into a string 1,2,3 in Python... is the method to use ,.join() ? but then it must take a list of strings... not integers... any fast method? Isn't the OP just looking for something like: foo=[1,2,3] bar=[4,5,6] foo+bar [1, 2, 3, 4, 5, 6] -- http://mail.python.org/mailman/listinfo/python-list
Re: how to join array of integers?
On Sep 17, 8:46 am, John Machin [EMAIL PROTECTED] wrote: On Sep 17, 10:16 pm, timw.google [EMAIL PROTECTED] wrote: On Sep 15, 8:36 am, Summercool [EMAIL PROTECTED] wrote: i think in Ruby, if you have an array (or list) of integers foo = [1, 2, 3] you can use foo.join(,) to join them into a string 1,2,3 in Python... is the method to use ,.join() ? but then it must take a list of strings... not integers... any fast method? Isn't the OP just looking for something like: foo=[1,2,3] bar=[4,5,6] foo+bar [1, 2, 3, 4, 5, 6] No. Read what he wrote. He has a SINGLE list whose elements are (e.g.) integers [1, 2, 3], *NOT* two lists. He wants to create a STRING 1,2,3, not a list.- Hide quoted text - - Show quoted text - You're right. I read it wrong. Sorry. -- http://mail.python.org/mailman/listinfo/python-list
Re: customary way of keeping your own Python and module directory in $HOME
On May 14, 8:55 pm, [EMAIL PROTECTED] wrote: On May 14, 6:00 pm, James Stroud [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: [snip], but on *nix, you can compile python with the --prefix= option set to a directory in your home dir and install there. Check. I recommend having your own python install if you want a comprehensive approach. Yup. I dropped the src in ~/src/Python-2.5.1, created a ~/py-2.5.1 directory, and did ./configure --prefix=/home/me/py-2.5.1 make make install and it worked fine. The only other step after that was creating a symlink: cd ln -s py-2.5.1 py and adding /home/me/py/bin to my $PATH. Doesn't seem like hyper-paranoid sysadmining is all that efficient, does it? Well, on a server with many other users, they've pretty much gotta keep you confined to your home directory. My issues have been with keeping a ~/pylib directory for extra modules, and reconciling that with setuptools / Easy Install. I'm curious to hear how other folks manage their own local module directory. I just do ./configure --prefix=$HOME;make;make install My PATH has $HOME/bin, and LD_LIBRARY_PATH has $HOME/lib before the system bin and lib directories. Everything works just fine. I do the same thing for everything else I download for personal use when I want to use a more up to date version of what's installed. For Windoze, Python gets installed in C:\Python24 (or C:\Python25 now, I guess) and you don't need admin rights for that. (Thank you, Python developers!) -- http://mail.python.org/mailman/listinfo/python-list
Re: os.listdir(file specifications) doesn't work ??
On May 14, 4:09 pm, Stef Mientki [EMAIL PROTECTED] wrote: hello, I want to find all files with the extension *.txt. From the examples in Learning Python, Lutz and Asher and from the website I see examples where you also may specify a wildcard filegroup. But when I try this files = os.listdir('D:\\akto_yk\\yk_controle\\*.txt') I get an error message WindowsError: [Errno 123] The filename, directory name, or volume label syntax is incorrect: 'D:\\akto_yk\\yk_controle\\*.txt/*.*' What am I doing wrong ? thanks, Stef Mientki You want the glob module http://docs.python.org/lib/module-glob.html import glob glob.glob('*.txt') -- http://mail.python.org/mailman/listinfo/python-list
list of datasaources with pyodbc
How do I get a list of datasources with pyodbc? I know that with mx.ODBC.Windows I can use the DataSources method to get a dictionay containing the datasources. Is there a similar way to do this with pyodbc? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list
Re: INSERT statements not INSERTING when using mysql from python
Not sure if this will help, as you said you already tried autocommit, but did you try to commit after creating the table, then doing all the inserts before commiting on disconnect? (I'm no MySQL or Python guru, but I do use it with python and MySQLdb .) -- http://mail.python.org/mailman/listinfo/python-list
using pydoc in an application
Hi all, I'm discovering pydoc, and it seems to me that this is a great way to have online documentation for my application. Are there any examples of using this in some kind of help menu in an application? I've tried to just bind pydoc.gui() to a menu item, but this just brings up the GUI for pydoc, and the user still needs to search for the module before the browser comes up, and when I quit serving pydoc.gui(), my application dies along with it. Also, I need to get out of python to use pydoc.gui again, or I get error: (98, 'Address already in use') I'm sure there's a better way to take advantage of this module and my docstrings to get some online help. I'm using Tkinter and Pmw, but maybe it's time to convert all this to wxWidgets? Thanks for any help. -- http://mail.python.org/mailman/listinfo/python-list
Re: using pydoc in an application
I went and looked at the pydoc.py code, and it looks like it isn't really meant to be used from inside another python program. After some tinkering arond with my code, I ended up with this: (Google is messing up my indentation) (in my __init__ function) ... menuBar.addmenuitem('Help', 'command', '', command=self.run_pydoc, label='Run pydoc (module help GUI)') ... def run_pydoc(self): Run pydoc -g for gui based help if 'linux' in sys.platform: os.system('pydoc -g') if 'win32' in sys.platform: os.system(os.path.join(sys.prefix, 'Tools', 'Scripts', 'pydocgui.pyw')) return A bit of a kludge, but it works for me. timw.google wrote: Hi all, I'm discovering pydoc, and it seems to me that this is a great way to have online documentation for my application. Are there any examples of using this in some kind of help menu in an application? I've tried to just bind pydoc.gui() to a menu item, but this just brings up the GUI for pydoc, and the user still needs to search for the module before the browser comes up, and when I quit serving pydoc.gui(), my application dies along with it. Also, I need to get out of python to use pydoc.gui again, or I get error: (98, 'Address already in use') I'm sure there's a better way to take advantage of this module and my docstrings to get some online help. I'm using Tkinter and Pmw, but maybe it's time to convert all this to wxWidgets? Thanks for any help. -- http://mail.python.org/mailman/listinfo/python-list
Re: Help req: Problems with MySQLdb
Do you have a MySQL acccount set up on the localhost? I usually create two users with the same privs. One for the localhost where the server is, another to connect from somewhere else. Something like mysql grant usage on *.* to 'user'@'localhost' identitfied by 'some_pass'; mysql grant usage on *.* to 'user'@'%' to identified by 'some_pass'; Check out http://dev.mysql.com/doc/refman/4.1/en/adding-users.html Hope this helps. rodmc wrote: I have written an application that connects to a database on a remote machine which uses MySQLdb 1.2.0. The application works perfectly when connecting to the database from a remote machine, however when it attempts to connect to a database on the same machine a connection error is generated. I have attached what little info I can below. DBSERVERIP = 1.2.3.4 db = MySQLdb.connect(host=DBSERVERIP, user=user, passwd=password, db=nuke) --- it refuses to connect on the above line and the exception is caught and a message displayed. -- http://mail.python.org/mailman/listinfo/python-list
pylab doesn't find numpy on Windows
Hi all. I installed matplotlib 0.87.3 under Python 2.4 on both Linux (FC3) and Windows XP Pro. On the linux install, I can import pylab, but when I try to do the same thing on the Windows installation, I get from pylab import * Traceback (most recent call last): File pyshell#7, line 1, in -toplevel- from pylab import * File C:\Python24\Lib\site-packages\pylab.py, line 1, in -toplevel- from matplotlib.pylab import * File C:\Python24\Lib\site-packages\matplotlib\pylab.py, line 196, in -toplevel- import cm File C:\Python24\Lib\site-packages\matplotlib\cm.py, line 5, in -toplevel- import colors File C:\Python24\Lib\site-packages\matplotlib\colors.py, line 33, in -toplevel- from numerix import array, arange, take, put, Float, Int, where, \ File C:\Python24\Lib\site-packages\matplotlib\numerix\__init__.py, line 60, in -toplevel- from Numeric import * ImportError: No module named Numeric I have numpy 0.9.8 installed in both places too. Thanks for any help. -- http://mail.python.org/mailman/listinfo/python-list
Re: pylab doesn't find numpy on Windows
Thanks. That did it. Alexandre Fayolle wrote: Le 13-06-2006, timw.google [EMAIL PROTECTED] nous disait: Hi all. I installed matplotlib 0.87.3 under Python 2.4 on both Linux (FC3) and Windows XP Pro. On the linux install, I can import pylab, but when I try to do the same thing on the Windows installation, I get from pylab import * snip ImportError: No module named Numeric I have numpy 0.9.8 installed in both places too. it is trying to load Numeric python. You need to configure matplotlib to use numpy by saying numerix : numpy in the matplotlibrc file. -- Alexandre Fayolle LOGILAB, Paris (France) Formations Python, Zope, Plone, Debian: http://www.logilab.fr/formations Développement logiciel sur mesure: http://www.logilab.fr/services Python et calcul scientifique: http://www.logilab.fr/science -- http://mail.python.org/mailman/listinfo/python-list
can distutils windows installer invoke another distutils windows installer
Hi all. I have a package that uses other packages. I created a setup.py to use 'try:' and import to check if some required packages are installed. I have the tarballs and corresponding windows installers in my sdist distribution, so if I untar my source distribution and do 'python setup.py install', the script either untars the subpackages to a tmp directory and does an os.system('python setup.py install') (Linux), or os.system(bdist_wininst installer) (win32) for the missing subpackage. This seems to work fine, except that on Windows, I can't uninstall the main package with Windows 'Add or Remove Programs' from the control panel. If I install my main package with a bdist_winst installer, I can. Is there a way to set up a bdist_wininst installer to do what I can do with the source dist? Thanks in advance, Tim Williams -- http://mail.python.org/mailman/listinfo/python-list
Re: installing pyodbc
No I didn't. Thanks for the reply. I've moved on to mx.ODBC. -- http://mail.python.org/mailman/listinfo/python-list
installing pyodbc
I just downloaded the pyodbc source to try and install on my Linux FC3 box. I see that there is a setup.py file, but when I try to do a 'python setup.py build' (or just 'python setup.py') I get Traceback (most recent call last): File setup.py, line 27, in ? revision = latest_revision('.') File setup.py, line 25, in latest_revision return int(output) ValueError: invalid literal for int(): exported The README.txt doesn't really say anything about how to install, exept that the easiest way is to use the Windows installer. That's fine for Windows, but what about Linux? Thanks for any help. -- http://mail.python.org/mailman/listinfo/python-list