= svmc.svm_check_parameter(prob.prob, param.param)
268 if msg:
--> 269 raise ValueError, msg
270 self.model = svmc.svm_train(prob.prob, param.param)
271
ValueError: C <= 0
---
Your input would be greatly appreciated.
Thanks a lot,
J
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Hello,
I have an issue with data that I am trying to convert to datetime. It has
'a.m.' rather than 'am' and the %p format doesn't seem to work. I am pretty
sure there should be an easy solution. That said I can not see it at the
moment. the following illustrates the issue. test1 and test2 w
Well, I have managed to get it working by using the locale setting. It would
be nice to use the am/pm setting only and leave the rest unset. Will have
to look into it further. Any tips?
import locale
#to set locale to use a.m. instead of AM
locale.setlocale(locale.LC_ALL, '')
bev
>
> My intent though is really not to produce a commercial product. My question
> relates to difficulty my partner and I have to exchanging py programs w/o
> him stumbling. I send him a py program written using Windows Python 2.5. He
> has the same. I've executed it IDLE and it works fine. He execu
Hi, I have problem here...I am writing a program but I am getting stucked at
how to solve the mode of a series of numbers...any ideas???following is the
program:def mode(data):num=0count=0mx=0mode=0for i in data:
if num!=data[i]:num=data[i]coun
hi, its me again jay, thanks alot everyone for your input on the last program i
created that solved for the mode,mean, and average of a set of numbers it
actually worked great...i used the import in a bit different method but still
very valuable...if anyone can give me any ideas on thi
hi, its me again jay, thanks alot everyone for your input on the last program i
created that solved for the mode,mean, and average of a set of numbers it
actually worked great..if anyone can give me any ideas on this program i am
doing now it would be appreciated.I keep would like to understand
Hello,
I have some autogenerated code from Selenium which I cannot figure out
how to pass some command line variables to. For example I could export
the same in Perl and it would be for example:
use strict;
use warnings;
use Time::HiRes qw(sleep);
use Test::WWW::Selenium;
use Test::More "no_
he quickest
import sys
print sys.srgv
sys.argv will it output a array of all command line args
./selenium-google-test.py yankees
will out put:
['selenium-google-test.py', 'yankees']
so
args = sys.argv
args[0] == 'yankees'
True
for a more functional way, check
Yeah, I figured that. I got it to work thanks, but I still don't
understand how exactly. Coming from Perl I am used to a more procedural
type of programming. BTW - Selenium is a great tool for web testing, and
the way it will translate your web clickstream into your choice of
languages rocks.
Hello,
I am scanning a text file and replacing words with alternatives. My
difficulty is that all occurrences are replaced (even if they are part of
another word!)..
This is an example of what I have been using:
for line in fileinput.FileInput("test_file.txt",inplace=1):
> line = lin
oops, I mean that the script opens a file and splits it into words; Then it
takes each word and searches for an alternative online; with the alternative
now stored in a variable, it simply needs to be written back over the
original word in the same file.
at the moment this might solve the problem,
place("3","e")
> astring = astring.replace("|#","f")
> astring = astring.replace("6","g")
> astring = astring.replace("#","h")
> astring = astring.replace("1","i")
> astring = as
Hello,
I have been experiencing such difficulty with something that should be
easy-- pretty new to programming..
Need to:
(1) open a text file
(2) iterate through it word by word
(3) replace each word with an alternative word and close the file.
**I don't know what the alternative word will be b
I want my object to create a fresh dictionary if its
not passed one.
Perhaps I don't understand. In the example below, the
first instance correctly creates a fresh dictionary.
But the second instance seems to inherit the now dirty
dictionary from the first instance.
What am I missing?
class n
> Wine is a good suggestion, but it takes up 3.53 MB. Is there a lighter
>> alternative?
>>
>
> So far, you didn't state whether the DLL actually uses Windows calls, but I
> would imagine it does, and if so, you can't use it on anything but Windows
> without emulating those calls, thus using Wine.
Hello Python gurus!
I am trying to
1) Read and decode video streams from internet.
2) Store them in a buffer.
3) Eventually convert them into data that can be used in Cycling '74's
Jitter.
If anyone has any idea how to start with this, that would be great! I have
limited experience with Python, b
Hi there,
My apologies if this is a trivial question but I am sort of new to python.
Here is my problem:
I have a list of dictionaries. Each dictionary has a word and its position
in the text the positions are in the form of a tuple.
Here is an example:
[
{'position': (5, 4), 'term': u'happy',},
2016 at 8:34 AM, Muhubo Yusuf wrote:
>
>
> From: Alan Gauld via Tutor
> Date: Fri, Jun 17, 2016 at 6:36 PM
> Subject: Re: [Tutor] help with comparing list of tuples in python 2
> To: tutor@python.org
>
>
> On 17/06/16 20:18, Lulu J wrote:
>
> > I have a li
r example
below).
Numbers=[1,2,3,4,5]
Words=["One", "Two", "Three, with comma", "Four 'with single quote'",
"Five"]
NumPlusWordQuoted=[]
for (i, j) in zip(Numbers,Words):
NumPlusWordQuoted.append([str(i) + " " + chr(34)
writerow(words)
writer.writerow([str(n) + " " + chr(34) + s + chr(34) for n, s in
zip(numbers, words)])
On 9 December 2013 22:54, Steven D'Aprano wrote:
> On Mon, Dec 09, 2013 at 09:52:34PM +, J Sutar wrote:
>
> > I'm trying to write to csv a string which
how can i split a word into letters in python 2.7.6?
--
Y D Jain
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Hi,
I am teaching myself programming in python and assistance with
UnicodeDecodeError
I am trying to scrap text from a website using Python 2.7 in windows 8 and
i am getting this error *"**UnicodeDecodeError: 'charmap codec can't encode
character u'\u2014 in position 11231 character maps to "*
*
Win 7Python v 3.4.3
I'm new to Python and only have coursework under my belt in another object
oriented programming language as well as limited systems skills.
After launching Python from the command line with py.exe, it appears that the
interrupter starts up fine. I've read on Python.Org's sit
attachments is prohibited without prior
consent.
On Thursday, April 2, 2015 5:09 AM, Steven D'Aprano
wrote:
On Thu, Apr 02, 2015 at 06:36:03AM +0000, J L wrote:
> Win 7Python v 3.4.3
> I'm new to Python and only have coursework under my belt in another
> object o
: New modulus reduction curves for clays added*
* using results from Sun et al (1988) *
* by: J. I. Sun & Ramin Golesorkhi*
* February 26, 1988 *
* --- *
From: sri...@gmail.com [mailto:sri...@gmail.com] On Behalf Of Wayne
Werner
Sent: Wednesday, March 10, 2010 2:24 PM
To: Armstrong, Richard J.
Cc: tutor@python.org
Subject: Re: [Tutor] Running a dos program with python
On Wed, Mar 10, 2010 at 3:20 PM, Armstrong, Richard J.
wrote:
Hello
From: sri...@gmail.com [mailto:sri...@gmail.com] On Behalf Of Wayne
Werner
Sent: Wednesday, March 10, 2010 3:00 PM
To: Armstrong, Richard J.
Cc: tutor@python.org
Subject: Re: [Tutor] Running a dos program with python
On Wed, Mar 10, 2010 at 4:51 PM, Armstrong, Richard J.
wrote:
The
python
I use wxPython, which allows a statement like:
wx.Execute('c:\shake91.exe "FLAC.txt" "a.txt" "b.txt"')
From: Armstrong, Richard J. <mailto:rarms...@water.ca.gov>
Sent: Wednesday, March 10, 2010 4:51 PM
To: Wayne Werne
Hello,
I have a simple question. I have created a module call Newmark.py and it
runs fine, however, I want to add some documentation so that when I type
in the console help(Newmark) it will give a description of the module.
Any ideas?
Thanks,
Richie
Hello all,
Does anyone have a suggestion for a good interpolation function in numpy
or scipy. I have an earthquake time history with a time step of 0.005
sec and want to convert it to a time history with a time step of say
0.01. The interpolation function numpy.interp is too "coarse" and
modifi
Alan Gauld writes:
> Ooh I was deliverately steering clear of the distinctions between data,
> information and knowledge! There lie religious wars! :-)
That's precisely why Guido says "don't say 'data' in this context."
It's not your choice to steer clear of those differences of
definition, i
I have a text file containing 336 records.
I can read and print out the whole file without any problem.
What I want to do is read and print out one record only (chosen at
random). So I need to get to record x, select it, and then print it (or
store it in a variable).
Can anyone tell me now to do
>At 02:17 PM 5/12/2005, Bernard Lebel wrote:
>>Just a generic question: why one would use apply()?
>>
>>In Learning Python, on page 357, there is an example of generating an
>>instance using apply():
>>
>>class A:
>> def __init__( self, number ):
>> self.number = number
>>
>>a =
Alan Gauld wrote:
> What's available and in what state of readiness?
>
> I tried Boa Constructor but after half a dozen code tweaks
> I was still running into compatibility errors with the latest
> wxPython and gave up.
>
> I know that Glade is out there, but what state is it in?
> And PythonC
Pujo Aji wrote:
> Hello
>
> I have a dynamic functions which created by some algorithms during
> runtime.
> These functions are in string type.
> When I want to use it, I can use eval command.
> But can someone give me more suggestion about how to handle this
> problem, I want to avoid eval.
Danny Yoo wrote:
>>>I have a dynamic functions which created by some algorithms during
>>>runtime. These functions are in string type. When I want to use it, I
>>>can use eval command. But can someone give me more suggestion about
>>>how to handle this problem, I want to avoid eval.
>>>
>>>
bob wrote:
>At 11:31 AM 11/3/2005, Johan Geldenhuys wrote:
>
>
>>Hi all,
>>Just a quick question;
>>
>>How do I code this output:
>>"""
>>files dirs
>>==
>>"""
>>
>>I want to print something a few space away from the left side or in the
>>middle of the line.
>>
>>
>
>In the
Michael Haft wrote:
>Hello,
> I tried the following code:
>
>def readSOMNETM(inputName):
>input = open(inputName, "r")
>result = []
>for line in input:
>fields = line.split()
>data = fields[1] + fields[2] + fields[7]
>result.append(data)
>input.close()
>
Danny Yoo wrote:
>>You make some good points here but I suggest that, in the real world,
>>the risks are small.
>>
>>
>
>Hi Colin,
>
>But that's the point I'm trying to make; eval() is appropriate only for
>toy code. In real world code that's exposed to the world, using eval() is
>usually the
Alex Hunsley wrote:
>Regards testing, I've been playing with both the unittest
>(http://pyunit.sourceforge.net/pyunit.html) and doctest
>(http://docs.python.org/lib/module-doctest.html). I was wondering what
>peoples thoughts were on the effectiveness and convenience of one versus
>the other.
Liam Clarke-Hutchinson wrote:
>I believe only by explicitly passing a reference to the parent?
>
>Liam Clarke-Hutchinson
>
>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
>Of Bill Campbell
>Sent: Wednesday, 9 November 2005 7:00 a.m.
>To: Tutor
>Subject: [Tu
I will be out of the office starting 03/16/2006 and will not return until 03/20/2006.
I will respond to your message when I return. ___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
[EMAIL PROTECTED] wrote:
> 1. What's involved in a port of a C program into Python? (drawmap is
> offered in a number of linux distributions btw.)
It really (really) depends on the C program -- C's so flexible that you
can write in a "Pythonish" style (specifically, avoiding pointer tricks,
kee
kevin parks wrote:
> I have been handed a huge number of documents which have hundreds of
> pages of times and durations, all calculated and notated by several
> different people over the course of many years. Sadly, no made any
> guidelines at all about how this work would proceed and all th
Richard Querin wrote:
> I know this is probably a dumb question:
>
> I've got mp3 files that are downloaded (by ipodder) into individual
> subfolders. I'd like to write a quick script to move (not copy) all the
> mp3 files in those folders into a single destination folder. I was
> thinking I could
shawn bright wrote:
> the only difference in one from the other is that in the headers of the
> other app (not my python script)
> there exist the following lines:
>
> MIME-Version: 1.0
> X-Mailer: OstroSoft SMTP Control (4.0.20)
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-En
Hans Dushanthakumar wrote:
> Hi,
>How do I use python for basic web-tasks like inputting data or
> clicking buttons on web-pages. For eg, how do I enter my username and
> password and click on the "OK" button on the yahoo mail page?
> I had a look at the webbrowser module documentation
> (http:
Chuck Coker wrote:
> from net.grinder.script import Test
> from net.grinder.script.Grinder import grinder
> from net.grinder.plugin.http import HTTPPluginControl, HTTPRequest
> from HTTPClient import NVPair
> connectionDefaults = HTTPPluginControl.getConnectionDefaults()
> httpUtilities = HTTPPlugi
> if x == None
>
> As simple as that.
In fact, I think the following is even a little more readable:
if x is None
and in fact that syntax has some advantages in various corner cases. It's
largely a matter of preference.
Dustin
___
Tutor maillist
import traceback
try:
something_funny()
except:
traceback.print_exc()
should do the trick for you.
Dustin
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Asrarahmed Kadri wrote:
> "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
> line 310, in RunScript
> exec codeObject in __main__.__dict__
> File "C:\project stuff-programs\Scriptdate.py", line 18, in ?
> t1 = my_version_datecheck.dateCheck(dt1,0)
> File "my_ver
For what it's worth, the vast majority of the XML out there (especially if
you're parsing RSS feeds, etc.) is written by monkeys and is totally
ill-formed. It seems the days of 'it looked OK in my browser' are still here.
To find out if it's your app or the XML, you could try running the XML thro
Kent Johnson wrote:
> Dustin J. Mitchell wrote:
>> Asrarahmed Kadri wrote:
>>> "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
>>> line 310, in RunScript
>>> exec codeObject in __main__.__dict__
>>> File
other apps.
Question: I want to remove SIP and revert to old version and can not find
documentation that outlines the procedure. Any suggestions?
--
J. D. Leach
Columbus, Indiana USA
Uptime:
19:37:45 up 1 day, 7:52, 1 user, load average: 1.00, 1.28, 1.49
Linux/Open Source Computer using:
Mandriva Lin
07:46 pm, J. D. Leach wrote:
> To All,
>
> This is, and isn't, Python related, but thought you may be of some
> assisstance. Running Mandriva 2006 on a 1.8Mhz Dell GX260. Also: Python
> 3.4.2, ERIC3 3.8.1, etc.
> Problem: was going to update to ERIC3 3.9.2 and downloaded
I'm very new to Python, but it seems like I just learned in a class for
a random number, you would need the :
import random
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Christopher Marlett
Sent: Thursday, March 13, 2008 7:44 PM
To: tutor@python.org
Subj
Hello Python users,
I am very new to Python, how do I program that converts 24 hour time to
12 hour time? The program should have three functions(input, conversion
and output function)
Thanks for any help
Pamela Bartruff
___
Tutor maillist -
m."
-Original Message-
From: Kent Johnson [mailto:[EMAIL PROTECTED]
Sent: Monday, March 24, 2008 8:07 AM
To: Bartruff, Pamela J.
Cc: tutor@python.org
Subject: Re: [Tutor] how to write a function
Bartruff, Pamela J. wrote:
> Hello Python users,
>
> I am very new to Pyth
Thank you so much. I appreciate the help, I am very new to Python, but
I would very much like to learn more...
-Original Message-
From: bhaaluu [mailto:[EMAIL PROTECTED]
Sent: Monday, March 24, 2008 9:17 AM
To: Bartruff, Pamela J.
Cc: tutor@python.org
Subject: Re: [Tutor] how to write a
I have a legacy program at work that outputs a text file with this header:
ÉÍÍ»
º Radio Source Precession Program º
º by John B. Doe º
º 31 August 1992 º
ÈÍÍÍ
Kent Johnson wrote:
On Mon, Sep 8, 2008 at 2:46 AM, J. Van Brimmer <[EMAIL PROTECTED]> wrote:
I have a legacy program at work that outputs a text file with this header:
ÉÍÍ»
º Radio Source Precession Program
Thanks Paul, this looks like just what I need to reformat PRECESS's
output into what I need.
Thanks,
Jerry
Paul McGuire wrote:
Instead of trying to match on the weird characters, in order to remove them,
here is a pyparsing program that ignores those header lines and just
extracts the interest
Johnny wrote:
Anyone have any advice for an all out beginner?
Advice as in... The best book?...best tutor web page?
I am wanting so badly to learn Python.
I have went to this site...
http://www.awaretek.com/tutorials.html
This gave me lots of info,, but with so many books to choose from, I
can
John Fouhy wrote:
2008/9/11 J. Van Brimmer <[EMAIL PROTECTED]>:
This should be enough to get you started. You'll just have to jump in and
read, read, and read. :-)
I would say: jump in and code, code, and code. Reading's easy, but if
you're anything like me, you&
you soon
--
Daniel J Kramer
Constant Fables
249 12th st #3
Brooklyn, NY 11215
(h) 347 223 4571
(m) 646 427 7430
test.py
Description: Binary data
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
11:52 AM, Daniel J Kramer
> <[EMAIL PROTECTED]> wrote:
> > Hi Kent
> >
> > I have been playing with the ,lower command and am not having much luck.
> It
> > seems like a simple task, but it is not working for me. Here is the code
> >
> > def main():
, I do not know where to
begin
thank you
--
Daniel J Kramer
Constant Fables
249 12th st #3
Brooklyn, NY 11215
(h) 347 223 4571
(m) 646 427 7430
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I am out of the office until 19/02/2013.
I am attending an IBM Redbook residency in Raleigh, NC, USA ... and have
limited access to my mail.
My response to your email will be delayed during this time.
Thanks
David J Pearson MBCS CITP CEng MIET
Technical Staff Member
Solution Architect [Mobile
@Bob @David -- I gave you all the other parts to give you a background,
and context as it relates to my 'problem'. My apologies if it seems
obfuscated. I took an hour to write that email, and revised it several
times in an attempt to provide good information. Please disregard my OP.
On 02/14/
gt; interpreted as "from the end" rather than "from the beginning".
>
> Item positions are counted from 0, which will be very familiar to C
> programmers. The start index is included in the slice, the end
> position is excluded.
>
> The model that you should think o
On 02/15/2013 04:03 PM, Albert-Jan Roskam wrote:
>
>> Eventually what I'll need to do is:
>> 1. Index the file and/or count the lines, as to identify each line's
>> positional relevance so that it can average any range of numbers that are
>> sequential; one to one another.
> In other words: you
through the list) to removing items from
a list without replacing the list? Specifically, I'm looking for
something that would be similar to the concept, "Remove every list item
that starts with X."
Regards,
--
David J. Weller-Fahy (please don't CC me)
__
ction "3.1.4 Lists" in the
python tutorial, I might have noticed the example which is similar to that
form:
#v+
>>> # Clear the list: replace all items with an empty list
>>> a[:] = []
>>> a
[]
#v-
Ah, well. Thanks again for the tips, gentlemen.
Regards,
-
Title: [Tutor] Need Help
Here is the assignment
You've been given an assignment by your supervisor to program a small application to monitor the current status of the cash account in the firm's petty cash fund (the amount of cash kept on hand in the office for incidental purchases). The requ
Hello,I am new to programming in Python, but I am very excited about
the possibilities that it (Python) has.I maybe jumping the gun a
little bit here, but this is what I would like to do:I would like to crea
Hello,I am new to programming in Python, but I am very excited about
the possibilities that it (Python) has.I maybe jumping the gun a
little bit here, but this is what I wouldlike to do:I would like to creat
On Wed, 14 Feb 2007 09:08:38 -0800
Dave Kuhlman <[EMAIL PROTECTED]> wrote:
> On Wed, Feb 14, 2007 at 05:20:44PM +0100, Rikard Bosnjakovic wrote:
>
> > Why is there no reply-to-tag in all the posts, making the list
> > recipient at all times?
>
I use Sylpheed 2.2.7 in a Linux box. There are 'Reply
On Wed, 2018-11-07 at 10:22 +0100, srinivasan wrote:
> blkid -o export %s | grep \'TYPE\' | cut -d\"=\" -f3
You don't need to escape the single quotes.
Try either:
"blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
or:
'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
or:
"blkid -o export %s | g
Dear Guys,
I have a 2D array:
>>>[['1', '2 ', '3'], ['longer ', 'longer', 'sort']]
How can I get what is the max(len(item)) for the columns ?
I would like to get a list with the max_col_width values.
I hope that, it can wrote with some nice list comprehension, but I can't do
that
80 matches
Mail list logo