Re: New to python, can i ask for a little help?

2009-05-12 Thread guang . zeng37
On May 13, 12:18 pm, "warhammer1...@gmail.com" wrote: > I loaded python 3.1 > I can use the gui and i see the following: > > Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit > (Intel)] on win32 > Type "copyright", "credits" or "license()" for more information. > > > > It would s

Re: Representing a Tree in Python

2009-05-12 Thread godshorse
On May 13, 11:54 am, CTO wrote: > On May 13, 12:10 am, godshorse wrote: > > > Hello, > > > I want to find out the shortest path tree from a root to several nodes > > in a graph data structure. I found a Dijkstra code from internet that > > finds shortest path between only two nodes. How can i ext

Updates to enviironment variables and ctypes

2009-05-12 Thread Scott Flynn
I was hoping I could update LD_LIBRARY_PATH at runtime and load a library through ctypes from there, but I haven't been able to. I've tried all of these. os.environ['LD_LIBRARY_PATH'] = "./lib" os.putenv('LD_LIBRARY_PATH', "./lib") os.system("export LD_LIBRARY_PATH=./lib") lib = CDLL("libevaluato

Re: py2exe + win32com + DAO

2009-05-12 Thread David Lyon
On Tue, 12 May 2009 22:06:42 -0700 (PDT), Trevor wrote: > I do not believe your assertion applies to the following line of code: > > daoEngine = win32com.client.Dispatch(r'DAO.DBEngine.36') It doesn't. I'm simply suggesting that it is possible you are opening the database in Access or something

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread Jeroen Ruigrok van der Werven
-On [20090513 05:53], walterbyrd (walterb...@iname.com) wrote: >As you probably know, cygwin formats to UNIX. That entirely depends on how you install it. Anyway, I am sure the Cygwin repository has the tools dos2unix/unix2dos available for installation. -- Jeroen Ruigrok van der Werven / asmo

Re: py2exe + win32com + DAO

2009-05-12 Thread Trevor
I do not believe your assertion applies to the following line of code: daoEngine = win32com.client.Dispatch(r'DAO.DBEngine.36') The preceding code snippet instantiates a COM object and is prerequisite to creating a reference to a specific database: daoDB = daoEngine.OpenDatabase(dbname) As the

Re: Representing a Tree in Python

2009-05-12 Thread CTO
On May 13, 12:10 am, godshorse wrote: > Hello, > > I want to find out the shortest path tree from a root to several nodes > in a graph data structure. I found a Dijkstra code from internet that > finds shortest path between only two nodes. How can i extend it to a > tree?. And what is the best way

Re: New to python, can i ask for a little help?

2009-05-12 Thread Mensanator
On May 12, 11:18�pm, "warhammer1...@gmail.com" wrote: > I loaded python 3.1 > I can use the gui and i see the following: > > Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit > (Intel)] on win32 > Type "copyright", "credits" or "license()" for more information. > > > > It would s

Re: New to python, can i ask for a little help?

2009-05-12 Thread Chris Rebert
On Tue, May 12, 2009 at 9:18 PM, warhammer1...@gmail.com wrote: > I loaded python 3.1 > I can use the gui and i see the following: > > Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit > (Intel)] on win32 > Type "copyright", "credits" or "license()" for more information. > >

Re: New to python, can i ask for a little help?

2009-05-12 Thread Sam Tregar
On Wed, May 13, 2009 at 12:18 AM, warhammer1...@gmail.com < warhammer1...@gmail.com> wrote: > Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit > (Intel)] on win32 > Type "copyright", "credits" or "license()" for more information. > >>> print "hello world!" > SyntaxError: invalid

Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-12 Thread David Lyon
On Wed, 13 May 2009 05:32:16 +0200, "Martin v. Löwis" wrote: > I think this was a case of obscure misconfiguration of the system. > It is always possible to configure a system in such a way that even > the most resilient installation procedure will break. Technically, you are right.. but imho.

Re: What's the use of the else in try/except/else?

2009-05-12 Thread greg
kj wrote: Wow. As rationales for syntax constructs go, this has got to be the most subtle one I've ever seen... It's to avoid masking bugs. Suppose you accidentally wrote try: v = mumble.field sys.warming('field was actually there?') except AttributeError: pass Then you coul

New to python, can i ask for a little help?

2009-05-12 Thread warhammer1...@gmail.com
I loaded python 3.1 I can use the gui and i see the following: Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> It would seem that this is working correctly and there is no path problem. I am

Re: Help with a HTTP GET request

2009-05-12 Thread Carbon-based
Great, thank you very much. On May 13, 1:38 pm, Tim Harig wrote: > On 2009-05-13, Tim Harig wrote: > > > host = "http://localhost"; > > request = r"""/common/foxisapi.dll/tmsmail.x2.isapi? > schema='' class='replicateApplication.getChanges' /""" > > url = host + urllib.quote(request) > > content

Representing a Tree in Python

2009-05-12 Thread godshorse
Hello, I want to find out the shortest path tree from a root to several nodes in a graph data structure. I found a Dijkstra code from internet that finds shortest path between only two nodes. How can i extend it to a tree?. And what is the best way to represent a tree in Python?. Thank you, -- h

Re: piping input to an external script

2009-05-12 Thread Tim Arnold
"Dave Angel" wrote in message news:mailman.25.1242113076.8015.python-l...@python.org... > Tim Arnold wrote: >> Hi, I have some html files that I want to validate by using an external >> script 'validate'. The html files need a doctype header attached before >> validation. The files are in utf8

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread walterbyrd
Thanks for shell script code. That code may be just as efficient, or even more efficient, than python. But, to me, python is far more readable. i=$1 i1=${i%%.*} echo $i1 cat $1 | sed s/^M// >$i1._cr ---= import os for file in os.listdir('.'): infile = o

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread walterbyrd
On May 12, 6:15 pm, norseman wrote: > Subject line says UNIX to DOS > > I hope that means you are using a UNIX machine. > I should have mentioned, I am working in an environment that is very restrictive about what I can put on my XP desktop. I can not put python, or even notepad++, on my desktop

Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-12 Thread Martin v. Löwis
> lol - so simple... > > Thankfully, we got a quick answer by the package writing master himself.. > > but imho - package installation shouldn't be that tricky.. it should be > click and shoot... which is what i'm working on doing.. > > I have to say that I don't mind being corrected because I

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread walterbyrd
On May 12, 6:12 pm, Terry Reedy wrote: > Are you sure you need to do that?  Most Windows programs (including > Python) are happy reading text files with just \n for line endings. These files will be looked at by some non-technical people. I am sure these people will just click on the icons, and

Re: Help with a HTTP GET request

2009-05-12 Thread Tim Harig
On 2009-05-13, Tim Harig wrote: > host = "http://localhost"; > request = r"""/common/foxisapi.dll/tmsmail.x2.isapi? schema='' class='replicateApplication.getChanges' /""" > url = host + urllib.quote(request) > content = urllib.urlopen(url).read() Which accidentally encodes the '?' separator. Thi

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread Simon Forman
On May 12, 4:39 pm, walterbyrd wrote: > I have about 150 unix formated text files that I would like to convert > to dos formated. > > I am guessing that I loop though each file in the directory, read each > line and conver the last character, then save to a file with the same > name in another dir

Re: Help with a HTTP GET request

2009-05-12 Thread Tim Harig
On 2009-05-13, Tim Harig wrote: > import urllib > url = > "http://localhost/common/foxisapi.dll/tmsmail.x2.isapi? content = urllib.urlopen(url).read() forgot to urlencode: host = "http://localhost"; request = r"""/common/foxisapi.dll/tmsmail.x2.isapi?http://mail.python.org/mailman/listinfo/pyth

Re: Help with a HTTP GET request

2009-05-12 Thread Tim Harig
On 2009-05-13, Paul Hemans wrote: > http://localhost/common/foxisapi.dll/tmsmail.x2.isapi? Note the entire URL. > So I am trying httplib I have encoded the GET request with urllib.quote urllib would be much easier if you don't need low level control -- it will automatically call httplib for you.

Re: sqlite single transaction without foreign key or triggers

2009-05-12 Thread John Machin
On May 13, 11:46 am, a...@pythoncraft.com (Aahz) wrote: > In article , > Rob Williscroft   wrote: > > > > >Aahz wrote innews:guao50$1j...@panix3.panix.comin comp.lang.python: > >> In article , > >> Rob Williscroft   wrote: > > >>>db.execute( ''' > >>>         update "sessions" set "uid" = ? > >>>  

Re: Help with a HTTP GET request

2009-05-12 Thread Stephen Hansen
> I am trying to build a HTTP request that looks like: > http://localhost/common/foxisapi.dll/tmsmail.x2.isapi > ? > Works in a browser. > > and now I am attempting to use HTTPConnection > >>> conn = httplib.HTTPConnection("localhost") > >>> print x > %3CPROCESS%20sync%3D%27%27%20schema%3D%27%27%20

Re: Help with a HTTP GET request

2009-05-12 Thread Chris Rebert
On Tue, May 12, 2009 at 7:20 PM, Paul Hemans wrote: > I am trying to build a HTTP request that looks like: > http://localhost/common/foxisapi.dll/tmsmail.x2.isapi? > Works in a browser. I'm not 100% sure, but I don't think you can have < or > in a URL. Your browser might be implicitly encoding th

Help with a HTTP GET request

2009-05-12 Thread Paul Hemans
I am trying to build a HTTP request that looks like: http://localhost/common/foxisapi.dll/tmsmail.x2.isapi? Works in a browser. lxml.parse() gives me: failed to load external entity urllib2.urlopen() gives me: Bad request So I am trying httplib I have encoded the GET request with urllib.quote ()

Re: sqlite single transaction without foreign key or triggers

2009-05-12 Thread Aahz
In article , Rob Williscroft wrote: >Aahz wrote in news:guao50$1j...@panix3.panix.com in comp.lang.python: >> In article , >> Rob Williscroft wrote: >>> >>>db.execute( ''' >>> update "sessions" set "uid" = ? >>> where "uid" = ? >>> and exists( >>> selec

Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-12 Thread David Robinow
> Thanks for the help.  I just got it to install for Python 2.6.  All I did > was change PYTHONPATH (as suggested by Mark) from > C:\Python25\Lib\site-packages to C:\Python26\Lib\site-packages Why do you have PYTHONPATH set at all? -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe + win32com + DAO

2009-05-12 Thread David Lyon
Maybe VB is opening the table in Exclusive mode... then when you are opening it as a subprocess, it's already locked. It's possible the win32com module is not giving you a very descriptive error message. Try running your process while vb is running at the same time with the database open and if

py2exe + win32com + DAO

2009-05-12 Thread Trevor
I have a Python code module that adds records to a MS Access database. The following line of code executes successfully when the code module is run as a Python script: daoEngine = win32com.client.Dispatch(r'DAO.DBEngine.36') It also runs successfully when the Python script is compiled and run as

Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-12 Thread David Lyon
On Tue, 12 May 2009 23:57:48 GMT, David Lees > Mark and David, > > Thanks for the help. I just got it to install for Python 2.6. All I > did was change PYTHONPATH (as suggested by Mark) from > C:\Python25\Lib\site-packages to C:\Python26\Lib\site-packages lol - so simple... Thankfully, we g

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread norseman
walterbyrd wrote: I have about 150 unix formated text files that I would like to convert to dos formated. I am guessing that I loop though each file in the directory, read each line and conver the last character, then save to a file with the same name in another directory. I am not really sure

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread Terry Reedy
walterbyrd wrote: I have about 150 unix formated text files that I would like to convert to dos formated. Are you sure you need to do that? Most Windows programs (including Python) are happy reading text files with just \n for line endings. -- http://mail.python.org/mailman/listinfo/python-

Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-12 Thread David Lees
Mark Hammond wrote: Probably some import statement is finding a .pyd module built against Python 2.5 instead of Python 2.6; it might be that PYTHONPATH points somewhere wrong, or the registry for Python 2.6 is setup wrong, or something else entirely... Cheers, Mark On 12/05/2009 3:13 PM, Da

Re: Nimrod programming language

2009-05-12 Thread Mensanator
On May 12, 12:54 pm, George Sakkis wrote: > On May 12, 12:49 pm, Mensanator wrote: > > > > > > > On May 12, 8:27 am, rump...@web.de wrote: > > > > > > > The language and library are missing arbitrary precision integer > > > > > > arithmetic, using GMP or something like that. > > > > > > True, but

Re: creating classes with mix-ins

2009-05-12 Thread Carl Banks
On May 12, 4:45 am, samwyse wrote: > Unfortunately, 'boilerplate()' uses the handlers that I provide when > MetaBlog is instantiated. In that case, the handler functions should be attributes of the instance, not of the class. Do something like this: class MetaBlog(object): def __init__(self

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread MRAB
walterbyrd wrote: On May 12, 2:53 pm, MRAB wrote: walterbyrd wrote: I have about 150 unix formated text files that I would like to convert to dos formated. I am guessing that I loop though each file in the directory, read each line and conver the last character, then save to a file with the sa

Váš příspěvek do konference Python če ká na schválení moderátorem

2009-05-12 Thread python-bounces
Vaše zpráva pro konferenci 'Python' ve věci RE: SALE 79% 0FF on Pfizer! Nebyla rozeslána. Pro její distribuci je nutný souhlas moderátora. Důvod pozdržení distribuce zprávy je: Příspěvek od nečlena do konference s přispíváním omezeným pouze na členy. Vaše zpráva buď bude rozeslána nebo

Re: How to abort module evaluation?

2009-05-12 Thread Dave Angel
mrstevegross wrote: I have a python script that is pretty simple: when executed, it imports a bunch of stuff and then runs some logic. When *imported*, it defines some variables and exits. Here's what it looks like: === foo.py === if __name__ != '__main__': x = 1 exit_somehow import bar do_

Re: Fill Javascript form

2009-05-12 Thread Дамјан Георгиевски
> On 11 Mag, 23:06, Shawn Milochik wrote: >> How is the form "written in JavaScript"? Is it dynamically generated? >> >> In any case, can you just send a POST request if you know the values >> required? > > The problem is indeed that the form is dynamically generated. > That's the .js file: T

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread walterbyrd
On May 12, 2:53 pm, MRAB wrote: > walterbyrd wrote: > > I have about 150 unix formated text files that I would like to convert > > to dos formated. > > > I am guessing that I loop though each file in the directory, read each > > line and conver the last character, then save to a file with the same

Re: What's the use of the else in try/except/else?

2009-05-12 Thread Carl Banks
On May 12, 2:35 am, Steven D'Aprano wrote: > On Tue, 12 May 2009 09:20:36 +, Steven D'Aprano wrote: > > On Tue, 12 May 2009 20:23:25 +1200, Lawrence D'Oliveiro wrote: > > >> In message , kj wrote: > > >>> I know about the construct: > > >>> try: > >>>     # do something > >>> except ...: > >>>

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread MRAB
walterbyrd wrote: I have about 150 unix formated text files that I would like to convert to dos formated. I am guessing that I loop though each file in the directory, read each line and conver the last character, then save to a file with the same name in another directory. I am not really sure

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread Diez B. Roggisch
walterbyrd schrieb: I have about 150 unix formated text files that I would like to convert to dos formated. I am guessing that I loop though each file in the directory, read each line and conver the last character, then save to a file with the same name in another directory. I am not really sur

Convert UNIX formated text files to DOS formated?

2009-05-12 Thread walterbyrd
I have about 150 unix formated text files that I would like to convert to dos formated. I am guessing that I loop though each file in the directory, read each line and conver the last character, then save to a file with the same name in another directory. I am not really sure what I convert the l

Re: issue with twisted and reactor. Can't stop reactor

2009-05-12 Thread Jean-Paul Calderone
On Tue, 12 May 2009 14:30:04 -0500, Nick Craig-Wood wrote: Gabriel wrote: Jean-Paul Calderone escribió: > None of the reactors in Twisted are restartable. You can run and stop them > once. After you've stopped a reactor, you cannot run it again. This is > the > cause of your problem. > >

Looking for teacher in New York

2009-05-12 Thread dervonb
I live in brooklyn i'm looking for someone who can help a group of two or three learn how to use python. to create games useful softwares and very high level coding eventually. in other words how to abuse it's talents for our greater good. Please respond if you can meet in the brooklyn, manhattan,

Re: Fill Javascript form

2009-05-12 Thread Aahz
In article <3f9c74cf-72f4-45e2-8724-3939366d1...@e24g2000vbe.googlegroups.com>, Matteo wrote: > >I have to fill a web form to authenticate and connect to the internet. >I thought it would have been easy to make a script to do that >automatically on startup. > >Unfortunately, it turned out that th

Re: Call Web Service using proxy and http authentication

2009-05-12 Thread wdveloper
On May 12, 8:38 pm, Steve Howell wrote: > On May 12, 8:59 am, wdveloper wrote: > > > Hi everyone, > > > I am trying to call a webservice which requires an http > > authentication. > > To reach the ws, I must pass from a proxy http. So in the whole I need > > go through two authentications before

Re: How to abort module evaluation?

2009-05-12 Thread Mike Driscoll
On May 12, 1:33 pm, mrstevegross wrote: > I have a python script that is pretty simple: when executed, it > imports a bunch of stuff and then runs some logic. When *imported*, it > defines some variables and exits. Here's what it looks like: > > === foo.py === > if __name__ != '__main__': >   x =

Re: issue with twisted and reactor. Can't stop reactor

2009-05-12 Thread Nick Craig-Wood
Gabriel wrote: > Jean-Paul Calderone escribió: > > None of the reactors in Twisted are restartable. You can run and > stop them > > once. After you've stopped a reactor, you cannot run it again. This is > > the > > cause of your problem. > > > > Jean-Paul > > I see. > Is it possible to d

Language detector using N-grams

2009-05-12 Thread Cesar D. Rodas
Hello Pythoners! I just finished my first useful project in Python, It is a language detector using N-grams. I hope this can be useful for someone, http://github.com/crodas/py-languess/tree/master The License of the project is BSD Best regards -- Cesar D. Rodas http://cesar.la/ Phone: +595-96

Re: confused with subprocess.Popen

2009-05-12 Thread Roy Hyunjin Han
There's a great article by Doug Hellmann on subprocess. http://www.doughellmann.com/PyMOTW/subprocess/ On Sun, May 10, 2009 at 1:37 AM, Soumen banerjee wrote: > Thanks!, i have found that alternately setting shell=True also works > -- > http://mail.python.org/mailman/listinfo/python-list > -- ht

Re: Wrapping comments

2009-05-12 Thread Piet van Oostrum
> Lawrence D'Oliveiro (LD) wrote: >LD> In message , Nick Craig- >LD> Wood wrote: >>> Rhodri James wrote: >>> Emacs is my editor of choice ... >>> >>> You probably haven't used MAC OS X then! >LD> I tried using Emacs via SSH from a Mac once. Made me run screaming for the >LD> neares

Re: Nimrod programming language

2009-05-12 Thread namekuseijin
On May 8, 12:48 pm, Andreas Rumpf wrote: > Dear Python-users, > > I invented a new programming language called "Nimrod" that combines Python's > readability with C's performance. Please check it out:http://force7.de/nimrod/ > Any feedback is appreciated. heh, looks more like a streamlined Object

Re: Call Web Service using proxy and http authentication

2009-05-12 Thread Steve Howell
On May 12, 8:59 am, wdveloper wrote: > Hi everyone, > > I am trying to call a webservice which requires an http > authentication. > To reach the ws, I must pass from a proxy http. So in the whole I need > go through two authentications before getting the ws working. I am > using SOAPpy and I'm get

How to abort module evaluation?

2009-05-12 Thread mrstevegross
I have a python script that is pretty simple: when executed, it imports a bunch of stuff and then runs some logic. When *imported*, it defines some variables and exits. Here's what it looks like: === foo.py === if __name__ != '__main__': x = 1 exit_somehow import bar do_some_stuff... === EOF

Re: how to consume .NET webservice

2009-05-12 Thread Mike Driscoll
On May 12, 12:54 pm, namekuseijin wrote: > On May 12, 4:12 am, "Diez B. Roggisch" wrote: > > > > > namekuseijin schrieb: > >  > Diez B. Roggisch wrote: > >  >> namekuseijin schrieb: > >  >>> bav escreveu: > >   question from a python newbie; > >   > >     how can i consume in python l

Re: how to consume .NET webservice

2009-05-12 Thread namekuseijin
On May 12, 4:12 am, "Diez B. Roggisch" wrote: > namekuseijin schrieb: >  > Diez B. Roggisch wrote: >  >> namekuseijin schrieb: >  >>> bav escreveu: >   question from a python newbie; >   >     how can i consume in python language, a .NET web service, passing >     a string array as

Re: Nimrod programming language

2009-05-12 Thread George Sakkis
On May 12, 12:49 pm, Mensanator wrote: > On May 12, 8:27 am, rump...@web.de wrote: > > > > > > The language and library are missing arbitrary precision integer > > > > > arithmetic, using GMP or something like that. > > > > > True, but currently not a high priority for me. > > > > Too bad. That ma

Re: piping input to an external script

2009-05-12 Thread Steve Howell
See suggested debugging tip inline of your program On May 11, 11:04 am, "Tim Arnold" wrote: > Hi, I have some html files that I want to validate by using an external > script 'validate'. The html files need a doctype header attached before > validation. The files are in utf8 encoding. My code

Re:

2009-05-12 Thread norseman
dd name to listTemp for user in list already existing: add user to listTemp for user in list.Temp.index(): copy to ListSorted reset first/last as needed for user in ListSorted: store it someplace (like your data file) I suspect some of the add_.. function will need some mods, but maybe not If 'shay123' is line number, track it in 'copy to ListSorted' section. If the number is user id, assign it in source file. (name id 1 pair per line, adjust read,etc to accommodate) Today is: 20090512 no code this section Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: Nimrod programming language

2009-05-12 Thread Mensanator
On May 12, 8:27 am, rump...@web.de wrote: > > > > The language and library are missing arbitrary precision integer > > > > arithmetic, using GMP or something like that. > > > > True, but currently not a high priority for me. > > > Too bad. That makes Nimrod officially "worthless", i.e., of no > > v

Re: piping input to an external script

2009-05-12 Thread norseman
Steve Howell wrote: On May 11, 11:31 pm, norseman wrote: Steve Howell wrote: On May 11, 10:16 pm, norseman wrote: Tim Arnold wrote: Hi, I have some html files that I want to validate by using an external script 'validate'. The html files need a doctype header attached before validation. The

Re: putting date strings in order

2009-05-12 Thread John Machin
On May 13, 1:58 am, Jaime Fernandez del Rio wrote: > On Tue, May 12, 2009 at 5:02 PM, MRAB wrote: > > John Machin wrote: > > >> MRAB mrabarnett.plus.com> writes: > > >>> Sort the list, passing a function as the 'key' argument. The function > >>> should return an integer for the month, eg 0 for '

Re: putting date strings in order

2009-05-12 Thread MRAB
Jaime Fernandez del Rio wrote: On Tue, May 12, 2009 at 5:02 PM, MRAB wrote: John Machin wrote: MRAB mrabarnett.plus.com> writes: Sort the list, passing a function as the 'key' argument. The function should return an integer for the month, eg 0 for 'jan', 1 for 'feb'. If you want to have a di

Re: Python API Functions equivalent to ruby's rb_big2str() and rb_str2cstr()

2009-05-12 Thread John Machin
On May 12, 11:48 pm, Hrvoje Niksic wrote: > rahul writes: > > Hi Christian, > >   rb_big2str(Big-Integer, base) of ruby returns string *base* >representation > > of big-Integer. now, i am able to find equivalent python API function > > of rb_str2cstr() of ruby. > > That would be PyLong_FromStri

Call Web Service using proxy and http authentication

2009-05-12 Thread wdveloper
Hi everyone, I am trying to call a webservice which requires an http authentication. To reach the ws, I must pass from a proxy http. So in the whole I need go through two authentications before getting the ws working. I am using SOAPpy and I'm getting quite crazy. I am able to arrange this problem

Re: putting date strings in order

2009-05-12 Thread John Machin
On May 13, 1:02 am, MRAB wrote: > John Machin wrote: > > MRAB mrabarnett.plus.com> writes: > >> Sort the list, passing a function as the 'key' argument. The function > >> should return an integer for the month, eg 0 for 'jan', 1 for 'feb'. If > >> you want to have a different start month then add

Re: putting date strings in order

2009-05-12 Thread Jaime Fernandez del Rio
On Tue, May 12, 2009 at 5:02 PM, MRAB wrote: > John Machin wrote: >> >> MRAB mrabarnett.plus.com> writes: >>> >>> Sort the list, passing a function as the 'key' argument. The function >>> should return an integer for the month, eg 0 for 'jan', 1 for 'feb'. If >>> you want to have a different star

Re: What's the use of the else in try/except/else?

2009-05-12 Thread Peter Pearson
On 12 May 2009 09:35:36 GMT, Steven D'Aprano wrote: [snip] > To really be safe, that should become: > > try: > rsrc = get(resource) > except ResourceError: > log('no more resources available') > raise > else: > try: > do_something_with(rsrc) > finally: > rsrc.clo

Re: putting date strings in order

2009-05-12 Thread MRAB
John Machin wrote: MRAB mrabarnett.plus.com> writes: Sort the list, passing a function as the 'key' argument. The function should return an integer for the month, eg 0 for 'jan', 1 for 'feb'. If you want to have a different start month then add and if you don't like what that produces, try su

Re: AssertionError - help me to solve this in a programme with Queue

2009-05-12 Thread maxim
> hi > It did work that way > > File "queue.py", line 15 >     threading.Thread__init__.(self) >                              ^ > SyntaxError: invalid syntax You've wrote right first time "threading.Thread.__init__(slef)", but misprinted in your code "def _int_(self,q)" instead of "def __init__ (

Re: AssertionError - help me to solve this in a programme with Queue

2009-05-12 Thread Diez B. Roggisch
gganesh wrote: > On May 12, 6:34 pm, MRAB wrote: >> gganesh wrote: >> > Hi all, >> > I'm just learning python ,the code below is found in one of the >> > sites ,it produces an error like >> > Traceback (most recent call last): >> > File "queue.py", line 34, in >> > main() >> > File "queue.py", l

Re: Python API Functions equivalent to ruby's rb_big2str() and rb_str2cstr()

2009-05-12 Thread Hrvoje Niksic
rahul writes: > Hi Christian, > rb_big2str(Big-Integer, base) of ruby returns string representation > of big-Integer. now, i am able to find equivalent python API function > of rb_str2cstr() of ruby. That would be PyLong_FromString, for the sake of later searches. > so , please help me about

Re: AssertionError - help me to solve this in a programme with Queue

2009-05-12 Thread gganesh
On May 12, 6:34 pm, MRAB wrote: > gganesh wrote: > > Hi all, > > I'm just learning python ,the code below is found in one of the > > sites ,it produces an error like > > Traceback (most recent call last): > >   File "queue.py", line 34, in > >     main() > >   File "queue.py", line 28, in main >

Re: Nimrod programming language

2009-05-12 Thread rumpf_a
> > That is already the case: The Pascal version is translated to Nimrod > > and than compiles itself. Bootstrapping works. > > I meant why not get rid of the translation step and implement the > compiler in idiomatic Nimrod. > Not until version 1.0 is out. This way the language can evolve more eas

Re: About progress bar in glade

2009-05-12 Thread shruti surve
On Tue, May 12, 2009 at 6:19 PM, shruti surve wrote: > hi > > i am using progress bar in glade and python file. When i clicked on menu > item, open office spreadsheet will be opened. but it takes some time to open > up, so i want to add progress bar. Now, when i clicked on menu item,dialog > with

Re: AssertionError - help me to solve this in a programme with Queue

2009-05-12 Thread MRAB
gganesh wrote: Hi all, I'm just learning python ,the code below is found in one of the sites ,it produces an error like Traceback (most recent call last): File "queue.py", line 34, in main() File "queue.py", line 28, in main t=MyThread(q) File "/usr/lib/python2.5/threading.py", lin

Re: how to write loop (was "no subject")

2009-05-12 Thread Dave Angel
karlos barlos wrote: hello to all i have been using this script to add users to my active directory structure i wise to make a loop in order for it to run for A large Number of Users can anyone give me some advice on the loop ?? import win32com,win32com.client def add_acct(location,accou

Re: Nimrod programming language

2009-05-12 Thread rumpf_a
> > > The language and library are missing arbitrary precision integer > > > arithmetic, using GMP or something like that. > > > True, but currently not a high priority for me. > > Too bad. That makes Nimrod officially "worthless", i.e., of no > value to me. > Well, you could write a wrapper for GM

Re: putting date strings in order

2009-05-12 Thread John Machin
MRAB mrabarnett.plus.com> writes: > > Sort the list, passing a function as the 'key' argument. The function > should return an integer for the month, eg 0 for 'jan', 1 for 'feb'. If > you want to have a different start month then add and if you don't like what that produces, try subtract :-) >

AssertionError - help me to solve this in a programme with Queue

2009-05-12 Thread gganesh
Hi all, I'm just learning python ,the code below is found in one of the sites ,it produces an error like Traceback (most recent call last): File "queue.py", line 34, in main() File "queue.py", line 28, in main t=MyThread(q) File "/usr/lib/python2.5/threading.py", line 398, in __init_

Re: Is there a GUI for informing a user of missing dependencies?

2009-05-12 Thread Dave Angel
Jason wrote: I'm writing a small GUI (Python 2.5/6) using wxPython and pySerial. Since these are both 3rd party modules, if a user doesn't have them installed and tries to run the GUI from a file browser, the app will fail silently. I'm hoping to avoid that. Sure, I'll have a readme file, but

Re: Nimrod programming language

2009-05-12 Thread rumpf_a
> There are two showstoppers for me though: > > 1. Introducing a new programming language where the char type is a > byte is anachronistic. You're saying that programmers don't have to > care about the string encoding and can just treat them as an array of > bytes. That is exactly what causes all t

Re: multithreading in python

2009-05-12 Thread Almar Klein
See the standard help on the threading and thread module. Almar 2009/5/12 shruti surve : > hi, >  how to do multithreading in python??? Like running dialog box and running > xml rpc calls simultaneously??? > > > regards > shruti > > -- > http://mail.python.org/mailman/listinfo/python-list > > --

Re: Python API Functions equivalent to ruby's rb_big2str() and rb_str2cstr()

2009-05-12 Thread rahul
On May 12, 5:25 pm, Christian Heimes wrote: > rahul schrieb: > > > Is functions equivalent to ruby's  rb_big2str() and rb_str2cstr() > > available in Python. > > I had search a lot in google but not able to find that. > > If anybody know than please give me the name of those functions of > > Pytho

Re: putting date strings in order

2009-05-12 Thread MRAB
noydb wrote: On May 11, 11:30 pm, Paul Rubin wrote: noydb writes: Anyone have any good ideas? I was curious to see what people came up with. Is this a homework assignment? Some hints: 1) figure out how to compare two month names for chronological order, le

multithreading in python

2009-05-12 Thread shruti surve
hi, how to do multithreading in python??? Like running dialog box and running xml rpc calls simultaneously??? regards shruti -- http://mail.python.org/mailman/listinfo/python-list

About progress bar in glade

2009-05-12 Thread shruti surve
hi i am using progress bar in glade and python file. When i clicked on menu item, open office spreadsheet will be opened. but it takes some time to open up, so i want to add progress bar. Now, when i clicked on menu item,dialog with progress bar is coming and progress bar is pulsating but xml_rpc

Re: putting date strings in order

2009-05-12 Thread Jaime Fernandez del Rio
If you simply want to generate an ordered list of months, start with it in order: dates = ["x_jan",...,"x_dec"] and if the desired starting month is start = 6 # i.e. x_jun dates = dates[start - 1:] + dates[:start - 1] If you have to sort the list itself, I would use an intermediate

Re: putting date strings in order

2009-05-12 Thread bearophileHUGS
noydb: > I have not worked with the %. > Can you provide a snippet of your idea in code form? Then it's a very good moment to learn using it: http://en.wikipedia.org/wiki/Modulo_operator >>> 10 % 3 1 >>> 10 % 20 10 >>> -10 % 3 2 >>> -10 % -3 -1 >Something like that< Implement your first v

Re: Sorting a dictionary

2009-05-12 Thread Andre Engels
On Tue, May 12, 2009 at 1:54 PM, Ronn Ross wrote: > I'm attempting to sort for the results of a dictionary. I would like to > short by the 'key' in ascending order. I have already made several attempts > using: sorted() and .sort(). > Here is my loop: >     for key,value in word_count.items(): >  

Re: Python API Functions equivalent to ruby's rb_big2str() and rb_str2cstr()

2009-05-12 Thread Christian Heimes
rahul schrieb: > Is functions equivalent to ruby's rb_big2str() and rb_str2cstr() > available in Python. > I had search a lot in google but not able to find that. > If anybody know than please give me the name of those functions of > Python. Please don't assume that we know what the Ruby function

Re: Sorting a dictionary

2009-05-12 Thread Jaime Fernandez del Rio
This one I think I know... Try with: for k in sorted(word_count) : print k,"=",word_count[k] You need to do the sorting before iterating over the keys... Jaime On Tue, May 12, 2009 at 1:54 PM, Ronn Ross wrote: > I'm attempting to sort for the results of a dictionary. I would like to > shor

EURO NEWS FINALLY LAUNCHED THEIR BLOG

2009-05-12 Thread Aqeel Ahmed Rajpar
TO SUBSCRIBE THE BLOG VIA EMAIL VISIT www.euronewspk.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: putting date strings in order

2009-05-12 Thread noydb
On May 11, 11:30 pm, Paul Rubin wrote: > noydb writes: > > Anyone have any good ideas?  I was curious to see what people came up > > with. > > Is this a homework assignment?  Some hints: > > 1) figure out how to compare two month names for chronological order, >    l

Re: Compiling Python on Windows : how to deal with modules ?

2009-05-12 Thread r2d3
Hi all, after some investigation, I managed to find how to do this "manually". I post it here if it could help others... 1) on windows, mostly all the dynamic libraries (time, socket, ...) are statically linked into python26.dll 2) all the modules are located in lib/ and some .pyd (in fact rename

  1   2   >