While and If messing up my program?

2005-10-04 Thread CJ
Hey, I'm new to the Python world, but I do have experience in several other languages. I've been running through a tutorial, and I decided that I'd make a program that runs through a list, finds if there are any duplicates. The program, doesn't work, but since its a first build I wasn't to

Re: Help needed in OOP-Python

2005-10-04 Thread Toufeeq Hussain
Hi Fredrik,On 10/5/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Toufeeq Hussain wrote:> I have 3 modules which have class declarations in them and which implement> multiple inheritance.> Traceback (most recent call last):> File "E:\PyPBM\PyPBM\test_case.py", line 7, in ? >TH = constraint.Option1_Ru

Re: Build spoofed IP packets

2005-10-04 Thread Sybren Stuvel
billie enlightened us with: > For low level packet building I already used Impacket module but if > I specify a spoofed src address during IP packet creation, module > returns an error. Suggestions? Yes, give us the error. And know that you can't build raw IP packets unless you're root. Sybren -

Re: Mantain IDE colors and paste them in an HTML page

2005-10-04 Thread Sybren Stuvel
Micah Elliott enlightened us with: > If you're just trying to get copy/paste-able-from-browser html that > has pretty colors, you might start up vim and use the default > colors. You might have to say ":syntax enable". Then just type > ":TOhtml" and you'll have a colorized version of your "IDE" d

Re: Help needed in OOP-Python

2005-10-04 Thread Fredrik Lundh
Toufeeq Hussain wrote: > I have 3 modules which have class declarations in them and which implement > multiple inheritance. > Traceback (most recent call last): > File "E:\PyPBM\PyPBM\test_case.py", line 7, in ? >TH = constraint.Option1_Rule1() there's no line that says "TH = constraint.Option1_

Re: Newbie Text Processing Question

2005-10-04 Thread Fredrik Lundh
Gregory Piñero wrote: >That's how Python works. You read in the whole file, edit it, and write it > back out. that's how file systems work. if file systems generally supported insert operations, Python would of course support that feature. -- http://mail.python.org/mailman/listinfo/python-

Help needed in OOP-Python

2005-10-04 Thread Toufeeq Hussain
Hello gurus, Python n00b here trying to learn some OOP-Python.Here's my problem. I have 3 modules which have class declarations in them and which implement multiple inheritance. Module1 class OptionClass:     def __init__ (self,name,ORSpecNumber,AltToItselfStart,AltToItselfEnd) :       

Re: Newbie Text Processing Question

2005-10-04 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I'm a total newbie to Python so any and all advice is greatly > appreciated. Well, I've got some for you. > I'm trying to use regular expressions to process text in an SGML file > but only in one section. This is generally a bad idea. SGML family languages aren't easy

Re: isatty() for file-like objects: Implement or not?

2005-10-04 Thread Neal Norwitz
HOWARD GOLDEN wrote: > The standard documentation for isatty() says: > > "Return True if the file is connected to a tty(-like) device, else > False. Note: If a file-like object is not associated with a real file, > this method should not be implemented." > > In his book, "Text Processing in

Re: check html file size

2005-10-04 Thread Tad McClellan
Xah Lee <[EMAIL PROTECTED]> wrote: > would anyone like to translate the following perl script to Python or > Scheme (scsh)? Yes, I would. -- Tad McClellan SGML consulting [EMAIL PROTECTED] Perl programming Fort Worth, Texas -- http://mai

Re: Newbie Text Processing Question

2005-10-04 Thread James Stroud
You can edit a file in place, but it is not applicable to what you are doing. As soon as you insert the first "", you've shifted everything downstream by those 8 bytes. Since they map to a physically located blocks on a physical drive, you will have to rewrite those blocks. If it is a big file

Re: Newbie Text Processing Question

2005-10-04 Thread Gregory Piñero
That's how Python works.  You read in the whole file, edit it, and write it back out.  As far as I know there's no way to edit a file "in place" which I'm assuming is what you're asking? And now, cue the responses telling you to use a fancy parser (XML?) for your project ;-) -Greg On 4 Oct 2005 2

Newbie Text Processing Question

2005-10-04 Thread gshepherd281
Hi, I'm a total newbie to Python so any and all advice is greatly appreciated. I'm trying to use regular expressions to process text in an SGML file but only in one section. So the input would look like this: RESEARCH GUIDE content content content content FORMS content content content cont

Help with chaos math extensions.

2005-10-04 Thread Brandon Keown
Hi, I have programmed a fractal generator (Julia Set/Mandelbrot Set) in python in the past, and have had good success, but it would run so slowly because of the overhead involved with the calculation. I recently purchased VS .NET 2003 (Win XP, precomp binary of python 2.4.2rc1) to make my

Re: check html file size

2005-10-04 Thread Erik Max Francis
Matt Garrish wrote: > Even if you weren't an incredibly offensive and petulant poster, what makes > you think anyone would write a script from you? Because in addition to being offensive and petulant, he's also an idiot. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ S

Re: python plotting with greek symbols within labels recommendations?

2005-10-04 Thread skip
mike> thus far, i've found that matplotlib mike> (http://matplotlib.sourceforge.net/) can do this, albeit the mike> implementation is so poor that you cannot mix standard text with mike> symbols on the same plot element. That seems a bit harsh. Have you asked on the matplotlib ma

Turn $6 into $6.000

2005-10-04 Thread Ville
HOW TO TURN 6 BUCKS INTO 6 THOUSAND! (WORLD WIDE) WARNING: READING THIS WILL CHANGE YOUR LIFE! I found this on a Bulletin board and decided to try it. A little while back, I was browsing through newsgroups, just like you are now, and came across an article similar to this that said you could make

Re: check html file size

2005-10-04 Thread Grant Edwards
On 2005-10-05, Xah Lee <[EMAIL PROTECTED]> wrote: > would anyone like to translate the following perl script to > Python or Scheme (scsh)? Sure. It'll cost you $110/hour with a 2-hour minimum. Where do I send the invoice? -- Grant Edwards grante Yow! I'll take RO

Re: check html file size

2005-10-04 Thread Matt Garrish
"Xah Lee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > would anyone like to translate the following perl script to Python or > Scheme (scsh)? Even if you weren't an incredibly offensive and petulant poster, what makes you think anyone would write a script from you? Matt --

Re: Will python never intend to support private, protected and public?

2005-10-04 Thread Paul Rubin
"El Pitonero" <[EMAIL PROTECTED]> writes: > If so, you would probably be the type of person that also likes static > typing, type safety and variable declaration, right? I certainly want type safety, which Python claims to have. I'd like to have variable declaration, at least like "var x". Perl

check html file size

2005-10-04 Thread Xah Lee
would anyone like to translate the following perl script to Python or Scheme (scsh)? the file takes a inpath, and report all html files in it above certain size. (counting inline images) also print a sorted report of html files and their size. (a copy of the script is here: http://xahlee.org/_scr

Re: dictionary interface

2005-10-04 Thread Robert Kern
Tom Anderson wrote: > On Tue, 4 Oct 2005, Robert Kern wrote: > >>Antoon Pardon wrote: >> >>> class Tree: >>> >>>def __lt__(self, term): >>> return set(self.iteritems()) < set(term.iteritems()) >>> >>>def __eq__(self, term): >>> return set(self.iteritems()) == set(term.iteritems(

Re: Idle

2005-10-04 Thread [EMAIL PROTECTED]
If you are compiling python and you want to build idle/tkinter, you need to have the development packages for tcl and tk. The python build scripts will only build tkinter should they find the libraries (libtk8.4.so and libtcl8.4.so) and the header files (tk.h and tcl.h). If you don't have the devel

Re: ssh or other python editor

2005-10-04 Thread jussij
> I'm working/making my python scripts in a windows OS > with putty now. If you need an FTP editor take a look at Zeus: http://www.zeusedit.com/features.html Zeus will do SSH, SSL/TLS and plain old FTP editing, with support for Unix, Windows, VM and MVS FTP servers. Just remember to setup y

Re: wxPython equiv. to tag_configure

2005-10-04 Thread ncf
Errm, can you slap me please? :X Either way, thank you soo much :) -Wes -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary interface

2005-10-04 Thread Tom Anderson
On Tue, 4 Oct 2005, Robert Kern wrote: > Antoon Pardon wrote: > >> class Tree: >> >> def __lt__(self, term): >> return set(self.iteritems()) < set(term.iteritems()) >> >> def __eq__(self, term): >> return set(self.iteritems()) == set(term.iteritems()) >> >> Would this be a co

Re: [Distutils] py2exe has a new maintainer

2005-10-04 Thread Bob Ippolito
On Oct 4, 2005, at 5:01 PM, Jimmy Retzlaff wrote: > After I feel comfortable with things, I hope to work with other > projects > in the Python packaging community (e.g., cx_Freeze, > PyInstaller/McMillan, py2app, setuptools, etc.) to see if we can't > find > synergies that will make all of th

Re: python plotting with greek symbols within labels recommendations?

2005-10-04 Thread Robert Kern
[EMAIL PROTECTED] wrote: > hello all, > > this message is geared toward those of you in the scientific community. > i'm looking for a python plotting library that can support rendering > greek symbols and other various characters on plot axes labels, etc. I > would prefer something that adheres to

Re: "no variable or argument declarations are necessary."

2005-10-04 Thread Neil Hodgson
C++ and C# are converging with implicitly typed languages to the extent that many declarations will be able to omit types. In the next C++ standard and in C# 3.0 it may be possible to write, where Fn is a function returning any particular type: auto spam = Fn(); // C++0x var spam = Fn

isatty() for file-like objects: Implement or not?

2005-10-04 Thread HOWARD GOLDEN
The standard documentation for isatty() says: "Return True if the file is connected to a tty(-like) device, else False. Note: If a file-like object is not associated with a real file, this method should not be implemented." In his book, "Text Processing in Python," David Mertz says: "..

Re: python plotting with greek symbols within labels recommendations?

2005-10-04 Thread Robert Kern
[EMAIL PROTECTED] wrote: > hello all, > > this message is geared toward those of you in the scientific community. > i'm looking for a python plotting library that can support rendering > greek symbols and other various characters on plot axes labels, etc. I > would prefer something that adheres to

py2exe has a new maintainer

2005-10-04 Thread Jimmy Retzlaff
I am taking over the maintenance and support of py2exe from Thomas Heller. As he announced a few weeks ago he is looking to focus on other things. py2exe has been very useful to me over the years and I look forward to keeping it every bit as useful in the future. I plan to make the transition as s

python plotting with greek symbols within labels recommendations?

2005-10-04 Thread michael . s . gilbert
hello all, this message is geared toward those of you in the scientific community. i'm looking for a python plotting library that can support rendering greek symbols and other various characters on plot axes labels, etc. I would prefer something that adheres to tex formatting (as implemented in la

Re: Python script to install network printers

2005-10-04 Thread Roger Upole
You can use win32print.AddPrinterConnection(r'\\server\sharedprinter'). However, if the printer driver has to be copied to the client machine and installed, that's probably where most of the time is spent. hth Roger "Matt Chan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTE

Re: Jargons of Info Tech industry

2005-10-04 Thread marduk
[Removed X-posting] On Tue, 2005-10-04 at 17:14 +, Roedy Green wrote: > On Tue, 23 Aug 2005 08:32:09 -0500, l v <[EMAIL PROTECTED]> wrote or quoted : > > >I think e-mail should be text only. > > I disagree. Your problem is spam, not HTML. Spam is associated with > HTML and people have in

Re: Jargons of Info Tech industry

2005-10-04 Thread Steven D'Aprano
On Tue, 04 Oct 2005 17:14:45 +, Roedy Green wrote: > On Tue, 23 Aug 2005 08:32:09 -0500, l v <[EMAIL PROTECTED]> wrote or quoted : > >>I think e-mail should be text only. > > I disagree. Your problem is spam, not HTML. Spam is associated with > HTML and people have in Pavlovian fashion co

Re: "no variable or argument declarations are necessary."

2005-10-04 Thread Paul Rubin
marduk <[EMAIL PROTECTED]> writes: > def myfunc(MyClass myparam): >int spam = 6 >str eggs > ># etc > > i.e. typed declarations and type checking. This would annoy the heck > out of me. It could be like Lisp, which has optional type declarations. If you use the type declarations, t

Re: New project coming up...stay with Python, or go with a dot net language??? Your thoughts please!

2005-10-04 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, spiffo <[EMAIL PROTECTED]> wrote: . . . >I am a corporate developer, working for a single company. Got a new project >coming up and wondering if I should stay with Python for this new, fairly >la

Re: how to get any available port

2005-10-04 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: . . . >Here's how it behaved over several runs: >$ python soc.py >('0.0.0.0', 34205) >$ python soc.py >('0.0.0.0', 34206) >$ python soc.py >('0.0.0.0', 34207) > >I

Re: "no variable or argument declarations are necessary."

2005-10-04 Thread marduk
On Tue, 2005-10-04 at 11:43 -0700, Paul Rubinhttp: wrote: > What's the big deal? Perl has an option for flagging undeclared > variables with warnings ("perl -w") or errors ("use strict") and Perl > docs I've seen advise using at least "perl -w" routinely. Those > didn't have much impact. Python

Re: Exception raising, and performance implications.

2005-10-04 Thread Tom Anderson
On Mon, 3 Oct 2005, it was written: > "leo" <[EMAIL PROTECTED]> writes: > >> I come from a java background, where Exceptions are a big Avoid Me, but >> are the performance implications the same in Python? > > Well, you could measure it experimentally pretty easily, but anyway, > Python exception

Re: wxPython equiv. to tag_configure

2005-10-04 Thread Michael Ekstrand
On Oct 4, 2005, at 3:11 PM, ncf wrote: > In the wxWidgets manual, I see a wxHtmlWindow object, but nothing like > that seems to exist when I dir() wxPython. wxHtmlWindow is in the wx.html module. -Michael -- http://mail.python.org/mailman/listinfo/python-list

Pygame: Filling the screen with tile images

2005-10-04 Thread CPUFreak91
I'm new to Pygame (by 2 days) and I can't figure out how to tile and image as the background image. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get any available port

2005-10-04 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Grant Edwards wrote: > > IIRC, you just call bind() with a port number of zero, and then > > use some method-or-other on the bound socket to find out what > > port it's bound to. > > >>> s = socket.socket() > >>> s.bind(("", 0)) > >>> s.getsockaddr() >

Build spoofed IP packets

2005-10-04 Thread billie
Hi all. I'd need to build spoofed IP packets. Do you know something about a python implementation? For low level packet building I already used Impacket module but if I specify a spoofed src address during IP packet creation, module returns an error. Suggestions? Regards. -- http://mail.pyt

Re: Mantain IDE colors and paste them in an HTML page

2005-10-04 Thread Micah Elliott
On Oct 04, billie wrote: > I need to insert a Python source in an HTML page mantaining to > coloration gives by the IDE. Do you care what IDE? > I tried the export function of scite but it does not generate a proper > HTML code that permit me to copy and paste it into another HTML page. > Does a

Re: how to get any available port

2005-10-04 Thread Fredrik Lundh
Grant Edwards wrote: > IIRC, you just call bind() with a port number of zero, and then > use some method-or-other on the bound socket to find out what > port it's bound to. >>> s = socket.socket() >>> s.bind(("", 0)) >>> s.getsockaddr() ("0.0.0.0", 4711) -- http://mail.python.org/mailman/l

Re: Mantain IDE colors and paste them in an HTML page

2005-10-04 Thread jay graves
billie wrote: > I tried the export function of scite but it does not generate a proper HTML > code that permit me to copy and paste it into another HTML page. Works OK for me. What exactly is it doing wrong on your side? > Does anyone got any suggestion? I've used Webcpp before. http://webcpp.

Boost.python mingw install on XP

2005-10-04 Thread fqueirolo
Hello all I am trying to install boost.python on my XP box. Boost: 1.33.0 Python: 2.4.2 (Final) MinGw: 4.1.1 I try: D:\Dev\boost_1_33_0\libs\python\build>bjam "--prefix=D:\Dev\boosttarget" "-sTOOLS=mingw" "--with-python-root=D:\Dev\Python24" "--with-python" install from a DOS command prompt.

Excel library with unicode support

2005-10-04 Thread Mike Tammerman
Hi, I want to create an Excel file, but I don't to use com or any win32 object. Because, the file should be opened via OpenOffice. I found pyXLWriter, but it doesn't support unicode or non-ascii characters. Is there a python library, that is able to create Excel files with unicode characters. I t

Re: Controlling who can run an executable

2005-10-04 Thread Cigar
Tony Nelson wrote: > In article <[EMAIL PROTECTED]>, > "Cigar" <[EMAIL PROTECTED]> wrote: > > > I am developing a program for a client. She runs a shop where her > > clients bring in items for sale or short term buyback. Development of > > the program has been going great but she's mentioned th

PythonWin: Change background color

2005-10-04 Thread Bell, Kevin
Does anyone know of a way to change the background color of the PythonWin windows from the blinding white, to another color, like the way MS Word will allow a dark blue background with white text? I know you can specify colors for all the different style of text via View/Options/Format, but I see

Mantain IDE colors and paste them in an HTML page

2005-10-04 Thread billie
Hi all. I need to insert a Python source in an HTML page mantaining to coloration gives by the IDE. I tried the export function of scite but it does not generate a proper HTML code that permit me to copy and paste it into another HTML page. Does anyone got any suggestion? Regards -- http://ma

Re: how to get any available port

2005-10-04 Thread Grant Edwards
On 2005-10-04, Paul Rubin <> wrote: > Grant Edwards <[EMAIL PROTECTED]> writes: >> > In the nomenclature of some of these applications, that kind >> > of transfer is called a client to client connection. Both >> > ends are called clients. >> >> IIRC, we were talking about TCP sockets. > So, ther

Re: how to get any available port

2005-10-04 Thread Grant Edwards
On 2005-10-04, Paul Rubin <> wrote: > Mohammed Smadi <[EMAIL PROTECTED]> writes: >> #transmission socket >> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >> s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) >> s.bind(("",hp_port)) # do some error checking >> ... >> any suggestions fo

Re: how to get any available port

2005-10-04 Thread Grant Edwards
On 2005-10-04, Mohammed Smadi <[EMAIL PROTECTED]> wrote: > On Tue, 4 Oct 2005, Grant Edwards wrote: > >> On 2005-10-04, ncf <[EMAIL PROTECTED]> wrote: >> >> > Hmm...perhaps he is trying to do a transfer thing like many chat >> > programs do. Instead of sending large files across a server, you >> >

Re: Controlling who can run an executable

2005-10-04 Thread Cigar
Istvan Albert wrote: > > I could ask her, "If you can't break it is that good enough security?" > > Guess not. Most non-programmers think everyone else who knows some > programming is a some sort of hacker genius. > > Instead come up with a simple solution then explain her how it will > works. I t

Re: how to get any available port

2005-10-04 Thread Fredrik Lundh
Mohammed Smadi wrote: > what else would you do? I am using examples from the web and they all > bind to a port at the localhost before connecting to the remote host. pointers, please. > my code is like this > > #transmission socket > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s.se

Re: how to get any available port

2005-10-04 Thread Paul Rubin
Mohammed Smadi <[EMAIL PROTECTED]> writes: > #transmission socket > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) > s.bind(("",hp_port)) # do some error checking > ... > any suggestions for alternative implementation? In this parti

Re: how to get any available port

2005-10-04 Thread jepler
On Tue, Oct 04, 2005 at 05:19:37PM -0400, Mohammed Smadi wrote: > what else would you do? I am using examples from the web and they all > bind to a port at the localhost before connecting to the remote host. [...] the web must be stupider than I thought. Here's how Python's own ftplib connects

Re: how to get any available port

2005-10-04 Thread Paul Rubin
Grant Edwards <[EMAIL PROTECTED]> writes: > > In the nomenclature of some of these applications, that kind > > of transfer is called a client to client connection. Both > > ends are called clients. > > IIRC, we were talking about TCP sockets. Yes, but if the person was talking about using TCPs s

Re: Idle

2005-10-04 Thread Hrvoje Blazevic
Philippe C. Martin wrote: > Hi, > > I remember having that when the wrong version of TCL/TK was installed on my > system. > And what is the right version? I have versions that came with their respective distros (8.4.9 in case of Suse) -- Hrvoje -- http://mail.python.org/mailman/listinfo/pytho

Re: how to get any available port

2005-10-04 Thread Mohammed Smadi
On Tue, 4 Oct 2005, Grant Edwards wrote: > On 2005-10-04, ncf <[EMAIL PROTECTED]> wrote: > > > Hmm...perhaps he is trying to do a transfer thing like many chat > > programs do. Instead of sending large files across a server, you > > "Direct Connect" and send the file directly. :shrugs: > > So ho

Re: Call C functions from Python

2005-10-04 Thread Martin v. Löwis
Java and Swing wrote: > Is there some other way, besides SWIG, which will allow me to call > functions inside an Ansi C DLL? You could write an extension module. See Modules/xxmodule.c in the Python source tree, as well as http://docs.python.org/ext/ext.html In the specific case, if it weren't f

Re: how to get any available port

2005-10-04 Thread jepler
Apparently, calling bind() with a zero "port" will choose some available port number, as demonstrated by this program: import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("", 0)) print s.getsockname() Here's how it behaved over several runs: $ python soc.py ('0.0.0.0', 34

Re: Call C functions from Python

2005-10-04 Thread Grant Edwards
On 2005-10-04, Java and Swing <[EMAIL PROTECTED]> wrote: > ok i got ctypes...now i try > >>> from ctypes import * >>> myApp = CDLL("C:\\myapp.dll") I've never seen that sort of usage before. I don't know what CDLL does, and I can't find it in the docs anywhere. Based on my reading of the tutoria

Re: Idle

2005-10-04 Thread Philippe C. Martin
Hi, I remember having that when the wrong version of TCL/TK was installed on my system. Regards, Philippe Hrvoje Blazevic wrote: > How do I get Idle to work on Linux? > > I've tried to compile 2.4.2 on Fedora core 4, and Suse 9.3, but Idle is > after make install either missing (Fedora), or

Re: how to debug when "Segmentation fault"

2005-10-04 Thread jepler
I've rewritten your middle example to be clearer. $ python2.4 Python 2.4.1 (#1, May 16 2005, 15:15:14) [GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> type("Y", (type,), {"mro": lambda x: [float]})("X", (), {}) and here's

Re: how to get any available port

2005-10-04 Thread Grant Edwards
On 2005-10-04, Paul Rubin <> wrote: > Grant Edwards <[EMAIL PROTECTED]> writes: >> > Hmm...perhaps he is trying to do a transfer thing like many chat >> > programs do. Instead of sending large files across a server, you >> > "Direct Connect" and send the file directly. :shrugs: >> >> So how does t

Re: how to get any available port

2005-10-04 Thread Paul Rubin
Grant Edwards <[EMAIL PROTECTED]> writes: > > Hmm...perhaps he is trying to do a transfer thing like many chat > > programs do. Instead of sending large files across a server, you > > "Direct Connect" and send the file directly. :shrugs: > > So how does that require binding the client end of a TCP

Re: Background process for ssh port forwarding

2005-10-04 Thread Jesse Rosenthal
On Tue, 04 Oct 2005 12:40:27 -0700, John Hazen wrote: > I think what's happening is that when you return from 'hostforward', the > connection is being closed because of garbage collection. Python uses > (among other stuff) reference counting to tell it when to delete > objects. After hostforward

Re: Which SQL module to use?

2005-10-04 Thread Bruno Desthuilliers
mrstephengross a écrit : > I'd like to do some basic SQL stuff in Python. It seems like there are > a heck of a lot of SQL modules for Python. What's the simplest and > easiest one to use? Probably the one that go with your RDBMS. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get any available port

2005-10-04 Thread Grant Edwards
On 2005-10-04, ncf <[EMAIL PROTECTED]> wrote: > Hmm...perhaps he is trying to do a transfer thing like many chat > programs do. Instead of sending large files across a server, you > "Direct Connect" and send the file directly. :shrugs: So how does that require binding the client end of a TCP conn

Re: Call C functions from Python

2005-10-04 Thread Java and Swing
ok i got ctypes...now i try >> from ctypes import * >> myApp = CDLL("C:\\myapp.dll") ..now how can I call functions on in myapp.dll? From the tutorial I am not sure..i try, dir(cdll.myApp) and dir(myApp)..but don't see my functions listed. thanks Grant Edwards wrote: > On 2005-10-04, Java and

Idle

2005-10-04 Thread Hrvoje Blazevic
How do I get Idle to work on Linux? I've tried to compile 2.4.2 on Fedora core 4, and Suse 9.3, but Idle is after make install either missing (Fedora), or reports **Idle can't import Tkinter... ** Thanks -- Hrvoje -- http://mail.python.org/mailman/listinfo/python-list

wxPython equiv. to tag_configure

2005-10-04 Thread ncf
Hi all. I'm trying to do a system where I'm working on a set of windows for both Tkinter and wxPython, and have come across a lovely little bump in the road. Tkinter's Text object has tag_* methods, but I don't know of a good way to do tag-related stuff with wxPython. In the wxWidgets manual, I se

Re: how to get any available port

2005-10-04 Thread ncf
Hmm...perhaps he is trying to do a transfer thing like many chat programs do. Instead of sending large files across a server, you "Direct Connect" and send the file directly. :shrugs: -- http://mail.python.org/mailman/listinfo/python-list

Re: Background process for ssh port forwarding

2005-10-04 Thread John Hazen
Hi Jesse- > def hostforward(): > #This is based on the assumption that the passfile is the gnus > #authinfo file, or has a similar format... > f = open(PASS_FILE, "r") > f_list = f.read().split(' ') > f.close() > #Now, we get the entry after "password" (be slicker to make i

Re: Call C functions from Python

2005-10-04 Thread Grant Edwards
On 2005-10-04, Java and Swing <[EMAIL PROTECTED]> wrote: > Is there some other way, besides SWIG, which will allow me to call > functions inside an Ansi C DLL? ctypes -- Grant Edwards grante Yow! Now KEN and BARBIE at

Re: Newbie regular expression ?

2005-10-04 Thread len
Thanks everyone for your help. I took the option of f1.lower().startswith("unq"). Len Sumnler -- http://mail.python.org/mailman/listinfo/python-list

Call C functions from Python

2005-10-04 Thread Java and Swing
Is there some other way, besides SWIG, which will allow me to call functions inside an Ansi C DLL? Example (C): defs.h --- typedef unsigned long MY_DIGIT; myapp.c - #include "defs.h" char *DoSomeStuff(char *input, MY_DIGIT *digits) { ... } ..thats an example of somethi

Re: Newbie regular expression ?

2005-10-04 Thread Steve Holden
len wrote: > I have the following statement and it works fine; > > list1 = glob.glob('*.dat') > > however I now have an additional requirement the the string must begin > with > any form of "UNQ,Unq,unq,..." > > as an example if I had the following four files in the directory: > > unq123abc

SWIG - python.exe crash

2005-10-04 Thread Java and Swing
When I try to print an object in Python, python.exe crashes. Below are my files. defs.h -- typedef unsigned long MY_DIGIT; myapp.c ---

Re: how to debug when "Segmentation fault"

2005-10-04 Thread Michael Ekstrand
On Oct 4, 2005, at 2:08 PM, Jp Calderone wrote: > On Tue, 4 Oct 2005 11:22:24 -0500, Michael Ekstrand > <[EMAIL PROTECTED]> wrote: >> I've never seen "stock" Python (stable release w/ only included >> modules) >> segfault, but did see a segfault with an extension module I was using >> the other w

Re: cgi relay for python cgi script

2005-10-04 Thread Michael Ekstrand
On Oct 4, 2005, at 2:35 AM, Amir Michail wrote: > Is there an easy way to execute a python cgi script on a different > machine from the cgi server? > > I could write my own server, but I was wondering if something is > available that would allow me to use a cgi script as is without > modification.

Re: Python script to install network printers

2005-10-04 Thread Matt Darby
Matt Chan wrote: >Hi, I am trying to create a python script to install a set of network >printers. I have had success using an os.popen statement, using >rundll32 and printui.dll. This takes way too long. Can someone point >me in a quicker direction? > >thanks, >Matt > > I know this is the pytho

Re: how to debug when "Segmentation fault"

2005-10-04 Thread Jp Calderone
On Tue, 4 Oct 2005 11:22:24 -0500, Michael Ekstrand <[EMAIL PROTECTED]> wrote: >On Tuesday 04 October 2005 11:13, Maksim Kasimov wrote: >> my programm sometime gives "Segmentation fault" message (no matter >> how long the programm had run (1 day or 2 weeks). And there is >> nothing in log-files tha

Re: Controlling who can run an executable

2005-10-04 Thread Istvan Albert
> I could ask her, "If you can't break it is that good enough security?" Guess not. Most non-programmers think everyone else who knows some programming is a some sort of hacker genius. Instead come up with a simple solution then explain her how it will works. I think in the ensuing conversation y

Re: cgi relay for python cgi script

2005-10-04 Thread Paul Rubin
"Amir Michail" <[EMAIL PROTECTED]> writes: > Is there an easy way to execute a python cgi script on a different > machine from the cgi server? What exactly do you mean by that? You can set a form target to another machine, if that's what you mean. -- http://mail.python.org/mailman/listinfo/pyth

Re: Newbie regular expression ?

2005-10-04 Thread Micah Elliott
On Oct 04, Micah Elliott wrote: >$ man 3 fnmatch Actually "man 7 glob" would be better (assuming you've got *nix). Also note that globs are not regular expressions. "pydoc glob" is another reference. -- Micah Elliott -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie regular expression ?

2005-10-04 Thread Fredrik Lundh
"len" <[EMAIL PROTECTED]> wrote: >I have the following statement and it works fine; > >list1 = glob.glob('*.dat') that's a glob pattern, not a regular expression. > however I now have an additional requirement the the string must begin > with any form of "UNQ,Unq,unq,..." list1 = glob.g

Re: Newbie regular expression ?

2005-10-04 Thread Micah Elliott
On Oct 04, len wrote: > I have the following statement and it works fine; > > list1 = glob.glob('*.dat') > > however I now have an additional requirement the the string must begin > with any form of "UNQ,Unq,unq,..." > > as an example if I had the following four files in the directory: > >

Re: Newbie regular expression ?

2005-10-04 Thread jepler
Here are two ideas that come to mind: files = glob.glob("UNQ*.dat") + glob.glob("Unq*.dat") + glob.glob("unq.dat") files = [f for f in glob.glob("*.dat") if f[:3] in ("UNQ", "Unq", "unq")] Jeff pgp30Rue2EGi7.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get any available port

2005-10-04 Thread Fredrik Lundh
Mohammed Smadi wrote: > if am using s.bind for a tcp socket. On the client side i dont really > care which socket i use as long as i get an available socket. Is there a > funciton or a way to get an available socket? why are you using bind if you're on the client side? -- http://mail.pyt

Re: "no variable or argument declarations are necessary."

2005-10-04 Thread Paul Rubin
Brian Quinlan <[EMAIL PROTECTED]> writes: > Have those of you who think that the lack of required declarations in > Python is a huge weakness given any thought to the impact that adding > them would have on the rest of the language? I can't imagine how any > language with required declarations coul

Newbie regular expression ?

2005-10-04 Thread len
I have the following statement and it works fine; list1 = glob.glob('*.dat') however I now have an additional requirement the the string must begin with any form of "UNQ,Unq,unq,..." as an example if I had the following four files in the directory: unq123abc.dat xy4223.dat myfile.dat UNQxyc

how to get any available port

2005-10-04 Thread Mohammed Smadi
hi; if am using s.bind for a tcp socket. On the client side i dont really care which socket i use as long as i get an available socket. Is there a funciton or a way to get an available socket? thanks smadi -- http://mail.python.org/mailman/listinfo/python-list

Re: ssh or other python editor

2005-10-04 Thread Mike Meyer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: >>- I'm a newbie at freeBSD so I think there is , but I don't know where. > Putty isn't doing any syntax coloring; it just draws things in the color > specified > by your editor. If you don't get any colors, it's probably beca

Re: closing sockets

2005-10-04 Thread Grant Edwards
On 2005-10-04, Grant Edwards <[EMAIL PROTECTED]> wrote: >> socket.error: (98, 'Address already in use') >> >> how can i get around that > > http://www.google.com/search?hl=en&q=socket.error%3A+%2898%2C+%27Address+already+in+use%27%29&btnG=Google+Search > > The first hit has this link which explain

Re: closing sockets

2005-10-04 Thread Grant Edwards
On 2005-10-04, Mohammed Smadi <[EMAIL PROTECTED]> wrote: > hi; > > i am executing program whcih uses a tcp socket. At the end of the program > i do s.close() where s is my socket. > > when i try to run the program again right away i get the following error > Traceback (most recent call last): >

  1   2   3   >