://mail.python.org/mailman/listinfo/tutor
I use Spyder mainly, also have Geany, SciTe, and Emacs setup but I like
Spyder for pyLint right there, console inside, the ability to run
applications in seperate threads and many more useful features.
--
Kind Regards,
Christian Witts
http://www.brpreiss.com/books/opus7/html/book.html
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
.
As for how fast it is by comparison, I unfortunately don't have time to
benchmark it.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
the math background and worked out how to efficiently
solve
problems.
Thanks,
Todd
Christian Witts wrote:
C.T. Matsumoto wrote:
Hello Tutors,
Can someone point me to any resources that can teach me about
algorithms in python?
I'm interested in learning how to analyze and make an algorithm
allowing input until the person enters 3 numbers
seperated purely by commas in for input.
--
Kind Regards,
Christian Witts
Business Intelligence
C o m p u s c a n | Confidence in Credit
Telephone: +27 21 888 6000
National Cell Centre: 0861 51 41 31
Fax: +27 21 413 2424
E-mail: cwi...@compuscan.co.za
like {Date: {Keyword1:
Count, Keyword2: Count}. Essentially you would just iterate over the
file, check if the line contains your keyword(s) that you are looking
for and then incrementing the counter for it.
--
Kind Regards,
Christian Witts
Business Intelligence
C o m p u s c a n | Confidence
be really careful with its usage.
If I remember correctly there was a recipe for safe parsing on
http://code.activestate.com/ but I don't seem to have the link at hand.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
://mail.python.org/mailman/listinfo/tutor
You can just open the file again in write mode which will truncate it
for you.
So, f = open(filename, 'w') will clear the contents of your filename
(don't forget to close the file when you're done if you do this though).
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Are you maybe looking for `dc = {y:x for y,x in zip('khalid', range(6))}` ?
--
Kind Regards,
Christian Witts
, or does it depend on the file format?
I will eventually be working with Excel and possibly mssql tables.
Thanks again for your help.
Roy
On Thu, Dec 3, 2009 at 3:46 AM, Christian Witts
cwi...@compuscan.co.za mailto:cwi...@compuscan.co.za wrote:
Roy Hinkelman wrote:
Your list
subscription options:
http://mail.python.org/mailman/listinfo/tutor
Hope the comments above help in your endeavours.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http
is in dictionary. It would also work for this scenario
of perfect data as well.
Hope that helps.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman
.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
In the console when you start it up you appear to be in your home
directory `~` but your script is in the Documents folder so you will
need to add Documents to your path for eg.
from sys import path
path.append('/path/to/script/to/be/imported')
import gun
--
Kind Regards,
Christian Witts
or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
You can take a look at this link and see if it can help you
http://www.1stbyte.com/2005/06/26/configure-and-compile-python-with-zlib/
--
Kind Regards,
Christian Witts
___
Tutor
listed in the TODO.
Advise is appreciated.
On Mon, Oct 26, 2009 at 2:12 PM, Luke Paireepinart
rabidpoob...@gmail.com mailto:rabidpoob...@gmail.com wrote:
On Mon, Oct 26, 2009 at 3:20 AM, Christian Witts
cwi...@compuscan.co.za mailto:cwi...@compuscan.co.za wrote:
fInput
asking as I'm away from my linux box
atm.
for line in open(log_file):
last_log_date = ' '.join(line.split(' ')[:3])
Thanks.
On Tue, Oct 27, 2009 at 2:56 PM, Christian Witts
cwi...@compuscan.co.za mailto:cwi...@compuscan.co.za wrote:
bibi midi wrote:
#!/usr/bin/env python
': 200}
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
),
converts it into an integer and adds it to your total_usage counter.
Of course this has no error checking and or niceties, but I will leave
that up to you.
Hope that helps.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
be able to type in on the console.
Hope that helps.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
single time
you try to make a choice rendering it slower than `if start = choice = stop`,
although on a small choice set the speed difference would hardly be noticeable.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
'You used a word I
did not understand' because the success variable is still False.
This is just a rather basic idea, but it will get the job done.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
/listinfo/tutor
This one came through, I also have 57 emails originating from you since
the 8th of July 2009.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http
guess is incorrect it would just loop
infinitely (it's currently 1 level of indentation out, as well as your
`tries += 1`).
Welcome to Python and hope you enjoy your stay. :)
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
(Please upgrade to Python 2.4 or greater.)
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Todd Zullinger wrote:
Christian Witts wrote:
Your version will fail if the person is running Python 3.0, 3.1 up
until the 3.3 series which is not good. Neater looking (imo) code
below.
from sys import version_info, exit
if version_info[0] == 1 or (version_info[0] == 2 and version_info[1
subscription options:
http://mail.python.org/mailman/listinfo/tutor
That would need to have a starting value of -1 and an end value of
-(len(phrase)+1). Of else you can start at length - 1, end at zero and
a step value of -1.
--
Kind Regards,
Christian Witts
://mail.python.org/mailman/listinfo/tutor
s = 'Büro'
for ch in s:
... print ch
...
B
�
r
o
You need to make it a unicode string.
s = u'Büro'
for ch in s:
... print ch
...
B
ü
r
o
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
this python code
k = []
s = u'Büro'
for c in s:
k.append(c)
print k
k=[u'B', u'\xa8', u'\xb9', u'r', u'o']
i still have 5 different chars.
2009/9/4 Christian Witts cwi...@compuscan.co.za
zhang allen wrote:
Hi All,
Say i have unicode string * Büro*.
i want to iterate
better off calling
a shell script with the cron job and in the shell script listing certain
environment variables you might need and then calling the script. The
job won't be running under your normal user account so you might need to
add them.
--
Kind Regards,
Christian Witts
?
MIke
On Thu, Sep 3, 2009 at 2:45 AM, Christian Witts
cwi...@compuscan.co.za mailto:cwi...@compuscan.co.za wrote:
Michael Yang wrote:
Hi Everyone,
I'm new to programming and to python.
I have a program I want to run on my Media Temple Virtual
Server (dv) - Linux
for ages.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
of that function there are no variables names burgerPrice,
friesPrice or sodaPrice.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
,
Christian Witts
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
file.split('.svg')[0]
You could also use split to get rid of the Flag_of_ by doing
file = file.split('.svg')[0].split('_')[2]
or you could use replace for it
file = file.split('.svg')[0].replace('Flag_of_', '')
--
Kind Regards,
Christian Witts
___
Tutor
: # Dictionaries can be accessed this way and it
looks cleaner.
new_filename = 'flag-%s.svg' % countries[fn] # String
formatting is neater and faster than concatenation
rename(filename, new_filename)
--
Kind Regards,
Christian Witts
simpler and faster to just use the strings build in index
and item assignment.
Hope that helps.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Chris Castillo wrote:
why does your 3rd and fourth lines have brackets?
On Thu, Jul 16, 2009 at 1:08 AM, Christian Witts
cwi...@compuscan.co.za mailto:cwi...@compuscan.co.za wrote:
Chris Castillo wrote:
I'm having some trouble reading multiple data types from a
single
Wayne wrote:
On Thu, Jul 16, 2009 at 4:06 AM, Christian Witts
cwi...@compuscan.co.za mailto:cwi...@compuscan.co.za wrote:
snip
Strings are essentially a list already of characters. What would
be slowing down your preferred method #1 would be your explicit
cast to a list
sue above average
jim perfect
On Thu, Jul 16, 2009 at 4:12 AM, Christian Witts
cwi...@compuscan.co.za mailto:cwi...@compuscan.co.za wrote:
Chris Castillo wrote:
why does your 3rd and fourth lines have brackets?
On Thu, Jul 16, 2009 at 1:08 AM, Christian Witts
cwi
:
['selenium-google-test.py', 'yankees']
so
args = sys.argv
args[0] == 'yankees'
True
That would be false, the first argument (list index zero) is the script
name. You would need to do
args = sys.argv[1:]
if you want to dump the filename from the list.
--
Kind Regards,
Christian Witts
like with the lists.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
etc as you can very easily end up with unexplained errors.
Hope that helps.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
if it doesn't match still you will need to do a .strip() on your guess.
Hope that helps.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
or if it is just printable characters then maybe look at string
translation tables and the string.replace methods to cull out what you
do not need.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo
. print(Hello world!)
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Forwarding to the list.
Original Message
Subject:Re: [Tutor] Print on 3.1 for Mac?
Date: Mon, 29 Jun 2009 12:38:43 +0100
From: andré palma andre...@gmail.com
To: Christian Witts cwi...@compuscan.co.za
References:
ac56af79a36314157de09d7d78770ffa.squir
?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Python 3.0+ print has been changed to a function so you need to do
print(Hello World!)
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
http
/listinfo/tutor
Running from a console the expected output would actually be
06-08-2009.gz
The name of the file will be 06-08-2009.gz
Other than that side effect it works with only 1 print.
--
Kind Regards,
Christian Witts
Data Management
C o m p u s c a n | Confidence in Credit
Telephone: +27 21
your stay. :)
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
] == ['142', '152']:
print IP, Cnt
Obviously if you want to keep the original log line then you will need
to store that in your dictionary as well, but for the purpose of
reporting how many 'offences' an IP Address has had this is simple enough.
--
Kind Regards,
Christian Witts
Paras K. wrote:
There are no headers for the log files, and there are mulitple log
files so what that walk through the directory for all csv files?
THANK IN ADVANCE!!!
On Wed, May 27, 2009 at 10:18 AM, Christian Witts
cwi...@compuscan.co.za mailto:cwi...@compuscan.co.za wrote:
Paras K
the Mutable
defaults for function/method arguments section of
http://www.ferg.org/projects/python_gotchas.html#contents_item_6
Hope that helps your understanding.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
http
this, just wondering
about the use case for such automation ?
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
prasad rao wrote:
Any particular reason why you need to be able to do this, just
wondering about the use case for such automation ?
--
Kind Regards,
Christian Witts
Thank you Christian for the prompt repply.
I am learning python.
I am just examining what are all
for such automation ?
--
Kind Regards,
Christian Witts
Hello
It is printing wether the item is callable or not.
I want it to print
sys.getdefaultencoding
ASCII
sys.getfilesystemencoding
mbcs
Like that
Prasad
My apologies, didn't double check.
It should be:
for attrib in dir
Take a look at this topic http://forum.qgis.org/viewtopic.php?f=5t=4341
It's from November 2008 so should still be current.
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
to do the heavy lifting for you
import string
funcs = {1:string.upper, 2:string.lower}
funcs[1]('this is a simple test')
'THIS IS A SIMPLE TEST'
funcs[2]('THIS IS A SIMPLE TEST')
'this is a simple test'
--
Kind Regards,
Christian Witts
___
Tutor
, None, None]
numeric_list.sort(); string_list.sort();
numeric_list, string_list
([3, 4, 6, 9], ['word'])
string_list.extend(numeric_list)
string_list
['word', 3, 4, 6, 9]
--
Kind Regards,
Christian Witts
___
Tutor maillist - Tutor@python.org
http
)
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
What you are doing is already fine although you can drop the starting
index for the first slice
l=[1,2,3,4,5,6,7,8,9,10]
l[:2], l[2:]
([1, 2], [3, 4, 5, 6, 7, 8, 9, 10])
--
Kind Regards,
Christian Witts
101 - 161 of 161 matches
Mail list logo