1
vote
3answers
24 views

Python String Reverse Program

I'm trying to write a program that will simply reverse a string. I get an error that something is not subscriptable or something. Could you guys help me pinpoint why this isn't working? ...
-5
votes
0answers
37 views

Str not callable? [closed]

I know this has been asked before but I read all of the answers and still don't get it why, plus all the code is way too advance for me. Why isn't my code working? Why am I getting this error? Can ...
0
votes
1answer
36 views

Remove characters before and including _ in python 2.7

good day all, i use python 2.7 the following code returns into a nice readable output. def add_line_remove_special(ta_from,endstatus,*args,**kwargs): try: ta_to = ...
2
votes
2answers
37 views

replacing last part of string after pattern

What is the best way to remove the last bit of a string, following a certain recognized pattern? For example: s = 'some Strings-and-stuff - SomeOther Strings-and-stuff - TAke.THis last -part ...
0
votes
3answers
45 views

Can't convert int to str

I am creating a project for a computer science class where i a creating a stacked cipher. I am using a copy to the clipboard function in order to allow the message to be changed by the next cipher. I ...
-3
votes
0answers
18 views

Take numbers as input and display a sequence? [closed]

How would I make a python program to ask for a starting number, ending number, and a unit to count by and have it display the answer I need to make a program for a school project that does the above. ...
3
votes
3answers
49 views

Making sure no integers in a string?

I have a simple question. I'm just wanting to know how I would have my program read the "input()" and see if there are integers or any kind of number in the string, and if so then print out a message ...
0
votes
1answer
27 views

Python, numpy, string decomposition (string from Abaqus AFXComTableKeyword.getValues())

From the getValues()method the AFXComTableKeyword class returns a string like: test = "('mat_huehne_2008', '0.125', '24.0'),('', '', '-24.0'),('', '', '41.0')"+\ ",('', '', '-41.0'),('', '', ...
7
votes
3answers
91 views

Hashing same character multiple times

I'm doing a programming challenge and I'm going crazy with one of the challenges. In the challenge, I need to compute the MD5 of a string. The string is given in the following form: n[c]: Where n is ...
2
votes
1answer
74 views

Regular expression to split a huge string into multiple sets of key-value pairs

I've a huge string which contains many sets, each is separated by ,. Each set has key-value pairs in it, each pair is separated by &. Here is small example, ...
0
votes
1answer
55 views

Splitting a String and Assigning it Variables

Im taking info from my school grade site and its coming out as a long string this is the output: [u'--'] [u'B', u'84'] [u'--'] [u'A-', u'90'] [u'--'] [u'C+', u'79'] [u'--'] [u'A', u'95'] [u'--'] ...
0
votes
1answer
56 views

Python 3: how to compare multiple strings in one line of code?

I'm trying to make a category select (by text interface) in Python 3, and I was wondering how I can compare if multiple strings are not true, and then print something along the lines of "that is not a ...
-4
votes
1answer
61 views

Python replace string in file

i need something to replace a string in a file wich is placed in that mktemp folder. this file is named autounattend.cfg and contains a string named %PASSWORD this string need to be replaced with ...
2
votes
2answers
58 views

Converting Unicode codepoints into Unicode character using Python 3.3.1

I've this string : sig=45C482D2486105B02211ED4A0E3163A9F7095E81.4DDB3B3A13C77FE508DCFB7C6CC68957096A406C\u0026type=video%2F3gpp%3B+codecs%3D%22mp4v.20.3%2C+mp4a.40.2%22\u0026quality=small\u ...
1
vote
3answers
66 views

Python - Using string as condition in if statement

I am trying to do this: a = "1 or 0" if (a): Print "true" So I can use a string as the condition of an if statement. Is this possible?

1 2 3 4 5 233
15 30 50 per page