Re: QPaintDevice: Must construct a QApplication before a QPaintDevice

2007-02-28 Thread boris . smirnov
On Feb 28, 10:45 am, Phil Thompson <[EMAIL PROTECTED]>
wrote:
> On Wednesday 28 February 2007 9:26 am, [EMAIL PROTECTED] wrote:
>
>
>
>
>
> > On Feb 28, 10:22 am, Phil Thompson <[EMAIL PROTECTED]>
>
> > wrote:
> > > On Wednesday 28 February 2007 9:00 am, [EMAIL PROTECTED] wrote:
> > > > On Feb 28, 9:07 am, [EMAIL PROTECTED] wrote:
> > > > > On Feb 28, 8:56 am, Phil Thompson <[EMAIL PROTECTED]>
>
> > > > > wrote:
> > > > > > On Tuesday 27 February 2007 11:09 pm, shredwheat wrote:
> > > > > > > When your programs stops with the error, it should also be
> > > > > > > printing a stack trace. This is a list of all the functions that
> > > > > > > have been called when Python had the problem.
>
> > > > > > > You shouldn't have to do anything extra to get the stack trace.
>
> > > > > > The error is raised in Qt and aborts immediately. It never gets
> > > > > > back to Python to generate a trace.
>
> > > > > > He needs to produce a short and complete test which demonstrates
> > > > > > the problem, then we can point out where the QPaintDevice is being
> > > > > > created.
>
> > > > > > Phil
>
> > > > > OK, but before I do a complete test, could anybody tell/explain me
> > > > > why the same file is working on Windows?
> > > > > Did anybody already meet with something similar Win vs. Linux?
>
> > > > > b.
>
> > > > Here is my simple script:
>
> > > > import sys
> > > > from qt import *
> > > > class Optimizer(QWidget):
> > > >def __init__(self, parent = 0):
> > > >   QWidget.__init__(self)
> > > >   QGridLayout(self)
> > > > if __name__ == '__main__':
> > > >a = QApplication (sys.argv)
> > > >mywidget = Optimizer()
> > > >a.exec_loop()
>
> > > > This produces this:
> > > > > python qt_script_bs_070228.py
>
> > > > QPaintDevice: Must construct a QApplication before a QPaintDevice
>
> > > > Any suggestions here?
>
> > > It works fine for me.
>
> > > > Thanks
>
> > > > BTW: One question:
> > > > when I use "import qt" instead of "from qt import *" I get this error:
> > > > Traceback (most recent call last):
> > > >   File "mscarideidtool_bs_070228.py", line 4, in ?
> > > > class Optimizer(QWidget):
> > > > NameError: name 'QWidget' is not defined
>
> > > > What is the difference between "import qt" and "from qt import *" ? I
> > > > thought that these are the same.
>
> > > The first creates a new namespace called "qt" and imports the module's
> > > objects into it. To reference those objects you have to include the
> > > namespace name.
>
> > > The second imports the module's objects into the current namespace.
>
> > > Phil- Hide quoted text -
>
> > > - Show quoted text -
>
> > OK, I have to apologize because I didn't mention that I use python
> > version 2.2.1, could it be the problem here? Bugs or something? I have
> > to use this version since it was delivered with a software that we use
> > here.
>
> So what versions of Qt, PyQt and SIP are you using? Were these included with
> the software you are using? If so, what is that software?
>
> Phil- Hide quoted text -
>
> - Show quoted text -

Stupid question but how can I find out what are the versions of those?
I only found qt.py file and there was this:
# Generated by SIP 3.3 (build 25) on Fri Jul 26 12:44:13 2002
The version of PyQt and SIP can't find out, but there is a directory
PyQt wit .pyc files and SIP.h file.

The sofware is MSC.ADAMS from msc.software

b.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: QPaintDevice: Must construct a QApplication before a QPaintDevice

2007-02-28 Thread boris . smirnov
On Feb 28, 10:22 am, Phil Thompson <[EMAIL PROTECTED]>
wrote:
> On Wednesday 28 February 2007 9:00 am, [EMAIL PROTECTED] wrote:
>
>
>
>
>
> > On Feb 28, 9:07 am, [EMAIL PROTECTED] wrote:
> > > On Feb 28, 8:56 am, Phil Thompson <[EMAIL PROTECTED]>
>
> > > wrote:
> > > > On Tuesday 27 February 2007 11:09 pm, shredwheat wrote:
> > > > > When your programs stops with the error, it should also be printing a
> > > > > stack trace. This is a list of all the functions that have been
> > > > > called when Python had the problem.
>
> > > > > You shouldn't have to do anything extra to get the stack trace.
>
> > > > The error is raised in Qt and aborts immediately. It never gets back to
> > > > Python to generate a trace.
>
> > > > He needs to produce a short and complete test which demonstrates the
> > > > problem, then we can point out where the QPaintDevice is being created.
>
> > > > Phil
>
> > > OK, but before I do a complete test, could anybody tell/explain me why
> > > the same file is working on Windows?
> > > Did anybody already meet with something similar Win vs. Linux?
>
> > > b.
>
> > Here is my simple script:
>
> > import sys
> > from qt import *
> > class Optimizer(QWidget):
> >def __init__(self, parent = 0):
> >   QWidget.__init__(self)
> >   QGridLayout(self)
> > if __name__ == '__main__':
> >a = QApplication (sys.argv)
> >mywidget = Optimizer()
> >a.exec_loop()
>
> > This produces this:
> > > python qt_script_bs_070228.py
>
> > QPaintDevice: Must construct a QApplication before a QPaintDevice
>
> > Any suggestions here?
>
> It works fine for me.
>
> > Thanks
>
> > BTW: One question:
> > when I use "import qt" instead of "from qt import *" I get this error:
> > Traceback (most recent call last):
> >   File "mscarideidtool_bs_070228.py", line 4, in ?
> > class Optimizer(QWidget):
> > NameError: name 'QWidget' is not defined
>
> > What is the difference between "import qt" and "from qt import *" ? I
> > thought that these are the same.
>
> The first creates a new namespace called "qt" and imports the module's objects
> into it. To reference those objects you have to include the namespace name.
>
> The second imports the module's objects into the current namespace.
>
> Phil- Hide quoted text -
>
> - Show quoted text -

OK, I have to apologize because I didn't mention that I use python
version 2.2.1, could it be the problem here? Bugs or something? I have
to use this version since it was delivered with a software that we use
here.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: QPaintDevice: Must construct a QApplication before a QPaintDevice

2007-02-28 Thread boris . smirnov
On Feb 28, 9:07 am, [EMAIL PROTECTED] wrote:
> On Feb 28, 8:56 am, Phil Thompson <[EMAIL PROTECTED]>
> wrote:
>
> > On Tuesday 27 February 2007 11:09 pm, shredwheat wrote:
>
> > > When your programs stops with the error, it should also be printing a
> > > stack trace. This is a list of all the functions that have been called
> > > when Python had the problem.
>
> > > You shouldn't have to do anything extra to get the stack trace.
>
> > The error is raised in Qt and aborts immediately. It never gets back to 
> > Python
> > to generate a trace.
>
> > He needs to produce a short and complete test which demonstrates the 
> > problem,
> > then we can point out where the QPaintDevice is being created.
>
> > Phil
>
> OK, but before I do a complete test, could anybody tell/explain me why
> the same file is working on Windows?
> Did anybody already meet with something similar Win vs. Linux?
>
> b.

Here is my simple script:

import sys
from qt import *
class Optimizer(QWidget):
   def __init__(self, parent = 0):
  QWidget.__init__(self)
  QGridLayout(self)
if __name__ == '__main__':
   a = QApplication (sys.argv)
   mywidget = Optimizer()
   a.exec_loop()

This produces this:
> python qt_script_bs_070228.py
QPaintDevice: Must construct a QApplication before a QPaintDevice

Any suggestions here?
Thanks



BTW: One question:
when I use "import qt" instead of "from qt import *" I get this error:
Traceback (most recent call last):
  File "mscarideidtool_bs_070228.py", line 4, in ?
class Optimizer(QWidget):
NameError: name 'QWidget' is not defined

What is the difference between "import qt" and "from qt import *" ? I
thought that these are the same.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: QPaintDevice: Must construct a QApplication before a QPaintDevice

2007-02-28 Thread boris . smirnov
On Feb 28, 8:56 am, Phil Thompson <[EMAIL PROTECTED]>
wrote:
> On Tuesday 27 February 2007 11:09 pm, shredwheat wrote:
>
> > When your programs stops with the error, it should also be printing a
> > stack trace. This is a list of all the functions that have been called
> > when Python had the problem.
>
> > You shouldn't have to do anything extra to get the stack trace.
>
> The error is raised in Qt and aborts immediately. It never gets back to Python
> to generate a trace.
>
> He needs to produce a short and complete test which demonstrates the problem,
> then we can point out where the QPaintDevice is being created.
>
> Phil

OK, but before I do a complete test, could anybody tell/explain me why
the same file is working on Windows?
Did anybody already meet with something similar Win vs. Linux?

b.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: QPaintDevice: Must construct a QApplication before a QPaintDevice

2007-02-27 Thread boris . smirnov

shredwheat napísal(a):
> On Feb 27, 3:35 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> > I don't see any QPaintDevice here. Where does that come from? You need to
> > give more information, a stack trace and a reduced example exhibiting the
> > behaviour.
>
> QWidget is derived from QPaintDevice, under Qt, no widgets can be
> instantiated before the QApplication.
>
> This source snippet looks like it should be working. If the exception
> is happening inside Optimizer() than something really unsusual is
> happening. I suspect there is python code somewhere else happening at
> import time that is creating a widget. The exception traceback should
> show you right where that would be.

Thanks for the reply.
I'm not so familiar with python so could you explain me how to use and
become the exception traceback. I've tried today to read something for
the beginners about traceback and stack trace in the forum, but I
haven't found something really understadable for met.
Some piece of code for my case will help :) and I want to learn it of
course.

Thanks.
Boris

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: QPaintDevice: Must construct a QApplication before a QPaintDevice

2007-02-27 Thread boris . smirnov
On Feb 27, 11:56 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> > Yes that I can deduce, but why I'm asking is why it's different on
> > Windows and Linux. Should it not be platform independent?
>
> It should be. I've got no idea why it seems to work on windows but I can say
> one thing for sure: that would be an artifact that you shouldn't rely on.
> In Qt, you _always_ need a QApplication for anything. So just do as it
> requires you to do: first, construct a QApplication. Then things will work.
>
> Diez

Hmm, as I see the code, I do construct QApplication as first

if __name__ == '__main__':
  a = QApplication (sys.argv)
  mywidget = Optimizer()
  a.setMainWidget (mywidget)
  mywidget.show()
  Update_StatusLine(mywidget)
  mywidget.setStartconfig()
  a.exec_loop ()

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: QPaintDevice: Must construct a QApplication before a QPaintDevice

2007-02-27 Thread boris . smirnov
On Feb 27, 11:46 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Hi all,
>
> > I have a python script that works without any problem on Windows but
> > with error:
>
> > QPaintDevice: Must construct a QApplication before a QPaintDevice
>
> > on Linux.
>
> > Where could be the problem?
>
> This is the problem:
>
> You Must construct a QApplication before a QPaintDevice
>
> Diez

Yes that I can deduce, but why I'm asking is why it's different on
Windows and Linux. Should it not be platform independent?

-- 
http://mail.python.org/mailman/listinfo/python-list


QPaintDevice: Must construct a QApplication before a QPaintDevice

2007-02-27 Thread boris . smirnov
Hi all,

I have a python script that works without any problem on Windows but
with error:

QPaintDevice: Must construct a QApplication before a QPaintDevice

on Linux.

Where could be the problem?

Thanks.
Boris

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Interactive os.environ vs. os.environ in script

2007-02-27 Thread boris . smirnov
On Feb 27, 10:33 am, Peter Otten <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > On Feb 27, 9:31 am, Peter Otten <[EMAIL PROTECTED]> wrote:
> >> [EMAIL PROTECTED] wrote:
> >> > Is there another possibility of how to solve it just by adding some
> >> > lines in script?
>
> >> I think you have to wrap your script in a shell script
>
> >> #!/bin/sh
> >> export LD_LIBRARY_PATH=/path/Linux/rh_linux
> >> python shrink_bs_070226.py
>
> >> To avoid that you can have the python script invoke itself, e. g.:
>
> >> #!/usr/bin/env python
> >> import os
> >> if os.environ.get("YADDA") != "whatever":
> >> print "fix environment"
> >> os.environ["YADDA"] = "whatever"
> >> os.system("yadda.py")
> >> raise SystemExit
>
> >> print "YADDA is now %r" % os.environ["YADDA"]
> >> print "do your real stuff"
>
> >> Peter
>
> > Thanks for the reply.
>
> > If I that good understood I did this:
> > **
> > import sys, re, glob, shutil
> > import os
>
> > if os.environ["LD_LIBRARY_PATH"].count('/path/Linux/rh_linux') !=1:
> >os.environ["LD_LIBRARY_PATH"]=os.environ["LD_LIBRARY_PATH"]+':'+'/
> > path/Linux/rh_linux'
> >os.system("shrink_bs_070226.py")
> >raise SystemExit
>
> > from qt import *
> > ***
>
> > Is that correct. If yes then it not works. If not then, what's wrong?
>
> I don't know. You are not quoting the actual code you are using (from qt
> import * is definitely not in line 29, and the #!/path/to/your/python is
> missing). Do you have more than one python version installed? then you may
> have to put
>
> #!/usr/bin/python2.2
>
> or similar in the first line of your script.
>
> Peter- Hide quoted text -
>
> - Show quoted text -

Probably I understood it not correctly. What did you mean was to put
that code into my python script "shrink_bs_070226.py" and then calls
script itself?

So I took my script "shrink_bs_070226.py" and it starts with:
**
#!/usr/bin/env python
import sys, re, glob, shutil
import os

then I put your code in that script

if os.environ["LD_LIBRARY_PATH"].count('/path/Linux/rh_linux') !=1:
   os.environ["LD_LIBRARY_PATH"]=os.environ["LD_LIBRARY_PATH"]+':'+'/
path/Linux/rh_linux'
   os.system("shrink_bs_070226.py")
   raise SystemExit

and here continues my script:

from qt import *

.
***

Is it correct?

BTW: On lines 3:18 I have comments, script description and
modifications, therefore is "from qt import *" on the line 29



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Interactive os.environ vs. os.environ in script

2007-02-27 Thread boris . smirnov
On Feb 27, 9:31 am, Peter Otten <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Is there another possibility of how to solve it just by adding some
> > lines in script?
>
> I think you have to wrap your script in a shell script
>
> #!/bin/sh
> export LD_LIBRARY_PATH=/path/Linux/rh_linux
> python shrink_bs_070226.py
>
> To avoid that you can have the python script invoke itself, e. g.:
>
> #!/usr/bin/env python
> import os
> if os.environ.get("YADDA") != "whatever":
> print "fix environment"
> os.environ["YADDA"] = "whatever"
> os.system("yadda.py")
> raise SystemExit
>
> print "YADDA is now %r" % os.environ["YADDA"]
> print "do your real stuff"
>
> Peter

Thanks for the reply.

If I that good understood I did this:
**
import sys, re, glob, shutil
import os


if os.environ["LD_LIBRARY_PATH"].count('/path/Linux/rh_linux') !=1:
   os.environ["LD_LIBRARY_PATH"]=os.environ["LD_LIBRARY_PATH"]+':'+'/
path/Linux/rh_linux'
   os.system("shrink_bs_070226.py")
   raise SystemExit

from qt import *
***

Is that correct. If yes then it not works. If not then, what's wrong?

> python shrink_bs_070226.py

Traceback (most recent call last):
  File "./shrink_bs_070226.py", line 29, in ?
from qt import *
ImportError: No module named qt

Thanks
Boris

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Interactive os.environ vs. os.environ in script

2007-02-26 Thread boris . smirnov
On Feb 26, 5:44 pm, Thinker <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
>
>
>
> [EMAIL PROTECTED] wrote:
>
> > OK then I have to reformulate my question. :)
>
> > In my script I have a line with
>
> > os.environ["LD_LIBRARY_PATH"]='/path/Linux/rh_linux'
>
> > but this line didn't work. But when I set this environment variable
> > in Linux shell it works. Here is a small example.
>
> >> python shrink_bs_070226.py
> > Traceback (most recent call last): File "shrink_bs_070226.py", line
> > 25, in ? from qt import * File
> > "/path/Linux/python/rh_linux/lib/python2.2/site-packages/ qt.py",
> > line 46, in ? import libsip ImportError: libadamsqt.so: cannot open
> > shared object file: No such file or directory
>
> ld-elf.so reads environment variables when it was loaded.
> It never reads environment variables again!
> That you setting environment in the process does not make link-editor
> to re-read environment variable and take effect.
>
> To resolve the problem, you can try to add the path to sys.path.
>
> - --
> Thinker Li - [EMAIL PROTECTED] [EMAIL 
> PROTECTED]://heaven.branda.to/~thinker/GinGin_CGI.py
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.6 (FreeBSD)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org
>
> iD8DBQFF4w6H1LDUVnWfY8gRAoI0AKCLikYsFU2N6aaOZFDd1L2KY8DjqACg3QQn
> KsEEcrvpw1CktEkVCKe/ojk=
> =EQG6
> -END PGP SIGNATURE-- Hide quoted text -
>
> - Show quoted text -

Hi,
thanks for the tip, but it didn't help.

I used:
sys.path.append('/path/Linux/rh_linux')

and the problem still persists:

Traceback (most recent call last):
  File "shrink_bs_070226.py", line 26, in ?
from qt import *
  File "/path/Linux/python/rh_linux/lib/python2.2/site-packages/
qt.py", line 46, in ?
import libsip
ImportError: libadamsqt.so: cannot open shared object file: No such
file or directory

Is there another possibility of how to solve it just by adding some
lines in script?

Thanks
Boris

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Interactive os.environ vs. os.environ in script

2007-02-26 Thread boris . smirnov
On Feb 26, 4:32 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Hi there,
>
> > I have a problem with setting environment variable in my script that
> > uses qt library. For this library I have to define a path to tell the
> > script whre to find it.
>
> > I have a script called "shrink_bs_070226" that looks like this:
> > **
> > import sys, re, glob, shutil
> > import os
>
> > os.environ["LD_LIBRARY_PATH"]='/path/Linux/rh_linux'
>
> > from qt import *
> > ***
>
> > When I run this script I get this error:
>
> >> python shrink_bs_070226.py
> > Traceback (most recent call last):
> >   File "shrink_bs_070226.py", line 25, in ?
> > from qt import *
> >   File "/path/Linux/python/rh_linux/lib/python2.2/site-packages/
> > qt.py", line 46, in ?
> > import libsip
> > ImportError: libadamsqt.so: cannot open shared object file: No such
> > file or directory
>
> > What is important here that when I set this variable interactive in
> > python session, there is no problem with import.
>
> >> python
> > Python 2.2.3 (#1, Aug  8 2003, 08:44:02)
> > [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-13)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
>  import os
>
>  import shrink_bs_070226
> > Traceback (most recent call last):
> >   File "", line 1, in ?
> >   File "shrink_bs_070226.py", line 25, in ?
> > from qt import *
> > ImportError: No module named qt
>
>  os.environ["LD_LIBRARY_PATH"]='/path/Linux/rh_linux'
>
>  import shrink_bs_070226
>
> > Could anybody explain me the logic here? Am I missing something?
>
> Until Python 2.4 a failed import could leave some debris which would make
> you think a second import did succeed.
>
> Try
>
> >>> import os
> >>> os.environ["LD_LIBRARY_PATH"]='/path/Linux/rh_linux'
> >>> import shrink_bs_070226 # I expect that to fail
>
> in a fresh interpreter to verify that what you see is an artifact of your
> test method.
>
> Peter- Hide quoted text -
>
> - Show quoted text -

You are right:

 > python
Python 2.2.3 (#1, Aug  8 2003, 08:44:02)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import  os

>>> os.environ["LD_LIBRARY_PATH"]='/path/Linux/rh_linux'

>>> import shrink_bs_070226
Traceback (most recent call last):
  File "", line 1, in ?
  File "shrink_bs_070226.py", line 25, in ?
from qt import *
ImportError: No module named qt
>>>

OK then I have to reformulate my question. :)

In my script I have a line with

os.environ["LD_LIBRARY_PATH"]='/path/Linux/rh_linux'

but this line didn't work.
But when I set this environment variable in Linux shell it works. Here
is a small example.

> python shrink_bs_070226.py
Traceback (most recent call last):
  File "shrink_bs_070226.py", line 25, in ?
from qt import *
  File "/path/Linux/python/rh_linux/lib/python2.2/site-packages/
qt.py", line 46, in ?
import libsip
ImportError: libadamsqt.so: cannot open shared object file: No such
file or directory

> setenv LD_LIBRARY_PATH /path/Linux/rh_linux

> python shrink_bs_070226.py

Starting Script "Shrinker" 

Why it's not working in script with command

os.environ["LD_LIBRARY_PATH"]='/path/Linux/rh_linux'

but in shell it works?

I hope it's understandable. :)
Thanks,
boris

-- 
http://mail.python.org/mailman/listinfo/python-list


Interactive os.environ vs. os.environ in script

2007-02-26 Thread boris . smirnov
Hi there,

I have a problem with setting environment variable in my script that
uses qt library. For this library I have to define a path to tell the
script whre to find it.

I have a script called "shrink_bs_070226" that looks like this:
**
import sys, re, glob, shutil
import os

os.environ["LD_LIBRARY_PATH"]='/path/Linux/rh_linux'

from qt import *
***

When I run this script I get this error:


> python shrink_bs_070226.py
Traceback (most recent call last):
  File "shrink_bs_070226.py", line 25, in ?
from qt import *
  File "/path/Linux/python/rh_linux/lib/python2.2/site-packages/
qt.py", line 46, in ?
import libsip
ImportError: libadamsqt.so: cannot open shared object file: No such
file or directory

What is important here that when I set this variable interactive in
python session, there is no problem with import.

> python
Python 2.2.3 (#1, Aug  8 2003, 08:44:02)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os

>>> import shrink_bs_070226
Traceback (most recent call last):
  File "", line 1, in ?
  File "shrink_bs_070226.py", line 25, in ?
from qt import *
ImportError: No module named qt

>>> os.environ["LD_LIBRARY_PATH"]='/path/Linux/rh_linux'

>>> import shrink_bs_070226
>>>

Could anybody explain me the logic here? Am I missing something?
Thank in advance.
Rg
Boris

-- 
http://mail.python.org/mailman/listinfo/python-list


calling python from msc.adams

2007-02-07 Thread boris . smirnov
Hello all,

i need to call python from msc.adams.
the syntax is
"mdi -c python exit"
I have created a linux script called "run_python" with this content:
mdi -c python $* exit

then a call this script with a command:

run_python script.py param1 param2  paramN

Everything looks OK, but the problem is that also the last "exit"
parameter in run_python script is taken as an input into script.py
together with param1 param2  paramN. But I need this exit
parameter not to send to python but to mdi.

Is there anybody who could give me any hint of how to do it?
Thank you very much.
Regards,
Boris

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: extract text from a string

2006-11-09 Thread boris . smirnov
Thank you very much.
I needed this kick. :)
Rg,
Boris


Grant Edwards napísal(a):
> On 2006-11-09, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Hallo all,
> >
> > I have tried for a couple of hours to solve my problem with re but I
> > have no success.
> >
> > I have a string containing: "+abc_cde.fgh_jkl\n" and what I need to
> > become is "abc_cde.fgh_jkl".  Could anybody be so kind and write me a
> > code of how to extract this text from that string?
>
> >>> s = "+abc_cde.fgh_jkl\n"
> >>> s[1:-1]
> 'abc_cde.fgh_jkl'
>
> --
> Grant Edwards   grante Yow!  ... I think I'm
>   at   having an overnight
>visi.comsensation right now!!

-- 
http://mail.python.org/mailman/listinfo/python-list

extract text from a string

2006-11-09 Thread boris . smirnov
Hallo all,

I have tried for a couple of hours to solve my problem with re but I
have no success.

I have a string containing: "+abc_cde.fgh_jkl\n" and what I need to
become is "abc_cde.fgh_jkl".  Could anybody be so kind and write me a
code of how to extract this text from that string?

thank you very much in advance
regards,
boris

-- 
http://mail.python.org/mailman/listinfo/python-list