Appreciate the responses, guys.
I now see the difference between the ways I was trying to call
function(s).
R.D.
--
http://mail.python.org/mailman/listinfo/python-list
Can someone help me understand why Example #1 & Example #2 will run
the functions,
while Example #3 DOES NOT?
Thanks for your time!
R.D.
def One():
print "running fuction 1"
def Two():
print "running fuction 2"
def Three():
print "running fuction 3"
# Example #1
fList = ["Two()","Thr
On Sep 16, 2:47 pm, Benjamin Kaplan wrote:
> On Thu, Sep 16, 2010 at 3:35 PM, DataSmash wrote:
> > I need to create a simple utility to remove characters from either the
> > right or left side of directories.
> > This works, but there has to be a better way. I tried to use
I need to create a simple utility to remove characters from either the
right or left side of directories.
This works, but there has to be a better way. I tried to use a
variable inside the brackets but I can't get
that to work. Can anyone think of a way to do this with less code?
Thanks!
import
On Jun 5, 3:50 am, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Jun 4, 5:30 pm, DataSmash <[EMAIL PROTECTED]> wrote:
>
> > Hi group,
> > I have a text file that contains thousands of lines and each line is
> > 256 characters long.
>
> > This is my tas
Hi group,
I have a text file that contains thousands of lines and each line is
256 characters long.
This is my task:
For each line in the file, move to the 25th character, if the
character is a "T",
move to the 35th character of the line and read 5 characters from
there.
Capture these 5 characters
Joe & Mike,
Thanks for your input!
R.D.
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I have a list that looks like this:
roadList = ["Motorways","Local","Arterial"]
I want to apply some code so that the output looks like this:
"Motorways;Local;Arterial"
...in other words, I want each item in the list separated by a ';' and
then the whole thing surrounded by quotes.
How c
On Feb 15, 1:32 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> Chris wrote:
> > On Feb 15, 7:10 pm, DataSmash <[EMAIL PROTECTED]> wrote:
> >> I simply want to capture the free disc space in a variable so that I
> >> can compare changes. I'm aware of a few
I simply want to capture the free disc space in a variable so that I
can compare changes. I'm aware of a few commands like "df -h" or "du -
k", but I can't figure out how to capture those values as a variable.
I also looked at os.statvfs(), but that output doesn't seem to make
any sense at all to
Thanks Larry, I'll give that a try...
R.D.
>
> Use win32.moveFile method instead. This links directly to the Windows
> MoveFile method that just moves the directory entries around.
>
> From Win32 Documentation:
>
> win32api.MoveFile
> MoveFile(srcName, destName)
>
> Renames a file, or a directo
Hi,
I need to organize thousands of directories full of files.
I want to move these directories into other subdirectories.
For example, all the directories that start with 01, move to
a directory named "one", all directories that start with 02, move
to a directory name "two", and so on
I can't
Really appreciate all the all the different answers and learning tips!
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I need to search and replace 4 words in a text file.
Below is my attempt at it, but this code appends
a copy of the text file within itself 4 times.
Can someone help me out.
Thanks!
# Search & Replace
file = open("text.txt", "r")
text = file.read()
file.close()
file = open("text.txt", "w")
A simple way to get all the files throughout the directory sturcture...
You may have to rewrite the "CONVERTING" part.
import os, glob
for root, dirs, files in os.walk(os.getcwd()):
for file in files:
if file.endswith(".mp3"):
print "File: " + os.path.abspath(os.path.join(
Hi Miki,
I appreciate you taking the time to figure out what I was trying to do.
This is exactly what I was looking for.
I plan on studing this code and looking at the wxpython demo as you
mentioned.
Thanks again!
R.D. Harles
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I've created a simple form with 2 radio boxes, 2 text boxes and a
button.
When I click the button, I'd like to write each "choice" to a text
file.
I can't figure out how to "link" the onClick event to the other 4
controls.
Any help would be much appreciated!
R.D. Harles
import wx, sys
cla
Thanks!
I ended up using the "-d" parameter.
I did try the zipfile module but I couldn't figure it out, nor could I
find any examples using it.
I also didn't have any luck changing the working dircectory and making
it work.
import subprocess, os
# Get all the zip files in the current directory.
f
I need to unzip all zip file(s) in the current directory
into their own subdirectories. The zip file name(s) always
start with the string "usa" and end with ".zip".
The code below will make the subdirectory, move the zip
file into the subdirectory, but unzips the contents into the
root (current) d
I'm looking for software to create a simple GUI to execute python code
for users in the office.
The GUI would need a couple text boxes for user input and some option
buttons and check boxes.
Can anyone recommend free software that doesn't require a huge learning
curve?
My python skills are probably
Thanks for explaining and all the additional ideas!
R.D.
--
http://mail.python.org/mailman/listinfo/python-list
I'm confused. Why is it that when I say "while len(list) < 5:", I get
5 items in my list.
If I say "while len(list) < 6:", I get 6 items in the list and so on.
I would think if I said "less than 5", I would get 4 items.
Can anyone explain this?
Thanks.
R.D.
# Start an empty list
list = []
while
Much Thanks!
I deleted the random.pyc and renamed the script and everything is good!
R.D.
--
http://mail.python.org/mailman/listinfo/python-list
Much Thanks!
I deleted the random.pyc and renamed the script and everything is good!
R.D.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
When I import the random module at the python interpreter, it works
fine:
>>> import random
>>> x = random.randint(1,55)
>>> print x
14
>>>
BUT, when I put the same code in a python script:
* random.py:
import random
x = random.randint(1,55)
print x
and run it at the command line, I get:
Tr
Awesome! That worked!
Much thanks to Peter and all of you who took the time to answer my
question.
R.D.
--
http://mail.python.org/mailman/listinfo/python-list
OR...if python can't handle this type of text file,
what do I need to do to remove the "\n" from the file?
--
http://mail.python.org/mailman/listinfo/python-list
I am using bash shell on windows and I'm getting the error:
TypeError: loop over non-sequence
Is there any way around not messing with the text file.
I want to batch generate the text lists as well.
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I think I've tried everything now and can't figure out how to do it.
I want to read in a text list from the current directory,
and for each line in the list, make a system directory for that name.
My text file would look something like this:
1144
1145
1146
1147
I simply want to create thes
29 matches
Mail list logo