Re: [Tutor] process and modify a list of strings, in place

2011-02-12 Thread Emile van Sebille
liably with John Machin's xlrd package. See http://pypi.python.org/pypi/xlrd Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] remote code execution

2011-02-15 Thread Emile van Sebille
session to the server to run and test the code. Is that what you're after? Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Dynamically assign variable names to tuple objects

2011-03-01 Thread Emile van Sebille
will be file1_line1+file2_line1+file3_line1, etc. Hint: Look at zip. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Dynamically assign variable names to tuple objects

2011-03-01 Thread Emile van Sebille
for line in open(filename) ] Then your loop looks like: for i in zip([ cleanedup(filename) for filename in myfiles ]) HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] New person greets you all!

2011-03-11 Thread Emile van Sebille
been ported to 3.x, so many of us (me included) haven't yet made the jump to 3.x. Just be aware that the two exist and the info you find on the net may not apply. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscri

Re: [Tutor] Sorting multiple sequences

2011-03-11 Thread Emile van Sebille
ush faster that pairs.sort()... Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] multiple if and or statement

2011-03-14 Thread Emile van Sebille
;test1' _or_ 'test2' so, the first test is i=='test1' and the second test if simply 'test2'. Try the following: if 'test2': print "non-empty strings evaluate as true" if not "": print "the not of an empty string evaluates true

Re: [Tutor] how to optimize this code?

2011-03-28 Thread Emile van Sebille
you set numValue outside your function and refer to it. Emile Is this the byref/pointer object distinction? I replaced a the pointer object with a byref object, which reduced processing time by about 10 %. Cython might be interesting as a hobby project, but I'm affraid I'll never get

Re: [Tutor] Trajectory Syntax Error

2011-03-30 Thread Emile van Sebille
. eg, use logistic(0.11) Emile ActivePython 2.6.1.1 (ActiveState Software Inc.) based on Python 2.6.1 (r261:67515, Dec 5 2008, 13:58:38) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >

Re: [Tutor] Importing sub modules

2011-03-31 Thread Emile van Sebille
True >>> Although I'm not sure what to make of the joins What are you trying to do? Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] counting a list of elements

2011-04-01 Thread Emile van Sebille
On 4/1/2011 10:16 AM Karim said... I would like to get advice on the best practice to count elements Well, I suspect you're more interested in knowing the total count of how many as opposed to counting how many. To get the total count of how many use len(mylist).

Re: [Tutor] Rhythmbox python plugin to capture middle click event

2011-04-06 Thread Emile van Sebille
for those just learning to program in python. You can browse at http://osdir.com/ml/rhythmbox-devel/ and subscribe at http://mail.gnome.org/mailman/listinfo/rhythmbox-devel HTH, Emile I've been able to get actions working correctly in my other plugin. (http://launchpad.net/rb-fileorganizer) b

Re: [Tutor] installing where does my money go

2011-04-07 Thread Emile van Sebille
ugins' warnings.warn(msg) usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] You're missing the command -- try install hth, Emile or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help An

Re: [Tutor] Converting files

2011-04-11 Thread Emile van Sebille
On 4/11/2011 10:40 AM sunil tech said... Hi all... is there any way to convert any file (eg: document files & image files) to .pdf? Look into reportlab. Look at the opensource area: http://www.reportlab.com/software/opensource/ if so, kindly share... thank you in advance. _

Re: [Tutor] how to read two files and substitute

2011-05-17 Thread Emile van Sebille
e if it starts with one of the targets, then spilt the fields from the line and select the fourth field. Accumulate those and return the result. Post your code when you follow up please. Emile ___ Tutor maillist - Tutor@python.org To u

Re: [Tutor] how to read two files and substitute

2011-05-17 Thread Emile van Sebille
ts[0]]=parts[3] origs=open("dummy.atomID").read().split() print " ".join([mapping[orig] for orig in origs]) Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] multiprocessing for nested function

2011-05-17 Thread Emile van Sebille
endent processing. Pyro, stackless, and twisted come to mind. It looks like the info at http://wiki.python.org/moin/ParallelProcessing is more up to date than my memory... Emile ... def categorize_reports(): if __name__ == '__main__': root2 = Tkinter.Tk(className

Re: [Tutor] how to convert list of lists to dict

2011-05-17 Thread Emile van Sebille
4592, 'uptime' : 5784399} node['server2'] = {'state' : 'active', 'ncpu' : 32, 'mem' : 34359738368, 'uptime' : 5416796} node['server3'] = {'state' : 'inactive', 'ncpu' : 8, 'mem' : 8

Re: [Tutor] how to read two files and substitute

2011-05-17 Thread Emile van Sebille
replace an existing one with "if parts[0] in mapping:" if that helps. Emile #!/bin/python mapping={} for line in open("confout.pdb").readlines(): parts=line.strip().split() if len(parts)>6: mapping[parts[1]]=parts[4]+parts[3] origs=open("dummy.

Re: [Tutor] how to convert list of lists to dict

2011-05-17 Thread Emile van Sebille
On 5/17/2011 10:19 AM Brad Hudson said... Thanks for the quick response Emile! However, this only seems to solve part of the problem. Yes -- I figured that by understanding the one-liner I replied with you'd be able to construct the missing part. And then by restructuring to a loop

Re: [Tutor] reading very large files

2011-05-17 Thread Emile van Sebille
; file object Open a file using the file() type, returns a file object. This is the preferred way to open a file. >>> Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] RuntimeError: file does not exist

2011-05-17 Thread Emile van Sebille
, line 1, in File "imagen_shp.py", line 32, in lyr.datasource = mapnik.Shapefile(base=filepath, file=filepath) Without having actually dug into this, should base and file have the same value? Emile File "C:\mapnik-0.7.1\python\2.6\site-packages\mapnik\__init__.py"

Re: [Tutor] string

2011-05-19 Thread Emile van Sebille
ain quote characters. mystring = "That's the difference" other = 'Python was named after "Monty Python" the TV show' Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] zero crossing pitch detection

2011-05-29 Thread Emile van Sebille
me as you appear to step through the data looking for \x10\x00 tags and calculating a distance. If my reading is correct, perhaps using split to break the data into pieces would be easier to work with? frames = data.split('\x10\x00') HTH, Emile

Re: [Tutor] [OT] Re: Floating Point Craziness

2011-06-13 Thread Emile van Sebille
oving dime 3 kilometers (two miles) away." (http://en.wikipedia.org/wiki/Lunar_Laser_Ranging_experiment) Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Blackjack Betting

2011-07-01 Thread Emile van Sebille
Where and how? Further, because global is used, it tells you that 'bet' is not in the local scope, nor in the global scope. Python's general scoping resolution rule is local-global-builtin. So bet, wherever you think it may be defined, lives in a different namespace.

Re: [Tutor] Hello World in Python without space

2011-07-11 Thread Emile van Sebille
"!") Alan mentioned using concatenation as well and "".join() is generally preferred, particularly when many strings are involved. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] compare and arrange file

2011-07-11 Thread Emile van Sebille
sortkey to value+flag append sortkey and line to decorated list sort decorated list for key,line in decorated list print line HTH, Emile i try this http://pastebin.com/2mvxn5GY but without look maybe somebody can give some hint , i know that this is maybe not a directly python quest

Re: [Tutor] compare and arrange file

2011-07-11 Thread Emile van Sebille
line. For example, XXXs,Dval,Cval = line.split("|") then, assuming a consistent valid file structure, if int(Dval): key="D"+Dval else: key="C"+Cval then, append (key,line) to your decorated list for each line, and finally sort and print the lines fro

Re: [Tutor] compare and arrange file

2011-07-12 Thread Emile van Sebille
ile.txt you might also try the shortened: from csv import reader,writer def sortkey(row): return max(row[1],row[2]),row[1]>row[2] writer(open("outfile.txt", "wb"), delimiter="|").writerows( sorted(reader(open("infile.txt", "rb"), delimi

Re: [Tutor] Descriptors and type declaration order

2011-07-14 Thread Emile van Sebille
Item is not known yet. Any ideas? You want to embed an instance of a class as an attribute of the same class? Does this help: class BaseItem(object): ident = Attribute("ident", "int") owner = Attribute("owner", "str") BaseItem.item = Att

Re: [Tutor] Program to Predict Chemical Properties and Reactions

2011-07-16 Thread Emile van Sebille
mistry and thought the funnest way to do it would be to build a program that can do this (if it works, I'd also like to replicate it for level of electronegativity, atomic radius size, electron affinity, and ionization levels 2, 3, and 4). Extend the dictionary for the additional attributes. Em

Re: [Tutor] Viability of Python

2011-07-21 Thread Emile van Sebille
ere's a better answer I can deploy quicker. What sorts of things is Python useful for and what things is it not? And finally, if there is code after Python, what’s a good second language, and when should someone start learning it? I'd say C, and I'd start by browsing

Re: [Tutor] Question regarding xml.dom.minidom: How do you send an unsignedByte in an wsdl request

2011-07-22 Thread Emile van Sebille
You'll likely get more traction on this at http://mail.python.org/mailman/listinfo/xml-sig Emile On 7/22/2011 11:18 AM Garry Bettle said... Howdy all, Hope this message finds everyone well - roll on the weekend! I'm trying some calls to an wsdl API I've subscribed to. But

Re: [Tutor] Question regarding xml.dom.minidom: How do you send an unsignedByte in an wsdl request

2011-07-22 Thread Emile van Sebille
On 7/22/2011 12:09 PM Stefan Behnel said... Emile van Sebille, 22.07.2011 20:59: You'll likely get more traction on this at http://mail.python.org/mailman/listinfo/xml-sig Unlikely. Wow. Agreed. Five unanswered posts this year. Emile ___

Re: [Tutor] Python loop isn't working

2011-08-05 Thread Emile van Sebille
when you get stuck. Emile import mapnik import os,fnmatch, sys from mapnik import LineSymbolizer,PolygonSymbolizer,PointSymbolizer from osgeo import ogr,gdal,osr directorio = sys.argv[1] extension = sys.argv[2] drop this... try: outdent this... if len(sys.argv) == 3: pri

Re: [Tutor] Converting from a single module to a package

2011-08-05 Thread Emile van Sebille
, include the following: import html htmlButton = html.button std.html.button(*arglist) #OR import html from tlib html.button(*arglist) Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

Re: [Tutor] Where is sys.py?

2011-08-21 Thread Emile van Sebille
On 8/21/2011 4:57 AM Lisi said... If sys.py is a file, it must be somewhere; but I can't find it. Where is it? I would like to look at it. The modules within it must surely be somewhere too. But since I can't find sys, I obviously can't find the modules. Again, I'd like to look at them. In c

Re: [Tutor] How have I transgressed??

2011-08-21 Thread Emile van Sebille
mail address is verified and those 'new to the list' get this message -- do you have multiple email accounts or possibly typoed in your email address on the message that evoked the 'new' response? Emile ___ Tutor maillist - Tutor@

Re: [Tutor] Store the output of os.system

2011-08-21 Thread Emile van Sebille
mmand in some form. Can you guys tell me how to store the output of a terminal or show the output in a GUI in python?? Instead of os.system, try the commands or subprocess module as appropriate for your version of python. HTH, Emile ___ Tutor mai

Re: [Tutor] Where is sys.py?

2011-08-22 Thread Emile van Sebille
On 8/22/2011 6:45 AM Lisi said... On Monday 22 August 2011 00:13:37 Steven D'Aprano wrote: The modules within it must surely be somewhere too. But since I can't find sys, I obviously can't find the modules. Again, I'd like to look at them. I don't understand what you mean by "modules within

Re: [Tutor] Zip - password protect

2011-08-23 Thread Emile van Sebille
pfile library includes a setpassword option. help(zipfile.PyZipFile.setpassword) Help on method setpassword in module zipfile: setpassword(self, pwd) unbound zipfile.PyZipFile method Set default password for encrypted files. Emile ___ Tutor mai

Re: [Tutor] Zip - password protect

2011-08-23 Thread Emile van Sebille
-file ? Check the answer that references the external open-source 7-Zip utility. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Zip - password protect

2011-08-23 Thread Emile van Sebille
#x27;, name + '.zip'] + self.file_locs) (from now) oddly enough, when I open up a python shell, i can run the above just fine and it creates a .zip file. But when I run it from eclipse, the exact thing, I get the error. I'd try providing the full path to 7z -- may

Re: [Tutor] largest palindrome number

2011-08-27 Thread Emile van Sebille
On 8/27/2011 8:21 AM surya k said... If you take a close look at my code. for i in range (1,100) : for j in range (i,100) : Temp = palindrome(i*j) here, as the loop goes on, i*j can never become smaller Of course it can... i=3 * j=90 is less than i=4 * j=4... Emile

Re: [Tutor] Help with if-elif-else structure

2011-08-27 Thread Emile van Sebille
index [0], while the second one is index[1]. No, it is true. The resulting code would be: if roll[0] > 15: doeggs() elif roll[1] >= 2 dospam() where the second test only occurs when roll[0] <= 15. Emile if roll[0]> 15: if roll[1]>= 2: print("Success"

Re: [Tutor] Intro

2011-08-29 Thread Emile van Sebille
a program' or 'load a program' approaches to adding quotes. For learning purposes, I think I'd advise a complete newbie to start with the monolithic approach and build up and out from there. Emile ___ Tutor maillist - Tutor@

Re: [Tutor] Loops and matrices'

2011-08-29 Thread Emile van Sebille
_STEP j = j+1 i = i + 1 the error I get is:- File "", line 18 (33) SyntaxError: can't assign to function call delta_temp access and assignment likely wants to be expressed with brackets rather than parens. Emile ActivePython 2.6.6.15 (

Re: [Tutor] select particular directories and files

2011-08-29 Thread Emile van Sebille
On 8/29/2011 4:52 PM questions anon said... I am trying to select particular files within a particular subdirectory, You might find glob a better starting point: ActivePython 2.6.6.15 (ActiveState Software Inc.) based on Python 2.6.6 (r266:84292, Aug 24 2010, 16:01:11) [MSC v.1500 32 bit (Int

Re: [Tutor] Is there a test for hashability?

2011-09-01 Thread Emile van Sebille
On 9/1/2011 11:30 AM Chris Fuller said... On Thursday 01 September 2011, Richard D. Moores wrote: Thanks, James, from your ideas I've come up with this function as a general test for hashibility of any object: def is_hashable(object): try: if hash(object): return True

Re: [Tutor] guess-my-number programme

2011-09-23 Thread Emile van Sebille
get my head around it... tries = tries + 1 This simply increments tries by one each time through the loop. So the first time through it takes on the value 2, then 3, then 4, etc. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] Windows vs Linux processing speed.

2011-10-15 Thread Emile van Sebille
up on Steven's reference to the py-dev thread, here's the link to the patch that details the simple changes that Chris Withers applied to httplib to improve his testcase performance from ~20 minutes to <3 seconds. http://svn.python.org/view/python/trunk/Lib/httplib.

Re: [Tutor] urgent help!!!!!!!!!!!

2011-11-18 Thread Emile van Sebille
o until after the test, ergo, UnboundLocalError. HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] basic class loading question

2011-11-23 Thread Emile van Sebille
n Qb_list:# Iterate over Qb_list quarterbacks.append(Qb(*this_qb)) # append Qb instance to quarterbacks ...or even drop the quarterbacks declaration above... quarterbacks = [Qb(*this_qb) for this_qb in Qb_list Emile print (quarterbacks[3].phone) # Print an item f

Re: [Tutor] useful function or reinventing the wheel??

2011-11-29 Thread Emile van Sebille
or your current question, you'll find makedirs with sample code at http://effbot.org/media/downloads/librarybook-core-modules.pdf Although dated, it's still a great place to start as most internal functions have changed little over the years. Emile so it would not surprise me, but I

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-30 Thread Emile van Sebille
that for $15k a piece you could get the tech to come out and clip the strap on the high order bit of the address space register which would double the usable space. Kinda like getting a discount on a caddy but they deliver the car with the back doors welded shut. Emile

Re: [Tutor] plotting in python

2011-11-30 Thread Emile van Sebille
ir support list [1], and follow up there. We focus mainly on getting you far enough along with python basics and generally leave specific library support to the library authors and support groups. HTH Emile [1] start at http://www.scipy.org/Mailing_Lists ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to return an object generated during a python threading code

2011-12-10 Thread Emile van Sebille
On 12/10/2011 8:46 AM Massimo Di Stefano said... Hi All, i'm tring to learn how to use threads in python to save a list of object. i'm starting from this code : Moving lista into the instance seems to do it... Emile # import threading import urllib from tempf

Re: [Tutor] A shorter way to initialize a list?

2011-12-13 Thread Emile van Sebille
i in range(3): for j in range(3): listB[i].append(listA[count]) ... if not, where's this come from? Emile count+=1 My question is: is there any alternative way I can initialize listB without resorting to using 2 loops? I'm learning Python coming from a C++ bac

Re: [Tutor] A shorter way to initialize a list?

2011-12-13 Thread Emile van Sebille
express it as a single statement using list comprehensions: >>> listB = [ [ [] for ii in range(3) ] for jj in range(3) ] >>> listB [[[], [], []], [[], [], []], [[], [], []]] >>> listB[1][1].append(1) >>> listB [[[], [], []], [[], [1], []], [[], [], []]] HTH, Emil

Re: [Tutor] reset password program

2011-12-16 Thread Emile van Sebille
he 'open' documentation. HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Defining a File path

2012-01-10 Thread Emile van Sebille
platform and specific needs. Google python path search for some ideas, and ask with more specifics. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Namespace question

2012-01-20 Thread Emile van Sebille
gt;> import settings >>> settings.whatever We are having to do: >>> import settings >>> settings.settings.whatever You could from settings import settings ... which then allows access as settings.whatever HTH, Emile This is inconvenient and probabl

Re: [Tutor] Finding a specific line in a body of text

2012-03-12 Thread Emile van Sebille
If, as others suggest, the files do fit in memory, you might try: content = open(thisfile).read() for fragment in content.split(keyword)[1:]: myresults.append(fragment.split('\n')[1] Emile ___ Tutor maillist - Tutor@python.org T

Re: [Tutor] number of mismatches in a string

2012-03-13 Thread Emile van Sebille
fflib: class SequenceMatcher | SequenceMatcher is a flexible class for comparing pairs of sequences of | any type, so long as the sequence elements are hashable. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription op

Re: [Tutor] Unable to open .py files directly

2012-03-19 Thread Emile van Sebille
nloads It will get you all the windows related support you're likely to want in a single installation. HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Library of Module for Analyzing Answer Cards

2012-03-23 Thread Emile van Sebille
a production environment. I think I'd examine the scanned image for a location marker, then from that and an answer template that provides the answer box locations, locate the answer box area for each question in turn and identify the filled in multiple

Re: [Tutor] Lists and While Loops

2012-03-28 Thread Emile van Sebille
;print message" does it... ... but I suspect your requirement isn't accurate. Emile myList = message.split() y = random.choice(myList) z = len(myList) while z !=0: myList.remove(y) print(y) I can't figure out 1) How to remove "y" from the list and conti

Re: [Tutor] Problem Stripping

2012-03-30 Thread Emile van Sebille
lace: Help on built-in function replace: replace(...) S.replace (old, new[, count]) -> string Return a copy of string S with all occurrences of substring old replaced by new. If the optional argument count is given, only the first count occurrences are replaced. HTH, Emile

Re: [Tutor] New to this list ....

2012-03-30 Thread Emile van Sebille
> To avoid this, look at copy.deepcopy as an alternative: >>> d = copy.deepcopy(c) >>> d [[1, 2, 3], [4, 5, 6, 7]] >>> b.append(8) >>> c [[1, 2, 3], [4, 5, 6, 7, 8]] >>> d [[1, 2, 3], [4, 5, 6, 7]] >>> HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What to call a string with embedded descriptor?

2012-03-30 Thread Emile van Sebille
On 3/30/2012 12:57 PM S.Irfan Rizvi said... please help me disable this...i made big mistake searching your site note that at the bottom of every email you're getting from this list has a link to the unsubscribe page... ___ Tutor maillist -

Re: [Tutor] What to call a string with embedded descriptor?

2012-03-30 Thread Emile van Sebille
-- you could also say proprietary I imagine. I'm not aware if there's a formal name... Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] New to this list ....

2012-03-30 Thread Emile van Sebille
On 3/30/2012 2:41 PM Barry Drake said... On 30/03/12 19:18, Cranky Frankie wrote: Here's what you need - he starts simple and winds up with some nice games: http://www.amazon.com/Python-Programming-Absolute-Beginner-Edition/dp/1435455002/ref=sr_1_6?ie=UTF8&qid=1333131438&sr=8-6 If you have

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

2012-04-03 Thread Emile van Sebille
sed to refer to when it was not mentioned prior? Prior value or not, j is the loop variable that steps over range(dlen) and refers to the numbers 0 to dlen-1 in turn. Did you mean to ask something about the code below as well? Emile from random import randrange, choice from string import a

Re: [Tutor] __class__.__name__ for literal integer causes SyntaxError

2012-04-04 Thread Emile van Sebille
s is executed, but that there is a SyntaxError for that same reference of a 'int' literal. I'd welcome comments, explanations or URLs to discussions. thanks Try >>> (6).__class__.__name__ 'int' >>> HTH, Emile ___ Tu

Re: [Tutor] Emailing code

2012-04-06 Thread Emile van Sebille
content type to deliver plain text -- anything html-ish allows compression of spaces hence the formatting loss. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tkinter GUI crashing problem

2012-04-06 Thread Emile van Sebille
On 4/6/2012 3:07 PM myles broomes said... import random from tkinter import * What version of python on what platform please... Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org

Re: [Tutor] Biopython

2012-04-10 Thread Emile van Sebille
pertaining to third party packages if the third party itself. Try http://biopython.org/wiki/Mailing_lists -- they'll get you going faster than we will... unless of course someone here has sufficient experience with that package. Emile ___ Tutor mai

Re: [Tutor] Readabilty vs 80 characters

2012-04-19 Thread Emile van Sebille
.. L=glob.glob(D) ... for pypgm in L: ... pgm = open(pypgm,'r').readlines() ... totalLines+=len(pgm) ... LongLines.extend([(pypgm,jj) for jj in pgm if len(jj)>79]) ... >>> >>> print len(LongLines),totalLines 12043 606760 >>>

Re: [Tutor] Embed python in a website

2012-05-03 Thread Emile van Sebille
On 5/3/2012 2:28 PM Adrian said... I recently created a gui form using tkinter, is it possible to integrate this form to my website page? How do i integrate? pyjs aka pyjamas allows you to write once and run on both web and desktop. I'd start there.

Re: [Tutor] A simple "if" and "elif" problem

2012-05-05 Thread Emile van Sebille
On 5/5/2012 11:01 AM Santosh Kumar said... I am reading the documentation and I'm in the section 4.1. Let me write it down here: You'll need to peek ahead to section 8 Errors and Exceptions. Try and see if that doesn't get you going. Emile x = int(input("Ple

Re: [Tutor] Displaying data in columns

2012-05-07 Thread Emile van Sebille
the string interpolation related docs. Start with http://docs.python.org/release/2.5.2/lib/typesseq-strings.html or the equivalent for your python version. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opt

Re: [Tutor] How can I have type "function" in my script?

2012-05-08 Thread Emile van Sebille
On 5/8/2012 11:31 AM xancorreu said... isinstance(2, function) like I do isinstance(2, int) Do you understand my reasoning? Nope, but here ya go: Python 2.6.4rc2 (r264rc2:75497, Oct 20 2009, 02:55:11) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more informat

Re: [Tutor] How can I have type "function" in my script?

2012-05-08 Thread Emile van Sebille
On 5/8/2012 3:14 PM Alan Gauld said... On 08/05/12 19:42, Emile van Sebille wrote: >>> from types import * >>> def test():pass ... >>> function=FunctionType >>> print isinstance(test,function) Wow, thanks for that. I knew about all the different functio

Re: [Tutor] How to start developing a website

2012-05-13 Thread Emile van Sebille
Can anyone explain me on it.. The folks at Django can -- see https://docs.djangoproject.com/en/dev/faq/help/ for django resources. HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] TypeError: 'int' object is not callable

2012-05-16 Thread Emile van Sebille
print(sum(L)) Also, in the future please post the complete traceback -- it relly helps. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Is this possible and should it be done?

2012-05-21 Thread Emile van Sebille
actual files are really un-important. What I want is for the folder to be represented as a single file by any normal file browser, pyfuse allows you to create and represent whatever you want using python as a file system to the OS. Probably worth a look... Emile

Re: [Tutor] Datetime Integer Array

2012-05-21 Thread Emile van Sebille
n source: ... print ts, [ int(ii) for ii in ts.replace("/","").replace(":","").split() ] ... 03/10/2010 02:00:00 [3, 10, 2010, 2, 0, 0] 03/10/2010 02:10:00 [3, 10, 2010, 2, 10, 0] 03/10/2010 02:20:00 [3, 10, 2010, 2, 20, 0] 03/10/2010 02:30:00 [3, 10, 2010

Re: [Tutor] iPython check if user running script is root user (Linux)

2012-05-31 Thread Emile van Sebille
ly root can run this script\n") See http://code.activestate.com/recipes/299410-root-access-required-to-run-a-script/ Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] packets_USB_python

2012-06-04 Thread Emile van Sebille
I can do the following: Interprocess communications may be a bit advanced for this forum. Look at http://wiki.python.org/moin/ParallelProcessing as you're likely to find something appropriate there. HTH, Emile - Process 2 receives icmpv6 (or any packet) from process1 and retransm

Re: [Tutor] special attributes naming confusion

2012-06-07 Thread Emile van Sebille
On 6/6/2012 4:28 PM Steven D'Aprano said... Prasad, Ramit wrote: That is, for loops first try to build an iterator by calling __iter__, and if that fails they try the sequence protocol obj[0], obj[1], obj[2], ... So...I could instead write __getitem__ for the same effect? Er, no... __getite

Re: [Tutor] properties beginner M Dawson book

2012-06-11 Thread Emile van Sebille
lassing. Pep 8 speaks to their use. See http://www.python.org/dev/peps/pep-0008/ HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Trouble running Python on Windows Vista

2012-06-14 Thread Emile van Sebille
u're asking, so even when you do get it going, it's not a stable platform. I'd-like-apples-to-be-oranges-but-they're-not-ly y'rs, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Notepad++ question

2012-06-14 Thread Emile van Sebille
f __name__ == '__main__': print "__name__ == '__main__'" else: print "__name__ == '",__name__,"'" Emile@MIS2 ~ $ python test.py __name__ == '__main__' Emile@MIS2 ~ $ python Python 2.4.3 (#1, May 18 2006, 07:40:45) [GC

Re: [Tutor] How does slicing work?

2012-06-15 Thread Emile van Sebille
t;> L [1, 2, 3, '?', 4] How does python get the result of slicing?Such as the examples above,they really confused me. There's some good examples at: http://stackoverflow.com/questions/509211/good-primer-for-python-slice-notation HTH, Emile _

Re: [Tutor] Dictionaries

2012-06-17 Thread Emile van Sebille
provide you the specific help you need to keep you moving forward. You might also want to read the highly regarded article at http://www.catb.org/~esr/faqs/smart-questions.html Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subsc

Re: [Tutor] Installing NumPy

2012-06-18 Thread Emile van Sebille
talled. Then I downloaded and ran http://pypi.python.org/packages/2.7/n/numpy/numpy-1.6.2.win32-py2.7.exe and I can now import numpy. What did you try? Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscriptio

Re: [Tutor] (no subject)

2012-06-19 Thread Emile van Sebille
mble-') ... A -grumble- B D -grumble- E A B C D -grumble- E >>> Or spice it up! >>> import random >>> undefined = ['-grumble-','-mumble-','-garbled-','-cough-'] >>> for ii in 'agbdteabcdfe': ...

Re: [Tutor] joining selected items in list

2012-06-24 Thread Emile van Sebille
s that belong together? If so, there's are several techniques for locations a sub-list within a list at http://stackoverflow.com/questions/2250633/python-find-a-list-within-members-of-another-listin-order But if not, I'm not sure there's an answer. Emile I am not aware of any list

Re: [Tutor] Tutor Digest, Vol 100, Issue 58

2012-06-25 Thread Emile van Sebille
checks for equality such as if w[0] == 'x': This does the same thing and works even when w is an empty string. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

<    1   2   3   4   5   6   >