On Wed, Jan 13, 2010 at 9:21 AM, Hs Hs wrote:
> Hi:
>
> I have a tab-delim file:
>
> col1 col2 col3
> andrew1987 1990
> jake 1974 1980
> jim 1964 1970
> lance1984 1992
>
>
> how can I sort column 2 and get :
> jim 1964 1970
> jake
On Wed, Jan 13, 2010 at 9:21 AM, Hs Hs wrote:
> Hi:
>
> I have a tab-delim file:
>
> col1 col2 col3
> andrew1987 1990
> jake 1974 1980
> jim 1964 1970
> lance1984 1992
>
>
> how can I sort column 2 and get :
> jim 1964 1970
> jake
On Wed, Feb 3, 2010 at 7:19 AM, NISA BALAKRISHNAN <
snisa.balakrish...@gmail.com> wrote:
> hi
>
> I am very new to python.
> I have a string for example : 123B new Project
> i want to separate 123B as a single string and new project as another
> string .
> how can i do that.
> i tried using p
On Wed, Feb 10, 2010 at 1:30 PM, Grigor Kolev wrote:
> Hi.
> I want to make a list of E-mail, photos and some additional data.
> But I want this list to be displayed in one site.
> How can I send data from a list of site page. Which module should I use
> --
> Grigor Kolev
>
>
On Wed, Feb 10, 2010 at 1:30 PM, Grigor Kolev wrote:
> Hi.
> I want to make a list of E-mail, photos and some additional data.
> But I want this list to be displayed in one site.
> How can I send data from a list of site page. Which module should I use
> --
> Grigor Kolev
>
>
On Wed, Feb 10, 2010 at 1:40 PM, Harya Dananjaya wrote:
> Can I compile my python source to exe in ubuntu?
> if I can do it, which compiler can do it?
>
> Thanks you,
>
> Harya Dananjaya
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or c
On Thu, Feb 25, 2010 at 4:03 PM, Kirk Bailey wrote:
> test
> --
>
>
> Cheers!
> -Kirk D Bailey
>
> THINK
> +-+
> .*.| BOX |
> ..*+-+
> *** THINK
> ___
> Tutor maillist - Tutor@python.
On Tue, May 25, 2010 at 12:28 PM, M. Bashir Al-Noimi wrote:
> Hi All,
>
> I'm trying to append a new sub-key to specific dictionary but it replacing
> the content of parent key instead of add a sub-key!
>
>
> How I can fix this issue?
>
> --snippet--
>
> addressbook = {
>'work': {
Hey you can use list comprehension here
age_dict = { 'pete': 42, 'ann': 25, 'carl': 30, 'amanda': 64 }
you can create a dict from a list of tuples and you can access the dict as
a
list of tuples by accessing its items
Example:
age_dict = dict([(key.upper(), value) for key,value in age_dict.item
On Mon, Sep 13, 2010 at 9:58 PM, wrote:
> Hi,
>
> I'm parsing IMDB movie reviews (each movie is in its own text file). In my
> script, I'm trying to extract genre information. Movies have up to three
> categories of genres--but not all have a "genre" tag and that fact is making
> my script abort
on't choke if you don't find any rgenres
> because rf.info["genre"] was empty". But maybe I need to define the "None"
> condition earlier?
>
> Basically a text file has this structure:
>
> High Noon
> Drama;Western # But this tag doesn't
On Thu, Sep 16, 2010 at 6:02 AM, Michael Powe wrote:
> Hello,
>
> Strictly speaking, this isn't overloading a method in the way we do it
> in Java. But similar. Maybe.
>
> I am writing a module for processing web server log files and one of
> the methods I provide is to extract a given query pa
On Thu, Sep 16, 2010 at 12:27 PM, Michael Powe wrote:
> Hello,
>
> I have two lists.
>
> alist = ['label', 'guid']
>
> blist = ['column0label', 'column1label', 'dimension0guid',
> 'description', 'columnid']
>
> I want to iterate over blist and extract the items that match my
> substrings in alist
On Thu, Sep 16, 2010 at 12:49 PM, Vince Spicer wrote:
>
>
> On Thu, Sep 16, 2010 at 12:27 PM, Michael Powe wrote:
>
>> Hello,
>>
>> I have two lists.
>>
>> alist = ['label', 'guid']
>>
>> blist = ['column0label
as
__address but get rewritten to _Computer__address (so not private but not
obvious)
class Computer(object):
def __init__(self):
self.__address = None
# see note on private vars in Python
http://docs.python.org/tutorial/classes.html?highlight=private#private-variables
@
line)
#method 2: this will convert a file into an array
data = open("file.txt", "r").readlines()
#method 3: if you had to know the line number
a = []
for i, line in enumerate(open('flie.txt')):
print i, line
a.append(line)
Hope this helps
--
Vince Spicer
Lea
On Thu, Oct 14, 2010 at 10:11 PM, Colleen Glaeser
wrote:
> BTW, the error message my program gives me for the B and M functions is:
>
> Traceback (most recent call last):
> File "I:\Lab 7 wierd stat data.py", line 49, in
> B()
> File "I:\Lab 7 wierd stat data.py", line 44, in B
>
> ((
utor
>
Tim,
Unless you are tied to the standard library I would recommend looking at
httplib2 http://code.google.com/p/httplib2/
This handles your authentication and connection much better then the
standard urllib.
--
Vince Spicer
--
Sent from Ubuntu
__
python.org/mailman/listinfo/tutor
>
Which Operation System?
In linux the user that is running the script must be have read access
chmod +r folder
--
Vince Spicer
--
Sent from Ubuntu
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
Hello Chris
You can manage you path from within your script,
import sys
sys.path.append("/home/user/lib")
Or in bash you can edit your $PYTHONPATH env variable
echo $PYTHO
On Mon, Nov 1, 2010 at 3:58 PM, Chris King wrote:
> On 11/1/2010 5:57 PM, Vince Spicer wrote:
>
>
>
> On Mon, Nov 1, 2010 at 3:54 PM, Chris King wrote:
>
>> On 11/1/2010 5:47 PM, Vince Spicer wrote:
>>
>>
>>
>> On Mon, Nov 1, 2010 at
On Mon, Nov 1, 2010 at 4:00 PM, Vince Spicer wrote:
>
>
> On Mon, Nov 1, 2010 at 3:58 PM, Chris King wrote:
>
>> On 11/1/2010 5:57 PM, Vince Spicer wrote:
>>
>>
>>
>> On Mon, Nov 1, 2010 at 3:54 PM, Chris King wrote:
>>
>>> On 11/1
; > To unsubscribe or change subscription options:
> > > http://mail.python.org/mailman/listinfo/tutor
> > >
> >
> >
>
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subsc
first, grabbing output from an external command try:
import commands
USE = commands.getoutput('grep USE /tmp/comprookie2000/emege_info.txt |head
-n1|cut -d\\"-f2')
then you can wrap strings,
import textwrap
Lines = textwrap.wrap(USE, 80) # return a list
so in short:
import commands, textwrap
Advanced Strings searches are Regex via re module.
EX:
import re
m = re.compile("(FDA.*?(approved|supported)|Ben[^\s])*")
if m.search(Text):
print m.search(Text).group()
Vince
On Mon, May 4, 2009 at 6:45 AM, Alex Feddor wrote:
> Hi
>
> I am looking for method enables advanced text str
you can pass sort a custom compare function
Simple ex:
def compare(x,y):
try:
return cmp(int(x), int(y))
except:
pass
try:
int(x)
except:
return -1
try:
int(y)
except:
return 1
return 0
x = [4, 6, 'word', 3, 9]
x.sort(
Take a peak at commands.getoutput
EX:
import commmands
ls = commands.getoutput("ls- ls")
Vince
On Thu, May 14, 2009 at 3:50 PM, MK wrote:
> Hi there,
>
> i am using this code to send an "cat > ThisIsMyUrl" with popen.
> Of cos cat now waits for the CTRL+D command.
> How can i send this comm
import commands
On Thu, May 14, 2009 at 4:28 PM, vince spicer wrote:
> Take a peak at commands.getoutput
>
>
> EX:
>
> import commmands
>
> ls = commands.getoutput("ls- ls")
>
> Vince
>
>
> On Thu, May 14, 2009 at 3:50 PM, MK wrote:
>
>
simple solution would be to create a lock file before processing,
lock = open("videoname.lck")
lock.close()
On Saturday 16 May 2009 8:26:31 pm Sylvain Ste-Marie wrote:
> I'm currently writing a script to batch convert video for my psp
>
> It basically looks into a folder for video and launch
I've seen this win32 library:
http://videocapture.sourceforge.net via
http://technobabbler.com?p=22
for linux
http://www.antonym.org/libfg
Vince
2009/5/20 Ricardo Aráoz
> Hi, a friend of mine has asked me how difficult would it be to send web
> cam images through python program as a hobby pr
import commands
output = commands.getout("ls -lah")
Vince
On Fri, May 29, 2009 at 3:27 PM, shawn bright wrote:
> Hey all
>
> I have a small program that when run from the command line, will
> return a certain value for an arguement. Like this:
>
> > mfetchz 45
> > 45j
>
> so the program is mfet
Sorry *output
import commands
> output = commands.getoutput("ls -lah")
> Vince
>
>
> On Fri, May 29, 2009 at 3:27 PM, shawn bright wrote:
>
>> Hey all
>>
>> I have a small program that when run from the command line, will
>> return a certain value for an arguement. Like this:
>>
>> > mfetchz 4
regex will do it
import re
line = re.sub(r"\s+", "\t", line)
print line
Vince
On Tue, Jun 2, 2009 at 11:42 AM, jyotsna guleria
wrote:
>
> Hello every one,
>
> I am trying to parse a file:
>
> I want to convert all the spaces in between the characters to single tab.
>
> e.g: my file has con
you could assign loop variable
@staticmethod
def get_form(address=None, postcode=None, town=None, phone=None,
fax=None,
freephone=None, address_country=None, address_region=None,
address_county=None, hotel=None):
context = get_context()
root = co
did you declare factorial before trying to use it?
factorial = 1
print "Factorial finder"
number = int(input("Please enter a non-negative integer: "))
for number in range(number, 1)
factorial = (factorial * number)
print "Factorial:", factorial
On Thu, Jun 11, 2009 at 9:53 AM, Eddie wrote:
no ":" after for statement
Vince
On Thu, Jun 11, 2009 at 10:06 AM, Eddie wrote:
> Thanks, that is my problem.
>
> With that code, why is it giving an error (indenting?) at the end of* for
> number in range(number, 1) *?
>
> 2009/6/12 vince spicer
>
> did y
Like in any language there any number for ways, heres another
b = "bottles of beer"
w = "on the wall"
bottles = range(1, 101)
bottles.reverse()
for bottle in bottles:
print " %s %s %s if one of those bottles should happen to fall there'll
be %s %s %s" % (bottle, b,w, bottle-1, b,w)
Vince
200
Well*
*result = [(ListA[i] - ListB[i-1])/ListA[i] for i in range(len(ListA))*if
not ListA[i] == 0*]
will exclude any results where listA[i] is 0, if you still want these in the
result
you may want to use good'ol for statement instead of list comprehension
results = []
for x in range(len(listA))
14mb file shouldn't be an issue, unless you very little ram, is there any
errors being outputted?
a cleaner way for reading the file:
for line in open("output.new"):
if line.startswith("intrinsic"):
print line
On Mon, Jun 22, 2009 at 2:16 PM, Bryan Fodness wrote:
> I am trying to o
revious ones.
>
> On Mon, Jun 22, 2009 at 4:21 PM, vince spicer wrote:
> > 14mb file shouldn't be an issue, unless you very little ram, is there any
> > errors being outputted?
> >
> > a cleaner way for reading the file:
> >
> > for line in open(&q
os.system is not the best way to handle this you may want to look into
the subprocess module
however:
import os
username = 'charlie'
private_key = '/path/to/key'
ssh = '/usr/bin/ssh'
command = 'hostname && df -h && exit'
servers = ['172.16.1.1', '172.16.12.2', '172.16.1.3']
for host in servers
Pickle is more for storing complex objects (arrays, dict, etc). pickling a
string makes it bigger.
I have stored large text chunks in text and/or blob columns compressed with
gzip.zlib.compress and extracted with gzip.zlib.decompress
Comparison:
import cPickle as Pickle
import gzip
x = "asdfasd
erence whether it is stored it in a TEXT or BLOB column?
>
> Dinesh
>
>
>
> *From:* vince spicer
> *Sent:* Wednesday, June 24, 2009 10:49 AM
> *To:* Dinesh B Vadhia
> *Cc:* tutor@python.org
> *Subject:* Re: [Tutor] string pickling and sqlite blob'ing
>
>
First off, selenium is a great tool and the python driver is very powerful
there are numerous ways to access cli variables,
the 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
le "/usr/lib/python2.6/unittest.py", line 849, in createTests
>self.module)
> File "/usr/lib/python2.6/unittest.py", line 613, in loadTestsFromNames
>suites = [self.loadTestsFromName(name, module) for name in names]
> File "/usr/lib/python2.6/unitt
good catch, my mistake
args[1] == 'yankees'
True
On Wed, Jul 15, 2009 at 12:25 AM, Christian Witts wrote:
> vince spicer wrote:
>
>> First off, selenium is a great tool and the python driver is very powerful
>>
>> there are numerous ways to access cli variable
simple example of calling a class
class myKlass(object):
On Wed, Jul 15, 2009 at 6:33 AM, Kent Johnson wrote:
> On Wed, Jul 15, 2009 at 7:41 AM, Todd Matsumoto wrote:
> > Hi,
> >
> > Can some one give, or point to some good examples of how @decorators
> work, and __call__ (able) objects?
>
>
simple example of calling a class
class myKlass(object):
def __call__(self, *args, **kws):
print "i was called"
>> test = myKlass()
>> test()
>> i was called
>
>
>
> On Wed, Jul 15, 2009 at 6:33 AM, Kent Johnson wrote:
>
>> On Wed, Jul 15, 2009 at 7:41 AM, Todd Matsumoto
>> wr
one way is:
import re
infile = open("test.txt", "r") #: open read mode
outfile = open("out.tx", "w") #: open write mode
for line in infile:
values = re.split("\s+", line) # split values on spaces EX: ['47', '8',
'ALA', 'H', 'H', '7.85', '0.02', '1']
outfile.write("%s %s C = %s CA = %
not sure exactly why you would want to that, but you could assign attributes
to a class
EX:
class storage:
pass
>> store = Storage()
>> name=raw_input()
>> setattr(store, name, zeros(3,3))
>> print store.Chris
On Wed, Jul 15, 2009 at 9:19 AM, chris Hynes wrote:
> I guess I have to sta
agreed much better description, thanks
On Wed, Jul 15, 2009 at 1:02 PM, wesley chun wrote:
> >>> > Can some one give, or point to some good examples of how @decorators
> >>> > work, and __call__ (able) objects?
> >
> > simple example of calling a class
> >
> > class myKlass(object):
> >
> >
s guys,
>
> In the example the __call__ method has *args and **kws as arguments. Is
> that required?
>
> Also when, in what situation would you use callable objects?
>
> Cheers,
>
> T
> Original-Nachricht
>
> > Datum: Wed, 15 Jul 2009 12:02
this should work
def find_value(value, lst):
for obj in lst:
if value in obj.values():
return obj
>> find_value("aaa", my_lst)
Vince
On Thu, Jul 23, 2009 at 9:55 AM, wrote:
> hello,
> please excuse me, but i would like to understand how dictionaris work.
>
> for examp
there are many ways to parse html pages and retrieve data, I tend to use
lxml and xpath to simplify things and urllib to pull down the data
lxml is not a core library but can be installed via easy_install, the main
benefit is the xpath support
=
not perfect or tested but
import re
chopset.reverse() #: put the longer extensions first
exts = "|".join([re.escape(x) fro x in chopset)])
for line in file:
print exts.sub("", line)
On Fri, Jul 24, 2009 at 9:22 AM, vankayala sailakshman <
sailakshm...@hotmail.com> wrote:
>
> Hi All,
>
>
you can build a dictionary and keep the active key, again this would only
work in predictable data
users = {}
name = None
for line in file:
key, value = [x.strip() for x in line.split(":")]
if key == "name":
name = data[1]
users[name] = {}
else:
users[name][d
On Wed, Jul 29, 2009 at 9:59 AM, Raj Medhekar wrote:
> Does anyone know a good webcrawler that could be used in tandem with the
> Beautiful soup parser to parse out specific elements from news sites like
> BBC and CNN? Thanks!
> -Raj
>
>
> ___
> Tutor ma
On Wed, Jul 29, 2009 at 11:35 AM, gpo wrote:
>
> My regex is being run in both Python v2.6 and v3.1
> For this example, I'll give one line. This lines will be read out of log
> files. I'm trying to get the GUID for the User ID to query a database with
> it, so I'd like a sub match. Here is the
On Thu, Jul 30, 2009 at 1:19 PM, Marv Boyes wrote:
> Hello, all. This is probably embarrassingly basic, but I haven't been able
> to find something that works.
>
> I'm working on a script that needs to manipulate a list (not 'list' in the
> Python sense) of URLs returned in a server response. Rig
On Thu, Aug 6, 2009 at 3:18 PM, chase pettet wrote:
> I am trying to write a script to work our LVS implementation. I want to be
> able to have user do something like this "./script SITE SERVER" and have
> the script look up the ip value of the site on that server and issue the
> command to pul
On Thu, Aug 6, 2009 at 3:42 PM, vince spicer wrote:
>
>
> On Thu, Aug 6, 2009 at 3:18 PM, chase pettet wrote:
>
>> I am trying to write a script to work our LVS implementation. I want to
>> be able to have user do something like this "./script SITE SERVER"
On Tue, Aug 25, 2009 at 3:55 PM, wrote:
> Hello,
> I want to strip the first '/' from the following:
>
> '/path/to/file'
>
> How can I do this?
>
> Dave
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
there
On Fri, Aug 28, 2009 at 8:05 AM, kevin parks wrote:
> Back to python after a long long layoff. So i am running into some
> beginner's confusion...
>
> I am trying to plot a list of numbers in gnuplot.py. To do that I am trying
> to pack the list with an index by iterating over the list so i can g
On Fri, Aug 28, 2009 at 9:18 AM, vince spicer wrote:
>
>
> On Fri, Aug 28, 2009 at 8:05 AM, kevin parks wrote:
>
>> Back to python after a long long layoff. So i am running into some
>> beginner's confusion...
>>
>> I am trying to plot a list of numbers
On Fri, Aug 28, 2009 at 10:49 AM, kevin parks wrote:
>
> Thanks for the replies. Though the list comprehension does not work:
>
> TypeError: enumerate() takes exactly 1 argument (2 given)
>
>
> On Aug 29, 2009, at 12:20 AM, vince spicer wrote:
>
>
>>
>>
On Wed, Sep 2, 2009 at 4:30 AM, Anthony Casey wrote:
> Hello, tutors.
>
> I'm someone who used to programme as a hobby and who is trying to get back
> into it via Python. I'm reading Programming in Python 3 by Summerfield
> (excellent book).
>
> I read something unusual about Boolean operations i
On Wed, Sep 2, 2009 at 7:55 AM, Kristina Ambert wrote:
> Hi,
>
> I just wanted to ask if everyone else gets this message as a first reply
> everytime you send out a message to tutor.
> It feels like I'm getting spam or something.
> Geneviève DIAGORN to me
> show details 3:59 PM (17 hours ago)
>
>
On Thu, Sep 10, 2009 at 8:51 AM, Oleg Oltar wrote:
> Hi!
>
> I have the following list
>
> l= [ a, b, c]
>
> Where a,b,c are objects created from one class, e.g. each has title
> attribute.
> What I want to have is a list of titles, e.g. [a.title, b.title, c.title]
>
> Is there a quick way to do
On Tue, Sep 15, 2009 at 10:03 AM, dan06 wrote:
>
> I've recently delved into python, about a week or so ago; I'm trying to
> figure out how to create on-the-fly thumbnails. Are there python standard
> library modules I could/should use or should I use external libraries like:
> GD, Gimp, or Image
On Fri, Sep 25, 2009 at 1:56 PM, waqas ahmad wrote:
>
>
> Hi,
>
> I dont know it is the right place to post this question. I need help to
> change one search code line . can you help me please.
>
> here is my search method code:
>
> search=re.compile("^#acl InternationalGroup.*\n", re.M).search(
On Tue, Sep 29, 2009 at 10:59 AM, wrote:
> I'm trying to make a very simple example to show alternate execution... if
> a
> number is divisible by 3 it will say so and if it isnt, it will say so.
> Heres my
> program
>
> n= raw_input("enter a number= ")
> def divisible(n):
>if n%3 == 0:
>
On Fri, Oct 2, 2009 at 1:24 AM, ggi ggi wrote:
>
> Dear All,
>
> I have some php scripts which I don't want to rewrite in python. How can I
> run php Scripts in python?
>
> Thanks in advance
> Googi G
>
> ___
> Tutor maillist - Tutor@python.o
On Thu, Oct 8, 2009 at 2:38 AM, Ansuman Dash wrote:
> Hi,
>
> Can anybody suggest me a package to verify validity of any kind of IP, i.e.
> IPv4 or IPv6.
>
> Thanks,
> AD
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscript
On Fri, Oct 16, 2009 at 1:45 PM, Nathan Farrar wrote:
> I'm trying to automate the collection of data to remote devices over
> ssh via pexpect. I had originally attempted (with limited success) to
> use paramiko, however due to cisco's ssh implimentation I cannot send
> mulitple commands over the
On Sun, Oct 18, 2009 at 7:29 PM, Wayne wrote:
> Hi, I think I recall seeing this here, but I wanted to make sure I'm
> correct.
> Is the best way to test for an empty list just test for the truth value?
> I.e.
>
> mylist = [1,2,3]
>
> while mylist:
>print mylist.pop()
>
> Thanks,
> Wayne
>
>
On Mon, Oct 19, 2009 at 1:58 PM, Emile van Sebille wrote:
> On 10/19/2009 12:20 PM Alan Gauld said...
>
>
>> "Sander Sweers" wrote
>>
>> mylist = ['John', 'Canada', 25, 32, 'right']
a = [item.upper() for item in mylist if type(item) == type('good')]
>>>
>>> Usually it is recommended t
On Mon, Oct 19, 2009 at 2:14 PM, vince spicer wrote:
>
>
> On Mon, Oct 19, 2009 at 1:58 PM, Emile van Sebille wrote:
>
>> On 10/19/2009 12:20 PM Alan Gauld said...
>>
>>
>>> "Sander Sweers" wrote
>>>
>>> mylist = ['John
On Tue, Oct 20, 2009 at 11:11 AM, Nathan Farrar wrote:
> I haven't been able to find any real examples of pexpect usage, nor
> documentation. Just little bits here and there, so I'm kind of
> struggling through.
>
> I've got the follow bit of code I'm working with:
>
> def main():
>try:
>
On Wed, Oct 21, 2009 at 12:21 PM, Jason Willis wrote:
> hi everyone,
>
> sorry for the rather boring question but i'm having serious issues getting
> my programs to run from the command line without having to type "python"
> in-front of them. I've tried a lot of different variations on the
> #!/us
On Wed, Oct 21, 2009 at 12:31 PM, vince spicer wrote:
>
>
> On Wed, Oct 21, 2009 at 12:21 PM, Jason Willis
> wrote:
>
>> hi everyone,
>>
>> sorry for the rather boring question but i'm having serious issues getting
>> my programs to run from the
On Wed, Oct 21, 2009 at 12:33 PM, vince spicer wrote:
>
>
> On Wed, Oct 21, 2009 at 12:31 PM, vince spicer wrote:
>
>>
>>
>> On Wed, Oct 21, 2009 at 12:21 PM, Jason Willis
>> wrote:
>>
>>> hi everyone,
>>>
>>> sorry for th
7;m sorry , what am I doing wrong here?
>
>
> On Wed, Oct 21, 2009 at 2:31 PM, vince spicer wrote:
>
>>
>>
>> On Wed, Oct 21, 2009 at 12:21 PM, Jason Willis
>> wrote:
>>
>>> hi everyone,
>>>
>>> sorry for the rather boring question b
On Fri, Oct 23, 2009 at 9:05 AM, John wrote:
> I'm using python 2.5
>
> I have a long list of if, elif, else. I always thought it was very NOT
> pythonic. It's easy to read but not pretty.
>
> for fldType in fieldList:
> if "int" in fldType:
> fld = "I"
> elif "char" in fldType :
>
On Sun, Nov 1, 2009 at 5:37 PM, Katt wrote:
> Hello all,
>
> Thank you all for your help. I appreciate it alot.
>
> I have been trying to work with file IO alot recently and would like to
> improve my little program so that I no longer use a hard coded list, but a
> text file that I can edit eas
On Mon, Nov 16, 2009 at 1:18 PM, wrote:
> Hello Tutor list.
> I'm running a test to find what the experimental average of a d20 is, and
> came across a strange bug in my code.
> import random
> list1 = []
> def p():
> d = 0
> for number in range(1,1000):
> t = random.randrange(1,19)
>
2) What is actually going on such that only the first digit is being
> evaluated? That is, the interpreter knows that x is 10 and y is 5-- and
> yet, for some reason the 5 is being tested against the 1 and since 5 is
> bigger than 1, it concludes that 5 is
_dir = "/path/to/whatever"
for r,d,f in os.walk(check_dir):
for dir in d:
loc = os.path.join(r,dir)
last_modified = datetime.fromtimestamp(os.path.getmtime(loc))
if last_modifed < remove_after:
print "delete old directory", loc
else:
print "keep recently modified", loc
Hope this helps,
Vince Spicer
Developer
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
arim
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
--
Vince Spicer
Developer
___
T
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
--
Vince Spicer
___
Tutor maillist - Tutor@python.org
To unsubscribe or
___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Vince Spicer
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Step 1) install Ubuntu
OK sorry couldn't resist.
This should help.
http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/install.html#installing-pyramid-on-a-windows-system
Vince
On Thu, May 31, 2012 at 10:20 AM, Tamar Osher wrote:
> Months ago, I learned Python version 3. I have re
91 matches
Mail list logo