Re: [Tutor] generating independent random numbers

2010-09-29 Thread Ewald Ertl
Hi, On Wed, Sep 29, 2010 at 11:42 AM, Peter Otten __pete...@web.de wrote: Carter Danforth wrote: Thanks for the replies, Dave and Joel. The reason I'm not just using the time or datetime modules for a random date is because it's restricted to 1970-2038; I'm pulling dates from 1600-3099.

Re: [Tutor] Finding even and odd numbers

2007-09-19 Thread Ewald Ertl
Hi Boyks, Boykie Mackay wrote: Hi guys, I have come across a bit of code to find if a group of numbers is odd or even.The code snippet is shown below: if not n1: return false The above should return false for all even numbers,numbers being represented by n.I have tried to wrap my

Re: [Tutor] Using my own installed python version in my directory tree.

2006-09-14 Thread Ewald Ertl
Hi Ziad Rahhal wrote: Hi, I installed pythin on Linux operating system but on my own tree directory. Now I want to get rid (not deleting) the default python installation, which means I want my own python version to be recognized when I use python command. PYTHONPATH has nothing to do

Re: [Tutor] smtp error from cgi script

2006-08-03 Thread Ewald Ertl
Hi Rob, Rob wrote: Hi, can someone help me interpret the error output below? I can't tell whether this is a coding error, or a configuration error, in which case, it would be up to my host provider. For privacy reasons, I have changed the actual email addresses to [EMAIL PROTECTED]

Re: [Tutor] error: (10054, 'Connection reset by peer')

2006-07-10 Thread Ewald Ertl
Hello! Grady Henry wrote: Here is a program that I wrote using the first example at 12.2.13 Examples at the www.python.org http://www.python.org website, # Import smtplib for the actual sending function import smtplib # Import the email modules we'll need from email.MIMEText import

Re: [Tutor] More network server questions

2006-06-20 Thread Ewald Ertl
http://mail.python.org/mailman/listinfo/tutor -- Ing. Ewald Ertl HartterGruppe Phone : +43-3352-33085-558 trinomic Projektmanagement Informationstechnik GmbH Fax : +43-3352-33085-600 Wiener Straße 41mailto:[EMAIL PROTECTED

Re: [Tutor] User input

2006-05-22 Thread Ewald Ertl
MATATA EMMANUEL wrote: Hi there, Can anyone tell me how I'm having trouble executing this piece of code: mpg = raw_input ( Enter your mileage:) distance = raw_input (Enter your distance:) galon_price = raw_input (Enter you cost per gallon:) make = Honda model = Accord ## print make,

Re: [Tutor] Argument check

2006-05-04 Thread Ewald Ertl
to accomplish it. Do you have some hints? Where could I find code-examples which solve similar problems? Would you recommend a different approach? Regards, Gregor -- Ing. Ewald Ertl HartterGruppe Phone : +43-3352-33085-558 trinomic Projektmanagement

Re: [Tutor] oserror [errno 20]

2006-04-03 Thread Ewald Ertl
Hi, k r fry wrote: Hi, I am new to this list, and also to Python. I am trying to get Python to loop through the directory DATADIR which contains the data I want to read. I get an error: oserror [errno 20] : Not a directory: Katiescint.py The section of code is shown below: for

Re: [Tutor] OSError

2006-03-15 Thread Ewald Ertl
Hi Chris, I think I've found the problem. os.listdir() gives you all entries of the directory, but your not changing to that directory. The os.path.getsize() just does not find the file in the directory testFiles under your current directory. See my short example below. import os

Re: [Tutor] odbchelper

2006-03-03 Thread Ewald Ertl
Hi! How have you started the script? As far as I could see, in the Chapter 1 of Dive into Python, the odbchelper.py is just a script-File and not a module to be imported, therefore the Exception with the ImportError. I do not have a Windows box here to check if the problem is with the PythonIDE.

Re: [Tutor] odbchelper

2006-03-03 Thread Ewald Ertl
Hi Kent! You are absolutely right. Sorry for my bad description. Kent Johnson wrote: Ewald Ertl wrote: Hi! How have you started the script? As far as I could see, in the Chapter 1 of Dive into Python, the odbchelper.py is just a script-File and not a module to be imported, therefore

Re: [Tutor] File handling: open a file at specified byte?

2006-02-19 Thread Ewald Ertl
/mailman/listinfo/tutor -- Ing. Ewald Ertl HartterGruppe Phone : +43-3352-33085-558 trinomic Projektmanagement Informationstechnik GmbH Fax : +43-3352-33085-600 Wiener Straße 41mailto:[EMAIL PROTECTED] A-7400 Oberwart

Re: [Tutor] self

2006-02-13 Thread Ewald Ertl
Hi Shuying! Shuying Wang wrote: Hi, I'm having problems understanding some code I came across: class Singleton: __single = None def __init__( self ): if Singleton.__single: raise Singleton.__single Singleton.__single = self What does passing

Re: [Tutor] unknown error in simple program

2006-02-13 Thread Ewald Ertl
Hi Eli! You have a lot of calls to input() in your code. When requesting help on input you get the following output: help(input) Help on built-in function input: input(...) input([prompt]) - value Equivalent to eval(raw_input(prompt)). As you can see, the data you input is put as

Re: [Tutor] smtplib with yahoo smtp server

2006-02-01 Thread Ewald Ertl
Hi! I made a copy of the source you posted. I just got a problem as expected when doing the session.login() because the access-data is invalid. The connection via the smtplib.SMTP() could be established. Perhaps there is something wrong with your namelookup. Can you try a call in the

Re: [Tutor] smtplib with yahoo smtp server

2006-02-01 Thread Ewald Ertl
Hi! Intercodes wrote: Ewald, First off, thanks for stopping by. The connection via the smtplib.SMTP() could be established. I dont think so. I think it fails before the login(). -- ex= smtplib.SMTP('smtp.mail.yahoo.com

Re: [Tutor] smtplib with yahoo smtp server

2006-02-01 Thread Ewald Ertl
Hi! Intercodes wrote: My nssswitch.conf -- passwd: compat group: compat hosts: files dns networks: files dns services: files protocols: files rpc:files ethers: files netmasks: files netgroup:

Re: [Tutor] a class knowing its self

2006-01-19 Thread Ewald Ertl
Hi! Ben Vinger wrote: Hello I've been reading about how a class has access to its own 'self', so I tried the following, but it is not working as I would expect: class Skill: def __init__(self): self.history = [] def setName(self, skill): self.name = skill

Re: [Tutor] Can I get some feedback on my currency converter program

2005-12-09 Thread Ewald Ertl
Hi! vikas mohan wrote: Hi all, this is my first program in python. It's a currency converter mini-program, but I am not getting the desired output. What wrong am I doing here? *Program code:* #converts currencies to Indian rupees def print_options(): print Options:

Re: [Tutor] Introspection (modules and functions)

2005-11-23 Thread Ewald Ertl
Hi! I quick solution for a name module could be: import os for d in os.__dict__: ... a=os. + d ... if callable( eval(a) ): ... print Callable %s % ( eval(a)) but there should also be a recipe on activestate for that problem. I think I've red something in the Python

Re: [Tutor] Linux app question

2005-08-18 Thread Ewald Ertl
Hi Alberto Alberto Troiano wrote: Hey tutorslong time don't see...*grin* I have a question, I've made a web page in PHP and its going to run under Linux Red Hat 9.0 The page has scripts that has to be on a certain path off the system...I have to make a CD to give the web page to my

Re: [Tutor] Question About chdir()

2005-08-08 Thread Ewald Ertl
Hi Don! Don Parris wrote: The book, Programming Python, shows an example of os.chdir() on the Windows platform, as follows: os.chdir(r'c:\temp') r ... raw Strings. There will no substitution be processed. Otherwise the \t ( Tab ) will be inserted in the string: print a\tb a b

Re: [Tutor] try except continue

2005-07-29 Thread Ewald Ertl
Hi! I think you just want to execute the rest of the function's in someProcedure(). Perhaps this could be the solution, what you want: def someProcedure(): ... for func in [ someFunc00, someFunc01, someFunc02, someFunc03 ]: ... try: ... func() ...

Re: [Tutor] Why is this error showing up? (Original Message: (Tutor) What's wrong with this code?) Ignore previous post.

2005-07-07 Thread Ewald Ertl
Hi! on Thu, 7 Jul 2005 01:13:48 -0600 Nathan Pinno [EMAIL PROTECTED] wrote : - Nathan PinnoThanks Wolfram for help with that error. Nathan Pinno Nathan PinnoHere's another that popped up:

Re: [Tutor] Why is this error showing up? (Original Message: (Tutor) What's wrong with this code?) Ignore previous post.

2005-07-07 Thread Ewald Ertl
Hello! I just looked a little over the code, what it is perhaps ment to do now. As allready mentioned by Ziyad in your former post: just call main_menu() don't print main_menu() This calls the funciton main_men(), which prints it menu and after this the print-Command in this line

Re: [Tutor] maximum recursion depth exceeded !

2005-07-07 Thread Ewald Ertl
Mohammad Moghimi --- end -- -- Ing. Ewald Ertl HartterGruppe Phone : +43-3352-33085-558 trinomic Projektmanagement Informationstechnik GmbH Fax : +43-3352-33085-600 Wiener Straße 41mailto

Re: [Tutor] Confused about error message

2005-07-04 Thread Ewald Ertl
Hi! you're missing the except-clause in the exception-handling: on Sun, 3 Jul 2005 21:37:57 -0400 gelsey torres [EMAIL PROTECTED] wrote : - gelsey torres I'm new to Python and computer programming in

Re: [Tutor] Lists in List question

2005-06-24 Thread Ewald Ertl
Hello Phil! the HTML-Formating look's better than the text-Version. on Thu, 23 Jun 2005 17:15:59 -0500 Phillip Hart [EMAIL PROTECTED] wrote : - Phillip Hart Hello, Phillip Hart I've been using lists

Re: [Tutor] List of regular expressions

2005-06-22 Thread Ewald Ertl
Hi Shidan! on Wed, 22 Jun 2005 00:28:44 -0400 Shidan [EMAIL PROTECTED] wrote : - Shidan Hi I have a list of regular expression patterns like such: Shidan Shidan thelist =

Re: [Tutor] Calling a function

2005-06-09 Thread Ewald Ertl
Hi! I don't know if I'm right here, because I've tested a simple model of what you're trying to do: on Wed, 8 Jun 2005 23:45:59 -0700 Kevin Reeder [EMAIL PROTECTED] wrote : - Kevin Reeder import

Re: [Tutor] all methods in a module

2005-05-27 Thread Ewald Ertl
Hi! I've the following solution: for d in [ random. + d for d in dir(random)]: ... if callable( eval(d) ): ... print %30s :\n\n %s % ( d, eval( %s.__doc__ % ( d))) ... random.Random : Random number generator base class used by bound module functions. HTH

Re: [Tutor] input()

2005-04-29 Thread Ewald Ertl
Hi! I don't have a Mac and so I don't know Macpython. on Fri, 29 Apr 2005 07:55:20 -0500 Servando Garcia [EMAIL PROTECTED] wrote : - Servando Garcia Hello and thanks in advance. Servando Garcia

Re: [Tutor] for loop

2005-04-19 Thread Ewald Ertl
Hi, I've slightly modified the for-Loop containing the else and not the if: x = [[1,2,3],[2,4,6],[8,4,5,6],[9,8,7]] for num in x: ... if 5 in num: ... break ... else: ... print YES ... second test: x = [[1,2,3],[2,4,6],[8,4,6],[9,8,7]] for num in x: ... if 5

Re: [Tutor] (no subject)

2005-04-14 Thread Ewald Ertl
Hi Jim, on Thu, 14 Apr 2005 01:09:14 -0500 Jim and Laura Ahl [EMAIL PROTECTED] wrote : - Jim and Laura Ahl How come when I ask it to print i[2:4] from an inputted string it gives me the letters

Re: [Tutor] function loading a file's lines to a list

2005-04-01 Thread Ewald Ertl
Hi! on Fri, 01 Apr 2005 12:01:02 +0200 Adriano Varoli Piazza [EMAIL PROTECTED] wrote : - Adriano Varoli Piazza Adriano Varoli Piazza def loadfromfile(fname): Adriano Varoli Piazza try: Adriano

Re: [Tutor] big numbers

2005-03-15 Thread Ewald Ertl
- Tutor@python.org Robert Storey http://mail.python.org/mailman/listinfo/tutor Robert Storey --- end -- -- Ing. Ewald Ertl HartterGruppe Phone : +43-3352-33085-558 trinomic Projektmanagement Informationstechnik GmbH Fax

Re: [Tutor] FTP retrieve

2005-03-15 Thread Ewald Ertl
--- end -- -- Ing. Ewald Ertl HartterGruppe Phone : +43-3352-33085-558 trinomic Projektmanagement Informationstechnik GmbH Fax : +43-3352-33085-600 Wiener Straße 41mailto:[EMAIL PROTECTED] A-7400 Oberwart

Re: [Tutor] getting a webpage via python

2005-03-08 Thread Ewald Ertl
Hi Paul! As mentioned earlier by Kent in this group under the subject: Subject: Re: [Tutor] Downloading from http Mark Kels wrote: On Sat, 12 Feb 2005 09:25:10 -0500, Jacob S. [EMAIL PROTECTED] wrote: urllib or urllib2 or maybe httplib maybe? urlopen( url[, data]) I'm sorry,

Re: [Tutor] Saving Entry fields in Tkinter

2005-03-01 Thread Ewald Ertl
Adam Cripps TIA Adam Cripps Adam --- end -- -- Ing. Ewald Ertl HartterGruppe Phone : +43-3352-33085-558 trinomic Projektmanagement Informationstechnik GmbH Fax : +43-3352-33085-600 Wiener Straße 41

Re: [Tutor] Saving Entry fields in Tkinter

2005-03-01 Thread Ewald Ertl
Hi on Tue, 1 Mar 2005 15:31:10 + Adam Cripps [EMAIL PROTECTED] wrote : - Adam Cripps Adam Cripps Thanks Ewald - this is what I have so far, with a far from perfect result: Adam Cripps

Re: [Tutor] Hex to Str

2005-02-04 Thread Ewald Ertl
Hello Heiko, I do not really know what you like to get, but the hex-number's in Python are usedd in a numeric representation. As far as I have seen in the interpreter, this depends on the value: a=0xabccddd type(a) type 'long' a=0xaabb type(a) type 'int' If you like to

Re: [Tutor] how to separate hexadecimal

2005-02-02 Thread Ewald Ertl
Hi! Using binary operations: a='0x87BE' str(hex(int(a,16) 0xFF)) '0xbe' str(hex((int(a,16) 0xFF00) / 0xFF)) '0x87' HTH Ewald on Wed, 2 Feb 2005 15:10:36 +0800 jrlen balane [EMAIL PROTECTED] wrote :

Re: [Tutor] Selecting text

2005-01-19 Thread Ewald Ertl
with '' is found i +=1 # if search should continue if another element is present HTH Ewald -- Ing. Ewald Ertl HartterGruppe Phone : +43-3352-33085-558 trinomic Projektmanagement Informationstechnik GmbH Fax : +43-3352-33085-600 Wiener Straße 41

Re: [Tutor] O.T.

2004-12-30 Thread Ewald Ertl
Hi! I#m 33, married, 2 Children ( 9 months old girl 3 year old boy ). We are living in the south of Burgenland in Austria. My mother tounge is german. I attended a secondary technical school studed electronics. After school I started working for a big company creating a power system control