[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

[Tutor] pyGtk using combobox

2006-02-10 Thread thomas
Hi, I would like to make a combobox with a list of strings, but I have many problems with it. I know how to make the combobox and how to add strings, but is it possible to get a list of strings from the combobox and also is it possible to update the combobox with a list of strings? (something lik

[Tutor] property built-in

2006-10-19 Thread thomas
Hi, I was wondering some things about property. suppose I have a class like this: class A(object): def __init__(self, x, y): self.__x = x def x(): def get(self): return self.__x def set(self, x): self.__x = x #and some other code that

[Tutor] Read the builtin module source, also itchy ellipses.

2006-11-17 Thread Thomas
Hi, I sometimes find it useful to read the source code of a module and for example I can type string.__file__ to find the location of the string module. However the .__file__ method is not available for the module builtin. Is it possible to read the source code for built in functions and if so h

[Tutor] A Million Sevens

2006-11-17 Thread Thomas
Earlier today I typed the following into my pythonwin interactive interpreter in windows xp: int('7' * 10 ** 6) I expected either an error message or it to get stuck and require me to stop the process manually. I read that unlike long integers in C, longs in python are only limited by the amo

Re: [Tutor] A Million Sevens

2006-11-17 Thread Thomas
On 18/11/06, Chris Hengge <[EMAIL PROTECTED]> wrote: > Not that it changes your reply, but just for my own sanity: > int('7' * 10 ** 6) <- does this not just type-cast a char into an int? > > Meaning that rather then consuming 1024k as you stated, it would consume > 2048k at the peak of the calcul

[Tutor] difflib.SequenceMatcher with get_matching_blocks is incorrect

2006-12-04 Thread Thomas
s this function designed to give up when the input strings get too long? Thanks in advance, Thomas ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Organizing 15500 records, how?

2006-12-12 Thread Thomas
onaries of userid to field value. That way I'm dealing with 10 to 50 files instead of 15500. Also, I am inexperienced with using classes but eager to learn and wonder if they would be any help in this case. Any advise much appreciated and thanks in

[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

[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

[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

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

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

[Tutor] executing SAS and passing parameters

2005-02-08 Thread Williams, Thomas
Greetings,   I am trying to use python to run a SAS program by passing the needed parameters.  I am able to start SAS, but unable to start the correct SAS program with its parameters.   Any assistance you could provide will be appreciated.   Tom Williams DSHS - Research and Data Analy

RE: [Tutor] executing SAS and passing parameters

2005-02-08 Thread Williams, Thomas
again, Tom -Original Message- From: Alan Gauld [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 1:57 PM To: Williams, Thomas; tutor@python.org Subject: Re: [Tutor] executing SAS and passing parameters > I am trying to use python to run a SAS program by passing th

[Tutor] executing SAS and passing parameters

2005-02-09 Thread Williams, Thomas
Here is the code I am using to invoke SAS: import os import sys shell = os.environ.get('COMSPEC') if shell is None: shell = os.environ.get('SHELL') if shell is None: shell = 'an unknown command processor' print 'Running under', shell os.exe

[Tutor] updating Oracle tables via python

2005-03-29 Thread Williams, Thomas
Greetings, I am attempting to update an Oracle table using python.  When I execute the code, the python script appears to hang, in that nothing else happens.   As always, any assistance you can provide will be appreciated.   Code:   connection = cx_Oracle.connect("db/[EMAIL PROTECTED

[Tutor] Cryptography Toolkit

2005-03-31 Thread Mark Thomas
Does anyone have some examples on the use of A.M. Kuchling's Python Cryptography Toolkit? I've tried his examples but get "AttributeError" and "TypeError". What I'm trying to do is encrypt/decrypt a file. I'm using Python 2.3 on xp pro. Thanks -- _ ( )

Re: [Tutor] Cryptography Toolkit

2005-03-31 Thread Mark Thomas
t;bhxupds&oo`g'uou`z`" <== *confused by this output* Close but no cigar!! *grin* -- _ ( ) Mark Thomas ASCII ribbon campaign X www.theswamp.org - against HTML email / \ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Cryptography Toolkit

2005-04-01 Thread Mark Thomas
ncrypt > > xored = obj_xor.encrypt(str_encrypt) > print xored > > obj_xor = XOR.new("string") > print obj_xor.decrypt(xored) > > Kent Excellent !! Many thanks Kent. -- _ ( ) Mark Thomas ASCII ribbon campaign X www.theswamp.org - against HTML email / \ ___

[Tutor] website information

2005-04-18 Thread Williams, Thomas
Does anyone know how to prevent this error from occurring: IOError: [Errno socket error] (10060, 'Operation timed out').   I have searched for solutions without any success.   Tom Williams     ___ Tutor maillist - Tutor@python.org h

Re: [Tutor] Simple string processing problem

2005-05-13 Thread Mark Thomas
GAAATTGCAAATTAACTGTG ScerACCACGTCCAATCTACCGATATTGCTGCTATGCATTATAA SparACCACGTCCAATCTACCGATATTGCTGCTATGCATTATAA SmikACCACGTCCAATCTACCGATATTGCTGCTATGCATTATAA SbayACCACGTCCAATCTACCGATATTGCTGCTATGCATTATAA -- _ ( ) Mark Thomas ASCII ribb

Re: [Tutor] (no subject)

2005-07-06 Thread Mark Thomas
On 7/6/05, Michael Huster <[EMAIL PROTECTED]> wrote: > In python under windows, how can I create and access a file on the Desktop? > The following do NOT work: How about... >>> userp = os.getenv('USERPROFILE') + '\\Desktop\\MyFile.txt' >>> fo =

[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

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/ _

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] 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] 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] How to strip both single and double quotes

2005-10-05 Thread Mark Thomas
\" \' ()*&^%$# << ' >>> [x.strip('\' \" () * & ^ % $ # < ') for x in str.split()] ['this', 'has', 'special', 'characters', '', '', '', ''] -- _ ( ) Mark Thomas ASCII ribbon campaign X www.theswamp.org - against HTML email / \ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] New Tutorial topic available

2006-02-26 Thread Mark Thomas
ormation for us newbies. -- _ ( ) Mark Thomas ASCII ribbon campaign X www.theswamp.org - against HTML email / \ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Problems with a Class

2007-01-13 Thread thomas coopman
can't use return in the loop you could save them in a list or something, and after the loop return the list. def loop(): x = [] for i in range(10): x.append(i) return x print loop() this will print a list with all the numbers. I hope this is what you mean. Thomas ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] import and unittest

2007-01-16 Thread Thomas Coopman
code and the test dir is a complete copy of the src dir but with unittest instead of code. I have something like this but I don't know how to organize the imports in the tests and I don't know if this is a good idea. What do you think? Thanks -- Thomas Coopman [EMAIL

Re: [Tutor] import and unittest

2007-01-16 Thread thomas coopman
On Tue, 16 Jan 2007 10:06:37 - "Alan Gauld" <[EMAIL PROTECTED]> wrote: > > "Thomas Coopman" <[EMAIL PROTECTED]> wrote > . > > I wondered if it was possible to do something like this: > > > > src/ > >-a_module/ > >

Re: [Tutor] import and unittest

2007-01-17 Thread thomas coopman
On Tue, 16 Jan 2007 10:06:37 - "Alan Gauld" <[EMAIL PROTECTED]> wrote: > > "Thomas Coopman" <[EMAIL PROTECTED]> wrote > . > > I wondered if it was possible to do something like this: > > > > src/ > >-a_module/ > >

Re: [Tutor] import and unittest

2007-01-17 Thread Thomas Coopman
On 1/17/07, Kent Johnson <[EMAIL PROTECTED]> wrote: thomas coopman wrote: > On Tue, 16 Jan 2007 10:06:37 - > "Alan Gauld" <[EMAIL PROTECTED]> wrote: > >> "Thomas Coopman" <[EMAIL PROTECTED]> wrote >> . >>>

Re: [Tutor] import and unittest

2007-01-17 Thread Thomas Coopman
On 1/17/07, Kent Johnson <[EMAIL PROTECTED]> wrote: Thomas Coopman wrote: > Well I don't really > need the circular imports but I would like to know how to do the imports correct. > > Suppose that in the example that I showed only One needs Two. > > So then we ha

Re: [Tutor] import and unittest

2007-01-17 Thread Thomas Coopman
On 1/17/07, Kent Johnson <[EMAIL PROTECTED]> wrote: Thomas Coopman wrote: > When I run One.py from in the directory A, doesn't look python in it's > parent directory when it can't find the module? > And if that's not the case where and what should I add to t

Re: [Tutor] Best IDE for Python

2007-01-26 Thread Mark Thomas
On 1/26/07, OkaMthembo <[EMAIL PROTECTED]> wrote: > how useable is vim on Windows? Very! I've used Vim on Windows since the 5.3 version, it only gets better. Like Alan said there is a learning curve, but once you've "got it" there is no going back. > i wish i could learn Unix. which distro do you

[Tutor] comparing almost equal strings

2007-02-08 Thread thomas coopman
Hi, I need a function that groups almost equal strings. It seems most easy to me, to do this with a hash function. So I would write a hash function like this: string = string.replace(" ", "").lower()[0:6] and then hash the string chars, but it should detect minor typo's, so words with one diffe

Re: [Tutor] comparing almost equal strings

2007-02-08 Thread thomas coopman
Hi, On Thu, 08 Feb 2007 13:07:41 +0100 Christopher Arndt <[EMAIL PROTECTED]> wrote: > thomas coopman schrieb: > > I need a function that groups almost equal strings. It seems most > > easy to me, to do this with a hash function. > > What do you mean be "a

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

Re: [Tutor] class methods as argument

2007-02-10 Thread thomas coopman
On Sat, 10 Feb 2007 22:10:52 +1000 Jonathan McManus <[EMAIL PROTECTED]> wrote: > It's pretty easy to make this work, actually. The issue is in the > "doSomething" method. > > > >>>class Foo(object): > > >>> def method(self, arg): > > >>> print arg > > > > >>>def doSomething(object, func)

Re: [Tutor] class methods as argument

2007-02-10 Thread thomas coopman
On Sat, 10 Feb 2007 07:55:54 -0500 Kent Johnson <[EMAIL PROTECTED]> wrote: > thomas coopman wrote: > > Hi, > > > > I want to do something like this, don't know how to properly > > explain it, so I just give you some example code > > > >&

Re: [Tutor] class methods as argument

2007-02-10 Thread thomas coopman
On Sat, 10 Feb 2007 09:04:15 -0500 Kent Johnson <[EMAIL PROTECTED]> wrote: > thomas coopman wrote: > > > > also, > > Is it better to use super in FooList? and how should I use it then? > > Actually I would say that FooList is not pulling its weight. > SortedL

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

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

[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

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

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

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

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

[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,*

[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

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

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

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

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

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

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

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
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
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
@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
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
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
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-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(

[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

[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

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

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

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

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

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

[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

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

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

[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

[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

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

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

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

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

[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

[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

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

  1   2   >