Posts
 
Reputation
Joined
Last Seen
Ranked #3K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
88% Quality Score
Upvotes Received
8
Posts with Upvotes
6
Upvoting Members
8
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
1 Commented Post
~34.2K People Reached
Favorite Tags

23 Posted Topics

Member Avatar for Cup of Squirrel

[QUOTE=Rete;130037]I have another problem with pythons Input, and I was wondering if someone could help me. Whenever I get any input from the user, python keeps printing out on a new line. So for example: [B]test = raw_input ("Input word")[/B] [B]print "Why "+ test +" there a line break all …

Member Avatar for Jason_15
1
18K
Member Avatar for Hummdis

I've tried this a number of different ways and I've even downloaded the Regular Expression reference sheet from addedbytes.com, but I just can't figure out how to move this eregi_replace() statement into a preg_replace() statement. I've read and understood the delimiter requirements for preg_replace(), but I think the problem is …

Member Avatar for Hummdis
0
245
Member Avatar for jacksantho

You need to modify your php.ini file to increase the max_execution_time setting to a value higher than 60 seconds. Or...streamline your code if possible to perform the work in under 60 seconds, if possible that is.

Member Avatar for Hummdis
0
6K
Member Avatar for lloydsbackyard

You shouldn't be asking people to write your code for you, it appears you're doing this for school or some other project. However, to direct you in the right direction, have a look at the PHP 'explode()' function. [URL="http://www.php.net/manual/en/function.explode.php"]http://www.php.net/manual/en/function.explode.php[/URL] There are some examples on that page that should show you …

Member Avatar for lloydsbackyard
0
195
Member Avatar for chaychie

Your 'update' link needs to be it's own form. You have 'form1', so make this 'refreshForm' or the like. Once you've create the form, the form action needs to be something like: [code]action="update.php?update=true"[/code] That is, if the file is named 'update.php'...use whatever file name you've given. Then, you'll need to …

Member Avatar for Hummdis
0
148
Member Avatar for ryan311

Are you trying to just validate that the first four characters of a username consists of alphabetic characters? You can use the "substr" function: [code]$username = "MyUser"; if(preg_match('/[A-Za-z]/', substr('abcdef', 0, 4)) { $valid = true; } else { $valid = false; }[/code]

Member Avatar for mschroeder
0
89
Member Avatar for nyler01
Member Avatar for Hummdis
0
210
Member Avatar for arthurav

Since "header()" doesn't provide any output (at least not to my knowledge), the only way I can see this working for you is to use cookies. Redirect with a variable in the URL, for example: [code=php]$cname = "nopage"; $cvalue = ""; $cexpire = time()+3600; // 1 hour $cpath = ""; …

Member Avatar for Hummdis
0
113
Member Avatar for ewiggin

You need to run the file from the Windows command line, not the Python command line. You should also be able to select "Run" from within the Python IDE in Windows. For example: [code] C:\Users\user1\Python Files> python script1 [/code] It may also be easier for you to just run it …

Member Avatar for Hummdis
0
154
Member Avatar for nsutton

Open the file and place it in a list (this puts the file in memory). From that list, keep track of your location in the list. If the item is found, confirm the delete request, then delete the list item (line). For example: [code=python] #if editing if action2 == '2': …

Member Avatar for nsutton
0
2K
Member Avatar for nsutton

[QUOTE=nsutton;1200219]How can i use this code (below) to take the random numbers from the dice roll and change 6 to "A" and 5 to "K" and ect.[/QUOTE] Use a Python dictionary...or two. [code=python] #!/usr/bin/env python import sys, random dice_to_cards = { 1:'9', 2:'10', 3:'J', 4:'Q', 5:'K', 6:'A' } hand = …

Member Avatar for Hummdis
0
4K
Member Avatar for joshua91

This is my opinion of having a yes/no question with a default, but you should capitalize the default letter and leave the other lowercase. You also need to take into account that the raw_input() function will provide you with a line break as well (\n) and therefore should be striped. …

Member Avatar for Hummdis
0
158
Member Avatar for Romber

First, in your mainPage() function, you can't do this: [code=python] s +='<a href = http://www.speedfinance.appspot.com/microsoft>Microsoft</a>\n' return s for name in company: generateMainPage(company [/code] You're returning before you reach the 'for' loop. The loop will never be executed and you *should* be getting a Python indentation error, as well a syntax …

Member Avatar for Hummdis
0
638
Member Avatar for micka10

Though I've never used it, try [url=http://pymediaserver.sourceforge.net/]PyMediaServer[/url].

Member Avatar for Hummdis
0
117
Member Avatar for Romber

Why don't you take all of the content for the "mainPage()" function, put it in a text file, then open and read the lines? There's not a single line of actual Python code and it's basically a waste of space. You're not even performing string replacement, so it brings nothing …

Member Avatar for Hummdis
0
142
Member Avatar for pythonnewbie10

Your 'playgame()' def doesn't actually return anything. Why not return a 1 for win or a 0 for loose. Then, in your main() function, use: [code=python] ### Main Script wins = 0 games = 0 while 1: result = playgame() if result == 1: win += 1 pass games += …

Member Avatar for TrustyTony
0
153
Member Avatar for Hummdis

I'm using Python and the Python CGI module to do some web development for a system's administrative access page. The problem I have is that the current features allow you to reboot the system, power off the system and stop/start/restart system services. The system is very limited in what's running …

Member Avatar for Hummdis
0
375
Member Avatar for Hummdis

I have a toaster system that does one thing. I'm looking to provide some network troubleshooting ability to the extremely stripped Linux OS by providing the 'dig' command. However, it appears that 'dig' is only available via the 'bind' package. My questions is: has anyone ever successfully buildt a dig …

Member Avatar for Hummdis
0
163
Member Avatar for Hummdis

I've been going through some PHP code for an open source applications and I've been seeing a lot of use of the "@" symbol in front of functions. For example: [code=php] if (!@copy($_FILE['attachment'], $dest)) { return $error['failed']; } [/code] My question is: what is the "@" symbol in front of …

Member Avatar for Hummdis
0
163
Member Avatar for Hummdis

I've been writing PHP for about two years now, nothing complex, mostly just HTML form processing scripts. My latest project for a customer has over 40 items in the form. It's a dynamic form using some JavaScript and PHP that displays certain parts of the form based on other options …

Member Avatar for Hummdis
0
178
Member Avatar for Millsy013
Member Avatar for network18
0
84
Member Avatar for valonesal

[quote] What I want to be able to do is display a different image depending on the url such as mywebsite.com/index.php?name=aname=red or mywebsite.com/index.php?name=aname=blue and it displays a red or blue image depending.[/quote] You would have to supply two variables in the URL, then use $_GET. I do this same thing, …

Member Avatar for Hummdis
0
113
Member Avatar for Nidhi G

If you're looking for a single key-press event, my suggestion is to use 'termios', but you'll need to make sure that you import termios before you try to run it. Here's something that I use when waiting for a user to input a single key strong from a menu option: …

Member Avatar for Hummdis
0
320

The End.