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:
>
"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
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:
#
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
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
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
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
> >
>Bytecodes:
>http://docs.python.org/lib/bytecodes.html
>
>VM:
>Python/ceval.c
Thanks,
Aaron
--
http://mail.python.org/mailman/listinfo/python-list
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
> 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
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
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.
>
> >
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
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
> 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
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
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
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
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
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
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
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
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
>
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
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
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
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.
> > >
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:
> >
> > -
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
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
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'
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.
[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
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
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:
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
[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
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('>')
>
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('>')
>
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_
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
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
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]
>
> >
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
> > > >
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
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
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
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
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
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
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
> 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
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
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
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
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
"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
<[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
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:
>
> > --
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:
>
> ---
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
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
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
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
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
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
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
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
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
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
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
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.
> >
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
101 - 173 of 173 matches
Mail list logo