[Tutor] anomaly

2018-04-19 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
I have a situation in which the same code gives an error in idle but works in qtconsole regards, *​in idle* v = np.zeros(len(x)) for i in range(len(x)): if x[i] < 1.0: v[i] = 0 else: v[i] = V print v​ RESTART: C:\Users\SHARMA\Documents\Python Scripts\sqwell.py ==

[Tutor] face recogniztion using raspberry pi

2018-03-03 Thread mamatha n
Hello friends. thise is my code i want to compare to image, and i need to get result percentage formate dis is very urgent. any one tell me how can i compare ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://ma

[Tutor] python gui Tkinter

2018-01-13 Thread mamatha n
please any one give me the code for username (entryfld)- pwrd (entryfld) login(button),changepwrd(button) virtualkeyboard-user has to be use dis keyboard once click on login button regester page open register page content 1.emply name(entryfld) 2.emply id(

Re: [Tutor] coding help with maxwell-boltzmann distribution

2017-10-13 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Yes we can vectorize. regards, Sarma. On Fri, Oct 13, 2017 at 9:43 PM, Peter Otten <__pete...@web.de> wrote: > D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > > f = np.zeros(40) > > v = np.arange(0,4,0.1) > > for i in np.arange(0, 40): > > f[i] = v[i]**2*(np.exp(-v[i]**2)) > > Note that you can write th

Re: [Tutor] coding help with maxwell-boltzmann distribution

2017-10-13 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Except for some constants the essential behaviour of Maxweell-Boltzmann distribution is determined by v**2 * exp(-v**2) The following code will gove you a plot of the shape of the curve. from matplotlib import pyplot as plt import numpy as np f = np.zeros(40) v = np.arange(0,4,0.1) for i in np.ara

Re: [Tutor] Require help for a script

2017-09-19 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
First fill the first row and first column of the matrix with seperate loops. Then the rest of the elements of the matrix can be filled with nested loops. regards, Sarma. On Tue, Sep 19, 2017 at 1:18 PM, Clara Chua wrote: > Hi Python tutor, I require help for a script that asks user for number of

[Tutor] Image i/o in python

2017-07-16 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
In python we have a set of imread and imshow in skimage. In matplotlib.image we again have imreadand imshow functions. In scipy.misc we again have another set imread and imshow. Are there anyfunctional differences between these multiple sets to justify their presence? … regards, Sarma. ___

Re: [Tutor] reg. list update

2017-04-17 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
This is an aliasing problem. Change the code to super = [] sub = [""]*3 other = ["a","b","c","d"] sub[0] = "hi" sub[1] = "hello" for item in other: l = sub[:] l[2] = item super.append(l) for item in super: print item regards, Sarma. On Tue, Apr 18, 2017 at 2:16 AM, Mats Wichmann

Re: [Tutor] sorted function

2017-04-14 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Change your code to def front_x(words): # +++your code here+++ ls=[] ls1=[] for str in words: if str[0]=='x': ls.append(str) else: ls1.append(str); print ls print ls1 ls = sorted(ls) ls1 = sorted(ls1) ls.extend(ls1) return ls regards, Sarma. O

Re: [Tutor] Count for loops

2017-04-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
A lot of confusion is caused by the print function converting an integer or float to a string before printing to console. thus both '1234 and '1234' are shown as 1234 on the console. Similarly '15.4' and 15.4 are displayed as 15.4. There is no way to tell which is a string, which is an int and whic

Re: [Tutor] Count for loops

2017-04-03 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Small correction. file_path = "C:/Users/Rafael/PythonCode/PiDigits.txt" with open(file_path) as a: b = a.read() get_year = input("What year were you born? ") count = 0 b= '3'+b[2:] n = len(b) for i in range(n-3): if b[i:i+4] == get_year: count += 1

Re: [Tutor] Count for loops

2017-04-03 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
I will go for this modification of the original code. file_path = "C:/Users/Rafael/PythonCode/PiDigits.txt" with open(file_path) as a: b = a.read() get_year = input("What year were you born? ") count = 0 b= '3'+b[2:] n = len(b) for i in range(n-4): if b[i:i

Re: [Tutor] Count for loops

2017-04-03 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Sorry. That was stupid of me. The loop does nothing. regards, Sarma. On Mon, Apr 3, 2017 at 8:44 PM, Alan Gauld via Tutor wrote: > On 03/04/17 16:07, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > > Modifying the code as shown below may work. > > I doubt it. > > > with open(file_path) as a: > > b

Re: [Tutor] Count for loops

2017-04-03 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Modifying the code as shown below may work. file_path = "C:/Users/Rafael/PythonCode/PiDigits.txt" with open(file_path) as a: b = a.read() get_year = input("What year were you born? ") count = 0 for year in b: if get_year in b: count += 1 print("Your birth date occurs %s times in

Re: [Tutor] Calculate 4**9 without using **, was Re: QUESTION

2017-03-04 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Much simpler is 4*4*4*4*4*4*4*4*4 regards, Sarma. On Sat, Mar 4, 2017 at 2:20 PM, Peter Otten <__pete...@web.de> wrote: > Tasha Burman wrote: > > > Hello python tutors, > > I am having difficulty with a power function; what is another way I can > do > > 4**9 without using **? Thanks, > > Hello

Re: [Tutor] Adding numbers within a string

2016-10-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Then Isaac's function does that(but you have to leave a space after last number in the string). def foo(x): a, b = 0, "" for i in x: if i != " ": b += i else: print ("this is b", b) a += int(b) print ("this is a",a)

Re: [Tutor] Adding numbers within a string

2016-10-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Sorry, I did not read the conditions that split and for should not be used. regards, Sarma. On Wed, Oct 12, 2016 at 10:20 PM, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > def string_sum(s): > total = 0 > items = s.split(" ") > for item in items: >total += int(item) > p

Re: [Tutor] Adding numbers within a string

2016-10-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
def string_sum(s): total = 0 items = s.split(" ") for item in items: total += int(item) print(total) You can call the function as string_sum("10 4 5 ") Output will be 19. regards, Sarma. On Wed, Oct 12, 2016 at 3:22 PM, hell gates wrote: >You can write y

Re: [Tutor] Python Code Not Working

2016-10-11 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
An easier solution is simply to type 'print' in place of 'test' in the program. It will work. regards, Sarma. On Mon, Oct 10, 2016 at 2:09 AM, wrote: > Everytime I run this it says test is not defined . I don’t understand. Can > someone please help correct? > > #Question 10 > > def reverse(mys

Re: [Tutor] maximum recursion error

2016-09-16 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Can somebody tell me why my IDLE hangs when asked setrecursionlimit. >>> x=GetSet(40) >>> x.var 40 >>> x.__dict__ {'var': 40} >>> del x.var >>> x.__dict__ {} >>> import sys >>> sys.setrecursionlimit(7) regards, Sarma. ___ Tutor maillist - Tutor@pyth

Re: [Tutor] Problem

2016-08-29 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
The following code should do. for a in range(1,10): for b in range(1,5): for c in range(1,5): for mc in range(50, 55): if mc ==(6*a)+(9*b)+(20*c): print "mc= ",mc,"a= ",a,"b= ",b,"c=",c regards, Sarma. On Mon, Aug 29, 2016 at 3:34 PM, A

[Tutor] install issues - third party modules

2016-08-11 Thread N Woodruff
Hello: I need some help with python installation, please. I have downloaded python 3.5.2, and installed it without issues on windows 7. Now I cannot get Third-party modules to install. I want to use openpyxl. I get the following errors:

Re: [Tutor] Dictionary Question

2016-05-02 Thread Jason N. via Tutor
ay 2, 2016 5:27 PM, "Jason N. via Tutor" wrote: > > Hello, > Wanted to ask if its possible to have a dictionary that can be looked up by > either values? > For example,  > mydic = {"A: "Apple", "B": "Banana"}When user inputs "A

[Tutor] Dictionary Question

2016-05-02 Thread Jason N. via Tutor
Hello, Wanted to ask if its possible to have a dictionary that can be looked up by either values? For example,  mydic = {"A: "Apple", "B": "Banana"}When user inputs "A" I want "Apple" to come. But if the user enter "Apple" I want "A" to respond. Please let me know the best way to handle this type

Re: [Tutor] "List" object is not callable

2016-05-01 Thread Jason N. via Tutor
Hello, I figured out the issue. It was a silly mistake - i was not running the correct code; instead was running code from another program which was active on a second tab. Thank you. On Sunday, May 1, 2016 4:15 PM, Jason N. via Tutor wrote: Thank you all for your responses.  I am

Re: [Tutor] "List" object is not callable

2016-05-01 Thread Jason N. via Tutor
://unsee.cc/sonezima/ Thank you. On Saturday, April 30, 2016 11:12 PM, Steven D'Aprano wrote: On Sat, Apr 30, 2016 at 06:51:17PM +, Jason N. via Tutor wrote: > Hello, > I found this simple script online but when I execute it I get the > following error: "TypeError: &

[Tutor] "List" object is not callable

2016-04-30 Thread Jason N. via Tutor
Hello, I found this simple script online but when I execute it I get the following error: "TypeError: 'list' object is not callable" Here is the code sample:import subprocess ls_output= subprocess.check_output(['dir']) I searched online and found a another similar code sample (http://www.opentec

Re: [Tutor] Fw: URGENT: PYTHON QUESTION

2016-03-31 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
This is working fine. What is the problem? def manipulate_data(kind, data): if kind == 'list': return list(data)[::-1] elif kind == 'set': #data=set({"a", "b", "c", "d", "e", "ANDELA", "TIA", "AFRICA"}) return set(data) elif kind == 'dictionary': return

[Tutor] Fwd: Citing Python

2016-03-16 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
-- Forwarded message -- From: D.V.N.Sarma డి.వి.ఎన్.శర్మ Date: Wed, Mar 16, 2016 at 3:39 PM Subject: Re: [Tutor] Citing Python To: Steven D'Aprano "Python 2.7.11 |Anaconda 2.5.0 (64-bit)| (default, Jan 29 2016, 14:26:21) [MSC v.1500 64 bit (AMD64)] on win32 Type "copyright", "cr

Re: [Tutor] Python Programming

2014-08-27 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
change the line if answera == ["Oslo" or "oslo"]: to if answera == "Oslo" or answera == "oslo": and see if it works. regards, Sarma. On Thu, Aug 28, 2014 at 12:27 AM, Alan Gauld wrote: > On 27/08/14 14:40, Jake wrote: > >> To whom it may concern, >> My name is Jake and I have recently sta

Re: [Tutor] re module

2014-08-14 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
I tested it on IDLE. It works. regards, Sarma. On Thu, Aug 14, 2014 at 7:37 PM, Chris “Kwpolska” Warrick < kwpol...@gmail.com> wrote: > > On 14 Aug 2014 15:58 "Sunil Tech" wrote: > > > > Hi, > > > > I have string like > > stmt = 'Patient name: Upadhyay Shyam style="font-family: times new roman

[Tutor] PYTHON 2.5.6 64 Bit Compilation is failing on Aix

2013-10-01 Thread D N, Mahesh
Hi, While compiling python2.5.6 by passing 64 bit arguments on aix5.3, make is failing . Command used to build: ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" --disable-ipv6 AR="ar -X64" --prefix=/usr/prasad/python --disable-shared --with-libs='/usr/prasad/ncurses/lib/libncurses.

[Tutor] A mergesort

2013-08-31 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
I have been searching for mergesort implimentations in python and came across this. def merge(a, b): if len(a)*len(b) == 0: return a+b v = (a[0] < b[0] and a or b).pop(0) return [v] + merge(a, b) def mergesort(lst): if len(lst) < 2: return lst m = len(lst)/2 return merge(mergesort(lst[:m]), mer

Re: [Tutor] python help!

2013-02-09 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Remove also 'continue' statement under the 'if denary2 not in range(0,256)' clause. On Sun, Feb 10, 2013 at 7:06 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ < dvnsa...@gmail.com> wrote: > I have altered the program to run on Python 2.7.3 > Perhaps it will run on Python 3 with small/or no alterations. > > def

Re: [Tutor] python help!

2013-02-09 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
I have altered the program to run on Python 2.7.3 Perhaps it will run on Python 3 with small/or no alterations. def show_menu(): print("===") print("1-binary to denary") print("2-denary to binary") print("3-exit") print("===") while True: show_men

[Tutor] Help on Remote File Copy & Exection

2012-10-25 Thread Arumugam N
Hi All, First of the big thanks and congrats for managing such a brilliant online community. I am new to Python and have started getting the taste of python on my day to day work. I have a requirement and i am trying to solve it using python. I am from QA. Here is what i do daily and wanted to d

Re: [Tutor] Musical note on python

2012-09-16 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
winsound.Beep() takes only integral values for frequency. Therefore you cannot use it if you want either just intonation or equal temperment scales exactly. -- regards, Sarma. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Musical note on python

2012-09-13 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
quot;"create a polyphonic waveform > > freqs: sequence of frequencies (Hz) > amps: sequence of amplitudes > f0: fundamental frequency (Hz) > fs: samples/second > > output is normalized to the range [-1,1]. > ""&

Re: [Tutor] Musical note on python

2012-09-13 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Error: "name data undefined" On Fri, Sep 14, 2012 at 12:33 AM, eryksun wrote: > On Thu, Sep 13, 2012 at 11:48 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ > wrote: > > > > As far as programming volume is concerned winsound.Beep has only > frequency > > and duration. pyaudio module appears to have provision

Re: [Tutor] Musical note on python

2012-09-13 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
As far as programming volume is concerned winsound.Beep has only frequency and duration. pyaudio module appears to have provision for volume control. Please refer to eryksun's post. -- regards, Sarma. On Thu, Sep 13, 2012 at 8:42 PM, Mark Lawrence wrote: > On 13/09/2012 13:29, D.V.N.Sarma డి.వి

Re: [Tutor] Musical note on python

2012-09-13 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
I want to thank all of you who have come forward to help me. -- regards, Sarma. On Thu, Sep 13, 2012 at 10:46 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ < dvnsa...@gmail.com> wrote: > Yes. As far as I can see it does not contain any thing which > concerns the volume of sound. > > > -- > regards, > Sarma.

Re: [Tutor] Musical note on python

2012-09-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Yes. As far as I can see it does not contain any thing which concerns the volume of sound. -- regards, Sarma. On Thu, Sep 13, 2012 at 5:42 AM, Mark Lawrence wrote: > On 13/09/2012 00:57, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > >> The Beep attribute of winsound module is useful. But the volume is f

Re: [Tutor] Musical note on python

2012-09-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
One can ofcourse increase the volume by adjusting master volume. But one needs ability to program volume level in order to produce sounds of different volume levels in a piece of music. -- regards, Sarma. On Thu, Sep 13, 2012 at 5:27 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ < dvnsa...@gmail.com> wrote: >

Re: [Tutor] Musical note on python

2012-09-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
The Beep attribute of winsound module is useful. But the volume is feeble. Is there anyway to control the loudness. -- regards, Sarma. On Thu, Sep 13, 2012 at 4:45 AM, Alan Gauld wrote: > On 12/09/12 14:53, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > >> My OS is Windows XP. I have Python 2.7.3(32 bit).

Re: [Tutor] Musical note on python

2012-09-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
My OS is Windows XP. I have Python 2.7.3(32 bit). My question is are there any commands in Python which directly allow me to produce a pure note of a given frequency, given volume and given duration. Further can we access the different sound channels(sound card) available through Python. -- regar

[Tutor] Musical note on python

2012-09-11 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
How to produce a musical note of given frequency,volume and duration in Python. -- regards, Sarma. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Subclassing list

2009-06-18 Thread Luis N
On Fri, Jun 19, 2009 at 12:56 AM, bob gailer wrote: > > Luis N wrote: >> >> I get an error "TypeError: 'rounding' is an invalid keyword argument >> for this function" on my list subclass. >> >> How might I subclass list without this er

[Tutor] Subclassing list

2009-06-18 Thread Luis N
I get an error "TypeError: 'rounding' is an invalid keyword argument for this function" on my list subclass. How might I subclass list without this error? This is the code: class SeriesList(list): def __new__(cls, *args, **kwargs): series_list = list.__new__(cls, *args) serie

Re: [Tutor] Nested, line by line, file reading

2007-12-16 Thread Luis N
On Dec 16, 2007 10:17 PM, jon vs. python <[EMAIL PROTECTED]> wrote: > Hi everyone, > I have a file with this content: > > "1 > 1 > 1 > 1 > 1 > 1 > 1 > 2 > 1 > 1" > > I wanted a little script that would print the line containing "2" and every > line containing "1" after it. I've tried this: > > >>>

Re: [Tutor] Introspect function or class' required arguments

2007-12-13 Thread Luis N
On Dec 14, 2007 12:08 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Luis N wrote: > > Is there a way to introspect a function or class' required arguments, > > particularly keyword arguments? > > See inspect.getargspec() and formatargspec(). > Look at the sour

[Tutor] Introspect function or class' required arguments

2007-12-13 Thread Luis N
Is there a way to introspect a function or class' required arguments, particularly keyword arguments? I can easily use a dictionary since it is my own function that I wish to introspect. I haven't tested the below code yet, but e.g. obj = getattr(self, 'obj')() preprocessors = {'Card':[{'obj_attr

Re: [Tutor] Python Versions

2007-12-12 Thread Luis N
On Dec 13, 2007 3:38 PM, earlylight publishing <[EMAIL PROTECTED]> wrote: > Do people really write whole applications just using the shell? > The shell isn't intended for writing whole applications. However, it's invaluable for testing. For writing whole applications I'd recommend The One True Edit

Re: [Tutor] Still Can't Find Timed While Loops

2007-12-07 Thread Luis N
I can't recall what your initial project was. I think it was a text adventure. I imagine that you have bigger ideas regarding timers then your current code suggests. Maybe you should investigate a time aware long-running process. Twisted Python is such a beast. While I can't recommend it's use as

[Tutor] PIDA Issue

2007-12-06 Thread Mahesh N
I have installed pida succesfully using the command python setup.py install Installation was successful i.e. no errors but when i launch pida, it says some module is missing. wat could be the problem??? i am posting the result of installation and of launching the program. maggi:~/Desktop/PIDA-0.5

Re: [Tutor] how to accept an integer?

2007-12-05 Thread Mahesh N
On Dec 6, 2007 2:31 AM, Mahesh N <[EMAIL PROTECTED]> wrote: > I dun understand the mistake. My aim is to accept an integer number. The > python lookup in IDLE asks for a string object but the interpreter returns > with the following error message. Some one pls explain. > Th

Re: [Tutor] how to accept an integer?

2007-12-05 Thread Mahesh N
On Dec 6, 2007 2:37 AM, Eric Brunson <[EMAIL PROTECTED]> wrote: > Mahesh N wrote: > > I dun understand the mistake. My aim is to accept an integer number. > > The python lookup in IDLE asks for a string object but the interpreter > > returns with the following error me

[Tutor] how to accept an integer?

2007-12-05 Thread Mahesh N
(). But how does input() function work? >>> prompt="temme a number\n" >>> speed =input(prompt) Traceback (most recent call last): File "", line 1, in speed =input(prompt) TypeError: 'str' object is not callable >>> speed =input("

[Tutor] Help with modulus.

2007-11-27 Thread Luis N
I'd like the below to be a single line if possible. hours = metrics.totaltime/360 minutes = (metrics.totaltime - 360*hours)/6 seconds = (metrics.totaltime - 360*hours - 6*minutes)/1000 Would it be possible to simplify this with a generator expression e.g. total_time = tuple((

Re: [Tutor] CGI request handler bug?

2007-03-02 Thread Steve N
> I was playing with some simple HTTP CGI server code > and discovered what I think may be a bug in > CGIHTTPServer.CGIHTTPRequestHandler. A "GET" request > without a leading '/' from a telnet session displays > the CGI script rather than the script's output. If > the > request includes the leading

[Tutor] CGI request handler bug?

2007-03-02 Thread Steve N
(myip, 8000), CGIHTTPRequestHandler) serv.serve_forever() print 'Content-type: text/html\n' print 'Hello' print 'Hello' Telnet without a leading '/' in the request displays the script: telnet localhost 8000 GET cgi-bin/hello.py print 'Content-type: te

[Tutor] problem with defining a global class instance

2006-11-17 Thread sharath B N
hi, i am sort of newbie to python. I am trying to do a super Market simulation with OOP in python. I have problems with using a class instance as global... def generate (... ,,...) " in this function i define the global variables " global stock,stockManager, manager etc. class Manager ... .

[Tutor] problem with defining a global class instance

2006-11-16 Thread sharath B N
hi, i am sort of newbie to python. I am trying to do a super Market simulation with OOP in python. I have problems with using a class instance as global... def generate (... ,,...) " in this function i define the global variables " global stock,stockManager, manager etc. class Manager ... .

Re: [Tutor] urllib

2006-09-12 Thread N
Hi,   You can try this:   import httplib, urllib params = urllib.urlencode({'ID':'1','Name':'name', 'Eid':'we[at]you.com'}) #Assumed URL: test.com/cgi-bin/myform h = httplib.HTTP("test.com")h.putrequest("POST", "/cgi-bin/myform")h.putheader("Content-length", "%d" % len(params))h.putheader('A

Re: [Tutor] Any good Glade and python tutorials?

2005-10-18 Thread Luis N
You might want to search for how it fits together with twisted's reactor http://www.google.com/search?q=twisted+glade+reactor Luis. On 10/15/05, Adam <[EMAIL PROTECTED]> wrote: > I'm making a Twisted app that needs a client side GUI and GTK seems like the > best way to go about this. Can anybody

Re: [Tutor] Boa-Constructor

2005-09-15 Thread Luis N
> Luis, > > I was actually asking how usable Boa-Constructor is right now for project > purposes, since I had "heard" it was kind of unstable and crashes a lot. Is > that your experience with Boa-Constructor? Or was the information I found > misleading? > > Thanks, > Terry I found Boa-co

Re: [Tutor] Venom / Python23.dll missing

2005-09-13 Thread Luis N
On 9/11/05, Damien Gouteux <[EMAIL PROTECTED]> wrote: > Hi all. > I try to run Venom, a Python binding for the Irrlicht engine. But I need > python23.dll. Download a game from pygame.org Luis. ___ Tutor maillist - Tutor@python.org http://mail.python

Re: [Tutor] Boa-Constructor

2005-09-13 Thread Luis N
On 9/12/05, Terry Kemmerer <[EMAIL PROTECTED]> wrote: > Hey Guys, > > I am trying to pick an IDE, and it seems to me that Boa-Constructor has > great potential. Did you check Boa out of CVS? It tends not to have an intermittent schedule of releases. Luis

Re: [Tutor] Python2.3.4, PySqlite2 and Solaris

2005-09-02 Thread Luis N
On 9/1/05, Luis N <[EMAIL PROTECTED]> wrote: > Hi, > > After fighting with installing pysqlite2 Apologizes, I started over. It went much better the second time. bash-2.05

[Tutor] Python2.3.4, PySqlite2 and Solaris

2005-09-01 Thread Luis N
Hi, After fighting with installing pysqlite2, (although you require the .tar.gz for a *Nix build, the header file required, sqlite3.h, was actually in the source .zip supplied for windows users sans a unix build environment) Anyway, I have pysqlite2, but: Python 2.3.4 (#1, Aug 23 2004, 13:59:34)

Re: [Tutor] Website Retrieval Program

2005-08-24 Thread Luis N
On 8/24/05, Daniel Watkins <[EMAIL PROTECTED]> wrote: > I'm currently trying to write a script that will get all the files > necessary for a webpage to display correctly, followed by all the > intra-site pages and such forth, in order to try and retrieve one of the > many sites I have got jumbled u

Re: [Tutor] Counting help

2005-08-23 Thread Luis N
On 8/23/05, Scott Oertel <[EMAIL PROTECTED]> wrote: > I have extracted a list of names, i.e. > > "Joe Smith" > "Joe Smith" > "Jack Smith" > "Sam Love" > "Joe Smith" > > I need to be able to count the occurances of these names and I really > don't have any idea where to begin. > > Any ideas? exc

Re: [Tutor] Remove a number from a string

2005-08-23 Thread Luis N
On 8/23/05, Shitiz Bansal <[EMAIL PROTECTED]> wrote: > Hi, > Suppose i have a string '347 liverpool street'. > I want to remove all the numbers coming at the starting of the string. > I can think of a few ways but whats the cleanest way to do it? > > Shitiz > I believe this question to be

Re: [Tutor] LiveWires problems

2005-08-16 Thread Luis N
On 8/15/05, ZIYAD A. M. AL-BATLY <[EMAIL PROTECTED]> wrote: > On Mon, 2005-08-15 at 11:52 -0400, Michael Murphy wrote: > > Hi all > > > > I'm having problems with installing LiveWire for python for Linux > > (Linspire 5.0 to be exact) and I'm having trouble compiling setup.py. > > Heres the results

Re: [Tutor] Replacement for 'Find' Module

2005-08-15 Thread Luis N
On 8/15/05, Simon Gerber <[EMAIL PROTECTED]> wrote: > You could probably do something like this... (Note: This example is > for Linux - but you can adapt it fairly easily to Windows.) > > > # E.g. Find every .inf file on a CD-ROM. > path = '/cdrom' > # 'E:\\' or whatever for Windows > inf_lis

Re: [Tutor] Python hosting again

2005-08-15 Thread Luis N
On 8/11/05, Jorge Louis De Castro <[EMAIL PROTECTED]> wrote: > Hello, > > I'm interested in writing with my own Python implementation of a Jabber IM > server and client. > Anyone knows where I could host my Python Jabber IM server for a reasonable > monlthy fee? It doesn't need to be a top-not

Re: [Tutor] web gallery

2005-08-15 Thread Luis N
On 8/15/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi All, > > I'd like to write some web gallery software from scratch for my girlfriend. > I've looked at the > PIL (python imaging library) and I'm using it to > generate thumbnails from given images. > Something else i'd like to get done

Re: [Tutor] python and xml

2005-08-13 Thread Luis N
On 8/13/05, David Holland <[EMAIL PROTECTED]> wrote: > What is a good way of using xml and python ? ElementTree? http://effbot.org/zone/element-index.htm or, lxml http://codespeak.net/lxml/ Luis. ___ Tutor maillist - Tutor@python.org http://mail.pyth

Re: [Tutor] Assistance!

2005-08-07 Thread Luis N
with python, you should use the cgi module. You can examine the documentation for this module by pressing F1 while within IDLE, and entering the module list. Here's a simple example: #!/usr/LOCAL/bin/python print "Content-type: text/html\n\n" import cgi def main(form): if f

Re: [Tutor] Is there a qucker method than the following?

2005-08-05 Thread Luis N
On 8/5/05, Nathan Pinno <[EMAIL PROTECTED]> wrote: > > Hi all, > > Is there a quicker method than the following? > > import random > numbers = [0,1,2,3,4,5,6,7,8,9,10,11,12] > cards = > ["Ace","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Jack","Queen","King"] > hand = {

Re: [Tutor] [Metakit] Mk4py

2005-08-04 Thread Luis N
On 8/4/05, Brian Kelley <[EMAIL PROTECTED]> wrote: > Yeah the spaces kill me as well sometimes, and then I think that the > spaces are okay sometimes. > > The real issue is that a metakit column name can include any printable > character except a comma ",". > > So, now you know :) > > Here is an

Re: [Tutor] Zope/Python web devel

2005-08-03 Thread Luis N
On 8/3/05, Jay Loden <[EMAIL PROTECTED]> wrote: > I've been considering some web projects recently, but I have some concerns > about selecting the tools I plan to use. I like Python, and I was immediately > thinking of using Zope to build on. > > However, I am concerned about performance, resource

Re: [Tutor] Web Browser in Python

2005-08-03 Thread Luis N
On 8/3/05, Shitiz Bansal <[EMAIL PROTECTED]> wrote: > Hi, > I need to program a web browser in python.I dont have any idea of how to > start, what i do have is time and willingness to learn.Could anyone direct > me to some suitable reference? > Shitiz > How about Grail http://grail.sourceforge.

Re: [Tutor] single executable

2005-07-31 Thread Luis N
On 7/31/05, Jorge Louis de Castro <[EMAIL PROTECTED]> wrote: Hi,Thanks for your reply. I have been googling this issue and found thisarticle:http://starship.python.net/crew/theller/moin.cgi/SingleFileExecutable that seems to indicate what I want is possible and it is available. Hi, I looked at th

Re: [Tutor] How do I go about this?

2005-07-27 Thread Luis N
On 7/27/05, Luis N <[EMAIL PROTECTED]> wrote: On 7/27/05, Nathan Pinno <[EMAIL PROTECTED] > wrote: Hi all,   How do I go about the following: I want to write a program that will print two lists one after another, then show all the available possibilities for matches e.g a0 an

Re: [Tutor] How do I go about this?

2005-07-27 Thread Luis N
On 7/27/05, Nathan Pinno <[EMAIL PROTECTED]> wrote: Hi all,   How do I go about the following: I want to write a program that will print two lists one after another, then show all the available possibilities for matches e.g a0 and x0.   Here is what I have so far:   lista = [x0, x1, x2, x3

Re: [Tutor] String slicing from tuple list

2005-07-21 Thread Luis N
On 21 Jul 2005 20:39:36 +0100, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi,I have a list of tuples like this:[(1423, 2637),(6457, 8345),(9086, 10100),(12304, 15666)] Each tuple references coordinates of a big long string and they are in the'right' order, i.e. earliest coordinate first within ea

Re: [Tutor] hello

2005-07-21 Thread Luis N
On 7/21/05, dina lenning <[EMAIL PROTECTED]> wrote: YES...heres my problem  I am a university student..will be a teacher in 2 years hopefully..andhave taken a first year computing course that said it required NO PRIORknowledge, but i am having great difficulty. The students (71 of them) are all co

Re: [Tutor] globals and map()

2005-07-19 Thread Luis N
On 7/19/05, Kent Johnson <[EMAIL PROTECTED]> wrote: Luis N wrote:> I'd appreciate some comments on my use of globals and the map function.>> import metakit> import marshal>> db = metakit.storage('addy.mk <http://addy.mk>',1)> dbs = db.getas(&#

[Tutor] globals and map()

2005-07-19 Thread Luis N
I'd appreciate some comments on my use of globals and the map function. The idea here is that (simple) Metakit database definitions can be loaded dynamically from another Metakit database detifintion. (Yes this would likely be easier with a SQL database, don't ask!) Nasty code ahead: import metak

Re: [Tutor] OT, Tcl & Python

2005-07-19 Thread Luis N
27;ve skimmed through it a bit, and will give it a more thorough read shortly. Thanks! Luis N  ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] OT, Tcl & Python

2005-07-16 Thread Luis N
Hi, I was wondering if someone knowledgeable of both Tcl and Python could suggest whether it would be a good or a bad idea to write a Python/Tk application, with the motive to rewrite the application in Tcl/Tk once completed. My reason for considering this route is that I have never written a sing

Re: [Tutor] Iterating over nested lists part2

2005-07-03 Thread Luis N
On 7/2/05, Kent Johnson <[EMAIL PROTECTED]> wrote: Luis N wrote:> def listItems():> l= []> d = {}> for r in range(len(vw)):> for x in range(lt):> ed = desc[x]> exec("d['%s']=vw[%d].%s" % (ed,r,ed)) &g

[Tutor] Iterating over nested lists part2

2005-07-02 Thread Luis N
m vw by 5. How can I have: for each record in the database:     for each column in the record:     do stuff. Without multiplying the result i.e len(vw) * lt Thanks. Luis N. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] slicing nested lists/dicts/tuples

2005-07-02 Thread Luis N
On 7/2/05, Luis N <[EMAIL PROTECTED]> wrote: Umm, sorry, I meant: d[desc[x]] = exec("""'vw[%s].desc[%s]'""" % (r,x )) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] slicing nested lists/dicts/tuples

2005-07-02 Thread Luis N
dded without changing the code. I thought that if: def listItems():     l= []     d = {}     lt = len(desc)     for r in range(len(vw)):     for x in range(len(lt)):     d[desc[x]] = exec("""'vw'+[r]+'.'+desc[x]""")     l.append(d)

[Tutor] slicing nested lists/dicts/tuples

2005-06-28 Thread Luis N
Hi, >>> l [{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}] This is how I imagine it: for i in l:     for j in l[i]:         for k in l[i][j]:             print k.get('first')     print k.get('last') Is

Re: [Tutor] how to setup gnu.py

2005-04-01 Thread Luis N
I grabbed this from the docs: Gnuplot.py uses Python distutils and can be installed by untarring the package, changing into the top-level directory, and typing "python setup.py install". The Gnuplot.py package is pure Python--no compilation is necessary. On Mar 30, 2005 11:13 PM, jrlen balane <[

[Tutor] xmlrpc server

2005-03-23 Thread Luis N
Hi, I've been exploring xmlrpc implementations, and am somewhat confused as to what I should use. I've spent the most time poking at Twisted, which took me a while to figure out the basics of, and have spent a moment or two exploring py-xmlrpc as well as SimpleXMLRPCServer in the standard library.

[Tutor] Why is this not an error?

2005-03-20 Thread Steve N
This code runs, but it seems to me it should generate a syntax error. Can someone explain what's going on? x = [1,2,3,4] z = 4 if z in x: print 'found:', z for i in x: print 'in the loop with', i else: print 'not found:', z >>> found: 4 in the loop with 1 in the loop with 2 in the l

[Tutor] slow html generation code

2005-03-02 Thread Luis N
This code seems a little slow, is there anything in particular that jumps out as being not quite right. The idea is that a file is opened that contains path names to other files, that are appended and outputed into a directory of choice. I plan to move this off the filesystem into a database when

  1   2   >