On Sat, Feb 20, 2010 at 11:55 AM, Luke Paireepinart
wrote:
>
>
> On Sat, Feb 20, 2010 at 1:50 PM, Kent Johnson wrote:
>
>> On Sat, Feb 20, 2010 at 11:22 AM, Andrew Fithian
>> wrote:
>> > can
>> > you help me speed it up even more?
>> > import random
>> > def sample_with_replacement(list):
>> >
Can anyone tell me if I can have my program check to see if something is true
the add to count
For example something like
if c_1 and c_2 and c_3 true:
count + 1
or if I can use it after splitting an input the problem is the input is
variable so I don't know if I can do such a thi
On Sun, Feb 21, 2010 at 7:44 AM, jim serson wrote:
> Can anyone tell me if I can have my program check to see if something is
> true the add to count
>
> For example something like
>
> if c_1 and c_2 and c_3 true:
> count + 1
>
> or if I can use it after splitting an input the proble
On 21 February 2010 22:44, jim serson wrote:
> Can anyone tell me if I can have my program check to see if something is
> true the add to count
>
> For example something like
>
> if c_1 and c_2 and c_3 true:
> count + 1
Your code currently throws the result of the count + 1 expression
On Sun, Feb 21, 2010 at 8:44 AM, jim serson wrote:
> Can anyone tell me if I can have my program check to see if something is
> true the add to count
>
> For example something like
>
> if c_1 and c_2 and c_3 true:
>
> count + 1
This will almost work as written. Try
if c_1 and c_2 and
Luke Paireepinart wrote:
Can you explain what your function is doing and also post some test code to
profile it?
On Sat, Feb 20, 2010 at 10:22 AM, Andrew Fithian wrote:
Hi tutor,
I'm have a statistical bootstrapping script that is bottlenecking on a
python function sample_with_replaceme
Hi,
do you know if there is a way so that i can get multiple values from a
function?
For example:
def count(a,b):
c = a + b
d = a - b
How can I return the value of C and D?
Then, i have another question: i've read, some time ago, this guide
http://hetland.org/writing/instant-python.html, ski
On Mon, 22 Feb 2010 03:00:32 am Giorgio wrote:
> Hi,
>
> do you know if there is a way so that i can get multiple values from
> a function?
>
> For example:
>
> def count(a,b):
> c = a + b
> d = a - b
>
> How can I return the value of C and D?
Return a tuple of c and d:
>>> def count(a, b):
...
Hi everyone, I would like to know how to use python with a mac.
For now, I go to spotlight, open terminal then type IDLE and a window pops
up but its like the window that opens when you run your programs already
saved and I'm not able to open another window to write a script from
scratch.
Could s
mac have python 2.5 and 2.6 installed by default. If you use Vi then you are
up for it. If you want IDE then pydev plugin with eclipse can be tried. I
had heard good things about it. Also you can try bpython(python fancy
interpretor), install it via macports.
~l0nwlf
On Sun, Feb 21, 2010 at 10:36
Hi all
I'm trying use regex to match image formats:
import re
def findImageFiles():
imageRx = re.compile('\.jpe?g$|\.png$|\.gif$|\.tiff?$', re.I)
someFiles =
["sdfinsf.png","dsiasd.dgf","wecn.GIF","iewijiefi.jPg","iasjasd.py"]
findImages = imageRx(someFiles)
print "START: %s" %
On Sun, 21 Feb 2010 03:22:19 am Andrew Fithian wrote:
> Hi tutor,
>
> I'm have a statistical bootstrapping script that is bottlenecking on
> a python function sample_with_replacement(). I wrote this function
> myself because I couldn't find a similar function in python's random
> library.
random.
On Mon, 22 Feb 2010 04:23:04 am Dayo Adewunmi wrote:
> Hi all
>
> I'm trying use regex to match image formats:
Perhaps you should use a simpler way.
def isimagefile(filename):
ext = os.path.splitext(filename)[1]
return (ext.lower() in
('.jpg', '.jpeg', '.gif', '.png', '.tif', '.tiff'
Hi all,
I'm trying to read a file (Python 2.5.2, Windows XP) as follows:
assignment_file = open('C:\Documents and Settings\coderoid\My
Documents\Downloads\code_sample.txt', 'r+').readlines()
new_file = open(new_file.txt, 'w+')
for line in assignment_file:
new_file.write(line)
new_file.close(
On Sun, Feb 21, 2010 at 10:36 PM, Marco Rompré wrote:
> Hi everyone, I would like to know how to use python with a mac.
>
> For now, I go to spotlight, open terminal then type IDLE and a window pops
> up but its like the window that opens when you run your programs already
> saved and I'm not able
On Sun, Feb 21, 2010 at 12:22 PM, Sithembewena Lloyd Dube wrote:
> Hi all,
>
> I'm trying to read a file (Python 2.5.2, Windows XP) as follows:
>
> assignment_file = open('C:\Documents and Settings\coderoid\My
> Documents\Downloads\code_sample.txt', 'r+').readlines()
> new_file = open(new_file.tx
@Wayne, sorry to have replied to you directly..
On Sun, Feb 21, 2010 at 9:23 PM, Sithembewena Lloyd Dube
wrote:
> Solved by moving the file just under C:\
>
> Must be an issue with directory name spaces.
>
> By the way, my code was riddled with bugs. readlines() returns a list
> object, which doe
I subscribe to an email list that distributes image files. I'd like to
automate the process of saving the images to individual files. I've got
it mostly figured out with two exceptions.
1) Sometimes msg.filename returns 'None' even though
msg.get_content_type returns 'image/jpeg' and the actual me
Hi,
I am having trouble understanding how superclass calls work. Here's
some code...
What version of Python are you using?
In Python 2.x, you MUST inherit from object to use super, and you MUST
explicitly pass the class and self:
class ParentClass(object):
def __init__(self, a,
On Mon, 22 Feb 2010 05:22:10 am Sithembewena Lloyd Dube wrote:
> Hi all,
>
> I'm trying to read a file (Python 2.5.2, Windows XP) as follows:
>
> assignment_file = open('C:\Documents and Settings\coderoid\My
> Documents\Downloads\code_sample.txt', 'r+').readlines()
> new_file = open(new_file.txt, '
I have a program called TrackStudy.py and another called ReportTool.py
Track runs above an Events folder that contains txt files that it
examines.Report runs in an Events folder on the same txt files. Neither
is operated when the other is operating. Both only read the same files.
I've bee
Hi,
I have an html file, with xml style comments in:
I'd like to extract only the comments. My sense of smell suggests that
there's probably a library (maybe an xml library) that does this already.
Otherwise, my current alogorithm looks a bit like this:
* Iterate over file
* If current line c
Just a little complement to Steven's excellent explanation:
On Mon, 22 Feb 2010 10:01:06 +1100
Steven D'Aprano wrote:
[...]
> So if you write a pathname like this:
>
> >>> path = 'C:\datafile.txt'
> >>> print path
> C:\datafile.txt
> >>> len(path)
> 15
>
> It *seems* to work, because \d i
23 matches
Mail list logo