Re: Extending Python by Adding Keywords Data types

2007-08-01 Thread Marc 'BlackJack' Rintsch
On Wed, 01 Aug 2007 01:42:38 +, Maximus Decimus wrote: Since, I am an amateur in using python, could you please be more specific. For new data types, you had asked to implement the classes. I intend to use C for implementing these data types. So where do i need to implement these classes

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Stargaming
On Wed, 01 Aug 2007 05:44:21 +, Michele Simionato wrote: On Aug 1, 5:53 am, beginner [EMAIL PROTECTED] wrote: Hi All, This is just a very simple question about a python trick. In perl, I can write __END__ in a file and the perl interpreter will ignore everything below that line. This

Re: How does xmlrpc work ?

2007-08-01 Thread Marc 'BlackJack' Rintsch
On Wed, 01 Aug 2007 05:32:14 +, [EMAIL PROTECTED] wrote: I am working on a system which used XMLRPC to communicate between hundreds of computer. One administrative computer keeps hundreds of xmlrpc instance of other computers. I want to know if evey instance use a single connection and

Re: A way to re-organize a list

2007-08-01 Thread Marc 'BlackJack' Rintsch
On Wed, 01 Aug 2007 01:33:49 +, beginner wrote: On Jul 19, 10:05 am, beginner [EMAIL PROTECTED] wrote: Hi Everyone, I have a simple list reconstruction problem, but I don't really know how to do it. I have a list that looks like this: l=[ (A, a, 1), (A, a, 2), (A, a, 3), (A, b, 1),

Re: Where do they tech Python officialy ?

2007-08-01 Thread NicolasG
Open source projects do not require previous professional experience to accept volunteers. So, one way out of your dilemma is to make a name for yourself as an open source contributor -- help out with Python itself and/or with any of the many open source projects that use Python, and you

Re: removing redundant elements in a dictionary

2007-08-01 Thread Antti Rasinen
On 2007-08-01, at 06:50, Astan Chee wrote: Hi, I have a dictionary which looks something like this: elem = {co:[1,2,3],cp:[3,2,1],pp:[5,6,7],cl:[1,2,3],qw: [6,7,8],qa:[8,7,6]} what Im trying to do is find all keys in the list that have the same value and delete those (except one);

Strange problems with subprocess

2007-08-01 Thread Michele Petrazzo
Hi all. I have a simple ping tester program that, every 1 minute (execute by linux crontab), create, with subprocess, a ping -c 1 my_addrs. All work, but sometime (about 1/2 times at a day), I receive this error message: File /exports/srv-wipex/net_test/ping_tester.py, line 88, in pyPing cmd_p

Re: Any way to monitor windows network connection?

2007-08-01 Thread momobear
On Aug 1, 1:47 pm, Gordon Airporte [EMAIL PROTECTED] wrote: momobear wrote: hi, Is there any way to show me detailed listings of all TCP and UDP endpoints in my microsoft windows XP in python way? thanks. Unless you're looking for a programming

Re: Any way to monitor windows network connection?

2007-08-01 Thread momobear
On Aug 1, 12:22 pm, Jay Loden [EMAIL PROTECTED] wrote: momobear wrote: hi, Is there any way to show me detailed listings of all TCP and UDP endpoints in my microsoft windows XP in python way? thanks. Not sure if it's exactly what you're looking for, but this might be of use as a

Re: Iteration over strings

2007-08-01 Thread Duncan Booth
Jay Loden [EMAIL PROTECTED] wrote: This isn't just a problem with the socket module, so please don't think I'm picking on it or singling it out, it's something I've seen a number of places. e.g. from os.stat: os.stat = stat(...) stat(path) - stat result Perform a stat

Re: split a string of space separated substrings - elegant solution?

2007-08-01 Thread Helmut Jarausch
Many thanks to all of you! It's amazing how many elegant solutions there are in Python. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: Iteration over strings

2007-08-01 Thread Stefan Behnel
Robert Dailey wrote: I have the following code: str = C:/somepath/folder/file.txt for char in str: if char == \\: char = / The above doesn't modify the variable 'str' directly. I'm still pretty new to Python so if someone could explain to me why this isn't working and what

Re: Error with Tkinter and tkMessageBox

2007-08-01 Thread Fabio Z Tessitore
Il Tue, 31 Jul 2007 18:45:57 -0400, jim-on-linux ha scritto: Try This: def reply(): showinfo('ciao','hello') I've tried without success ... thanks I've also discovered that when I (or some other prog using tkinter) display menu, the underscore is an ugly little black box. So,

Re: Free SMS from Computer Worldwide

2007-08-01 Thread Dan Anos
Hi Lowbowman, Interested in expanding your SMS website to other countries, check out our affiliate scheme on FreebieSMS.co.uk. I cant see your email address on your website. Fiach On Jul 31, 4:09 am, lowboman [EMAIL PROTECTED] wrote: Hello there I invite you to check out my

Re: Where do they tech Python officialy ?

2007-08-01 Thread Alex Popescu
[EMAIL PROTECTED] (Alex Martelli) wrote in news:1i23wyk.avc945i4dwsiN% [EMAIL PROTECTED]: NicolasG [EMAIL PROTECTED] wrote: ... The problem is that I would like to work as a Python programmer but all the job vacancies I can find requires a couple of years of professional experience ...

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Ben Finney
beginner [EMAIL PROTECTED] writes: In perl, I can write __END__ in a file and the perl interpreter will ignore everything below that line. IIRC, this Perl feature is specifically intended to work with its feature of reading data from the same file, as all the lines following that marker.

Re: Process Control Help

2007-08-01 Thread Hendrik van Rooyen
Walt Leipold lei...e-net.com wrote: 8--- summary of state of the art - (Wow, that was a depressing post to write.) Cheer up! - The end is nigh! Warning: The rest of this post is barely on topic for python, and contains some shameless self advertising. Its probably

Re: standalone process to interact with the web

2007-08-01 Thread Diez B. Roggisch
beginner wrote: Hi Everyone, I am looking for a way to allow a standalone python process to easily interactive with a few web pages. It has to be able to easily receive requests from the web and post data to the web. I am thinking about implementing a standalone soap server, but I am

Re: Reload after an exception, not possible ?

2007-08-01 Thread Stef Mientki
Steve Holden wrote: Stef Mientki wrote: hello, I've a graphical application (wxPython), where the code in the main GUI loop is given below. 1JAL_Loaded = False 2while len(App_Running) 0: 3if JALsPy_globals.State == SS_Run: 4try: 5if

Re: simple string backspace question

2007-08-01 Thread Hendrik van Rooyen
John Machin sjm...con.net wrote: Point (2): Backspace??? YAGNI --- backspace hasn't been much use for anything (except when typing text) since the days when in order to get a bold letter (say X) on a character impact printer, one would transmit X\bX\bX ... ooh! Ugly! Almost as bad as,

Re: access the name of my method inside it

2007-08-01 Thread Marc 'BlackJack' Rintsch
On Wed, 01 Aug 2007 09:06:42 +, james_027 wrote: for example I have this method def my_method(): # do something # how do I get the name of this method which is my_method here? Why do you need this? There are ways but those are not really good for production code. Ciao,

Re: standalone process to interact with the web

2007-08-01 Thread Bruno Desthuilliers
beginner a écrit : Hi Steve, On Jul 31, 11:42 am, Steve Holden [EMAIL PROTECTED] wrote: beginner wrote: Hi Everyone, I am looking for a way to allow a standalone python process to easily interactive with a few web pages. It has to be able to easily receive requests from the web and post

Re: Where do they tech Python officialy ?

2007-08-01 Thread Magnus Lycka
On July 23, NicolasG wrote: I want to be a professional python programmer... unfortunately sometimes to work as a programmer is really hard in this world, every employee requires professional experience and you can't really start as a beginner.. On July 24, NicolasG wrote: Python is what

access the name of my method inside it

2007-08-01 Thread james_027
Hi, for example I have this method def my_method(): # do something # how do I get the name of this method which is my_method here? Thanks, james -- http://mail.python.org/mailman/listinfo/python-list

calling a .net application from Python 2.5

2007-08-01 Thread Acm
I am working with Python 2.5. I would like to know how to call a .NET application (or .dll) from a Python script. Can anyone help please? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Floats as keys in dict

2007-08-01 Thread Brian Elmegaard
Hi I am making a script to optimiza by dynamic programming. I do not know the vertices and nodes before the calculation, so I have decided to store the nodes I have in play as keys in a dict. However, the dict keys are then floats and I have to round the values of new possible nodes in each

Problem with subprocess.Popen()

2007-08-01 Thread The Cruisemaniac
Hi all, I'm trying to run a windows batch file from a python script using subprocess.popen(). The issue that I'm facing is that, if i give the batch file as parameter to the popen function, the script runs, but if i provide a parameter, it is not working. Can someone help me with the command.

Re: Extending Python by Adding Keywords Data types

2007-08-01 Thread Bjoern Schliessmann
Maximus Decimus wrote: Since, I am an amateur in using python, http://en.wikipedia.org/wiki/Amateur | Most commonly an amateur is understood to be someone who does | something without pay or formal training. Conversely, a | professional is someone who has received training in a particular |

Re: standalone process to interact with the web

2007-08-01 Thread Bruno Desthuilliers
beginner a écrit : (snip) Yes exactly. I just don't want to reinvent the wheel as I imagine there are already tons of libraries and frameworks that support RPC or the like functions. Why go thru the pain of RPC, SOAP or such bloated horrors ? Why not just use plain old HTTP with a RESTful API

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Steve Holden
Stargaming wrote: On Wed, 01 Aug 2007 05:44:21 +, Michele Simionato wrote: On Aug 1, 5:53 am, beginner [EMAIL PROTECTED] wrote: Hi All, This is just a very simple question about a python trick. In perl, I can write __END__ in a file and the perl interpreter will ignore everything

Re: access the name of my method inside it

2007-08-01 Thread Marc 'BlackJack' Rintsch
On Wed, 01 Aug 2007 07:01:42 -0400, Steve Holden wrote: Marc 'BlackJack' Rintsch wrote: On Wed, 01 Aug 2007 09:06:42 +, james_027 wrote: for example I have this method def my_method(): # do something # how do I get the name of this method which is my_method here? Why do

MIMEText breaking the rules?

2007-08-01 Thread Dale Strickland-Clark
The email module's mimetext handling isn't what you might expect from something that appears to behave like a dictionary. $ python Python 2.5 (r25:51908, May 25 2007, 16:14:04) [GCC 4.1.2 20061115 (prerelease) (SUSE Linux)] on linux2 Type help, copyright, credits or license for more information.

Re: access the name of my method inside it

2007-08-01 Thread Steve Holden
Marc 'BlackJack' Rintsch wrote: On Wed, 01 Aug 2007 09:06:42 +, james_027 wrote: for example I have this method def my_method(): # do something # how do I get the name of this method which is my_method here? Why do you need this? There are ways but those are not really

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Stargaming
On Wed, 01 Aug 2007 06:56:36 -0400, Steve Holden wrote: Stargaming wrote: On Wed, 01 Aug 2007 05:44:21 +, Michele Simionato wrote: On Aug 1, 5:53 am, beginner [EMAIL PROTECTED] wrote: Hi All, This is just a very simple question about a python trick. In perl, I can write __END__ in a

Plain old SAX and minidom useable? But how then?

2007-08-01 Thread Dobedani
Dear All, I guess I don't know where to look for the right information. I hope you guys can help me on the way. I want to retrieve a string from an XML-file. If Python were to have XPath available, my problem would be solved. The xquery string would be enough and I have already obtained that the

Re: Plain old SAX and minidom useable? But how then?

2007-08-01 Thread Carsten Haese
On Wed, 2007-08-01 at 04:58 -0700, Dobedani wrote: [...] Nelson says: There's the stock Python install, which barely does anything [for XML]. That's overstated. Plain old SAX and minidom may not be ideal, but they're useable. Please: where then can I find examples of such use? If I cannot

wxPython version question

2007-08-01 Thread The Max
Hi at all Hi have need of testing the version of wxPython in use at the moment I use wxversion, but I don't can find a method for testing version like this: if versionOfWX() = 2.8: or if versionOfWX() = 2.8: ( versioneOfWX is a pseudo-function create for this example ) Someone know

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Magnus Lycka
beginner wrote: Hi All, This is just a very simple question about a python trick. In perl, I can write __END__ in a file and the perl interpreter will ignore everything below that line. This is very handy when testing my program. Does python have something similar? raise SystemExit()

Re: access the name of my method inside it

2007-08-01 Thread Steve Holden
Marc 'BlackJack' Rintsch wrote: On Wed, 01 Aug 2007 07:01:42 -0400, Steve Holden wrote: Marc 'BlackJack' Rintsch wrote: On Wed, 01 Aug 2007 09:06:42 +, james_027 wrote: for example I have this method def my_method(): # do something # how do I get the name of this method

Re: wxPython version question

2007-08-01 Thread Bjoern Schliessmann
The Max wrote: Hi have need of testing the version of wxPython in use at the moment I use wxversion, but I don't can find a method for testing version like this: if versionOfWX() = 2.8: or if versionOfWX() = 2.8: ( versioneOfWX is a pseudo-function create for this example )

Re: Plain old SAX and minidom useable? But how then?

2007-08-01 Thread Stefan Behnel
Hi, calm down, minidom is not easy to use, but it can solve your problem. Dobedani wrote: I guess I don't know where to look for the right information. I hope you guys can help me on the way. I want to retrieve a string from an XML-file. If Python were to have XPath available, my problem

Re: Plain old SAX and minidom useable? But how then?

2007-08-01 Thread Dobedani
Darsten and Stefan, Yeah, thank you very much! I actually found a good example at http://www.python.org/doc/2.4/lib/dom-example.html Your input was also helpful, so now I have been able to walk through the XML and to retrieve the text strings I need: doc = parse(configfile); elems =

Re: Extending Python by Adding Keywords Data types

2007-08-01 Thread Paul McGuire
On Jul 31, 3:28 pm, Maximus Decimus [EMAIL PROTECTED] wrote: I am using python v2.5 and I am an amateur working on python. I am extending python for my research work and would like some help and guidance w.r.t this matter from you experienced python developers. II want to add some more

Re: access the name of my method inside it

2007-08-01 Thread Bruno Desthuilliers
james_027 a écrit : Hi, On Aug 1, 5:18 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 01 Aug 2007 09:06:42 +, james_027 wrote: for example I have this method def my_method(): # do something # how do I get the name of this method which is my_method here? Why do

Equivalent to gzinflate() function in PHP.

2007-08-01 Thread Adam Kubica
Hellou. Anybody know about code that work equivalent to gzinflate() function used in PHP? I search via google but I don't found anything sensible :-( -- http://mail.python.org/mailman/listinfo/python-list

Re: access the name of my method inside it

2007-08-01 Thread Paul McGuire
On Aug 1, 8:07 am, james_027 [EMAIL PROTECTED] wrote: Hi, On Aug 1, 5:18 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 01 Aug 2007 09:06:42 +, james_027 wrote: for example I have this method def my_method(): # do something # how do I get the name of

Re: access the name of my method inside it

2007-08-01 Thread Jay Loden
james_027 wrote: Hi, On Aug 1, 5:18 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 01 Aug 2007 09:06:42 +, james_027 wrote: for example I have this method def my_method(): # do something # how do I get the name of this method which is my_method here? Why do you

Re: access the name of my method inside it

2007-08-01 Thread james_027
Hi, On Aug 1, 5:18 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 01 Aug 2007 09:06:42 +, james_027 wrote: for example I have this method def my_method(): # do something # how do I get the name of this method which is my_method here? Why do you need this?

Re: Strange problems with subprocess

2007-08-01 Thread kyosohma
On Aug 1, 2:20 am, Michele Petrazzo [EMAIL PROTECTED] wrote: Hi all. I have a simple ping tester program that, every 1 minute (execute by linux crontab), create, with subprocess, a ping -c 1 my_addrs. All work, but sometime (about 1/2 times at a day), I receive this error message: File

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread beginner
On Jul 31, 10:53 pm, beginner [EMAIL PROTECTED] wrote: Hi All, This is just a very simple question about a python trick. In perl, I can write __END__ in a file and the perl interpreter will ignore everything below that line. This is very handy when testing my program. Does python have

Re: Equivalent to gzinflate() function in PHP.

2007-08-01 Thread kyosohma
On Aug 1, 8:44 am, Adam Kubica [EMAIL PROTECTED] wrote: Hellou. Anybody know about code that work equivalent to gzinflate() function used in PHP? I search via google but I don't found anything sensible :-( I'm not sure what gzinflate does, but it looks like it's some kind of

Re: zip() function troubles

2007-08-01 Thread Chris Mellon
On 31 Jul 2007 12:57:13 -0700, Paul Rubin http://phr.cx@nospam.invalid wrote: Chris Mellon [EMAIL PROTECTED] writes: Better hand in your computer, then. You're never going to find a situation where the environment won't affect the running time of your algorithms. The environment may

Re: http client module

2007-08-01 Thread stefano
On 31 jul, 23:07, Steve Holden [EMAIL PROTECTED] wrote: stefano wrote: Hello i'm looking for a http client for python i found this one call httplib2 http://64.233.169.104/search?q=cache:0jJWNfodK6gJ:bitworking.org/proj... but is too old Look at urllib and urllib2 in the standard

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Neil Cerutti
On 2007-08-01, beginner [EMAIL PROTECTED] wrote: Thanks everyone for responding. It doesn't look like python has it. I would definitely miss it. As Steve said, the nice thing about __END__ is that things below __END__ do not have to have legit syntax. That let me focus on the lines of code I

Re: wxPython version question

2007-08-01 Thread Chris Mellon
On 8/1/07, The Max [EMAIL PROTECTED] wrote: Hi at all Hi have need of testing the version of wxPython in use at the moment I use wxversion, but I don't can find a method for testing version like this: if versionOfWX() = 2.8: or if versionOfWX() = 2.8: ( versioneOfWX is a

Emacs + python

2007-08-01 Thread Hadron
Could anyone put me on the right track to developing Python with emacs please : modes to consider, debugging etc hopefully all within emacs. Any help and shared experiences much appreciated. -- http://mail.python.org/mailman/listinfo/python-list

Re: Floats as keys in dict

2007-08-01 Thread Alex Martelli
Brian Elmegaard [EMAIL PROTECTED] wrote: I am making a script to optimiza by dynamic programming. I do not know the vertices and nodes before the calculation, so I have decided to store the nodes I have in play as keys in a dict. However, the dict keys are then floats and I have to round

Re: Where do they tech Python officialy ?

2007-08-01 Thread Alex Martelli
NicolasG [EMAIL PROTECTED] wrote: Open source projects do not require previous professional experience to accept volunteers. So, one way out of your dilemma is to make a name for yourself as an open source contributor -- help out with Python itself and/or with any of the many open source

Extending doctest

2007-08-01 Thread Neil Cerutti
One of my current tests looks like this (the program is an interpreter for a scheme-like language): result = parse_op('(with (b (newbox 5))' ... ' (seqn (setbox b 1)' ... ' (setbox b 2)' ... ' (setbox b 3)' ...

Re: Problem with subprocess.Popen()

2007-08-01 Thread O.R.Senthil Kumaran
I'm trying to run a windows batch file from a python script using subprocess.popen(). The issue that I'm facing is that, if i give the batch file as parameter to the popen function, the script runs, but if i provide a parameter, it is not working. The actual windows command to be

Re: Where do they tech Python officialy ?

2007-08-01 Thread Ant
On Aug 1, 9:40 am, Alex Popescu [EMAIL PROTECTED] wrote: ... It depends :-). In my experience I met employers being concerned by my implication in the oss world :-). I have the opposite experience. It was predominantly the fact that I was involved in several open source projects that got me

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Diez B. Roggisch
beginner wrote: On Jul 31, 10:53 pm, beginner [EMAIL PROTECTED] wrote: Hi All, This is just a very simple question about a python trick. In perl, I can write __END__ in a file and the perl interpreter will ignore everything below that line. This is very handy when testing my program. Does

Re: Where do they tech Python officialy ?

2007-08-01 Thread Alex Martelli
Alex Popescu [EMAIL PROTECTED] wrote: ... and you will both learn a lot _and_ acquire professional experience that any enlightened employer will recognize as such. It depends :-). In my experience I met employers being concerned by my implication in the oss world :-). Considering

force unicode strings

2007-08-01 Thread Thomas Guettler
Hi, is it possible to force all non ascii strings to be unicode strings somehow? Sometimes I forget that I need to write u'...' if the string contains an umlaut. I get an exception in django later. But since the exception does not show the string it is hard to find it. Is it possible to loop

Assertion in list comprehension

2007-08-01 Thread beginner
Hi, Does anyone know how to put an assertion in list comprehension? I have the following list comprehension, but I want to use an assertion to check the contents of rec_stdl. I ended up using another loop which essentially duplicates the functions of list comprehension. It just look like a waste

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Chris Mellon
On 8/1/07, beginner [EMAIL PROTECTED] wrote: On Jul 31, 10:53 pm, beginner [EMAIL PROTECTED] wrote: Hi All, This is just a very simple question about a python trick. In perl, I can write __END__ in a file and the perl interpreter will ignore everything below that line. This is very

Re: Floats as keys in dict

2007-08-01 Thread Steve Holden
Alex Martelli wrote: Brian Elmegaard [EMAIL PROTECTED] wrote: I am making a script to optimiza by dynamic programming. I do not know the vertices and nodes before the calculation, so I have decided to store the nodes I have in play as keys in a dict. However, the dict keys are then floats

Re: What is the functional way of doing this?

2007-08-01 Thread Alexander Schmolck
beginner [EMAIL PROTECTED] writes: Hi, If I have a number n and want to generate a list based on like the following: def f(n): l=[] while n0: l.append(n%26) n /=26 return l I am wondering what is the 'functional' way to do the same. This is very

Re: Assertion in list comprehension

2007-08-01 Thread [EMAIL PROTECTED]
On Aug 1, 9:37 am, beginner [EMAIL PROTECTED] wrote: Hi, Does anyone know how to put an assertion in list comprehension? I have the following list comprehension, but I want to use an assertion to check the contents of rec_stdl. I ended up using another loop which essentially duplicates the

Awkward format string

2007-08-01 Thread beginner
Hi, In order to print out the contents of a list, sometimes I have to use very awkward constructions. For example, I have to convert the datetime.datetime type to string first, construct a new list, and then send it to print. The following is an example. x=(e[0].strftime(%Y-%m-%d),

Re: What is the functional way of doing this?

2007-08-01 Thread Chris Mellon
On 7/31/07, Ricardo Aráoz [EMAIL PROTECTED] wrote: Steven D'Aprano wrote: On Tue, 31 Jul 2007 09:01:42 -0300, Ricardo Aráoz wrote: Considering I am a beginner I did a little test. Funny results too. The function I proposed (lists1.py) took 11.4529998302 seconds, while the other one

Time object?

2007-08-01 Thread Robert Dailey
Hi, I'm well aware of the datetime module, however it is really inconsistent and useless to me. In order to do any arithmetic on time objects, I have to use the 'timedelta' class, which doesn't even allow me to do all the math I want to do. For example, I want to do 1 / timeobj, where timeobj

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Cameron Laird
In article [EMAIL PROTECTED], Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-08-01, beginner [EMAIL PROTECTED] wrote: Thanks everyone for responding. It doesn't look like python has it. I would definitely miss it. As Steve said, the nice thing about __END__ is that things below __END__ do not

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Neil Cerutti
On 2007-08-01, Cameron Laird [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-08-01, beginner [EMAIL PROTECTED] wrote: Thanks everyone for responding. It doesn't look like python has it. I would definitely miss it. As Steve said, the nice

Re: Awkward format string

2007-08-01 Thread beginner
On Aug 1, 11:31 am, Chris Mellon [EMAIL PROTECTED] wrote: On 8/1/07, beginner [EMAIL PROTECTED] wrote: Hi, In order to print out the contents of a list, sometimes I have to use very awkward constructions. For example, I have to convert the datetime.datetime type to string first,

Re: Time object?

2007-08-01 Thread Steve Holden
Robert Dailey wrote: Hi, I'm well aware of the datetime module, however it is really inconsistent and useless to me. In order to do any arithmetic on time objects, I have to use the 'timedelta' class, which doesn't even allow me to do all the math I want to do. For example, I want to

Re: Awkward format string

2007-08-01 Thread Chris Mellon
On 8/1/07, beginner [EMAIL PROTECTED] wrote: Hi, In order to print out the contents of a list, sometimes I have to use very awkward constructions. For example, I have to convert the datetime.datetime type to string first, construct a new list, and then send it to print. The following is an

Re: Assertion in list comprehension

2007-08-01 Thread Chris Mellon
On 8/1/07, beginner [EMAIL PROTECTED] wrote: Hi, Does anyone know how to put an assertion in list comprehension? I have the following list comprehension, but I want to use an assertion to check the contents of rec_stdl. I ended up using another loop which essentially duplicates the functions

Re: calling a .net application from Python 2.5

2007-08-01 Thread James Matthews
http://pythonnet.sourceforge.net/ On 8/1/07, Acm [EMAIL PROTECTED] wrote: I am working with Python 2.5. I would like to know how to call a .NET application (or .dll) from a Python script. Can anyone help please? Thank you. -- http://mail.python.org/mailman/listinfo/python-list --

Re: calling a .net application from Python 2.5

2007-08-01 Thread Chris Mellon
Note that for 2.5 you'll want the released snapshot, not the official release. On 8/1/07, James Matthews [EMAIL PROTECTED] wrote: http://pythonnet.sourceforge.net/ On 8/1/07, Acm [EMAIL PROTECTED] wrote: I am working with Python 2.5. I would like to know how to call a .NET application

Re: Assertion in list comprehension

2007-08-01 Thread beginner
On Aug 1, 11:09 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Aug 1, 9:37 am, beginner [EMAIL PROTECTED] wrote: Hi, Does anyone know how to put an assertion in list comprehension? I have the following list comprehension, but I want to use an assertion to check the contents of

Re: Assertion in list comprehension

2007-08-01 Thread Stargaming
On Wed, 01 Aug 2007 11:28:48 -0500, Chris Mellon wrote: On 8/1/07, beginner [EMAIL PROTECTED] wrote: Hi, Does anyone know how to put an assertion in list comprehension? I have the following list comprehension, but I want to use an assertion to check the contents of rec_stdl. I ended up

Re: Awkward format string

2007-08-01 Thread Ian Clark
beginner wrote: Hi, In order to print out the contents of a list, sometimes I have to use very awkward constructions. For example, I have to convert the datetime.datetime type to string first, construct a new list, and then send it to print. The following is an example.

Checking object types

2007-08-01 Thread Robert Dailey
Hi, I'm currently interested in creating an __add__() operator for one of my classes. This class handles both integers and objects its own type, however I don't know how I can perform special add operations depending on which is passed in. Since I haven't seen any evidence of function

Re: Assertion in list comprehension

2007-08-01 Thread Marc 'BlackJack' Rintsch
On Wed, 01 Aug 2007 16:55:53 +, Stargaming wrote: Thirdly: This sort of testing is precisely what unit tests and/or doctests are for. Huh? What beginner is doing there seems more like input validation than testing. Unit or doctests are meant for testing (and in case of doctests,

Re: Assertion in list comprehension

2007-08-01 Thread beginner
On Aug 1, 11:28 am, Chris Mellon [EMAIL PROTECTED] wrote: On 8/1/07, beginner [EMAIL PROTECTED] wrote: Hi, Does anyone know how to put an assertion in list comprehension? I have the following list comprehension, but I want to use an assertion to check the contents of rec_stdl. I

Re: Awkward format string

2007-08-01 Thread Chris Mellon
On 8/1/07, beginner [EMAIL PROTECTED] wrote: On Aug 1, 11:31 am, Chris Mellon [EMAIL PROTECTED] wrote: On 8/1/07, beginner [EMAIL PROTECTED] wrote: Hi, In order to print out the contents of a list, sometimes I have to use very awkward constructions. For example, I have to convert

Re: Awkward format string

2007-08-01 Thread Neil Cerutti
On 2007-08-01, beginner [EMAIL PROTECTED] wrote: print f, %s\t%s\t%d\t%f\t%f\t%f\t%d % (x.field1..strftime(%Y-%m- %d), x.field2..strftime(%Y-%m-%d), x.field3, x.field4, x.field5, x.field.6, x.field7) This is also tedious and error-prone. Providing a suitable .str or .__repr__ method for

Re: Assertion in list comprehension

2007-08-01 Thread Chris Mellon
On 8/1/07, beginner [EMAIL PROTECTED] wrote: On Aug 1, 11:28 am, Chris Mellon [EMAIL PROTECTED] wrote: On 8/1/07, beginner [EMAIL PROTECTED] wrote: Hi, Does anyone know how to put an assertion in list comprehension? I have the following list comprehension, but I want to use

Re: Assertion in list comprehension

2007-08-01 Thread Chris Mellon
On 01 Aug 2007 16:55:53 GMT, Stargaming [EMAIL PROTECTED] wrote: On Wed, 01 Aug 2007 11:28:48 -0500, Chris Mellon wrote: On 8/1/07, beginner [EMAIL PROTECTED] wrote: Hi, Does anyone know how to put an assertion in list comprehension? I have the following list comprehension, but I want

Python IMAP web-access

2007-08-01 Thread Damjan
Is there some project that implements web access to an IMAP store? Maybe something AJAXy like http://roundcube.net/?? -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange problems with subprocess

2007-08-01 Thread Michele Petrazzo
[EMAIL PROTECTED] wrote: This doesn't look like a complete traceback. It doesn't give what the error was. Forgot a line, sorry! exceptions.OSError: [Errno 4] Interrupted system call Mike Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking object types

2007-08-01 Thread Alex Popescu
Robert Dailey [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: --=_Part_51775_19953536.1185988361742 Hi, I'm currently interested in creating an __add__() operator for one of my classes. This class handles both integers and objects its own type, however I don't know how I can

Re: Assertion in list comprehension

2007-08-01 Thread beginner
On Aug 1, 12:35 pm, Chris Mellon [EMAIL PROTECTED] wrote: On 8/1/07, beginner [EMAIL PROTECTED] wrote: On Aug 1, 11:28 am, Chris Mellon [EMAIL PROTECTED] wrote: On 8/1/07, beginner [EMAIL PROTECTED] wrote: Hi, Does anyone know how to put an assertion in list comprehension? I

Re: Assertion in list comprehension

2007-08-01 Thread beginner
On Aug 1, 12:38 pm, Chris Mellon [EMAIL PROTECTED] wrote: On 01 Aug 2007 16:55:53 GMT, Stargaming [EMAIL PROTECTED] wrote: On Wed, 01 Aug 2007 11:28:48 -0500, Chris Mellon wrote: On 8/1/07, beginner [EMAIL PROTECTED] wrote: Hi, Does anyone know how to put an assertion in list

Re: Assertion in list comprehension

2007-08-01 Thread Chris Mellon
On 8/1/07, beginner [EMAIL PROTECTED] wrote: On Aug 1, 12:35 pm, Chris Mellon [EMAIL PROTECTED] wrote: On 8/1/07, beginner [EMAIL PROTECTED] wrote: much snippage I see. In fact I want to whole block surrounded by __debug__ to be optimized away in non-debug runs. If the logic of my program

Re: Where do they tech Python officialy ?

2007-08-01 Thread Bruno Desthuilliers
Alex Popescu a écrit : [EMAIL PROTECTED] (Alex Martelli) wrote in news:1i23wyk.avc945i4dwsiN% [EMAIL PROTECTED]: NicolasG [EMAIL PROTECTED] wrote: ... The problem is that I would like to work as a Python programmer but all the job vacancies I can find requires a couple of years of

Buffering HTML as HTMLParser reads it?

2007-08-01 Thread chrispwd
Hello, I am working on a project where I'm using python to parse HTML pages, transforming data between certain tags. Currently the HTMLParser class is being used for this. In a nutshell, its pretty simple -- I'm feeding the contents of the HTML page to HTMLParser, then I am overriding the

Re: Pythonic way for missing dict keys

2007-08-01 Thread John J. Lee
Steve Holden [EMAIL PROTECTED] writes: [...] Yup. Anyway there's a trivial translation for uses of apply. apply(f, *args, **kw) = f(*args, **kw) [...] Steve means: apply(f, args, kw) = f(*args, **kw) John -- http://mail.python.org/mailman/listinfo/python-list

Re: Subprocess and pipe-fork-exec primitive

2007-08-01 Thread Rafael V.
Hi Martin, the operating system I'm using is SUSE Linux 10, kernel 2.6.13. You're right, I was missing something. After you told me that it couldn't be Python preforming wait() on SIGCHLD, I decided to investigate further. My application requires access to a Informix database, and uses

  1   2   >