[Tutor] Where to store test-code?

2019-06-13 Thread Thomas Güttler
that there are several ways. I know that all these ways work. Nevertheless it would be great to have a sane default. If there is a guideline IDEs could assist to create new tests at a common location. Related: https://youtrack.jetbrains.com/issue/JT-53069 Regards, Thomas -- Thomas Guettler http

[Tutor] Next steps after creating virtualenv (new github project)?

2019-03-03 Thread Thomas Güttler Lists
want to store my small project in git and upload it to github later. What is the best practice for the directory layout? Are there (official) docs how to start a new project after creating the virtualenv? Regards,   Thomas Güttler -- Thomas Guettler http://www.thomas-guettler.de/ I am

Re: [Tutor] Percentage of installations without setuptools (Was if __name__=='__main__' ...)

2017-08-14 Thread Thomas Güttler
Am 13.08.2017 um 02:12 schrieb Steven D'Aprano: On Fri, Aug 11, 2017 at 02:35:00PM +0200, Thomas Güttler wrote: How high is the percentage of python installation which don't have setuptools? I have no clue. Is it 5%, 10%, 15% ...? I know there is no definite answer to this question

[Tutor] Percentage of installations without setuptools (Was if __name__=='__main__' ...)

2017-08-11 Thread Thomas Güttler
. Is it 5%, 10%, 15% ...? I know there is no definite answer to this question. But you can guess this better than me. Regards, Thomas Güttler Am 10.08.2017 um 12:01 schrieb Chris Warrick: > On 9 August 2017 at 23:15, Steven D'Aprano <st...@pearwood.info> wrote: >> On Tue, Aug

[Tutor] The sane default choice is entry_points console_scripts Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-09 Thread Thomas Güttler
Am 08.08.2017 um 12:56 schrieb Chris Warrick: On 8 August 2017 at 03:30, Ben Finney <ben+pyt...@benfinney.id.au> wrote: Thomas Güttler <guettl...@thomas-guettler.de> writes: Why is "the sane default is 'use console_scripts entry-point in setup.py'" not a good answer?

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-07 Thread Thomas Güttler
Am 05.08.2017 um 06:14 schrieb Ben Finney: Thomas Güttler <guettl...@thomas-guettler.de> writes: The underlaying question is: Imangine you are a newcomer. A newcomer is in a tough position when it comes to packaging and distributing Python code, especially the command-line pr

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-04 Thread Thomas Güttler
Am 04.08.2017 um 02:50 schrieb Ben Finney: Thomas Güttler <guettl...@thomas-guettler.de> writes: Why are there two ways: "script" vs "console_scripts entry-point"? Because Distutils implements only ‘scripts’, and that's not capable enough for what people need so S

[Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-03 Thread Thomas Güttler
Am 02.08.2017 um 18:06 schrieb Wolfgang Maier: On 08/02/2017 04:57 PM, Steven D'Aprano wrote: On Wed, Aug 02, 2017 at 10:48:39PM +1000, Ben Finney wrote: Thomas Güttler <guettl...@thomas-guettler.de> writes: Maybe I am doing something wrong. I was proud because I did use “console_s

Re: [Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-02 Thread Thomas Güttler
Am 02.08.2017 um 05:51 schrieb Steven D'Aprano: On Wed, Aug 02, 2017 at 11:22:00AM +1000, Ben Finney wrote: Steven D'Aprano <st...@pearwood.info> writes: On Tue, Aug 01, 2017 at 04:54:40PM +0200, Thomas Güttler wrote: [...] I use Python since several years and I use console_

Re: [Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-02 Thread Thomas Güttler
the difference between python scripts and python code files. Regards, thomas -- Thomas Guettler http://www.thomas-guettler.de/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] __main__.py file Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-02 Thread Thomas Güttler
a setup.py), as opposed to just putting the script somewhere in $PATH. Up to now I never did this. Maybe I will do this in the future. thank you, Thomas Güttler -- Thomas Guettler http://www.thomas-guettler.de/ ___ Tutor maillist - Tutor@python.org

[Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-01 Thread Thomas Güttler
ears and I use console_script in entry_points of setup.py. I am very unsure if this is the right way if you want to teach a new comers the joy of python. In the current context we want to translate a bunch of shell scripts to python scripts. What do you think? Regards, Thomas Güttler

Re: [Tutor] classproperty: readonly and inheritance - not more needed

2017-04-24 Thread Thomas Güttler
stand you. Thank you Regards, Thomas Güttler -- Thomas Guettler http://www.thomas-guettler.de/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] classproperty: readonly and inheritance - not more needed

2017-04-23 Thread Thomas Güttler
Am 20.04.2017 um 14:26 schrieb Steven D'Aprano: On Thu, Apr 20, 2017 at 10:39:57AM +0200, Thomas Güttler wrote: - its hard to get classproperty to work right. What is "righ"? In my case a read-only classproperty is enough. Inheritance should be supported. I don't have

[Tutor] classproperty: readonly and inheritance - not more needed

2017-04-20 Thread Thomas Güttler
Am 19.04.2017 um 11:16 schrieb Steven D'Aprano: On Wed, Apr 19, 2017 at 09:28:26AM +0200, Thomas Güttler wrote: [code for a classproperty] Nice, if it is that simple. Is there a reason why this is not in the standard library? I haven't had a chance to test Peter's classproperty code yet

[Tutor] classproperty, three times in virtualenv

2017-04-20 Thread Thomas Güttler
Am 19.04.2017 um 09:43 schrieb Alan Gauld via Tutor: On 19/04/17 08:28, Thomas Güttler wrote: Nice, if it is that simple. Is there a reason why this is not in the standard library? Probably because it is such a rare use case and because its not that hard to do yourself if you really need

Re: [Tutor] classproperty for Python 2.7 (read-only enough)

2017-04-19 Thread Thomas Güttler
Am 18.04.2017 um 13:17 schrieb Peter Otten: Thomas Güttler wrote: I would like to have read-only class properties in Python. I found this http://stackoverflow.com/questions/128573/using-property-on-classmethods But there are a lot of discussions of things which I don't understand. I want

[Tutor] classproperty for Python 2.7 (read-only enough)

2017-04-18 Thread Thomas Güttler
. Regards, Thomas Güttler -- Thomas Guettler http://www.thomas-guettler.de/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] NumPy and SciPy

2016-09-27 Thread Floeck, Thomas
Hi there, you have an idea where I can find NumPy and SciPy windows *.exe-files for Python 3.5? Thanks for any help! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] Practice Exercises for Beginner ? :p:

2016-06-03 Thread Thomas C. Hicks
On Jun 2, 2016, at 16:43, Andrei Colta wrote: Hi, Anyone can recommend practical work on learning python.. seems reading and reading does not helping. Thanks in advance, Andrei I would echo those saying "make something" - for me the thing that really moved me

Re: [Tutor] Semantic Error: Trying to access elements of list and append to empty list with for loop

2016-06-02 Thread Olaoluwa Thomas
WordExtract.py since it does just that. :) *Warm regards,* *Olaoluwa O. Thomas,* *+2347068392705* On Thu, Jun 2, 2016 at 6:44 PM, Steven D'Aprano <st...@pearwood.info> wrote: > On Thu, Jun 02, 2016 at 06:05:43PM +0100, Olaoluwa Thomas wrote: > > > fname = raw_input('Enter file

[Tutor] Semantic Error: Trying to access elements of list and append to empty list with for loop

2016-06-02 Thread Olaoluwa Thomas
hot [image: Inline image 2] whereas I want only one list containing strings not nested lists. Any help would be appreciated. *Warm regards,* *Olaoluwa O. Thomas,* *+2347068392705* ___ Tutor maillist - Tutor@python.org To unsubscribe or change su

Re: [Tutor] Issues converting a script to a functioin (or something) [SOLVED]

2016-05-01 Thread Olaoluwa Thomas
Gotcha. *Warm regards,* *Olaoluwa O. Thomas,* *+2347068392705* On Sun, May 1, 2016 at 7:14 PM, Alan Gauld via Tutor <tutor@python.org> wrote: > On 01/05/16 14:38, Olaoluwa Thomas wrote: > > > Thanks for your feedback. Please do not hesitate to provide more as I > shall >

Re: [Tutor] Issues converting a script to a functioin (or something) [SOLVED]

2016-05-01 Thread Olaoluwa Thomas
enath...@gmail.com> wrote: > On Sun, May 01, 2016 at 5:34 PM, Olaoluwa Thomas <thomasolaol...@gmail.com> > wrote: > > The novice Python programmer is back. > > I'm trying to incorporate a function and its call in the GrossPay.py > script > that Alan solved for me

[Tutor] Issues converting a script to a functioin (or something)

2016-05-01 Thread Olaoluwa Thomas
<= 40: gross = hours * rate print "Your Gross pay is "+str(round(gross, 4)) computepay() What am I doing wrong? *Warm regards,* *Olaoluwa O. Thomas,* *+2347068392705* ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] Issue with Code [SOLVED]

2016-04-30 Thread Olaoluwa Thomas
o make it more responsive. Thanks a lot! *Warm regards,* *Olaoluwa O. Thomas,* *+2347068392705* On Sun, May 1, 2016 at 2:00 AM, Alan Gauld via Tutor <tutor@python.org> wrote: > On 01/05/16 01:16, Alan Gauld via Tutor wrote: > > > I can't see anything obviously wrong in your co

[Tutor] Fwd: Issue with Code

2016-04-30 Thread Olaoluwa Thomas
Hi All, I sent this forwarded email earlier but hadn't subscribed to the mailing list so I guess that's why I didn't get a response. Please review and advise. *Warm regards,* *Olaoluwa O. Thomas,* *+2347068392705* -- Forwarded message -- From: Olaoluwa Thomas <thomasol

[Tutor] Issue with Code

2016-04-30 Thread Olaoluwa Thomas
appreciate a logical explanation for why the "else" statement in the 2nd script isn't working properly. I'm running Python v2.7.8 on a Windows 7 Ultimate VM via Command prompt and my scripts are created and edited via Notepad++ v6.7.3 *Warm regards,* *Olaoluwa O. Thomas,* *+2347068392705* hou

Re: [Tutor] Recommendations for best tool to write/run Python :p:

2016-03-03 Thread Thomas C. Hicks
used Ipython (now Jupyter) for teaching my kids programming in middle and high school. === Thomas C. Hicks, MD, MPH Training Manager Gansu Gateway, Lanzhou, Gansu ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Recommendations for best tool to write/run Python :p:

2016-03-03 Thread Thomas C. Hicks
Matt, As a physician myself just getting into the world of teaching computer programming I would be very interested to know what you teach to the doctors. Feel free to reply off list, would love to discuss this! === Thomas C. Hicks, MD, MPH Training Manager Gansu Gateway

Re: [Tutor] Create complex dictionary :p:

2015-10-22 Thread Thomas C. Hicks
On 10/23/2015 05:19 AM, jarod_v6--- via Tutor wrote: Hi!!I would like to prepare a dictionary with complex structure: complex = {name ="value",surname="po",age=poi) What is the most pythonic way to build a dictionary of dictionary?thanks for any help! This doesn't look too complex so I

Re: [Tutor] Create complex dictionary :p: :p:

2015-10-22 Thread Thomas C. Hicks
On 10/23/2015 05:59 AM, Alex Kleider wrote: mydict = dict('name'='value', 'surname'='po','age'='poi') Oops, you are correct! Don't want to put the key names in quotes, I mistyped my experiment. SDG, tom ___ Tutor maillist - Tutor@python.org To

[Tutor] tkinter in Python 3

2015-08-27 Thread Michael Thomas
I'm trying to move a Python 2.x program to Python 3.x. When I try to import tkinter I get the error message that no module _tkinter can be found. I've tried sudo apt-get install python-tk. While this command works, there is no difference in the result. This problem has only cropped up after I

Re: [Tutor] Pytest help :p:

2015-07-07 Thread Thomas C. Hicks
list is outstanding, civil, knowledgable people really wanting to help. == Thomas C. Hicks, MD, MPH Training Manager, Gansu Gateway Lanzhou, Gansu, PR China ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] creat a program that reads frequency of words in file :p:

2015-06-01 Thread Thomas C. Hicks
On 06/01/2015 05:56 PM, Alan Gauld wrote: if text in line: count += 1 print(This word appears, count, times in the file) And this is, of course, completely off track. You need to split the line into its separate words and store each word into the dictionary. OP may want to

Re: [Tutor] Integrating TDD into my current project work-flows :p:

2015-05-05 Thread Thomas C. Hicks
really drove that idea and its implementation home for me. I believe the user story idea first shows up in chapter 2 of the book. thomas ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org

Re: [Tutor] How to output dictionary data to CSV file :p:

2015-04-28 Thread Thomas C. Hicks
On 04/28/2015 09:43 PM, Alan Gauld wrote: You could consider JSON too. JSON looks a lot like a Python dictionary of strings so is almost a perfect match to your data. Sounds great, I'll check it out. Thanks! thomas == Thomas C. Hicks, MD, MPH Training Manager

Re: [Tutor] How to output dictionary data to CSV file :p:

2015-04-28 Thread Thomas C. Hicks
methods. How rude of me, I neglected to note I am using Python 3.4.3. And now you're top-posting to make it even worse;) Lesson learned! thomas ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https

[Tutor] Variable data to CSV

2015-02-27 Thread Thomas Toker
Hey all so I'm new to python(like 2 days ago new) I need to find the device address, usb port, and number of times the error occurs Heres what I have:  import re import csv import reimport csvf = open(file.txt, r) #location of log file searchlines = f.readlines()                   #create list

[Tutor] I am teaching my students Python the second semester using www.LearnStreet.com ( http://www.learnstreet.com/ ). I am in need of some help. I am having a problem with the Lists-Set 1 exercise 1

2014-02-04 Thread Thomas Maher
I am teaching my students Python the second semester using www.LearnStreet.com ( http://www.learnstreet.com/ ). I am in need of some help. I am having a problem with the Lists-Set 1 exercise 18. The problem is below. I have put in several codes and the output is 5, which is the right

[Tutor] Web scrapping

2013-12-12 Thread Amal Thomas
Hi, I am new to python3. I am working in computational biology. I need to submit many sequence (one by one) to a http web server ( http://mfold.rna.albany.edu/?q=mfold/RNA-Folding-Form) . After the processing I need to download the output file. There is an offline package for this server but

Re: [Tutor] Web scrapping

2013-12-12 Thread Amal Thomas
-Form ) 3. Then further steps downloading the output.. Thanks, On Fri, Dec 13, 2013 at 12:19 AM, Joel Goldstick joel.goldst...@gmail.comwrote: On Thu, Dec 12, 2013 at 1:41 PM, Amal Thomas amalthomas...@gmail.comwrote: Hi, I am new to python3. I am working in computational biology. I need

Re: [Tutor] Web scrapping

2013-12-12 Thread Amal Thomas
On Fri, Dec 13, 2013 at 12:29 AM, Joel Goldstick joel.goldst...@gmail.comwrote: So, read the Requests tutorial, and study the POST examples as POST is the http method that is used when filling in a form. First you will need to examine the form to learn the names of the fields you need to

[Tutor] Need to create code

2013-12-10 Thread Matthew Thomas
Write a function named SSN2Name with an interactive loop. The function takes the dictionary named data as input argument where this dictionary stores the key, value pairs of SSN, name of person. The SSN is in the string format 'xxx-xx-' and name is also a string. Each iteration of the

Re: [Tutor] Load Entire File into memory

2013-11-05 Thread Amal Thomas
On Mon, Nov 4, 2013 at 10:00 PM, Steven D'Aprano st...@pearwood.info wrote: import os filename = YOUR FILE NAME HERE print(File size:, os.stat(filename).st_size) f = open(filename) content = f.read() print(Length of content actually read:, len(content)) print(Current file position:,

[Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
this. Working on Python 3.3.1,ubuntu 13.04(Linux 3.8.0-29-generic x64) Thanks -- *AMAL THOMAS * ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
:07, Amal Thomas wrote: I am currently using this method to load my text file: *f = open(output.txt) content=io.StringIO(f.read()) f.close()* But I have found that this method uses 4 times the size of text file. So why not use f = open(output.txt) content=f.read() f.close

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
Yes I have found that after loading to RAM and then reading lines by lines saves a huge amount of time since my text files are very huge. On Mon, Nov 4, 2013 at 6:46 PM, Alan Gauld alan.ga...@btinternet.comwrote: On 04/11/13 13:06, Amal Thomas wrote: Present code: *f = open(output.txt

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
in time. Thanks, On Mon, Nov 4, 2013 at 7:11 PM, Peter Otten __pete...@web.de wrote: Amal Thomas wrote: Yes I have found that after loading to RAM and then reading lines by lines saves a huge amount of time since my text files are very huge. How exactly did you find out? You should only

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
, Nov 4, 2013 at 7:16 PM, William Ray Wing w...@mac.com wrote: On Nov 4, 2013, at 8:30 AM, Amal Thomas amalthomas...@gmail.com wrote: How long are the lines in your file? In particular, are they many hundreds or thousands of characters long, or are they only few hundred characters, say 200

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
@Dave: thanks.. By the way I am running my codes on a server with about 100GB ram but I cant afford my code to use 4-5 times the size of the text file. Now I am using read() / readlines() , these seems to be more efficient in memory usage than io.StringIO(f.read()). On Mon, Nov 4, 2013 at 9:23

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
that is clear and understandable, then try to optimize it if necessary. -- *AMAL THOMAS* ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
= open(filename) content = f.read() print(Length of content actually read:, len(content)) print(Current file position:, f.tell()) f.close() and send us the output. -- *AMAL THOMAS* ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor -- *AMAL THOMAS* ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Which version of python should i use?

2013-05-20 Thread Amal Thomas
hi, I am a beginner. I am using a unix sytem (ubuntu 12.10). Python 2.7.3 is installed in my system. I found out that Python has version upto 3.3.2. Should I update my python version? Is the syntaxes of the each version different? Thanks, Thomas

Re: [Tutor] Which version of python should i use?

2013-05-20 Thread Amal Thomas
Thank you very much..!! I am starting to learn python for my Bioinformatics work, so I would look for the version that has libraries helpful for me.. On Mon, May 20, 2013 at 6:38 PM, Dave Angel da...@davea.name wrote: On 05/20/2013 05:59 AM, Amal Thomas wrote: hi, I am a beginner. I am

Re: [Tutor] Random Number Game: Returns always the same number - why?

2013-05-20 Thread Thomas Murphy
Mitya, Why is it best in this situation to use range() rather than a while loop? Curious about best practices for the various iterating functions. Thanks! There are a few issues here: * variable names should be lower case * for this case it's best to use for loop with range() * you calculate

Re: [Tutor] writing effective unittests

2013-01-03 Thread Luke Thomas Mergner
* Albert-Jan Roskam fo...@yahoo.com wrote: Hi, I am trying to learn a bit of test-driven programming using unittests and nosetests. I am having trouble finding resources that explain how to write effective tests. I am not a programmer or a student, so I do not have access

[Tutor] writing effective unittests

2013-01-02 Thread Luke Thomas Mergner
tutorial that I've missed. Based on the O'Reilly 2-Part introduction, I hope that learning to write tests will make my code better. Thanks, -- Luke Thomas Mergner Glendale, CA Sent from Mutt. ___ Tutor maillist - Tutor@python.org To unsubscribe

[Tutor] Displaying data in columns

2012-05-07 Thread Thomas C. Hicks
and prints out the columns but am hoping there is a more elegant solution. I am not against reading documentation, just can't find the right module to read about. thomas ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options

[Tutor] How do you save work in progress in Pyscripter ?

2012-04-06 Thread Thomas Mujica
Please help a newbie Was able to write and successfully run this but I can't seem to be able to save it Luckily I had saved it to Word and then I was able to copy and paste it back into PyScripter. I'm using Python Scripter Version 2.5.3.0 x86 *** Python 2.7.2 (default, Jun 12

[Tutor] Datetime objects

2012-03-16 Thread Luke Thomas Mergner
Hi, I am having trouble comparing two datetime objects. Using Sqlalchemy I save a string as a date into an sqlite field (which has no native date format, I gather). import datetime as dt date_obj = dt.datetime.strptime(date_string,'%m.%d.%Y') I want to compare that date later with an

Re: [Tutor] creating dict of dict : similar to perl hash of hash

2012-03-06 Thread Thomas Maier
'}{'anotherstring'} = 'string2'; Thomas ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Debugging While Loops for Control

2012-02-16 Thread Luke Thomas Mergner
-- Message: 1 Date: Wed, 15 Feb 2012 23:57:08 -0500 From: Luke Thomas Mergner lmerg...@gmail.com To: tutor@python.org Subject: [Tutor] Debugging While Loops for Control Message-ID: a8bdf988-fe78-4ca1-8cb7-c0a0e68fd

[Tutor] Debugging While Loops for Control

2012-02-15 Thread Luke Thomas Mergner
Hi, I've been translating and extending the Blackjack project from codeacademy.com into Python. My efforts so far are here: https://gist.github.com/1842131 My problem is that I am using two functions that return True or False to determine whether the player receives another card. Because of

[Tutor] Testing dymamically created methods

2012-01-10 Thread Thomas Maier
. Sorry for my ignorance, I just started to learn Python last week. Thanks, Thomas ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Testing dymamically created methods

2012-01-10 Thread Thomas Maier
On Tue, Jan 10, 2012 at 3:31 PM, Walter Prins wpr...@gmail.com wrote: Hi, On 10 January 2012 12:15, Thomas Maier hay...@gmail.com wrote: This code works without py.test or nosetests. For example if I use print instead of 'assert'. Both py.test and nosetests failed to execute this correctly

[Tutor] Wading through traceback output

2011-12-26 Thread Thomas C. Hicks
it is saying is that there is a problem with my Python libraries but this is not a problem I have ever seen before. Is it possible the 2.6 libraries were updated in the hiatus time causing this problem? If so any ideas on how I can investigate fixing this are appreciated. thomas

Re: [Tutor] Wading through traceback output :p:

2011-12-26 Thread Thomas C. Hicks
On Mon, 26 Dec 2011 07:10:45 -0500 Alan Gauld alan.ga...@btinternet.com wrote: On 26/12/11 11:42, Thomas C. Hicks wrote: Given it was working before and not now the obvious question is what has changed? It looks like you are on a Linux box so do you have automatic updates switched on? Or do

Re: [Tutor] Assigning range :p:

2011-07-27 Thread Thomas C. Hicks
On Wed, 27 Jul 2011 20:16:31 -0400 Alexander Quest alexxqu...@gmail.com wrote: Does anyone know how to assign a certain numerical range to a variable, and then choose the number that is the middle of that range? For example, I want to assign the variable X a range between 1 and 50, and then I

[Tutor] Logger object not passed between modules

2011-07-26 Thread Luke Thomas Mergner
('In frame __init__, the size is : ', self.GetSize) $ python app.py logging.Logger object at 0x105a1a110 logging.Logger object at 0x105a1a450 --The log prints -- 2011-07-26 01:39:07,642 - Main - INFO - Starting log... 2011-07-26 01:39:11,078 - Main - INFO - Shutting down main app. Luke Thomas

[Tutor] IDLE/tk in 10.6

2011-07-15 Thread Luke Thomas Mergner
Hi, I am not a professional programmer, but just trying to learn. I'm running Mac 10.6 Snow Leopard. I used MacPorts to install python26, python27, and python3. My python interpreter loads 2.7.2 after I ran the python_select command, which is added via MacPorts I think. I'd like to try

Re: [Tutor] voluntary work :p:

2011-04-25 Thread Thomas C. Hicks
On Mon, 25 Apr 2011 15:09:02 -0400 Rafael Durán Castañeda rafadurancastan...@gmail.com wrote: I recommend you visit www.pythonchallenge.comhttp://www.pythonchallenge.com On 25/04/11 20:42, Wolf Halton wrote: Learn Python the Hard Way is pretty cool. I am always looking for books that lay

Re: [Tutor] While Loops: Coin Flip Game :p:

2010-11-14 Thread Thomas C. Hicks
On Sun, 14 Nov 2010 17:16:36 -0500 Dawn Samson sd...@live.ca wrote: Greetings, I'm a Python beginner and working my way through Michael Dawson's Python Programming for the Absolute Beginner. I'm stuck in a particular challenge that asks me to write a program that flips a coin 100 times and

[Tutor] monodevelop 2.2

2010-08-21 Thread Thomas
I was wondering if someone could tell me if you can use the gui designer in monodevelop 2.2+ with python. Thanks, Thomas ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo

Re: [Tutor] string to list

2010-08-05 Thread Thomas C. Hicks
On Thu, 5 Aug 2010 03:40:55 -0400 Sander Sweers sander.swe...@gmail.com wrote: On 5 August 2010 06:38, Vikram K kpguy1...@gmail.com wrote: Suppose i have this string: z = 'AT/CG' How do i get this list: zlist = ['A','T/C','G'] If you know the format of the string is always the

Re: [Tutor] how to do excel in python

2010-08-05 Thread Thomas C. Hicks
On Thu, 5 Aug 2010 10:08:59 -0400 invincible patriot invincible_patr...@hotmail.com wrote: hi, can any one tell me how can I access MS excel worksheet in python and how can I access itz individual cells..?? I have had good luck with the xlrd and xlwt modules, you can get them at

Re: [Tutor] Help return a pattern from list

2010-07-05 Thread Thomas C. Hicks
this? Thanks Vin I use the fnmatch module: import fnmatch fileList = [something1.mp3,something2.mp3,something4.pdf,something5.odt] pattern='*.mp3' for x in fnmatch.filter(fileList,pattern): #do something to your files or list items here thomas

[Tutor] Suggestions for output on multiple platforms

2010-06-29 Thread Thomas C. Hicks
not sure it will be readable under Mac and Windows. Any ideas are welcome! thomas ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Iterating through a list of strings

2010-05-04 Thread Thomas C. Hicks
Wow, this is great! I appreciate all the pointers, lots to keep learning here. thomas ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Iterating through a list of strings

2010-05-03 Thread Thomas C. Hicks
processing the items in the list and using the string function x.startswith() and the list function list.remove(). Interestingly if I put in print x in place of the lines.remove(x) line I get all the comment lines printed. Can anyone point me in the right direction? thomas

Re: [Tutor] Saving class instances

2009-07-14 Thread Thomas Scrace
On 13 Jul 2009, at 22:04, Alan Gauld alan.ga...@btinternet.com wrote: That's one way and you can find an example and some advice on how to handle subclassing in the OOP topic of my tutor. Wow; thanks! That tutorial was really useful, I will have to check out the rest of the site

[Tutor] Saving class instances

2009-07-13 Thread Thomas Scrace
Hi everyone, I am new to Python (and to programming) and, now that I have worked through most of Learning Python, I have set myself the exercise of writing a little text-based program to catalogue the contents of my CD collection. I have written enough code to allow me to create

Re: [Tutor] Saving class instances

2009-07-13 Thread Thomas Scrace
I think I will give both approaches a go, since this is just a learning exercise anyway. Thanks very much for your help. Oh, and sorry for accidentally quoting the whole digest last time. Won't happen again! Tom On 13 Jul 2009, at 17:53, tutor-requ...@python.org wrote: I think you are

[Tutor] Building VST's with Python

2009-04-16 Thread Logan Thomas
I'm new to python but do have a little programming knowledge with C++I got into programming so I could build Virtual Instruments because I love the world of sound and creating instruments that shape it...I have tried to find a program that would be an ideal vehicle for this task...I've

Re: [Tutor] Lucky Boy Sudhir wants to chat

2008-12-17 Thread Williams, Thomas (DSHS/RDA)
Thank you Tom -Original Message- From: Kent Johnson [mailto:ken...@tds.net] Sent: Wednesday, December 17, 2008 6:52 AM To: Lucky Boy Sudhir Cc: tutor@python.org Subject: Re: [Tutor] Lucky Boy Sudhir wants to chat I have unsubscribed Lucky Boy from the list as he is just spamming it.

Re: [Tutor] XML to text

2008-10-24 Thread Thomas Walch
This might be helpful: http://www.boddie.org.uk/python/XML_intro.html Have fun! Thomas Dinesh B Vadhia schrieb: I have a large number of xml files that I want to convert into text format. What is the best and easiest way to do this? Thanks! Dinesh

Re: [Tutor] Decimals 'not equal to themselves' (e.g. 0.2 equals 0.200000001)

2008-08-03 Thread Thomas Pani
import Decimal In [3]: Decimal('0.2') * 2 Out[3]: Decimal(0.4) thomas ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Unable to Reconfigure IDLE

2008-07-28 Thread Thomas Corbett
On Jul 27, 2008, at 7:16 AM, Tim Golden wrote: Thomas Corbett wrote: On Jul 26, 2008, at 9:02 AM, Alan Gauld wrote: Thomas Corbett [EMAIL PROTECTED] wrote Configured shell window to wrong size, now can't seem to find the menu (Options Configure) to resize the shell. Don't you just

[Tutor] Unable to Reconfigure IDLE

2008-07-26 Thread Thomas Corbett
Running IDLE 1.2.2 under MacPython 2.5 on Mac OS X 5.1. Configured shell window to wrong size, now can't seem to find the menu (Options Configure) to resize the shell. Tried going to username Library Preferences and removing org.python* files, but that did not work. Thanks!

Re: [Tutor] Unable to Reconfigure IDLE

2008-07-26 Thread Thomas Corbett
On Jul 26, 2008, at 9:02 AM, Alan Gauld wrote: Thomas Corbett [EMAIL PROTECTED] wrote Configured shell window to wrong size, now can't seem to find the menu (Options Configure) to resize the shell. Don't you just resize it then close it and the next time it opens it uses the new size

Re: [Tutor] listing classes

2008-05-20 Thread Thomas Pani
Hi, dir(A) will essentially give you what you want (and a little more) If you're only interested in classes, you can do something like: import types [ name for name in dir(A) if type(eval('A.'+name)) == types.ClassType ] Thomas Laureano Arcanio wrote: Hi All, I need to have a listing

Re: [Tutor] Open a directory in the default file manager

2008-05-16 Thread Thomas Pani
can spawn xdg-open (from xdg-utils) from Python. This will autodetect gnome, kde and xfce and use their tools (gnome-open, kfmclient, exo-open). I think on OS X/Darwin there's a similar utility called `open'. You can use sys.platform to determine which system you're running on. thomas

[Tutor] SOAPpy and ZSI

2008-03-26 Thread Dan Thomas-Paquin
Hi, I've been tasked with setting up a basic SOAP client and I'm its been the most frustrating python experience. Here's the code: from LoginService_services import * import sys from SOAPpy import SOAPProxy # get a port proxy instance loc = LoginServiceLocator() port =

Re: [Tutor] Question on multithreading

2008-02-24 Thread Thomas Pani
this might be helpful: http://wiki.wxpython.org/LongRunningTasks Cheers, Thomas Pani Varsha Purohit wrote: Hello, i have a gui program in wxpython where i am spawning two threads. one for the mainloop of gui and other for some background tasks. I have to stop the background running thread

Re: [Tutor] opening a pipe?

2008-02-12 Thread Thomas Pani
assume you know that you can just open a file for reading instead of piping cat. thomas James Hartley wrote: A Perl script can easily serve as a filter within a pipe as seen in the following: use strict; use warnings; open(IN, 'cat hello.txt |') or die 'unable to open file'; while

Re: [Tutor] A bit about python culture

2008-02-07 Thread Thomas B.Døderlein
-project.dk pythonprogram.dk These might be used for project subdomains, then the programmers might add their name in E-mail adresses. Doing this you will also marked Python projects + making people aware of Python as a programming language. Just a thought :) BR Thomas

Re: [Tutor] Bad time to get into Python?

2008-02-03 Thread Thomas Pani
to maintain 2.6 and 3.0 in parallel, conversion should be easy enough. Cheers, thomas pani [1] http://docs.python.org/dev/3.0/whatsnew/3.0.html [2] http://www.python.org/dev/peps/pep-3000/ ___ Tutor maillist - Tutor@python.org http://mail.python.org

[Tutor] regex eats even when not hungry

2007-02-16 Thread Thomas
? Many thanks in advance, Thomas ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] class methods as argument

2007-02-10 Thread thomas coopman
Hi, I want to do something like this, don't know how to properly explain it, so I just give you some example code class Foo(object): def method(self, arg): print arg def doSomething(object, func): object.func(test) object = Foo() doSomething(object, Foo.method) I want

  1   2   >