Is there an equivalent Python function to JavaScript's String.fromCharCode?  The use case is a string generator and I'd like to use the ASCII decimal or hex values to generate the characters (numbers, symbols, upper/lower letters).  JS example:  String.fromCharCode(97) // Gives 'a'
28473
How do I get the  value of a character as an int in ?
32263
Can you please tell me how much is (-2) % 5? According to my Python interpreter is 3, but do you have a wise explanation for this?  I've read that in some languages the result can be machine-dependent, but I'm not sure though.
77376
var i : integer;  i := 1234567;   Given the above, I want the string "1,234,567" as output (assuming UK locale). IntToStr just gives me "1234567". I'm sure there's a one-liner for this, but I can't find it...
9833
How do I convert a hex string to an int in Python?   I may have it as "0xffff" or just "ffff".
26280
What is an easy way in Python to format integers into strings representing thousands with K, and millions with M, and leaving just couple digits after comma?  I'd like to show 7436313 as 7.44M, and 2345 as 2,34K.  Is there some % string formatting operator available for that? Or that could be done only by actually dividing by 1000 in a loop and constructing result string step by step?
8128
What is the best possible way to check if a string can be represented as a number in Python?   The function I currently have right now is:  def is_number(s):     try:         float(s)         return True     except ValueError:         return False   Which, not only is ugly and slow, seems clunky. However I haven't found a better method because calling float in the main function is even worse.
36723
I have a long sequence of hex digits in a string, such as      000000000000484240FA063DE5D0B744ADBED63A81FAEA390000C8428640A43D5005BD44   only much longer, several kilobytes.  Is there a builtin way to convert this to a bytes object in python 2.6/3?
40928
How can you check whether a string is convertible to an int?  Let's say we have data like "House", "50", "Dog", "45.99", I want to know whether I should just use the string or use the parsed int value instead.  In JavaScript we had this  function. If the string couldn't be parsed, it would get back NaN.
29964
itoa() is a really handy function to convert a number to a string. Linux does not seem to have itoa(), is there an equivalent function or do I have to use sprintf(str, "%d", num)?
60150
I'm working with some example java code for making md5 hashes. One part converts the results from bytes to a string of hex digits:  byte messageDigest[] = algorithm.digest();      StringBuffer hexString = new StringBuffer(); for (int i=0;i&lt;messageDigest.length;i++) {     hexString.append(Integer.toHexString(0xFF &amp; messageDigest[i]));     }   However, it doesn't quite work since toHexString apparently drops off leading zeros. So, what's the simplest way to go from byte array to hex string that maintains the leading zeros?
18302
I have a list of Unicode codepoints, but I don't know of a "simple" way to convert these hex values into the actual characters they represent...    I've heard that zsh has echo -e '\u0965', but I use bash 4.1.  Is there something as simple as the zsh method, for bash?
5691
Is there a better way of getting this result? This function fails if num has more digits than digits, and I feel like it should be in the library somewhere (like Integer.toString(x,"%3d") or something)  static String intToString(int num, int digits) {     StringBuffer s = new StringBuffer(digits);     int zeroes = digits - (int) (Math.log(num) / Math.log(10)) - 1;      for (int i = 0; i &lt; zeroes; i++) {         s.append(0);     }     return s.append(num).toString(); }
40753
Recently I have started playing with jQuery, and have been following a couple of tutorials. Now I feel slightly competent with using it (it's pretty easy), and I thought it would be cool if I were able to make a 'console' on my webpage (as in, you press the ` key like you do in  games, etc.), and then have it Ajax itself back to the server in-order to do stuff.  I originally thought the best way would be to just get the text inside the textarea, and then split it, or should I use the keyup event, convert the keycode returned to an ASCII character, append the character to a string and send the string to the server (then empty the string).  I couldn't find any information on getting text from a textarea, all I got was keyup information. Also, how can I convert the keycode returned to an ASCII character?
78486
For example, if I have a unicode string, I can encode it as an ASCII string like so:  &gt;&gt;&gt; u'\u003cfoo/\u003e'.encode('ascii') '&lt;foo/&gt;'   However, I have e.g. this ASCII string:  '\u003foo\u003e'   ... that I want to turn into the same ASCII string as in my first example above:  '&lt;foo/&gt;'
111081
I have a unicode string like "Tanım" which is encoded as "Tan%u0131m" somehow. How can i convert this encoded string back to original unicode.  Apparently urllib.unquote does not support unicode.
59820
What is the most efficient way in C# 2.0 to check each character in a string and return true if they are all valid hexadecimal characters and false otherwise? Example void Test() {     OnlyHexInString(&quot;123ABC&quot;); // Returns true     OnlyHexInString(&quot;123def&quot;); // Returns true     OnlyHexInString(&quot;123g&quot;); // Returns false }  bool OnlyHexInString(string text) {     // Most efficient algorithm to check each digit in C# 2.0 goes here }
28551
Does * have a special meaning in Python as it does in C? I saw a function like this in the Python Cookbook:  def get(self, *a, **kw)   Would you please explain it to me or point out where I can find an answer (Google interprets the * as wild card character and thus I cannot find a satisfactory answer).