User Profile

Collapse

Profile Sidebar

Collapse
Bouzy
Bouzy
Last Activity: Nov 24 '08, 09:58 PM
Joined: Jun 25 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Bouzy
    replied to File log
    The point was though I didn't want to have to type that code 4 times and make the script really long. (I would need it typed every time I typed datalog()) Is there a way to shorten the code by not needing to type ...

    Code:
    for root,dirs,files in os.walk(cwd):   
       for folder in glob.glob(root):
          for file in glob.glob(folder + '/*.**'):
             file_path = os.path.split(file)[1]
             size = os.stat(file)
    ...
    See more | Go to post

    Leave a comment:


  • Bouzy
    started a topic File log

    File log

    I am trying to make a script to check files in a folder, then see later if the files have been changed at all..

    I have this working to make the original file (data log with files,file_size s, and dates).

    Code:
    log_file = open('log_file.txt', 'w')
    
    for root,dirs,files in os.walk(cwd):   
       for folder in glob.glob(root):
          for file in glob.glob(folder + '/*.**'):
             file_path = os.path.split(file)[1]
    ...
    See more | Go to post

  • Thanks! That worked exactly as needed.
    See more | Go to post

    Leave a comment:


  • Bouzy
    started a topic Finding all numbers in string and replacing with ''

    Finding all numbers in string and replacing with ''

    I have a list of words and am trying to replace all the numbers in my list with whitespace.

    Code:
    for word in words:
          numbers = re.search('[0-9]+', word)
          word = clearup(word)
          if word in dictionary:
             pass
          else:
             print word
    Code:
    def clearup(tor):
    
       numbers = re.search('[0-9]+', tor)
       return tor.replace('%s' % numbers, '')\
    ...
    See more | Go to post

  • Bouzy
    replied to 2 line Function doesn't work
    Thanks, with your help and some other things I did I got it fixed, but the reason I didn't use your second example is because I was going to reuse the function because it's replacing not just ','s but every punctuation mark in the English language.

    Problem solved.
    See more | Go to post

    Leave a comment:


  • Bouzy
    started a topic 2 line Function doesn't work

    2 line Function doesn't work

    I am trying to go through words in a list of words and take out all the '.'s. I made the function ...

    Code:
    def clearup(tor): 
    
       tor = tor.replace('.', '')
    Code:
    words = fcheck.read().split()
    
     for word in words:
          clearup(word)
          if word in dictionary: # dictionary is a tuple of words
             pass
          else:
             print word
    why doesn't...
    See more | Go to post

  • Bouzy
    started a topic Keep windows from zipping up a file.

    Keep windows from zipping up a file.

    I wrote this script...

    Code:
    #!/usr/bin/python
    # Filename: backup_zip.py
    
    import os, zipfile, time, datetime, glob
    from os.path import splitext, relpath, split
    
    r = 1
    cwd = os.getcwd()
    today = datetime.date.today()
                 
    def backup():
    
       for dirpath,dirs,files in os.walk(cwd):
    
          for file in files:
       
             z_path
    ...
    See more | Go to post

  • Bouzy
    replied to What is your OS and Python Version
    Windows XP
    Python 2.5
    Mainly I use IDLE
    See more | Go to post

    Leave a comment:


  • Bouzy
    started a topic os.path pathname manipulations

    os.path pathname manipulations

    Code:
    for dirpath,dirs,files in os.walk(cwd):
    for file in files:
    
    global z_path
    z_path = os.path.  # WHAT WOULD GO HERE #  (dirpath)   
    
    print z_path
    This is part of a script where I am tying to grab the names of folders and an undetermined number of sub-folders/files and print them to screen. I don't know how deep the sub-folders will go. Currently when I do this...
    See more | Go to post

  • Bouzy
    replied to Backup with zips
    When I run your code it doesn't give any errors. However, it doesn't work. When I run this as my code...

    Code:
    #!/usr/bin/python
    # Filename: backup_zip.py
    
    import os, zipfile
    
    r = 1
    
    while r == 1:
    
       print "This script when run backs up files in a directory by comressing them to zips. "
       begin = raw_input("Do you wish to back up files in this directory
    ...
    See more | Go to post

    Leave a comment:


  • Bouzy
    started a topic Backup with zips

    Backup with zips

    I am attempting to write a script to zip all directories in current directory into zip files. e.g. [If a directory has 2 folders in it and my script is run in that directory I want it to create two zips (one for each folder) and keep the tree organization in the zip]. Currently I have this...

    Code:
    #!/usr/bin/python
    # Filename: backup_zip.py
    
    import os
    import zipfile
    import glob
    
    r = 1
    ...
    See more | Go to post

  • Bouzy
    replied to Space
    If it helps hear is the url I just put it up. For some reason the images don't show up.... but if this helps explain why it looks good in IE7 and FF but not IE6 or 5.5 then good.

    http://goldfishgraphics.110mb.com/...
    See more | Go to post

    Leave a comment:


  • Bouzy
    started a topic Space

    Space

    I had my site done, but I looked at it in IE6 and it was messed up even though it looked fine in IE7 and FF. I used a conditional statment so now when it loads in IE6 it loads a different style sheet. However I don't know what is causing the gap to the right of my layout next to the banner and stuff or any of my other problems. Does anyone know?
    Code:
    <pre class="alt2" dir="ltr" style="border: 1px inset; margin:
    ...
    See more | Go to post

  • Bouzy
    started a topic Tables positioning

    Tables positioning

    I have been trying to make some very basic forms. Everything I think should work once I get it on my server, but it looks like crap. I know you are supposed to use tables for an easy way to position. I know really nothing about tables. I just sort of guessed on what to do this is what I came up with.

    Code:
    <?php
    include('includes/corefuncs.php');
    if (function_exists('nukeMagicQuotes')) {
       nukeMagicQuotes();
    ...
    See more | Go to post

  • Bouzy
    replied to lightbox
    Nevermind I had the wrong image path, but it still works for all my browsers exept IE. In ie it just shows up like a image would if you looked at its url. Anyone know anything about that?
    See more | Go to post

    Leave a comment:


  • Bouzy
    replied to lightbox
    yes I have the #
    <script type="text/javascript" src="lightbox.j s"></script>

    and lightbox.js is saved as a js file in my thing with the script in it. I will show you.

    ...
    See more | Go to post

    Leave a comment:


  • Bouzy
    started a topic lightbox

    lightbox

    I have been trying to put lightbox on my site I am making, but its not working. I have searched on forums and can't find exactly the same problem. When I click on my thumnail to open it abosolutly nothing happens. It just says done in my loading bar on firefox.. I think I have everything required to do it. I have the tag in the head I have a seperate css sheet thats linked to I have the link line of java stuff. I will show you my code and if you...
    See more | Go to post

  • Bouzy
    started a topic Forms
    in PHP

    Forms

    Hello I am having a problem with forms. I know they are easy for some people, but I am new. I am trying to make a simple feedback form. Hear is what I have so far...
    [code=php]
    <?php

    //process the email
    if (array_key_exis ts('send', $_POST)) {
    $to = 'goldfishgraphi cs@gmail.com'; //use your own email
    $subject = 'Project Idea';

    //process the $_POST variables
    $name =...
    See more | Go to post
    Last edited by pbmods; Jul 19 '07, 11:54 PM. Reason: Added CODE tags.

  • Bouzy
    started a topic Div differs in (yes once again) Firefox vs IE

    Div differs in (yes once again) Firefox vs IE

    I have a problem that I know gets asked about a lot. Its how my page differs in IE vrs. Firefox. I know IE sucks, but hears whats going on.

    IE... http://i93.photobucket.com/albums/l7...uzy/IEGOLD.jpg

    Firefox... http://i93.photobucket.com/albums/l7...zy/FIREFOX.jpg

    (Note the positioning of the text in the sidebars)

    I hate the fact that my pages look sweet in Firefox, but not...
    See more | Go to post

  • Bouzy
    replied to Change the web page color!!!!???
    I am not sure how to do it, but I would suggest PHP it would work on everyones computer then also php is great code for copying and pasting. Goolge php and what you are looking for see if you can find a solution.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...