Re: os.path.realpath(path) bug on win7 ?

2013-01-05 Thread Chris Rebert
On Sat, Jan 5, 2013 at 10:55 PM, iMath <2281570...@qq.com> wrote: > > os.path.realpath(path) bug on win7 ? > > Temp.link is a Symbolic link > Its target location is C:\test\test1 > But > >>> os.path.realpath(r'C:\Users\SAMSUNG\Temp.link\test2') > 'C:\\Users\\SAMSUNG\\Temp.link\\test2' > > I though

os.path.realpath(path) bug on win7 ?

2013-01-05 Thread iMath
os.path.realpath(path)  bug on win7 ?Temp.link is a Symbolic linkIts target location is C:\test\test1But >>> os.path.realpath(r'C:\Users\SAMSUNG\Temp.link\test2')'C:\\Users\\SAMSUNG\\Temp.link\\test2'I thought the return value should be ' C:\\test\\test1\\test2'Is it a bug ? anyone can clear it to

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Mitya Sirenef
On 01/05/2013 03:35 AM, Sia wrote: I have strings such as: > > tA.-2AG.-2AG,-2ag > or > .+3ACG.+5CAACG.+3ACG.+3ACG > > The plus and minus signs are always followed by a number (say, i). I want python to find each single plus or minus, remove the sign, the number after it and remove i character

SOLUTIONS MANUAL TO A Course in Modern Mathematical Physics by Peter Szekeres

2013-01-05 Thread reganrexman
I have solutions manuals to all problems and exercises in these textbooks. To get one in an electronic format contact me at: reganrexman(at)gmail(dot)com and let me know its title, author and edition. Please this service is NOT free. SOLUTIONS MANUAL TO A First Course in Differential Equations

SOLUTIONS MANUAL TO A Course in Modern Mathematical Physics by Peter Szekeres

2013-01-05 Thread reganrexman
I have solutions manuals to all problems and exercises in these textbooks. To get one in an electronic format contact me at: reganrexman(at)gmail(dot)com and let me know its title, author and edition. Please this service is NOT free. SOLUTIONS MANUAL TO A First Course in Differential Equations

Good Python IDE

2013-01-05 Thread Sourabh Mhaisekar
Hello All, I am recently started couple of projects in Python, one in Python GTK and one in Python Qt. I want a good IDE (For Windows ) for Python which gives support for Python as well as PyGtk and PyQt. Features I am looking for * Support for Core Python Auto-completion. * Support for PyGtk

Re: Python programming philosophy

2013-01-05 Thread Sourabh Mhaisekar
The main philosophy behind python (according to me) is rapid application development. The python gives you convinent and powerful tool to develop sophisticated application rapidly. You can find more details on http://www.python.org/about/success/ http://www.python.org/about/success/#rapid-appl

Re: Python programming philosophy

2013-01-05 Thread 88888 Dihedral
chaouche yacine於 2013年1月6日星期日UTC+8上午6時34分38秒寫道: > The compiler reads your source code and parses it into parse trees. This is > first step. It then takes the parse trees and transform them into abstract > syntax trees, which are like a DOM tree in an HTML file, and then transform > that AST into

A question about thrift performance.

2013-01-05 Thread Vincent
Hi, all I have issue of thrift-performance in python, does anyone has an experience on thrift-in-python? My question in stackoverflow: http://stackoverflow.com/questions/14171227/why-is-thrift-binary-protocol-serialization-so-much-slow Copy the question to here(open stackoverflow to check pre

Re: Python programming philosophy

2013-01-05 Thread chaouche yacine
The compiler reads your source code and parses it into parse trees. This is first step. It then takes the parse trees and transform them into abstract syntax trees, which are like a DOM tree in an HTML file, and then transform that AST into a control flow graph, and finally a bytecode is produce

Re: import of ttk

2013-01-05 Thread Terry Reedy
On 1/5/2013 2:21 PM, Verde Denim wrote: On 01/04/2013 11:39 PM, Terry Reedy wrote: On 1/4/2013 11:02 PM, Verde Denim wrote: In reading through one of the learning articles, I have a bit of code that imports ttk, but I apparently don't have this installed. I've looked up the svn checkout for pyt

Re: Python programming philosophy

2013-01-05 Thread Chris Angelico
On Sun, Jan 6, 2013 at 9:05 AM, Nac Temha wrote: > Hello, > > I want to learn working principle of python as broadly. How to interpret the > python? For example, what is pyc files and when does it occur? > Can you explain them? Thanks in advance. The pyc files aren't really a philosophical point

Re: reduce expression to test sublist

2013-01-05 Thread Dave Angel
On 01/05/2013 04:55 PM, Terry Reedy wrote: > On 1/5/2013 1:58 PM, Dave Angel wrote: > >> If you're trying to make a faster loop, then I suggest you look into set >> differences. Turn both lists into sets, and subtract them. Something >> like (untested): >> >> result = not bool( set(lst1) -

Python programming philosophy

2013-01-05 Thread Nac Temha
Hello, I want to learn working principle of python as broadly. How to interpret the python? For example, what is pyc files and when does it occur? Can you explain them? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: python wiki gone?

2013-01-05 Thread Terry Reedy
On 1/5/2013 2:59 PM, Andrew Berg wrote: On 2013.01.05 13:07, Lee Harr wrote: When I go to wiki.python.org I get redirected to http://wiki.python.org/moin/ which is 404 Not Found. There's a security issue with moinmoin. The Python wiki is not the only wiki offline for this reason. For anyone d

Re: reduce expression to test sublist

2013-01-05 Thread Terry Reedy
On 1/5/2013 1:25 PM, Asim wrote: Hi All The following reduce expression checks if every element of list lst1 is present in list lst2. It works as expected for integer lists but for lists of strings, it always returns False. reduce( lambda x,y: (x in lst2) and (y in lst2), lst1) reduce(lambda

Re: reduce expression to test sublist

2013-01-05 Thread Terry Reedy
On 1/5/2013 1:58 PM, Dave Angel wrote: If you're trying to make a faster loop, then I suggest you look into set differences. Turn both lists into sets, and subtract them. Something like (untested): result = not bool( set(lst1) - set(lst2) ) This does not return False as soon as an ite

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Roy Smith
In article , Chris Angelico wrote: > On Sun, Jan 6, 2013 at 7:04 AM, Ian Kelly wrote: > > On Sat, Jan 5, 2013 at 8:57 AM, Chris Angelico wrote: > >> You miss my point, though. I went for simple Pythonic code, and never > >> measured its performance, on the expectation that it's "good enough".

Re: reduce expression to test sublist

2013-01-05 Thread Jussi Piitulainen
Asim writes: > Hi All > > The following reduce expression checks if every element of list lst1 > is present in list lst2. It works as expected for integer lists but > for lists of strings, it always returns False. > >reduce( lambda x,y: (x in lst2) and (y in lst2), lst1) Possibly this:

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Chris Angelico
On Sun, Jan 6, 2013 at 7:04 AM, Ian Kelly wrote: > On Sat, Jan 5, 2013 at 8:57 AM, Chris Angelico wrote: >> You miss my point, though. I went for simple Pythonic code, and never >> measured its performance, on the expectation that it's "good enough". >> Written in C, the state machine is probably

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Ian Kelly
On Sat, Jan 5, 2013 at 8:57 AM, Chris Angelico wrote: > You miss my point, though. I went for simple Pythonic code, and never > measured its performance, on the expectation that it's "good enough". > Written in C, the state machine is probably WAY faster than splitting > and then iterating. My C++

Re: reduce expression to test sublist

2013-01-05 Thread chaouche yacine
Because reduce doesn't do what you want. You'd want "all". L1 = [1,2,3] L2 = ["A1","B2","C3",1,2,3] print all((x in L2 for x in L1)) # prints True L3 = ["A1","B2","C3"] print all((x in L2 for x in L3)) # prints True - Original Message - From: Asim To: python-list@python.org Cc: Sent:

Re: python wiki gone?

2013-01-05 Thread Andrew Berg
On 2013.01.05 13:07, Lee Harr wrote: > When I go to wiki.python.org I get redirected to > http://wiki.python.org/moin/ > which is 404 Not Found. There's a security issue with moinmoin. The Python wiki is not the only wiki offline for this reason. -- CPython 3.3.0 | Windows NT 6.2.9200.16461 / Free

Re: pygame - importing GL - very bad...

2013-01-05 Thread someone
On 01/05/2013 02:27 PM, Chris Angelico wrote: On Sun, Jan 6, 2013 at 12:06 AM, someone wrote: In any case I think we understand each other. That's one of the links I just posted :) It's not just a naming difference, though. With Pascal's pass-by-reference semantics, this code would act diff

Re: import of ttk

2013-01-05 Thread Verde Denim
On 01/04/2013 11:39 PM, Terry Reedy wrote: > On 1/4/2013 11:02 PM, Verde Denim wrote: >> In reading through one of the learning articles, I have a bit of code >> that imports ttk, but I apparently don't have this installed. I've >> looked up the svn checkout for python-tk, and have checked it out >

python wiki gone?

2013-01-05 Thread Lee Harr
Have I just happened across wiki.python.org at a bad time, or is the wiki gone? When I go to wiki.python.org I get redirected to http://wiki.python.org/moin/ which is 404 Not Found. -- http://mail.python.org/mailman/listinfo/python-list

Re: reduce expression to test sublist

2013-01-05 Thread Dave Angel
On 01/05/2013 01:25 PM, Asim wrote: > Hi All > > The following reduce expression checks if every element of list lst1 is > present in list lst2. It works as expected for integer lists but for lists > of strings, it always returns False. > >reduce( lambda x,y: (x in lst2) and (y in lst2), lst

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Tim Chase
On 01/05/13 11:24, Tim Chase wrote: I don't know how this version times out: import re r = re.compile(r"[-+](\d+)([^-+]*)") def modify(m): result = m.group(2)[int(m.group(1)):] return result Doh, I intended to change this after testing, making it just returm m.g

reduce expression to test sublist

2013-01-05 Thread Asim
Hi All The following reduce expression checks if every element of list lst1 is present in list lst2. It works as expected for integer lists but for lists of strings, it always returns False. reduce( lambda x,y: (x in lst2) and (y in lst2), lst1) Moreover, for the lists of strings the follo

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Tim Chase
On 01/05/13 02:35, Sia wrote: I have strings such as: tA.-2AG.-2AG,-2ag or .+3ACG.+5CAACG.+3ACG.+3ACG The plus and minus signs are always followed by a number (say, i). I want python to find each single plus or minus, remove the sign, the number after it and remove i characters after that. So

Re: Yet another attempt at a safe eval() call

2013-01-05 Thread matt . newville
On Saturday, January 5, 2013 8:17:16 AM UTC-8, Oscar Benjamin wrote: > On 5 January 2013 16:01, Chris Angelico wrote: > > > On Sun, Jan 6, 2013 at 2:56 AM, Oscar Benjamin > > > wrote: > > >> On 4 January 2013 15:53, Grant Edwards wrote: > > >>> On 2013-01-04, Steven D'Aprano > >>> wrote: >

Re: Yet another attempt at a safe eval() call

2013-01-05 Thread Oscar Benjamin
On 5 January 2013 16:01, Chris Angelico wrote: > On Sun, Jan 6, 2013 at 2:56 AM, Oscar Benjamin > wrote: >> On 4 January 2013 15:53, Grant Edwards wrote: >>> On 2013-01-04, Steven D'Aprano wrote: On Thu, 03 Jan 2013 23:25:51 +, Grant Edwards wrote: * But frankly, you should a

Re: Random List Loop?!

2013-01-05 Thread Oscar Benjamin
On 5 January 2013 15:47, Christian Gabriel wrote: > Hi > > I have tried now for ages to make a loop that does the following: > > Makes a new list with 9 random values, from 9 different lists, with 9 > elements. > > And makes sure that none of the elements repeat! > > Is there anyone that can help

Re: Random List Loop?!

2013-01-05 Thread Chris Angelico
On Sun, Jan 6, 2013 at 2:47 AM, Christian Gabriel wrote: > Hi > > I have tried now for ages to make a loop that does the following: > > Makes a new list with 9 random values, from 9 different lists, with 9 > elements. > > And makes sure that none of the elements repeat! > > Is there anyone that c

Re: Yet another attempt at a safe eval() call

2013-01-05 Thread Chris Angelico
On Sun, Jan 6, 2013 at 2:56 AM, Oscar Benjamin wrote: > On 4 January 2013 15:53, Grant Edwards wrote: >> On 2013-01-04, Steven D'Aprano wrote: >>> On Thu, 03 Jan 2013 23:25:51 +, Grant Edwards wrote: >>> >>> * But frankly, you should avoid eval, and write your own mini-integer >>> arithmet

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Chris Angelico
On Sun, Jan 6, 2013 at 2:38 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> it may or may not run faster than the explicit state machine, > > You got me by a factor of 3 or 4. Not bad. You miss my point, though. I went for simple Pythonic code, and never measured its performan

Re: Random List Loop?!

2013-01-05 Thread Roy Smith
In article , Christian Gabriel wrote: > Hi > > I have tried now for ages to make a loop that does the following: > > Makes a new list with 9 random values, from 9 different lists, with 9 > elements. > > And makes sure that none of the elements repeat! > > Is there anyone that can help, wit

Re: Yet another attempt at a safe eval() call

2013-01-05 Thread Oscar Benjamin
On 4 January 2013 15:53, Grant Edwards wrote: > On 2013-01-04, Steven D'Aprano wrote: >> On Thu, 03 Jan 2013 23:25:51 +, Grant Edwards wrote: >> >> * But frankly, you should avoid eval, and write your own mini-integer >> arithmetic evaluator which avoids even the most remote possibility >>

Random List Loop?!

2013-01-05 Thread Christian Gabriel
Hi I have tried now for ages to make a loop that does the following: Makes a new list with 9 random values, from 9 different lists, with 9 elements. And makes sure that none of the elements repeat! Is there anyone that can help, with a very simple solution?? Best Christian -- http://mail.py

Re: Couting the number of lines of code of a python program

2013-01-05 Thread Roy Smith
In article , Dave Angel wrote: > On 01/05/2013 10:17 AM, chaouche yacine wrote: > > > > > > > > Here is my implementation : > > > > defcount_loc(lines):nb_lines =0docstring =Falseforline inlines:line > > =line.strip()ifline ==""\ orline.startswith("#")\ ordocstring > > andnot(line.startswit

Re: Couting the number of lines of code of a python program

2013-01-05 Thread chaouche yacine
Sorry, I don't know what went wrong, here is another paste (hopefully this will work this time). If you prefer, this a link anchor to the function https://www.assembla.com/code/tahar/subversion/nodes/tahar.py?rev=8#ln340 def count_loc(lines):     nb_lines  = 0     docstring = False     for line

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Roy Smith
In article , Chris Angelico wrote: > it may or may not run faster than the explicit state machine, Hmmm, hard to say. Both are O(n), but yours makes several more copies of the data than mine (the string addition, the replace(), the split(), the string slicing). We both make copies as we put

Re: Couting the number of lines of code of a python program

2013-01-05 Thread Dave Angel
On 01/05/2013 10:17 AM, chaouche yacine wrote: > > > Here is my implementation : > > defcount_loc(lines):nb_lines =0docstring =Falseforline inlines:line > =line.strip()ifline ==""\ orline.startswith("#")\ ordocstring > andnot(line.startswith('"""')orline.startswith("'''"))\ > or(line.startswi

Re: Couting the number of lines of code of a python program

2013-01-05 Thread Chris Angelico
On Sun, Jan 6, 2013 at 2:17 AM, chaouche yacine wrote: > defcount_loc(lines):nb_lines =0docstring =Falseforline inlines:line > =line.strip()ifline ==""\ orline.startswith("#")\ ordocstring > andnot(line.startswith('"""')orline.startswith("'''"))\ > or(line.startswith("'''")andline.endswith("'''

Re: Couting the number of lines of code of a python program

2013-01-05 Thread chaouche yacine
The idea started off as a volumetric information of my projects, but evolved to a sort of code browser that would display classes, methods and functions in a tree-like structure, and now I mostly want to use it with other people's code as a way to have the big picture. So I would say that it is

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Chris Angelico
On Sun, Jan 6, 2013 at 2:03 AM, Roy Smith wrote: > That's why I chose to split this where I did. It was where the scan > direction changed. Ah, good point. In any case, this is a fairly simple and clear way of doing things; it may or may not run faster than the explicit state machine, but IMHO i

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Roy Smith
In article , Chris Angelico wrote: > On Sun, Jan 6, 2013 at 1:30 AM, Roy Smith wrote: > > In article , > > Chris Angelico wrote: > > > >> result = "".join([x[int(x[0])+1:] for x in > >> ("0"+s).replace("-","+").split("+")]) > > > > That's exceedingly clever. But bordering on line noise. At

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Chris Angelico
On Sun, Jan 6, 2013 at 1:30 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> result = "".join([x[int(x[0])+1:] for x in >> ("0"+s).replace("-","+").split("+")]) > > That's exceedingly clever. But bordering on line noise. At the very > least, I would break it up into a couple o

Re: Windows Installer Error

2013-01-05 Thread matttwall
On Saturday, January 5, 2013 8:30:39 AM UTC-6, matt...@gmail.com wrote: > I am running on Windows 7 Professional x64 with latest service pack and I > cannot get Python to install. I run the python-3.2.1.msi, and after I select > the installation directory, I get a popup that says "There is a prob

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Roy Smith
In article , Chris Angelico wrote: > result = "".join([x[int(x[0])+1:] for x in > ("0"+s).replace("-","+").split("+")]) That's exceedingly clever. But bordering on line noise. At the very least, I would break it up into a couple of lines to make it easier to understand (plus you can print

Windows Installer Error

2013-01-05 Thread matttwall
I am running on Windows 7 Professional x64 with latest service pack and I cannot get Python to install. I run the python-3.2.1.msi, and after I select the installation directory, I get a popup that says "There is a problem with this Windows Installer package. A DLL required for this install to c

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Roy Smith
In article , Sia wrote: > I have strings such as: > > tA.-2AG.-2AG,-2ag > or > .+3ACG.+5CAACG.+3ACG.+3ACG Some kind of DNA binding site? A couple of questions. Are the numbers always single digits? How much data is there? Are we talking a few hundred 20-character strings, or all of Genba

Re: Couting the number of lines of code of a python program

2013-01-05 Thread Chris Angelico
On Sun, Jan 6, 2013 at 12:55 AM, chaouche yacine wrote: > The > problem is that I'm using the inspect module, because it provides a > nice function inspect.getsourcelines that takes a python object and > return its number of lines of code. BUT, it works on live objects, that > means one has to fi

Couting the number of lines of code of a python program

2013-01-05 Thread chaouche yacine
Hello. I'v written a small script that prints the number of lines of code of a python program to stdout (by module, function, class and method), the sources are available online here  https://www.assembla.com/code/tahar/subversion/nodes. The readme has an example usage as well as a trace of

Re: PyGreSQL 4.1 released

2013-01-05 Thread D'Arcy J.M. Cain
On Sat, 5 Jan 2013 13:23:55 +0100 Michael Poeltl wrote: > no python3 support yet? > can you tell us when pygresql will be ready for python3? Hard to say when (we all have day jobs) but it is planned for version 5.0. You can track our milestones at http://trac.vex.net:8000/pgtracker We will prob

Re: problem with exam task for college

2013-01-05 Thread Chris Angelico
On Sun, Jan 6, 2013 at 12:14 AM, wrote: > that's probably it, how do i solve it? I'm afraid I can't help you there. Check out the docs for the getkey function and see if it can be put into non-blocking mode; if not, you may have to completely change your model. For instance, if I were writing th

Re: pygame - importing GL - very bad...

2013-01-05 Thread Chris Angelico
On Sun, Jan 6, 2013 at 12:06 AM, someone wrote: > On 01/05/2013 12:47 PM, Chris Angelico wrote: >> You can find good references on the subject in various >> places, but call-by-reference as implemented in Pascal simply doesn't >> exist in most modern languages, because its semantics are way >> con

Re: problem with exam task for college

2013-01-05 Thread jeltedeproft
that's probably it, how do i solve it? -- http://mail.python.org/mailman/listinfo/python-list

Re: pylint, was Re: pygame - importing GL - very bad...

2013-01-05 Thread someone
On 01/05/2013 01:49 PM, Jan Riechers wrote: On 05.01.2013 03:11, someone wrote: But about the regular expressions (a bit deeper look into that): Like said of Chris: [a-z] defines a "catching group", in this case all ascii lowercase letters ranging from "a" to "z". If noting else is provided, the

Re: pygame - importing GL - very bad...

2013-01-05 Thread someone
On 01/05/2013 12:47 PM, Chris Angelico wrote: C has typed variables, so it's a compile-time error to try to put any other type into that variable. Python doesn't. That flexibility comes at the cost of error-catching. There are hybrid systems, but in general, type declarations imply variable decla

Re: pylint, was Re: pygame - importing GL - very bad...

2013-01-05 Thread Jan Riechers
On 05.01.2013 03:11, someone wrote: On 01/03/2013 12:27 PM, Chris Angelico wrote: On Thu, Jan 3, 2013 at 10:19 PM, someone wrote: Doesn't this "[ ... ]" mean something optional? What does {2,30}$ mean? I think $ means that the {2,30} is something in the end of the sentence... You can find

Re: problem with exam task for college

2013-01-05 Thread Chris Angelico
On Sat, Jan 5, 2013 at 11:24 PM, wrote: > hy again,thanx, i updated my code with your more efficient approach :), so > that possibly resolves problem number 2, but still leaves me with problem > n°1, my code is still stuck in the first update of the fuel tank > (brandstoftank), for the sake of

Re: PyGreSQL 4.1 released

2013-01-05 Thread Michael Poeltl
no python3 support yet? can you tell us when pygresql will be ready for python3? thx Michael * D'Arcy J.M. Cain [2013-01-03 15:05]: > --- > Release of PyGreSQL version 4.1 > --- > > It has been a long time coming but PyGreSQL v4.1 has bee

Re: problem with exam task for college

2013-01-05 Thread jeltedeproft
hy again,thanx, i updated my code with your more efficient approach :), so that possibly resolves problem number 2, but still leaves me with problem n°1, my code is still stuck in the first update of the fuel tank (brandstoftank), for the sake of your easyness i'll paste the code again from vi

Re: Evaluate postgres boolean field

2013-01-05 Thread andydtaylor
Brilliant, thanks guys -- http://mail.python.org/mailman/listinfo/python-list

Re: pygame - importing GL - very bad...

2013-01-05 Thread Chris Angelico
On Sat, Jan 5, 2013 at 9:49 PM, someone wrote: > Ok, I think you're right. At least I find that C-compilers catches many > errors/warnings which python don't say anything about. But also C require me > to define/declarer the types of variables before I use them... OTOH I guess > I like that python

Re: New in Python , Need a Mentor

2013-01-05 Thread someone
On 01/02/2013 05:30 PM, Chris Angelico wrote: On Thu, Jan 3, 2013 at 3:24 AM, Wolfgang Strobl wrote: Chris Angelico : I strongly recommend IDLE - much better editing/recall facilities than the command-line Python has), and work through the tutorial: Well, this is certainly a matter of taste.

Re: pygame - importing GL - very bad...

2013-01-05 Thread Dave Angel
On 01/05/2013 05:49 AM, someone wrote: > On 01/05/2013 02:30 AM, Dave Angel wrote: > >> >> Function objects are enormously useful, as you get more adept at using >> Python. > > Ok, I'll look forward to that. Recently I had some problems with > pass-by-value vs pass-by-reference. I googled the prob

Re: pygame - importing GL - very bad...

2013-01-05 Thread someone
On 01/05/2013 02:30 AM, Dave Angel wrote: from opengl import gl, glu, glut gl.rotate(...) gl.clear(gl.COLOR_BUFFER_BIT) Erhm, that's the same as above. Is that what you meant to write? No, it's not the same; here he did not capitalize the function names. Previously they look like class ins

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Chris Angelico
On Sat, Jan 5, 2013 at 7:35 PM, Sia wrote: > I have strings such as: > > tA.-2AG.-2AG,-2ag > or > .+3ACG.+5CAACG.+3ACG.+3ACG > > The plus and minus signs are always followed by a number (say, i). I want > python to find each single plus or minus, remove the sign, the number after > it and remove

Re: Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Frank Millman
On 05/01/2013 10:35, Sia wrote: I have strings such as: tA.-2AG.-2AG,-2ag or .+3ACG.+5CAACG.+3ACG.+3ACG The plus and minus signs are always followed by a number (say, i). I want python to find each single plus or minus, remove the sign, the number after it and remove i characters after that.

Need a specific sort of string modification. Can someone help?

2013-01-05 Thread Sia
I have strings such as: tA.-2AG.-2AG,-2ag or .+3ACG.+5CAACG.+3ACG.+3ACG The plus and minus signs are always followed by a number (say, i). I want python to find each single plus or minus, remove the sign, the number after it and remove i characters after that. So the two strings above become: