Re: [Tutor] Convert tuple within tuple into single tuple

2017-01-11 Thread Emile van Sebille
quot;credits" or "license" for more information. >>> import itertools >>> a = list(itertools.chain((1,2,3),(4,5))) >>> a [1, 2, 3, 4, 5] Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] copy files selectively from source to destination

2016-12-05 Thread Emile van Sebille
this selective copying? You could test f as you loop over the files to ensure it ends '.txt'. Emile Thanks in advance for the hints. Best, Kumar. # -*- coding: utf-8 -*- """ Created on Wed Jun 01 17:05:07 2016 @author: anatta """ import os imp

Re: [Tutor] Convert structured 1D array to 2D array

2016-02-27 Thread Emile van Sebille
inner tuples to lists -- tuples = [(1,2,3),('a','b','c'),('12/12/2009','2/4/2014','3/4/200')] lists =map(list,tuples) Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] No connection could be made because the target machine actively refused it (despite mongod running) and unable to insert data into MongoDB

2016-01-22 Thread Emile van Sebille
is not properly configured to allow mongod traffic into it. Talk to the machines firewall administrator. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to invert tuples, one problem more

2015-11-30 Thread Emile van Sebille
On 11/27/2015 12:50 PM, marcus lütolf wrote: dear pythonistas, thanks for your very valuable help. I am struggling with a simple piece of code: x = Marcus print '{0} {1} x'.format('a', '=') You're almost there - print '{0} {1} {2}'.format

Re: [Tutor] Working collaboratively

2015-10-19 Thread Emile van Sebille
On 10/19/2015 3:04 PM, Alex Kleider wrote: On 2015-10-19 13:08, Emile van Sebille wrote: This looks like the list of identified issues: https://bitbucket.org/pypa/pypi/issues Browse through and see if anything looks interesting/doable. On 2015-10-19 13:34, Mark Lawrence wrote: How

Re: [Tutor] Working collaboratively

2015-10-19 Thread Emile van Sebille
entified issues: https://bitbucket.org/pypa/pypi/issues Browse through and see if anything looks interesting/doable. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] File operation query

2015-10-15 Thread Emile van Sebille
) Also, the line below continues from the last insertion -- you'll also need to reposition the file pointer or re-open the file. Emile for line in file: print line print file.close() ## Regards, RD. ___

Re: [Tutor] File operation query

2015-10-15 Thread Emile van Sebille
script, it is always empty - it does not display the user input provided. May I know why? ## input1 = raw_input("Input1:") file = open("check.txt", "r+") file.write(input1 + "\n") t

Re: [Tutor] 0 > "0" --> is there a "from __future__ import to make this raise a TypeError?

2015-10-12 Thread Emile van Sebille
ou're looking for. See http://www.rafekettler.com/magicmethods.html#comparisons for more info. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Can one use python to concatenate n media files?

2015-10-12 Thread Emile van Sebille
On 10/11/2015 9:15 PM, Fast Primes wrote: If so, could someone present an example? target = open(target,'wb') for source in mediafilelist: target.write(open(source,'rb').read()) But you probably want something diff

Re: [Tutor] Updating index of a list

2015-10-08 Thread Emile van Sebille
; 1', ' 95'], ['5', ' jorgen', ' 1', ' 99’]] (it continues) from a text file. However, what I am trying to do take the indexes of thelist[0][1] which has a value of 'james' (being index 1 of list 0) and theist[0][3] which has

Re: [Tutor] Creating a match file

2015-09-21 Thread Emile van Sebille
, get that data and write all 12 fields to a new dictionary. When done, write the results to the output file. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Invalid Syntax Message

2015-09-14 Thread Emile van Sebille
ectly. How do I fix this problem so the programs are able to run on my Mac. Start by providing a complete copy-n-paste of the screen when the error occurs. That normally provides enough detail to diagnose the issue. Emile ___ Tutor maillist - Tuto

Re: [Tutor] problem with code

2015-08-20 Thread Emile van Sebille
quot;that seems reasonable")) if time<=2 else print ("get a life") Check your parens -- they're mismatched. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] About using list in a function

2015-08-19 Thread Emile van Sebille
internal server where we have only approved compatible sources/packages. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] variable existence q

2015-08-15 Thread Emile van Sebille
the global. Not any more -- it's a local variable because the assignment, while not executed, exists. If that is changed inside the function, doesn't it change the global? Only if you include the globals statement before the variable is referenced. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] variable existence q

2015-08-15 Thread Emile van Sebille
#x27;... As Peter noted, somewhere within override_defaults there's an assignment to it. Changing to def override_defaults(top_directory=top_directory): should initialize it in case the assignment path isn't processed. Emile ___ Tut

Re: [Tutor] SQLite, Python and SQL injection attacks

2015-08-14 Thread Emile van Sebille
ldn’t assemble your query using Python’s string operations because doing so is insecure; it makes your program vulnerable to an SQL injection attack ..." See http://bobby-tables.com/ for more info. Emile ___ Tutor maillist - Tutor@python.org To unsu

Re: [Tutor] revisiting a puzzle about -3**2 vs (-3)**2

2015-08-12 Thread Emile van Sebille
valuation as a number. Consider this: def sq1(x): sgn = int(x<0) return sgn*abs(x)**2 That's effectively what the parser does. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help

2015-08-10 Thread Emile van Sebille
On 8/10/2015 10:07 AM, Alan Gauld wrote: PS. What is SDSU? San Diego State University I'd guess. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] DEALING WITH API

2015-08-07 Thread Emile van Sebille
which includes all the updates that have taken place on the website in the last 24 hours. I'd normally use wget to retrieve tgz files and not a browser. Emile So, when I use urlopen on the same url, & I try to read it, all I get is gibberish. Any help, please ? If I am unable to solv

Re: [Tutor] Dictionary Issue

2015-08-07 Thread Emile van Sebille
tals of python in a time tested way. See https://docs.python.org/2/tutorial/ for python2 or https://docs.python.org/3/tutorial/ for python3. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.pyt

Re: [Tutor] Schechter Function in python

2015-08-04 Thread Emile van Sebille
: how would you write the following as a python function using valid python mathematical expressions: Your post ends prematurely without the example to be coded, but a google search for "Schecter function in python" yields a variety of hits. Have you checked

Re: [Tutor] scratching my head

2015-08-04 Thread Emile van Sebille
e "give a man a fish" approach to help; a magic black box to do the job for him. Sometimes a fish of three or four lines that replaces a 20 line effort might be better considered as a solution to be teased apart and understood. Emile ___

Re: [Tutor] String Attribute

2015-08-01 Thread Emile van Sebille
On 8/1/2015 4:21 PM, Ltc Hotspot wrote: Hi Emile, Question: What is the source of the line 7 syntax: mbox.split? I read mbox from the file. eg, mbox = open("mbox-short.txt",'r').read() and it looks to me that if you insert the above in front of the for loop belo

Re: [Tutor] String Attribute

2015-08-01 Thread Emile van Sebille
utput? Because there are 54 lines that start with 'From'. As I noted in looking at your source data, for each email there's a 'From ' and a 'From:' -- you'd get the right answer checking only for startswith('From ') Emile Here is the latest

Re: [Tutor] email validation

2015-08-01 Thread Emile van Sebille
I am guessing it has to do with my syntax? any suggestions, please? Python executes as it processes the file, so that open_existing_file must have been previously defined before you can refer to it. Try moving that def block in front of main and you'll likely be OK (assuming no other issues) Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] String Attribute

2015-08-01 Thread Emile van Sebille
du gsil...@umich.edu wagne...@iupui.edu zq...@umich.edu antra...@caret.cam.ac.uk gopal.ramasammyc...@gmail.com david.horw...@uct.ac.za david.horw...@uct.ac.za stephen.marqu...@uct.ac.za lo...@media.berkeley.edu lo...@media.berkeley.edu r...@media.berkeley.edu c...@iupui.edu c...@iupui.edu c...@iu

Re: [Tutor] a puzzle about -3**2 vs (-3)**2

2015-08-01 Thread Emile van Sebille
umans reading the code that need to change it. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] String Attribute

2015-08-01 Thread Emile van Sebille
27;re parsing it'll help us identify what the program will need to be prepared to handle. Emile On 7/31/2015 5:26 PM, Ltc Hotspot wrote: Hi Mark, Desired output on execution of the script: stephen.marqu...@uct.ac.za lo...@media.berkeley.edu zq...@umich.edu rjl...@iupui.edu zq...@umi

Re: [Tutor] String Attribute

2015-07-31 Thread Emile van Sebille
.split() > 9 line4 = line3[1] 10 addresses.add(line4) 11 count = count + 1 IndexError: list index out of range Because line3 is not sub-scriptable. Have you examined what line3 holds when the error occurs? Em

Re: [Tutor] 'open' is not defined

2015-07-30 Thread Emile van Sebille
27; >>> count = 0 >>> for line in fh: Please paste in the contents from your screen where the error appears. Note that in my example the open line complains about fname not existing so I'm getting and IOError, and if the issue were with open, as per the example with xxope

Re: [Tutor] Basic question about docstrings

2015-07-29 Thread Emile van Sebille
of showing those docstrings at the Python prompt? Are you asking about help? as in: >>> help(get_value) Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Identifying V3 examples

2015-07-23 Thread Emile van Sebille
ut and paste into the interpreter. eg ---8<---8<---8<---8<---8<---8<--- import sys for ii in sys.path: print ii ---8<---8<---8<---8<---8<---8<--- YMMV, Emile ___ Tutor maillist - Tutor@python.or

Re: [Tutor] FW: query

2015-06-24 Thread Emile van Sebille
number=int(input("Enter the number which u want to check for odd and even :")) You're probably seeing the error here, which is outside your try/except block, hence the except not working as you expect. try : Emile ___ Tut

Re: [Tutor] FW: query

2015-06-23 Thread Emile van Sebille
You're more likely to get an appropriate response if you review http://catb.org/~esr/faqs/smart-questions.html and then ask. Emile On 6/23/2015 10:13 AM, Gupta, Manaswini Kat wrote: From: Gupta, Manaswini Kat Sent: Tuesday, June 23, 2015 10:42 PM To: 'tutor-ow...@python.org&#x

Re: [Tutor] ls *.py[co] >> .hidden

2015-05-21 Thread Emile van Sebille
On 5/21/2015 9:28 AM, Albert-Jan Roskam via Tutor wrote: I just created an alias for this: alias hidepycs="ls *.py[co] > .hidden" Close -- try alias ls='ls --hide=*.py[co]' and when you want to see them use ls -a. Emile ___

Re: [Tutor] pointer puzzlement

2015-05-07 Thread Emile van Sebille
gt;>> id(20) 7515584L >>> id(10+10) 7515584L >>> id(19+1) 7515584L Compare to: def testid(K=100): K += 10 return 'the ID is', id(K), K Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-07 Thread Emile van Sebille
On 4/6/2015 12:42 PM, Dave Angel wrote: On 04/06/2015 03:20 PM, Emile van Sebille wrote: Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> d = {

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread Emile van Sebille
pass a particular dictionary value in a function? Or does it require a different form to do so? Maybe this form helps: Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.

Re: [Tutor] Matrix bug

2015-04-05 Thread Emile van Sebille
>> a[1][1]=1 >>> a [[0, 0, 0], [0, 1, 0], [0, 0, 0]] >>> hth, Emile a [[0, 0, 0], [0, 0, 0], [0, 0, 0]] a[0][0]=1 a [[1, 0, 0], [1, 0, 0], [1, 0, 0]] The code assigned to "1" a(0,0), a(1,0) and a(2,0). It was expected: [[1, 0, 0], [0, 0, 0], [0, 0,

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Emile van Sebille
On 4/2/2015 4:22 AM, Dave Angel wrote: There was somewhere in one of the books a list of 'good practice,' including an item something like: Solve the right problem. There's a world of wisdom in that one alone. +1 Emile ___

Re: [Tutor] updating a dictionary

2015-02-19 Thread Emile van Sebille
On 2/19/2015 3:10 PM, Alan Gauld wrote: On 19/02/15 22:50, Emile van Sebille wrote: if cell.endswith(suffix, 14, 16) is False: ... so they'll never end with numeric values. Further, "".endswith() accepts only one argument so you ought to get an error on this line. Sorr

Re: [Tutor] updating a dictionary

2015-02-19 Thread Emile van Sebille
dict['Cell'] = site dict[band] = dl_prb_utl inFileOne.close(); Perhaps if you provide a sample of what the contents of inFileOne look like and what you want dict to look like after each iteration we'd get a better idea of what you're trying to accomplish. As it is, it'd likely take someone who recognizes the problem domain to shed light on this. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] (no subject)

2015-02-19 Thread Emile van Sebille
On 2/19/2015 9:23 AM, rakesh sharma wrote: Greetings !! Hi all, what the meaning of the line at the start of the python file __author__ = "user" Googling __author__ provides lots of relevant info. Emile ___ Tutor maillist - Tutor@pyt

Re: [Tutor] Topic focus of ‘python-tutor’

2015-02-19 Thread Emile van Sebille
On 2/19/2015 1:51 AM, James Chapman wrote: No one should *_EVER_ *be discouraged to ask a question they do not know have not found the answer to. Learning where to look and how to ask are likely more important skills for a programmer than learning any one specific language. Emile

Re: [Tutor] Why is an instance smaller than the sum of its components?

2015-02-03 Thread Emile van Sebille
On 2/3/2015 1:12 PM, Jugurtha Hadjar wrote: Hello, I was writing something and thought: Since the class had some 'constants', and multiple instances would be created, I assume that each instance would have its own data. So this would mean duplication of the same constants? If so, I thought why n

Re: [Tutor] Learning python scripts for practical linux activities.

2015-01-15 Thread Emile van Sebille
ython scripts that incorporate "LAME" for modifying audio files. Anything of that nature. As I learn Python, I would like to create Python utilities. I'm hoping there is some learning material that might lead me in that direction. Sincere thanks d Check out http://it-ebooks.i

Re: [Tutor] Problem understanding the asarray function of numpy

2014-09-11 Thread Emile van Sebille
ameter for the sum builtin -- this sum function comes from numpy. See http://docs.scipy.org/doc/numpy/reference/generated/numpy.sum.html for details. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https

Re: [Tutor] How to count vehicle? I'm trying but my code don't increasing..

2014-09-03 Thread Emile van Sebille
On 9/2/2014 7:01 AM, Whees Northbee wrote: If all of these confusing, I'll simplify the problem, I need to know if a point (x,y) exactly at a line where line is (ax1,ay) to (ax2,ay).. Can someone tell me how?? if ax1https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Shorter way for a little program

2014-08-24 Thread Emile van Sebille
On 8/23/2014 7:16 AM, Mimi Ou Yang wrote: age = input("K") age = int(age) if (age == 1) or (age == 2) or (age == 3) or (age == 4): print ("LOL") else: print ("K") Is there a shorter way to do this program??? print ('LOL','K')[int(input("k"))>4] ___

Re: [Tutor] import values, calculate distance

2014-08-21 Thread Emile van Sebille
I think would be to call these things: > id, x, y > Minor nit: better still would be: code, x, y so as not to shadow the builtin id Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] import values, calculate distance

2014-08-21 Thread Emile van Sebille
I think would be to call these things: > id, x, y > Minor nit: better still would be: code, x, y so as not to shadow the builtin id Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Printing multi-line variables horizontally

2014-08-08 Thread emile
On 08/08/2014 10:58 AM, emile wrote: On 08/08/2014 01:50 AM, Greg Markham wrote: die_1 = """ .-. | | | o | | | `-'""" die_2 = """ .-. |o| | | |o| `-'""" Not quite sure how this

Re: [Tutor] Printing multi-line variables horizontally

2014-08-08 Thread emile
On 08/08/2014 01:50 AM, Greg Markham wrote: die_1 = """ .-. | | | o | | | `-'""" die_2 = """ .-. |o| | | |o| `-'""" I'll leave the cleanup as an exercise for you. HTH, Emile

Re: [Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread Emile van Sebille
You might try using '"%s"' % filename so that the name is within quotes for the shell environment. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Read a file, Load a dictionary

2014-07-24 Thread Emile van Sebille
Comma Separated Value (CSV) files... and then load it into a dictionary. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Security and Reliability of Python

2014-07-24 Thread Emile van Sebille
#x27;s as secure and reliable as we need it to be. :) Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] subprocess.call not formatting date

2014-07-08 Thread Emile van Sebille
e must be an integer") TypeError: bufsize must be an integer Any suggestions, please? Pass in the formatted string using the python datetime module. datetime.datetime.today().strftime("%y-%m-%d_%H-%M") see https://docs.python.org/2/library/datetime.html for more details. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Socket Error: Connection refused

2014-07-07 Thread Emile van Sebille
he options tab of the cmd.exe properties. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why is Quick Search at docs.Python.org so useless?

2014-07-06 Thread Emile van Sebille
On 7/5/2014 11:40 AM, Deb Wyatt wrote: I'd be using a news reader if accessing news was still free. Try news.gmane.org. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/ma

Re: [Tutor] What are your favourite unofficial resources

2014-06-30 Thread Emile van Sebille
obably of similar quality. Well, in that case I'd put forward effbot's guide to the python standard library, particularly for python 2.x, but most of the examples are still valid. I paid for it back in the day, but now it's available on-line at http://effbot.org/librarybook/ Emile

Re: [Tutor] What are your favourite unofficial resources

2014-06-30 Thread Emile van Sebille
ff finally. >sigh< Hi Emile, I do not know what you are referring to. Can you be more specific? Are you referring to comp.lang.python, or a different newsgroup, or something else entirely? Are you talking about a particular mailing list? See http://en.wikipedia.org/wiki/Google_Groups fo

Re: [Tutor] What are your favourite unofficial resources

2014-06-30 Thread Emile van Sebille
ff finally. >sigh< Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How does one construct a module for import?

2014-06-02 Thread Emile van Sebille
e. so you've likely done something like: import xyz xyz(a,b,c,d,e...,rationvtorc) when you should be doing something like: import xyz xyz.callable(a,b,c,d,e...,rationvtorc) HTH, Emile 528 529 plotDataV2(cycles, AdvancedCapital, lnAdvancedCapital, RealisedCapital,

Re: [Tutor] (no subject)

2014-05-15 Thread Emile van Sebille
grade = "C" elif curraverage >= 60: grade = "D" else: grade = "F" lettergrades.append(grade) HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Finding Hostname-IP DNS mappings and if machine is dead or alive

2014-05-12 Thread Emile van Sebille
How far have you gotten? Post your code to show us where you're at and we can point you in the right direction. Emile On 5/12/2014 2:44 PM, KIRAN D.S. wrote: Hi, I have a UNIX shell script that: a. lists out the Hostname-IP DNS mappings b. checks whether the machine is pingable

Re: [Tutor] Keeping change-in-place vs. copy methods straight

2014-04-28 Thread Emile van Sebille
n reverse: reverse(...) L.reverse() -- reverse *IN PLACE* >>> The *IN PLACE* tells me. HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Understanding code line

2014-03-27 Thread Emile van Sebille
On 3/21/2014 3:40 PM, Steven D'Aprano wrote: a = b This assigns the value to b. So if b was 4, now a is also 4. Steven means 'assigns the value to a' here. For anyone looking down the line... ___ Tutor maillist - Tutor@python.org To uns

Re: [Tutor] PLEASE remove me from your e-mailing list

2014-03-20 Thread Emile van Sebille
We can't take you off the list -- see the line below that says: To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor Emile On 3/20/2014 3:43 PM, Art Caton wrote: artca...@gmail.com no longer requests your "Tutor Request&q

Re: [Tutor] How to determine which function code is being called from

2014-03-06 Thread Emile van Sebille
While there are ways of getting at the caller using introspection, there are no reliable ways of doing so and you would do well to rethink the need and take an alternate course such as passing a parameter in. Suppose the following: funcC=funcB what would you want to see? Emile On 3/6/2014

Re: [Tutor] reg: How to import dll in python

2014-03-05 Thread Emile van Sebille
Hi Shweta, You'll likely get a better response posting this question on the main python list -- the Tutor list is primarily for teaching python Emile On 3/5/2014 4:49 AM, Shweta Kaushik wrote: Hi, Please find code used to create dll: *_add_1.cpp_* #include "add_1.h" usin

Re: [Tutor] Regular expression - I

2014-02-18 Thread Emile van Sebille
On 2/18/2014 11:42 AM, Mark Lawrence wrote: On 18/02/2014 18:03, Steve Willoughby wrote: Because the regular expression means “match an angle-bracket Please do not top post on this list. Appropriate trimming is also appreciated. Emile

Re: [Tutor] for: how to skip items

2014-02-17 Thread emile
13:47:21) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> a100 = list(range(100)) >>> a100[::10] [0, 10, 20, 30, 40, 50, 60, 70, 80, 90] >>> HTH,

Re: [Tutor] is an alias a variable

2014-01-31 Thread emile
, 09:35:42) [GCC 2.96 2731 (Red Hat Linux 7.1 2.96-85)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys as s >>> m = s >>> id(m) 1075446500 >>>

Re: [Tutor] auto completion before initially running program

2014-01-31 Thread emile
than running the program I presume there is no way around this. Autocompletion is provided by the editor you're using. You'll need to place some more context around this question to get appropriate responses. Emile ___ Tutor maillist - T

Re: [Tutor] run a python script from access form

2014-01-31 Thread emile
e's python distribution which includes Mark Hammond's windows extensions. Then read through the docs on com servers. It's been a while since I've done so, but I expect that should get you going. Emile ___ Tutor maillist - Tutor@pytho

Re: [Tutor] how run it on python 3

2014-01-20 Thread Emile van Sebille
posts won't be quite so diluted... Emile In which case, I can only suggest: please read and respond to what other people are asking you. Otherwise, it defeats the purpose of asking a question: that is, to communicate. ___ Tutor maillist -

Re: [Tutor] how run it on python 3

2014-01-20 Thread Emile van Sebille
expressions, but always include the full traceback as that tells us where to start looking for the issue. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] another better way to do this ?

2014-01-12 Thread Emile van Sebille
b: a=a.replace(ii,"") while ii+ii in a: a=a.replace(ii+ii,ii) return b in a Show me another. :) Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] another better way to do this ?

2014-01-12 Thread Emile van Sebille
ii not in b: a=a.replace(ii,"") return b in a Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python & Django

2014-01-09 Thread Emile van Sebille
party module that the django users are having problems with. YMMV, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] recursion depth

2014-01-08 Thread Emile van Sebille
the adding part, and the palindrome checking part), but apparently I can't help but blow up my machine... Without seeing your code it's hard to be specific, but it's obvious you'll need to rethink your approach. :) Emile ___ Tutor

Re: [Tutor] ValueError: could not convert string to float: '13,2'

2014-01-03 Thread emile
be aware that it could impact other parts of your porgram as well, particularly if this is a read in data set from a non-local region. Also, in places where commas are used as decimal points, it's also common to use periods as commas: >>> print

Re: [Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread emile
On 12/23/2013 07:11 AM, Steven D'Aprano wrote: Are you now even a *tiny* bit moved to use a single space after full stops?) No. See http://www.heracliteanriver.com/?p=324 Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or c

Re: [Tutor] Positional Arguments

2013-11-01 Thread Emile van Sebille
#x27;payrate' so the proper way to call the function would be: calcandprint (86, 11.50) which would (presumably) calculate and print the result of having worked 86 hours at a payrate of 11.50/hr But-I-didn't-read-all-your-code-ly y'rs, Emile On 11/1/2013 11:43 AM, Jenny Allar wr

Re: [Tutor] python, xml, mongodb

2013-10-27 Thread Emile van Sebille
k to fully integrate and test each additional data source. Hope this helps, Emile On 10/24/2013 1:44 PM, Ismar Sehic wrote:> hello, me again - the guy with a (mis)fortune of having to deal with a > lot of company's in and outgoing xml.I guess they just like xml as a > data

Re: [Tutor] Getting daily averages with pandas

2013-10-13 Thread Emile van Sebille
Hi Boris, Read up on the trig functions in the math module. http://docs.python.org/2/library/math.html#trigonometric-functions Emile On 10/11/2013 6:18 PM, Boris Vladimir Comi wrote: Boris Vladimir Comi escrito: I found a way to create daily averages of many variables, for example of a

Re: [Tutor] OT: Coffeescript and Python

2013-09-06 Thread Emile van Sebille
On 9/6/2013 3:47 AM, Alan Gauld wrote: This is somewhat off topic so replies offlist may be appropriate. I can fix that. :) Are you familiar with pyjs, which provides python to javascript capabilities? (see http://pyjs.org/) Is there any reason to prefer one over the other? Emile I&#x

Re: [Tutor] Comment on http://www.catb.org/esr/faqs/smart-questions.html

2013-08-26 Thread Emile van Sebille
perhaps pointing to http://www.catb.org/esr/faqs/smart-questions.html#intro is a better answer? Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Comment on http://www.catb.org/esr/faqs/smart-questions.html

2013-08-26 Thread Emile van Sebille
dn't write esr and Rick Moen to request changes -- I expect you'd be pointed to http://www.catb.org/esr/faqs/smart-questions.html#disclaimer if you got a reply at all. Emile On 8/26/2013 12:41 PM, bob gailer wrote: Hi fellow tutors and helpers. I have a reaction to http://www.cat

Re: [Tutor] does anyone know a good module for automation

2013-04-29 Thread Emile van Sebille
I recently automated a scheduled task to retrieve content from an https site that uses javascript for site interaction using iMacros, ahk and the related firefox extension. Not a python solution, but it got the job done. Emile On 4/26/2013 8:28 AM, Frank Schiro wrote: Pywinauto is not

Re: [Tutor] How to find reverse pair words in a list of Words that has to be accessed through a URL

2013-04-19 Thread emile
se of self paired words that aren't pairs. (pop,wow,mom,etc) I got 94 distinct pairs. Which is a better result than the 124.5 pairs I got the first pass through. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscriptio

Re: [Tutor] Python Pipes

2012-10-29 Thread Emile van Sebille
On 10/29/2012 3:33 AM, Ganesh Manal wrote: Please give me sample python program that works with python31 Start with the tutorial at http://docs.python.org/3/tutorial/index.html It'll step you through lots of sample python scripts. Emile ___

Re: [Tutor] Question

2012-10-28 Thread Emile van Sebille
to me that the v3.x compatible wxpython is being rebranded as Project Phoenix -- see http://wiki.wxpython.org/ProjectPhoenix Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/lis

Re: [Tutor] Doubt!

2012-10-23 Thread emile
und returns an empty string." HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] newb help reading lines from csv

2012-10-22 Thread Emile van Sebille
the second for loop not execute at all? The first one prints the rows of the file just fine. The first pass also exhausts the input feed -- you'll need to rewind or reposition the next line pointer to the start of the file and I suspect the easiest way is to

Re: [Tutor] name conventions

2012-10-22 Thread Emile van Sebille
official word is pep 8 -- http://www.python.org/dev/peps/pep-0008/ Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using the set.difference method with an unknown number of input iterables

2012-10-18 Thread Emile van Sebille
I try, but they just tell > me that there is something that I'm missing here. > > Thanks > > #Code below > a = set([1,2,3,4]) > b = set([2,3,4,5]) > c = set([3,4,5,6]) > d = set([4,5,6,7]) > > not_a = [b,c,d] > a.difference(not_a) Try this as a.difference(*no

  1   2   3   4   5   6   >