Re: [Tutor] Question about subprocess

2014-01-10 Thread Danny Yoo
There is a warning in the documentation on subprocess that might be relevant to your situation: Warning: Use communicate() rather than .stdin.write, .stdout.read or .stderr.read to avoid deadlocks due to any of the other OS pipe buffers filling up and blocking the child process.

Re: [Tutor] Question about subprocess

2014-01-10 Thread Steven D'Aprano
On Sat, Jan 11, 2014 at 12:48:13PM +0800, daedae11 wrote: p = subprocess.Popen(['E:/EntTools/360EntSignHelper.exe', 'E:/build/temp/RemoteAssistSetup.exe'], stdout=subprocess.PIPE, shell=True).stdout temp = p.readline(); print temp p.close() When I run the above

Re: [Tutor] Question about distribute in pypi

2013-12-27 Thread Albert-Jan Roskam
Subject: Re: [Tutor] Question about distribute in pypi To: daedae11 daeda...@126.com Cc: tutor@python.org Date: Friday, December 27, 2013, 8:19 AM On Thu, Dec 26, 2013 at 11:06 PM, daedae11 daeda...@126.com wrote: Are distribute 0.6.49 and distribute 0.7.3 the same plugin's different

Re: [Tutor] Question about distribute in pypi

2013-12-27 Thread Oscar Benjamin
On 27 December 2013 13:53, Albert-Jan Roskam fo...@yahoo.com wrote: Subject: Re: [Tutor] Question about distribute in pypi To: daedae11 daeda...@126.com Cc: tutor@python.org Date: Friday, December 27, 2013, 8:19 AM On Thu, Dec 26, 2013 at 11:06 PM, daedae11 daeda...@126.com wrote

[Tutor] Question about distribute in pypi

2013-12-26 Thread daedae11
Hi, Are distribute 0.6.49 and distribute 0.7.3 the same plugin's different version? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Question about distribute in pypi

2013-12-26 Thread Danny Yoo
Hi Daedae, I am not sure. Do you have URLs to them from the Python Package index? (PyPi)? https://pypi.python.org/pypi I see distribute 0.7.3 here: https://pypi.python.org/pypi/distribute/0.7.3 and when I look at all versions of the software, it does appear that 0.6.49 was the

Re: [Tutor] Question about distribute in pypi

2013-12-26 Thread eryksun
On Thu, Dec 26, 2013 at 11:06 PM, daedae11 daeda...@126.com wrote: Are distribute 0.6.49 and distribute 0.7.3 the same plugin's different version? distribute is a fork of setuptools. The fork was merged back, so for a fresh installation of Python just install setuptools. The 0.7.3 package

Re: [Tutor] Question about conditions and empty values

2013-10-28 Thread Shelby Martin
I use the Python GUI called IDLE. As far as I can tell, it doesn't show me any error messages, but when the program shuts down suddenly due to a coding error, some sort of text pops up very briefly on the screen before it shuts down. Sorry, I'm a complete newbie to Python :) And thanks for your

Re: [Tutor] Question about conditions and empty values

2013-10-28 Thread Alan Gauld
On 28/10/13 15:59, Shelby Martin wrote: I use the Python GUI called IDLE. As far as I can tell, it doesn't show me any error messages, How are you running the program in IDLE? When I type the code into a new edit window, save it and run it from within IDLE the error trace appears in the

[Tutor] Question about conditions and empty values

2013-10-26 Thread Shelby Martin
For the program below, if I enter 0 at the prompt, it provides the reply Please, sit. It may be a while. However, if I just press the Enter key, it shuts the program down without a reply from the Maitre D'. My question is this - the author of this exercise states the condition is False if either

Re: [Tutor] Question about conditions and empty values

2013-10-26 Thread Alan Gauld
On 26/10/13 20:13, Shelby Martin wrote: My question is this - the author of this exercise states the condition is False if either zero or empty is the value. I'm assuming he means that empty is just pressing Enter without entering a number? Normally that would be correct but... money =

[Tutor] Question about Functions

2013-09-10 Thread novo shot
Dear tutors: The following is an example I found in the Raspberry Pi for Dummies book: #function test def theFunction(message): print I don't get , message return ARRRGH! theFunction(this) result=theFunction(this either) print reply is: , result

Re: [Tutor] Question about Functions

2013-09-10 Thread Joel Goldstick
On Tue, Sep 10, 2013 at 1:49 PM, novo shot novos...@gmail.com wrote: Dear tutors: The following is an example I found in the Raspberry Pi for Dummies book: #function test def theFunction(message): print I don't get , message return ARRRGH! theFunction(this) the above line

[Tutor] Question about Functions

2013-09-10 Thread novo shot
Dear tutors: The following is an example I found in the Raspberry Pi for Dummies book: #function test def theFunction(message): print I don't get , message return ARRRGH! theFunction(this) result=theFunction(this either) print reply is: , result

Re: [Tutor] Question about Functions

2013-09-10 Thread Chris Down
On 2013-09-10 13:34, novo shot wrote: When I declare a variable to be equal as the fucntion (result=theFunction(this either)) is Python also executing the function? You're not declaring it as equal, that would be `==' (or `is' for identity). `=' assigns, it doesn't check for equality. The way

Re: [Tutor] Question about Functions

2013-09-10 Thread Prasad, Ramit
novo shot wrote: Dear tutors: The following is an example I found in the Raspberry Pi for Dummies book: #function test def theFunction(message): print I don't get , message return ARRRGH! theFunction(this) result=theFunction(this either) print reply is: , result

Re: [Tutor] Question about Functions

2013-09-10 Thread Alan Gauld
On 10/09/13 18:49, novo shot wrote: Dear tutors: The following is an example I found in the Raspberry Pi for Dummies book: #function test def theFunction(message): print I don't get , message return ARRRGH! All the code above does is define the function and assign it the name

Re: [Tutor] Question about Functions

2013-09-10 Thread Dino Bektešević
Date: Tue, 10 Sep 2013 13:34:50 -0400 From: novo shot novos...@gmail.com To: tutor@python.org Subject: [Tutor] Question about Functions Message-ID: CAGk5SVGPVL-1xgEukXCcRUmmYJG_Aq+mh+wnR=ot5ajbcht...@mail.gmail.com Content-Type: text/plain; charset=iso-8859-1 Dear tutors

Re: [Tutor] Question about Functions

2013-09-10 Thread Steven D'Aprano
On Tue, Sep 10, 2013 at 01:49:11PM -0400, novo shot wrote: When I declare a variable to be equal as the fucntion (result=theFunction(this either)) is Python also executing the function? No, you have misunderstood. Equals in programming languages is not the same as equals in mathematics. Some

Re: [Tutor] Question in regards to loops and matplotlib

2013-08-08 Thread Zachary Rizer
This looks quite clean! Since posting this question I have cleaned up this script by using multiple functions, but it still isn't this clean! My data is a normal CSV table with column headers. It isn't in a dictionary format like your sample data here. I'm sure I could switch it to that format

Re: [Tutor] Question

2013-08-07 Thread zubair alam
what exactly you want to do by code [1,2,3] = Anything /code the above code is called unpacking of sequence, so there must be some variable on left side of assignment operator. but you have list of integers, why? On Tue, Jul 23, 2013 at 11:15 PM, Don Jennings dfjenni...@gmail.com wrote:

[Tutor] Question in regards to loops and matplotlib

2013-08-07 Thread Zachary Rizer
So I just started coding, and I'm so glad I chose Python to start me off! I really enjoy the clean layout, easy syntax, and power of the language. I'm doing astronomy research and I just started teaching myself matplotlib along with my general python work. I feel like I'm catching on quick, but I

[Tutor] Question

2013-07-23 Thread Amandeep Behl
def Move(label): label = Anything a_list = [1,2,3] Move(a_list) I don't see any error when executing above but when i manually assign [1,2,3] = Anything i get error Why? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Question about python for web

2013-06-26 Thread Seshadri Raja
Dear Dat, Sorry for the late reply. The path of the python should be #!/usr/bin/python (or) #!/usr/bin/env python. Forward Slash(/) is missing in your CGI script. ​Enable the ExecCGI for your DocumentRoot Ref: http://httpd.apache.org/docs/current/howto/cgi.html​ ​ Directory ​

[Tutor] Question about python for web

2013-06-23 Thread Dat Huynh
Dear all, I have a very simple question about running a simple web application with apache on MacOS. Step 1: Copy the file mod_wsgi.so from the link http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-macosx106-ap22py26-3.3.so into the folder /usr/libexec/apache2 Step 2: Add the

[Tutor] Question regarding the 'chr' function

2013-06-09 Thread Colin Clayton
Hi everyone, I am fairly new to the Python language and have come from a background of Google's App Inventor Block Language. I'm having trouble understanding what the 'chr' function does? I have yet to find a tutorial or information online relating to the 'chr' function that really clicks with

Re: [Tutor] question already discussed with oscar benjamin

2013-05-16 Thread Oscar Benjamin
On 7 May 2013 21:10, Linsey Raaijmakers lm.raaijmak...@gmail.com wrote: Hi, Im trying to work with the help Oscar provided me, but I still get stuck :( For the benefit of everyone else here, this is referring to a question that was asked on python-list. The discussion there went off-list and I

[Tutor] question already discussed with oscar benjamin

2013-05-15 Thread Linsey Raaijmakers
Hi, Im trying to work with the help Oscar provided me, but I still get stuck :( So what I'm trying to do now is write the program with the following input and output: Input: action,start,apex,stop 3, 12, 13, 15 4, 15, 15, 15 3, 20, 21, 25 5, 21, 23, 30 ... And when you run your program it

[Tutor] Question on regular expressions

2013-02-12 Thread Marcin Mleczko
Hello, given this kind of string: start SomeArbitraryAmountOfText start AnotherArbitraryAmountOfText end a search string like: rstart.*?end would give me the entire string from the first start to end : start SomeArbitraryAmountOfText start AnotherArbitraryAmountOfText end but I am interested

Re: [Tutor] Question on regular expressions

2013-02-12 Thread Alan Gauld
On 12/02/13 17:43, Marcin Mleczko wrote: but I am interested only in the second part between the 2nd start and the end: start AnotherArbitraryAmountOfText end What would be best, most clever way to search for that? best and clever are not always the same. The simplest way if its a fixed

Re: [Tutor] Question on regular expressions

2013-02-12 Thread Peter Otten
Marcin Mleczko wrote: given this kind of string: start SomeArbitraryAmountOfText start AnotherArbitraryAmountOfText end a search string like: rstart.*?end would give me the entire string from the first start to end : start SomeArbitraryAmountOfText start AnotherArbitraryAmountOfText end

Re: [Tutor] Question on regular expressions

2013-02-12 Thread Mark Lawrence
On 12/02/2013 17:43, Marcin Mleczko wrote: Hello, given this kind of string: start SomeArbitraryAmountOfText start AnotherArbitraryAmountOfText end a search string like: rstart.*?end would give me the entire string from the first start to end : start SomeArbitraryAmountOfText start

[Tutor] Question on re.findall usage

2013-01-28 Thread Dave Wilder
Hello, I am trying using re.findall to parse the string below and then create a list from the results. junk_list = 'tmsh list net interface 1.3 media-ca \rpabilities\r\nnet interface 1.3 {\r\nmedia-capabilities {\r\nnone\r\nauto\r\n 4SR4-FD\r\n 10T-HD\r\n

Re: [Tutor] Question on re.findall usage

2013-01-28 Thread Oscar Benjamin
Please post in plain text (not html) as otherwise the code gets screwed up. When I paste your code into a terminal this is what happens: junk_list = 'tmsh list net interface 1.3 media-ca \rpabilities\r\nnet interface 1.3 {\r\nmedia-capabilities {\r\nnone\r\n auto\r\n

Re: [Tutor] Question on re.findall usage

2013-01-28 Thread Joel Goldstick
On Mon, Jan 28, 2013 at 2:15 PM, Dave Wilder d.wil...@f5.com wrote: Hello, I am trying using re.findall to parse the string below and then create a list from the results. junk_list = 'tmsh list net interface 1.3 media-ca \rpabilities\r\nnet interface 1.3 {\r\nmedia-capabilities {\r\n

Re: [Tutor] Question on re.findall usage

2013-01-28 Thread Dave Wilder
On 28 January 2013 2:44, : Oscar Benjamin [mailto:oscar.j.benja...@gmail.com wrote: Please post in plain text (not html) as otherwise the code gets screwed up. ... Some people like to use regexes for everything. I prefer to try string methods first as I find them easier to understand.

Re: [Tutor] Question on re.findall usage

2013-01-28 Thread Mitya Sirenef
On 01/28/2013 03:19 PM, Dave Wilder wrote: On 28 January 2013 2:44, : Oscar Benjamin [mailto:oscar.j.benja...@gmail.com wrote: Please post in plain text (not html) as otherwise the code gets screwed up. ... Some people like to use regexes for everything. I prefer to try string

Re: [Tutor] Question regular expressions - the non-greedy pattern

2013-01-22 Thread Marcin Mleczko
Now I think I got it. Thanks a lot again. Marcin Am 22.01.2013 12:00, schrieb tutor-requ...@python.org: Message: 1 Date: Tue, 22 Jan 2013 11:31:01 +1100 From: Steven D'Aprano st...@pearwood.info To: tutor@python.org Subject: Re: [Tutor] Question regular expressions - the non-greedy

[Tutor] Question regular expressions - the non-greedy pattern

2013-01-21 Thread Marcin Mleczko
Hello, in the howto (http://docs.python.org/2/howto/regex.html#regex-howto) there are code examples near the end of the page (the non-greedy pattern) I am referring to: s = 'htmlheadtitleTitle/title' len(s) 32 print re.match('.*', s).span() (0, 32) print re.match('.*', s).group()

Re: [Tutor] Question regular expressions - the non-greedy pattern

2013-01-21 Thread Hugo Arts
On Mon, Jan 21, 2013 at 3:45 PM, Marcin Mleczko marcin.mlec...@onet.euwrote: Now I'm changing the input string to (adding an extra ''): s = 'htmlheadtitleTitle/title' and evoking the last command again: print re.match('.*?', s).group() I would expect to get the same result html as I'm

Re: [Tutor] Question regular expressions - the non-greedy pattern

2013-01-21 Thread Walter Prins
Hi, On 21 January 2013 14:45, Marcin Mleczko marcin.mlec...@onet.eu wrote: Did I get the concept of non-greedy wrong or is this really a bug? Hugo's already explained the essence of your problem, but just to add/reiterate: a) match() will match at the beginning of the string (first

Re: [Tutor] Question regular expressions - the non-greedy pattern

2013-01-21 Thread Steven D'Aprano
On 22/01/13 01:45, Marcin Mleczko wrote: Now I'm changing the input string to (adding an extra ''): s = 'htmlheadtitleTitle/title' and evoking the last command again: print re.match('.*?', s).group() I would expect to get the same result html as I'm using the non-greedy pattern. What I get

Re: [Tutor] Question regular expressions - the non-greedy pattern

2013-01-21 Thread Marcin Mleczko
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Hugo, hello Walter, first thank you very much for the quick reply. The functions used here i.e. re.match() are taken directly form the example in the mentioned HowTo. I'd rather use re.findall() but I think the general interpretetion of the

Re: [Tutor] Question regular expressions - the non-greedy pattern

2013-01-21 Thread Steven D'Aprano
On 22/01/13 10:11, Marcin Mleczko wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Hugo, hello Walter, first thank you very much for the quick reply. The functions used here i.e. re.match() are taken directly form the example in the mentioned HowTo. I'd rather use re.findall() but I

Re: [Tutor] Question regular expressions - the non-greedy pattern

2013-01-21 Thread Walter Prins
Hi Marcin, On 21 January 2013 23:11, Marcin Mleczko marcin.mlec...@onet.eu wrote: first thank you very much for the quick reply. No problem... The functions used here i.e. re.match() are taken directly form the example in the mentioned HowTo. I'd rather use re.findall() but I think the

Re: [Tutor] Question regular expressions - the non-greedy pattern

2013-01-21 Thread Lie Ryan
On 22/01/13 10:11, Marcin Mleczko wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Hugo, hello Walter, first thank you very much for the quick reply. The functions used here i.e. re.match() are taken directly form the example in the mentioned HowTo. I'd rather use re.findall() but I

Re: [Tutor] Question regular expressions - the non-greedy pattern

2013-01-21 Thread Alan Gauld
Your understanding is flawed. Try these actions and ponder their significance... s = 'htmlheadtitleTitle/title' re.search('.*?',s).group() 'html' re.search('.*',s).group() 'htmlheadtitleTitle/title' s = 'htmlheadtitleTitle-title' re.search('.*',s).group() 'htmlheadtitle'

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-19 Thread Scurvy Scott
[SNIP] Thank you guys so much, sorry for the delayed response. It's awesome being able to learn a thing or two from people who know so much about their craft. I've got the code working the way I envisioned it now and probably couldn't without y'alls help. I'm so glad this mailing list exists,

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-16 Thread Steven D'Aprano
On 16/01/13 11:23, Scurvy Scott wrote: After playing with your example I keep being told that list has no attribute int_to_note. I know what the problem is, I just don't know how to fix it. Oops, sorry about that, that is my fault. I did warn that my code was untested! If you know what the

[Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
Hello guys, I'm using Ubuntu 12.10 and Python 2.7 right now. I'm working on code using the Mingus module but this question isn't specific to this module, per se. What I'm trying to do is to generate the fibonacci numbers up to a given N and then do modulo 12 on each number in order to create a

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Oscar Benjamin
On 15 January 2013 23:40, Scurvy Scott etanes...@gmail.com wrote: [SNIP] Anyways, the problem I'm having is I'm not really sure how to search a list for multiple elements and remove just those elements. Below is my code so far, and information y'all could provide would be appreciated. Thanks.

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Steven D'Aprano
On 16/01/13 10:40, Scurvy Scott wrote: [...] Anyways, the problem I'm having is I'm not really sure how to search a list for multiple elements and remove just those elements. Below is my code so far, and information y'all could provide would be appreciated. Thanks. Actually, your problem so

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Oscar Benjamin
On 15 January 2013 23:53, Scurvy Scott etanes...@gmail.com wrote: Anyways, the problem I'm having is I'm not really sure how to search a list for multiple elements and remove just those elements. Below is my code so far, and information y'all could provide would be appreciated. Thanks.

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
On Tue, Jan 15, 2013 at 4:01 PM, Steven D'Aprano st...@pearwood.info wrote: On 16/01/13 10:40, Scurvy Scott wrote: [...] Anyways, the problem I'm having is I'm not really sure how to search a list for multiple elements and remove just those elements. Below is my code so far, and information

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
SNIP So here I extract out of your code (untested!) a generator which produces an infinite series of Fibonacci numbers, one at a time: def fib(): a, b = 0, 1 while True: yield b a, b = b, a+b This is untested, I may have got it wrong. Next, a function to

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Andreas Perstinger
On 16.01.2013 01:23, Scurvy Scott wrote: After playing with your example I keep being told that list has no attribute int_to_note. I know what the problem is, I just don't know how to fix it. [SNIP] So right now my code is: import mingus.core.notes as notes

[Tutor] Question about the raw string

2012-11-27 Thread JiangShan
Hi everyone, I am studying the python 3 and I am confused about the raw string. Why does the python interpreter do not escape the single backslash before the quotes even I add a r before the string. The following is an example: print(r\) SyntaxError: EOL while

Re: [Tutor] Question about the raw string

2012-11-27 Thread Steven D'Aprano
On Wed, Nov 28, 2012 at 01:01:12AM +, JiangShan wrote: Hi everyone, I am studying the python 3 and I am confused about the raw string. Why does the python interpreter do not escape the single backslash before the quotes even I add a r before the string.

Re: [Tutor] Question

2012-10-28 Thread Emile van Sebille
On 10/27/2012 2:19 PM, Alan Gauld wrote: On 27/10/12 20:50, Amin Memar wrote: Hi there! How can I use wxpython on python 3.3.0? You can't its not supported yet. So you will need to either port the code yourself or use Python 2.7. This is not uncommon with third party modules a lot of them

Re: [Tutor] Question

2012-10-28 Thread Mark Lawrence
On 28/10/2012 17:41, Emile van Sebille wrote: On 10/27/2012 2:19 PM, Alan Gauld wrote: On 27/10/12 20:50, Amin Memar wrote: Hi there! How can I use wxpython on python 3.3.0? You can't its not supported yet. So you will need to either port the code yourself or use Python 2.7. This is not

Re: [Tutor] Question

2012-10-28 Thread Alan Gauld
On 28/10/12 17:41, Emile van Sebille wrote: How can I use wxpython on python 3.3.0? Actually, it looks to me that the v3.x compatible wxpython is being rebranded as Project Phoenix -- see http://wiki.wxpython.org/ProjectPhoenix That's good news although two names for the same toolkit will

[Tutor] Question

2012-10-27 Thread Amin Memar
Hi there! How can I use wxpython on python 3.3.0? thanks   Best Regards. Amin___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Question

2012-10-27 Thread Alan Gauld
On 27/10/12 20:50, Amin Memar wrote: Hi there! How can I use wxpython on python 3.3.0? You can't its not supported yet. So you will need to either port the code yourself or use Python 2.7. This is not uncommon with third party modules a lot of them are still on v2. It is a lot of work to

[Tutor] Question about language code

2012-10-11 Thread Dae James
Here is a example in Python v2.7.2 document: import locale loc = locale.getlocale() # get current locale # use German locale; name might vary with platform locale.setlocale(locale.LC_ALL, 'de_DE') However, the result of executing on my computer is: locale.setlocale(locale.LC_ALL, 'de_DE')

Re: [Tutor] Question about language code

2012-10-11 Thread eryksun
On Thu, Oct 11, 2012 at 11:12 PM, Dae James daeda...@126.com wrote: import locale loc = locale.getlocale() # get current locale # use German locale; name might vary with platform locale.setlocale(locale.LC_ALL, 'de_DE') This depends on the C runtime. For Windows, see MSDN: setlocale

Re: [Tutor] Question about language code

2012-10-11 Thread eryksun
On Fri, Oct 12, 2012 at 12:37 AM, eryksun eryk...@gmail.com wrote: For example (untested): locale.setlocale(locale.LC_ALL, 'German_Germany.1252') I got around to testing the above, and it works. Also, the Python docs say if [locale is] an iterable, it’s converted to a locale name using

Re: [Tutor] Question about lists

2012-09-21 Thread Hugo Arts
On Fri, Sep 21, 2012 at 3:31 PM, Leo Degon existential...@gmail.com wrote: I'm trying to create a class where the main focus is creating a list whose elements are lists and the elements of those lists are collection of zeros and ones. I am trying to create functions to rotate the list ninety

[Tutor] Question

2012-09-11 Thread Ashley Fowler
I have a question. In a assignment it asks for me to do the following below... if peek then print the Student object at the beginning of the list (using __str__) but don't remove it from the list; Could you explain what it means? This is what I have so far,

Re: [Tutor] Question

2012-09-11 Thread Brannon, Terrence
From: Tutor [mailto:tutor-bounces+terrence.brannon=bankofamerica@python.org] On Behalf Of Ashley Fowler Sent: Tuesday, September 11, 2012 12:08 PM To: tutor@python.org Subject: [Tutor] Question I have a question. In a assignment it asks for me to do the following below... if peek

Re: [Tutor] Question

2012-09-11 Thread eryksun
On Tue, Sep 11, 2012 at 12:08 PM, Ashley Fowler afowl...@broncos.uncfsu.edu wrote: I have a question. In a assignment it asks for me to do the following below... if peek then print the Student object at the beginning of the list (using __str__) but don't remove it from

[Tutor] Question

2012-08-23 Thread Ashley Fowler
I am trying to complete an assignment and I am stuck at the if-else statements area. Could someone please help me? the instructions and what I have so far are below... Instructions: Your main function should do the following: (1) create an empty list; (2) ask the user if he/she wants to

Re: [Tutor] Question

2012-08-23 Thread Alan Gauld
On 23/08/12 18:02, Ashley Fowler wrote: def main(): l = list() x = eval(input('Enter a number: ')) Don;t use eval() its bad practicecand fort advanced use only. Instead explicitly convert to int() or float() while x = 0: l.append(x) x = eval(input('Enter a

Re: [Tutor] Question

2012-08-23 Thread Ashley Fowler
From: tutor-bounces+afowler2=broncos.uncfsu@python.org [tutor-bounces+afowler2=broncos.uncfsu@python.org] on behalf of Alan Gauld [alan.ga...@btinternet.com] Sent: Thursday, August 23, 2012 5:59 PM To: tutor@python.org Subject: Re: [Tutor

Re: [Tutor] Question

2012-08-23 Thread Kwpolska
(resent due to sending off-list by mistake) Let's begin with telling you what you did wrong here. A fixed and completed code is below. ( = okay, # = modified/deleted; python code in `backticks`) On Thu, Aug 23, 2012 at 7:02 PM, Ashley Fowler afowl...@broncos.uncfsu.edu wrote: def main(): #

Re: [Tutor] Question

2012-08-23 Thread Kwpolska
] Sent: Thursday, August 23, 2012 5:59 PM To: tutor@python.org Subject: Re: [Tutor] Question On 23/08/12 18:02, Ashley Fowler wrote: def main(): l = list() x = eval(input('Enter a number: ')) Don;t use eval() its bad practicecand fort advanced use only. Instead explicitly convert

Re: [Tutor] Question

2012-08-23 Thread eryksun
On Thu, Aug 23, 2012 at 1:02 PM, Ashley Fowler afowl...@broncos.uncfsu.edu wrote: Instructions: Your main function should do the following: (1) create an empty list; (2) ask the user if he/she wants to perform a list operation. if yes: (a) prompt the user for the operation:

[Tutor] Question about reading from a file.

2012-08-07 Thread Brad Dutton
I recently discovered how to read from a file but I've having some trouble with it. I made a short example program that goes like this: 1. fob = open('c:/python27/a.txt', 'r') 2. 3. print fob.read() 4. print fob.read() When it runs it returns this: 1. Hey now brown cow 2.

Re: [Tutor] Question about reading from a file.

2012-08-07 Thread Peter Otten
Brad Dutton wrote: I recently discovered how to read from a file but I've having some trouble with it. I made a short example program that goes like this: 1. fob = open('c:/python27/a.txt', 'r') 2. 3. print fob.read() 4. print fob.read() When it runs it returns this:

Re: [Tutor] Question about reading from a file.

2012-08-07 Thread Mark Lawrence
On 04/08/2012 22:51, Brad Dutton wrote: I recently discovered how to read from a file but I've having some trouble with it. I made a short example program that goes like this: 1. fob = open('c:/python27/a.txt', 'r') 2. 3. print fob.read() 4. print fob.read() When it runs it

Re: [Tutor] Question about reading from a file.

2012-08-07 Thread Joel Goldstick
On Tue, Aug 7, 2012 at 5:12 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 04/08/2012 22:51, Brad Dutton wrote: I recently discovered how to read from a file but I've having some trouble with it. I made a short example program that goes like this: 1. fob = open('c:/python27/a.txt',

Re: [Tutor] Question about reading from a file.

2012-08-07 Thread Ramchandra Apte
Imagine a book. .read(num) reads a page of the book Now if you call again it goes to the next page. Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor ___ Tutor

Re: [Tutor] Question about reading from a file.

2012-08-07 Thread Mark Lawrence
On 07/08/2012 13:37, Ramchandra Apte wrote: Imagine a book. .read(num) reads a page of the book Now if you call again it goes to the next page. Please don't top post. This is now the fourth time you've been asked. -- Cheers. Mark Lawrence.

[Tutor] Question about autocomplete functionality

2012-06-12 Thread Richard Querin
Hi All, I wrote a small utility several months ago to easily search a project list (an excel spreadsheet) by project name or number etc. However I am thinking of expanding it with the following sort of functionality - the ability to add 'tags' to a given project (tags being just simple

Re: [Tutor] Question about autocomplete functionality

2012-06-12 Thread Joel Goldstick
On Tue, Jun 12, 2012 at 3:38 PM, Joel Goldstick joel.goldst...@gmail.com wrote: On Tue, Jun 12, 2012 at 3:01 PM, Richard Querin rfque...@gmail.com wrote: Hi All, I wrote a small utility several months ago to easily search a project list (an excel spreadsheet) by project name or number etc.

Re: [Tutor] Question about autocomplete functionality

2012-06-12 Thread Alan Gauld
On 12/06/12 20:01, Richard Querin wrote: tags that have ever been entered and use a sort of autocomplete functionality to make them quicker to enter. And to reduce the number of, and discourage the use of, 'almost duplicate' tags. Are there any resources out there (libraries, tutorials etc)

Re: [Tutor] Question about autocomplete functionality

2012-06-12 Thread Joel Goldstick
On Tue, Jun 12, 2012 at 3:01 PM, Richard Querin rfque...@gmail.com wrote: Hi All, I wrote a small utility several months ago to easily search a project list (an excel spreadsheet) by project name or number etc. However I am thinking of expanding it with the following sort of functionality -

Re: [Tutor] Question about autocomplete functionality

2012-06-12 Thread Prasad, Ramit
However, this is only really useful if I can keep a running list of all tags that have ever been entered and use a sort of autocomplete functionality to make them quicker to enter. And to reduce the number of, and discourage the use of, 'almost duplicate' tags. Are there any resources out

Re: [Tutor] Question about autocomplete functionality

2012-06-12 Thread Alan Gauld
If you want a GUI desktop sort of application check this out: http://www.freenetpages.co.uk/hp/alan.gauld/ There is a chapter on GUI programming that might give you some good ideas But that's a prehistoric version of the tutor :-) Use the link in my sig instead... -- Alan G Author of the

Re: [Tutor] Question about autocomplete functionality

2012-06-12 Thread Alan Gauld
On 12/06/12 21:17, Prasad, Ramit wrote: The discouraging of 'almost duplicate' tags is going to be more difficult I understood the OP to simply mean that autocompletion would reduce the amount of mis-typing by only completing existing tag values therefore reducing misspellings etc. If

Re: [Tutor] question about listing variables defined since session started

2012-05-01 Thread Prasad, Ramit
Steven D'Aprano wrote: Robert Sjoblom wrote: On 30 April 2012 23:25, Comer Duncan comer.dun...@gmail.com wrote: Hi, I have a newbie type question. Say I have started a python (or ipython) session and have done some imports and have also defined some new variables since the session

Re: [Tutor] question about listing variables defined since session started

2012-05-01 Thread Steven D'Aprano
Prasad, Ramit wrote: Steven D'Aprano wrote: Robert Sjoblom wrote: On 30 April 2012 23:25, Comer Duncan comer.dun...@gmail.com wrote: Hi, I have a newbie type question. Say I have started a python (or ipython) session and have done some imports and have also defined some new variables since

Re: [Tutor] question about listing variables defined since session started

2012-05-01 Thread Prasad, Ramit
Steven D'Aprano wrote: Prasad, Ramit wrote: Steven D'Aprano wrote: Robert Sjoblom wrote: On 30 April 2012 23:25, Comer Duncan comer.dun...@gmail.com wrote: Hi, I have a newbie type question. Say I have started a python (or ipython) session and have done some imports and have also

[Tutor] question about listing variables defined since session started

2012-04-30 Thread Comer Duncan
Hi, I have a newbie type question. Say I have started a python (or ipython) session and have done some imports and have also defined some new variables since the session started. So, I have in my current namespace a bunch of things. Suppose I want to list just those variable names which have

Re: [Tutor] question about listing variables defined since session started

2012-04-30 Thread Robert Sjoblom
On 30 April 2012 23:25, Comer Duncan comer.dun...@gmail.com wrote: Hi, I have a newbie type question.  Say I have started a python (or ipython) session and have done some imports and have also defined some new variables since the session started.  So, I have in my current namespace a bunch

Re: [Tutor] question about listing variables defined since session started

2012-04-30 Thread Alan Gauld
On 30/04/12 22:25, Comer Duncan wrote: I have a newbie type question. Say I have started a python (or ipython) session and have done some imports and have also defined some new variables since the session started. So, I have in my current namespace a bunch of things. Suppose I want to list

Re: [Tutor] question about listing variables defined since session started

2012-04-30 Thread Steven D'Aprano
Comer Duncan wrote: Hi, I have a newbie type question. Say I have started a python (or ipython) session and have done some imports and have also defined some new variables since the session started. So, I have in my current namespace a bunch of things. Suppose I want to list just those

Re: [Tutor] question about listing variables defined since session started

2012-04-30 Thread Robert Sjoblom
What's who and whos? They're matlab functions: who lists the variables currently in the workspace. whos lists the current variables and their sizes and types. It also reports the totals for sizes. -- best regards, Robert S. ___ Tutor maillist -

Re: [Tutor] question about listing variables defined since session started

2012-04-30 Thread Steven D'Aprano
Robert Sjoblom wrote: On 30 April 2012 23:25, Comer Duncan comer.dun...@gmail.com wrote: Hi, I have a newbie type question. Say I have started a python (or ipython) session and have done some imports and have also defined some new variables since the session started. So, I have in my current

[Tutor] Question about login=''.join(choice(lc) for j in range(llen))

2012-04-03 Thread Khalid Al-Ghamdi
Hi, The following code tries to generate some dummy data for regex exercises. My question is in reference the line before last: dom=.join(choice(lc) for j in range (dlen)) how does the interpreter know what j is supposed to refer to when it was not mentioned prior? from random import

Re: [Tutor] Question about login=''.join(choice(lc) for j in range(llen))

2012-04-03 Thread Emile van Sebille
On 4/3/2012 7:54 AM Khalid Al-Ghamdi said... Hi, The following code tries to generate some dummy data for regex exercises. My question is in reference the line before last: dom=.join(choice(lc) for j in range (dlen)) how does the interpreter know what j is supposed to refer to when it

<    1   2   3   4   5   6   7   8   9   10   >