inpu = "3443331123377"
tstr = inpu[0]
for k in range(1, len(inpu)):
if inpu[k] != inpu[k-1] :
tstr = tstr + inpu[k]
print(tstr)
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 16 Jan 2014 22:24:40 -, Nac Temha wrote:
Hi everyone,
I want to do operation with chars in the given string. Actually I want to
grouping the same chars.
For example;
input : "3443331123377"
operation-> (3)(44)()(333)(11)(2)(33)(77)
output: "34131237"
How can I
giacomo boffi writes:
> % python a.py
> 34131237
% cat a.py
i="3443331123377";n=0
while n+1!=len(i):i,n=(i[:n]+i[n+1:],n) if i[n+1]==i[n] else (i,n+1)
print i
% python a.py
34131237
%
--
for Nikos
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 17 Jan 2014 00:24:40 +0200, Nac Temha wrote:
> Hi everyone,
>
> I want to do operation with chars in the given string. Actually I want
> to grouping the same chars.
>
> For example;
>
> input : "3443331123377"
> operation-> (3)(44)()(333)(11)(2)(33)(77)
> output: "341312
Nac Temha writes:
> Hi everyone,
>
> I want to do operation with chars in the given string. Actually I want to
> grouping the same chars.
>
> For example;
>
> input : "3443331123377"
> operation-> (3)(44)()(333)(11)(2)(33)(77)
> output: "34131237"
>
>
>
> How can I do without list
In Mark Lawrence
writes:
> > input = "3443331123377"
> > output = []
> > previous_ch = None
> > for ch in input:
> > if ch != previous_ch:
> > output.append(ch)
> > previous_ch = ch
> > print ''.join(output)
> >
> Cheat, you've used a list :)
Ack! I missed that
On 16/01/2014 22:30, John Gordon wrote:
In Nac Temha
writes:
--047d7b6d95d0367a3d04f01de490
Content-Type: text/plain; charset=ISO-8859-1
Hi everyone,
I want to do operation with chars in the given string. Actually I want to
grouping the same chars.
For example;
input : "34433
On 2014-01-17 00:24, Nac Temha wrote:
> Hi everyone,
>
> I want to do operation with chars in the given string. Actually I
> want to grouping the same chars.
>
> For example;
>
> input : "3443331123377"
> operation-> (3)(44)()(333)(11)(2)(33)(77)
> output: "34131237"
>
> How can
In Nac Temha
writes:
> --047d7b6d95d0367a3d04f01de490
> Content-Type: text/plain; charset=ISO-8859-1
> Hi everyone,
> I want to do operation with chars in the given string. Actually I want to
> grouping the same chars.
> For example;
> input : "3443331123377"
> operation-> (3)(44)(1
Hi everyone,
I want to do operation with chars in the given string. Actually I want to
grouping the same chars.
For example;
input : "3443331123377"
operation-> (3)(44)()(333)(11)(2)(33)(77)
output: "34131237"
How can I do without list, regular expression. just using string
op
Mike314 wrote:
Hello,
I have a strange problem with the string format:
'%s %s %s %s %s' % ['01', '02', '03', '04', '05']
Traceback (most recent call last):
File "", line 1, in
TypeError: not enough arguments for format string
But as soon I use tuple it is working:
'%s %s %s %s %s' % (
On Mar 11, 4:07 pm, Mike314 wrote:
> Hello,
>
> I have a strange problem with the string format:
>
> >>> '%s %s %s %s %s' % ['01', '02', '03', '04', '05']
>
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: not enough arguments for format string
>
> But as soon I use tu
On Mar 11, 12:07 am, Mike314 wrote:
> Hello,
>
> I have a strange problem with the string format:
>
> >>> '%s %s %s %s %s' % ['01', '02', '03', '04', '05']
>
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: not enough arguments for format string
>
> But as soon I use t
On Tue, 10 Mar 2009 22:07:59 -0700, Mike314 wrote:
> Hello,
>
>I have a strange problem with the string format:
>
'%s %s %s %s %s' % ['01', '02', '03', '04', '05']
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: not enough arguments for format string
>
> But
Hello,
I have a strange problem with the string format:
>>> '%s %s %s %s %s' % ['01', '02', '03', '04', '05']
Traceback (most recent call last):
File "", line 1, in
TypeError: not enough arguments for format string
But as soon I use tuple it is working:
>>> '%s %s %s %s %s' % ('01', '02',
Madhusudan Singh wrote:
>> if the callback code is Python, you should be able to add a print
>> statement to the line just before the failing "int" call:
>>
>> print repr(signalrangestr), type(signalrangestr)
>> signalrange = int(signalrangestr)
>>
>> that print statement should be all you
Fredrik Lundh wrote:
>> The code is :
>>
>> void Form3::getNPrange()
>> {
>
> what language is this?
Its python embedded in the designer workflow. pyuic extracts stuff from it,
and generates a python script from the ui.h file.
>
> if the callback code is Python, you should be able to add a pr
Madhusudan Singh wrote:
> I am working with an application that I designed with the Designer > pyuic
> workflow and I get the following error on trying to process the contents
> of
> a combobox :
>
> Traceback (most recent call last):
> File "measure.py", line 908, in acquiredata
>np=self.ge
Hi
I am working with an application that I designed with the Designer > pyuic
workflow and I get the following error on trying to process the contents of
a combobox :
Traceback (most recent call last):
File "measure.py", line 908, in acquiredata
np=self.getNPrange()
File "measure.py", li
Tzanko Tzanev wrote:
> #but there is an error in
> playlist_txt += mp3id + mp3_title + mp3_artist
It'd be a lot easier to help if you'd say what the error was.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
Tzanko Tzanev a écrit :
> hi :)
> I need some help for this script
> I have
please take care of indentation when posting code.
>
> cursor = conn.cursor()
> cursor.execute("select * from playlist limit 5")
> result = cursor.fetchall()
> # iterate through resultset
> playlist_t
Tzanko Tzanev wrote:
> hi :)
> I need some help for this script
> I have
>
> cursor = conn.cursor()
> cursor.execute("select * from playlist limit 5")
> result = cursor.fetchall()
> # iterate through resultset
> playlist_txt = ''
> for record in result:
> mp3id = record[0]
> mp
hi :)
I need some help for this script
I have
cursor = conn.cursor()
cursor.execute("select * from playlist limit 5")
result = cursor.fetchall()
# iterate through resultset
playlist_txt = ''
for record in result:
mp3id = record[0]
mp3_title = record[1]
mp3_artist = record[2]
pl
23 matches
Mail list logo