On Thu, Feb 12, 2009 at 2:55 PM, Alan Gauld wrote:
> But you need to have an order that will work with sorted().
> Its not just the order you add items to the dict.
And yes algorithmically, there is No Requirement or I should say a
good Use Case for a Dict to have sorted keys. More we work with
On Tue, Feb 17, 2009 at 1:24 PM, Norman Khine wrote:
> Thank you, but is it possible to get the original string from this?
What do you mean by the original string Norman?
Look at these definitions:
Quoted String:
In the different parts of the URL, there are set of characters, for
e.g. space cha
Hello,
I am looking for a good material that would provide exercises (and
possibly solutions to demo exercises) that illustrates the Object
Oriented Programming constructs in Python. Can pointers?
TIA,
Senthil
___
Tutor maillist - Tutor@python.org
h
On Wed, Feb 25, 2009 at 10:37 AM, prasad rao wrote:
>
> licenseRe = re.compile(r'\(([A-Z]+)\)( No. (\d+))?')
Change that to:
licenseRe = re.compile(r'\(([A-Z]+)\)\s*(No.\d+)?')
It now works.
Thanks,
Senthil
___
Tutor maillist - Tutor@python.org
ht
On Wed, Mar 4, 2009 at 11:13 AM, Eric Dorsey wrote:
> I know, for example, that the > code means >, but what I don't know is
> how to convert it in all my data to show properly? I
Feedparser returns the output in html only so except html tags and
entities in the output.
What you want is to Unesca
2009/3/7 Emad Nawfal (عماد نوفل) :
> import glob
> for path in glob.iglob("*.temp"):
> infile = open(path)
> for line in infile:
> print line.strip()
import glob
files = sorted(glob.glob("*.temp"))
for each in files:
print open(each).read()
Note couple of things:
- glob.glob
> I have question if we make if statement inside if like cprogramming below
> how to do in python
Indentation is the key here. It is very simple.
x=1
y=2
if x == 1:
print "inside first if"
if x == 2:
print "inside second if"
--
Senthil
___
Hello Samuel,
When sending through smtp.gmail.com you might need to starttls() and
do a login() before sending.
>>> import smtplib
>>> headers = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" %(from,to,subject)
>>> message = headers + "Hello, How are you?"
>>> mailserver = smtplib.SMTP('smtp.gmail.c
Hello Dominique,
On Sat, Apr 4, 2009 at 6:07 AM, Dominique wrote:
> I am developing a very small multi-platform app to search for a specific word
> or
> expression in files located in a drive or directory.
> So I need to open files to search for the word.
>
> I read that opening a binary file as
On Tue, Oct 06, 2009 at 03:39:36PM -0400, Mark Young wrote:
> I'm now fairly familiar with Python, so I'm thinking about starting to learn a
> second programming language. The problem is, I don't know which to learn. I
You have already got a lot of healthy advice in this thread.
I would like to su
On Fri, Dec 04, 2009 at 01:13:42PM +0530, Prasad Mehendale wrote:
> I am a beginner. I want to save the output data of the following programme in
> a file through the programme. Please suggest me the way. I am using Python
> 2.3.3 on mandrake linux 10 and using "Idle" to save the output to a file
On Mon, Dec 07, 2009 at 08:38:24AM +0100, Jojo Mwebaze wrote:
> I need help on something very small...
>
> i am using urllib to write a query and what i want returned is 'FHI=128%2C128&
> FLO=1%2C1'
>
The way to use urllib.encode is like this:
>>> urllib.urlencode({"key":"value"})
'key=value'
>
On Thu, Dec 17, 2009 at 09:32:44PM -0800, Benjamin Castillo wrote:
> What is URL to online Python interpreter?
Google could have helped you too.
Anyways, http://shell.appspot.com/
--
Senthil
___
Tutor maillist - Tutor@python.org
To unsubscribe or cha
On Feb 6, 2008 11:38 PM, Timothy Sikes <[EMAIL PROTECTED]> wrote:
>
> First off, I was running my script from my flash drive-That could have
> caused something. Next, I have possible found something IN the
> location where I ran the script, I found a pic_db.bat with stuff in it... It
>
> Ishan Puri wrote:
> Hi,
> I have download NLTK for Python 2.5. It download automatically to
> C:\Program Files\Python25\libs\site-packages\nltk. When I try to open a
> module in python, it says that no such module exists. What do I need to do?
There are ways to install the module in the si
On Thu, Jan 15, 2009 at 9:42 AM, Bill Campbell wrote:
> Python does the Right Thing(tm) when dividing two integers,
> returning an integer result.
>
Unless it is python 3k, in which integer division (single /) can
result in float. Because int is a long by default. :-)
--
Senthil
__
stalled.
Thanks,
Senthil
--
Senthil Kumaran O.R.
http://uthcode.sarovar.org
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> Also, how to practically walk in reverse order in a list without
> copying it (e.g. items[::-1]),
> especially if i need both indexes and items (couldn't find with
> enumerate()).
>
Are you looking for reversed()?
The way you are doing it is probably OK.
But it can be simplified thus:
keys = [
On Thu, Jan 15, 2009 at 06:57:09PM -0700, Eric Dorsey wrote:
>Working in IDLE on Windows Vista, I have one program that I set to have
>2 character spacing (due to the levels of if's and while's going on --
>later my brother called this a bit of a code smell, ie. logic shouldn't
>go
On Fri, Jan 16, 2009 at 9:11 AM, Ishan Puri wrote:
> Hi,
> I was wondering if anyone could tell me where I can get corpora
> containing IMs, or blogs or any internet communication? This is kind of
www.google.com
And for IM's specifically, you can look at "Alice Bot" Project, the
corpus will
On Sun, Jan 18, 2009 at 8:34 AM, Ian Egland wrote:
> Hello all, I just joined this mailing list.
>
> I am a beginner to programming in general and would really appreciate a
> tutorial for Python3000 that at least covers the basics. I have tried
Hello Ian,
That is a nice reason to get started with
On Mon, Jan 19, 2009 at 12:11 PM, Brett Wilkins wrote:
> Hey Colin,
> What you're running into here is the limited accuracy of floating point
> values...
Here the Python Documentation mentioning about the inherent
limitations in dealing with floating point numbers:
http://docs.python.org/tutoria
On Thu, Feb 5, 2009 at 1:37 PM, amit sethi wrote:
> How do you pass arguments of unknown no. of arguments to a function.
You use * operator ( indirection) in the function definition for
arguments and you pass the variable number of number arguments as a
list.
For e.g.
>>> def foo(*args):
...
On Thu, Feb 5, 2009 at 2:27 PM, Alan Gauld wrote:
> In general you can't. You would need to have a Python interpreter
> in your browser.
Alan, I think he was referring to CGI programming. Given the nature of
his first question.
Well continuing the discussion further, I saw a post by Bret Cannon o
> unindent does not match any outer indention level
Means that your Intendentaion is not proper. You should align your print
statement and rest to the same level as if statement.
Use a proper editor that supports Python Syntax.
On Sun, Sep 10, 2017 at 4:32 AM, Elmar Klein wrote:
> Hi there,
>
25 matches
Mail list logo