15,175 Topics

Member Avatar for
Member Avatar for Meena Yegappan

Hi I am trying to run a python script which has this code snippet: process = subprocess.Popen('./start_ws.pl') process.wait() os.system('make') The perl script started changes environmental variables and enters into new subshell. After entering into new subshell, the commands below script os.system('make') goes unnoticed.They get executed only if i exit from …

Member Avatar for slate
0
493
Member Avatar for ub007

Hi All, I'm running some tests to assess system behaviour when memory is being hogged. Found this on googling: perl -np -e '$x="0123456789"x1000000' < /dev/zero This works a charm. But my esxi platforms do not have perl installed. They have python supported though:) Any thoughts on how that one liner …

Member Avatar for TrustyTony
0
118
Member Avatar for Ismatus3

Hello , In this python script that do backup of folders , i just dont know why when i execute it printed : > Sauvegarde reussie vers E:\20130521 > Echec de la sauvegarde That means that this part : zip_command = "zip -qr {0} {1}".format(target, ' '.join(source)) # lancement de …

Member Avatar for woooee
0
311
Member Avatar for entropic3105

Where can I download the random module, because I've been looking for weeks and can't find a site where I can download it.

Member Avatar for entropic3105
0
750
Member Avatar for derejetaffese

i need small sample code using python which performs english verbs morphological analysis. Pls some body there, can you help your bro here?

Member Avatar for otengkwaku
0
323
Member Avatar for otengkwaku

hi guy, i have created an app why my beloved python. i have frozen it using cx_freeze for easy distribution but the problem is, on my development computer (win7) it runs perfectly but when i send it to a testing pc (windows XP sp3 32bit) it give me the error …

Member Avatar for vegaseat
0
588
Member Avatar for Sivaram R

models.py class Settings(models.Model): date_format = models.CharField('Date format', max_length=100) time_format = models.CharField('Time format', max_length=100) views.py for saving the date and time format in database as boolean. def date_format(request): settings = Settings.objects.get(user=request.user) settingsForm = SettingsForm(instance=settings) if request.method =='POST': settingsForm = SettingsForm(request.POST,instance=settings) if (settingsForm.is_valid()): settings=settingsForm.save() return redirect('/member/follow-up/') return render_to_response( 'incident/date_format.html', { 'about_menu': True, …

Member Avatar for ChrisPadgham
0
324
Member Avatar for 26bm

Hi, I am tring to make a custom cursor in pygame and I would like to use a XBM file to do so. I am wondering if somebody could please give me an example on how to create a XBM cursor, how to load it into pygame, and how to …

0
144
Member Avatar for Varunkrishna

def word_Rep(text,Dic_Word): rc = re.compile('|'.join(map(re.escape, Dic_Word))) def translate(match): return Dic_Word[match.group()] return rc.sub(translate, text) Dic_Word= { #A Words 'a':'ein', 'an':'eine', 'able':'KOmmen', 'about':'gegen', 'above':'Uber', 'absence':'Abwesenheit', 'absent':'abwesend', 'accent':'Betonung', 'accept':'akzeptieren', 'according':'nach', 'acquainted':'kennen', 'across':'uber' } Text_Trans= raw_input("[*]ENTER THE TEXT TO TRANSLATE:") Trans=word_Rep(Text_Trans,Dic_Word) print Trans please refer the above code. What happens here is that ,if …

Member Avatar for Varunkrishna
0
1K
Member Avatar for 26bm

Hi, I wrote some code using pygame that has two images. I am trying to figure out how transparency works, so I have tried to display a circle png on a square png. My code looks like this. import pygame from pygame.locals import * #make window pygame.init() screen = pygame.display.set_mode((1270, …

Member Avatar for 26bm
0
601
Member Avatar for vegaseat

Just a code sample that allows you to play your midi or mp3 music files with Python and module pygame.

4
2K
Member Avatar for massivefermion

I just downloaded [Python for S60 2.0.0](http://en.wikipedia.org/wiki/Python_for_S60).The instructions say that for using it,I should open PyS60 Application Packager but it complains:«No module named tkFileDialog». I'm using Python3.3.2 And I should say that I know Python for S60 is really old and outdated and that maybe the problem,so I will appreciate …

Member Avatar for TrustyTony
0
210
Member Avatar for vegaseat

You can draw a number of shapes directly on the PyGame window, and then save the drawing to an image file.

3
5K
Member Avatar for rude_god

Hi all I've been messing about with this bit of code. Basically what it's supposed to do is create these six buttons, which when clicked pass a parameter to a function and then call that function. The function basically removes one condition from a larger list depending on which button …

Member Avatar for Lardmeister
0
4K
Member Avatar for otengkwaku

Hi guys i have created a python 2.7 application using PyQt4 and Pyttsx. PyQt4 is a crossplatform GUI library and pyttsx is a text to speach library the code can be found [here](https://github.com/Oteng/timeTracker) Pleace if you have a comment of imporovement let me know thanks

0
99
Member Avatar for RockJake28

So I'm starting to learn python as it's an awesome language from what I've already done in it. I came across an exercise to learn lists and it was basically as follows Create a list of first names and a list of second names and use a for loop to …

Member Avatar for Lardmeister
0
325
Member Avatar for siss

I'm a complete beginner learning Python. I'm writing code to get response of cloudstack api call 'listTemplates'. But what ever i did, it shows a error message like 'Unable to execute API command listtemplates due to missing parameter templatefilter' i have tried to specify thar parameter but failed. can anyone …

Member Avatar for TrustyTony
0
500
Member Avatar for ram619

Hello......I have written a script in which I am telnetting from system1 to system2. There from system2 I am doing ssh to system3. This system3 is a Embedded Board running Linux. Here on system3 I am executing a code that gives me a CLI interface. In this CLI we have …

Member Avatar for ram619
0
173
Member Avatar for vadimak

Hello i need to make a cash register but i dont know how to do it. i was thinking about to make it in loop but i dont know how to make its. i need to input a barcode of product each barcode has price an stock level. In the …

Member Avatar for vadimak
0
544
Member Avatar for dp121307

I'm not sure if its my computer or what. For some reason when I run programs in class they go through fine but after running the same program at home it doesnt seem to work. Basically, what I'm trying to do is create an event handler that draws a circle …

Member Avatar for dp121307
0
378
Member Avatar for chriswelborn

I just wanted to show the basic usage of docopt, a module that makes parsing command-line arguments so much easier. I'm not affiliated with the creators of docopt, but I'm certainly thankful for their work and happy to post this little snippet. I will point you to [docopt.org](http://docopt.org) for more …

1
3K
Member Avatar for clouds_n_things

For those of you who have worked with NMMAP before, Im raising an error each time I run my script. I'm using <python3 nmap_scanner.py -H 10.50.60.125 -p 21, 1720> at the command line to execute the script, and im running into the error: Traceback (most recent call last): File "nmap_scanner.py", …

Member Avatar for chriswelborn
0
2K
Member Avatar for nouth

with terminal is there a way for me to get a list of names that are already taken? like for things like variables and filenames `import` so I can't accidentally name something that will make a bug

Member Avatar for chriswelborn
1
624
Member Avatar for shanki himanshu

the formula for naive bayes is P(A/B1,B2,B3...Bn) = [ P(A) * P(B1/A) * P(B2/A) * . . . P(Bn/A) ] / [ P(B1) * P(B2) *....P(Bn) ] i am working on a project to classify email as spam or not. i have a large data set. i am using nltk …

Member Avatar for shanki himanshu
0
159
Member Avatar for krystosan
Member Avatar for siss

I need to convert python code to javascript. do anyone here know javascript? please give your mail id i will sent the python code to your mail! thanks in advance :)

Member Avatar for TrustyTony
0
172
Member Avatar for nouth

I want to learn about `def` because that looks very the most intriguing how you can make it kind of like reusable but when I was learning I had come some problems with understanding def main(): #renewable code main() if __name__ == "__main__": main() I don't understand what `__name__` and …

Member Avatar for nouth
0
503
Member Avatar for tony75

Hi I downloaded keyboard event and its work very fine. Its capture all keystroke and print it. My question is how can we do it to save to file (for example C: \log.txt) instead to print out . To write out f=open('c:\log.txt','w') but where can I put it :)? import …

Member Avatar for tony75
0
779
Member Avatar for Necrozze

I have a qucik question for you guys. Is there a way to change the taskbar icon? Im done with my game and im gonna show it in class on tuesday 14 and I just thought it would be cool to have an icon that represents the game and not …

0
173
Member Avatar for Varunkrishna

Here I am using askopenfile to upload a (text)file, I also wanted to display the file name next to the upload button and then I want to read its contents and convert it to another language. Say for example if the document is in English I want to convert it …

Member Avatar for woooee
0
2K

The End.