Re: Python Embedding Thread

2008-07-21 Thread googler . 1 . webmaster
Hi! Thank you very much for your answers. I have a menue with a script in it. So my app starts a new thread for each script. So I would like to run two scripts all the same time. Could someone give me a tip, what I have to set in my code? Thank you :) -- http://mail.python.org/mailman/listinfo/p

Re: string[i:j:k]

2008-07-21 Thread John McMonagle
konstantin wrote: > > Thanks! > It seems that negative step leads in reverse direction. > But logic isn't completely clear for me. s = '123456789' s[::-2] > '97531' > > but s[:-1:-2] > '' > though I expected something like '8642' > What did i missed? > > -- You need to *start*

Re: formatting list -> comma separated (slightly different)

2008-07-21 Thread Niklas Norrthon
On 9 Juli, 22:25, Michiel Overtoom <[EMAIL PROTECTED]> wrote: > Paul & Robert wrote... > > d = ["soep", "reeds", "ook"] > >print ', '.join(d) > > soep, reeds, ook > > I occasionally have a need for printing lists of items too, but in the form: > "Butter, Cheese, Nuts and Bolts".  The last separator

Web Page Construction in Python

2008-07-21 Thread SUBHABRATA
Dear Group, I am getting some questions on doing Web Pages in Python. I have some interactive codes in python for which I like to make web pages. I am trying to use kid. Kid I learnt, and is easy, too. My questions are: i) Am I going correct? ii) Is there any language other than kid? iii)

Re: string[i:j:k]

2008-07-21 Thread Gary Herron
konstantin wrote: On Jul 22, 9:18 am, alex23 <[EMAIL PROTECTED]> wrote: On Jul 22, 3:10 pm, konstantin <[EMAIL PROTECTED]> wrote: some_string[i:j:k] What does it mean? i = start position, j = end position, k = step size s = "ABABABABABABAB" s[0:6:2] 'AAA'

Re: tail-rec decorator, well still blows the stack...

2008-07-21 Thread ssecorp
thanks i already have perfect iterative versions of fibonacci. def fib(n): a, b = 1, 0 while n: a, b, n = b, a+b, n-1 return b I know the example is not the way to write pythonic code, I was just learning about decorators and then I saw this example and tried it out. but than

Re: string[i:j:k]

2008-07-21 Thread konstantin
On Jul 22, 9:18 am, alex23 <[EMAIL PROTECTED]> wrote: > On Jul 22, 3:10 pm, konstantin <[EMAIL PROTECTED]> wrote: > > > some_string[i:j:k] > > What does it mean? > > i = start position, j = end position, k = step size > > >>> s = "ABABABABABABAB" > >>> s[0:6:2] > 'AAA' > >>> s = "ABCABCABCABCABC" >

Re: proliferation of computer languages

2008-07-21 Thread Chris Rathman
I can't say that I see any particular point to the essay. But I did want to point out that Oz should not be considered part of the ML family. Aside from not being statically typed - a very central tenet to ML, Oz is much more part of the Logic family of languages (Mercury, Prolog, etc...). On Ju

Re: Time Complexity of String Operations

2008-07-21 Thread Terry Reedy
youtoo wrote: It has been extensively discussed the time complexity (quadratic) of string concatenation (due to string's immutability). But what is: == the time complexity of string indexing? Is it constant? == the time complexity of string slicing? Is it O(K) with K the slice's length? How a

Re: tail-rec decorator, well still blows the stack...

2008-07-21 Thread Terry Reedy
ssecorp wrote: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496691 so I try it and when I run: @Decorators.tail_recursion def fibtr(n): def fibt(a, b, n): if n <= 1: return b else: return fibt(b, a + b, n - 1) if n == 0: return

Re: string[i:j:k]

2008-07-21 Thread alex23
On Jul 22, 3:10 pm, konstantin <[EMAIL PROTECTED]> wrote: > some_string[i:j:k] > What does it mean? i = start position, j = end position, k = step size >>> s = "ABABABABABABAB" >>> s[0:6:2] 'AAA' >>> s = "ABCABCABCABCABC" >>> s[0:6:3] 'AA' Hope this helps. - alex23 -- http://mail.python.org/mai

string[i:j:k]

2008-07-21 Thread konstantin
Hello, I'm not a newbie in python, but recently faced a problem in simple expression: some_string[i:j:k] What does it mean? I believe this grammar (http://docs.python.org/ref/ slicings.html) describes the syntax. But I can't grasp it. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Website Creation using Python

2008-07-21 Thread alex23
On Jul 22, 12:44 am, Amie <[EMAIL PROTECTED]> wrote: > I would like some help on how to create a website using the python > programming language. > I've tried using enamel, but had some problems because I could not > create html tables and intergrating it with python, like you use it > when coding

Re: scanf in python

2008-07-21 Thread AMD
Robert Kern a écrit : AMD wrote: Hello, I often need to parse strings which contain a mix of characters, integers and floats, the C-language scanf function is very practical for this purpose. I've been looking for such a feature and I have been quite surprised to find that it has been discus

Re: Time Complexity of String Operations

2008-07-21 Thread David Wahler
On Mon, Jul 21, 2008 at 10:31 PM, youtoo <[EMAIL PROTECTED]> wrote: > It has been extensively discussed the time complexity (quadratic) of > string concatenation (due to string's immutability). Actually, it is roughly linear, at least for reasonable string lengths: $ python -V Python 2.5.2 $ pyth

fromfile error on windows, not mac

2008-07-21 Thread jadamwil
Hello, I am using the numpy fromfile function to read binary data from a file on disk. The problem is that the program runs fine on a Mac, but gives an error or warning on windows when trying to read the data. I use it like this: Signal = zeros((N, 16), dtype=float32) for sample in range(0, N):

Re: Python Embedding Thread

2008-07-21 Thread Jaimy Azle
"Benjamin" <[EMAIL PROTECTED]> wrote: > Two threads should not be running through the Python VM concurrently > in the same process. The GIL has to be held *any* time you use the > Python API. When you want to release the GIL (to process something in > C), use PY_BEGIN_ALLOW_THREADS and > PY_END_AL

Re: tail-rec decorator, well still blows the stack...

2008-07-21 Thread David Wahler
On Mon, Jul 21, 2008 at 10:01 PM, ssecorp <[EMAIL PROTECTED]> wrote: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496691 > > so I try it and when I run: > @Decorators.tail_recursion > def fibtr(n): >def fibt(a, b, n): >if n <= 1: >return b >else: >

Re: Python Written in C?

2008-07-21 Thread Larry Bates
Grant Edwards wrote: On 2008-07-22, Larry Bates <[EMAIL PROTECTED]> wrote: You talk about "writing it in assembly language for each MPU chip". Actually it is even better than that. We now have these modern inventions, called compilers that do that type of work for us. They translate high lev

Re: Problem with Python Server Pages (PSP)

2008-07-21 Thread barun . saha04
On Jul 22, 5:18 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Jul 21, 9:42 pm, [EMAIL PROTECTED] wrote: > > > > > > > Hi, > > > I am facing a very basic problem with PSP. I have installedmod_python > > (in fedora Core 1), added the lines required for loading Python > > modules and handling P

Re: Website Creation using Python

2008-07-21 Thread Larry Bates
Amie wrote: Afternoon, I would like some help on how to create a website using the python programming language. I've tried using enamel, but had some problems because I could not create html tables and intergrating it with python, like you use it when coding in php. Any help would be appreciate

Re: Python Written in C?

2008-07-21 Thread Grant Edwards
On 2008-07-22, Larry Bates <[EMAIL PROTECTED]> wrote: > You talk about "writing it in assembly language for each MPU > chip". Actually it is even better than that. We now have > these modern inventions, called compilers that do that type of > work for us. They translate high level instructions,

Re: Python Written in C?

2008-07-21 Thread Larry Bates
[EMAIL PROTECTED] wrote: I'm just learning about Python now and it sounds interesting. But I just read (on the Wiki page) that mainstream Python was written in C. That's what I was searching for: Python was written in what other language? See, my concern was something like: OK, if Python is so h

Time Complexity of String Operations

2008-07-21 Thread youtoo
It has been extensively discussed the time complexity (quadratic) of string concatenation (due to string's immutability). But what is: == the time complexity of string indexing? Is it constant? == the time complexity of string slicing? Is it O(K) with K the slice's length? How are strings stored

Re: tail-rec decorator, well still blows the stack...

2008-07-21 Thread ssecorp
I my function not proper tail-recursion? because this doesn't blow the stack: #!/usr/bin/env python2.4 # This program shows off a python decorator( # which implements tail call optimization. It # does this by throwing an exception if it is # it's own grandparent, and catching such # exceptions

tail-rec decorator, well still blows the stack...

2008-07-21 Thread ssecorp
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496691 so I try it and when I run: @Decorators.tail_recursion def fibtr(n): def fibt(a, b, n): if n <= 1: return b else: return fibt(b, a + b, n - 1) if n == 0: return 0 else:

Re: How to install simplejson on WinXP

2008-07-21 Thread lookon
I just installed again to see the error message. But it worked OK now. The problem was about compiling the c extension last time. Fredrik Lundh wrote: > lookon wrote: > > > I am new to python and had difficulty in installing simplejson on > > WinXP...Could anyone help me? Thanks > > what did you t

Re: Python Embedding Thread

2008-07-21 Thread Benjamin
On Jul 21, 6:56 am, [EMAIL PROTECTED] wrote: > Hi :) > > I want to run Python in my app. That works still fine. But my app > supports now Threads and I would like to know what to do, that it runs > without problems. > > PyGILState_Release and PyGILState_Ensure should solve the problem > right? Wher

Re: Odd math related issue.

2008-07-21 Thread Dan Bishop
On Jul 21, 3:52 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Robert Rawlins wrote: > > I’ve got what seems to me to be a totally illogical math issue here > > which I can’t figure out. Take a look at the following code: > > >         /self/.__logger.info(/"%i / %i"/ % (bytes_transferred, > > /sel

Re: Pinging a machine from python

2008-07-21 Thread Prasanth
On May 26, 5:21 am, Zerge <[EMAIL PROTECTED]> wrote: > On May 25, 11:13 am, Prasanth <[EMAIL PROTECTED]> wrote: > > > I tried pinging a machine from python using socket programming but > > could not do it. Is there any module which we can use to ping the > > machine < like net::ping in perl> or can

Re: Python Written in C?

2008-07-21 Thread bojannastic at googlemail
On Jul 20, 6:50 pm, [EMAIL PROTECTED] wrote: > So I was suspecting the Python compiler or interpreter is written in a > REAL language like C#. So, Wiki says it's written in C! It's almost as > if it were an intentional trick...write your own, new language in an > OLD, real world language that is pa

Re: Python Written in C?

2008-07-21 Thread Craig Allen
it's clear to me that the perfect language should exist a priori, coming to being causa sui. Having to actually implement a language is disgusting and unnatural. -- http://mail.python.org/mailman/listinfo/python-list

RE: Python Written in C?

2008-07-21 Thread Delaney, Timothy (Tim)
Fredrik Lundh wrote: > rynt wrote: > >> You're either --- >> A. A Troll >> B. A young, immature programmer trying to show off or >> C. A total idiot. > > you forgot the "All of the above" choice. I read it as an inclusive "or". Tim Delaney -- http://mail.python.org/mailman/listinfo/python-l

Re: Python Written in C?

2008-07-21 Thread giveitawhril2008
On Jul 20, 9:18 pm, Michiel Overtoom <[EMAIL PROTECTED]> wrote: . > > Many major text/word processing programs (Emacs, vi, MS-Word) are also > written in C. Does that mean you should do all your text processing in C? Well, actually, as a COBOL geezer I should not complain about Python. Rumor had i

Re: Problem with Python Server Pages (PSP)

2008-07-21 Thread Graham Dumpleton
On Jul 21, 9:42 pm, [EMAIL PROTECTED] wrote: > Hi, > > I am facing a very basic problem with PSP. I have installedmod_python > (in fedora Core 1), added the lines required for loading Python > modules and handling PSP pages. I have created a hello.psp page. But > when I try to view this hello.psp p

Re: Error importing modules with mod_python

2008-07-21 Thread Graham Dumpleton
On Jul 22, 3:30 am, Aaron Scott <[EMAIL PROTECTED]> wrote: > I've installedmod_python, and everything seems to be working, but it > fails when I try to import another file into the file that's actually > producing the output. I have these lines at the top of index.py: > > frommod_pythonimport apach

Re: scanf in python

2008-07-21 Thread Robert Kern
AMD wrote: Hello, I often need to parse strings which contain a mix of characters, integers and floats, the C-language scanf function is very practical for this purpose. I've been looking for such a feature and I have been quite surprised to find that it has been discussed as far back as 2001

Re: Converting List of String to Integer

2008-07-21 Thread Andrew Freeman
Samir wrote: For my small list, I didn't notice a discernible increase in speed, but I may have to try it with a larger list size. About speed, and memory consumption: List comprehensions (http://docs.python.org/tut/node7.html#SECTION00714) are just shortcuts for for-loops.

Re: Python Written in C?

2008-07-21 Thread Tom Machinski
On Mon, Jul 21, 2008 at 3:53 PM, DaveM <[EMAIL PROTECTED]> wrote: > On Mon, 21 Jul 2008 03:18:01 +0200, Michiel Overtoom <[EMAIL PROTECTED]> > wrote: > > > >Many major text/word processing programs (Emacs, vi, MS-Word) are also > >written in C. > > I thought Emacs was written in Lisp. Large part

Re: Python Written in C?

2008-07-21 Thread Teiresias
[EMAIL PROTECTED] writes: > I'm just learning about Python now and it sounds interesting. But I > just read (on the Wiki page) that mainstream Python was written in C. > That's what I was searching for: Python was written in what other > language? Well, yes, the interpreter and a handful of the c

Re: Converting List of String to Integer

2008-07-21 Thread Andrew Freeman
Samir wrote: On Jul 21, 6:15 pm, Andrew Freeman <[EMAIL PROTECTED]> wrote: Samir wrote: On Jul 21, 3:20 pm, Gary Herron <[EMAIL PROTECTED]> wrote: Samir wrote: Hi Everyone, I am relatively new to Python so please forgive me for what seems like a basic quest

Re: Python Written in C?

2008-07-21 Thread Mensanator
On Jul 21, 8:26 am, Johannes Bauer <[EMAIL PROTECTED]> wrote: > Mensanator schrieb: > > > You want cool? > > THIS is cool: > > > j = ((invert(xyz[1]-xyz[0],xyz[1]**(k-1))*(xyz[1]**(k-1)-prev_gen[2])) > > % xyz[1]**(k-1))/xyz[1]**(k-2) > > You call it cool, I call it NameError: name 'invert' is not

Re: Python Written in C?

2008-07-21 Thread DaveM
On Mon, 21 Jul 2008 03:18:01 +0200, Michiel Overtoom <[EMAIL PROTECTED]> wrote: >Many major text/word processing programs (Emacs, vi, MS-Word) are also >written in C. I thought Emacs was written in Lisp. DaveM -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting List of String to Integer

2008-07-21 Thread Samir
On Jul 21, 6:15 pm, Andrew Freeman <[EMAIL PROTECTED]> wrote: > Samir wrote: > > On Jul 21, 3:20 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > > >> Samir wrote: > > >>> Hi Everyone, > > >>> I am relatively new to Python so please forgive me for what seems like > >>> a basic question. > > >>> Assume

Getting clear error messages with a Python templating system?

2008-07-21 Thread Tom Machinski
Hi there, I'm developing web applications in Python, so I use a templating system to produce HTML. We're dealing with heavy traffic here, so my original choice was the fast and efficient Cheetah. The main problem is that Cheetah doesn't provide clear error messages. Even in the best cases, you on

Re: persistent deque (continued)

2008-07-21 Thread Raymond Hettinger
On Jul 21, 12:08 pm, castironpi <[EMAIL PROTECTED]> wrote: > Some time ago, I was asking about the feasibility of a persistent > deque, a double-ended queue. > > It runs into the typical space allocation problems.   Try starting with a dict-based implementation of a double-ended queue ( http://asp

Re: Converting List of String to Integer

2008-07-21 Thread Andrew Freeman
Samir wrote: On Jul 21, 3:20 pm, Gary Herron <[EMAIL PROTECTED]> wrote: Samir wrote: Hi Everyone, I am relatively new to Python so please forgive me for what seems like a basic question. Assume that I have a list, a, composed of nested lists with string representations o

Re: Python Written in C?

2008-07-21 Thread Terry Reedy
mk wrote: Seriously, though, would there be any advantage in re-implementing Python in e.g. C++? Considered and rejected by Guido and the CPython developer crew. Anyone who wants C++Python is free to make one, just as people have done JavePython (Jython), C#Python, (IonPython), PythonPython

Re: Importing different versions of a module

2008-07-21 Thread Fredrik Lundh
mercado mercado wrote: I have two versions of a script on my machine. One version is for new development and the other version is a production version. This script imports a module from a different directory, and this module again has two versions (a development version and a production versi

Re: persistent deque (continued)

2008-07-21 Thread M.-A. Lemburg
On 2008-07-21 21:08, castironpi wrote: Some time ago, I was asking about the feasibility of a persistent deque, a double-ended queue. You might want to have a look at mxBeeBase: http://www.egenix.com/products/python/mxBase/mxBeeBase/ Using the integer index you could probably write an on-disk

Re: Change PC to Win or Windows

2008-07-21 Thread Lie
On Mon, 2008-07-21 at 16:45 -0400, Derek Martin wrote: > On Mon, Jul 21, 2008 at 12:32:00PM -0700, Lie wrote: > > > The term "PC" is commonly used in English, in the United States > > > and other English speaking countries, to mean a computer running > > > Microsoft Windows. > > > > As far as I am

Re: Python Written in C?

2008-07-21 Thread Terry Reedy
Fredrik Lundh wrote: rynt wrote: You're either --- A. A Troll B. A young, immature programmer trying to show off or C. A total idiot. you forgot the "All of the above" choice. Or Aspiring Comic. This is certain one of the more entertaining troll posts we have had ;-). -- http://mai

Re: Getting the name of a variable which was used as a function parameter.

2008-07-21 Thread Fredrik Lundh
Ravi Kotecha wrote: Of course I wouldn't, it is a total hack, mostly useless but fun. I tried to do it after someone in #python efnet said it was impossible! your function only finds *some* name (if it finds a name at all), not *the* name, so you haven't really proven that someone wrong yet.

Re: Trying to solve a python/mechanize "error 500" http error

2008-07-21 Thread Larry Bates
bruce wrote: i'm getting the following error: mechanize._response.httperror_seek_wrapper: HTTP Error 500: i'm running python 5.1 and mechanize 0.1.7b I have no idea as to what I have to change/modify/include to handle this issue. The link that I'm testing is at the bottom of the page. W

Re: Importing different versions of a module

2008-07-21 Thread norseman
mercado mercado wrote: Thanks norseman for the reply. You're right that I didn't like it though. :-) Also note that my original question has to do with importing modules from different locations. If all I had to do was use different paths within the script (e.g. for sending to os.path.join o

Re: imported module no longer available

2008-07-21 Thread Fredrik Lundh
Jeff Dyke wrote: actually no, the only things in that fucntion were. print globals().keys() - i see it here print mymodulename - it fails here. the `import mymodulename` statement is at the very top of the file. plus the processing that was attempted after. so how did that proc

Re: Getting the name of a variable which was used as a function parameter.

2008-07-21 Thread Ravi Kotecha
Of course I wouldn't, it is a total hack, mostly useless but fun. I tried to do it after someone in #python efnet said it was impossible! On Jul 21, 9:56 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Mon, 21 Jul 2008 09:01:10 -0700, Ravi Kotecha wrote: > > I thought this was pretty

RE: Python Written in C?

2008-07-21 Thread Phil Runciman
On 20 jul, 19:50, [EMAIL PROTECTED] wrote: > I'm just learning about Python now and it sounds interesting. But I > just read (on the Wiki page) that mainstream Python was written in C. > That's what I was searching for: Python was written in what other > language? > > See, my concern was somethi

Re: Python Written in C?

2008-07-21 Thread Marc 'BlackJack' Rintsch
On Mon, 21 Jul 2008 11:26:27 -0700, castironpi wrote: > On Jul 20, 11:59 pm, Michael Torrie <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >> > I'm not dissing Python, here. Just noting that, if it is written in C, >> > that throws a curve at me in trying to balance the value of learning >

Re: Getting the name of a variable which was used as a function parameter.

2008-07-21 Thread Marc 'BlackJack' Rintsch
On Mon, 21 Jul 2008 09:01:10 -0700, Ravi Kotecha wrote: > I thought this was pretty cool and since I spent 30 mins or so > goggling before giving up and figuring out myself I thought I'd share > it with you. > def a(a): > ... for k,v in sys._getframe(1).f_locals.items(): > ... if

Re: Seriously, though, about LLVM

2008-07-21 Thread Fredrik Lundh
mk wrote: This project has gained some publicity. There's IronPython, right, so has anybody thought about implementing Python using LLVM as backend, as it seems not out of question at all? you mean like: http://llvm.org/ProjectsWithLLVM/#pypy ? No, I don't mean "Python written in Pyth

Re: Converting List of String to Integer

2008-07-21 Thread Samir
On Jul 21, 4:44 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > Samir wrote: > > On Jul 21, 3:20 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > > >> Samir wrote: > > >>> Hi Everyone, > > >>> I am relatively new to Python so please forgive me for what seems like > >>> a basic question. > > >>> Assume tha

Re: Change PC to Win or Windows

2008-07-21 Thread Derek Martin
On Mon, Jul 21, 2008 at 12:32:00PM -0700, Lie wrote: > > The term "PC" is commonly used in English, in the United States > > and other English speaking countries, to mean a computer running > > Microsoft Windows. > > As far as I am aware, they're like that because most people aren't > even aware t

Re: Converting List of String to Integer

2008-07-21 Thread Gary Herron
Samir wrote: On Jul 21, 3:20 pm, Gary Herron <[EMAIL PROTECTED]> wrote: Samir wrote: Hi Everyone, I am relatively new to Python so please forgive me for what seems like a basic question. Assume that I have a list, a, composed of nested lists with string representations o

Re: sending input to an embedded application

2008-07-21 Thread norseman
Matthew Fitzgibbons wrote: mefyl wrote: Uwe Schmitt wrote: On 12 Jul., 09:08, George Oliver <[EMAIL PROTECTED]> wrote: What I would like to do is take a program and embed it or put it within a Python-run GUI, using the GUI just to capture and send input to the application, and display the ou

Re: Missing sqlite3.h Error when Building Debug Python -- Windows Vista

2008-07-21 Thread Bev in TX
Thanks for letting me know about this. I installed Subversion and tried to make the build work like that, but it fails. 1) I am building 64-bit on Vista, so I used build-amd64.bat instead of build.bat. 2) build-amd64.bat was setup to use MSVS 9.0, while I am using MSVS 8.0. Also, some of the BA

Re: Converting List of String to Integer

2008-07-21 Thread John Machin
On Jul 22, 6:11 am, Samir <[EMAIL PROTECTED]> wrote: [snip] > For some reason, the logic I posted seems to work ok while I'm using > the Python shell, but when used in my code, the program just hangs. > It never outputs the results. Below is the code in its entirety. Is > there a problem with my

Trying to solve a python/mechanize "error 500" http error

2008-07-21 Thread bruce
i'm getting the following error: mechanize._response.httperror_seek_wrapper: HTTP Error 500: i'm running python 5.1 and mechanize 0.1.7b I have no idea as to what I have to change/modify/include to handle this issue. The link that I'm testing is at the bottom of the page. When I insert th

Trying to solve a python/mechanize "error 500" http error

2008-07-21 Thread bruce
i'm getting the following error: mechanize._response.httperror_seek_wrapper: HTTP Error 500: i'm running python 5.1 and mechanize 0.1.7b I have no idea as to what I have to change/modify/include to handle this issue. The link that I'm testing is at the bottom of the page. When I insert th

Re: Converting List of String to Integer

2008-07-21 Thread Samir
On Jul 21, 3:20 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > Samir wrote: > > Hi Everyone, > > > I am relatively new to Python so please forgive me for what seems like > > a basic question. > > > Assume that I have a list, a, composed of nested lists with string > > representations of integers, suc

Re: persistent deque (continued)

2008-07-21 Thread Larry Bates
castironpi wrote: Some time ago, I was asking about the feasibility of a persistent deque, a double-ended queue. It runs into the typical space allocation problems. If you're storing a pickle, you have to allocate and fragment the file you've opened, since pickles can be variable-length strings

Re: scanf in python

2008-07-21 Thread AMD
I'm pretty certain python won't grow an additional operator for this. Yet you are free to create a scanf-implementation as 3rd-party-module. IMHO the usability of the approach is very limited though. First of all, the need to capture more than one input token is *very* seldom - nearly all co

Re: Python Written in C?

2008-07-21 Thread Johannes Bauer
Mensanator schrieb: You want cool? THIS is cool: j = ((invert(xyz[1]-xyz[0],xyz[1]**(k-1))*(xyz[1]**(k-1)-prev_gen[2])) % xyz[1]**(k-1))/xyz[1]**(k-2) You call it cool, I call it NameError: name 'invert' is not defined. Regards, Johannes -- "Wer etwas kritisiert muss es noch lange nicht sel

Re: Change PC to Win or Windows

2008-07-21 Thread Lie
> It very much IS the point. Language evolves based on common usage > patterns of the people who use it. That is inarguably correct. > The term "PC" is commonly used in English, in the United States > and other English speaking countries, to mean a computer running > Microsoft Windows. As far

Re: Converting List of String to Integer

2008-07-21 Thread Gary Herron
Samir wrote: Hi Everyone, I am relatively new to Python so please forgive me for what seems like a basic question. Assume that I have a list, a, composed of nested lists with string representations of integers, such that a = [['1', '2'], ['3'], ['4', '5', '6'], ['7', '8', '9', '0']] I would l

Re: Python Written in C?

2008-07-21 Thread Luis M . González
Let's say you want to build a house... You can use pre-built bricks and stack them together to build your walls, or you can cook your own bricks out of clay because hey! clay is the real thing not those ready-made bricks that anyone can use! In the end, you'll have a truly original house but yo

persistent deque (continued)

2008-07-21 Thread castironpi
Some time ago, I was asking about the feasibility of a persistent deque, a double-ended queue. It runs into the typical space allocation problems. If you're storing a pickle, you have to allocate and fragment the file you've opened, since pickles can be variable-length strings; i.e. if the new da

Converting List of String to Integer

2008-07-21 Thread Samir
Hi Everyone, I am relatively new to Python so please forgive me for what seems like a basic question. Assume that I have a list, a, composed of nested lists with string representations of integers, such that a = [['1', '2'], ['3'], ['4', '5', '6'], ['7', '8', '9', '0']] I would like to convert

Re: scanf in python

2008-07-21 Thread Diez B. Roggisch
AMD schrieb: Hello, I often need to parse strings which contain a mix of characters, integers and floats, the C-language scanf function is very practical for this purpose. I've been looking for such a feature and I have been quite surprised to find that it has been discussed as far back as 20

Re: interpreter vs. compiled

2008-07-21 Thread castironpi
On Jul 18, 2:13 pm, Dan <[EMAIL PROTECTED]> wrote: > On Jul 18, 2:17 pm, castironpi <[EMAIL PROTECTED]> wrote: > > > > > On Jul 17, 11:39 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > > > On 18 Jul., 01:15, castironpi <[EMAIL PROTECTED]> wrote: > > > > > On Jul 17, 5:37 pm, I V <[EMAIL PROTECTED]

Re: Python Written in C?

2008-07-21 Thread castironpi
On Jul 20, 11:59 pm, Michael Torrie <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I'm not dissing Python, here. Just noting that, if it is written in C, > > that throws a curve at me in trying to balance the value of learning > > Python vs. some other major language. > > Definitely one

Re: automating python programs

2008-07-21 Thread Dan Upton
On Mon, Jul 21, 2008 at 2:12 PM, Zach Hobesh <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to figure out how to run a python program on a schedule, maybe > every half an hour... Is this possible? > > Thanks! > > -Zach > > -- > http://mail.python.org/mailman/listinfo/python-list > On Linux, man

RE: automating python programs

2008-07-21 Thread Ahmed, Shakir
Windows scheduler is one of the option. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Zach Hobesh Sent: Monday, July 21, 2008 2:13 PM To: python-list@python.org Subject: automating python programs Hi, I'm trying to figure out h

Re: calling source command within python

2008-07-21 Thread arsyed
On Mon, Jul 21, 2008 at 1:59 PM, mk <[EMAIL PROTECTED]> wrote: > Jie wrote: > >> Hi all, >> >> i'm having trouble executing os.system('source .bashrc') command >> within python, it always says that source not found and stuff. Any >> clue? >> > > It _might_ be that the shell it fires up is /bin/sh

automating python programs

2008-07-21 Thread Zach Hobesh
Hi, I'm trying to figure out how to run a python program on a schedule, maybe every half an hour... Is this possible? Thanks! -Zach -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Written in C?

2008-07-21 Thread Dan Upton
On Mon, Jul 21, 2008 at 1:21 PM, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Mon, 21 Jul 2008 18:12:54 +0200, mk wrote: > >> Seriously, though, would there be any advantage in re-implementing >> Python in e.g. C++? >> >> Not that current implementation is bad, anything but, but if you'

Re: Almost keywords

2008-07-21 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > A possible way to avoid such bugs is to turn all those names like > "list", "map", "filter", "self", etc into keywords. But this may have > some disadvantages (well, I think I'd like to have "self" as keyword, > seen how all Python books strong suggest to not use a name

Re: calling source command within python

2008-07-21 Thread mk
Jie wrote: Hi all, i'm having trouble executing os.system('source .bashrc') command within python, it always says that source not found and stuff. Any clue? It _might_ be that the shell it fires up is /bin/sh and this in turn is not bash. Anyway, it's better to use subprocess / Popen for th

Re: Error importing modules with mod_python

2008-07-21 Thread Diez B. Roggisch
Aaron Scott wrote: > I've installed mod_python, and everything seems to be working, but it > fails when I try to import another file into the file that's actually > producing the output. I have these lines at the top of index.py: > > from mod_python import apache > from storylab import * > > ...

Re: Seriously, though, about LLVM

2008-07-21 Thread mk
Fredrik Lundh wrote: mk wrote: This project has gained some publicity. There's IronPython, right, so has anybody thought about implementing Python using LLVM as backend, as it seems not out of question at all? you mean like: http://llvm.org/ProjectsWithLLVM/#pypy ? No, I don't mean "

Error importing modules with mod_python

2008-07-21 Thread Aaron Scott
I've installed mod_python, and everything seems to be working, but it fails when I try to import another file into the file that's actually producing the output. I have these lines at the top of index.py: from mod_python import apache from storylab import * ... and in the directory where index.py

Re: Python Written in C?

2008-07-21 Thread Marc 'BlackJack' Rintsch
On Mon, 21 Jul 2008 18:12:54 +0200, mk wrote: > Seriously, though, would there be any advantage in re-implementing > Python in e.g. C++? > > Not that current implementation is bad, anything but, but if you're not > careful, the fact that lists are implemented as C arrays can bite your > rear f

Re: Python Written in C?

2008-07-21 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Erik Max Francis <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > I'm just learning about Python now and it sounds interesting. But I > > just read (on the Wiki page) that mainstream Python was written in C. > > That's what I was searching for: Python w

Re: Python Written in C?

2008-07-21 Thread Marc 'BlackJack' Rintsch
On Mon, 21 Jul 2008 17:06:03 +0100, Tim Golden wrote: > mk wrote: > >> Wrong! Real programmers can program using only Touring machine > > Is that some kind of bicycle? Maybe it's a Turing machine after Bicycle Repair Man got his hands on it!? Ciao, Marc 'BlackJack' Rintsch -- http://mai

Re: how to create GUI dynamically

2008-07-21 Thread Peter Wang
On Jul 21, 8:19 am, [EMAIL PROTECTED] wrote: > Hi; > > i m working on a project where i need  run time creation of GUI. > > i have some no. of entities for which i want checkboxes in front of > them which can be checked/ unchecked by user. > > But the problem is that the number and name of entities

Re: how to create GUI dynamically

2008-07-21 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hi; i m working on a project where i need run time creation of GUI. i have some no. of entities for which i want checkboxes in front of them which can be checked/ unchecked by user. But the problem is that the number and name of entities is not fixed and it depends on

Re: Please recommend a RPC system working with twisted.

2008-07-21 Thread Larry Bates
??? wrote: Hi all, I'm looking for an RPC system working with twisted. 1. Binary. I want it run faster than any xml based RPC. 2. Bidirectional. Unlike HTTP, on which the client has to poll the sever for events, the server should "call" the client's method to notify events. 3. C/Python sup

scanf in python

2008-07-21 Thread AMD
Hello, I often need to parse strings which contain a mix of characters, integers and floats, the C-language scanf function is very practical for this purpose. I've been looking for such a feature and I have been quite surprised to find that it has been discussed as far back as 2001 but never

Re: Change PC to Win or Windows

2008-07-21 Thread Derek Martin
On Sat, Jul 19, 2008 at 02:56:07AM -0700, Lie wrote: > government, etc. IBM PC is one of the first computers that ordinary > people could possess, when IBM-clones appeared on the market, they're > referred as PCs too because they are Personal Computer, a computer > that is designed for personal use

Re: Run as Service

2008-07-21 Thread Larry Bates
[EMAIL PROTECTED] wrote: I have, in the past, used SRVANY to run a Python app as a Windows service. However, now I am interested in distributing my scripts and want to make it as painless for the end user as possible (hands-off is best :). How can you go about running a Python app as a Windows

  1   2   >