Re: [Tutor] How to use a function

2015-01-19 Thread Dominik George
Hi, > parser_illumina_readset_file("~/Desktop/file.csv") > > dir() > > I can't found the readsets list. Someone could please help me? > thanks so much! Maybe: readsets = parser_illumina_readset_file("~/Desktop/file.csv") In your call, you discard the result, which, obviously, discards it. -

Re: [Tutor] Auto-response for your message to the "Tutor" mailing list

2014-10-26 Thread Dominik George
Hi, Am 26. Oktober 2014 13:20:13 MEZ, schrieb tutor-boun...@python.org: >Your message for tutor@python.org, the Python programming tutor list, >has been received and is being delivered. This automated response is >sent to those of you new to the Tutor list, to point out a few >resources that can

Re: [Tutor] Python GPIO Code Help Needed

2014-10-26 Thread Dominik George
Hi, >if ( GPIO.input(23) == False ): >os.system('mpg321 -g 95 a.mp3') while not GPIO.input(23): pass ... would be the simplest solution. -nik ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opt

Re: [Tutor] Finding the latest file in a dir

2014-01-05 Thread Dominik George
Hi, > OSError: [Errno 2] No such file or directory: 'alfresco20140104-.sql' > I get results if I do it without giving the dir location such as That is because the getctime call will run based in the current working directory. You can use a construct like: max([os.path.join('opt', 'foo', x

Re: [Tutor] what's your name? (to a class)

2014-01-02 Thread Dominik George
Hi, > Am I missing something or don't classes know how they're called > (unlike funcs, which have a __name__ attribute, very practicle)? Is > there a way to get it otherwise? The class has it, the instance doesn't. That said, you are looking for self.__class__.__name__ ... > class SuperType: >

Re: [Tutor] The Charms of Gmail

2013-12-22 Thread Dominik George
> >OMG, so obvious. I actually had to reply to several messages in recent > >digests, and I utterly resented my clunky technique the second I saw > >you'd mentioned this. Thanks. > > > >-- > >Keith > > > > This might also prevent you from completely losing all threading. > This has happened on at

Re: [Tutor] The Charms of Gmail

2013-12-22 Thread Dominik George
> I'm no expert, but would a (semi-)decent email client help? Probably not, as Google's IMAP implementation is hopelessly broken beyond all repair. -nik -- * concerning Mozilla code leaking assertion failures to tty without D-BUS * That means, D-BUS is a tool that makes software look better

Re: [Tutor] The Charms of Gmail

2013-12-21 Thread Dominik George
> I'm sorry Mark, I'm stuck with using gmail [...] Use sane e-mail, then. -- # apt-assassinate --help Usage: apt-assassinate [upstream|maintainer] PGP-Fingerprint: 3C9D 54A4 7575 C026 FB17 FD26 B79A 3C16 A0C4 F296 signature.asc Description: Digital signature

Re: [Tutor] class variables

2013-12-20 Thread Dominik George
Hi, > I am a little confused about class variables: I feel like I've repeatedly > seen statements like this: please take a look at the archives - this topic has been discussed on this list recently. -nik -- * mirabilos is handling my post-1990 smartphone * Aaah, it vibrates! Wherefore art tho

Re: [Tutor] how to edit program files in Python?

2013-12-19 Thread Dominik George
Hi, > My son and I just opened "Python for Kids" and we're working our way > through the lessons.  Sometimes he mistypes the lines and hits return > and discovers after that that he made a mistake in the line.  But, > when we try to correct the line, we are not able to.  We just get that > loud be

Re: [Tutor] Loop over floating point values

2013-12-01 Thread Dominik George
Hi, > - Do not create a list of the floating point values as i=[0.01, 0.02, > 0.03..] - either like that or by using a suitable mathematical formula > combined with a list comprehension You could simply write your own version of xrange that does it, as a generator: def xrange_f(start, stop, st

Re: [Tutor] TypeError: range() integer end argument expected, got float.

2013-11-29 Thread Dominik George
Hi, > Using python 7.3 I think we must update 'import antigravity' to say something about python-driven flux capacitors :þ ... > def PaymentTable(balance, annualInterestRate, payment): You should not CamelCase function names. > upperbound = round((balance + (monthlyinterest * 12)) / 12, 0) Yo

Re: [Tutor] Allocation of serial ports

2013-11-29 Thread Dominik George
Hi, >So, how can I ensure that port A is always ttyUSB0 http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/ -nik ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/

Re: [Tutor] Splitting lists with strings and integers

2013-11-27 Thread Dominik George
Mark Lawrence schrieb: >Dominik, > >I'm very sorry about the above, I really should know better than to >post >at stupid o'clock in the morning when I'm already exhausted. Thanks, Mark :)! -nik ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] Splitting lists with strings and integers

2013-11-26 Thread Dominik George
> >for x in xrange(len(animal)): > >if animal[x].isdigit(): > >animal[x] = int(animal[x]) > > > > Before posting anything else would you please do a tutorial > yourself. The above for loop is appalling newbie code, I'll leave > you to post the Pythonic format. Can I trust

Re: [Tutor] Splitting lists with strings and integers

2013-11-26 Thread Dominik George
Hi, > I have a list with mixed strings/integers. I want to convert this to a > list of lists, and I want the numbers to get stored as integers. First, let's do it with a list comprehension. You should really learn those if you do serious Python programming ;)! list2 = [[int(z) if z.isdigit(

Re: [Tutor] Dict

2013-11-26 Thread Dominik George
Hi, > Is it possible to sort dict & to get result as dict? > if it is possible, please give some example. By what do you want to sort it? By key? By value? By a combination of both? Cheers, Nik -- Ein Jabber-Account, sie alle zu finden; ins Dunkel zu treiben und ewig zu binden; im Nat

Re: [Tutor] How to set variables inside a class()

2013-11-26 Thread Dominik George
Hi, > By setting test.flag you are creating a new instance level attribute > that exists only within the test instance. That's legal Python > but usually its not a good idea to have different instances of > the same class having different attributes. maybe this becomes clearer by breaking down th

Re: [Tutor] How to set variables inside a class()

2013-11-26 Thread Dominik George
Hi Reuben, > class Animal(): > > flag = True > print flag Are you sure you know what this does ;)? Normally, you initialize all variables in the constructor. > test.flag = False > 1)Inside the Animal class(), How can I set the variable 'flag' to FALSE? Your qustion is a bit u

Re: [Tutor] Usefulness of classes and necessity of inheriting classes

2013-11-25 Thread Dominik George
Hi Reuben, > Question no 1: > -- > I would like to know why do we actually inherit classes? What would be the > benefit of inheriting? I think this is not the classical explanation of this, but when teaching programming to my students, I make a very great deal of the following

Re: [Tutor] Else vs. Continue

2013-11-24 Thread Dominik George
Hi, > I stumbled upon the "continue" statement and to me it looks like it > does exactly the same as else. I tested both else and continue in a > little program and I don't see any differences between both. Is my > assumption correct or wrong? If the latter is the case: Can you give > me examples

Re: [Tutor] Fibonacci Series

2013-11-24 Thread Dominik George
Hi, > a, b = b, a +b > a = b = 1 > b = a + b = 1 + 1 = 2 Your issue is that you interpret the assignment wrong. You seem to think that it assigns b to a and THEN a+b to b, which is not the case. The right side of the assignment creates a tuple, and the left side unpacks it. It is the same as

[Tutor] Sending sensible e-mail (was: Re: (no subject))

2013-11-22 Thread Dominik George
Hi, > Subject: [Tutor] (no subject) On a side note, please learn how to send e-mail. Thanks, Nik -- * mirabilos is handling my post-1990 smartphone * Aaah, it vibrates! Wherefore art thou, demonic device?? PGP-Fingerprint: 3C9D 54A4 7575 C026 FB17 FD26 B79A 3C16 A0C4 F296 signature.asc De

Re: [Tutor] Class attribute error

2013-11-16 Thread Dominik George
On Sat, Nov 16, 2013 at 09:13:13AM -0800, reutest wrote: > class myclass(): > > def test(self): > print "print this line" > > > if __name__ == '__main__': > myclass.run() Is that a question? If I were to guess, I'd say you sho

Re: [Tutor] basic function concept

2013-11-16 Thread Dominik George
> main() > > Can someone tell me why main is not being given any arguments? Because you didn't write any there. -nik -- Wer den Grünkohl nicht ehrt, ist der Mettwurst nicht wert! PGP-Fingerprint: 3C9D 54A4 7575 C026 FB17 FD26 B79A 3C16 A0C4 F296 signature.asc Description: Digital signature

Re: [Tutor] Auto-response for your message to the "Tutor" mailing list

2013-10-20 Thread Dominik George
> Your message for tutor@python.org, the Python programming tutor list, > has been received and is being delivered. This automated response is > sent to those of you new to the Tutor list, to point out a few > resources that can help with answering your own questions, or improve > the chances of g

Re: [Tutor] Passing arguments?

2013-10-20 Thread Dominik George
Hi, > I've written the code below the assignment, and I think I have everything > covered in terms of asking the user for the information I need and somehow > calculating costs, but I'm just ridiculously confused on the order and > placement of the functions and components of this program- specifi

Re: [Tutor] Help please

2013-10-17 Thread Dominik George
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Todd Matsumoto schrieb: >> #1. Error handling for the files to ensure reading only .txt file >Look up exceptions. >Find out what the string method endswith() does. One should note that the OP probably meant files of the type text/plain rather than

Re: [Tutor] sqlite3 COMMIT directive

2013-09-30 Thread Dominik George
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hi, >sqlite3.OperationalError: cannot commit - no transaction is active That means that you have to execute "BEGIN TRANSACTION" before using atomic commits. http://www.sqlite.org/lang_transaction.html http://sqlite.org/transactional.html >I've b

Re: [Tutor] Creating To Do List Program - Question

2013-09-30 Thread Dominik George
Hi Rafael, > > Your original program had some code that interacted with the user. So > > when you went from that to a giant print statement, I, and proably many > > others, thought you were just kidding. > > I noticed that, but I was serious about that. I mean, my giant print > statement was rea

Re: [Tutor] Creating To Do List Program - Question

2013-09-30 Thread Dominik George
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Rafael Knuth schrieb: >Dominik, > >> it's not your program - it's your attitude. We expect you to learn >for yourself as well, and putting the commands you output into a script >and execute it clearly isn't beyond what we can expect from someone w

Re: [Tutor] Creating To Do List Program - Question

2013-09-30 Thread Dominik George
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Rafael Knuth schrieb: >Hej there, > >@Alan @Joel: >I didn't know that pouring corn on newbies is the purpose of a tutor >mailing list. >Why don't you try writing a program instead? Why don't you use the cat >interpreter instead? >I tried my best a

Re: [Tutor] Creating To Do List Program - Questions

2013-09-30 Thread Dominik George
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Rafael Knuth schrieb: >Hej there, > >apologies if you're receiving my mail for a second time, I had some >issues with Google and I just want to make sure you will receive my >email. > >I am writing a to do list program in Python 3.0. > >Last week,

Re: [Tutor] Creating To Do List Program - Question

2013-09-29 Thread Dominik George
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Rafael Knuth schrieb: >Hej there, > >I am writing a to do list program in Python 3.0. > >Earlier this week, I shared my first iteration on the mailing list, >and the feedback was that I should learn how to create, write to and >read from a text fi

Re: [Tutor] os.system() not working

2013-08-27 Thread Dominik George
Hi, in any case and apart from what was already said, your setup sounds very awkward, if not insane. Are you sure your implementation is a good idea? -nik Nitish Kunder schrieb: >Hii >I have a python program which i am calling from a php script. >The arguments to the program is a path to th

Re: [Tutor] How to extract numerator and denominator from fractions.Fraction(4, 32)?

2013-08-05 Thread Dominik George
Hi, how about casting to str()? -nik "Richard D. Moores" schrieb: import fractions fractions.Fraction(6, 21) >Fraction(2, 7) > >How do I turn that Fraction(2, 7) into "1/7"? (and not >0.2857142857142857...) > >Or do I have to employ fractions.gcd? > >I can't seem to find the answer

Re: [Tutor] LDAP search with ldap library module failing

2013-08-05 Thread Dominik George
Hi, > Now, if I search fog cn=ab*, a much limited search it will return the search > results. Thinking that it could be a limitation from the server side, I've > done > the same search with ldapsearch in bash, and it gets what is expected. Are you sure it gets what is expected? ldapsearch limits

Re: [Tutor] re module- puzzling results when matching money

2013-08-04 Thread Dominik George
Hi, not quite. The moral is to learn about greedy and non-greedy matching ;)! -nik Alex Kleider schrieb: >On 2013-08-03 13:38, Dominik George wrote: >> Hi, >> >> b is defined as all non-word characters, so it is the complement oft >> w. w is [A-Za-z0-9_-], so b i

Re: [Tutor] re module- puzzling results when matching money

2013-08-03 Thread Dominik George
Hi, \b is defined as all non-word characters, so it is the complement oft \w. \w is [A-Za-z0-9_-], so \b includes \$ and thus cuts off your group. -nik Alex Kleider schrieb: >#!/usr/bin/env python > >""" >I've been puzzling over the re module and have a couple of questions >regarding the be

Re: [Tutor] slashes in paths

2013-07-20 Thread Dominik George
Hi, the base path is \, and one exists for every drive. C:\foo is foo in C:'s root, C:foo is foo in C:'s current working directory. -nik Jim Mooney schrieb: >On 20 July 2013 13:46, Alan Gauld wrote: > >> The fact that you gave it a prefix containing forward >> slashes is confusing things.

Re: [Tutor] slashes in paths

2013-07-20 Thread Dominik George
Hi Jim, > But oddly, it makes all slashes forward if I end the path with a > forward slash, so it's not consistent with itself. It is, in the sense that it preserves any form of seperator that is already there. It just doesn't throw away what you want to be there: >>> import ntpath >>> ntpath.

Re: [Tutor] slashes in paths

2013-07-20 Thread Dominik George
Hi, > >>> soundfile13 > 'c:/python27/jimprogs/wav\\bicycle_bell.wav' > >>> > > with single forward slashes mixed with a double backslash > > it comes out even worse if I print it > > c:/python27/jimprogs/wav\bicycle_bell.wav - no double backslash, > which could create a mess if someone copied

Re: [Tutor] 3 Dimensional Dictionaries

2013-07-20 Thread Dominik George
Hi, > world = > [{'continent':'Asia','continent_code':1,'ocean':'Pacific','country':'India','country_code':1,'state':'Kerala', > 'state_pin':51}, > [...] > > i am trying to to make it in this format > to clarify the task at hand: this is comparible to SQL's GROUP BY clause, right? -nik -