[Tutor] Where to store test-code?

2019-06-13 Thread Thomas Güttler
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
nv/bin I 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-guettle

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 que

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

2017-08-11 Thread Thomas Güttler
ve no clue. 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 wrote: >> On Tue, Aug 08, 2017 at

[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 wrote: Thomas Güttler writes: Why is "the sane default is 'use console_scripts entry-point in setup.py'" not a good answer? Because third-party Setuptools is required for entry point

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 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 programs. There has been significant progress

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 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 Setuptools implements entry poi

[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 writes: Maybe I am doing something wrong. I was proud because I did use “console_scripts” entry points. Did so

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 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_script in entry_points o

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

2017-08-02 Thread Thomas Güttler
w 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
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 To

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

2017-08-01 Thread Thomas Güttler
several years 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

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

2017-04-24 Thread Thomas Güttler
es, now I understand 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

[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 classpr

[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 wa

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

2017-04-18 Thread Thomas Güttler
s or loops. 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: https://mail.python.org/mailman/listinfo/tutor

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 forward was doing a data projec

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

2016-06-02 Thread Olaoluwa Thomas
.sort() print lst I named the file 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 wrote: > On Thu, Jun 02, 2016 at 06:05:43PM +0100, Olaoluwa Thomas wrote: > > > fname = raw_input

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

2016-06-02 Thread Olaoluwa Thomas
the output in the attached screenshot [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@pyt

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 wrote: > On 01/05/16 14:38, Olaoluwa Thomas wrote: > > > Thanks for your feedback. Please do not hesitate to provide more as I > shall > > email you per

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

2016-05-01 Thread Olaoluwa Thomas
wrote: > On Sun, May 01, 2016 at 5:34 PM, Olaoluwa Thomas > 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. > It computes total pay based on two in

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

2016-05-01 Thread Olaoluwa Thomas
e) elif hours >= 0 and hours <= 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 -

Re: [Tutor] Issue with Code [SOLVED]

2016-04-30 Thread Olaoluwa Thomas
ay is "+str(round(gross, 4)) I'm gonna add Try and Except to 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 wrote: > On 01/05/16 01:16, Alan Gauld via Tutor wrote: > > > I c

[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

[Tutor] Issue with Code

2016-04-30 Thread Olaoluwa Thomas
I would 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,*

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: :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 uns

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 am

[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 chang

Re: [Tutor] Pytest help :p:

2015-07-07 Thread Thomas C. Hicks
gt; mailing 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 unsubscrib

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

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

2015-05-05 Thread Thomas C. Hicks
Django development 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.pyth

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 Ma

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

2015-04-28 Thread Thomas C. Hicks
for! Thanks, apparently my knowledge deficit is in understanding dictionary 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 maillis

[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 answer.

Re: [Tutor] Web scrapping

2013-12-12 Thread Amal Thomas
On Fri, Dec 13, 2013 at 12:29 AM, Joel Goldstick wrote: > > > 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 provide data > for. >

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 wrote: > > > > On Thu, Dec 12, 2013 at 1:41 PM, Amal Thomas wrote: > >> Hi, >> >> I am new to python3. I am working in computational biology. I need t

[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 cer

[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 func

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 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:", f.tell(

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
ry efficiency is easy, do it line by line off the disk. > > This assumes that you can process one line at a time, sequentially. I > expect that is not the case. > > > -- > Steven > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscript

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
filename).st_size) f = 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 - T

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
way 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
@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 P

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
Mon, Nov 4, 2013 at 7:16 PM, William Ray Wing wrote: > On Nov 4, 2013, at 8:30 AM, Amal Thomas 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 or less? > > U

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. > >

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 wrote: > On 04/11/13 13:06, Amal Thomas wrote: > > Present code: >> >> >> *f = op

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
f.close()for lines in content: * *content.close()* Now I have found that memory use is roughly 1.5 times the size of text file. Previously it was around 4-5 times. Its remarkable change. Waiting for more suggestions. Thanks, On Mon, Nov 4, 2013 at 5:05 PM, Alan Gauld wrote: > On 04/11/13 11:07

[Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
to do 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] 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 calcul

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 wrote: > On 05/20/2013 05:59 AM, Amal Thomas wrote: > >> hi, >> I am a begi

[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] writing effective unittests

2013-01-03 Thread Luke Thomas Mergner
* Albert-Jan Roskam 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 to

[Tutor] writing effective unittests

2013-01-02 Thread Luke Thomas Mergner
good 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

[Tutor] Displaying data in columns

2012-05-07 Thread Thomas C. Hicks
? I know I could write a function that reads the items, figures string lengths, adds padding white space 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] 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 1

[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 inp

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

2012-03-06 Thread Thomas Maier
cts, etc all at the same level: > > dict = {} > dict['mylist'] = [1,2,3] > dict['mystring'] = 'string' > dict['mynum'] = 4 > dict['anotherdict'] = {} > dict['anotherdict']['anotherstring'] = 'string2' > Hi David, Mixed data types in nested data structure are possible in Perl as well: %hash = (); $hash{'mylist'} = [1,2,3]; $hash{'mystring'} = 'string'; $hash{'mynum'} = 4; $hash{'anotherhash'} = {}; $hash{'anotherhash'}{'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 > To: tutor@python.org > Subject: [Tutor] Debugging While Loops for Control > Message-ID: > Content-Type

[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 th

Re: [Tutor] Testing dymamically created methods

2012-01-10 Thread Thomas Maier
On Tue, Jan 10, 2012 at 3:31 PM, Walter Prins wrote: > Hi, > > On 10 January 2012 12:15, Thomas Maier 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 execut

[Tutor] Testing dymamically created methods

2012-01-10 Thread Thomas Maier
d like to see test report for each method executed in 'for' loop. Is it possible? PS. 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] Wading through traceback output :p:

2011-12-26 Thread Thomas C. Hicks
On Mon, 26 Dec 2011 07:10:45 -0500 Alan Gauld 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

[Tutor] Wading through traceback output

2011-12-26 Thread Thomas C. Hicks
rror: More than 4094 XFs (styles) I don't understand this very well at all - any pointers are appreciated. I think what 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 t

Re: [Tutor] Assigning range :p:

2011-07-27 Thread Thomas C. Hicks
On Wed, 27 Jul 2011 20:16:31 -0400 Alexander Quest 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 want to have t

[Tutor] Logger object not passed between modules

2011-07-25 Thread Luke Thomas Mergner
gger. self.logger = logging.getLogger('Frame') # The argument shouldn't matter, as I follow the examples. print self.logger self.logger.info('In frame __init__, the size is : ', self.GetSize) $ python app.py --The log prints -- 2011-07-26 01:39:07,642 - Main - INFO

[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 IDL

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 wrote: > I recommend you visit > 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 it out well. Thank

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 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 then t

[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] how to do excel in python

2010-08-05 Thread Thomas C. Hicks
On Thu, 5 Aug 2010 10:08:59 -0400 invincible patriot 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 www.python-excel.org. The Google

Re: [Tutor] string to list

2010-08-05 Thread Thomas C. Hicks
On Thu, 5 Aug 2010 03:40:55 -0400 Sander Sweers wrote: > On 5 August 2010 06:38, Vikram K 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 same you can do > something lik

Re: [Tutor] Help return a pattern from list

2010-07-05 Thread Thomas C. Hicks
.mp3 extension. How to > go about doing 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

[Tutor] Suggestions for output on multiple platforms

2010-06-29 Thread Thomas C. Hicks
m 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-02 Thread Thomas C. Hicks
n't understand about 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 m

Re: [Tutor] Saving class instances

2009-07-14 Thread Thomas Scrace
On 13 Jul 2009, at 22:04, "Alan Gauld" 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 now. I am sure this has a

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 b

[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 instances

[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 narrowed

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. Ken

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
0002 In [2]: from decimal 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 resiz

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

[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] 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 ha

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

2008-05-16 Thread Thomas Pani
se a desktop environment, you 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

[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 = loc.getLogin(in0='pbs_uen',

Re: [Tutor] Question on multithreading

2008-02-24 Thread Thomas Pani
notes on this topic 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 >

Re: [Tutor] opening a pipe?

2008-02-12 Thread Thomas Pani
-- I 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 hell

Re: [Tutor] A bit about python culture

2008-02-07 Thread Thomas B.Døderlein
le .dk domains pyproject.dk pyprojects.dk python-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 programm

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

2008-02-03 Thread Thomas Pani
d time to learn Python. There will be some major changes in 3k, but as long as you don't have 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] Windows Python 2.5.1 IPV6 problems

2008-02-02 Thread Thomas DiZoglio
Hi, I'm trying to get some IPV6 python code running under Windows. I have installed Python 2.5.1 for Windows using the binaries from python.org. I'm a newbie to Python programming as well. The code works fine under Debian and MacOSX (both using Python 2.5) I have rebuilt the python binaries from

[Tutor] regex eats even when not hungry

2007-02-16 Thread Thomas
regex of ".*?" means any number of any characters, with a non-greedy hunger (so to speak) right? Any ideas on what is causing this to fail? Many thanks in advance, Thomas ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

  1   2   >