On Sat, Apr 13, 2024 at 1:10 PM Mats Wichmann via Python-list <
python-list@python.org> wrote:
> On 4/13/24 07:00, jak via Python-list wrote:
>
> doesn't Pandas have a "where" method that can do this kind of thing? Or
> doesn't it match what you are looking for? Pretty sure numpy does, but
> that
On Mon, May 22, 2023 at 12:41 PM Mats Wichmann wrote:
> On 5/20/23 13:53, Chris Green wrote:
> > I'm converting a bash script to python as it has become rather clumsy
> > in bash.
> >
> > However I have hit a problem with converting dates, the bash script
> > has:-
> >
> > dat=$(date --date
On Tue, Oct 26, 2021 at 6:36 PM Shaozhong SHI
wrote:
> Hello,
>
> The result of df.count() appears to be a series object. How to store the
> result of df.count() as a new dataframe in Pandas?
>
> That is data anyhow.
>
> Regards,
>
> David
> --
> https://mail.python.org/mailman/listinfo/python-l
data is another table.
>
> Regards,
>
> Shao
>
>
> I'm fairly new to pandas myself. Can't help there. You may want to post
this on Stackoverflow, or look for a similar issue on github.
https://stackoverflow.com/questions/tagged/pandas+json
https://github.com/pandas-de
On Sun, Oct 4, 2020 at 8:39 AM Tim Williams wrote:
>
>
> On Fri, Oct 2, 2020 at 11:00 AM Shaozhong SHI
> wrote:
>
>> Hello,
>>
>> I got a json response from an API and tried to use pandas to put data into
>> a dataframe.
>>
>> However, I ke
On Fri, Oct 2, 2020 at 11:00 AM Shaozhong SHI
wrote:
> Hello,
>
> I got a json response from an API and tried to use pandas to put data into
> a dataframe.
>
> However, I kept getting this ValueError: arrays must all be same length.
>
> Can anyone help?
>
> The following is the json text. Regard
etter place to ask a pandas question
is StackOverflow. Here's a link that may answer your question.
Convert timestamp to day, month, year and hour
<https://stackoverflow.com/questions/57515291/convert-timestamp-to-day-month-year-and-hour>
Tim Williams
--
https://mail.python.org/mailman/listinfo/python-list
On Saturday, December 8, 2018 at 10:13:14 PM UTC-5, Monte Milanuk wrote:
> Did you find any solution(s)?
I usually just lurk and read on this list. I don't reply since there's usually
more competent people that regularly post helpful answers. (I lurk to learn
from them!)
If no one's replied yet
On Thu, Jul 5, 2018 at 9:02 AM Mark Summerfield via Python-list <
python-list@python.org> wrote:
> For GUI programming I often use Python bindings for Qt.
>
> There are two competing bindings, PySide and PyQt.
>
> Ideally I like to have applications that can use either. This way, if I
> get a prob
On Friday, December 22, 2017 at 8:41:29 AM UTC-5, Tim Williams wrote:
> On Thursday, December 21, 2017 at 12:18:11 PM UTC-5, MarkA wrote:
> > On Thu, 21 Dec 2017 07:05:33 -0800, rafaeltfreire wrote:
> > From docs.python.org:
> >
> > 8.10. copy — Shallow and deep copy
On Thursday, December 21, 2017 at 12:18:11 PM UTC-5, MarkA wrote:
> On Thu, 21 Dec 2017 07:05:33 -0800, rafaeltfreire wrote:
> From docs.python.org:
>
> 8.10. copy — Shallow and deep copy operations
>
> Source code: Lib/copy.py
>
> Assignment statements in Python do not copy objects, they create
On Wednesday, November 1, 2017 at 6:30:27 PM UTC-4, Andrew Z wrote:
> nope. it doesnt:
>
> I added print-s after each line and that produced:
> [az@hp src]$ cat ./main1.py
> import matplotlib.pyplot as plt
> print("imported")
> plt.plot([1,2,4,1])
> print("plot is done")
> plt.show()
> print("show
On Friday, May 26, 2017 at 12:26:13 PM UTC-4, Peter Otten wrote:
> Tim Williams wrote:
>
> > I've spent too much time trying to track this down. I'll just hard-code my
> > filename in my INI file. Maybe I'll get back to it, but I need to move on.
>
> The o
On Friday, May 26, 2017 at 8:37:38 AM UTC-4, Tim Williams wrote:
> On Friday, May 26, 2017 at 8:32:19 AM UTC-4, Tim Williams wrote:
> > On Thursday, May 25, 2017 at 9:43:40 PM UTC-4, Tim Williams wrote:
> > > On Thursday, May 25, 2017 at 5:16:13 PM UTC-4, Peter Otte
On Friday, May 26, 2017 at 8:32:19 AM UTC-4, Tim Williams wrote:
> On Thursday, May 25, 2017 at 9:43:40 PM UTC-4, Tim Williams wrote:
> > On Thursday, May 25, 2017 at 5:16:13 PM UTC-4, Peter Otten wrote:
> (snip)
> > > ...
> > >
> > > How do you get
>
On Thursday, May 25, 2017 at 9:43:40 PM UTC-4, Tim Williams wrote:
> On Thursday, May 25, 2017 at 5:16:13 PM UTC-4, Peter Otten wrote:
(snip)
> > ...
> >
> > How do you get
> >
> > > LogFile = '%(CaptureDrive)s%(RootDir)s/test.log'
> >
&g
On Thursday, May 25, 2017 at 5:16:13 PM UTC-4, Peter Otten wrote:
> Tim Williams wrote:
>
> > On Wednesday, May 24, 2017 at 5:47:37 PM UTC-4, Peter Otten wrote:
> >> Tim Williams wrote:
> >>
> >> > Just as a followup, if I use 'unrepr=True'
On Wednesday, May 24, 2017 at 5:47:37 PM UTC-4, Peter Otten wrote:
> Tim Williams wrote:
>
> > Just as a followup, if I use 'unrepr=True' in my ConfigObj, I don't have
> > to convert the strings.
>
> I'd keep it simple and would use JSON...
I look
On Wednesday, May 24, 2017 at 2:46:54 PM UTC-4, Tim Williams wrote:
> (Apologies for using Google Groups to post)
>
> I'm trying to use dictConfig to configure logging. I keep running into the
> error that the logging.StreamHandler object is not iterable.
>
> I'm usi
On Wednesday, May 24, 2017 at 2:46:54 PM UTC-4, Tim Williams wrote:
> (Apologies for using Google Groups to post)
>
> I'm trying to use dictConfig to configure logging. I keep running into the
> error that the logging.StreamHandler object is not iterable.
>
> I'm usi
(Apologies for using Google Groups to post)
I'm trying to use dictConfig to configure logging. I keep running into the
error that the logging.StreamHandler object is not iterable.
I'm using Python 3.4.3 on a Windows 7 box.
C:\Python34\python.exe 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40
On Tuesday, January 29, 2013 3:41:54 AM UTC-5, C. Ng wrote:
> Is there a numpy operation that does the following to the array?
>
>
>
> 1 2 ==> 4 3
>
> 3 4 2 1
>
>
>
> Thanks in advance.
>>> import numpy as np
>>> a=np.array([[1,2],[3,4]])
>>> a
array([[1, 2],
[3, 4]])
>>> np.
On Thursday, September 6, 2012 4:21:56 PM UTC-4, Tim Williams wrote:
> On Thursday, September 6, 2012 11:07:07 AM UTC-4, Helpful person wrote:
>
> > I am a complete novice to Python. I wish to access a dll that has
>
> >
>
> > been written to be compatible wit
On Thursday, September 6, 2012 11:07:07 AM UTC-4, Helpful person wrote:
> I am a complete novice to Python. I wish to access a dll that has
>
> been written to be compatible with C and VB6. I have been told that
>
> after running Python I should enter "from ctypes import *" which
>
> allows P
On Tuesday, September 4, 2012 8:16:33 AM UTC-4, Tim Williams wrote:
> On Sunday, August 26, 2012 9:23:49 PM UTC-4, Tim Roberts wrote:
>
> > Tim Williams wrote:
>
> >
>
> >
>
> >
>
> > >Hello all,
>
> >
>
> > >
&g
On Sunday, August 26, 2012 9:23:49 PM UTC-4, Tim Roberts wrote:
> Tim Williams wrote:
>
>
>
> >Hello all,
>
> >
>
> >I'm trying to use the ctypes module to call functions in a DLL. I've
>
> >figured out how to modify my path so the li
Hello all,
I'm trying to use the ctypes module to call functions in a DLL. I've figured
out how to modify my path so the library is found, and I can call LoadLibrary
on it, but one of the functions expects an array of POINTS. Here is the
prototype from the .h file:
TRACKER_API HRESULT Initial
On May 23, 5:10 pm, no1 wrote:
> Hi, we're investigating transitioning our company from matlab to python. We
> found OMPC as a MATLAB m-file-to Python translator, but we're encountering a
> problem using the translated code to import MATLAB data structures into
> Python. For example, when we sa
On Mar 22, 7:33 am, Sangeet wrote:
> Hi
>
> I am new to the python programming language.
>
> I've been trying to write a script that would access the last modified file
> in one of my directories. I'm using Win XP.
>
> I saw a similar topic, on the forum before, however the reply using
> (os.pop
On Nov 24, 7:45 am, huisky wrote:
> Hi,
>
> As a newbie, I posted my question here again.
> say i have two dics read from a text file by 'split'.
>
> >>> cstart
>
> defaultdict(, {15424: ['Dec', '6', '18:57:40'], 552:
> ['Dec', '7', '09:31:00'], 15500: ['Dec', '6', '20:17:02'], 18863:
> ['Dec', '7
On 21/12/2007, Benedict Verheyen <[EMAIL PROTECTED]> wrote:
> Hi,
>
> i get an "Unable to relay for" when trying to send an email from within
> my network to an email address not on my domain.
> I don't understand why it says "relaying" as i'm sending from an
> internal domain user to an external u
On 27/11/2007, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> There's a government website which shows public data for banks. We'd
> like to pull the data down programmatically but the data is "hidden"
> behind .aspx...
>
> Is there anyway in Python to hook in directly to a browser (firefox or
> IE
On 25/10/2007, A.T.Hofkamp <[EMAIL PROTECTED]> wrote:
> On 2007-10-25, Pete Bartonly <[EMAIL PROTECTED]> wrote:
> >
> Also, brackets around conditions (in the if) are not needed, and comparing
> against None is usually done with 'is' or 'is not' instead of '==' or '!='.
> The result is then
>
> if
a message to the addy, if it doesn't bounce, then it's valid.
Invalid email doesn't always bounce, ( or the bounces may not always reach you )
:)
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 12/10/2007, Florian Lindner <[EMAIL PROTECTED]> wrote:
> Hello,
> is there a function in the Python stdlib to test if a string is a valid
> email address?
>
You mean a valid SMTP email address?
In reality, there isn't a way of doing this. But a good rule of thumb
is if it hasn't got at least
On 11/10/2007, brad <[EMAIL PROTECTED]> wrote:
> Crazy question, but has anyone attempted this or seen Python code that
> does? For example, if a text file contained 'Guido' and or 'Robert' and
> or 'Susan', then we should return True, otherwise return False.
> --
> http://mail.python.org/mailman/l
# make sure the line ending is intact
outfile.write(line)
infile.close()
outfile.close()
or maybe
infile = open('infile.txt')
outfile = open('outfile.txt','w')
new_file = []
for line in infile:
if 'msgid' in line:
# tr
On 07/10/2007, Tim Chase <[EMAIL PROTECTED]> wrote:
> > I'm not really sure how readline() works. Is there a way to iterate
> > through a file with multiple lines and then putting each line in a
> > variable in a loop?
>
> You can use readlines() to get the whole line (including the
> newline):
>
>
x11')]
Also, before iterating the whole list check that 'x11' exists
if 'x11' in mylist:
do stuff
and list comprehesions
print [x for x in mylist if x == 'x11']
HTH :)
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 28/09/2007, Robin Becker <[EMAIL PROTECTED]> wrote:
> Tim Williams wrote:
> > On 28/09/2007, Robin Becker <[EMAIL PROTECTED]> wrote:
> >> Is there a way to use smtplib to get recipient validation. I can use
> >> smtplib
> >> quite happily t
On 28/09/2007, Robin Becker <[EMAIL PROTECTED]> wrote:
> Is there a way to use smtplib to get recipient validation. I can use smtplib
> quite happily to send emails using the locahost's sendmail, but sendmail is
> just
> fire and forget, so some bad addresses eg [EMAIL PROTECTED] don't cause any
On 21/09/2007, Tim Williams <[EMAIL PROTECTED]> wrote:
> On 20/09/2007, Python Maniac <[EMAIL PROTECTED]> wrote:
> > I am new to Python however I would like some feedback from those who
> > know more about Python than I do at this time.
> >
> > def scrambleLi
On 20/09/2007, Python Maniac <[EMAIL PROTECTED]> wrote:
> I am new to Python however I would like some feedback from those who
> know more about Python than I do at this time.
>
> def scrambleLine(line):
>s = ''
>for c in line:
>s += chr(ord(c) | 0x80)
>return s
>
> def descramb
On 15/09/2007, Konstantinos Pachopoulos <[EMAIL PROTECTED]> wrote:
> Hi,
> is there something corresponding to the java String.trim() method, ie
> trim start and trailing space/tab chars from string?
> say convert " asdf " to "asdf"?
>>> ' asdf '.strip()
'asdf'
>>> ' asdf '.rstrip()
' asdf'
>>>
On 14/09/2007, Sean Nakasone <[EMAIL PROTECTED]> wrote:
> I'm having trouble with sending smtp mail. It's hanging after the
> smtplib.SMTP() line. It doesn't works from home but not from work. What's
> the best way to debug this?
>
> # Here's my script
> import smtplib
> msg = "Subject: Hello\n\n
On 13/09/2007, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
> me again... I should describe it better:
> the result should be an array with just:
>
> 498 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04 8.3956e-04
> 3.8560e-03 4.8384e-02 11:40:01 499
> 499 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04
On 07/09/07, Tom Brown <[EMAIL PROTECTED]> wrote:
> On Thursday 06 September 2007 16:01, windandwaves wrote:
> > Hmmm, thank you all for your replies. I will do some research on the
> > net (i did some already, but because I am really not much of a
> > programmer, it is often too detailed for me).
On 06/09/07, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
>
> You may want to try with a regexp, but I'm not sure it's worth it (hint:
> the timeit module is great for quick small benchmarks).
>
> Else, you could as well write your own testing function:
>
> def str_starts_with(astring, *prefixes)
On 27/08/07, Simon Brunning <[EMAIL PROTECTED]> wrote:
> On 8/27/07, Carnell, James E <[EMAIL PROTECTED]> wrote:
>
> > Image.open("C:\test.jpg")
>
> Try:
>
> Image.open(r"C:\test.jpg")
>
> See http://docs.python.org/ref/strings.html
r"C:\test.jpg"
also
"C:\\test.jpg" or 'C:/test.jpg'
--
http:
On 24/08/07, J. Cliff Dyer <[EMAIL PROTECTED]> wrote:
> Tim Williams wrote:
> > On 23/08/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> >> Hi,
> >>
> >> I have a bunch of files that have changed from standard htm files to
> >
On 23/08/07, Tim Williams <[EMAIL PROTECTED]> wrote:
> On 23/08/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I have a bunch of files that have changed from standard htm files to
> > php files but all the links inside the site are now br
On 23/08/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a bunch of files that have changed from standard htm files to
> php files but all the links inside the site are now broken because
> they point to the .htm files while they are now .php files.
>
> Does anyone have an idea ab
On 20/08/07, Brian McCann <[EMAIL PROTECTED]> wrote:
>
> Shawn, Tim ,Jay
>
> many thanks,
>
> It looks like there are many ways this problem can be approached
>
> either by using regex or a tokens
>
> Tim I'm not familiar with your solution, but will learn about that method
> also
Hi Brian,
> bu
On 20/08/07, Shawn Milochik <[EMAIL PROTECTED]> wrote:
> Hopefully this will help (using your input file)
>
> #!/usr/bin/env python
> import re
> buildinfo = "input.txt"
> input = open(buildinfo, 'r')
>
> regex = re.compile(r"^\s*build.number=(\d+)\s*$")
>
> for line in input:
>if re.search(reg
On 20/08/07, Brian McCann <[EMAIL PROTECTED]> wrote:
>
>
>
>
> From: [EMAIL PROTECTED] on behalf of Tim Williams
> Sent: Mon 8/20/2007 2:59 PM
> To: Brian McCann
> Cc: python-list@python.org
> Subject: Re: reading a line in file
&g
On 20/08/07, Brian McCann <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I can read in the whole file build.number which has the following lines
> how do I just capture the value of build.number and assign it to a variable
> Thanks,
> Brian
>
> contents of file build.number:
> #Build Number for ANT. Do not
On 17/08/07, Beema shafreen <[EMAIL PROTECTED]> wrote:
> hi everybody,
> i have a file with data separated by tab
> mydata:
> fhl1fkh2
> dfp1chk1
> mal3alp14
> mal3moe1
> mal3spi1
> mal3bub1
> mal3bub3
> mal3mph1
> mal3mad3
> hob1nak1
> hob1wsp1
> hob1
ng blank line and a "From nobody"
> line) are in the message body, followed by the body text.
>
> How do I assign values to the header?
>
> I'd appreciate any help anyone can give me with this.
Your script (as posted) works fine for me.
I did need to change one import line to: from email.Message import
Message (note the capitalization), but that was all - originally it
stopped the script dead, so it wasn't the cause of your problem.
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 02/08/07, Beema shafreen <[EMAIL PROTECTED]> wrote:
> Hi everybody ,
> I am a beginner in python,
> I have to fetch the redundant entries from a file,
>
> code:
>
> import re
> L = []
> fh = open('ARCHITECTURE_MAIN.txt',
> 'r')
> for line in fh.readlines():
> data =line.st
t; y = z.split()
> >>> x = ''.join(y)
> >>> w = int(x)
> >>> w
> 123456
but it doesn't if you use replace !!
>>> z = '123 456'
>>> int( z.replace( ' ' ,'' ) )
> 123456
> Propose:
> 123 456 789 => 123456789
> 123.456 789 => 123.456789
+1 for me too
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 20/07/07, DJ Fadereu <[EMAIL PROTECTED]> wrote:
> Hello, can anyone help me with this? What am I doing wrong here?
>
> (I've changed private info to /xx)
> I'm getting an authentication error while using a standard script
> Gmail:
> --SCRIPT--
On 18/07/07, Robert Rawlins - Think Blue
<[EMAIL PROTECTED]> wrote:
>
> What's the best way to create a copy of a list? I've seen several method and
> I'm not sure what to use. This will be in a class and one method creates a
> list which I then want to move to the self scope, like so:
>
listB =
On 18/06/07, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> Tim Williams <[EMAIL PROTECTED]> wrote:
> > You can also do this by holding a file open in write mode until the
> > script has finished.
> >
> >try:
> > open('lock.txt&
On 18/06/07, Robin Becker <[EMAIL PROTECTED]> wrote:
> Wildemar Wildenburger wrote:
> > Robin Becker wrote:
> .
> >
> > Well I can think of a dumb way: create a temporary file during the
> > transaction and have your script check for that before running its main
> > body.
> >
> >
> > I thin
> I think thats the most hassle free way of doing it.
If the script finishes abnormally, the file will still exist and
future execution of the script will fail.
:)
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
the file is already open the script won't run, if the script
finshes/crashes or the machine reboots the open file will close.
In both cases if the script finishes normally or crashes, or the
machine is restarted. The lock (ie socket or open file) is released.
HTH :)
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 17/06/07, William Gill <[EMAIL PROTECTED]> wrote:
> I have a (web) development computer w/o an SMTP server and want to test
> form generated e-mail using a dummy SMTP server that delivers the mail
> message to a file, or better yet, to a text editor instead of actually
> sending it. Is it possi
ce without a space being inserted in between?
>
maybe this: (on Win32, don't know about *nix)
for x in range(10):
print '.\b',
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 15 May 2007 06:38:45 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I'm trying to use PAMIE to login to a website:
>
> import cPAMIE
>
> # python.org - just a test, works fine
> ie = cPAMIE.PAMIE()
> website = "http://www.python.org";
> ie.navigate(website)
> ie.textBoxSet('q', 'pamie')
>
On 11/05/07, Sven Rech <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a written a C program which makes use of python embedding.
> I want to find out all threads that a loaded module has started.
> But I can't find anything about this in the docs. Is it possible?
>
Without details of your module, its
On 4 May 2007 03:02:37 -0700, Jaswant <[EMAIL PROTECTED]> wrote:
> This is a simple way to do it i think
>
>
> s=hello
>
> >>> if(len(s)==0):
> print "Empty"
> else:
> print s
>
> hello
Not as simple as " If not s: "
and nowhere near as simple as " print s or 'Emp
On 07/04/07, Eric Price <[EMAIL PROTECTED]> wrote:
> Good grief! And they call a 722-line program "simple"?! LOL!
> I did what I need to do with a __one_line_shell_script__ LOL!
> Naw, if I have to go through all that, I'll skip on python this time around,
> thank you very much!
> Eric
Yup, its no
On 06/04/07, Tim Williams <[EMAIL PROTECTED]> wrote:
> Content: ['text/plain', 'text/html', 'message/delivery-status',
> 'text/plain', 'text/plain', 'text/plain', 'unknown', 'message/rfc822'
ent_type() in required:
text_parts.append(part)
print ('\r\n' + '='*76 +'\r\n').join(text_parts)
# print all the text parts seperated by a line of '='
# end
Whether you use the email module or not, you need to join the
retrieved message i
On 3 Apr 2007 12:36:10 -0700, flit <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> Using poplib in python I can extract only the headers using the .top,
> there is a way to extract only the message text without the headers?
for i in range( M.stat()[0] ): # M.stat returns msg-count and mbox size
ms
On 4 Apr 2007 08:58:49 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> For any list x, x.index(item) returns the index of the FIRST
> occurrence of the item in x. Is there a simple way to identify the
> LAST occurrence of an item in a list? My solution feels complex -
> reverse the list, look
On 30/03/07, Durumdara <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I want to create some backup archives with python (I want to write a backup
> application in Python).
> Some package managers (7z, arj, winzip) can create splitted archives (1
> mega, 650, 700 mega, etc).
>
> Because I want to ftp these re
On 29 Mar 2007 13:40:58 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On Mar 29, 12:02 pm, [EMAIL PROTECTED] wrote:
> > Alex> I'm looking for a simple method to delete a folder after 72
> > Alex> "Business hours" (saturday/sunday doesnt count) since its
> > Alex> creation. Note
On 30/03/07, Tim Williams <[EMAIL PROTECTED]> wrote:
Emile, (slight change to my original reply)
You are passing the TO addresses as 3 addresses in a single string.
[TO] results in a list containing a single string - not a list
containing 3 individual addresses.
You need to either pa
On 30/03/07, Boudreau, Emile <[EMAIL PROTECTED]> wrote:
>
> sendMail('this is the subject line', 'the results: 71 fails, 229 pass, 300
> total.', '[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]')
>
> def sendMail(subject, body, TO, FROM="[EMAIL PROTECTED]"):
> print TO
> HOST = "ex
On 20/02/07, Wolfgang Draxinger <[EMAIL PROTECTED]> wrote:
> H folks,
>
> I got, hmm not really a problem, more a question of elegance:
>
> In a current project I have to read in some files in a given
> directory in chronological order, so that I can concatenate the
> contents in those files into a
; But note that 'in' performs a substring search and therefore "yn" and ""
> > would be accepted as valid answers, too.
>
> Mmm, right. Thanks for the correction.
>
> =>
> while not usrinp.lower() in ['y', 'n']:
or better still
while usrinp.lower() not in ['y', 'n']:
:):)
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 24/01/07, BJ Swope <[EMAIL PROTECTED]> wrote:
>
>
>
> On 1/24/07, Tim Williams <[EMAIL PROTECTED]> wrote:
> >
> > On 24/01/07, py <[EMAIL PROTECTED]> wrote:
> > > I would love for anybody to comment on this code with regard to
> redun
On 24/01/07, py <[EMAIL PROTECTED]> wrote:
> I would love for anybody to comment on this code with regard to
> redundancy/efficiency/wordiness or whatever else.
> for instance, do i understand correctly that i cant have a try: else: without
> an intervening except:?
> -dave
>
> stdout.wri
On 17 Jan 2007 04:50:33 -0800, Will McGugan <[EMAIL PROTECTED]> wrote:
>
> Will McGugan wrote:
>
> > Hi,
> >
> > I'd like a generator that takes a sequence and yields tuples containing
> > n items of the sqeuence, but ignoring the 'odd' items. For example
>
> Forgot to add, for my purposes I will a
On 16/01/07, gandalf gold <[EMAIL PROTECTED]> wrote:
>
> Hi everyone,
>
> I was trying out smtplib and found out that I can email to anyone in my
> domain but not to an email address not in the domain. From browsing on the
> web, it seems that this has to do with the configuration of the mail serve
On 16/01/07, Ralf Schönian <[EMAIL PROTECTED]> wrote:
>
> I would also like to vote for Karrigell.
>
> BTW: Does anyone knows how to avoid stopping/starting of the webserver
> after changing external libraries? I have some own modules under
> /opt/local/python/lib and import them by extending the
On 15 Jan 2007 00:52:33 -0800, Torabisu <[EMAIL PROTECTED]> wrote:
>
> Duncan Smith wrote:
> > Hello,
> > I find myself in the, for me, unusual (and at the moment unique)
> > position of having to write a web application. I have quite a lot of
> > existing Python code that will form part of t
On 13 Jan 2007 02:01:11 -0800, Tim Golden <[EMAIL PROTECTED]> wrote:
> Thierry Lam wrote:
> > I'm using the WMI library for python and I was able to connect to
> > another computer on the network with the following line:
> >
> > c = wmi.WMI(computer="the-network-computer", user="hello",
> > passwor
On 12 Jan 2007 09:16:51 -0800, CSUIDL PROGRAMMEr <[EMAIL PROTECTED]> wrote:
> I have a filename
> cairo-2.3.4.src.rpm
> Is there any way i can only get 2.3.4 from this file name
Is this a one off, or do you have to process multiple files with similar names?
--
Tim Wi
On 8 Jan 2007 16:03:53 +0100, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>
> len(dict.keys()).
>
Or
len(dict)
:)
--
http://mail.python.org/mailman/listinfo/python-list
om/wndsync/help/sources/abit.htm
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 16/12/06, g.franzkowiak <[EMAIL PROTECTED]> wrote:
> Hi everybody,
>
> have a little problem with a service on Win32.
>
> I use a TCP server as service, but can't access from an other machine.
> Only local access is possible.
>
> The service starts like this:
>
> -> myService.py --username user
On 15/12/06, Benjamin Georgi <[EMAIL PROTECTED]> wrote:
> Hello list,
>
> I could use some help extracting the keys/values of a list of
> dictionaries from a string that is just the str() representation of the
> list (the problem is related to some flat file format I'm using for file
> IO).
>
> Exa
On 23/11/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Tim Williams wrote:
> >>>>
>
> and the use of a list comprehension is pretty silly to, given that you want
> to apply the same *function* to all items, and don't really need to look
> it up
On 23 Nov 2006 04:09:18 -0800, Vania <[EMAIL PROTECTED]> wrote:
> Hi, I'm not sure this is the proper forum but I try nevertheless.
> The problem I'am facing is that the socket library always fail to
> connect to an URL. The net effect is that I can not use setuptools.
> I'm using Python2.4 on a wi
On 23/11/06, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Thu, 23 Nov 2006 03:13:10 -0800, Daniel Austria wrote:
>
> > Sorry,
> >
> > how can i convert a string like "10, 20, 30" to a list [10, 20, 30]
> >
> > what i can do is:
> >
> > s = "10, 20, 30"
> > tmp = '[' + s + ']'
> > l = eval(tmp)
>
On 23 Nov 2006 03:13:10 -0800, Daniel Austria <[EMAIL PROTECTED]> wrote:
> Sorry,
>
> how can i convert a string like "10, 20, 30" to a list [10, 20, 30]
>
> what i can do is:
>
> s = "10, 20, 30"
> tmp = '[' + s + ']'
> l = eval(tmp)
>
> but in my opinion this is not a nice solution
>
Not nice, e
On 5 Nov 2006 04:34:32 -0800, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hi,
> I have a string '((1,2), (3,4))' and I want to convert this into a
> python tuple of numbers. But I do not want to use eval() because I do
> not want to execute any code in that string and limit it to list of
> num
On 10/11/06, Tim Williams <[EMAIL PROTECTED]> wrote:
>
>
> On 10/11/06, Michael B. Trausch <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > Every programming example that I have seen thus far shows simple server
> code and how to bind to a socket--however
1 - 100 of 281 matches
Mail list logo