| |
thread by: mmgarvey |
last post Oct 29 '08 by: Terry Reedy
Hi,
I'm using python to develop some proof-of-concept code for a
cryptographic application. My code makes extended use of python's
native bignum capabilities.
In many cryptographic applications there is the need for a function
'get_highest_bit_num' that returns the position number of the highest
set bit of a given integer. For example:
|
thread by: imran akhtar |
last post Dec 29 '08 by: bvdet
i have a balckjack code, which does not seem to run, in python, it comes up with syntax error, i have try sortng it out. does not seem to work. below is my code, if anyone can work out wht wrong with it. that will be great. thereis an attched file, to see the code more cleaer.
from random import choice as randomcards
def total(hand):
...
|
thread by: Catalin |
last post Jul 18 '05 by: Ian Bicking
Can Python replace PHP?
Can I use a python program to make an interface to a mysql 4.X database?
If that's possible where can I find a tutorial?
|
thread by: Bart Nessux |
last post Jul 18 '05 by: Dave Cole
Just fooling around this weekend. Wrote and timed programs in C, Perl and
Python. Each Program counts to 1,000,000 and prints each number to the
console as it counts. I was a bit surprised. I'm not an expert C or Perl
programming expery, I'm most familiar with Python, but can use the others
as well.
Here are my results:
C = 23 seconds...
|
thread by: Mark Hahn |
last post Jul 18 '05 by: Fredrik Lundh
We are considering switching to the dollar sign ($) for self, instead of the
period ( . ) we are using now in Prothon. Ruby uses the at-sign (@) for
self, but our new usage of self also includes replacing the period for some
attribute references, as in obj$func() versus obj.func(), and too many
programs treat that as an email address and...
|
thread by: David MacQuigg |
last post Jul 18 '05 by: Hung Jung Lu
On 27 Apr 2004 16:34:56 -0700, has.temp2@virgin.net (has) wrote:
>David MacQuigg <dmq@gain.com> wrote in message news:<bniq80hiib0gauiltuntk9jvia2getbnj4@4ax.com>...
>
>> Example of Simplified Classes ( Prototypes )
>> ============================================
>
>
>
>Class-based OOP by any other name. But then, I've pointed this out
|
thread by: Maurice LING |
last post Jul 18 '05 by: Jacob Hallen
Hi,
I remembered reading a MSc thesis about compiling Perl to Java bytecodes
(as in java class files). At least, it seems that someone had compiled
scheme to java class files quite successfully. I'm wondering if
something of such had been attempted in python, as in compiling X
language into .pyc. I do not understand the schematics of .pyc...
|
| |
thread by: Stephen Ferg |
last post Jul 18 '05 by: Stephen Ferg
I am a very satisfied user of Python and have been for number of
years. I would never willing use another language. I wish all good
things for Python, and that moves me to express some thoughts about
Python's future prospects.
I submit that the future expansion of Python usage is constrained by
Python's lack of a CPAN-like facility, and I...
|
thread by: George Sakkis |
last post Jul 18 '05 by: jfj
Why does slicing a tuple returns a new tuple instead of a view of the existing one, given that
tuples are immutable ? I ended up writing a custom ImmutableSequence class that does this, but I
wonder why it is not implemented for tuples.
George
|
thread by: Steven Bethard |
last post Jul 18 '05 by: Nick Craig-Wood
Fuzzyman wrote:
> Cameron Laird wrote:
>
>
>>This is a serious issue.
>>
>>It's also one that brings Tcl, mentioned several
>>times in this thread, back into focus. Tcl presents
>>the notion of "safe interpreter", that is, a sub-
>>ordinate virtual machine which can interpret only
|
thread by: Scott David Daniels |
last post Jul 18 '05 by: Scott David Daniels
Kind of fun exercise (no good for British English).
def units(value, units='bytes'):
magnitude = abs(value)
if magnitude >= 1000:
for prefix in Scott.Daniels@Acm.Org
|
thread by: Paul L. Du Bois |
last post Jul 18 '05 by: Antoon Pardon
Has anyone written a Queue.Queue replacement that avoids busy-waiting?
It doesn't matter if it uses os-specific APIs (eg
WaitForMultipleObjects). I did some googling around and haven't found
anything so far.
Because I know someone will ask: no, the busy-waiting hasn't been a
problem in my app. I'm just interested in reading the code.
p
|
thread by: mrstephengross |
last post Jul 19 '05 by: AnswerGuy
Hi all... How can I find out the number of significant digits (to the
right of the decimal place, that is) in a double? At least, I *think*
that's what I'm asking for. For instance:
0.103 --> 3
0.0103 --> 4
0.00103 --> 5
0.000103 --> 6
0.0000103 --> 7
|
thread by: Jeffrey Maitland |
last post Jul 21 '05 by: Paul Rubin
Hello all,
I am in the process of writing a multithreading program and what I was
wondering is a sleep command in an executing function will affect the
threads below it? Here is a basic example of what I mean.
def main():
temp_var = True
while temp_var == True:
if
|
thread by: Steven D'Aprano |
last post Aug 1 '05 by: Steven Bethard
Playing around with comparisons of functions (don't ask), I discovered an
interesting bit of unintuitive behaviour:
>>> (lambda y: y) < (lambda y: y)
False
Do the comparison again and things become even more bizarre:
>>> (lambda y: y) < (lambda y: y)
True
|
| |
thread by: Frank Millman |
last post Sep 14 '05 by: Frank Millman
Hi all
I am writing a multi-user accounting/business system. Data is stored in
a database (PostgreSQL on Linux, SQL Server on Windows). I have written
a Python program to run on the client, which uses wxPython as a gui,
and connects to the database via TCP/IP.
The client program contains all the authentication and business logic.
It has...
|
thread by: seberino |
last post Dec 7 '05 by: hiddenharmony
I'm trying to move beyond Emacs/Vim/Kate
and was wondering if Eclipse is better and if it is the *best*
IDE for Python.
Should I leave Emacs and do Python coding in Eclipse?
Chris
|
thread by: Mike Meyer |
last post Jan 9 '06 by: Mike Meyer
After spending time I should have been sleeping working on it, the try
python site is much more functional. It now allows statements,
including multi-line statements and expressions. You can't create code
objects yet, so it's still more a programmable calculator than
anything real.
I've got some of the tutorial text (literally) up as well....
|
thread by: Mathijs |
last post Jan 25 '06 by: Mathijs
Hi,
Python beginner here and very much enjoying it. I'm looking for a
pythonic way to find how many listmembers are also present in a reference
list. Don't count duplicates (eg. if you already found a matching member
in the ref list, you can't use the ref member anymore).
Example1:
ref=
list=
|
thread by: Tuvas |
last post Jan 30 '06 by: Tuvas
I have a function in a program that works something like this.
def load_pic_data(width,heigth,inpdat, filt=TRUE):
data=''
total=0
tnum=0
size=100
for y in range(0,heigth):
row=''
for x in range(0,width):
|
thread by: Steve R. Hastings |
last post Apr 9 '06 by: Fredrik Lundh
When you compile the expression
for i in range(1000):
pass
does Python make an iterator for range(), and then generate the values
on the fly? Or does Python actually allocate the list
and then step through it?
I was under the impression that recent releases of Python optimize this
|
thread by: 63q2o4i02 |
last post May 24 '06 by: Paddy
Hi, I'm interested in using python to start writing a CAD program for
electrical design. I just got done reading Steven Rubin's book, I've
used "real" EDA tools, and I have an MSEE, so I know what I *want* at
the end of this; I just have never taken on a programming task of this
magnitude. I've seen that some are using python as a utility...
|
thread by: Ron Garret |
last post May 21 '06 by: Martin v. Löwis
>>> u'\xbd'
u'\xbd'
>>> print _
Traceback (most recent call last):
File "<stdin>", line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode character u'\xbd' in
position 0: ordinal not in range(128)
>>>
|
| |
thread by: John Salerno |
last post Aug 10 '06 by: Stephan Kuhagen
I understand the difference, but I'm just curious if anyone has any
strong feelings toward using one over the other? I was reading that a
disadvantage to the more general usage (i.e. env) is that it finds the
first python on the path, and that might not be the proper one to use. I
don't know if that's a real issue most of the time, but it's at...
|
thread by: jaysherby |
last post Aug 9 '06 by: jaysherby
I'm new at Python and I need a little advice. Part of the script I'm
trying to write needs to be aware of all the files of a certain
extension in the script's path and all sub-directories. Can someone
set me on the right path to what modules and calls to use to do that?
You'd think that it would be a fairly simple proposition, but I can't...
|