Re: neoPython : Fastest Python Implementation: Coming Soon

2021-05-05 Thread Ian Clark
I wish you best of luck, on top of everything else it looks like the neopython namespace has already been eaten up by some crypto project On Wed, May 5, 2021 at 11:18 AM Benjamin Schollnick < bscholln...@schollnick.net> wrote: > > Why? The currently extant Python implementations contribute to cli

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Ian Clark
This is my whack at it, I can't wait to hear about it being the wrong big o notation! numbers=[] while len(numbers) < 10: try: chip = int(input('please enter an integer: ')) except ValueError: print('that is not a number, try again') else: numbers.append(chip)

Re: How to replace space in a string with \n

2019-01-31 Thread Ian Clark
text = "The best day of my life!" output = '' for i in text: if i == ' ': output +='\n' else: output += i print(output) throwing my hat in the ring, not only is it .replace free it is entirely method free On Thu, Jan 31, 2019 at 3:41 AM ^Bart wrote: > [Solved by myself and I'm happy!!!

Re: what considerations for changing height of replacement radiator?

2019-01-30 Thread Ian Clark
looking for a Space heater? sorry, not the Java mailing list On Wed, Jan 30, 2019 at 3:11 PM jkn wrote: > Hi all > I'm looking at changing a radiator in a bedroom shortly and wondering > about > my options re. sizing. > > The current radiator is 900mm W x 600mm H, and is single panel, no > c

Re: Python stopped installing packages

2019-01-29 Thread Ian Clark
according to https://pypi.org/project/discord.py/ Discord.py only supports 3.4 and 3.5 On Tue, Jan 29, 2019 at 4:52 PM Hamish Allen <101929...@gmail.com> wrote: > Hi, > > Recently I’ve been trying to code a Discord bot in Python 3.6.2, then I > realised that some features of discord.py were only

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Ian Clark
which version of Python? I get Syntax error on 3.7.1 On Tue, Jan 29, 2019 at 12:37 PM Adrian Ordona wrote: > The code actually works just the way i copy and pasted > > Sent from my iPhone > > On Jan 29, 2019, at 12:34, Ian Clark wrote: > > just the pure number of letter

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Ian Clark
just the pure number of letters next to parenthesis would cause the Parser to error out On Tue, Jan 29, 2019 at 12:32 PM Schachner, Joseph < joseph.schach...@teledyne.com> wrote: > Yes, that works. Assuming it was correctly formatted when you ran it. > The formatting could not possibly be run in

Re: Problem in Installing version 3.7.2(64 bit)

2019-01-29 Thread Ian Clark
back in my day we had to show our professors errors on punchcard! and we liked it On Sun, Jan 27, 2019 at 11:51 AM Terry Reedy wrote: > On 1/26/2019 6:24 AM, Vrinda Bansal wrote: > > Dear Sir/Madam, > > > > After Installation of the version 3.7.2(64 bit) in Windows 8 when I run > the > > program

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Ian Clark
threw this together, let me know what you think num_list=[] name_list = ['first','second','third','fourth','fifth','sixth','seventh','eighth','ninth','tenth'] name_it = name_list.pop(0) while len(num_list) < 3: try: num_list.append( int( input(f"Insert the {name_it} number: "))) except Valu

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Ian Clark
Like this? num_max = 0 num_index = 0 name_list = ['first','second','third','fourth','fifth','sixth','seventh','eighth','ninth','tenth'] name_it = name_list.pop(0) while num_index <3: try: num_list = int( input(f"Insert the {name_it} number: ")) except ValueError: print('Not a number, try

Re: Raising exception on STDIN read

2008-02-29 Thread Ian Clark
On 2008-02-28, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > I hope it's more clear now. Python objects are only meaningful *inside* a > Python program, but an *external* program can't use them directly. Yes, sorry. This is what I was getting hung up on. My thinking was that subprocess was orch

Re: Raising exception on STDIN read

2008-02-28 Thread Ian Clark
On 2008-02-28, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Thu, 28 Feb 2008 14:29:04 -0200, Ian Clark <[EMAIL PROTECTED]> > escribió: > >> On 2008-02-27, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >>> En Wed, 27 Feb 2008 15:06:36 -0200, Ian

Re: Raising exception on STDIN read

2008-02-28 Thread Ian Clark
On 2008-02-27, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Wed, 27 Feb 2008 15:06:36 -0200, Ian Clark <[EMAIL PROTECTED]> > escribi�: > >> On 2008-02-27, Michael Goerz <[EMAIL PROTECTED]> wrote: >>> Hi, >>> >>> I would li

Re: Raising exception on STDIN read

2008-02-27 Thread Ian Clark
On 2008-02-27, Michael Goerz <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to raise an exception any time a subprocess tries to read > from STDIN: > > latexprocess = subprocess.Popen( \ > 'pdflatex' + " " \ > + 'test' + " 2>&1", \ > shell=True, \ > cwd=os.g

Re: os.fork() not working on windows (help)

2008-02-25 Thread Ian Clark
On 2008-02-25, A. Joseph <[EMAIL PROTECTED]> wrote: > Please i`m trying to create a process using the os.fork() but it keep If you're not trying to clone your current process, just make a new one, you should look at the subprocess module. http://docs.python.org/lib/module-subprocess.html Ian --

Re: Is crawling the stack "bad"? Why?

2008-02-25 Thread Ian Clark
On 2008-02-25, Russell Warren <[EMAIL PROTECTED]> wrote: > >> the threading.local class seems defined for that purpose, not that I've ever >> used it ;) > > I hadn't heard of that... it seems very useful, but in this case I > think it just saves me the trouble of making a stash dictionary... > unle

Re: Curses and Threading

2008-01-22 Thread Ian Clark
On 2008-01-22, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> In fact you have *two* threads: the main thread, and the one you create >> explicitly. > >> After you start the clock thread, the main thread continues executing, >> immediately entering the finally clause. >> If you want to wait for th

Re: error/warning color customization in interactive console?

2008-01-16 Thread Ian Clark
On 2008-01-16, yhvh <[EMAIL PROTECTED]> wrote: > Is it possible to output error messages in a different color? > I'm using Terminal on Gnome. >>> print "\033[1;31mHello\033[0m There!" Some reading: http://en.wikipedia.org/wiki/ANSI_escape_code http://www.ioncannon.net/ruby/101/fun-with-ansi-escap

Re: mysqldb SELECT COUNT reurns 1

2007-12-27 Thread Ian Clark
On 2007-12-27, SMALLp <[EMAIL PROTECTED]> wrote: > connectionString = {"host":"localhost", "user":"root", > "passwd":"pofuck", "db":"fileshare"} > dataTable = "files" > conn = mysql.connect(host=connectionString["host"], > user=connectionString["user"], passwd=connectionString["passwd"], > db=conn

Re: Debugging pipe IPC

2007-12-18 Thread Ian Clark
Jim B. Wilson wrote: > ... My fondest wish is to play the role of the child at the > good old ">>>" prompt. ... > > Jim Okay, I misunderstood the direction you wanted to go. I thought that you wanted to play the part of the mother, giving commands to the child and not the other way around. As

Re: Debugging pipe IPC

2007-12-18 Thread Ian Clark
Jim B. Wilson wrote: > Ian Clark wrote: >> Jim B. Wilson wrote: >> ... >>> The child/client sends requests on its stdout and receives responses >>> on stdin. >> So, why can't you just run this client on the command line and let the >> shel

Re: Debugging pipe IPC

2007-12-17 Thread Ian Clark
Jim B. Wilson wrote: ... > The child/client sends requests on its stdout and receives responses on > stdin. So, why can't you just run this client on the command line and let the shell handle stdin/stdout for you? Ian Clark -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging pipe IPC

2007-12-17 Thread Ian Clark
recipe? > > Jim Wilson > Gainesville, FL You're looking for the cmd module. <http://docs.python.org/lib/module-cmd.html> Ian Clark -- http://mail.python.org/mailman/listinfo/python-list

Re: cx_Oracle + array parameter

2007-12-03 Thread Ian Clark
[EMAIL PROTECTED] wrote: > Hello, > > I'm trying to pass array as an argument into PL/SQL procedure. > According to cursor manual (http://cx-oracle.sourceforge.net/html/ > cursorobj.html) arrayvar() should be use to do it. I've created my > array type in PL/SQL: > > CREATE OR REPLACE TYPE cx_arra

Re: Iterable Flattener with Depth.

2007-11-02 Thread Ian Clark
thebjorn wrote: > On Nov 2, 6:32 am, praddy <[EMAIL PROTECTED]> wrote: >> On Nov 1, 5:03 pm, [EMAIL PROTECTED] wrote: >> >>> Pradeep Jindal: Any comments? >>> Something with similar functionality (plus another 20 utility >>> functions/classes or so) has probably to go into the std lib... :-) >

Re: Combine two dictionary...

2007-10-01 Thread Ian Clark
Abandoned wrote: > On 1 Ekim, 20:41, Carsten Haese <[EMAIL PROTECTED]> wrote: >> On Mon, 2007-10-01 at 10:24 -0700, Abandoned wrote: >>> Hi.. >>> dict1={1: 4, 3: 5}... and 2 millions element >>> dict2={3: 3, 8: 6}... and 3 millions element >>> I want to combine dict1 and dict2 and i don't want to

Re: newb: Simple regex problem headache

2007-09-21 Thread Ian Clark
crybaby wrote: > import re > > s1 =' 25000 ' > s2 = ' 5.5910 ' > > mypat = re.compile('[0-9]*(\.[0-9]*|$)') > rate= mypat.search(s1) > print rate.group() > > rate=mypat.search(s2) > print rate.group() > rate = mypat.search(s1) > price = float(rate.group()) > print price > > I get an error when

Re: acronym program

2007-09-21 Thread Ian Clark
Shawn Minisall wrote: > I'm trying to write a program that gets the first letter of every word > of a phrase and prints it on screen. I'm having problems with it. I'm > thinking a for loop would be good since I don't know the exact number of > words the user is going to enter, but after that I

Re: HTTP Protocol Client

2007-09-20 Thread Ian Clark
[EMAIL PROTECTED] wrote: > h = httplib.HTTP('http://Google.com',80) This should be: h = httplib.HTTP('Google.com',80) And I certainly agree with the others, check out urllib*. Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: I could use some help making this Python code run faster using only Python code.

2007-09-20 Thread Ian Clark
[EMAIL PROTECTED] wrote: > On Sep 20, 5:46 pm, Paul Hankin <[EMAIL PROTECTED]> wrote: >> On Sep 20, 10:59 pm, Python Maniac <[EMAIL PROTECTED]> wrote: >> >>> I am new to Python however I would like some feedback from those who >>> know more about Python than I do at this time. >>> def scrambleLine(

Re: curses: x, y positioning

2007-09-17 Thread Ian Clark
7stud wrote: > However, now I am having a problem trying to set the color of the text > that is output: import curses def example(screen): if curses.has_colors(): curses.init_pair(1, curses.COLOR_GREEN, curses.COLOR_BLACK) curses.init_pair(2, curses.COLOR_YELLOW, curses.COL

Re: Spaces from string specifier

2007-09-14 Thread Ian Clark
Gabriel Genellina wrote: > En Fri, 14 Sep 2007 01:57:43 -0300, Gavin Tomlins <[EMAIL PROTECTED]> > escribi�: > >> I'm trying to work out when using a format specifier I get spaces in the >> resulting string. Eg. Looking at the outputted string you can see that >> there are spaces after T5LAT,

Re: subclass of integers

2007-09-14 Thread Ian Clark
Ian Clark wrote: > Mark Morss wrote: >> I would like to construct a class that includes both the integers and >> None. I desire that if x and y are elements of this class, and both >> are integers, then arithmetic operations between them, such as x+y, >> return the same

Re: subclass of integers

2007-09-14 Thread Ian Clark
Mark Morss wrote: > I would like to construct a class that includes both the integers and > None. I desire that if x and y are elements of this class, and both > are integers, then arithmetic operations between them, such as x+y, > return the same result as integer addition. However if either x o

Re: sys.argv index out of range error

2007-09-13 Thread Ian Clark
Brian McCann wrote: > init.sh > > #!/bin/sh > WORKSPACE_ROOT="$1"; > > export > JAVA_OPTIONS="-Djava.library.path=$WORKSPACE_ROOT/:$WORKSPACE_ROOT/:$WORKSPACE_ROOT/" > echo "JAVA_OPTIONS="$JAVA_OPTIONS; > > set > PATH="$WORKSPACE_ROOT/vendor/basistech/rlp5.4/rlp/bin/ia32-glibc23-gcc32:$WORKSP

Re: recursion

2007-09-13 Thread Ian Clark
Neil Cerutti wrote: > On 2007-09-13, Gigs_ <[EMAIL PROTECTED]> wrote: >> Can someone explain me this >> > def f(l): >> if l == []: >> return [] >> else: >> return f(l[1:]) + l[:1] # <= cant figure this, how is all sum >> at the end? > > In plain English, t

Re: Beginners Query - Simple counter problem

2007-09-06 Thread Ian Clark
Carsten Haese wrote: > On Thu, 2007-09-06 at 11:24 -0700, Ian Clark wrote: >> Carsten Haese wrote: >>> def d6(count): >>> return sum(random.randint(1, 6) for die in range(count)) >>> >> My stab at it: >> >> >>> def roll

Re: Getting original working directory

2007-09-06 Thread Ian Clark
rave247 rave247 wrote: > "..the *original* directory location *after* os.chdir() is > performed.." os.getcwd() is not helping much as it returns the location > that was set up in os.chdir() call > > Thanks Your question is akin to having a name X that is bound to some value, setting it

Re: Beginners Query - Simple counter problem

2007-09-06 Thread Ian Clark
Carsten Haese wrote: > On Thu, 2007-09-06 at 11:00 -0700, Scott David Daniels wrote: >> def d6(count): >> result = 0 >> for die in range(count): >> result += random.randint(1, 6) >> return result > > This, of course, can be further improved into: > > def d6(count): > r

Re: Symbolic Link

2007-08-21 Thread Ian Clark
Hyuga wrote: > On Aug 19, 4:29 pm, mosscliffe <[EMAIL PROTECTED]> wrote: >> The source file is in an area which python can see, but not the >> browser. I am trying to make a link in a browser friendly area so I >> can use it to display an image file. > > You might want to try using an .htaccess f

Re: Question on SPE and pwintypes.dll

2007-08-17 Thread Ian Clark
Gerry wrote: >... but the OS wasn't migrated ... There's your problem right there. It's hard to run most software these days without an OS. Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: All names in the current module

2007-08-15 Thread Ian Clark
Ian Clark wrote: > Torsten Bronger wrote: >> Hallöchen! >> >> How can I get a list with all classes defined in the current module? >> Thank you! >> >> Tschö, >> Torsten. >> > > Assuming you want to see all classes in the re module: >

Re: All names in the current module

2007-08-15 Thread Ian Clark
Torsten Bronger wrote: > Hallöchen! > > How can I get a list with all classes defined in the current module? > Thank you! > > Tschö, > Torsten. > Assuming you want to see all classes in the re module: >>> import re >>> help(re) #best way >>> >>> def isclass(cls): ... try: ...

Re: JPype - passing to Java main

2007-08-13 Thread Ian Clark
[EMAIL PROTECTED] wrote: > I am trying to get JPype to pass a String into a Java class main > function. Demonstration code below: > > =JAVA > package com; > > public class JPypeTest { > >public static void main(String args[]) { > System.out.println(args[0]);

Re: Getting started with JPype

2007-08-13 Thread Ian Clark
Disclaimer: I have never used (or even heard of) JPype before... porter wrote: (snip) > > "Package myclass.HelloWorld is not Callable" > (snip) > > from jpype import * > > startJVM(getDefaultJVMPath(), "-ea", "-Djava.class.path=D:/tmp/jpype- > reli/test/dist/test.jar'' ) > > package = JPackag

Re: programmatically define a new variable on the fly

2007-08-09 Thread Ian Clark
Lee Sander wrote: > Hi, > > I would like to define a new variable which is not predefined by me. > For example, > I want to create an array called "X%s" where "%s" is to be determined > based on the data I am processing. So, for example, if I the file > I'm reading has > g 99 > on the first line,

Re: (no) fast boolean evaluation ?

2007-08-02 Thread Ian Clark
Stef Mientki wrote: > hello, > > I discovered that boolean evaluation in Python is done "fast" > (as soon as the condition is ok, the rest of the expression is ignored). > > Is this standard behavior or is there a compiler switch to turn it on/off ? > > thanks, > Stef Mientki It's called short

Re: Bug in execfile?

2007-08-02 Thread Ian Clark
Fernando Perez wrote: > Hi all, > > (snip) > > I'm really, really puzzled by this. From reading the execfile() docs, I had > the hunch to change the call to: > > execfile(fname,{}) > > and now the problem disappears, so I can keep on working. > > But I'm still very bothered by the fact th

Re: Berkely Db. How to iterate over large number of keys "quickly"

2007-08-02 Thread Ian Clark
lazy wrote: > I have a berkely db and Im using the bsddb module to access it. The Db > is quite huge (anywhere from 2-30GB). I want to iterate over the keys > serially. > I tried using something basic like > > for key in db.keys() > > but this takes lot of time. I guess Python is trying to get th

Re: problems playing with dates from any month.

2007-08-02 Thread Ian Clark
krishnakant Mane wrote: > On 02/08/07, Ian Clark <[EMAIL PROTECTED]> wrote: > >> http://docs.python.org/lib/node85.html >> > I looked there even before. > but could not figure out what the code did. > I know in that variable called s there was a string i

Re: problems playing with dates from any month.

2007-08-02 Thread Ian Clark
krishnakant Mane wrote: > hello, > I have a very strange problem and I can't find any solution for that. > I am working on an accounting package which I wish to develop in python. > the simple problem is that I want to knoe how I can know if the given > date is the nth day of a month. > for example

Re: Awkward format string

2007-08-01 Thread Ian Clark
Gerard Flanagan wrote: > (snip) > > def tostring(data): > return tuple(strftime(x) for x in data[:2]) + data[2:] > Hrmm, not sure that having a function named tostring() that returns a tuple is the best idea. ;) Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: Awkward format string

2007-08-01 Thread Ian Clark
beginner wrote: > Hi, > > In order to print out the contents of a list, sometimes I have to use > very awkward constructions. For example, I have to convert the > datetime.datetime type to string first, construct a new list, and then > send it to print. The following is an example. > > x=(e

Re: Inverse of id()?

2007-05-20 Thread Ian Clark
On 5/20/07, Michael Hoffman <[EMAIL PROTECTED]> wrote: > [snip] > That's not what I get: > > Python 2.5 (r25:51908, Mar 13 2007, 08:13:14) > [GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin > Type "help", "copyright", "credits" or "license" for more information. > >>> class A: p

Re: need help with python

2007-05-11 Thread Ian Clark
On 11 May 2007 18:47:27 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > ya so im pretty much a newb to this whole python thing... its pretty > cool but i just started today and im already having trouble. i > started to use a tutorial that i found somewhere and i followed the > instructions a

Re: FW: Re: e-mailing multiple values

2007-05-08 Thread Ian Clark
On 5/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Thanks. > That does help. When teh script sends a mail of the list item(all_data), the > data shows up like this: > > [(' Ham\n', ' eggs \n'), > (' chicken \n', ' thighs

Re: e-mailing multiple values

2007-05-08 Thread Ian Clark
On 5/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I have a script which has a method which returns multiple strings at once > using the yield. I would like to send an e-mail of these values in a single > e-mail instead of a mail for each string. How would I be able to do that? > > Thank

Re: Slicing Arrays in this way

2007-05-02 Thread Ian Clark
Yeah, having an elegant_solution() function would solve soo many of my problems. ;) Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: curses mystical error output

2007-05-02 Thread Ian Clark
On 5/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have a fairly simple curses app which is giving me this error: > > addstr() returned ERR > > I'm trapping it and continuing. I can see that *some* of my addstring calls > succeed. This one happens to be > > screen.addstr(row, 39,

Re: Read and Write the same file

2007-05-01 Thread Ian Clark
On 1 May 2007 16:03:28 -0700, JonathanB <[EMAIL PROTECTED]> wrote: > Ok, so this is the scenario. I need to create a simple, no-frills XML > editor for non-technical users. It doesn't have to do anything fancy, > what I want is a series of text boxes with the text contents of the > elements pre-pri

Re: Removing the continous newline characters from the pythong string

2007-05-01 Thread Ian Clark
On 1 May 2007 14:30:12 -0700, mobil <[EMAIL PROTECTED]> wrote: > Hi guys i m trying out newline characters and to clean them up > a\n\n\n\n\n\n\n\n\nsss\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvsa\n\n\n\nasf > \n\nafs > > hello guys > > im trying to replace > \n\n\n\n\n\n\n\n\n with \n > > thanks for help

Re: strip newline from string

2007-04-28 Thread Ian Clark
On 4/28/07, James <[EMAIL PROTECTED]> wrote: [snip] > username = getuser() > string.strip > (username) > print "username is %s" % username [snip] > > > The autoconf.txt contains two lines, which first has an ip address and > second a username. The problem I'm having is that the string.strip() do

Re: creating an object from base class

2007-04-27 Thread Ian Clark
Quote iogilvy: > i wish to have some extended functionality added to sockets > > i can create my own socket class class mysocket(socket.socket): > > and all should be fine. Except, the sockets are created for me by the > accept method, listening on port. So how can i take the standard > socket cr

Re: mysql "rows affected"

2007-04-26 Thread Ian Clark
Both cursor.execute() and cursor.executemany() return the number of rows affected. Here is a link to the documentation: http://mysql-python.sourceforge.net/MySQLdb-1.2.2/public/MySQLdb.cursors.BaseCursor-class.html#execute Ian On 4/26/07, Carl K <[EMAIL PROTECTED]> wrote: using MySQLdb, I do