Hey Timmie,
Tim Michelsen wrote:
>> When I do this sort of thing I like
>> to move my imports into my functions/methods.
> Would this then be compliant with the style recommendations?
Hm, I'm not sure. I guess that if you consider that somewhere near the
top of the style guide it says something a
On Wed, Mar 19, 2008 at 3:56 PM, Tim Michelsen <[EMAIL PROTECTED]>
wrote:
> m = 0
> cm = 0
> mm = 0
> ## first list item
> if first.endswith("m",-1):
> m = first.strip("m")
> elif first.endswith("cm",-2):
> cm = first.strip("cm")
> elif first.endswith("mm",-2):
> mm = first.strip("mm")
Weave is probably what you really want to do, although it doesn't do
what you said: http://wiki.python.org/moin/weave
Pyrex actually does what you said: http://wiki.python.org/moin/Pyrex
On Wed, Mar 19, 2008 at 7:52 PM, Dinesh B Vadhia
<[EMAIL PROTECTED]> wrote:
>
>
> Say because of performance, y
[EMAIL PROTECTED] wrote:
> print "Converter"
> number = 2.5
> n = int(raw_input("Insert Feet Amount"))
> while n > 0:
> print n, "Feet is"
> print n*12, "inches"
> print n*30, "centimeters"
> print
>
> Currently this is what I am working with.
> 2 problems I am facing.
> 1.
print "Converter"
number = 2.5
n = int(raw_input("Insert Feet Amount"))
while n > 0:
print n, "Feet is"
print n*12, "inches"
print n*30, "centimeters"
print
Currently this is what I am working with.
2 problems I am facing.
1. When I run the script and type in the amount of
Alan Gauld wrote:
> For something like this I'd use regular expressions.
> If your strings vary in length then I'd use a separate regular
> expression per unit then use that to findall matching
> substrings for each unit.
> Of course you will have to work out the right regex but that
> shouldn't
Hello,
thank you for the fast reply!
> A regex would avoid that since it would detect an m
> as being diffrent to a cm or mm.
>
> Of course you will have to work out the right regex but that
> shouldn't be too difficult if you are sure you have a whitespace
> separator and a number followed by th
> When I do this sort of thing I like
> to move my imports into my functions/methods.
Would this then be compliant with the style recommendations?
> The 'main' code then
> conditionally calls the function/method. All the code in the
> function safely assumes that the import has been done but co
Say because of performance, you might want to re-write/convert Python code to
C++. What is the best way (or best practice) to do this wrt the tools
available?
Dinesh
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Btw, the win32 version of libusb is not maintained anymore, and bogus
in my experience. I didn't really get to use libusb much on linux, but
it seemed to get a descriptor at least. IIRC, they were upset with
their interface and in the middle of vastly changing it.
--Michael
On Wed, Mar 19,
I've never heard of the type of cable you're using. Can you send a
link to one to the list?
You're missing most of the USB ideas more than the python ideas.
USB is very very complicated. The USB spec (of which you care about
chapter 9) is nothing like how most people actually use USB. Most
people
"Tim Michelsen" <[EMAIL PROTECTED]> wrote
> I would like to read several parts of a string into different
> variables
> based on the (physical) units of the quantities.
>
> Here's my testing code:
> ###
> mystring = '2m 4cm 3mm' # can also be '1pound 30pence', ...
> mylist = mystring.
Hi Tim,
Tim Michelsen wrote:
> Hello fellow Pythonistas,
> I have a question concerning import statements.
...
> it takes a lot
> of time for a TKinter-GUI to start up. And this start-up time is even
> longer when matplotlib is imported
> a optimized version would be:
> import sys
>
> plot_
Hello,
I would like to read several parts of a string into different variables
based on the (physical) units of the quantities.
Here's my testing code:
###
mystring = '2m 4cm 3mm' # can also be '1pound 30pence', ...
mylist = mystring.split(" ")
print mylist
first = mylist[0]
second =
Hello fellow Pythonistas,
I have a question concerning import statements.
My code uses matplotlib to plot the results of my calculations.
Since I want to make this plotting functionality a optional feature I
would like to import matplotlib only when needed because it takes a lot
of time for a T
Shrutarshi Basu wrote:
> Ok, I'm starting to understand how things work. Just one last
> question: suppose my package has a config.py (which contains a config
> dict) which another module in the package imports by "import config".
> If the user of my package has a config.py in the directory from wh
Ok, I'm starting to understand how things work. Just one last
question: suppose my package has a config.py (which contains a config
dict) which another module in the package imports by "import config".
If the user of my package has a config.py in the directory from where
they run their program (whi
"Mike Holloway" <[EMAIL PROTECTED]> wrote
> I have a Prolific Technologies bridged usb cable that I wish to talk
> to
> using pyusb and libusb,
Sorry I can't help but thanks for pointing these out.
I've been intending to write a USB module for over
a year, now I don't need to! :-)
--
Alan Gau
Hi all,
I'm very new to this list, so hello all!
I'm just starting out using python, my background is lamp.
I have a Prolific Technologies bridged usb cable that I wish to talk to
using pyusb and libusb, I've tried following examples and compiling my
own code but I'm really struggling getting i
> Nowadays the best practice for invoking a method from all superclasses
> (yes, multiple inheritance) is this:
>
> class SubClass(BaseClass):
> def __init__(self, t, *args, **kw):
> super(SubClass, self).__init__(*args, **kw)
> # do something with t
>
> That way you let Pyth
"Jack Lucas" <[EMAIL PROTECTED]> wrote
>I am trying to make a converter for Python on my Mac.
> I know I can find one online, but this is more satisfying.
Have you looked at the Cocoa tutorial on using Python on MacOS?
It is just such a convertor(for currency). Using that as a template it
should
> start, as I want to be able to input any Unit to Convert (will keep it simple
for now, feet, inches etc. and add
Maybe you want to get inspired by a Gnome deskbar handler:
http://www.kryogenix.org/days/2006/09/06/converter-deskbar
___
Tutor maillist -
Shrutarshi Basu wrote:
> Thanks for that, i think that creating a configuration submodule and
> importing it into the modules that need it will be the most elegant
> solution for me. I was wondering whether the following solution would
> work / be good practice?
> 1. have the parser system in __ini
I am trying to make a converter for Python on my Mac. I know I can find one
online, but this is more satisfying.
I am not sure exactly where to start. I want to be able to input a "Unit to
Convert" a "Unit to Convert to" and an "Amount of Unit to Convert"
For example Unit to Convert: centimeters,
"brindly sujith" <[EMAIL PROTECTED]> wrote
> i am developing an application in tkinter
>
> i want to know whether we have any option to search a directory from
> tkinter
> program
I'm not sure what you mean.
You can use the standard Python modules to search a directory,
or indeed an entire dire
elis aeris wrote:
> I actually said "ending" to avoid problems with different terminology
> between different languages - but i guess a return is still a return
> in python.
Return does not exit a program. A return statement denotes a point in a
function when the function will stop executing an
hi
i am developing an application in tkinter
i want to know whether we have any option to search a directory from tkinter
program
please answer me
thank you
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
27 matches
Mail list logo