Re: makepy.py not working

2008-04-08 Thread Gabriel Genellina
En Tue, 08 Apr 2008 10:18:48 -0300, <[EMAIL PROTECTED]> escribió: > I've a problem getting makepy running. When I start the tool on my > machine with doubleclick everything is fine. > But when I try this in my Code: > > makepy.py -i "Microsoft Excel 11.0 Object Library(1.5)" The above is supposed

Re: text adventure game problem

2008-04-08 Thread Carl Banks
On Apr 9, 1:24 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 8 Apr 2008 18:01:01 -0700 (PDT), [EMAIL PROTECTED] > declaimed the following in comp.lang.python: > > > okay, I'm having this one problem with a text adventure game. It's > > kind of hard to explain, but I'll do my best. > >

Re: Cannot understand the detailedly the following code

2008-04-08 Thread Gabriel Genellina
En Tue, 08 Apr 2008 09:45:35 -0300, A.T.Hofkamp <[EMAIL PROTECTED]> escribió: > On 2008-04-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > [deleted a long piece of text by our BDFL about recursive graph > path-finding algorithm] > >> after first writing the inductive part ... for node in

Can C.L.P.handle the load?

2008-04-08 Thread Paddy
On Apr 8, 7:51 pm, Berco Beute <[EMAIL PROTECTED]> wrote: > It's wonderful news for Python. It will definitely be a boost for > Python's (and Django's) popularity. Python finally seems to be on > every developers mind at the moment. Looks like it's showtime for > Python! I'm waiting for the rush o

Re: Setting default version among multiple python installations

2008-04-08 Thread Karthik
Gabriel Genellina wrote: En Tue, 08 Apr 2008 06:48:54 -0300, Karthik <[EMAIL PROTECTED]> escribió: I am an absolute linux and python newbie. The linux machine(red hat version 7.2) that i managed to get my hands on had python 1.5(vintage stuff, i guess) in it. I have installed python 2.5 us

pprint module and newer standard types

2008-04-08 Thread Paddy
Hi, When I try and use pprint on standard types I get varying 'quality of output'. Lists will wrap nicely to multiple lines as will dicts, but sets and defaultdicts give one long unreadable line. Is their a chance to get this changed so that more built-in types look pretty when printed with pprin

Re: Setting default version among multiple python installations

2008-04-08 Thread Gabriel Genellina
En Tue, 08 Apr 2008 06:48:54 -0300, Karthik <[EMAIL PROTECTED]> escribió: > I am an absolute linux and python newbie. The linux machine(red hat > version 7.2) that i managed to get my hands on had python 1.5(vintage > stuff, i guess) in it. I have installed python 2.5 using the source tar. > How

Re: PROBLEMS WITH PYTHON IN SOME VARIABLE,FUNCTIONS,ETC.

2008-04-08 Thread Gabriel Genellina
2008/4/8, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: >> I am using Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v. >> 1310 32 bit (Intel)] on win32 with IDLE 1.2.1 >> My O/S is Windows XP SP2 I use 512 MB RAM. En Tue, 08 Apr 2008 06:02:00 -0300, Vladimir Kropylev <[EMAIL PROTECTED]> escri

Can't figure out traceback: (error_proto(-ERR EOF) line 121 poplib.py

2008-04-08 Thread erikcw
Hi, I keep getting this error from poplib: (error_proto(-ERR EOF) line 121 poplib.py Does this mean the connection has timed out? What can I do to deal with it? Thanks! Erik -- http://mail.python.org/mailman/listinfo/python-list

Re: String Literal to Blob

2008-04-08 Thread Gabriel Genellina
En Tue, 08 Apr 2008 13:55:07 -0300, Victor Subervi <[EMAIL PROTECTED]> escribió: > Thanks. I apparently am printing some holder for the image. I stripped > out > most of it with this > content[0][0] Yes, because of this: content = cursor.fetchall() fetchall returns a list of rows, each row

Re: Sorting a List of Objects by an Attribute of the Objects Case-Insensitively

2008-04-08 Thread Paddy
On Apr 9, 4:04 am, Jason <[EMAIL PROTECTED]> wrote: > Hi folks-- > > Basically, I have a pressing need for a combination of 5.2 "Sorting a > List of Strings Case-Insensitively" & 5.3 "Sorting a List of Objects > by an Attribute of the Objects" from the Python Cookbook. > > My first guess isn't work

Re: __init__.py file

2008-04-08 Thread Gabriel Genellina
En Tue, 08 Apr 2008 17:51:21 -0300, cesco <[EMAIL PROTECTED]> escribió: > I need to instantiate an object (my_object) whose methods I have to > use in two files (file1.py and file2.py) which are in the same > directory. Is it possible to instantiate such object in the > __init__.py file and then

Re: style question - hasattr

2008-04-08 Thread Miles
On Tue, Apr 8, 2008 at 10:21 PM, ian <[EMAIL PROTECTED]> wrote: > Ok, so what about 'hasattr' ?? > hasattr(myObject,'property') > seems equivalent to > 'property' in dir(myObject) > > I would suggest that using the 'in' is cleaner in this case also. Is > there a performance penalty her

Re: Converting a tuple to a list

2008-04-08 Thread David Harrison
On 09/04/2008, Gabriel Ibanez <[EMAIL PROTECTED]> wrote: > Hi all .. > > I'm trying to using the map function to convert a tuple to a list, without > success. > > I would like to have a lonely line that performs the same as loop of the > next script: > > ---

Re: Converting a tuple to a list

2008-04-08 Thread CM
On Apr 8, 6:46 pm, "Gabriel Ibanez" <[EMAIL PROTECTED]> wrote: > Gabriel Ibanez wrote: > > Hi all .. > > > I'm trying to using the map function to convert a tuple to a list, without > > success. > > > I would like to have a lonely line that performs the same as loop of the > > next script: > > > --

Re: text adventure game problem

2008-04-08 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | In the above function, there's the option to examine a cabinet and get | 8 gold. (everyone here knows that...but I'm just trying to state my | problem...) | Unfortunately, it kind of doesn't work. | After the first time I 'examine cabi

Re: style question - hasattr

2008-04-08 Thread Terry Reedy
"ian" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | In old python code i would use 'has_key' to determine if an element | was present in a dictionary. | | Python 3.0 will even removed 'has_key'. The reason for removal is that | using the 'in' operator is a cleaner syntax and havin

gen_py target directory for makepy

2008-04-08 Thread Alan Meyer
I had an unusual problem tonight running makepy to install some Microsoft COM interfaces in a Python 2.5 Windows XP installation created using the ActiveState installer. In earlier versions of Python, the files were generated to: \PythonXX\Lib\site-packages\win32com\gen_py But in my 2.5 insta

Re: Sorting a List of Objects by an Attribute of the Objects Case-Insensitively

2008-04-08 Thread Jason
On Apr 8, 8:26 pm, "David Harrison" <[EMAIL PROTECTED]> wrote: > On 09/04/2008, Jason <[EMAIL PROTECTED]> wrote: > > > Hi folks-- > > > Basically, I have a pressing need for a combination of 5.2 "Sorting a > > List of Strings Case-Insensitively" & 5.3 "Sorting a List of Objects > > by an Attribu

Re: Sorting a List of Objects by an Attribute of the Objects Case-Insensitively

2008-04-08 Thread David Harrison
On 09/04/2008, Jason <[EMAIL PROTECTED]> wrote: > Hi folks-- > > Basically, I have a pressing need for a combination of 5.2 "Sorting a > List of Strings Case-Insensitively" & 5.3 "Sorting a List of Objects > by an Attribute of the Objects" from the Python Cookbook. > > My first guess isn't work

Re: Google App Engine

2008-04-08 Thread Jason Scheirer
On Apr 8, 7:50 pm, John Nagle <[EMAIL PROTECTED]> wrote: > Duncan Booth wrote: > > Google have announced a new service called 'Google App Engine' which may > > be of interest to some of the people here > > OK, now we need a compatibility layer so you can move apps from > Google App Engine to yo

RE: Google App Engine

2008-04-08 Thread Trent Nelson
> But people will always prefer complaining on the grounds of > insufficient information to keeping quiet on the basis of knowledge. +1 QOTW! -- http://mail.python.org/mailman/listinfo/python-list

Sorting a List of Objects by an Attribute of the Objects Case-Insensitively

2008-04-08 Thread Jason
Hi folks-- Basically, I have a pressing need for a combination of 5.2 "Sorting a List of Strings Case-Insensitively" & 5.3 "Sorting a List of Objects by an Attribute of the Objects" from the Python Cookbook. My first guess isn't working: import operator def sort_by_attr(seq, attr): key=oper

Re: Google App Engine

2008-04-08 Thread John Nagle
Duncan Booth wrote: > Google have announced a new service called 'Google App Engine' which may > be of interest to some of the people here OK, now we need a compatibility layer so you can move apps from Google App Engine to your own servers. You don't want to be locked into a single vendor

Re: import statement convention

2008-04-08 Thread Steve Holden
Ben Finney wrote: > [EMAIL PROTECTED] writes: > >> By convention, I've read, your module begins with its import >> statements. Is this always sensible? > > There are exceptions, but the benefits are great: It's very easy to > see what this module requires, without needing to execute it. > >> I p

python-com and vista

2008-04-08 Thread sniffer
hi all, the problem i am facing is as follows:- i have created a com component in python this registers and works fine on winxp and stuff but on vista i need to turn off user account control to get the component registered and every time i need to use the component i again have to turn it UAC off

style question - hasattr

2008-04-08 Thread ian
In old python code i would use 'has_key' to determine if an element was present in a dictionary. Python 3.0 will even removed 'has_key'. The reason for removal is that using the 'in' operator is a cleaner syntax and having two ways to achieve the same result is against the principle of the languag

Re: new user needs help!

2008-04-08 Thread Steve Holden
drjekil (or should that be mrhyde?): Once again, *please* make sure you reply to the list. Personal replies are much less likely to get attention. regards Steve drjekil sayer wrote: > u got it! > thats what i am trying to explain with my bad english! > thanks once again. > > > On 4/9/08, *S

Re: new user needs help!

2008-04-08 Thread drjekil
u got it! thats the thing i am trying to explain by my bad english! thanks for the help. -- View this message in context: http://www.nabble.com/new--user-needs-help%21-tp16571823p16578029.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mai

Re: text adventure game problem

2008-04-08 Thread corvettecraz92
On Apr 8, 9:55 pm, André <[EMAIL PROTECTED]> wrote: > On Apr 8, 10:44 pm, [EMAIL PROTECTED] wrote: > > > > > On Apr 8, 9:25 pm, André <[EMAIL PROTECTED]> wrote: > > > > On Apr 8, 10:01 pm, [EMAIL PROTECTED] wrote: > > > > > okay, I'm having this one problem with a text adventure game. It's > > > >

Re: text adventure game problem

2008-04-08 Thread André
On Apr 8, 10:44 pm, [EMAIL PROTECTED] wrote: > On Apr 8, 9:25 pm, André <[EMAIL PROTECTED]> wrote: > > > > > On Apr 8, 10:01 pm, [EMAIL PROTECTED] wrote: > > > > okay, I'm having this one problem with a text adventure game. It's > > > kind of hard to explain, but I'll do my best. > > > [code] > > >

Re: Python Leopard DLL Hell

2008-04-08 Thread Michael Torrie
Brian Cole wrote: > That appears to be working correctly at first glance. The argument to > dlopen is the correct shared library. Unfortunately, either python or > OS X is lying to me here. If I inspect the python process with OS X's > Activity Monitor and look at the "Open Files and Ports" tab, it

Re: text adventure game problem

2008-04-08 Thread corvettecraz92
On Apr 8, 9:25 pm, André <[EMAIL PROTECTED]> wrote: > On Apr 8, 10:01 pm, [EMAIL PROTECTED] wrote: > > > > > okay, I'm having this one problem with a text adventure game. It's > > kind of hard to explain, but I'll do my best. > > [code] > > > def prompt_kitchen(): > >     global gold > >     gold_t

Re: text adventure game problem

2008-04-08 Thread André
On Apr 8, 10:25 pm, André <[EMAIL PROTECTED]> wrote: > On Apr 8, 10:01 pm, [EMAIL PROTECTED] wrote: > > > > > okay, I'm having this one problem with a text adventure game. It's > > kind of hard to explain, but I'll do my best. > > [code] > > > def prompt_kitchen(): > >     global gold > >     gold_

Re: text adventure game problem

2008-04-08 Thread André
On Apr 8, 10:01 pm, [EMAIL PROTECTED] wrote: > okay, I'm having this one problem with a text adventure game. It's > kind of hard to explain, but I'll do my best. > [code] > > def prompt_kitchen(): >     global gold >     gold_taken = False >     while True: >         prompt_kit = raw_input('>') >  

Re: text adventure game problem

2008-04-08 Thread Dan Bishop
On Apr 8, 8:01 pm, [EMAIL PROTECTED] wrote: > okay, I'm having this one problem with a text adventure game. It's > kind of hard to explain, but I'll do my best. > [code] > > def prompt_kitchen(): > global gold > gold_taken = False > while True: > prompt_kit = raw_input('>') >

Re: import statement convention

2008-04-08 Thread Ben Finney
[EMAIL PROTECTED] writes: > By convention, I've read, your module begins with its import > statements. Is this always sensible? There are exceptions, but the benefits are great: It's very easy to see what this module requires, without needing to execute it. > I put imports that are needed for te

Python Leopard DLL Hell

2008-04-08 Thread Brian Cole
Hello All, I'm running into a strange problem on Leopard with how Python loads shared libraries. I'll give you a background of what we are trying to accomplish before describing the problem. I am not certain whether this is an OS X problem, or a Python problem, though it appears with the combinati

text adventure game problem

2008-04-08 Thread corvettecraz92
okay, I'm having this one problem with a text adventure game. It's kind of hard to explain, but I'll do my best. [code] def prompt_kitchen(): global gold gold_taken = False while True: prompt_kit = raw_input('>') if prompt_kit == 'examine cabinet 1' and not gold_taken:

problem using import from PyRun_String

2008-04-08 Thread Patrick Stinson
I'm creating a module with PyModule_New(), and running a string buffer as the module's text using PyRun_String and passing the module's __dict__ to locals and globals. I'm having a problem using the import statement from within PyRun_String(). It complains about "__import__ not found", which after

Re: new user needs help!

2008-04-08 Thread Steve Holden
[EMAIL PROTECTED] wrote: > thanks! Please keep all replies on the list: somebody else may also wish to help (and they will also pick up mistakes I make ;-) > I am working with a text filelooks like this: > #NAME AA TOPO ACCESS DSSP STRIDE Z-COORD > 1lghB A i 79.8 H H -24.58 > 1lghB V i 79.6 H H

Re: calling variable function name ?

2008-04-08 Thread George Sakkis
On Apr 8, 3:52 pm, TkNeo <[EMAIL PROTECTED]> wrote: > I don't know the exact terminology in python, but this is something i > am trying to do > > i have 3 functions lets say > FA(param1,param2) > FB(param1,param2) > FC(param1,param2) > > temp = "B" #something entered by user. now i want to call FB.

How would I go about checking if urllib2 timed out?

2008-04-08 Thread Lamonte Harris
Can someone explain to me how I would do error handling to check if the current proxy timed out on when trying to connect to the web page: import urllib2 proxy=urllib2.ProxyHandler({'http':'24.232.167.22:80'}) opener=urllib2.build_opener(proxy) f=opener.open('http://www.whatismyipaddress.com'

Re: Converting a tuple to a list

2008-04-08 Thread Shane Geiger
from goopy.functional import * tupla = ((1,2), (3,4), (5,6)) print flatten(tupla) Gabriel Ibanez wrote: > Hi all .. > > I'm trying to using the map function to convert a tuple to a list, without > success. > > I would like to have a lonely line that performs the same as loop of the > next s

Ctypes and C Infinite Callback Loops

2008-04-08 Thread Thomas Dimson
Hello, I have quite a complex issue that is arising with regards to using ctypes to hook into some legacy code. The legacy code is in infinite loop - I can not touch this. It does some listening, and periodically calls a specific callback function. What I would like to be able to do is spawn a Py

Re: Converting a tuple to a list

2008-04-08 Thread John Krukoff
On Wed, 2008-04-09 at 00:46 +0200, Gabriel Ibanez wrote: > Gabriel Ibanez wrote: > > Hi all .. > > > > I'm trying to using the map function to convert a tuple to a list, without > > success. > > > > I would like to have a lonely line that performs the same as loop of the > > next script: > > > > -

Re: Converting a tuple to a list

2008-04-08 Thread Brian
On Tue, Apr 8, 2008 at 6:36 PM, Brian <[EMAIL PROTECTED]> wrote: > > > On Tue, Apr 8, 2008 at 6:22 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > > > Gabriel Ibanez wrote: > > > Hi all .. > > > > > > I'm trying to using the map function to convert a tuple to a list, > > without > > > success. > > >

Re: Converting a tuple to a list

2008-04-08 Thread Gabriel Ibanez
Gabriel Ibanez wrote: > Hi all .. > > I'm trying to using the map function to convert a tuple to a list, without > success. > > I would like to have a lonely line that performs the same as loop of the > next script: > > --- > # Conveting tuple -> list > > tup

Re: Converting a tuple to a list

2008-04-08 Thread Brian
On Tue, Apr 8, 2008 at 6:22 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Gabriel Ibanez wrote: > > Hi all .. > > > > I'm trying to using the map function to convert a tuple to a list, > without > > success. > > > > I would like to have a lonely line that performs the same as loop of the > > next

Re: Data structure recommendation?

2008-04-08 Thread bearophileHUGS
More bits from your code: neighbours = list() ==> neighbours = [] If you have a recent enough version of Python you can use: candidate_is_neighbour = any(distance < n[1] for n in neighbours) Instead of: candidate_is_neighbour = bool([1 for n in neighbours if distance < n[1]]) It's shorter & simp

Re: Converting a tuple to a list

2008-04-08 Thread Steve Holden
Gabriel Ibanez wrote: > Hi all .. > > I'm trying to using the map function to convert a tuple to a list, without > success. > > I would like to have a lonely line that performs the same as loop of the > next script: > > --- > # Conveting tuple -> list >

Re: makepy.py not working

2008-04-08 Thread Konstantin Veretennicov
On Tue, Apr 8, 2008 at 4:18 PM, <[EMAIL PROTECTED]> wrote: > Hallo, > > I've a problem getting makepy running. When I start the tool on my > machine with doubleclick everything is fine. > But when I try this in my Code: > > makepy.py -i "Microsoft Excel 11.0 Object Library(1.5)" This syntax i

Re: Data structure recommendation?

2008-04-08 Thread bearophileHUGS
Few more notes on the code: You may use the @property in such situations (or you may just use attributes, dropping the property). Note that Python doesn't inline functions calls like Java HotSpot does quite often. def __children(self): raise NotImplementedError() children = propert

Converting a tuple to a list

2008-04-08 Thread Gabriel Ibanez
Hi all .. I'm trying to using the map function to convert a tuple to a list, without success. I would like to have a lonely line that performs the same as loop of the next script: --- # Conveting tuple -> list tupla = ((1,2), (3,4), (5,6)) print tupla

Re: Python 3.0 new integer division

2008-04-08 Thread Jonathan Gardner
On Apr 8, 2:25 pm, Grzegorz Słodkowicz <[EMAIL PROTECTED]> wrote: > > Isn't Decimal a BCD implementation? Yep, you are right and I am wrong. http://www.python.org/dev/peps/pep-0327/#why-not-rational -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to check if string is an integer?

2008-04-08 Thread Steve Holden
Martin Marcher wrote: > hmmm > > int() does miss some stuff: > 1E+1 > 10.0 int("1E+1") > Traceback (most recent call last): > File "", line 1, in > ValueError: invalid literal for int() with base 10: '1E+1' > > I wonder how you parse this? > > I honestly thought until right now int

Re: CPython VM & byte code resources wanted

2008-04-08 Thread Steve Holden
Aaron Gray wrote: > "Aaron Gray" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Hi, >> >> I am looking to study the CPython source code, but I cannot seem to find >> the VM code. > > Found it :) > > Python/ceval.c > >> Also is there any where a detailed list of the o

Re: new user needs help!

2008-04-08 Thread Steve Holden
Tim Chase wrote: >> f = open("/tmp/data.txt", 'w') >> >> will open that file. >> >> You can throw the first line away with >> >> headings = f.next() >> >> Then you can loop over the rest with >> >> for name, aa, topo, access, dssp, stride, z in file: >> # >> # Then process each line here

Re: Python 3.0 new integer division

2008-04-08 Thread Grzegorz Słodkowicz
> If you want precision with fractions, you should be using the Decimal > type, which uses a rational. A rational, if you recall from your math > classes, is one integer divided by another. > Isn't Decimal a BCD implementation? -- http://mail.python.org/mailman/listinfo/python-list

Re: Running a python code periodically

2008-04-08 Thread Mike Driscoll
On Apr 8, 3:01 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > paul wrote: > > Maryam Saeedi schrieb: > >> Hi, > > >> I was wondering if you know how can I run a python code once every five > >> minutes for a period of time either using python or some other program > >> like > >> a bash script. > > >

Re: __init__.py file

2008-04-08 Thread Steven W. Orr
On Tuesday, Apr 8th 2008 at 16:51 -, quoth cesco: =>Hi, => =>I need to instantiate an object (my_object) whose methods I have to =>use in two files (file1.py and file2.py) which are in the same =>directory. Is it possible to instantiate such object in the =>__init__.py file and then directly u

Re: CPython VM & byte code resources wanted

2008-04-08 Thread Aaron Gray
>Bytecodes: >http://docs.python.org/lib/bytecodes.html > >VM: >Python/ceval.c Thanks, Aaron -- http://mail.python.org/mailman/listinfo/python-list

Re: Translating keywords

2008-04-08 Thread Lie
On Apr 7, 9:54 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Ronn Ross wrote: > > This is my first post and I'm new to Python. How would someone go about > > adding keywords to Python? It would be great to add support for > > Esperanto keywords in the language instead of English being the only > >

__init__.py file

2008-04-08 Thread cesco
Hi, I need to instantiate an object (my_object) whose methods I have to use in two files (file1.py and file2.py) which are in the same directory. Is it possible to instantiate such object in the __init__.py file and then directly use it in file1.py and file2.py? If not, as I seem to experience, wh

Re: new user needs help!

2008-04-08 Thread Tim Chase
> f = open("/tmp/data.txt", 'w') > > will open that file. > > You can throw the first line away with > > headings = f.next() > > Then you can loop over the rest with > > for name, aa, topo, access, dssp, stride, z in file: > # > # Then process each line here Small caveat here...Ste

RE: Best way to check if string is an integer?

2008-04-08 Thread Stephen Cattaneo
1E+1 is short hand for a floating point number, not an interger. >>> float("1E+1") 10.0 You could convert the float to an integer if you wanted (i.e. ceiling, floor, rounding, truncating, etc.). Cheers, Steve -Original Message- From: Martin Marcher [mailto:[EMAIL PROTECTED] Sent: Tuesd

Re: new user needs help!

2008-04-08 Thread Mike Driscoll
On Apr 8, 3:38 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > drjekil wrote: > > I am totally new in biopython and its my first program.so may be i am asking > > stupid question. > > New? Most questions are sensible. > > Let's suppose that the four lines you give below are stored in a text > file ca

Re: new user needs help!

2008-04-08 Thread Mike Driscoll
On Apr 8, 2:55 pm, drjekil <[EMAIL PROTECTED]> wrote: > I am totally new in biopython and its my first program.so may be i am asking > stupid question. > I am working with a text filelooks like this: > #NAME AA TOPO ACCESS DSSP STRIDE Z-COORD > 1lghB A i 79.8 H H -24.58 > 1lghB V i 79.6 H H -22.06

Re: Coping with cyclic imports

2008-04-08 Thread Jeffrey Froman
Torsten Bronger wrote: > I know that cyclic imports work in Python under certain > circumstances.  Can anyone refer me to a page which explains when > this works? I don't know of a specific URL offhand. Cyclic imports are not a problem by themselves, but cyclic definitions are. Thus: #

Re: CPython VM & byte code resources wanted

2008-04-08 Thread Aaron Gray
"Aaron Gray" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I am looking to study the CPython source code, but I cannot seem to find > the VM code. Found it :) Python/ceval.c > Also is there any where a detailed list of the opcodes ? Still could do with an opco

Re: new user needs help!

2008-04-08 Thread Steve Holden
drjekil wrote: > I am totally new in biopython and its my first program.so may be i am asking > stupid question. New? Most questions are sensible. Let's suppose that the four lines you give below are stored in a text file called "/tmp/data.txt". > I am working with a text filelooks like this: >

RE: Running a python code periodically

2008-04-08 Thread Stephen Cattaneo
If your on a *NIX just use cron. Execute 'crontab -e' edit the file as desired and save see man crontab for formatting. Cheers, Steve From: Maryam Saeedi [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 08, 2008 10:54 AM To: python-list@python.

Re: CPython VM & byte code resources wanted

2008-04-08 Thread Arnaud Delobelle
On Apr 8, 9:29 pm, "Aaron Gray" <[EMAIL PROTECTED]> wrote: > Hi, > > I am looking to study the CPython source code, but I cannot seem to find the > VM code. > Also is there any where a detailed  list of the opcodes ? > > Many thanks in advance, > > Aaron Bytecodes: http://docs.python.org/lib/bytec

Re: Best way to check if string is an integer?

2008-04-08 Thread Martin Marcher
arg, as posted earlier: int("10.0") fails, it will of course work with float("1E+1") sorry for the noise... On Tue, Apr 8, 2008 at 10:32 PM, Martin Marcher <[EMAIL PROTECTED]> wrote: > hmmm > > int() does miss some stuff: > > >>> 1E+1 > 10.0 > >>> int("1E+1") > Traceback (most recent call la

Re: Best way to check if string is an integer?

2008-04-08 Thread Martin Marcher
hmmm int() does miss some stuff: >>> 1E+1 10.0 >>> int("1E+1") Traceback (most recent call last): File "", line 1, in ValueError: invalid literal for int() with base 10: '1E+1' I wonder how you parse this? I honestly thought until right now int() would understand that and wanted to show that

CPython VM & byte code resources wanted

2008-04-08 Thread Aaron Gray
Hi, I am looking to study the CPython source code, but I cannot seem to find the VM code. Also is there any where a detailed list of the opcodes ? Many thanks in advance, Aaron -- http://mail.python.org/mailman/listinfo/python-list

new user needs help!

2008-04-08 Thread drjekil
I am totally new in biopython and its my first program.so may be i am asking stupid question. I am working with a text filelooks like this: #NAME AA TOPO ACCESS DSSP STRIDE Z-COORD 1lghB A i 79.8 H H -24.58 1lghB V i 79.6 H H -22.06 1lghB H i 71.9 H H -19.94 i need to compare those lines which has

new user needs help!

2008-04-08 Thread drjekil
I am totally new in biopython and its my first program.so may be i am asking stupid question. I am working with a text filelooks like this: #NAME AA TOPO ACCESS DSSP STRIDE Z-COORD 1lghB A i 79.8 H H -24.58 1lghB V i 79.6 H H -22.06 1lghB H i 71.9 H H -19.94 i need to compare those lines which has

Coping with cyclic imports

2008-04-08 Thread Torsten Bronger
Hallöchen! I have a rather fat module that represents a document parser -- inline elements, block elements, and the like. Now I want to split it into many modules to make everything more manageable. But at the moment I don't see how to avoid cyclic imports: A document element A, which is repres

Re: Running a python code periodically

2008-04-08 Thread Larry Bates
paul wrote: > Maryam Saeedi schrieb: >> Hi, >> >> I was wondering if you know how can I run a python code once every five >> minutes for a period of time either using python or some other program >> like >> a bash script. > > See the sched module in the standard library or here: > http://pypi.pyt

Re: calling variable function name ?

2008-04-08 Thread Arnaud Delobelle
On Apr 8, 8:52 pm, TkNeo <[EMAIL PROTECTED]> wrote: > I don't know the exact terminology in python, but this is something i > am trying to do > > i have 3 functions lets say > FA(param1,param2) > FB(param1,param2) > FC(param1,param2) > > temp = "B" #something entered by user. now i want to call FB.

Re: Reproducing a web page and add own content to it.

2008-04-08 Thread LaundroMat
On Apr 8, 4:11 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > LaundroMat wrote: > > On Apr 8, 2:04 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> LaundroMat wrote: > >>> Hi - > >>> I'm working on a Django powered site where one of the required > >>> functionalities is the possibility of disp

Re: Is the Python for statement the same as for each in other languages?

2008-04-08 Thread [EMAIL PROTECTED]
On 8 avr, 19:55, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > jmDesktop schrieb: > > > Thank you. It looks like it is, but I wanted to make sure I > > understood. Also, I didn't see a "regular" for loop construct either > > (i=0;i<=10;i++), etc. I'm still new at it, but is there one of those?

calling variable function name ?

2008-04-08 Thread TkNeo
I don't know the exact terminology in python, but this is something i am trying to do i have 3 functions lets say FA(param1,param2) FB(param1,param2) FC(param1,param2) temp = "B" #something entered by user. now i want to call FB. I don't want to do an if else because if have way too many methods

Re: Best way to check if string is an integer?

2008-04-08 Thread Tobiah
> byte twiddling if the need arouse. I'm excited already :) ** Posted from http://www.teranews.com ** -- http://mail.python.org/mailman/listinfo/python-list

Re: Running a python code periodically

2008-04-08 Thread paul
Maryam Saeedi schrieb: > Hi, > > I was wondering if you know how can I run a python code once every five > minutes for a period of time either using python or some other program like > a bash script. See the sched module in the standard library or here: http://pypi.python.org/simple/Recur/ cheer

Re: Calling CVF-Fortran-dll with ctypes and simple structure

2008-04-08 Thread Gabriel Genellina
En Tue, 08 Apr 2008 06:02:17 -0300, Michael Schäfer <[EMAIL PROTECTED]> escribió: > Gabriel, > > works perfect - even in complex nested structures! > Thank you very much! > >> (If both Fortran and VB say "char*9", why did you choose a pointer >> here?) > I do not know this possibility. Could y

Re: Google App Engine

2008-04-08 Thread Steve Holden
Duncan Booth wrote: [...] > Yes, it says you can use almost any Python web framework but django is the > preferred one. > > Some of the comments at > http://www.techcrunch.com/2008/04/07/google-jumps-head-first-into-web-services-with-google-app-engine/ > sound kind of upset, e.g.: "Python will b

Re: list.sort(): heaviest item?

2008-04-08 Thread Raymond Hettinger
On Apr 8, 8:15 am, "Steven Clark" <[EMAIL PROTECTED]> wrote: > If I have a list of items of mixed type, can I put something into it > such that after a list.sort(), is guaranteed to be at the end of the > list? Since the other guys gave you the real answer, how about this: sentinel = object() myl

Re: Google App Engine

2008-04-08 Thread Duncan Booth
William Dode <[EMAIL PROTECTED]> wrote: > On 08-04-2008, Duncan Booth wrote: >> Google have announced a new service called 'Google App Engine' which >> may be of interest to some of the people here (although if you want >> to sign up you'll have to join the queue behind me): >> >> From the introdu

Re: set file permission on windows

2008-04-08 Thread Tim Golden
Tim Arnold wrote: > "Mike Driscoll" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> On Apr 8, 12:03 pm, "Tim Arnold" <[EMAIL PROTECTED]> wrote: >>> > >> According to the following thread, you can use os.chmod on Windows: >> >> http://mail.python.org/pipermail/python-list/2003

Re: Running a python code periodically

2008-04-08 Thread Gabriel Ibanez
Hi, On Linux/Unix: $ man at You could create a bash script using this command. Keep in mind that the script must "schedule" itself again. There's other way: using the cron daemon (crond). Its programming depends on the used distro. I hope this helps. Regards .. - Original Message --

Re: set file permission on windows

2008-04-08 Thread Mike Driscoll
On Apr 8, 1:19 pm, "Tim Arnold" <[EMAIL PROTECTED]> wrote: > "Mike Driscoll" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > > > On Apr 8, 12:03 pm, "Tim Arnold" <[EMAIL PROTECTED]> wrote: > >> > > According to the following thread, you can use os.chmod on Windows: > > >ht

Re: Google App Engine

2008-04-08 Thread Berco Beute
It's wonderful news for Python. It will definitely be a boost for Python's (and Django's) popularity. Python finally seems to be on every developers mind at the moment. Looks like it's showtime for Python! -- http://mail.python.org/mailman/listinfo/python-list

Re: set file permission on windows

2008-04-08 Thread Tim Arnold
"Mike Driscoll" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Apr 8, 12:03 pm, "Tim Arnold" <[EMAIL PROTECTED]> wrote: >> > According to the following thread, you can use os.chmod on Windows: > > http://mail.python.org/pipermail/python-list/2003-June/210268.html > > You can

need help to upload file to webserver

2008-04-08 Thread Sells, Fred
I am automating the client side of a simple web interface. I need to upload a file to a webserver that requires authentication. I've got the authentication working with urllib2 (see below), but the only examples I've found to upload files use httplib without authentication. I'm competent with

Re: Is the Python for statement the same as for each in other languages?

2008-04-08 Thread Diez B. Roggisch
jmDesktop schrieb: > Thank you. It looks like it is, but I wanted to make sure I > understood. Also, I didn't see a "regular" for loop construct either > (i=0;i<=10;i++), etc. I'm still new at it, but is there one of those? Yes, it's foreach. And for your usecase, use for i in xrange(11):

Is the Python for statement the same as for each in other languages?

2008-04-08 Thread jmDesktop
Thank you. It looks like it is, but I wanted to make sure I understood. Also, I didn't see a "regular" for loop construct either (i=0;i<=10;i++), etc. I'm still new at it, but is there one of those? -- http://mail.python.org/mailman/listinfo/python-list

Running a python code periodically

2008-04-08 Thread Maryam Saeedi
Hi, I was wondering if you know how can I run a python code once every five minutes for a period of time either using python or some other program like a bash script. Thanks, Maryam -- http://mail.python.org/mailman/listinfo/python-list

Re: set file permission on windows

2008-04-08 Thread Mike Driscoll
On Apr 8, 12:03 pm, "Tim Arnold" <[EMAIL PROTECTED]> wrote: > hi, I need to set file permissions on some directory trees in windows using > Python. > > When I click on properties for a file and select the 'Security' tab, I see a > list of known 'Group or user names' with permissions for each entry

  1   2   >