No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Occasionally I need to make files in certain folder using python. To minimize the clutter which such files might cause I would like to make them hidden. It's pretty easy to do this using windows explorer but I have to do it manually for every file which my script creates. … |
|
data='115Z2113-3-777-55789ABC7777' I have a string in the above format. I want to remove 'ABC7777' from it. If there are any characters other then numbers after the right most '-' symbol, then only the string preceeding it should be retained.i.e., '115Z2113-3-777-55789ABC7777' should be stored in data. 'ABC7777' should be stripped off. … |
|
Hi everybody! I'm trying to write a program that is able to look inside a txt file and change, for example, the first word with a similar word. The txt file will have one word for line. EXAMPLE::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ORIGINAL TXT FILE: tom lives CHANGED TXT FILE: mum lives :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: I … |
|
Hi, When i search for a pattern in a file how do i get the line and line#? basically i want to replicate the 'grep' command functionality. Now i can easily say whether the pattern exists or not using re.search funtion but i'm not able to print that particular line … |
|
Hi everybody! I need to split my path, let's say' "C:\path1\path2\path3\path4" into separate strings... Not sure how to do that, I've tried os.path.split / splitdrive etc. but it always give me just 2 arguments I need to get "C:\path1" from this path string for example, which would be the root … |
|
I have a list of document pages with indicators where each document begins "ND": [CODE] Page1,ND Page2, Page3, Page4,ND Page5, [/CODE] I am trying to format it so that I have a two column csv with the first and last page: [CODE] Page1, Page3 Page4, Page5 etc [/CODE] I cannot … |
|
At various points in my text-based programs, I've had to write a function for use in multiple-choice menus. It needs to have the following qualities: [list][*]Ignores non-number input, repeating the request if it is given a string. [*]Can be given upper and lower limits on the acceptable numbers, repeating the … |
|
This is probably totally absurd, but...is it possible to, through Python, access the command line and use it? For instance, write a program that outputted all of the files in a given directory, much like cd [directory] dir would? |
|
I recently bought a book on Python, and I'm working my way through it. However, I've come to a very simple program, but I can't understand a certain part of the code. Can someone explain? [QUOTE]# Print out a date, given year, month, and day as numbers months = [ … |
|
hi there, my 1 year old carpet python is eating a jumbo rat every 3 days wat is the next thing to feed after jumbo rats please advise thanks wyno |
|
If I have something like this [CODE] a = input("Number: ") b = 2 + a [/CODE] How do I make the answer of b the name of a file? Thanks! |
|
So I have a pyGTK app going on nicely, but it requires sudo permission (under Linux) to perform a BASH operation. If I prompt for a password using a GUI, is there any way I can do my BASH stuff without sudo asking the user for a password in the … |
|
I have been scripting with Python for a few years but I just recently decided to start using some OOP to make my life a bit easier. Although I've read many examples and some chapters and websites, some of the most rudimentary basics still elude me. Here is an example … |
|
Hi, I just joined today and i need some help with python. I just started using python not to long ago in my intro programming class. We have an assignment coming up and i need some help. How do you get the sum of an integer. ie: you put in … |
|
A file is ELL[COLOR="Red"]P[/COLOR][COLOR="Red"]S[/COLOR]YST[COLOR="Red"]A[/COLOR]TL ELL[COLOR="Red"]S[/COLOR][COLOR="Red"]U[/COLOR]YST[COLOR="Red"]L[/COLOR]TL * * *[COLOR="Green"] : . [/COLOR]* * *[COLOR="Green"] :[/COLOR]* * H[COLOR="Red"]H[/COLOR]ULJKL[COLOR="Red"]O[/COLOR][COLOR="Red"]P[/COLOR]OA H[COLOR="Red"]P[/COLOR]ULJKL[COLOR="Red"]P[/COLOR][COLOR="Red"]O[/COLOR]OA * [COLOR="Green"].[/COLOR] * * * * *[COLOR="Green"] : : [/COLOR]* * and it is a long file ..... so output shud be where there is[COLOR="Green"] : [/COLOR]and [COLOR="Green"].[/COLOR] counting start from E and … |