Search Discussions

196 discussions - 1,447 posts

  • def nametonumber(name): lst=[""] for x,y in enumerate (name): lst=lst.append(y) print (lst) return (lst) a=["1-800-getcharter"] print (nametonumber(a))#18004382427837 The syntax for when to use a () ...
    Oct 22, 2014 at 8:30 pm
    Oct 27, 2014 at 9:26 pm
  • Hello Is there in Python something like: j = (j = 10) ? 3 : j+1; as in C language ? thx
    Oct 22, 2014 at 8:29 am
    Oct 27, 2014 at 9:04 am
  • I want to toggle between color="Red" and color="Blue" Here is one: if color == "Red": color = "Blue" else: color = "Red" Here is two: if x = "True" color = "Red" else: color="Blue" x= not x Others?
    Oct 9, 2014 at 12:11 am
    Oct 18, 2014 at 7:06 am
  • I haven't had a lot of practice doing this. If anyone knows of a site I would appreciate it. Will Python work like this: I am trying to come up with an example and work to it. Say I want a Grocery ...
    Oct 20, 2014 at 6:10 pm
    Oct 21, 2014 at 12:55 pm
  • I have a dictionary that looks like this: {"1":{"Key1":"Value1", "Key2":"Value2", "Key3":"Value3"}, "2":{"Key1":"Value1", "Key2":"Value2", "Key3":"Value3"}, "3":{"Key1":"Value1", "Key2":"Value2", ...
    Oct 14, 2014 at 3:57 pm
    Nov 3, 2014 at 5:57 pm
  • I use python 3.4.0 version. In the course of developing / running a python program, I have encountered a problem. I have reproduced below a simple program to bring it out. ... for j in range(3) ...
    Oct 27, 2014 at 4:01 pm
    Oct 30, 2014 at 5:41 pm
  • Hi, I am using netcat to listen to a port and python to read stdin and print to the console. nc -l 2003 | python print_metrics.py sys.stdin.flush() doesn?t seem to flush stdin, so I am using the ...
    Empty AccountEmpty Account
    Oct 17, 2014 at 11:38 am
    Oct 22, 2014 at 3:28 pm
  • class pet: def set_age(self,age): self.age=age def get_age(self): return self.age pax=pet pax.set_age(4) Traceback (most recent call last): File "C:\Functions\test.py", line 18, in <module ...
    Oct 30, 2014 at 8:16 pm
    Nov 4, 2014 at 5:38 am
  • Why is the second part of while condition not being checked? while ans.lower() != 'yes' or ans.lower()[0] != 'y': ans = input('Do you like python?') My intention is if either of the conditions are ...
    Oct 12, 2014 at 5:08 pm
    Oct 14, 2014 at 11:16 pm
  • For the record, I don't want a hint. I want the answer. I see a practice question is similar to this. 15 <= x < 30 And it wants a similar expression that is equivalent. So the right answer is 15<= x ...
    Oct 5, 2014 at 11:02 pm
    Oct 9, 2014 at 3:28 pm
  • I'm just learning Python. It seems like indents are EXTREMELY important. I guess, since there are no brackets, everything is controlled by indents. Well, I'm reading a couple books on Python now, and ...
    Oct 15, 2014 at 2:13 am
    Oct 21, 2014 at 5:09 pm
  • Question: Does python in general terms (apart from extensions or gc manipulation), exhibit a "high water" type leak of allocated memory in recent python versions (2.7+)? Background ...
    Oct 3, 2014 at 6:36 pm
    Oct 10, 2014 at 6:52 am
  • I have a dictionary as follows:- { u'StarterAmps1': Row(id=4, ain=u'AIN3', name=u'StarterAmps1', convh34.374834509803, Description=u'Starter Amps'), u'LeisureVolts': Row(id=1, ain=u'AIN0', ...
    Oct 1, 2014 at 9:58 am
    Oct 3, 2014 at 8:09 am
  • Moved from other (Seymore's) thread where this is perhaps not relevant So my point: Whether the language supports it strongly (Pascal' procedures) weakly (C's void functions) more weakly (Python's ...
    Rustom ModyRustom Mody
    Oct 25, 2014 at 5:27 pm
    Oct 29, 2014 at 6:00 am
  • Been using emacs for over 20 years and teaching python for 10. And getting fed up that my audience looks at me like Rip van Winkle each time I start up emacs... So trying out Idle... Some specific ...
    Rustom ModyRustom Mody
    Oct 9, 2014 at 6:52 am
    Oct 17, 2014 at 5:03 am
  • Every Python operator has a function version in the operator module: operator + has function operator.add; operator - has function operator.sub; operator * has function operator.mul; and so forth ...
    Steven D'ApranoSteven D'Aprano
    Oct 8, 2014 at 1:41 am
    Oct 9, 2014 at 1:41 am
  • Hello If i am writing (-1)**1000 on a python program, will the interpreter do (-1)*(-1)*...*(-1) or something clever ? In fact i have (-1)**N with N an integer potentially big. I do some tests that ...
    Oct 22, 2014 at 8:27 am
    Nov 4, 2014 at 12:46 am
  • I must say that the lack of static types in Python is a pain in the neck especially when I'm exploring new libraries. Recently, I learned a new language called Dart which have optional typing and I ...
    Oct 29, 2014 at 4:17 pm
    Oct 30, 2014 at 4:16 am
  • I am trying to learn classes. I am currently using Python 2.7 at the command line. If you try to type commands at the command line and make the slightest mistake you have to start over. I was trying ...
    Oct 27, 2014 at 2:27 am
    Oct 28, 2014 at 4:57 am
  • Hi, (sorry for cross-posting) A few days ago I needed to check whether some Python code ran with Python 2.6. What is the easiest way to install another Python version along side the default Python ...
    Albert-Jan RoskamAlbert-Jan Roskam
    Oct 12, 2014 at 1:33 pm
    Oct 16, 2014 at 2:59 pm
  • Hi I have just started an introductory course on Python. I have never even seen a programming language before so I am struggling a bit. Our lecturer has given us a number of excercises to complete ...
    Diarmuid HigginsDiarmuid Higgins
    Oct 3, 2014 at 5:35 pm
    Oct 9, 2014 at 9:38 pm
  • Hi, I am learning Python (version 3.4) strings.I have a function that takes in a parameter and prints it out as given below. def donuts(count): if count <= 5: print('Number of donuts: ',count) else ...
    Oct 1, 2014 at 10:37 pm
    Oct 3, 2014 at 2:08 am
  • Write a program that reads the contents of the two files into two separate lists. The user should be able to enter a boy's name, a girl's name or both, and the application will display messages ...
    Oct 27, 2014 at 3:10 pm
    Oct 30, 2014 at 12:09 am
  • Out of curiosity, I ran: globals().clear() in the interactive interpreter. It broke much more than I expected! Built-ins were no longer available, and import stopped working. I expected that global ...
    Steven D'ApranoSteven D'Aprano
    Oct 1, 2014 at 4:00 pm
    Oct 6, 2014 at 9:30 am
  • I need to add a linker option to the command(s) run by setup.py when building various objects. I'm not familiar with Python at all, so I basically copied and modified a line from one area of the ...
    Cyd HaseltonCyd Haselton
    Oct 27, 2014 at 3:54 pm
    Nov 5, 2014 at 3:23 pm
  • I am using Python 3.4 on Mac OS X and Tinter 8.5. Does anyone have any code that they would share with me on how to remove the "Python" menu in the menubar at the top next to the "apple'? I would ...
    Noble BellNoble Bell
    Oct 19, 2014 at 11:22 pm
    Oct 28, 2014 at 4:06 pm
  • So sorry everyone. I've posted here several times today. This is VERY frustrating. So, I'm reading this link. https://docs.python.org/2/howto/urllib2.html Fetching URLs The simplest way to use ...
    Oct 16, 2014 at 12:40 am
    Oct 16, 2014 at 10:56 pm
  • Hi, I have a text file. Now it is required to select every other line of that text to generate a new text file. I have read through Python grammar, but still lack the idea at the beginning of the ...
    Oct 13, 2014 at 5:38 pm
    Oct 14, 2014 at 12:34 am
  • Let's say I have an incoming list of values *l*. Every element of *l* can be one of the following options: 1) an integer value 2) a string in form of '<int_value ', e.g. '7' 3) a string with a json ...
    Oct 29, 2014 at 10:42 am
    Nov 12, 2014 at 8:31 pm
  • Are the following two expressions the same? x is y Id(x) == id(y) ? I ported some Java code to Python, and it was using Java's idea of equality (via ==) in some places. Right now, I have a suite of ...
    Dan StrombergDan Stromberg
    Oct 27, 2014 at 12:12 am
    Oct 27, 2014 at 1:17 pm
  • I downloaded PYTZ and put it here. C:\Python27\pytz Now, in the cmd window, I typed this: C:\Python27\pytz\setup.py A text file opens and nothing else happens. I thought it was supposed to install ...
    Oct 18, 2014 at 7:54 pm
    Oct 20, 2014 at 8:19 am
  • Hi, I need to develop a python CLI framework. For example if i need to set an ip address in linux: ifconfig eth0 I should be able to use python to do the above. 1. The user will execute ...
    Oct 9, 2014 at 12:20 pm
    Oct 15, 2014 at 4:05 pm
  • Hello, I am working on a mathematical equation which I'm finding really hard to express in python. Could any of you spare some time to help me out? The equation looks like this b(i,x) = [?(l?L) ...
    Oct 6, 2014 at 11:13 am
    Oct 7, 2014 at 2:07 am
  • Just out of academic interest, is there somewhere in the Python docs where the following is explained? False print("It's Twue") It's Twue i.e. in the if statement 3 is True but not in the first
    Simon KennedySimon Kennedy
    Oct 23, 2014 at 2:30 pm
    Oct 24, 2014 at 12:42 am
  • I'm trying to install Pandas. I went to this link. https://pypi.python.org/pypi/pandas/0.14.1/#downloads I downloaded this: pandas-0.14.1.win32-py2.7.exe (md5) I have Python27 installed. So, I run ...
    Oct 18, 2014 at 8:00 pm
    Oct 20, 2014 at 1:41 pm
  • Hi, I am trying to search a string through files in a directory - however while Python script works on it and writes a log - I want to present the user with count of number of strings found. So it ...
    Oct 15, 2014 at 6:39 pm
    Oct 16, 2014 at 2:12 pm
  • Hi, I'm a lurker here and enjoy the back-and-forth, especially among the experts among you. My question is this: I have Python 3.4.1 installed on 64-bit Win 7 Home Premium, and on 32-bit Win 7 Pro ...
    Pal AcreidePal Acreide
    Oct 6, 2014 at 12:04 am
    Oct 11, 2014 at 8:55 pm
  • for instance in ruby i can write following code: module M def ins_var @ins_var ||= nil end def m @ins_var = "val" end def m2 ins_var # = "val" end end in py # m.py # how to def a ins_var? def m: # ...
    Roro codeathRoro codeath
    Oct 6, 2014 at 10:00 am
    Oct 8, 2014 at 10:12 am
  • Dear Sirs I am working on a project at Service Birmingham to migrate our applications from Windows Server 2003 over to Windows Server 2008 R2 Can you confirm if Python 2.76 is compatible with Server ...
    Sas ParmarSas Parmar
    Oct 6, 2014 at 1:52 pm
    Oct 6, 2014 at 5:50 pm
  • As Gary says, the form of input is really the critical part. How will users type these? One simple cheat you could do would be to prompt for each term separately - something like this: exponent = ...
    Chris AngelicoChris Angelico
    Oct 1, 2014 at 12:20 am
    Oct 1, 2014 at 5:01 pm
  • Hi everyone, I'm not really sure if this is the right place to ask about regular expressions, but since I'm usin python I thought I could give a try :-) Here is the problem, I'm trying to write a ...
    Oct 28, 2014 at 11:02 am
    Nov 5, 2014 at 10:44 am
  • <tr <th key<td <input type=text name=key value="%(key)s" rowhtml = '<tr <th %s<td <input type=text name=%s value"%%(%s)s" \n" what does % mean in first line of code and what does %%(%s)s mean in ...
    Oct 28, 2014 at 9:41 pm
    Oct 29, 2014 at 8:40 am
  • Hi, ALL, When I am on Windows, I can write something like this: sys.path.append('C:\Users\Igor\Documents\MyLib') Now, when I'm on Linux, can I do this: sys.path.append('~/MyLib') ? I.e., will '~' ...
    Igor KorotIgor Korot
    Oct 10, 2014 at 4:21 am
    Oct 10, 2014 at 3:53 pm
  • Hi all, I'd like to build a web site for myself, essentially a "vanity" web site to show off whatever web development skills I have, and perhaps do some blogging. I'm a Python developer, so I'd like ...
    Oct 2, 2014 at 1:30 pm
    Oct 6, 2014 at 5:28 pm
  • Hi All, I have written a function that -reads a file -splits the words and stores it in a dictionary as word(key) and the total count of word in file (value). I want to print the words with top 20 ...
    Oct 4, 2014 at 9:11 am
    Oct 5, 2014 at 6:58 am
  • Where is DIRECTORY_ENTRY_LOAD_CONFIG? In the changelog (https://code.google.com/p/pefile/) one can read: "Version: 1.2.10-60 Besides some small bugfixes in this release I've added functionality to ...
    Oct 29, 2014 at 1:15 pm
    Oct 31, 2014 at 1:22 am
  • Hi! I'd like to write one or more scripts that analyze processes in memory on Windows 7. I used to do these things in C++ by using native Win32 API calls. How should I proceed in python? Any pointers?
    Oct 27, 2014 at 5:16 pm
    Oct 29, 2014 at 9:29 am
  • Dear Python and Numpy Users: My data are in the form of '32-bit unsigned integer' as follows: myData = np.array([1073741824, 1073741877, 1073742657, 1073742709, 1073742723, 1073755137, ...
    Artur BercikArtur Bercik
    Oct 18, 2014 at 5:58 am
    Oct 18, 2014 at 7:22 am
  • Dear All, How to write a program for reading or parsing the XML file in Sub root Wise. For ex: Below XMl, I want to read/ parse first country details and here also two year tag values are there. ...
    Venugopal ReddyVenugopal Reddy
    Oct 13, 2014 at 11:39 am
    Oct 15, 2014 at 9:04 am
  • I'm an absolute noob to Python, although I have been programming in several other languages for over 10 years. I'm trying to install and run some scripts, and I'm not having much success. I followed ...
    Ryan ShuellRyan Shuell
    Oct 12, 2014 at 8:17 pm
    Oct 14, 2014 at 10:30 am
Group Navigation
period‹ prev | Oct 2014 | next ›
Group Overview
grouppython-list @

245 users for October 2014

Chris Angelico: 158 posts Seymore4Head: 91 posts Rustom Mody: 83 posts Mark Lawrence: 56 posts Steven D'Aprano: 47 posts Terry Reedy: 47 posts Ian Kelly: 40 posts Marko Rauhamaa: 32 posts Denis McMahon: 31 posts Peter Otten: 29 posts MRAB: 25 posts Ben Finney: 23 posts Dan Stromberg: 23 posts Dave Angel: 22 posts Ryguy7272: 21 posts Joel Goldstick: 17 posts Cameron Simpson: 16 posts Shiva: 15 posts Alister: 14 posts Ned Batchelder: 14 posts
show more