Re: porting vc++ project to python?

2007-08-23 Thread Diez B. Roggisch
marco Starglider schrieb: > hi, > > i have a very large project in visual studio2005->visual c++ in windowsxp. > i'd like to port it, or my next project, over to python. > is this possible without rewriting all my code? > are there multiple options to do this? > my project is so large, that entir

Re: How do I get the current path of my python file that is currently running.

2007-08-23 Thread Arnau Sanchez
Lamonte Harris escribió: > Say I start i click on a python file on my desktop, how could I return > the path of the current python file thats running? http://docs.python.org/lib/module-sys.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Xah's Edu Corner: Under the spell of Leibniz's dream

2007-08-23 Thread Matthias Buelow
In comp.lang.lisp Bikal KC <[EMAIL PROTECTED]> wrote: > I used usenet years ago then stopped for couple of years. I remember > seeing him/her on c.l.perl I believe doing the same thing he/she is > doing atm. I'd say the ultimate usenet superstar. Wow! I think it's some (probably mild) form of aut

[ANN] Python courses this Fall

2007-08-23 Thread wesley chun
Folks, I'd like to announce my final Python courses for 2007: Need to get up-to-speed with Python as quickly as possible? Come join me, Wesley Chun, author of Prentice-Hall's well-received "Core Python Programming," for another set of courses this Fall in beautiful Northern California! This will b

Are there precompiled python for sgi ?

2007-08-23 Thread [EMAIL PROTECTED]
Hi, Are there precompiled python for sgi(IRIX6.5) to download? Several packages(_socket, Tkinter, ...) always failed when I tried to build python from source on our machine running IRIX6.5. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: How would I go about making a file open. Not the way you might think.

2007-08-23 Thread Hendrik van Rooyen
Lamonte Harris wrote: >Basically you can open a file by double clicking, and by default it would open w/ what every program you have it set >to. Most text files would open in notepad. How can I make a txt open so that notepad opens w/ the content in it by >using just python. I asked this ques

Re: What Are These Import/From Statements about?

2007-08-23 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Robert Kern wrote: > os.path. It's a sub-module of the standard os module. Actually, there are no such things as sub-modules (as you'll find out if you try to define one). What it really is is a variable in that module, which points to another module (e.g. posixpat

Re: Raw strings to normal strings conversion?

2007-08-23 Thread James Stroud
Nagarajan wrote: > Is there a way by which I could obtain normal string form of a raw > string. > XML CDATA is returned as raw string. But I need the string to actually > escape special chars. > > Any idea? > This doesn't seem clear. Perhaps an example of what you get and what you want it conve

Re: [ANN] Python courses this Fall

2007-08-23 Thread Jeff Pang
Sounds good.How about the costs for those lessons?thanks. -- "wesley chun" <[EMAIL PROTECTED]> wrote: Folks, I'd like to announce my final Python courses for 2007: Need to get up-to-speed with Python as quickly as possible? Come join me, Wesley Chun, author of Prentice-Hall's well-received "Core

Re: Impersonate another user temporarily (Unix and Windows)

2007-08-23 Thread Tim Golden
billiejoex wrote: > Hi there. I'm writing a modification for a FTP server library I'm > maintaining. > Depending on the system I'd want to temporarily impersonate the logged > user to perform actions on filesystem. > Something like: > > try: > change_user('user', 'password') > os.rmdir('di

Question: wxpython and 3d engine example with model load ?

2007-08-23 Thread OpenPavilion
Hello, did anyone succeed in combining wxpython and a 3d engine (pyogre, crystalblend, panda3d, soya etc.) ? I would like to create an application, which uses wxpython tree, menu and grid elements and embedds a 3d view of some of the listed objects in an own detail window, so showing the object a

Re: Raw strings to normal strings conversion?

2007-08-23 Thread Nagarajan
On Aug 23, 1:21 pm, James Stroud <[EMAIL PROTECTED]> wrote: > Nagarajan wrote: > > Is there a way by which I could obtain normal string form of a raw > > string. > > XML CDATA is returned as raw string. But I need the string to actually > > escape special chars. > > > Any idea? > > This doesn't see

Re: python debugging under emacs?

2007-08-23 Thread Alberto Griggio
> Is there a debugging mode in emacs that works well with python? > > I tried gud, but it was giving me errors, so I thought I'd ask before I > try to get it to work: Is there an emacs mode (perhaps gud) that'll give a > view of the python source, and currenly executing line, the ability > inspect

Re: Raw strings to normal strings conversion?

2007-08-23 Thread Marc 'BlackJack' Rintsch
On Thu, 23 Aug 2007 09:21:40 +, Nagarajan wrote: > On Aug 23, 1:21 pm, James Stroud <[EMAIL PROTECTED]> wrote: >> Nagarajan wrote: >> > Is there a way by which I could obtain normal string form of a raw >> > string. >> > XML CDATA is returned as raw string. But I need the string to actually >>

Re: Baby Steps, optionDB

2007-08-23 Thread Padraig
On Aug 23, 4:41 am, "W. Watson" <[EMAIL PROTECTED]> wrote: > root.option_readfile('optionDB') Just leave out the line which tries to read in the non-existent config file... -- http://mail.python.org/mailman/listinfo/python-list

Joining elements in a list to 1 element

2007-08-23 Thread dimitri pater
Dear all, I am having trouble joining elements in a list into 1 element. e.g. ['a','b','c'] into ['abc'] so that len(list) returns 1 I have tried the following: myList = ['a','b','c'] print myList >>>['a', 'b', 'c'] # get type print type(myList) >>> # get length print len(myList) >>>3 myList2 = '

beginner, idiomatic python

2007-08-23 Thread bambam
Would someone like to suggest a replacement for this? It works ok, but it doesn't look like any of the other code: tempList = ['1','2','3','4','5','6','7','8'] sampleList=[] for port in tempList: pagefound = False for i in range(self.parent.GetPageCount()): page=self.parent.GetPage

Socket recv(1) seems to block instead of returning end of file.

2007-08-23 Thread Hendrik van Rooyen
While doing a netstring implementation I noticed that if you build a record up using socket's recv(1), then when you close the remote end down, the recv(1) hangs, despite having a short time out of 0.1 set. If however, you try to receive more than one char, (I tested with 3, did not try 2), then

Re: Raw strings to normal strings conversion?

2007-08-23 Thread Nagarajan
On Aug 23, 2:42 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Thu, 23 Aug 2007 09:21:40 +, Nagarajan wrote: > > On Aug 23, 1:21 pm, James Stroud <[EMAIL PROTECTED]> wrote: > >> Nagarajan wrote: > >> > Is there a way by which I could obtain normal string form of a raw > >> > strin

Re: Joining elements in a list to 1 element

2007-08-23 Thread Francesco Guerrieri
On 8/23/07, dimitri pater <[EMAIL PROTECTED]> wrote: > > Dear all, > I am having trouble joining elements in a list into 1 element. > e.g. ['a','b','c'] into ['abc'] so that len(list) returns 1 > > You need to append the joined string to your new list. For instance my_list = ["a", "b", "c"] my_seco

Re: Impersonate another user temporarily (Unix and Windows)

2007-08-23 Thread billiejoex
On 23 Ago, 10:38, Tim Golden <[EMAIL PROTECTED]> wrote: > billiejoex wrote: > > Hi there. I'm writing a modification for a FTP server library I'm > > maintaining. > > Depending on the system I'd want to temporarily impersonate the logged > > user to perform actions on filesystem. > > Something like

Re: Impersonate another user temporarily (Unix and Windows)

2007-08-23 Thread Chris Mellon
On 8/23/07, billiejoex <[EMAIL PROTECTED]> wrote: > On 23 Ago, 10:38, Tim Golden <[EMAIL PROTECTED]> wrote: > > billiejoex wrote: > > > Hi there. I'm writing a modification for a FTP server library I'm > > > maintaining. > > > Depending on the system I'd want to temporarily impersonate the logged >

sentance containg the string or symbol Ω

2007-08-23 Thread yadin
how can i print a sentance containg the string or symbol Ω in python and also lambda? -- http://mail.python.org/mailman/listinfo/python-list

Re: Baby Steps, optionDB

2007-08-23 Thread W. Watson
That got things moving. Thanks. It looks like I have some typos to deal with now. I used to program in C++, and there's one thing I've never liked about OOP. Too much typing! Padraig wrote: > On Aug 23, 4:41 am, "W. Watson" <[EMAIL PROTECTED]> wrote: >> root.option_readfile('optionDB') > > Just

Re: Baby Steps, optionDB

2007-08-23 Thread W. Watson
Thanks. I think I agree about the book comment. I used to dabble with Tcl/Tk many years ago. About a year ago, I sold my only book on it. I thought I'd never need it again! I wonder if Grayson's (e-book on his site) has improved. After spending about 90 minutes with IDLE, I'm not real impressed.

Re: sentance containg the string or symbol ?

2007-08-23 Thread Peter Otten
yadin wrote: > how can i print a sentance containg the string or symbol ? in python > and also lambda? The most robust way is to use unicode strings: >>> print u"? and also \N{GREEK CAPITAL LETTER LAMDA}" ? and also ? If you use literals like the omega above you also have to specify the encodin

Re: sentance containg the string or symbol Ω

2007-08-23 Thread Bill Scherer
yadin wrote: > how can i print a sentance containg the string or symbol Ω in python > and also lambda? > > >>> "Ω" '\xce\xa9' >>> print '\xce\xa9' Ω >>> ...works on my terminal anyway. -- http://mail.python.org/mailman/listinfo/python-list

Re: sentance containg the string or symbol Ω

2007-08-23 Thread Peter Otten
Oops, forgot to switch the encoding to utf-8. >>> print u"Ω and also \N{GREEK CAPITAL LETTER LAMDA}" Ω and also Λ Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: advice about `correct' use of decorator

2007-08-23 Thread BJörn Lindqvist
On 8/22/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > On 22 ago, 10:00, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > > As I said, you can accomplish the exact same thing by calling a > > function from within the function that requires the user to be logged > > in. > > > > def change_pass():

Re: sentance containg the string or symbol Ω

2007-08-23 Thread Bart Ogryczak
On 23 ago, 13:20, yadin <[EMAIL PROTECTED]> wrote: > how can i print a sentance containg the string or symbol Ω in python > and also lambda? Well, you can use this dictionary to find out its unicode code point: from htmlentitydefs import name2codepoint unichr(name2codepoint['Omega']) u'\u03a9' uni

Re: beginner, idiomatic python

2007-08-23 Thread Scott David Daniels
bambam wrote: > Would someone like to suggest a replacement for this? It works ok, > but it doesn't look like any of the other code: > > tempList = ['1','2','3','4','5','6','7','8'] > sampleList=[] > for port in tempList: > pagefound = False > for i in range(self.parent.GetPageCount()): >

Re: Baby Steps, optionDB

2007-08-23 Thread Carsten Haese
On Thu, 2007-08-23 at 04:30 -0700, W. Watson wrote: > I used to program in C++, and there's one thing I've never liked about > OOP. Too much typing! Blame C++, not OOP. In time, you will find that Python's approach to OOP in particular and to programming in general allows you to express your idea

Problems Connecting to Crystal Reports table and changing field values

2007-08-23 Thread Michael Dorrian
Below is the my code so far. I have one table with 7 fields in my report and i want to clear these fields and then save the report as a different name and then print. The saving and printing part seem fine but i cannot seem to access the connection properties at all. I have the ConnectionPropertie

Re: Question: wxpython and 3d engine example with model load ?

2007-08-23 Thread kyosohma
On Aug 23, 4:11 am, OpenPavilion <[EMAIL PROTECTED]> wrote: > Hello, > > did anyone succeed in combining wxpython and a 3d engine (pyogre, > crystalblend, panda3d, soya etc.) ? > > I would like to create an application, which uses wxpython tree, menu > and grid elements and embedds a 3d view of som

Re: How would I go about making a file open. Not the way you might think.

2007-08-23 Thread kyosohma
On Aug 23, 2:09 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > Lamonte Harris wrote: > >Basically you can open a file by double clicking, and by default it would > >open > > w/ what every program you have it set >to. Most text files would open in > notepad. How can I make a txt open so t

Simple Python Spider

2007-08-23 Thread luca bertini
Hi everybody, i'm new to the forum so: hello everybody (should I say "world"?) ^_^ I'm trying to do a simple spider in python which: 1) ask google a query 2) parse the data I'm a python newbie so *any* help would be very, very welcommed. Thanks in advice! cheers! -- http://mail.python.org/mai

simple spider in python

2007-08-23 Thread gmcalendar
Hi everybody, i'm new to the forum so: hello everybody (should I say "world"?) ^_^ I'm trying to do a simple spider in python which: 1) ask google a query 2) parse the data I'm a python newbie so *any* help would be very, very welcommed. Thanks in advice! cheers! -- http://mail.python.org/mail

Re: MsiLib

2007-08-23 Thread Charlie
Thank you everybody for your help. It finally runs without errors and I should be able to use this as I figure out more of it. I am curios if there is any idea as to when GetString will be implemented? Charlie -- http://mail.python.org/mailman/listinfo/python-list

Re: Joining elements in a list to 1 element

2007-08-23 Thread Francesco Guerrieri
On 8/23/07, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > > What do you want to have happen in this case? > > my_list = [ 'a', 4, 'c' ] > It depends on the requirements of the OP. A possible solution could be: my_second_list = [] try: my_second_list.append("".join(my_list)) except TypeError:

Re: Socket recv(1) seems to block instead of returning end of file.

2007-08-23 Thread Grant Edwards
On 2007-08-23, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > While doing a netstring implementation I noticed that if you > build a record up using socket's recv(1), then when you close > the remote end down, the recv(1) hangs, I don't see that behavior running 2.4 on Gentoo. > despite having

Re: Question: wxpython and 3d engine example with model load ?

2007-08-23 Thread Mike C. Fletcher
OpenPavilion wrote: ... > I would like to create an application, which uses wxpython tree, menu > and grid elements and embedds a 3d view of some of the listed objects > in an own detail window, so showing the object as a 3d model. > I know there is PyOpenGL as well, but I need to load complete mod

Re: simple spider in python

2007-08-23 Thread Frederick Polgardy
On Aug 23, 8:33 am, [EMAIL PROTECTED] wrote: > Hi everybody, i'm new to the forum so: hello everybody (should I say > "world"?) ^_^ > I'm trying to do a simple spider in python which: > > 1) ask google a query > 2) parse the data > > I'm a python newbie so *any* help would be very, very welcommed.

Python submodules and name imports

2007-08-23 Thread Frank Aune
Hi, First take a look at: http://www.network-theory.co.uk/docs/pytut/Packages.html as I will use this module file layout as an example. If I want to do the following: from Sound import Effects ... Effects.echo.echofilte(bla bla) What will Sound/Effects/__init__.py need to contain then? I trie

Re: Symbolic Link

2007-08-23 Thread mosscliffe
On 22 Aug, 00:05, Ian Clark <[EMAIL PROTECTED]> wrote: > Hyuga wrote: > > On Aug 19, 4:29 pm,mosscliffe<[EMAIL PROTECTED]> wrote: > >> The source file is in an area which python can see, but not the > >> browser. I am trying to make a link in a browser friendly area so I > >> can use it to display

Re: simple spider in python

2007-08-23 Thread samushack
> I'm trying to do a simple spider in python which: > > 1) ask google a query > 2) parse the data While you could use urllib2.urlopen() as Frederick mentioned, there is actually a Python module built JUST for getting info from Google queries! So check out PyGoogle: http://pygoogle.sourceforge.net/

Re: Baby Steps, optionDB

2007-08-23 Thread W. Watson
VBasic is the same. Longish. The ultimate in conciseness was APL. Carsten Haese wrote: > On Thu, 2007-08-23 at 04:30 -0700, W. Watson wrote: >> I used to program in C++, and there's one thing I've never liked about >> OOP. Too much typing! > > Blame C++, not OOP. In time, you will find that Pyth

Re: Baby Steps, optionDB

2007-08-23 Thread Carsten Haese
On Thu, 2007-08-23 at 14:38 +, W. Watson wrote: > The ultimate in conciseness was APL. I think you are mistaking terseness for conciseness. -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

Re: simple spider in python

2007-08-23 Thread gmcalendar
thanks everybody, s kind. I'll take a look at booth. have a nice day/night (depending on your latitude!) ^_^ ciao! -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I get the current path of my python file that is currently running.

2007-08-23 Thread rasmus
On Aug 23, 3:33 am, Arnau Sanchez <[EMAIL PROTECTED]> wrote: > Lamonte Harris escribió: > > > Say I start i click on a python file on my desktop, how could I return > > the path of the current python file thats running? > > http://docs.python.org/lib/module-sys.html Try this: import sys import os

expat error, help to debug?

2007-08-23 Thread Andreas Lobinger
Aloha, i'm trying to write an xml filter, that extracts some info about an .xml document (with external entities), esp. start elements and external entities. The document is a DOCBOOK xml and afacs well formed and passes our docbook toolchain (dblatex etc.). My parser is (very simple): [115] scyl

Re: [ANN] Python courses this Fall

2007-08-23 Thread wesley chun
$1295/pp for the intro course and $495/ for the 1-day course (but $395 if you take the intro course too). http://cyberwebconsulting.com (click "Python Training") for more details -wesley On 8/23/07, Jeff Pang <[EMAIL PROTECTED]> wrote: > Sounds good.How about the costs for those lessons?thanks.

Re: simple spider in python

2007-08-23 Thread gmcalendar
Well, it turned out that google since Dec 2006 is not giving out SOAP api keys anymore. What a shame! any tip? ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: simple spider in python

2007-08-23 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >thanks everybody, s kind. I'll take a look at booth. >have a nice day/night (depending on your latitude!) ^_^ > >ciao! > Somewhere in the middle between the two suggestions you've already received is http://www.unixreview.com/documen

comparing two lists

2007-08-23 Thread Ladislav Andel
Hi, what would be the most efficient way to do following? I have a list of dictionaries taken from DB e.g. dblist = [{'id:1, 'host':'google.com','ip_address':'1.2.3.4'}, {'id:3, 'host':'yahoo.com','ip_address':'5.6.7.8'}, {'id:9, 'host':'msn.com','ip_address':'11.3.2.3'}] and list of object in

Re: optparse - required options

2007-08-23 Thread Omari Norman
On Mon, Aug 20, 2007 at 05:31:00PM -0400, Jay Loden wrote: > Robert Dailey wrote: > > Well, I don't know what is wrong with people then. I don't see how > > required arguments are of bad design. Some command-line applications are > > built around performing tasks based on information received. Comp

Re: Python submodules and name imports

2007-08-23 Thread Pádraig
On Aug 23, 2:58 pm, Frank Aune <[EMAIL PROTECTED]> wrote: > Hi, > > First take a look at: > > http://www.network-theory.co.uk/docs/pytut/Packages.html > > as I will use this module file layout as an example. > > If I want to do the following: > > from Sound import Effects > ... > Effects.echo.echof

Re: Socket recv(1) seems to block instead of returning end of file.

2007-08-23 Thread Dan Stromberg - Datallegro
On Thu, 23 Aug 2007 11:54:01 +0200, Hendrik van Rooyen wrote: > > While doing a netstring implementation I noticed that if you > build a record up using socket's recv(1), then when you close > the remote end down, the recv(1) hangs, despite having a short > time out of 0.1 set. > > If however,

Re: C# and Python

2007-08-23 Thread subeen
On Aug 21, 5:00 pm, Bikal KC <[EMAIL PROTECTED]> wrote: > subeenwrote: > > When the user clicks Quick Sort button, the quicksort.py will be > > called and it will sort the numbers. > > One way to do this: > In your C# app, have the mouse click event handler call python > interpreter "/path/to/pytho

Re: comparing two lists

2007-08-23 Thread kyosohma
On Aug 23, 11:27 am, Ladislav Andel <[EMAIL PROTECTED]> wrote: > Hi, > what would be the most efficient way to do following? > > I have a list of dictionaries taken from DB e.g. > dblist = [{'id:1, 'host':'google.com','ip_address':'1.2.3.4'}, > {'id:3, 'host':'yahoo.com','ip_address':'5.6.7.8'}, >

Re: comparing two lists

2007-08-23 Thread Ladislav Andel
[EMAIL PROTECTED] wrote: > On Aug 23, 11:27 am, Ladislav Andel <[EMAIL PROTECTED]> wrote: > >> Hi, >> what would be the most efficient way to do following? >> >> I have a list of dictionaries taken from DB e.g. >> dblist = [{'id:1, 'host':'google.com','ip_address':'1.2.3.4'}, >> {'id:3, 'host':

My 'time' module is broken, unsure of cause

2007-08-23 Thread darren kirby
Hi all, I have a strange error here and I am unsure how to further investigate it: Python 2.4.4 (#1, Aug 23 2007, 10:51:29) [GCC 4.1.2 (Gentoo 4.1.2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import time 40:42:0 >>> now = time.time() Traceback (most rec

creating a tar file with python

2007-08-23 Thread Brian McCann
Hi, I'm trying to create a tar file of the contents of the current directory right now there is only one file "text.xml" in the current dir, I'm using"." current dir as source but that gives syntax error any help would be greatly appreciated --Brian #!/usr/bin/python import string import

Re: My 'time' module is broken, unsure of cause

2007-08-23 Thread Jean-Paul Calderone
On Thu, 23 Aug 2007 11:22:55 -0600, darren kirby <[EMAIL PROTECTED]> wrote: >Hi all, > >I have a strange error here and I am unsure how to further investigate it: > >Python 2.4.4 (#1, Aug 23 2007, 10:51:29) >[GCC 4.1.2 (Gentoo 4.1.2)] on linux2 >Type "help", "copyright", "credits" or "license" for

Re: My 'time' module is broken, unsure of cause

2007-08-23 Thread Will Maier
On Thu, Aug 23, 2007 at 11:22:55AM -0600, darren kirby wrote: > Python 2.4.4 (#1, Aug 23 2007, 10:51:29) > [GCC 4.1.2 (Gentoo 4.1.2)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import time > 40:42:0 > >>> now = time.time() > Traceback (most recent call

Co-developers wanted: document markup language

2007-08-23 Thread Torsten Bronger
Hallöchen! Some LaTeX users in Aachen thought about a general-use markup language this spring. I wrote some code and a rough project description, however, we could need some help. If you are interested, visit the provisional project page at http://latex-bronger.sourceforge.net/gummi/ Tschö, Tor

Re: My 'time' module is broken, unsure of cause

2007-08-23 Thread darren kirby
quoth the Calderone: > > [EMAIL PROTECTED]:~$ echo "print '40:42:0'" > time.py > [EMAIL PROTECTED]:~$ python > Python 2.4.3 (#2, Oct 6 2006, 07:52:30) > [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >

Re: My 'time' module is broken, unsure of cause

2007-08-23 Thread Gary Herron
darren kirby wrote: > Hi all, > > I have a strange error here and I am unsure how to further investigate it: > > Python 2.4.4 (#1, Aug 23 2007, 10:51:29) > [GCC 4.1.2 (Gentoo 4.1.2)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > import time

Re: simple spider in python

2007-08-23 Thread samushack
> Somewhere in the middle between the two suggestions you've already > received is http://www.unixreview.com/documents/s=10133/ur0706e/>. I followed that link, and got an error page... As to the Google API key issue, I was unaware of that. Very annoying of them to stop that service. PyGoogle will

Re: Simple Python Spider

2007-08-23 Thread Thomas Wittek
luca bertini schrieb: > 1) ask google a query http://code.google.com/apis/ http://code.google.com/apis/ajaxsearch/ But you probably have to reverse engineer the JavaScript lib. > 2) parse the data http://blog.hill-street.net/?p=7 -- Thomas Wittek Web: http://gedankenkonstrukt.de/ Jabber: [EMAI

Re: comparing two lists

2007-08-23 Thread Erik Jones
On Aug 23, 2007, at 11:27 AM, Ladislav Andel wrote: > Hi, > what would be the most efficient way to do following? > > I have a list of dictionaries taken from DB e.g. > dblist = [{'id:1, 'host':'google.com','ip_address':'1.2.3.4'}, > {'id:3, 'host':'yahoo.com','ip_address':'5.6.7.8'}, > {'id:9, '

Re: comparing two lists

2007-08-23 Thread Peter Otten
Ladislav Andel wrote: > what would be the most efficient way to do following? > > I have a list of dictionaries taken from DB e.g. > dblist = [{'id:1, 'host':'google.com','ip_address':'1.2.3.4'}, > {'id:3, 'host':'yahoo.com','ip_address':'5.6.7.8'}, > {'id:9, 'host':'msn.com','ip_address':'11.3.

Question about embedding python in C++

2007-08-23 Thread TheShadow
When extending python in c/c++ after you register a module is there a way in c/c++ to check if they were correctly registered? Cause I'm having the problem where when I execute the the python script it finds the module but none of the functions. -- http://mail.python.org/mailman/listinfo/python-

Re: Socket recv(1) seems to block instead of returning end of file.

2007-08-23 Thread Grant Edwards
On 2007-08-23, Dan Stromberg - Datallegro <[EMAIL PROTECTED]> wrote: > Are you using sock.settimeout()? Hey, somebody snuck timeouts into the socket module when I wasn't looking... > I agree with Grant though - posting a minimal snippet of code that > replicates the problem would help us help yo

Re: Socket recv(1) seems to block instead of returning end of file.

2007-08-23 Thread Grant Edwards
On 2007-08-23, Dan Stromberg - Datallegro <[EMAIL PROTECTED]> wrote: > On Thu, 23 Aug 2007 11:54:01 +0200, Hendrik van Rooyen wrote: > >> >> While doing a netstring implementation I noticed that if you >> build a record up using socket's recv(1), then when you close >> the remote end down, the rec

Re: Question about embedding python in C++

2007-08-23 Thread Farshid Lashkari
TheShadow wrote: > When extending python in c/c++ after you register a module is there a > way in c/c++ to check if they were correctly registered? > > Cause I'm having the problem where when I execute the the python > script it finds the module but none of the functions. > Are you calling Py_In

Re: ctypes and unsigned char*

2007-08-23 Thread [EMAIL PROTECTED]
On 23 Aug., 05:46, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > If the result can contain nul bytes, you have to specify its size > explicitely (else it will be truncated at the first zero). Use the > string_at utility function: > > result_str = string_at(result, length) > > (That should work f

Re: comparing two lists

2007-08-23 Thread Ladislav Andel
Peter Otten wrote: > Ladislav Andel wrote: > > >> what would be the most efficient way to do following? >> >> I have a list of dictionaries taken from DB e.g. >> dblist = [{'id:1, 'host':'google.com','ip_address':'1.2.3.4'}, >> {'id:3, 'host':'yahoo.com','ip_address':'5.6.7.8'}, >> {'id:9, 'hos

Issue tracker migration is complete

2007-08-23 Thread Brett Cannon
Thanks to the work of Erik Forsberg and Martin von Löwis, Python's issue tracker now lives at http://bugs.python.org . Because this is a new tracker on a new system you cannot use your SourceForge password on the new tracker. But account names have been migrated, so if you go to "Lost your login?

Re: Question about embedding python in C++

2007-08-23 Thread TheShadow
On Aug 23, 11:57 am, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > TheShadow wrote: > > When extending python in c/c++ after you register a module is there a > > way in c/c++ to check if they were correctly registered? > > > Cause I'm having the problem where when I execute the the python > > scrip

how to select between two file libraries with same name?

2007-08-23 Thread Jose Borreguero
Imagine my file one.py contains the statement import two If there's a two.py in same directory as one.py, then this file will be loaded. However, I want to load a different file named also two.py, say file ~username/mypythonlib/two.py How can I select between the two two.py files ? -jose -- http:

how to select between two file libraries with same name?

2007-08-23 Thread jmborr
Imagine my file one.py contains the statement import two If there's a two.py in same directory as one.py, then this file will be loaded. However, I want to load a different file named also two.py, say file ~username/mypythonlib/two.py How can I select between the two two.py files ? -jose -- http:

python setup.py: how to override a setup.cfg value ?

2007-08-23 Thread Chris Shenton
I'm building python-ldap and need to change values of library and include paths that are in the setup.cfg file. This is an automated build (using "buildit") so I'd prefer not to have edit the .cfg by hand, with sed, or even with buildit's Substitute(). I'd like to be able to do something like I'd

Re: Impersonate another user temporarily (Unix and Windows)

2007-08-23 Thread billiejoex
On 23 Ago, 13:13, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 8/23/07, billiejoex <[EMAIL PROTECTED]> wrote: > > > > > > > On 23 Ago, 10:38, Tim Golden <[EMAIL PROTECTED]> wrote: > > > billiejoex wrote: > > > > Hi there. I'm writing a modification for a FTP server library I'm > > > > maintaining

Re: Question about embedding python in C++

2007-08-23 Thread TheShadow
On Aug 23, 11:57 am, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > TheShadow wrote: > > When extending python in c/c++ after you register a module is there a > > way in c/c++ to check if they were correctly registered? > > > Cause I'm having the problem where when I execute the the python > > scrip

Re: how to select between two file libraries with same name?

2007-08-23 Thread kyosohma
On Aug 23, 1:46 pm, jmborr <[EMAIL PROTECTED]> wrote: > Imagine my file one.py contains the statement > import two > If there's a two.py in same directory as one.py, then this file will > be loaded. However, I want to load a different file named also two.py, > say file ~username/mypythonlib/two.py

Re: advice about `correct' use of decorator

2007-08-23 Thread Gerardo Herzig
BJörn Lindqvist wrote: >On 8/22/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > >>On 22 ago, 10:00, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: >> >> >>>As I said, you can accomplish the exact same thing by calling a >>>function from within the function that requires the user to be log

Using Regular Expresions to change .htm to .php in files

2007-08-23 Thread sebzzz
Hi, I have a bunch of files that have changed from standard htm files to php files but all the links inside the site are now broken because they point to the .htm files while they are now .php files. Does anyone have an idea about how to do a simple script that changes each .htm in a given file t

Re: Question about embedding python in C++

2007-08-23 Thread TheShadow
On Aug 23, 1:17 pm, TheShadow <[EMAIL PROTECTED]> wrote: > On Aug 23, 11:57 am, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > > > TheShadow wrote: > > > When extending python in c/c++ after you register a module is there a > > > way in c/c++ to check if they were correctly registered? > > > > Cause

Re: beginner, idiomatic python

2007-08-23 Thread Zentrader
Does page count change? i.e. is it necessary to retrieve it in every loop or tempList = ['1','2','3','4','5','6','7','8'] sampleList=[] page_count = self.parent.GetPageCount() for i in range(page_count): Also, once pagefound is set to True, all pages following will not be appended to sampleL

Newbie: List file system roots

2007-08-23 Thread Einar W. Høst
Hi, How would you list the file system roots in Python? That is, I'm looking for a way to list all connected drives (C:, D: etc) on a Windows box, or all /root, /tmp etc on a *nix box. In Java, there's a built-in API function to do this, File.listRoots(), but I couldn't find any equivalents in the

Re: libgmail failure

2007-08-23 Thread [EMAIL PROTECTED]
Thanks! That worked brilliantly. -James -- http://mail.python.org/mailman/listinfo/python-list

Re: MsiLib

2007-08-23 Thread Martin v. Löwis
Charlie schrieb: > Thank you everybody for your help. It finally runs without errors and I > should be able to use this as I figure out more of it. I am curios if > there is any idea as to when GetString will be implemented? If I can find the time, it may be for Python 2.6. If not, Python 2.7, 3.1

Re: Using Regular Expresions to change .htm to .php in files

2007-08-23 Thread Tim Williams
On 23/08/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I have a bunch of files that have changed from standard htm files to > php files but all the links inside the site are now broken because > they point to the .htm files while they are now .php files. > > Does anyone have an idea ab

Putting #'s and variables together in 1 variable

2007-08-23 Thread Lamonte Harris
File "Desktop\python\newsystem\init.py", line 51, in random_n random_name = a+b+c+d+e+ 'temp.txt' TypeError: unsupported operand type(s) for +: 'int' and 'str' import random def random_name(): a = random.randint(0,9) b = random.randint(0,9) c = random.randint(0,9) d = random.

Re: Newbie: List file system roots

2007-08-23 Thread kyosohma
On Aug 23, 2:48 pm, "Einar W. Høst" <[EMAIL PROTECTED]> wrote: > Hi, > > How would you list the file system roots in Python? That is, I'm looking > for a way to list all connected drives (C:, D: etc) on a Windows box, or > all /root, /tmp etc on a *nix box. In Java, there's a built-in API > functio

Re: Using Regular Expresions to change .htm to .php in files

2007-08-23 Thread Tim Williams
On 23/08/07, Tim Williams <[EMAIL PROTECTED]> wrote: > On 23/08/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have a bunch of files that have changed from standard htm files to > > php files but all the links inside the site are now broken because > > they point to the .htm fil

Re: Putting #'s and variables together in 1 variable

2007-08-23 Thread Jay Loden
Lamonte Harris wrote: > File "Desktop\python\newsystem\init.py", line 51, in random_n > random_name = a+b+c+d+e+ 'temp.txt' > TypeError: unsupported operand type(s) for +: 'int' and 'str' > > import random > def random_name(): > a = random.randint(0,9) > b = random.randint(0,9) >

Re: Putting #'s and variables together in 1 variable

2007-08-23 Thread Grant Edwards
On 2007-08-23, Jay Loden <[EMAIL PROTECTED]> wrote: > 2) Since all you're doing is adding a bunch of numeric values to each other >to build the string, why wouldn't you just create a random number between >0 -> 9 and use that? Since the OP calls randint 5 times, his answer is 5 times

Re: Syslog

2007-08-23 Thread Michael Bentley
On Aug 20, 2007, at 4:56 PM, greg wrote: > Hi All, > > Could anyone tell me how I could syslog to a specific log (e.g. /var/ > log/daemon.log, /var/log/syslog.log...)? > # something like this: import logging logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(lev

Re: MsiLib

2007-08-23 Thread Charlie
Quoting "Martin v. Löwis" <[EMAIL PROTECTED]>: > Charlie schrieb: >> Thank you everybody for your help. It finally runs without errors and I >> should be able to use this as I figure out more of it. I am curios if >> there is any idea as to when GetString will be implemented? > > If I can find the

  1   2   >