import error

2006-07-31 Thread cheeky
Hi, all. I now really like to program with Python, even though I'm a newbie. I have difficulty in solving the following problem. $ python Traceback (most recent call last): File "x.py", line 6, in ? import calendar, time File "time.py", line 5, in ? now = time.time() TypeError: 'modul

Re: import error

2006-07-31 Thread Simon Forman
cheeky wrote: > Hi, all. > > I now really like to program with Python, even though I'm a newbie. I > have difficulty in solving the following problem. > > $ python > Traceback (most recent call last): > File "x.py", line 6, in ? > import calendar, time > File "time.py", line 5, in ? > n

Re: gaierror: (8, 'hostname nor servname provided, or not known')

2006-07-31 Thread Laszlo Nagy
faulkner írta: > my boss has a similar problem with his home internet connection in > general. he traced it back to his router, which was in the first couple > generations of routers. how old are the routers you tested this on? > aside from upgrading them, if they are the problem, i can suggest a >

Re: running an app as user "foo"

2006-07-31 Thread Simon Forman
bruce wrote: > hi. > > within python, what's the best way to automatically spawn an app as a given > user/group. > > i'm testing an app, and i'm going to need to assign the app to a given > user/group, as well as assign it certain access rights/modes (rwx) i then > want to copy the test app to a gi

Re: Need a compelling argument to use Django instead of Rails

2006-07-31 Thread Gerhard Fiedler
On 2006-07-31 14:37:26, Bruno Desthuilliers wrote: >> So, if mod_python provides the same functionality, it's not the main >> reason why Python developers use application servers while PHP users >> still program with page codes in /htdocs. >> >> Why do PHP users stick to that old way of things? B

Python help for Access database

2006-07-31 Thread shakir
dbc.odbc("test1_Data") cursor = conn.cursor() # data type in mdb is as follows: application -> Text, Run_Date -> Date, Run_dateYMD -> #number, status -> Script cursor.execute("INSERT INTO local_cmgenadm (Application,Run_Date, Run_DateYMD,status) values (\

Static Variables in Python?

2006-07-31 Thread Michael Yanowitz
Is it possible to have a static variable in Python - a local variable in a function that retains its value. For example, suppose I have: def set_bit (bit_index, bit_value): static bits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] bits [bit_index] = bit_value print "\tBit Array

Re: XML parsing and writing

2006-07-31 Thread c00i90wn
Nice package ElementTree is but sadly it doesn't have a pretty print, well, guess I'll have to do it myself, if you have one already can you please give it to me? thanks :) Stefan Behnel wrote: > c00i90wn wrote: > > Hey, I'm having a problem with the xml.dom.minidom package, I want to > > generate

Re: Static Variables in Python?

2006-07-31 Thread Roel Schroeven
Michael Yanowitz schreef: > Is it possible to have a static variable in Python - > a local variable in a function that retains its value. > > For example, suppose I have: > > def set_bit (bit_index, bit_value): >static bits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] >bits [bit

Re: Static Variables in Python?

2006-07-31 Thread tac-tics
Michael Yanowitz wrote: > Is it possible to have a static variable in Python - > a local variable in a function that retains its value. > > For example, suppose I have: > > def set_bit (bit_index, bit_value): >static bits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] >bits [bit_index

Borg vs. Module

2006-07-31 Thread tobiah
I am making a web app, made up of many modules that all need access to some important data, like the current session data, cookies, navigation history, post/get variables, etc. I decided to go with the 'Borg' idea, by assigning the __dict__ of an object to a class variable so that each instantiati

Re: Windows vs. Linux

2006-07-31 Thread James Stroud
jean-michel bain-cornu wrote: >Take care to use os.sep This is an important point. You should read up on the os.path module to make sure you are doing things in a platform independent way, for example, its better to use: os.path.join('my', 'favorite', 'dir') than "\\".join(['my', 'favor

Re: Static Variables in Python?

2006-07-31 Thread bearophileHUGS
tac-tics: > If you declare bits in set_bit() as "global bits = ...", it will create > it as a global variable without you having to declare it outside of the > function. Just be careful about name conflicts. Are you sure? def fun(): global x = 10 fun() print x Bye, bearophile -- http://mai

Re: list of lists of lists ....

2006-07-31 Thread yomgui
thanks for all your answers yomgui yomgui wrote: > > Hi, > > I have a list of data (type A) > my list can includes element of type A or a lists, > these list can includes element of type A or a lists, and so on ... > > is there a simple way to obtain a single list of all the elemets > of type

Re: BCD List to HEX List

2006-07-31 Thread John Machin
[EMAIL PROTECTED] wrote: > Philippe Martin wrote: > > Yes, I came here for the "algorithm" question, not the code result. > > To turn BCD x to binary integer y, > > set y to zero > for each nibble n of x: > y = (((y shifted left 2) + y) shifted left 1) + n Yeah yeah yeah i.e. y = y * 10 +

Python server j2me client ssl socket handshake error

2006-07-31 Thread karzem
I try to write simple midlet in java to connect with my server which monitors processes in my PC. I've written almost everything and now I've spend 4 days trying to set up a connection between them. Without ssl everything works fine. Here is my fragment of server program: def verify_cb(conn, cert,

Re: Static Variables in Python?

2006-07-31 Thread Carsten Haese
On Mon, 2006-07-31 at 15:21, Michael Yanowitz wrote: > Is it possible to have a static variable in Python - > a local variable in a function that retains its value. > > For example, suppose I have: > > def set_bit (bit_index, bit_value): >static bits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

Re: Using Python for my web site

2006-07-31 Thread Gerhard Fiedler
On 2006-07-31 15:00:15, Bruno Desthuilliers wrote: > In fact, the real question IMHO is: what would MySQL advantage over > PostgreSQL be ?-) A few years ago I did some research, and the result was that while PostgreSQL was claimed to have more features and a better design, the reports of databas

Re: Static Variables in Python?

2006-07-31 Thread John Salerno
[EMAIL PROTECTED] wrote: > tac-tics: >> If you declare bits in set_bit() as "global bits = ...", it will create >> it as a global variable without you having to declare it outside of the >> function. Just be careful about name conflicts. > > Are you sure? > > def fun(): > global x = 10 > fun(

Re: Static Variables in Python?

2006-07-31 Thread Bruno Desthuilliers
Roel Schroeven a écrit : > Michael Yanowitz schreef: > >> Is it possible to have a static variable in Python - a local >> variable in a function that retains its value. >> (snip) > > You could do it by defining static_bits as a keyword parameter with a > default value: > (snip) > It might be

Re: Using Python for my web site

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 17:12 -0300, Gerhard Fiedler wrote: > On 2006-07-31 15:00:15, Bruno Desthuilliers wrote: > > > In fact, the real question IMHO is: what would MySQL advantage over > > PostgreSQL be ?-) > > A few years ago I did some research, and the result was that while > PostgreSQL was c

Re: Static Variables in Python?

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 15:21 -0400, Michael Yanowitz wrote: > Is it possible to have a static variable in Python - > a local variable in a function that retains its value. > > For example, suppose I have: > > def set_bit (bit_index, bit_value): >static bits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

Re: Static Variables in Python?

2006-07-31 Thread Bruno Desthuilliers
Michael Yanowitz a écrit : > Is it possible to have a static variable in Python - > a local variable in a function that retains its value. > > For example, suppose I have: > > def set_bit (bit_index, bit_value): >static bits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] >bits [bi

Re: Static Variables in Python?

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 13:02 -0700, Cliff Wells wrote: > @attrs ( bits = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ) Also, IMO, it's a bit more readable to write: bits = [ 0 for i in range ( 16 ) ] which avoids the necessity of counting the zeros to know how many there are. Regards, C

Re: Static Variables in Python?

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 13:37 -0700, Cliff Wells wrote: > On Mon, 2006-07-31 at 13:02 -0700, Cliff Wells wrote: > > > > @attrs ( bits = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ) > > Also, IMO, it's a bit more readable to write: > > bits = [ 0 for i in range ( 16 ) ] Or even: bits = [

Re: Static Variables in Python?

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 15:21 -0400, Michael Yanowitz wrote: > Is it possible to have a static variable in Python - > a local variable in a function that retains its value. > > For example, suppose I have: > > def set_bit (bit_index, bit_value): >static bits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

Re: Using Python for my web site

2006-07-31 Thread Gerhard Fiedler
On 2006-07-31 17:28:00, Cliff Wells wrote: >> I assume you don't agree... :) > > I certainly don't. [...] > Also, saying "a few years ago I did some research" in software terms is > pretty much equivalent to saying "I don't know". Exactly. So what's your point with this comment? I stated what

Re: Static Variables in Python?

2006-07-31 Thread Paddy
Michael Yanowitz wrote: > Is it possible to have a static variable in Python - > a local variable in a function that retains its value. > > For example, suppose I have: > > def set_bit (bit_index, bit_value): >static bits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] >bits [bit_index

Re: Using Python for my web site

2006-07-31 Thread northband
So seems the best approach would be a MVC model rather than server scripting? Currently our site is built with a closed source hypertext preprocessor much like PHP. So it would be easier for us to script another site, but if we would gain performance via a MVC model, then that's what we need. I

Re: BCD List to HEX List

2006-07-31 Thread John Machin
Philippe Martin wrote: > Paul Rubin wrote: > > > Philippe Martin <[EMAIL PROTECTED]> writes: > >> I actually need numbers much larger than 32 bits. ***NOW*** you tell us, after all the stuffing about re 32 bits. > > > > What is the max size hex number you need? What is the application if > > yo

Re: Static Variables in Python?

2006-07-31 Thread tac-tics
> But of course: > > >>> def fun(): > global x = 10 > > SyntaxError: invalid syntax > >>> global x x = 10 Close enough ^^; -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python for my web site

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 17:58 -0300, Gerhard Fiedler wrote: > On 2006-07-31 17:28:00, Cliff Wells wrote: > > >> I assume you don't agree... :) > > > > I certainly don't. [...] > > > Also, saying "a few years ago I did some research" in software terms is > > pretty much equivalent to saying "I don

RE: Borg vs. Module

2006-07-31 Thread Jordan R McCoy
Tobiah: >From the standpoint of implementation, I don't see much of a difference unless you are specifically interested in the more limited functionality of a module (vs. a class instance). If you aren't, then you can simply instantiate your borg class and then insert it into sys.modules early in

Re: Using Python for my web site

2006-07-31 Thread northband
Just spoke with my department and looks like we still want to go with a server scripting method. Although MVC may be better fit, for the sake of the learning curve, we want to use a PSP style method. So as of now we are looking at using FreeBSD, MySQL, and some form of Python that will allow us t

Re: Python help for Access database

2006-07-31 Thread John Machin
n_dateYMD -> #number, status -> Script > > cursor.execute("INSERT INTO local_cmgenadm (Application,Run_Date, > Run_DateYMD,status) values (\'MyApp1\',\'%s\', \'20060731\' , > \'Good\')")%mytime 1. Why do you think you need all those \ ch

Re: Using Python for my web site

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 14:40 -0700, northband wrote: > Just spoke with my department and looks like we still want to go with a > server scripting method. Although MVC may be better fit, for the sake > of the learning curve, we want to use a PSP style method. I'm with the others who suggest using a

Re: getting debug from urllib2

2006-07-31 Thread Ben Edwards
Thanks a lot, hove managed to get it working: opener = urllib2.build_opener(urllib2.HTTPHandler(debuglevel=1)) Ben On Mon, 2006-07-31 at 12:33 -0400, Chris Lambacher wrote: > On Mon, Jul 31, 2006 at 02:43:36PM +0100, Ben Edwards wrote: > > Have been experimenting with HTTP stuff in python 2.4 an

Re: Using Python for my web site

2006-07-31 Thread northband
Makes sense, I will follow your advice. Sounds like more time invest upfront will equal time saved over the long run. I am defitely interested in proxy caching and load balancing. Which do you recommend? I have used #Pound while working for a university. -Adam Cliff Wells wrote: > On Mon, 20

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
John Machin wrote: > So why don't you get a freely available "bignum" package, throw away > the bits you don' t want, and just compile it and use it, instead of > writing your own bug-ridden (see below) routines? Oh yeah, the bignum > package might use "long" and you think that you don't have acce

Re: Using Python for my web site

2006-07-31 Thread Bruno Desthuilliers
Gerhard Fiedler a écrit : > On 2006-07-31 15:00:15, Bruno Desthuilliers wrote: > > >>In fact, the real question IMHO is: what would MySQL advantage over >>PostgreSQL be ?-) > > > A few years ago I did some research, and the result was that while > PostgreSQL was claimed to have more features a

Re: Using Python for my web site

2006-07-31 Thread Diez B. Roggisch
northband schrieb: > So seems the best approach would be a MVC model rather than server > scripting? Currently our site is built with a closed source hypertext > preprocessor much like PHP. So it would be easier for us to script > another site, but if we would gain performance via a MVC model, th

Re: Using Python for my web site

2006-07-31 Thread Bruno Desthuilliers
northband a écrit : > So seems the best approach would be a MVC model rather than server > scripting? This is still "server-scripting" - at least since on the server-side and is done with something frequently labelled as a "script language" !-) > Currently our site is built with a closed sourc

ELF format reader

2006-07-31 Thread Hugo Venturini
Hi, I am looking for an ELF format reader written in python. Does anyone know if it exists?H. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python help for Access database

2006-07-31 Thread BartlebyScrivener
John Machin wrote: >> or mxODBC >> [very good but not free]. I love mxODBC. It's free for noncommercial use. http://www.egenix.com/files/python/mxODBC.html rd -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python for my web site

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 15:06 -0700, northband wrote: > Makes sense, I will follow your advice. Sounds like more time invest > upfront will equal time saved over the long run. I am defitely > interested in proxy caching and load balancing. Which do you > recommend? I have used #Pound while workin

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
Sorry forgot a few answers/comments: John Machin wrote: > SHOULD BE >= >currently add([6, 6], [4, 4] -> [10, 10] True, thanks > *** try - 10 instead of % 10 > If the first operand is > 19, you have a bug! > This might save a few CPU cycles on your smartcard can it ? each array value will be

Re: Using Python for my web site

2006-07-31 Thread Bruno Desthuilliers
northband a écrit : > Just spoke with my department and looks like we still want to go with a > server scripting method. Although MVC may be better fit, for the sake > of the learning curve, we want to use a PSP style method. I really don't think the learning curve will be a problem. We learned

Re: BCD List to HEX List

2006-07-31 Thread John Machin
Philippe Martin wrote: > John Machin wrote: > > > So why don't you get a freely available "bignum" package, throw away > > the bits you don' t want, and just compile it and use it, instead of > > writing your own bug-ridden (see below) routines? Oh yeah, the bignum > > package might use "long" and

ImportError raised in script, not interactive session.

2006-07-31 Thread Adam Blinkinsop
I'm writing a set of modules to monitor remote system services, and I'm having a problem running my test scripts. When I pass the scripts into python, like so: -- $ PYTHONPATH="${TARGET_DIR}" python test.py -- I get an ImportError: -- Traceback (most recent call last): File "./test.py", line

Re: Windows vs. Linux

2006-07-31 Thread diffuser78
Linux can let you do more in Python and this comes from my personal exprience. Ubuntu Dapper should let you install drivers easily for wireless...a little bit tweaking might be required but its worth the effort. Python and Ubuntu rock...go fot it. [EMAIL PROTECTED] wrote: > Okay, once-upon-a-time

RE: Python-list Digest, Vol 35, Issue 2

2006-07-31 Thread support
This is an automated response. Thank you for contacting the Technical Support team at The MathWorks Ltd. A technical support representative will be contacting you within 1 business day. The following information will help us in responding to your request. If you have already provided the info

Re: Windows vs. Linux

2006-07-31 Thread diffuser78
> I'd never recommend dual-boot for anything! > Hardware is cheap, time and trouble is expensive. Dual-booting if so easy and helpful, I have always found it to be extremely useful. You might have a bad experience but I have my laptop and desktop both running dual boot successfully for 4 and a ha

RE: Python-list Digest, Vol 35, Issue 1

2006-07-31 Thread support
This is an automated response. Thank you for contacting the Technical Support team at The MathWorks Ltd. A technical support representative will be contacting you within 1 business day. The following information will help us in responding to your request. If you have already provided the info

RE: ImportError raised in script, not interactive session.

2006-07-31 Thread Jordan R McCoy
Assuming your setting the target directory to the overwatch folder, and you are starting the interactive session in your home directory, this is what is happening. The folder containing your package must be in the python path, not the folder itself. Try "PYTHONPATH=/home/directory python test.py

Re: Python help for Access database

2006-07-31 Thread John Machin
BartlebyScrivener wrote: > John Machin wrote: > > >> or mxODBC > >> [very good but not free]. > > I love mxODBC. It's free for noncommercial use. > I was presuming that the OP was mucking about with Access only because he was so constrained by his job :-) -- http://mail.python.org/mailman/listi

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
John Machin wrote: > Have you actually tried it? Do you mean it barfs on the word "long" > [meaning that it's not an ANSI-compliant C compiler], or that "long" is > only 16 bits? :-) if the documentation tells me there is no 32 bit support, why should I not believe it ? > because (1) [like I sa

Re: ImportError raised in script, not interactive session.

2006-07-31 Thread Adam Blinkinsop
Jordan R McCoy wrote: > If this isn't the case, what are you using for TARGET_DIR? ${TARGET_DIR} = /home/blinks/projects/overwatch/target/lib/python I've started the interactive session from several different directories, and never had a problem. My make output (note the second item in sys.path):

Re: BCD List to HEX List

2006-07-31 Thread John Machin
Philippe Martin wrote: > Sorry forgot a few answers/comments: > > John Machin wrote: > > SHOULD BE >= > >currently add([6, 6], [4, 4] -> [10, 10] > > True, thanks > > > *** try - 10 instead of % 10 > > If the first operand is > 19, you have a bug! > > This might save a few CPU cycles on your s

Decorator for use with cgilib

2006-07-31 Thread Paul McGuire
(if anyone still uses cgilib, in the presence of Django, TG, et al.)... I tried out a simple CGI Python script this week, and was a bit annoyed at the repetitive ,,, etc. opening and closing tags for each request handler method. So I wrote a decorator to handle this junk. It's posted on the Pyth

Re: Decorator for use with cgilib

2006-07-31 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > (if anyone still uses cgilib, in the presence of Django, TG, et al.)... > > I tried out a simple CGI Python script this week, and was a bit annoyed at > the repetitive ,,, etc. opening and closing tags for each > request h

under naming

2006-07-31 Thread David Bear
I must have missed reading something important about naming conventions. I have found that if I have a python module where I have an identifier named with a beginning underscore that I cannot use from module import * to make that name available in another module. for example, module A _myvar = '

PIL issues

2006-07-31 Thread David Bear
I am trying to use PIL and when building it, PIL fails to find my jpeg library. I am using a python 2.4.3 that I build myself on Suse linux 9.3. I do have the following jpeg libraries: rpm -qa | grep jpeg jpeg-6b-738 libjpeg-32bit-9.3-7 libjpeg-6.2.0-738 yet, when building PIL I get: python set

Re: Nuther problem with 'dive into Python'

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 14:03 +0100, Ben Edwards wrote: > Am going through Chapter 9 - HTTP Web Services in dive into Python. It > uses the following: > > data = urllib.urlopen('http://diveintomark.org/xml/atom.xml').read() > > The page no longer exists, can anyone recommend an alternative page to

Re: under naming

2006-07-31 Thread Robert Kern
David Bear wrote: > I must have missed reading something important about naming conventions. > > I have found that if I have a python module where I have an identifier named > with a beginning underscore that I cannot use from module import * to make > that name available in another module. > > f

Re: Working with Widget after Instance loses the reference

2006-07-31 Thread John McMonagle
On Mon, 2006-07-31 at 11:15 -0700, Al in Dallas wrote: > I made the mistake of creating an instance of a widget and assigning it > to a name I'd already used. Now, if I use root.children or > root.slaves(), I can see the "lost" widget, but can I do anything else > with the string of numbers that sh

Re: under naming

2006-07-31 Thread John Machin
David Bear wrote: > I must have missed reading something important about naming conventions. > > I have found that if I have a python module where I have an identifier named > with a beginning underscore that I cannot use from module import * to make > that name available in another module. > > fo

Pickle vs XML for file I/O

2006-07-31 Thread crystalattice
I'm creating an RPG for experience and practice. I've finished a character creation module and I'm trying to figure out how to get the file I/O to work. I've read through the python newsgroup and it appears that shelve probably isn't the best option for various reasons. This lead me to try messi

Re: Pickle vs XML for file I/O

2006-07-31 Thread Simon Forman
crystalattice wrote: > I'm creating an RPG for experience and practice. I've finished a > character creation module and I'm trying to figure out how to get the > file I/O to work. > > I've read through the python newsgroup and it appears that shelve > probably isn't the best option for various rea

realine not found error

2006-07-31 Thread David Bear
I built python 2.4.2 for suse linux 9.3. I configured it to be a separate instance of python from the version packaged with suse. Now when I start it I get an error: python Python 2.4.2 (#4, Jul 27 2006, 14:34:30) [GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] on linux2 Type "help", "copyright", "

Re: BCD List to HEX List

2006-07-31 Thread Simon Forman
Philippe, please! The suspense is killing me. What's the cpu!? For the love of God, what's the CPU? I-can't-take-it-anymore-it's-such-a-simple-question-ingly yours, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Help with arrays of strings

2006-07-31 Thread Jon Smirl
I only have a passing acquaintance with Python and I need to modify some existing code. This code is going to get called with 10GB of data so it needs to be fairly fast. http://cvs2svn.tigris.org/ is code for converting a CVS repository to Subversion. I'm working on changing it to convert from CV

RE: Python-list Digest, Vol 35, Issue 4

2006-07-31 Thread support
This is an automated response. Thank you for contacting the Technical Support team at The MathWorks Ltd. A technical support representative will be contacting you within 1 business day. The following information will help us in responding to your request. If you have already provided the info

Re: BCD List to HEX List

2006-07-31 Thread John Machin
Simon Forman wrote: > Philippe, please! The suspense is killing me. What's the cpu!? > > For the love of God, what's the CPU? > > I-can't-take-it-anymore-it's-such-a-simple-question-ingly yours, Yes, please . I've found a C compiler manual on the web for the Epson S1C33 CPU as well as the

Re: Using Python for my web site

2006-07-31 Thread Gerhard Fiedler
On 2006-07-31 18:23:17, Cliff Wells wrote: > My point is to stop FUD right at that comment. I don't doubt your > research from "a few years ago", but ancient research is entirely > irrelevant for making a decision *today*. That's exactly the reason why I added this information. It might not be f

Re: realine not found error

2006-07-31 Thread Robert Kern
David Bear wrote: > I built python 2.4.2 for suse linux 9.3. I configured it to be a separate > instance of python from the version packaged with suse. > > Now when I start it I get an error: > python > Python 2.4.2 (#4, Jul 27 2006, 14:34:30) > [GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] on li

Re: readline not found error

2006-07-31 Thread David Bear
Robert Kern wrote: > David Bear wrote: >> I built python 2.4.2 for suse linux 9.3. I configured it to be a separate >> instance of python from the version packaged with suse. >> >> Now when I start it I get an error: >> python >> Python 2.4.2 (#4, Jul 27 2006, 14:34:30) >> [GCC 3.3.5 20050117 (pr

Re: Windows vs. Linux

2006-07-31 Thread Dan
Andy Dingley wrote: [snip] > Python is one of the best languages I've found for > platform-independence - significantly better than Perl. [big snip] This statement was given in the context of Windows and Linux, and I've precious little experience doing anything on Windows. So I won't challenge

Re: Help with arrays of strings

2006-07-31 Thread Simon Forman
Jon Smirl wrote: > I only have a passing acquaintance with Python and I need to modify some > existing code. This code is going to get called with 10GB of data so it > needs to be fairly fast. > > http://cvs2svn.tigris.org/ is code for converting a CVS repository to > Subversion. I'm working on cha

code to retrieve web mail?

2006-07-31 Thread John Savage
I have a free web mail address and would like to use python to retrieve files that have been emailed to me. The basic code would accommodate cookies, a login name and password, then download using the full URL I can provide. From postings here I thought mechanize held promise, but I've found it to

Re: Help with arrays of strings

2006-07-31 Thread Jon Smirl
On Mon, 31 Jul 2006 18:33:34 -0700, Simon Forman wrote: > Splitting a string into a list (array) of lines is easy enough, if you > want to discard the line endings, Thanks for the pointers, that should be enough to get me started. I had started off in the wrong direction looking for arrays instea

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
John Machin wrote: > > Simon Forman wrote: >> Philippe, please! The suspense is killing me. What's the cpu!? >> >> For the love of God, what's the CPU? >> >> I-can't-take-it-anymore-it's-such-a-simple-question-ingly yours, > > Yes, please . > > I've found a C compiler manual on the web f

Re: Nested function scope problem

2006-07-31 Thread danielx
Gerhard Fiedler wrote: > On 2006-07-30 09:54:14, Antoon Pardon wrote: > > > Aren't you looking too much at implementation details now? > > Possibly, but at this point I'm still trying to understand how Python does > these things, and what the useful abstraction level is for me. I also still > have

FOR LOOPS

2006-07-31 Thread OriginalBrownster
I am using a class called UploadedFile. I want to create a for loop to itterate through the objects within file name class UploadedFile(SQLObject): filename = StringCol(alternateID=True) abspath = StringCol() uniqueid = IntCol() I'll show you a snippit of the code I am try

Re: readline not found error

2006-07-31 Thread Robert Kern
David Bear wrote: > okay. Since I grabbed the python tar file from python.org, do I then assume > that readline is not included in the python source distribution? if so, > where would I find it. If not, what different build instructions do I need > to follow to make it build with readline? Oops.

Re: FOR LOOPS

2006-07-31 Thread danielx
OriginalBrownster wrote: > I am using a class called UploadedFile. > I want to create a for loop to itterate through the objects within file > name > > class UploadedFile(SQLObject): > filename = StringCol(alternateID=True) > abspath = StringCol() > uniqueid = IntCol() > > I'll sh

Re: BCD List to HEX List

2006-07-31 Thread Grant Edwards
On 2006-08-01, Philippe Martin <[EMAIL PROTECTED]> wrote: >> Perhaps if Philippe could divulge the part number that's in >> the bottom right corner of the manual that he has, and/or any >> part number that might be mentioned in the first few pages of >> that manual, enlightenment may ensue >

suppressing the console in a GUI program

2006-07-31 Thread John Salerno
Hi guys. I tried naming my file with a .pyw extension, but the console still shows up. Why doesn't this work? And is there another, more programmatic way to suppress it? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: suppressing the console in a GUI program

2006-07-31 Thread John Salerno
John Salerno wrote: > Hi guys. I tried naming my file with a .pyw extension, but the console > still shows up. Why doesn't this work? And is there another, more > programmatic way to suppress it? > > Thanks. I just noticed that the console that opens isn't the normal one, it's IPython. Now how

RE: Python-list Digest, Vol 35, Issue 6

2006-07-31 Thread support
This is an automated response. Thank you for contacting the Technical Support team at The MathWorks Ltd. A technical support representative will be contacting you within 1 business day. The following information will help us in responding to your request. If you have already provided the info

Re: Pickle vs XML for file I/O

2006-07-31 Thread crystalattice
On Mon, 31 Jul 2006 14:35:39 -1000, Simon Forman <[EMAIL PROTECTED]> wrote: > crystalattice wrote: >> I'm creating an RPG for experience and practice. I've finished a >> character creation module and I'm trying to figure out how to get the >> file I/O to work. >> >> I've read through the python

Re: Using Python for my web site

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 21:57 -0300, Gerhard Fiedler wrote: > On 2006-07-31 18:23:17, Cliff Wells wrote: > > > My point is to stop FUD right at that comment. I don't doubt your > > research from "a few years ago", but ancient research is entirely > > irrelevant for making a decision *today*. > > T

Re: How to catch python's STDOUT

2006-07-31 Thread Greg Ewing
[EMAIL PROTECTED] wrote: > I dont want the outputs of print to be displayed on the console > since it is used my fellow-workers > But i need those prints for debugging purpose import sys sys.stdout = open("my_debugging_output.txt", "w") Or you can replace sys.stdout with any obje

Re: code to retrieve web mail?

2006-07-31 Thread Cliff Wells
On Tue, 2006-08-01 at 01:47 +, John Savage wrote: > I have a free web mail address and would like to use python to retrieve > files that have been emailed to me. The basic code would accommodate > cookies, a login name and password, then download using the full URL I > can provide. From posting

ANN: Quest for the Holy Grail (a PyGame game)

2006-07-31 Thread Greg Ewing
This game is doubly Pythonic -- it uses PyGame, and it's based on a Monty Python movie. It was originally an entry in the Pygame.draw challenge (http://media.pyweek.org/static/pygame.draw-0606.html). I've put a slightly enhanced and bugfixed version on my web page: http://www.cosc.canterbury.ac.n

Re: Using Python for my web site

2006-07-31 Thread Luis M. González
I don't have experience with Django or any other python framework, but I have used bare-bones mod_python and it rocks. I wouldn't use PSP though... It is not very polished, and they way it handles the "indentation problem" in python is a little bit confussing. IMHO the best way of using mod_python

Re: BCD List to HEX List

2006-07-31 Thread John Machin
Grant Edwards wrote: > On 2006-08-01, Philippe Martin <[EMAIL PROTECTED]> wrote: > > >> Perhaps if Philippe could divulge the part number that's in > >> the bottom right corner of the manual that he has, and/or any > >> part number that might be mentioned in the first few pages of > >> that manual

Re: BCD List to HEX List

2006-07-31 Thread bryanjugglercryptographer
John Machin wrote: > [EMAIL PROTECTED] wrote: > > Philippe Martin wrote: > > > Yes, I came here for the "algorithm" question, not the code result. > > > > To turn BCD x to binary integer y, > > > > set y to zero > > for each nibble n of x: > > y = (((y shifted left 2) + y) shifted left 1)

Re: Pickle vs XML for file I/O

2006-07-31 Thread John Machin
crystalattice wrote: > > Plus, to modify data in a class I presume the word "instance" is missing here ... > do I have to unpickle the whole thing > first or is there a way to modify the data while it's pickled? Actually, > I think I can answer that last question: a character instance, having

Re: BCD List to HEX List

2006-07-31 Thread John Machin
[EMAIL PROTECTED] wrote: > John Machin wrote: > > [EMAIL PROTECTED] wrote: > > > Philippe Martin wrote: > > > > Yes, I came here for the "algorithm" question, not the code result. > > > > > > To turn BCD x to binary integer y, > > > > > > set y to zero > > > for each nibble n of x: > > > y

Re: Pickle vs XML for file I/O

2006-07-31 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, crystalattice wrote: > On Mon, 31 Jul 2006 14:35:39 -1000, Simon Forman <[EMAIL PROTECTED]> > wrote: > >> What kind of trouble were you having with pickle? > > It's mostly a combination of things (I hope you can follow my logic). > First, to use "good programming prac

<    1   2   3   >