Posts
 
Reputation
Joined
Last Seen
Ranked #430
Strength to Increase Rep
+8
Strength to Decrease Rep
-2
100% Quality Score
Upvotes Received
10
Posts with Upvotes
10
Upvoting Members
7
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
4 Commented Posts
0 Endorsements
Ranked #344
~108.61K People Reached
Member Avatar for a1eio

Hey, Just a simple question really, i was looking through the documentation for python and i couldn't find anything that did basic cd drive things, like ejecting it and stuff. The one module i did find 'cd' was only compatible on IRIX systems. After failing miserably on google i was …

Member Avatar for Mahmoud_16
0
4K
Member Avatar for chris99
Member Avatar for farmwife
0
6K
Member Avatar for Lardmeister

When I run: [code]dec = 255 print hex(dec) [/code]I get 0xff, but I like to get just 'ff'

Member Avatar for bumsfeld
0
5K
Member Avatar for chris99

Just wondering how the game would be put together, maybe even a step by step tutorial. I could use this to practice with the commands used without Tkinter or Pygame. This could be a good learning experience.

Member Avatar for Jacklittle01
0
1K
Member Avatar for sneekula

I need to read in a text file, replace selected words and write the changed text back out to a file. Is there an easy way with Python?

Member Avatar for halamas
0
20K
Member Avatar for sneekula
Member Avatar for TrustyTony
0
6K
Member Avatar for playonlcd

I have read some documentation about python, but no examples on how could you can extract Keys from a double dictionary. To understand better here is an example: Let's say we have the following dictionary: {'AAA': {'KEY1':'text1', 'KEY2':'text2', 'KEY3:' 'text3', 'KEY4': 'text4'}, 'BBB': {'BBB1':{'KEY1':'text1', 'KEY2':'text2', 'KEY3:' 'text3', 'KEY4': 'text4'}, 'BBB2':{'KEY1':'text1', …

Member Avatar for playonlcd
0
481
Member Avatar for back2arie

Hi I have problem to get data from tag (eg: <TEXT></TEXT>). For example the string is like this: [CODE]$string = "<TEXT> Some text </TEXT>"; if($string =~ /<(TEXT)>\s*(.*)\s*<\/\1>/g) { $result = $2; print $result, "\n"; }[/CODE] It works fine, but if the string is like this: [CODE]$string = "<TEXT> Some text …

Member Avatar for k_manimuthu
0
108
Member Avatar for kbalamuk

I want to replace 'nf' with 1.0, so that the resulting string should be: '(1.0+nfpermult+1.0)' I tried various approaches using find(), re.sub but I am not able to make it work. eg. re.sub('nf', '1.0', str) replaces all occurrences of nf. also re.sub('\bnf\b', '1.0', str) does not work either as 'nf' …

Member Avatar for vegaseat
-1
6K
Member Avatar for rehber344

hi everyone ı have a very big text file which is 35mb and that includes 85000 lines. those lines are the rules of ıptales and from the command shell ı do paste and copy and as you can see it that ıs very diffucult to paste every lıne ı trıed …

Member Avatar for woooee
0
184
Member Avatar for masterinex

Hi, I want write a program which extract 'Rated PG for some scary moments and mild language' from the following html file and return it as a list . html file: <div class="info"> <h5><a href="/mpaa">MPAA</a>:</h5> <div class="info-content"> Rated PG for some scary moments and mild language. (also 2009 extended version) …

Member Avatar for vegaseat
0
222
Member Avatar for masterinex

Hi , Im trying to extract the number 7.2 from the html string below using python: '''<a href="/ratings_explained">weighted average</a> vote of <a href="/List?ratings=7">7.2</a> / 10</p><p>''' I thought this would be code to do this .But how come this doesnt work ? averageget = re.compile('<a href="/List?ratings=7">(.*?)</a>') average = averageget.findall(htmlr) Could it …

Member Avatar for ghostdog74
0
97
Member Avatar for dimitar.dk
Member Avatar for JeoSaurus
0
135
Member Avatar for k1w1dad

I have a script for renaming files, but can not seem to iron out the bugs. I am trying to rename a list of files: File1.File1 File2.File2 etc I need them to be renamed to: File1 File2 etc This is the code so far: [code] import os import sys import …

Member Avatar for Gribouillis
0
202
Member Avatar for darnoc

Hi, I am having trouble inserting lines into a file via a Unix shell script, can anyone out there help me with this? Part of my file content looks like this: # default ssl qop [ssl-qop-mgmt-default] default = ALL I now need this part to read as follows: # default …

Member Avatar for darnoc
0
176
Member Avatar for babno

I need to add elements in the middle of a user created array. The closest I found was splice, but from what I read it can only replace. example of what I want to do it take list monkey marble oreo sandle monkey marble smile phone oreo sandle

Member Avatar for babno
0
2K
Member Avatar for qaokpl

I'am trying to build a website and I want to make some things auto mated. I only know html nothing else. A freind of mine make a site similer to what I'am doing but used perl. I want to know more and I can't tlak to this guy anymore.

Member Avatar for ghostdog74
0
161
Member Avatar for Debangana

Hi I am trying to ftp files from a windows server to a unix machine. When I login with the required credentials into the windows server , I want to make sure that the login directory is the correct one else I should change directory before initiating the ftp process. …

Member Avatar for ghostdog74
0
114
Member Avatar for metaface

Hello all, I would like to write a shell script that can scan a directory containing audio files and extract metadata or audio encoding information from the files. The goal is for the shell script to be able to process music files based on embedded data as: Format, Data Rate, …

Member Avatar for ghostdog74
0
501
Member Avatar for Bhoot

i have come across a question which asks to write an awk command that displays all records having 2nd and 3rd characters same. i could write the solution in sed, using tagged regular expression, as follows : [QUOTE] sed -n '/^.\(.\)\1.*$/' emp.list [/QUOTE] However, as far as i know, tagged …

Member Avatar for ghostdog74
0
294
Member Avatar for snahata

Hi, I would like to add a new column in a text file which contains values based on the value of another column. Eg: suppose the text file contains: 1 abc 67 2 def 40 3 uty 57 ....... .... Now i would like to add a new column which …

Member Avatar for ghostdog74
0
386
Member Avatar for pinder

Hi, I'm trying to copy a file in python, I have imported the shutil module My problem is that I want to copy file in a directory beginning with a certain name. Example I have 5 file in the fodler but i want to copy all the one tat begin …

Member Avatar for nrupparikh
0
127
Member Avatar for rusman

I need to read in a list from a file, but I want to always ignore/skip the first line of this file. Right now I'm just cat'ing the file and awk'ing the first column as that's all I need. However, this will also give me the first column of the …

Member Avatar for eggi
0
4K
Member Avatar for phynias

i have a modsecurity log that i want to pull a couple things from. here is an example line [05/Mar/2008:12:50:07 --0800] [[url]www.mydomain.com/sid#1ef44178][/url][rid#2042fa58][//member/index.php][2] Warning. Match of "rx ^OPTIONS$" against "REQUEST_METHOD" required. [file "/usr/local/apache2/modsec/modsecurity_crs_21_protocol_anomalies.conf"] [line "41"] [id "960015"] [msg "Request Missing an Accept Header"] [severity "CRITICAL"] [tag "PROTOCOL_VIOLATION/MISSING_HEADER"] so i want to …

Member Avatar for manik007
0
122
Member Avatar for knish

i am using glob.glob('') function to get a list of all files from a folder. I need to get only those names which do not contain '_ab' in it. How is it possible. I understand the need for regular expressions here. i tried (?!....) . what should work here. example …

Member Avatar for ghostdog74
0
138
Member Avatar for bimaljr

Hi, I just need to know a simple command to bulk renaming. I have hundreds of .DEB files. I want to remove [B]4%3a[/B] from all file names. [B]example :[/B] [I]old name :[/I] ark-kde4_4%3a4.0.3-0ubuntu4_i386.deb [I]new name :[/I] ark-kde4_4.0.3-0ubuntu4_i386.deb I know there is a "rename" command but I don't know it's use. …

Member Avatar for bimaljr
0
184
Member Avatar for yair7190

hi everyone, im trying to write a shell script that calculates memory usage of several processes (i basically run bash several times). here's the script: [code=bash] #!/usr/bin/bash memUsage=`ps -ef | grep bash| awk '{sum+= $2}'` echo $memUsage if $memUsage>130000000000000 ; then echo "mem usage exceeded" else echo "mem usage normall" …

Member Avatar for ghostdog74
0
118
Member Avatar for yair7190

hi everyone, im searching for a way to insert several values i get from a command [top |grep root |awk '{print $10}'] to a variable, so that the variable will contain the sum of all values returned. (trying to calculate MEM usage by all root processes ) can anyone help? …

Member Avatar for ghostdog74
0
136
Member Avatar for picass0

Is there any function in shell that enable to check for upper or lower case? i would like to check the input argumnets for upper or lower case.

Member Avatar for ghostdog74
0
2K
Member Avatar for picass0

i wanted to printout the last entry of the file without passing in any arguments but how can i able to do it? i know how to print out where argument is supplied and doing a grep to match it. example inside the file i have: apple:2:1:3 orange:1:2:3 grape:2:3:4 i …

Member Avatar for ghostdog74
0
114