Re: question about loading variables from a file...

2006-11-05 Thread georgeryoung
On Nov 5, 2:26 pm, avidfan <[EMAIL PROTECTED]> wrote: > Can someone offer some advice as to how the best way to approach this > might be? > > I am trying to write a generic python script to build out some > applications, so the python script will be generic enough to work for > all of them, but it

Re: Is there a way to define a true global across modules?

2006-11-05 Thread Hendrik van Rooyen
"alex23" <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen wrote: > > "robert" <[EMAIL PROTECTED]> wrote: > > > Fredrik Lundh wrote: > > > > http://www.effbot.org/pyfaq/how-do-i-share-global-variables-across-modules.htm > > > > Or worse style - if you are too lazy to create a extra global variables

Re: how do I pass values between classes?

2006-11-05 Thread kath
hi, Larry Bates thanks for the reply... > You might consider doing it the same way wx passes things around. > When you instantiate the subclass pass the parent class' instance > as first argument to __init__ method. Yes thats absolutely right.. > That way the subclass can > easily pass valu

how can I send several command by useing pexpect ssh

2006-11-05 Thread haishan chang
I have studied pexpect example "sshls.py" and "ssh_session.py", trying to carry several linux command by ssh. for example. 1. ssh connect one remotehost, 2. cd  /tmp directory 3. mkdir myname 4. touch  output.log   But I found these examples only can carry one command.who knows how to carry sereval

Timer Usage

2006-11-05 Thread chewjeremy
I'm planning to do C++ development together with Python on Linux. I understand that Linux allows only one timer per process. Does Python use the Linux timer? If so, how do I use the timer without interfering with Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: wing ide vs. komodo?

2006-11-05 Thread [EMAIL PROTECTED]
Karlo Lozovina wrote: > "vj" <[EMAIL PROTECTED]> wrote in news:1162708898.962171.161120 > @e3g2000cwe.googlegroups.com: > > > The embedded python shell is also a useful feature. > > Yes, but Debug Probe and Stack Data absolutely rock! Can't live without > them anymore. Just set a breakpoint, run yo

adding python scripting to my application

2006-11-05 Thread Julian
Hi, first of all, I have to say I am new to Python. I have been working with a finite element analysis program written in c++. now, I am trying to 'rebuild' this code (possibly a full re-write) with scripting capability. I did some reading on the web, and found that there are two ways to do this :

Re: tips requested for a log-processing script

2006-11-05 Thread Hendrik van Rooyen
"Jaap" <[EMAIL PROTECTED]> wrote: > Python ers, > As a relatively new user of Python I would like to ask your advice on > the following script I want to create. > > I have a logfile which contains records. All records have the same > layout, and are stored in a CSV-format. Each record is (non-uni

Re: how to write code into a blog post?

2006-11-05 Thread Jorge Vargas
On 4 Nov 2006 14:40:19 -0800, thebjorn <[EMAIL PROTECTED]> wrote: > Jorge Vargas wrote: > > Hi I know many people here blog so sorry for the OT. > > > > Currently I have a wordpress install and went I wanted to post some > > code I notice how painfull it is. > > Indeed :-) I'm using the iG:Syntax

Python Distilled

2006-11-05 Thread Simon Wittber
I want to build a Python2.5 interpreter for an embedded system. I only have 4MB of RAM to play with, so I want to really minimise the python binary. Things I can think of removing safely are: - Unicode - Long numbers - Complex number - Compiler / Parser - Thread support - OS specific stuff

Re: Awesome Python Information

2006-11-05 Thread Dave Setchell
On Sun, 05 Nov 2006 17:05:10 -0500, jim-on-linux wrote: > Thanks for the heads up. I spend enough time with > the email without having to chase gosts. > > jim-on-linux > http://www.inqvista.com > > > > > > > On Sunday 05 November 2006 16:39, Paul McGuire > wrote: >> "Brandon" <[EMAIL PR

Re: Pyro stability

2006-11-05 Thread writeson
Irmen, Thanks, you're very good about answering Pyro related questions! Thanks again. I posted a more detailed question to the mailing list describing as best I could how I want to use Pyro and the questions I have in regards to the system described. Doug Irmen de Jong wrote: > writeson wrote:

Re: Is there a way to define a true global across modules?

2006-11-05 Thread alex23
Hendrik van Rooyen wrote: > "robert" <[EMAIL PROTECTED]> wrote: > > Fredrik Lundh wrote: > > > http://www.effbot.org/pyfaq/how-do-i-share-global-variables-across-modules.htm > > Or worse style - if you are too lazy to create a extra global variables > > module > > (ab)use the __main__ module als

Re: wing ide vs. komodo?

2006-11-05 Thread Karlo Lozovina
"vj" <[EMAIL PROTECTED]> wrote in news:1162708898.962171.161120 @e3g2000cwe.googlegroups.com: > The embedded python shell is also a useful feature. Yes, but Debug Probe and Stack Data absolutely rock! Can't live without them anymore. Just set a breakpoint, run your code end then you can inspect

Re: Projecting MUD maps

2006-11-05 Thread [EMAIL PROTECTED]
BJörn Lindqvist wrote: > Hello, I'm looking for an algorithm to project "MUD maps" such as the > following map: http://www.aww-mud.org/maps/MUD_Maps/Caerin-colour.jpg > > MUD:s consists of rooms, each rooms has up to four orthogonal edges > (north, east, west and south) that connects it to another

Re: RAW network programming under Windows

2006-11-05 Thread sturlamolden
billie wrote: > RAW network programming under Windows it's not always possible because > of the security limitations that microsoft introduced in the latest > Windows versions and that affects WinSocket API. > On UNIX systems I'm able to freely send raw packets (for example I'm > able to compile

Re: Projecting MUD maps

2006-11-05 Thread Diez B. Roggisch
BJörn Lindqvist schrieb: > Hello, I'm looking for an algorithm to project "MUD maps" such as the > following map: http://www.aww-mud.org/maps/MUD_Maps/Caerin-colour.jpg > > MUD:s consists of rooms, each rooms has up to four orthogonal edges > (north, east, west and south) that connects it to anoth

SPE editor slow?

2006-11-05 Thread timmy
hello i've been using the SPE editor on a moderately large project and it's constantly pausing during editing, like it's attempting to check something as i edit. as you can imagine a 4 second pause every few characters is EXTREMELY annoying when you just want to get some work done. i really like

Re: forwarding *arg parameter

2006-11-05 Thread Tuomas
Dennis Lee Bieber wrote: > On Sun, 05 Nov 2006 17:42:30 GMT, Tuomas <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > >>I am looking a shorter way to do the above in the case: >> >>def g(*arg): >> return arg >> >>def f(*arg): >> return g(arg) >> >>How can g know if

Re: Programming Language that is Spreadsheet/Table Based

2006-11-05 Thread Ravi Teja
Omar wrote: > I'm looking for a programming language or module that sorta looks and > feels like MS Excel (I love and think in tables), yet has the power and > open-endedness of python or javascript. I'm still pretty new to > python. PyCells http://pycells.pdxcb.net/ http://pycells.pdxcb.net/wiki

Re: Awesome Python Information

2006-11-05 Thread John Machin
Paul McGuire wrote: > "Brandon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Check out: www.ChezBrandon.com > > > By which he means, "do NOT waste your time checking out this ridiculous > website with absolutely no Python whatever anywhere." > (This is the idiot who claims he

Projecting MUD maps

2006-11-05 Thread BJörn Lindqvist
Hello, I'm looking for an algorithm to project "MUD maps" such as the following map: http://www.aww-mud.org/maps/MUD_Maps/Caerin-colour.jpg MUD:s consists of rooms, each rooms has up to four orthogonal edges (north, east, west and south) that connects it to another room. So it is very easy to mode

Re: simple way to un-nest (flatten?) list

2006-11-05 Thread George Sakkis
djc wrote: > There is I am sure an easy way to do this, but I seem to be brain dead > tonight. So: > > I have a table such that I can do > > [line for line in table if line[7]=='JDOC'] > and > [line for line in table if line[7]=='Aslib'] > and > [line for line in table if line[7]=='ASLIB'

Re: Wait for a system command executed in the background

2006-11-05 Thread Brice
On 2006-11-05, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 5 Nov 2006 18:32:39 +0100, Brice ><[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > > >> >> At the time, I have a working solution (not fully developped by >> myself...), but in this solution os.system is used

Re: ANN: PyQt v4.1 Released

2006-11-05 Thread Phil Thompson
On Sunday 05 November 2006 6:00 pm, vj wrote: > > Riverbank Computing is pleased to announce the release of PyQt v4.1 > > available from http://www.riverbankcomputing.co.uk/pyqt/. > > What's the best way to learn pyqt. Do the examples from the book GUI > Programming with Python: QT Edition still wo

Re: tips requested for a log-processing script

2006-11-05 Thread George Sakkis
Jaap wrote: > Apart from this I have a configuration file, which contains the list of > itemID's i need to focus on per month. Not all itemID's are relevant for > each month, but for example only every second or third month. All > records in the logfile with other itemID's can be ignored. I have y

Re: ANN: PyQt v4.1 Released

2006-11-05 Thread Phil Thompson
On Sunday 05 November 2006 7:19 pm, Tool69 wrote: > Thanks Phil, > Can you put some hints about how to build QScintilla2 on Windows please > ? You mean something other than the installation instructions? Phil -- http://mail.python.org/mailman/listinfo/python-list

Re: Awesome Python Information

2006-11-05 Thread jim-on-linux
Thanks for the heads up. I spend enough time with the email without having to chase gosts. jim-on-linux http://www.inqvista.com On Sunday 05 November 2006 16:39, Paul McGuire wrote: > "Brandon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >groups.com... > > > Check out:

simple way to un-nest (flatten?) list

2006-11-05 Thread djc
There is I am sure an easy way to do this, but I seem to be brain dead tonight. So: I have a table such that I can do [line for line in table if line[7]=='JDOC'] and [line for line in table if line[7]=='Aslib'] and [line for line in table if line[7]=='ASLIB'] etc I also have a dictiona

Re: Awesome Python Information

2006-11-05 Thread Paul McGuire
"Brandon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Check out: www.ChezBrandon.com > By which he means, "do NOT waste your time checking out this ridiculous website with absolutely no Python whatever anywhere." (This is the idiot who claims he saved the Congress from some Moss

Re: python GUIs comparison (want)

2006-11-05 Thread Mudcat
Dennis Lee Bieber wrote: > IOWs, eyecandy with no functionality... Sounds like the same mindset > that creates entire web sites using Flash animations such that one /can > not/ access them using a simple fast-loading text modes. > Not exactly. Look...when you're using freeware to compete w

Re: python GUIs comparison (want)

2006-11-05 Thread Paul Rubin
"Mudcat" <[EMAIL PROTECTED]> writes: > > No that would suck. Best to try to stay as close as possible to the > > native widgets on whatever the underlying platform is. If you want > > to depart from the native UI, then start from scratch and write a whole > > new window system with a complete app

Re: NEWBIE: Script help needed

2006-11-05 Thread Lorenzo Thurman
Thanks for the reply, but I know there is something wrong with the command, I'm just not sure how to troubleshoot it. Anyway, I can execute all of the commands from the command line, but only 3 fails when run from within the script. I'll take a look at the link. Nick Vatamaniuc wrote: > If the

[newbie] conditional imports

2006-11-05 Thread John Remfry
  -- No virus found in this outgoing message. Checked by AVG Free Edition. -- http://mail.python.org/mailman/listinfo/python-list

RAW network programming under Windows

2006-11-05 Thread billie
RAW network programming under Windows it's not always possible because of the security limitations that microsoft introduced in the latest Windows versions and that affects WinSocket API. On UNIX systems I'm able to freely send raw packets (for example I'm able to compile IP packets with a src addr

Re: Awesome Python Information

2006-11-05 Thread Terry Reedy
"Brandon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Check out: www.ChezBrandon.com for awesome megalomania having nothing to do with Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get/read Hard disk label / drive label

2006-11-05 Thread Rob Williscroft
Praveen wrote in news:1162752076.121514.313750 @h48g2000cwc.googlegroups.com in comp.lang.python: > I want to read individual disk label > > for Hard disk (C: drive, D: drive disk label) > and > CD-ROM disk label > > Please provide some pointer to the code or document. > You could use: http:/

Re: forwarding *arg parameter

2006-11-05 Thread Tuomas
Stargaming wrote: > Either you take one of the snippets here: > http://aspn.activestate.com/ASPN/search?query=flatten§ion=PYTHONCKBK&type=Subsection > > > or just use arg[0] clever (as mentioned a few times in this thread). Thanks. My solution became: >>> def flattern(arg): ... result = [

question about loading variables from a file...

2006-11-05 Thread avidfan
Can someone offer some advice as to how the best way to approach this might be? I am trying to write a generic python script to build out some applications, so the python script will be generic enough to work for all of them, but it needs to 'source' a file that contains app and environment specif

Re: Programming Language that is Spreadsheet/Table Based

2006-11-05 Thread dug
I think that Gnumeric lets you do some python stuff. Douglas Omar wrote: > I'm looking for a programming language or module that sorta looks and > feels like MS Excel (I love and think in tables), yet has the power and > open-endedness of python or javascript. I'm still pretty new to > python.

Re: ANN: PyQt v4.1 Released

2006-11-05 Thread Tool69
Thanks Phil, Can you put some hints about how to build QScintilla2 on Windows please ? -- http://mail.python.org/mailman/listinfo/python-list

Awesome Python Information

2006-11-05 Thread Brandon
Check out: www.ChezBrandon.com -- http://mail.python.org/mailman/listinfo/python-list

sneak peak: pythonic math in the silicon forest

2006-11-05 Thread [EMAIL PROTECTED]
Greetings Pythoneers: Per usual, I've been walking this talk in Portland "Open Source Capital" Oregon revolving around Python as a math learning language, viewing math as an extensible type system (like Python) with such well-known inhabitants as Vector, Polynomial, Polyhedron and so on. Whereas

Re: forwarding *arg parameter

2006-11-05 Thread Stargaming
Tuomas schrieb: > Tuomas wrote: > >> def g(*arg): >> return arg >> >> def f(*arg): >> return g(arg) >> >> How can g know if it is called directly with (('foo', 'bar'),) or via >> f with ('foo', 'bar'). I coud write in f: return g(arg[0], arg[1]) if >> I know the number of arguments, but

How to get/read Hard disk label / drive label

2006-11-05 Thread Praveen
I want to read individual disk label for Hard disk (C: drive, D: drive disk label) and CD-ROM disk label Please provide some pointer to the code or document. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: finding the list of the matched strings

2006-11-05 Thread John Machin
James Stroud wrote: [snip] > I think I'm having some network problems. I'll try again. Also the > previous "attempt" had a typo (perhaps a freudian slip). Also this time you replied to the wrong thread :-) > > ",".join(some_list). > > By the way, don't name your own objects with the names of bui

Re: maybe this is a print odds

2006-11-05 Thread Peter Otten
pipehappy wrote: > I come this code: > > Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit > (Intel)] on win > 32 > Type "help", "copyright", "credits" or "license" for more information. class He(object): > ... def __str__(self): > ... return "He" > ... hes =

maybe this is a print odds

2006-11-05 Thread pipehappy
I come this code: Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> class He(object): ... def __str__(self): ... return "He" ... >>> hes = [He(),He(),He()] >>> print hes [<__mai

Re: forwarding *arg parameter

2006-11-05 Thread Tuomas
Tuomas wrote: > def g(*arg): > return arg > > def f(*arg): > return g(arg) > > How can g know if it is called directly with (('foo', 'bar'),) or via f > with ('foo', 'bar'). I coud write in f: return g(arg[0], arg[1]) if I > know the number of arguments, but what if I don't know that in

Re: ANN: PyQt v4.1 Released

2006-11-05 Thread vj
> Riverbank Computing is pleased to announce the release of PyQt v4.1 > available from http://www.riverbankcomputing.co.uk/pyqt/. What's the best way to learn pyqt. Do the examples from the book GUI Programming with Python: QT Edition still work? Is the material from the book mostly valid or have

Re: forwarding *arg parameter

2006-11-05 Thread Tuomas
Steven D'Aprano wrote: > You could write something like this: > > def g(*arg): > # Detect the special case of a single tuple argument > if len(arg) == 1 and type(arg[0]) == tuple: > return arg[0] > else: > return arg > > but now tuple arguments are treated differently

python bindings

2006-11-05 Thread Lane Brooks
I have a header file and archive file for a C-api that I would like to interface via python. I tried using SWIG, but I get the error message to compile the object files with the -fPIC option. Since I do not have the source code, I cannot recompile. Can anyone suggest a way to get this C-api into

socket.error.__bases__ = (EnvironmentError,) ?

2006-11-05 Thread robert
I've often trouble catching IO errors in general. Now a frequent case everywhere in an app after I've added a defaultsockettimout. Is this a legal/right practice to change the Exception tree like this: socket.error.__bases__ = (EnvironmentError,) And is there a chance that in future there is a c

Wait for a system command executed in the background

2006-11-05 Thread Brice
Hello I am new to python and I am really a bad programmer... As a linux user, I use quodlibet for listening to music. Quodlibet allows me to write plugins in python. I am trying to write a plugins to burn a playlist by using cdrecord, and this either in dao or tao mode. The basic of this plugi

Re: python GUIs comparison (want)

2006-11-05 Thread Mudcat
Paul Rubin wrote: > > No that would suck. Best to try to stay as close as possible to the > native widgets on whatever the underlying platform is. If you want > to depart from the native UI, then start from scratch and write a whole > new window system with a complete app suite etc. Ok. But ot

Re: forwarding *arg parameter

2006-11-05 Thread Steven D'Aprano
On Sun, 05 Nov 2006 15:26:58 +, Tuomas wrote: > >>> def g(*arg): > ... return arg > ... > >>> g('foo', 'bar') > ('foo', 'bar') > >>> # seems reasonable The function g: - takes the arguments 'foo' and 'bar' - collects them in a tuple named 'arg' = ('foo', 'bar') - returns the tuple name

Re: string to list of numbers conversion

2006-11-05 Thread Peter Otten
[EMAIL PROTECTED] wrote: > This recipe fails when negative numbers are used. > > safe_eval('(12, -12)') > *** Unsafe_Source_Error: Line 1. Unsupported source construct: > compiler.ast.UnarySub > > But, I think it could be easily fixed for somebody who understands the > script. I think that s

Re: disabledforeground or similar for Entry (in Tkinter)

2006-11-05 Thread jim-on-linux
Since others want to see more, Try this, you can make the changes you want to the look of your final output with grid or pack_forget() . root = Tk() class Ktest: def __init__(self): self.Ftest1() def Ftest1(self): try: self.test2.grid_forget()

Re: forwarding *arg parameter

2006-11-05 Thread Stargaming
Tuomas schrieb: > >>> def g(*arg): > ... return arg > ... > >>> g('foo', 'bar') > ('foo', 'bar') > >>> # seems reasonable > ... > >>> g(g('foo', 'bar')) > (('foo', 'bar'),) > >>> # not so good, what g should return to get rid of the outer tuple > > TV Use the following then: >>> g(*g('fo

Re: Really strange behavior

2006-11-05 Thread IloChab
Il Sun, 05 Nov 2006 04:19:36 +1100, Steven D'Aprano ha scritto: > Why don't you add some temporary print statements into your code to try > to narrow it down? > > I did it and I followed the script with the dubugger and what I saw is that it gets lost in the simulate method of QTReactor instead

Re: forwarding *arg parameter

2006-11-05 Thread Tuomas
Diez B. Roggisch wrote: > Tuomas schrieb: > >> >>> def g(*arg): >> ... return arg >> ... >> >>> g('foo', 'bar') >> ('foo', 'bar') >> >>> # seems reasonable >> ... >> >>> g(g('foo', 'bar')) >> (('foo', 'bar'),) >> >>> # not so good, what g should return to get rid of the outer tuple > >

Re: Is there a commas-in-between idiom?

2006-11-05 Thread Ernesto García García
Tim Peters wrote: > More idiomatic as > >if len(list) > 0: > > and even more so as plain > >if list: > >>print list[0], >>for element in list[1:]: >> print ',', element, > > > Do you really want a space before and after each inter-element comma? No, but it was only an e

Re: forwarding *arg parameter

2006-11-05 Thread Diez B. Roggisch
Tuomas schrieb: > >>> def g(*arg): > ... return arg > ... > >>> g('foo', 'bar') > ('foo', 'bar') > >>> # seems reasonable > ... > >>> g(g('foo', 'bar')) > (('foo', 'bar'),) > >>> # not so good, what g should return to get rid of the outer tuple g(*g('foo', 'bar')) * and ** are the syme

forwarding *arg parameter

2006-11-05 Thread Tuomas
>>> def g(*arg): ... return arg ... >>> g('foo', 'bar') ('foo', 'bar') >>> # seems reasonable ... >>> g(g('foo', 'bar')) (('foo', 'bar'),) >>> # not so good, what g should return to get rid of the outer tuple TV -- http://mail.python.org/mailman/listinfo/python-list

Re: string to list of numbers conversion

2006-11-05 Thread bearophileHUGS
[EMAIL PROTECTED] wrote: > Hi, > I have a string '((1,2), (3,4))' and I want to convert this into a > python tuple of numbers. But I do not want to use eval() because I do > not want to execute any code in that string and limit it to list of > numbers. > Is there any alternative way? This is

Re: Trouble compiling win32all on Windows

2006-11-05 Thread robert
Ross Ridge wrote: > robert wrote: >> I've trouble compiling win32all. VC98 and latest SDK installed >> (otherwise with original SDK it won't even compile). >> It tells that uuid.lib(cguid_i.obj) : fatal error LNK1103: debug info >> is destroyed. > > The library isn't compatable with the compiler y

Re: Event driven server that wastes CPU when threaded doesn't

2006-11-05 Thread Snor
> You got a lot of long-winded replies, but the short reply is that > Twisted has packaged solutions for this. > Seehttp://twistedmatrix.com/projects/core/enterprise > > "Twisted provides an interface to any Python DB-API 2.0 compliant > database through an asynchronous interface which allows da

ANN: PyQt v4.1 Released

2006-11-05 Thread Phil Thompson
Riverbank Computing is pleased to announce the release of PyQt v4.1 available from http://www.riverbankcomputing.co.uk/pyqt/. The highlights of this release include: - support for Qt v4.2 including QGraphicsView and related classes, the undo framework, widget stylesheets, and integration with G

Re: string to list of numbers conversion

2006-11-05 Thread [EMAIL PROTECTED]
Peter, Thanks. This recipe fails when negative numbers are used. safe_eval('(12, -12)') *** Unsafe_Source_Error: Line 1. Unsupported source construct: compiler.ast.UnarySub But, I think it could be easily fixed for somebody who understands the script. Can somebody help. Thanks. Suresh Peter O

ANN: SIP v4.5 Released

2006-11-05 Thread Phil Thompson
Riverbank Computing is pleased to announce the release of SIP v4.5 available from http://www.riverbankcomputing.co.uk/sip/. SIP is a tool for generating Python modules that wrap C or C++ libraries. It is similar to SWIG. It is used to generate PyQt and PyKDE. Full documentation is available

Re: Is there a commas-in-between idiom?

2006-11-05 Thread Tim Peters
]Ernesto García García] > it's very common that I have a list and I want to print it with commas > in between. How do I do this in an easy manner, whithout having the > annoying comma in the end? > > > > list = [1,2,3,4,5,6] > > # the easy way > for element in list: >print element, ',', > > pr

Re: Is there a commas-in-between idiom?

2006-11-05 Thread Ernesto García García
Ernesto García García wrote: > Hi experts, > > it's very common that I have a list and I want to print it with commas > in between. How do I do this in an easy manner, whithout having the > annoying comma in the end? > > > > list = [1,2,3,4,5,6] > > # the easy way > for element in list: >

Re: finding the list of the matched strings

2006-11-05 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Hi, I have a list of strings. And I want to find the subset which > matches a particular regular expression. > > import re > ll = ('a', 'b', 's1', 's2', '3s') > p = re.compile('^s.*') > newList = filter(lambda s: p.match(s), ll) or newList = [s for s in ll if p.match(

Re: finding the list of the matched strings

2006-11-05 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > Hi, I have a list of strings. And I want to find the subset which > matches a particular regular expression. > > import re > ll = ('a', 'b', 's1', 's2', '3s') > p = re.compile('^s.*') > newList = filter(lambda s: p.match(s), ll) > > I suppose there should be simple funct

Re: Is there a commas-in-between idiom?

2006-11-05 Thread James Stroud
Ernesto García García wrote: > Hi experts, > > it's very common that I have a list and I want to print it with commas > in between. How do I do this in an easy manner, whithout having the > annoying comma in the end? > > > > list = [1,2,3,4,5,6] > > # the easy way > for element in list: >

Re: finding the list of the matched strings

2006-11-05 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hi, I have a list of strings. And I want to find the subset which > matches a particular regular expression. > > import re > ll = ('a', 'b', 's1', 's2', '3s') > p = re.compile('^s.*') > newList = filter(lambda s: p.match(s), ll) > > I suppose there should be simple func

Re: finding the list of the matched strings

2006-11-05 Thread Christian Joergensen
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Hi, I have a list of strings. And I want to find the subset which > matches a particular regular expression. > > import re > ll = ('a', 'b', 's1', 's2', '3s') > p = re.compile('^s.*') > newList = filter(lambda s: p.match(s), ll) > > I suppose there

Re: Is there a commas-in-between idiom?

2006-11-05 Thread Peter Otten
Ernesto García García wrote: > it's very common that I have a list and I want to print it with commas > in between. How do I do this in an easy manner, whithout having the > annoying comma in the end? >>> items = [1, 2, 3, "many"] >>> print ", ".join(str(item) for item in items) 1, 2, 3, many Pe

Re: Is there a commas-in-between idiom?

2006-11-05 Thread Christian Joergensen
Ernesto García García <[EMAIL PROTECTED]> writes: > Hi experts, > > it's very common that I have a list and I want to print it with commas > in between. How do I do this in an easy manner, whithout having the > annoying comma in the end? >>> list = [1,2,3,4,5,6] >>> print ','.join(map(str, list))

Re: string to list of numbers conversion

2006-11-05 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I have a string '((1,2), (3,4))' and I want to convert this into a > python tuple of numbers. But I do not want to use eval() because I do > not want to execute any code in that string and limit it to list of > numbers. > Is there any alternative way? http://aspn.ac

Re: string to list of numbers conversion

2006-11-05 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > Hi, > I have a string '((1,2), (3,4))' and I want to convert this into a > python tuple of numbers. But I do not want to use eval() because I do > not want to execute any code in that string and limit it to list of > numbers. > Is there any alternative way? Python

finding the list of the matched strings

2006-11-05 Thread [EMAIL PROTECTED]
Hi, I have a list of strings. And I want to find the subset which matches a particular regular expression. import re ll = ('a', 'b', 's1', 's2', '3s') p = re.compile('^s.*') newList = filter(lambda s: p.match(s), ll) I suppose there should be simple function to do this in re module. Is there any?

Re: tips requested for a log-processing script

2006-11-05 Thread martdi
if you are running in windows you can use the win32com module to automate the process of generating a pivot table in excel and then code to send it via e-mail Jaap wrote: > Python ers, > As a relatively new user of Python I would like to ask your advice on > the following script I want to create

Is there a commas-in-between idiom?

2006-11-05 Thread Ernesto García García
Hi experts, it's very common that I have a list and I want to print it with commas in between. How do I do this in an easy manner, whithout having the annoying comma in the end? list = [1,2,3,4,5,6] # the easy way for element in list: print element, ',', print # this is what I really w

string to list of numbers conversion

2006-11-05 Thread [EMAIL PROTECTED]
Hi, I have a string '((1,2), (3,4))' and I want to convert this into a python tuple of numbers. But I do not want to use eval() because I do not want to execute any code in that string and limit it to list of numbers. Is there any alternative way? Thanks. Suresh -- http://mail.python.org/mai

Re: python GUIs comparison (want)

2006-11-05 Thread timmy
Mudcat wrote: > When you say far better widgets, do you mean that it has a greater > number of widgets to choose from, or that the types of widgets are > basically the same but have a greater amount of flexibility in them? by better i mean more of them to choose from and the functionality they p

Re: ANN: SE 2.3. Available now

2006-11-05 Thread Tim Chase
> nah, if you've spent more than five minutes on c.l.python lately, you'd > noticed that it's the Solution to Everything (up there with pyparsing, I > think). SE would be the Solution to Everything. pyparsing Provides Your Perfect Alternative where Regexp Syntax Is No Good. The "re" module is

Re: Pyro stability

2006-11-05 Thread Irmen de Jong
writeson wrote: [some questions about Pyro] I've replied to this on Pyro's mailing list. -Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: small python cgi webserver

2006-11-05 Thread Norbert Kaufmann
Fabian Braennstroem wrote: [...] >>In your response (cgi-script) you have to divide the header from the >>content '\r\n\r\n'. > > > I am not sure, what that means!? ... but it works :-) > We are talking about HTTP, take a look at the HTTP response in version 1.1: http://www.w3.org/Protocols/rf

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-05 Thread Martin v. Löwis
Paul Rubin schrieb: > I dunno about x86 hardware signals but these instructions do > read-modify-write operaitons. That means there has to be enough > interlocking to prevent two cpu's from updating the same memory > location simultaneously, which means the CPU's have to communicate. > See

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-05 Thread Ross Ridge
Paul Rubin wrote: > I dunno about x86 hardware signals but these instructions do > read-modify-write operaitons. That means there has to be enough > interlocking to prevent two cpu's from updating the same memory > location simultaneously, which means the CPU's have to communicate. > See

tips requested for a log-processing script

2006-11-05 Thread Jaap
Python ers, As a relatively new user of Python I would like to ask your advice on the following script I want to create. I have a logfile which contains records. All records have the same layout, and are stored in a CSV-format. Each record is (non-uniquely) identified by a date and a itemID. Ea

Re: WSDL?

2006-11-05 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > CORBA may work fine in an intranet environment, where you can control > the server and the client, but it clearly failed to be a popular choice > on the internet: have you seen any company offering webservices with a > CORBA interface?? The OP wa

Re: NEWBIE: Script help needed

2006-11-05 Thread Nick Vatamaniuc
If the other commands work but 3) doesn't, it means there is something different (wrong?) with the command. So try running 3) , then one of the other ones and see the difference. The getCommandOutput() , I suspect, just waits for the data from the actual command and the command is not returnin

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-05 Thread Paul Rubin
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > > I think that has to be on a single processor, or at most a dual core > > processor with shared cache on die. With multiple cpu chips I don't > > think can get the signals around that fast. > > Can you explain what you mean? The lock# signal takes

Re: Programming Language that is Spreadsheet/Table Based

2006-11-05 Thread Hendrik van Rooyen
"James Stroud" <[EMAIL PROTECTED]> wrote: > Gerard Flanagan wrote: 8<-- > Thank you, this is very good stuff to think about. > > James I can't really add to the above train of thought... And I don't know if this will help - but if you want to think,

Re: python to sharepoint ?

2006-11-05 Thread David
You might want to check out IronPython: http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython It's a port of the .NET FW for Python, which probably exposes the API you'll need. -David curtin wrote: > anyone have code that allows me to post files direct to sharepoint from > python? > >